summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-03-10 16:55:21 -0500
committerKohei Yoshida <kyoshida@novell.com>2011-03-10 20:21:13 -0500
commit12343c15568dcc2c9209d8ca41fda2263122448f (patch)
tree3212a89c6cd8ea2e0aee7103aa9669bbb8a6f307 /chart2
parent99745dbcbb25b61437914c9782475d0b67a4b0bd (diff)
parentce6308e4fad2281241bf4ca78280eba29f744d43 (diff)
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Diffstat (limited to 'chart2')
-rwxr-xr-x[-rw-r--r--]chart2/inc/pch/precompiled_chart2.hxx2
-rw-r--r--chart2/prj/build.lst4
-rw-r--r--chart2/prj/d.lst4
-rw-r--r--chart2/source/controller/accessibility/AccessibleViewForwarder.cxx2
-rw-r--r--chart2/source/controller/accessibility/AccessibleViewForwarder.hxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/AreaWrapper.cxx27
-rw-r--r--chart2/source/controller/chartapiwrapper/AxisWrapper.cxx135
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/AxisWrapper.hxx17
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx7
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx235
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx32
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx35
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx73
-rw-r--r--chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx260
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx86
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/GridWrapper.cxx38
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/GridWrapper.hxx13
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/LegendWrapper.cxx47
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx114
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx6
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/TitleWrapper.cxx25
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx116
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx5
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx25
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx106
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx3
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx15
-rw-r--r--chart2/source/controller/chartcontroller.component56
-rw-r--r--chart2/source/controller/dialogs/ChartTypeDialogController.cxx2
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx98
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.hxx8
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.cxx25
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.hxx10
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx19
-rw-r--r--chart2/source/controller/dialogs/DialogModel.hxx4
-rw-r--r--chart2/source/controller/dialogs/ObjectNameProvider.cxx11
-rw-r--r--chart2/source/controller/dialogs/Strings.src18
-rw-r--r--chart2/source/controller/dialogs/Strings_Scale.src8
-rw-r--r--chart2/source/controller/dialogs/Strings_Statistic.src12
-rw-r--r--chart2/source/controller/dialogs/TabPages.hrc25
-rw-r--r--chart2/source/controller/dialogs/dlg_ChartType.src2
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard.cxx6
-rw-r--r--chart2/source/controller/dialogs/dlg_DataEditor.cxx18
-rw-r--r--chart2/source/controller/dialogs/dlg_DataEditor.src2
-rw-r--r--chart2/source/controller/dialogs/dlg_DataSource.cxx6
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx4
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertAxis_Grid.src2
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertDataLabel.src2
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx2
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertErrorBars.src1
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertLegend.src2
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertTitle.src2
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertTrendline.src2
-rw-r--r--chart2/source/controller/dialogs/dlg_NumberFormat.cxx2
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx24
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeFont.cxx2
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx2
-rw-r--r--chart2/source/controller/dialogs/dlg_View3D.cxx3
-rw-r--r--chart2/source/controller/dialogs/dlg_View3D.src3
-rw-r--r--chart2/source/controller/dialogs/hidother.src3
-rw-r--r--chart2/source/controller/dialogs/res_BarGeometry.cxx8
-rw-r--r--chart2/source/controller/dialogs/res_BarGeometry.hxx6
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.cxx50
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.hxx10
-rw-r--r--chart2/source/controller/dialogs/res_ErrorBar.cxx40
-rw-r--r--chart2/source/controller/dialogs/res_LegendPosition.cxx95
-rw-r--r--chart2/source/controller/dialogs/res_LegendPosition.hxx5
-rw-r--r--chart2/source/controller/dialogs/res_TextSeparator.cxx9
-rw-r--r--chart2/source/controller/dialogs/res_TextSeparator.hxx4
-rw-r--r--chart2/source/controller/dialogs/res_Titles.cxx2
-rw-r--r--chart2/source/controller/dialogs/res_Trendline.cxx18
-rw-r--r--chart2/source/controller/dialogs/res_Trendline.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx46
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneAppearance.src4
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneGeometry.src9
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx17
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc4
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.src18
-rw-r--r--chart2/source/controller/dialogs/tp_AxisLabel.cxx58
-rw-r--r--chart2/source/controller/dialogs/tp_AxisLabel.hxx8
-rw-r--r--chart2/source/controller/dialogs/tp_AxisLabel.src8
-rw-r--r--chart2/source/controller/dialogs/tp_AxisPositions.cxx56
-rw-r--r--chart2/source/controller/dialogs/tp_AxisPositions.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_AxisPositions.src16
-rw-r--r--chart2/source/controller/dialogs/tp_ChartType.cxx26
-rw-r--r--chart2/source/controller/dialogs/tp_ChartType.src16
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.src4
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.cxx22
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.hxx6
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.src9
-rw-r--r--chart2/source/controller/dialogs/tp_ErrorBars.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_ErrorBars.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_ErrorBars.src1
-rw-r--r--chart2/source/controller/dialogs/tp_LegendPosition.cxx7
-rw-r--r--chart2/source/controller/dialogs/tp_LegendPosition.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_LegendPosition.src1
-rw-r--r--chart2/source/controller/dialogs/tp_PointGeometry.cxx8
-rw-r--r--chart2/source/controller/dialogs/tp_PointGeometry.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_PointGeometry.src1
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.cxx27
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.src4
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.cxx10
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.src7
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.cxx488
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.hrc63
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.hxx33
-rwxr-xr-x[-rw-r--r--]chart2/source/controller/dialogs/tp_Scale.src212
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.cxx68
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.src11
-rw-r--r--chart2/source/controller/dialogs/tp_TitleRotation.cxx8
-rw-r--r--chart2/source/controller/dialogs/tp_TitleRotation.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_Trendline.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_Trendline.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_Trendline.src1
-rw-r--r--chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.src1
-rw-r--r--chart2/source/controller/drawinglayer/DrawViewWrapper.cxx2
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx4
-rw-r--r--chart2/source/controller/inc/AxisItemConverter.hxx17
-rw-r--r--chart2/source/controller/inc/CharacterPropertyItemConverter.hxx6
-rw-r--r--chart2/source/controller/inc/ConfigurationAccess.hxx2
-rw-r--r--chart2/source/controller/inc/DataPointItemConverter.hxx8
-rw-r--r--chart2/source/controller/inc/DrawViewWrapper.hxx8
-rw-r--r--chart2/source/controller/inc/ErrorBarItemConverter.hxx8
-rw-r--r--chart2/source/controller/inc/GraphicPropertyItemConverter.hxx6
-rw-r--r--chart2/source/controller/inc/HelpIds.hrc249
-rw-r--r--chart2/source/controller/inc/ItemConverter.hxx12
-rw-r--r--chart2/source/controller/inc/LegendItemConverter.hxx6
-rw-r--r--chart2/source/controller/inc/MultipleChartConverters.hxx10
-rw-r--r--chart2/source/controller/inc/MultipleItemConverter.hxx2
-rw-r--r--chart2/source/controller/inc/RegressionCurveItemConverter.hxx6
-rw-r--r--chart2/source/controller/inc/RegressionEquationItemConverter.hxx6
-rw-r--r--chart2/source/controller/inc/SeriesOptionsItemConverter.hxx6
-rw-r--r--chart2/source/controller/inc/StatisticsItemConverter.hxx8
-rw-r--r--chart2/source/controller/inc/TitleItemConverter.hxx6
-rw-r--r--chart2/source/controller/inc/dlg_DataEditor.hxx2
-rw-r--r--chart2/source/controller/inc/dlg_DataSource.hxx2
-rw-r--r--chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx2
-rw-r--r--chart2/source/controller/inc/dlg_ObjectProperties.hxx10
-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.hxx2
-rw-r--r--chart2/source/controller/inc/res_ErrorBar.hxx2
-rw-r--r--chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx370
-rw-r--r--chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx6
-rw-r--r--chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx16
-rw-r--r--chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx6
-rw-r--r--chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx12
-rw-r--r--chart2/source/controller/itemsetwrapper/ItemConverter.cxx22
-rw-r--r--chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx137
-rw-r--r--chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx10
-rw-r--r--chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx10
-rw-r--r--chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx6
-rw-r--r--chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx72
-rw-r--r--chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx8
-rw-r--r--chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx8
-rw-r--r--chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx10
-rw-r--r--chart2/source/controller/main/ChartController.cxx80
-rw-r--r--chart2/source/controller/main/ChartController.hxx11
-rw-r--r--chart2/source/controller/main/ChartController_EditData.cxx6
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx198
-rw-r--r--chart2/source/controller/main/ChartController_Position.cxx28
-rw-r--r--chart2/source/controller/main/ChartController_Properties.cxx10
-rw-r--r--chart2/source/controller/main/ChartController_TextEdit.cxx43
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx84
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx195
-rw-r--r--chart2/source/controller/main/ChartDropTargetHelper.cxx77
-rwxr-xr-xchart2/source/controller/main/ChartModelClone.cxx280
-rwxr-xr-xchart2/source/controller/main/ChartModelClone.hxx89
-rw-r--r--chart2/source/controller/main/ChartTransferable.cxx2
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx12
-rw-r--r--chart2/source/controller/main/ChartWindow.hxx6
-rw-r--r--chart2/source/controller/main/CommandDispatchContainer.hxx6
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.cxx10
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.hxx2
-rw-r--r--chart2/source/controller/main/ElementSelector.cxx10
-rw-r--r--chart2/source/controller/main/ImplUndoManager.cxx506
-rw-r--r--chart2/source/controller/main/ImplUndoManager.hxx230
-rw-r--r--chart2/source/controller/main/PositionAndSizeHelper.cxx59
-rw-r--r--chart2/source/controller/main/SelectionHelper.cxx20
-rw-r--r--chart2/source/controller/main/ShapeController.cxx45
-rw-r--r--chart2/source/controller/main/ShapeToolbarController.cxx10
-rw-r--r--chart2/source/controller/main/StatusBarCommandDispatch.cxx3
-rw-r--r--chart2/source/controller/main/UndoActions.cxx178
-rw-r--r--chart2/source/controller/main/UndoActions.hxx134
-rw-r--r--chart2/source/controller/main/UndoCommandDispatch.cxx58
-rw-r--r--chart2/source/controller/main/UndoCommandDispatch.hxx7
-rw-r--r--chart2/source/controller/main/UndoGuard.cxx165
-rw-r--r--chart2/source/controller/main/UndoGuard.hxx137
-rw-r--r--chart2/source/controller/main/UndoManager.cxx441
-rw-r--r--chart2/source/controller/main/_serviceregistration_controller.cxx7
-rw-r--r--chart2/source/controller/main/makefile.mk9
-rw-r--r--chart2/source/controller/makefile.mk11
-rw-r--r--chart2/source/inc/AxisHelper.hxx15
-rw-r--r--chart2/source/inc/ChartModelHelper.hxx1
-rw-r--r--chart2/source/inc/ChartTypeHelper.hxx3
-rw-r--r--chart2/source/inc/CommonFunctors.hxx13
-rw-r--r--chart2/source/inc/DiagramHelper.hxx23
-rw-r--r--chart2/source/inc/ExplicitCategoriesProvider.hxx43
-rw-r--r--chart2/source/inc/InternalData.hxx26
-rw-r--r--chart2/source/inc/InternalDataProvider.hxx30
-rwxr-xr-x[-rw-r--r--]chart2/source/inc/NumberFormatterWrapper.hxx (renamed from chart2/source/inc/chartview/NumberFormatterWrapper.hxx)16
-rw-r--r--chart2/source/inc/OPropertySet.hxx30
-rw-r--r--chart2/source/inc/ReferenceSizeProvider.hxx2
-rw-r--r--chart2/source/inc/RelativePositionHelper.hxx8
-rw-r--r--chart2/source/inc/Strings.hrc15
-rw-r--r--chart2/source/inc/UndoGuard.hxx123
-rw-r--r--chart2/source/inc/UndoManager.hxx183
-rw-r--r--chart2/source/inc/chartview/ChartSfxItemIds.hxx164
-rw-r--r--chart2/source/inc/chartview/ExplicitScaleValues.hxx165
-rw-r--r--chart2/source/inc/chartview/ExplicitValueProvider.hxx11
-rw-r--r--chart2/source/inc/exports.dxp1
-rw-r--r--chart2/source/inc/servicenames.hxx2
-rw-r--r--chart2/source/model/chartmodel.component150
-rw-r--r--chart2/source/model/inc/DataSeries.hxx4
-rw-r--r--chart2/source/model/inc/Diagram.hxx9
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Axis.cxx137
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/BaseCoordinateSystem.cxx94
-rw-r--r--chart2/source/model/main/ChartModel.cxx159
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/ChartModel.hxx41
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/DataPoint.cxx70
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/DataPoint.hxx7
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/DataSeries.cxx110
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Diagram.cxx126
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/FormattedString.cxx95
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/GridProperties.cxx100
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Legend.cxx186
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Legend.hxx19
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/PageBackground.cxx107
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/StockBar.cxx105
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Title.cxx139
-rwxr-xr-xchart2/source/model/main/UndoManager.cxx427
-rwxr-xr-xchart2/source/model/main/UndoManager.hxx109
-rwxr-xr-x[-rw-r--r--]chart2/source/model/main/Wall.cxx107
-rw-r--r--chart2/source/model/main/_serviceregistration_model.cxx10
-rw-r--r--chart2/source/model/main/makefile.mk1
-rw-r--r--chart2/source/model/makefile.mk11
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/AreaChartTypeTemplate.cxx96
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/BarChartTypeTemplate.cxx98
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/BubbleChartType.cxx93
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/BubbleChartTypeTemplate.cxx96
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/BubbleDataInterpreter.cxx43
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/CandleStickChartType.cxx104
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ChartType.cxx55
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ChartTypeTemplate.cxx23
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ColumnChartType.cxx103
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ColumnLineChartTypeTemplate.cxx96
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/DataInterpreter.cxx8
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/DataInterpreter.hxx4
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/LineChartType.cxx104
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/LineChartTypeTemplate.cxx104
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/NetChartType.cxx52
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/PieChartType.cxx96
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/PieChartTypeTemplate.cxx103
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ScatterChartType.cxx104
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/ScatterChartTypeTemplate.cxx104
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/StockChartTypeTemplate.cxx102
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/XYDataInterpreter.cxx31
-rwxr-xr-x[-rw-r--r--]chart2/source/model/template/_serviceregistration_charttypes.cxx0
-rw-r--r--chart2/source/tools/AxisHelper.cxx232
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/CharacterProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ChartModelHelper.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ChartTypeHelper.cxx25
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ChartViewHelper.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ColorPerPointHelper.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/CommonConverters.cxx1
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/DataSourceHelper.cxx18
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/DiagramHelper.cxx218
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ErrorBar.cxx109
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ExplicitCategoriesProvider.cxx246
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/FillProperties.cxx0
-rw-r--r--chart2/source/tools/InternalData.cxx42
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/InternalDataProvider.cxx345
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/LegendHelper.cxx8
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/LineProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/NamedFillProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/NamedLineProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/NamedProperties.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/NumberFormatterWrapper.cxx (renamed from chart2/source/view/main/NumberFormatterWrapper.cxx)23
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ObjectIdentifier.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RegressionCurveCalculator.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RegressionCurveHelper.cxx4
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RegressionCurveModel.cxx93
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RegressionEquation.cxx124
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RelativePositionHelper.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/RelativeSizeHelper.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ResId.cxx2
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/StatisticsHelper.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/ThreeDHelper.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/WrappedIgnoreProperty.cxx0
-rwxr-xr-x[-rw-r--r--]chart2/source/tools/WrappedPropertySet.cxx56
-rw-r--r--chart2/source/tools/_serviceregistration_tools.cxx7
-rw-r--r--chart2/source/tools/charttools.component92
-rw-r--r--chart2/source/tools/makefile.mk9
-rw-r--r--chart2/source/view/axes/DateHelper.cxx132
-rw-r--r--chart2/source/view/axes/DateScaling.cxx216
-rw-r--r--chart2/source/view/axes/DateScaling.hxx114
-rw-r--r--chart2/source/view/axes/MinimumAndMaximumSupplier.cxx21
-rw-r--r--chart2/source/view/axes/ScaleAutomatism.cxx336
-rw-r--r--chart2/source/view/axes/Tickmarks.cxx333
-rw-r--r--chart2/source/view/axes/Tickmarks.hxx166
-rw-r--r--chart2/source/view/axes/Tickmarks_Dates.cxx171
-rw-r--r--chart2/source/view/axes/Tickmarks_Dates.hxx65
-rw-r--r--chart2/source/view/axes/Tickmarks_Equidistant.cxx671
-rw-r--r--chart2/source/view/axes/Tickmarks_Equidistant.hxx (renamed from chart2/source/view/axes/TickmarkHelper.hxx)163
-rw-r--r--chart2/source/view/axes/VAxisBase.cxx26
-rw-r--r--chart2/source/view/axes/VAxisBase.hxx21
-rw-r--r--chart2/source/view/axes/VAxisOrGridBase.cxx17
-rw-r--r--chart2/source/view/axes/VAxisOrGridBase.hxx21
-rw-r--r--chart2/source/view/axes/VAxisProperties.cxx19
-rw-r--r--chart2/source/view/axes/VAxisProperties.hxx1
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx406
-rw-r--r--chart2/source/view/axes/VCartesianAxis.hxx27
-rw-r--r--chart2/source/view/axes/VCartesianCoordinateSystem.cxx12
-rw-r--r--chart2/source/view/axes/VCartesianGrid.cxx13
-rw-r--r--chart2/source/view/axes/VCartesianGrid.hxx2
-rw-r--r--chart2/source/view/axes/VCoordinateSystem.cxx30
-rw-r--r--chart2/source/view/axes/VPolarAngleAxis.cxx21
-rw-r--r--chart2/source/view/axes/VPolarAngleAxis.hxx9
-rw-r--r--chart2/source/view/axes/VPolarAxis.cxx6
-rw-r--r--chart2/source/view/axes/VPolarAxis.hxx8
-rw-r--r--chart2/source/view/axes/VPolarCoordinateSystem.cxx1
-rw-r--r--chart2/source/view/axes/VPolarGrid.cxx81
-rw-r--r--chart2/source/view/axes/VPolarGrid.hxx14
-rw-r--r--chart2/source/view/axes/VPolarRadiusAxis.cxx27
-rw-r--r--chart2/source/view/axes/VPolarRadiusAxis.hxx24
-rw-r--r--chart2/source/view/axes/makefile.mk6
-rw-r--r--chart2/source/view/charttypes/AreaChart.cxx42
-rw-r--r--chart2/source/view/charttypes/AreaChart.hxx15
-rw-r--r--chart2/source/view/charttypes/BarChart.cxx76
-rw-r--r--chart2/source/view/charttypes/BarChart.hxx18
-rw-r--r--chart2/source/view/charttypes/BarPositionHelper.cxx79
-rw-r--r--chart2/source/view/charttypes/BarPositionHelper.hxx19
-rw-r--r--chart2/source/view/charttypes/BubbleChart.cxx6
-rw-r--r--chart2/source/view/charttypes/BubbleChart.hxx8
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.cxx107
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.hxx15
-rw-r--r--chart2/source/view/charttypes/CategoryPositionHelper.cxx17
-rw-r--r--chart2/source/view/charttypes/CategoryPositionHelper.hxx5
-rw-r--r--chart2/source/view/charttypes/PieChart.cxx11
-rw-r--r--chart2/source/view/charttypes/PieChart.hxx18
-rwxr-xr-x[-rw-r--r--]chart2/source/view/charttypes/VSeriesPlotter.cxx360
-rw-r--r--chart2/source/view/chartview.component34
-rw-r--r--chart2/source/view/diagram/VDiagram.cxx5
-rw-r--r--chart2/source/view/inc/DateHelper.hxx63
-rw-r--r--chart2/source/view/inc/LegendEntryProvider.hxx55
-rw-r--r--chart2/source/view/inc/MinimumAndMaximumSupplier.hxx9
-rw-r--r--chart2/source/view/inc/PlotterBase.hxx21
-rw-r--r--chart2/source/view/inc/PlottingPositionHelper.hxx78
-rw-r--r--chart2/source/view/inc/ScaleAutomatism.hxx37
-rw-r--r--chart2/source/view/inc/VCoordinateSystem.hxx27
-rw-r--r--chart2/source/view/inc/VDataSeries.hxx4
-rw-r--r--chart2/source/view/inc/VDiagram.hxx2
-rw-r--r--chart2/source/view/inc/VLegendSymbolFactory.hxx12
-rw-r--r--chart2/source/view/inc/VSeriesPlotter.hxx50
-rw-r--r--chart2/source/view/main/ChartItemPool.cxx104
-rw-r--r--chart2/source/view/main/ChartItemPool.hxx2
-rw-r--r--chart2/source/view/main/ChartView.cxx245
-rw-r--r--chart2/source/view/main/ChartView.hxx4
-rw-r--r--chart2/source/view/main/Clipping.cxx4
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx6
-rw-r--r--chart2/source/view/main/PlotterBase.cxx9
-rw-r--r--chart2/source/view/main/PlottingPositionHelper.cxx81
-rw-r--r--chart2/source/view/main/VDataSeries.cxx16
-rw-r--r--chart2/source/view/main/VLegend.cxx497
-rw-r--r--chart2/source/view/main/VLegend.hxx2
-rw-r--r--chart2/source/view/main/VLegendSymbolFactory.cxx288
-rw-r--r--chart2/source/view/main/VTitle.cxx2
-rw-r--r--chart2/source/view/main/VTitle.hxx2
-rw-r--r--chart2/source/view/main/_serviceregistration_view.cxx7
-rw-r--r--chart2/source/view/main/makefile.mk1
-rw-r--r--chart2/source/view/makefile.mk8
386 files changed, 12357 insertions, 7401 deletions
diff --git a/chart2/inc/pch/precompiled_chart2.hxx b/chart2/inc/pch/precompiled_chart2.hxx
index 2afeb812d101..8fc5070c1af8 100644..100755
--- a/chart2/inc/pch/precompiled_chart2.hxx
+++ b/chart2/inc/pch/precompiled_chart2.hxx
@@ -269,7 +269,7 @@
#include "unotools/configitem.hxx"
#include "unotools/eventlisteneradapter.hxx"
-#include "vcl/fldunit.hxx"
+#include "tools/fldunit.hxx"
#include "osl/mutex.hxx"
//---MARKER---
diff --git a/chart2/prj/build.lst b/chart2/prj/build.lst
index 469eb7554d6b..5b534700a4f0 100644
--- a/chart2/prj/build.lst
+++ b/chart2/prj/build.lst
@@ -1,4 +1,4 @@
-ch chart2 : l10n comphelper cppu cppuhelper sal svtools svx tools vcl toolkit unotools sfx2 NULL
+ch chart2 : offapi offuh L10N:l10n comphelper cppu cppuhelper sal svtools svx tools vcl toolkit unotools sfx2 LIBXSLT:libxslt NULL
ch chart2 usr1 - all ch_mkout NULL
ch chart2\inc nmake - all ch_inc NULL
ch chart2\source\inc get - all ch_source_inc NULL
@@ -24,4 +24,4 @@ ch chart2\source\controller\chartapiwrapper nmake - all ch_source_controlle
ch chart2\source\controller\main nmake - all ch_source_controller_main ch_inc NULL
ch chart2\source\controller\menus nmake - all ch_source_controller_menus ch_inc NULL
ch chart2\prj get - all ch_prj NULL
-ch chart2\qa\unoapi nmake - all ch_qa_unoapi NULL
+ch chart2\qa\unoapi nmake - all ch_qa_unoapi NULL
diff --git a/chart2/prj/d.lst b/chart2/prj/d.lst
index 440e2efbe8c5..bf1085336c05 100644
--- a/chart2/prj/d.lst
+++ b/chart2/prj/d.lst
@@ -21,3 +21,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\schart\statusbar
..\uiconfig\statusbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\schart\statusbar\*.xml
mkdir: %_DEST%\inc%_EXT%\chart2
+..\%__SRC%\misc\chartcontroller.component %_DEST%\xml%_EXT%\chartcontroller.component
+..\%__SRC%\misc\chartmodel.component %_DEST%\xml%_EXT%\chartmodel.component
+..\%__SRC%\misc\charttools.component %_DEST%\xml%_EXT%\charttools.component
+..\%__SRC%\misc\chartview.component %_DEST%\xml%_EXT%\chartview.component
diff --git a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
index 38108fced14b..67fa0d2ece5d 100644
--- a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
+++ b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx
@@ -53,7 +53,7 @@ AccessibleViewForwarder::~AccessibleViewForwarder()
// ________ IAccessibleViewforwarder ________
-BOOL AccessibleViewForwarder::IsValid() const
+sal_Bool AccessibleViewForwarder::IsValid() const
{
return sal_True;
}
diff --git a/chart2/source/controller/accessibility/AccessibleViewForwarder.hxx b/chart2/source/controller/accessibility/AccessibleViewForwarder.hxx
index 5437541851d1..98c58a00a444 100644
--- a/chart2/source/controller/accessibility/AccessibleViewForwarder.hxx
+++ b/chart2/source/controller/accessibility/AccessibleViewForwarder.hxx
@@ -45,7 +45,7 @@ public:
virtual ~AccessibleViewForwarder();
// ________ IAccessibleViewforwarder ________
- virtual BOOL IsValid() const;
+ virtual sal_Bool IsValid() const;
virtual Rectangle GetVisibleArea() const;
virtual Point LogicToPixel( const Point& rPoint ) const;
virtual Size LogicToPixel( const Size& rSize ) const;
diff --git a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
index 82954b939226..69bb32633dcf 100644..100755
--- a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
@@ -58,29 +58,34 @@ namespace
static const ::rtl::OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.Area" ));
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticAreaWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
+
+struct StaticAreaWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticAreaWrapperPropertyArray_Initializer >
+{
+};
+
- return aPropSeq;
-}
} // anonymous namespace
// --------------------------------------------------------------------------------
@@ -172,7 +177,7 @@ Reference< beans::XPropertySet > AreaWrapper::getInnerPropertySet()
const Sequence< beans::Property >& AreaWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticAreaWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > AreaWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 5dbefe7cded9..5903df8cf183 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -30,10 +30,15 @@
#include "precompiled_chart2.hxx"
#include "AxisWrapper.hxx"
#include "AxisHelper.hxx"
+#include "TitleHelper.hxx"
#include "Chart2ModelContact.hxx"
#include "ContainerHelper.hxx"
#include "macros.hxx"
#include "WrappedDirectStateProperty.hxx"
+#include "GridWrapper.hxx"
+#include "TitleWrapper.hxx"
+#include "DisposeHelper.hxx"
+
#include <comphelper/InlineContainer.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
@@ -83,6 +88,9 @@ enum
PROP_AXIS_AUTO_MIN,
PROP_AXIS_AUTO_STEPMAIN,
PROP_AXIS_AUTO_STEPHELP,
+ PROP_AXIS_TYPE,
+ PROP_AXIS_TIME_INCREMENT,
+ PROP_AXIS_EXPLICIT_TIME_INCREMENT,
PROP_AXIS_LOGARITHMIC,
PROP_AXIS_REVERSEDIRECTION,
PROP_AXIS_VISIBLE,
@@ -175,6 +183,27 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
+ Property( C2U( "AxisType" ),
+ PROP_AXIS_TYPE,
+ ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), //type com::sun::star::chart::ChartAxisType
+ //#i111967# no PropertyChangeEvent is fired on change so far
+ beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( C2U( "TimeIncrement" ),
+ PROP_AXIS_TIME_INCREMENT,
+ ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::TimeIncrement * >(0)),
+ //#i111967# no PropertyChangeEvent is fired on change so far
+ beans::PropertyAttribute::MAYBEVOID ));
+
+ rOutProperties.push_back(
+ Property( C2U( "ExplicitTimeIncrement" ),
+ PROP_AXIS_EXPLICIT_TIME_INCREMENT,
+ ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::TimeIncrement * >(0)),
+ beans::PropertyAttribute::READONLY |
+ beans::PropertyAttribute::MAYBEVOID ));
+
+ rOutProperties.push_back(
Property( C2U( "Logarithmic" ),
PROP_AXIS_LOGARITHMIC,
::getBooleanCppuType(),
@@ -324,14 +353,17 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticAxisWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
@@ -339,16 +371,16 @@ const Sequence< Property > & lcl_GetPropertySequence()
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticAxisWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticAxisWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -371,6 +403,83 @@ AxisWrapper::~AxisWrapper()
{
}
+// ____ chart::XAxis ____
+Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getAxisTitle() throw (uno::RuntimeException)
+{
+ if( !m_xAxisTitle.is() )
+ {
+ TitleHelper::eTitleType eTitleType( TitleHelper::X_AXIS_TITLE );
+ switch( m_eType )
+ {
+ case X_AXIS:
+ eTitleType = TitleHelper::X_AXIS_TITLE;
+ break;
+ case Y_AXIS:
+ eTitleType = TitleHelper::Y_AXIS_TITLE;
+ break;
+ case Z_AXIS:
+ eTitleType = TitleHelper::Z_AXIS_TITLE;
+ break;
+ case SECOND_X_AXIS:
+ eTitleType = TitleHelper::SECONDARY_X_AXIS_TITLE;
+ break;
+ case SECOND_Y_AXIS:
+ eTitleType = TitleHelper::SECONDARY_Y_AXIS_TITLE;
+ break;
+ default:
+ return 0;
+ }
+ m_xAxisTitle = new TitleWrapper( eTitleType, m_spChart2ModelContact );
+ }
+ return m_xAxisTitle;
+}
+Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getMajorGrid() throw (uno::RuntimeException)
+{
+ if( !m_xMajorGrid.is() )
+ {
+ GridWrapper::tGridType eGridType( GridWrapper::X_MAJOR_GRID );
+ switch( m_eType )
+ {
+ case X_AXIS:
+ eGridType = GridWrapper::X_MAJOR_GRID;
+ break;
+ case Y_AXIS:
+ eGridType = GridWrapper::Y_MAJOR_GRID;
+ break;
+ case Z_AXIS:
+ eGridType = GridWrapper::Z_MAJOR_GRID;
+ break;
+ default:
+ return 0;
+ }
+ m_xMajorGrid = new GridWrapper( eGridType, m_spChart2ModelContact );
+ }
+ return m_xMajorGrid;
+}
+Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getMinorGrid() throw (uno::RuntimeException)
+{
+ if( !m_xMinorGrid.is() )
+ {
+ GridWrapper::tGridType eGridType( GridWrapper::X_MAJOR_GRID );
+ switch( m_eType )
+ {
+ case X_AXIS:
+ eGridType = GridWrapper::X_MINOR_GRID;
+ break;
+ case Y_AXIS:
+ eGridType = GridWrapper::Y_MINOR_GRID;
+ break;
+ case Z_AXIS:
+ eGridType = GridWrapper::Z_MINOR_GRID;
+ break;
+ default:
+ return 0;
+ }
+ m_xMinorGrid = new GridWrapper( eGridType, m_spChart2ModelContact );
+ }
+ return m_xMinorGrid;
+}
+
// ____ XShape ____
awt::Point SAL_CALL AxisWrapper::getPosition()
throw (uno::RuntimeException)
@@ -451,6 +560,10 @@ void SAL_CALL AxisWrapper::dispose()
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
+ DisposeHelper::DisposeAndClear( m_xAxisTitle );
+ DisposeHelper::DisposeAndClear( m_xMajorGrid );
+ DisposeHelper::DisposeAndClear( m_xMinorGrid );
+
clearWrappedPropertySet();
}
@@ -530,7 +643,7 @@ Reference< beans::XPropertySet > AxisWrapper::getInnerPropertySet()
const Sequence< beans::Property >& AxisWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticAxisWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > AxisWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
index 8ff813f42c4b..d55db6e0f34c 100644..100755
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx
@@ -31,9 +31,10 @@
#include "WrappedPropertySet.hxx"
#include "ReferenceSizePropertyProvider.hxx"
#include "ServiceMacros.hxx"
-#include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/implbase5.hxx>
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
+#include <com/sun/star/chart/XAxis.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/drawing/XShape.hpp>
@@ -46,14 +47,13 @@
namespace chart
{
-
namespace wrapper
{
-
class Chart2ModelContact;
-class AxisWrapper : public ::cppu::ImplInheritanceHelper4<
+class AxisWrapper : public ::cppu::ImplInheritanceHelper5<
WrappedPropertySet
+ , com::sun::star::chart::XAxis
, com::sun::star::drawing::XShape
, com::sun::star::lang::XComponent
, com::sun::star::lang::XServiceInfo
@@ -94,6 +94,11 @@ public:
::com::sun::star::lang::XEventListener >& aListener )
throw (::com::sun::star::uno::RuntimeException);
+ // ____ chart::XAxis ____
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getAxisTitle( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getMajorGrid( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getMinorGrid( ) throw (::com::sun::star::uno::RuntimeException);
+
// ____ XShape ____
virtual ::com::sun::star::awt::Point SAL_CALL getPosition()
throw (::com::sun::star::uno::RuntimeException);
@@ -132,6 +137,10 @@ private: //member
tAxisType m_eType;
::com::sun::star::uno::Any m_aTemporaryHelpStepValue;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xAxisTitle;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xMajorGrid;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xMinorGrid;
};
} // namespace wrapper
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
index 6b60c3010990..26d1d5af76a7 100644..100755
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
@@ -28,8 +28,7 @@
#ifndef CHART_CHART2MODELCONTACT_HXX
#define CHART_CHART2MODELCONTACT_HXX
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
+#include <chartview/ExplicitScaleValues.hxx>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
@@ -80,8 +79,8 @@ public:
sal_Bool getExplicitValuesForAxis(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XAxis > & xAxis,
- ::com::sun::star::chart2::ExplicitScaleData & rOutExplicitScale,
- ::com::sun::star::chart2::ExplicitIncrementData & rOutExplicitIncrement );
+ ExplicitScaleData & rOutExplicitScale,
+ ExplicitIncrementData & rOutExplicitIncrement );
sal_Int32 getExplicitNumberFormatKeyForAxis(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis );
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
index bf1b879334b2..aec879688e1e 100644..100755
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
@@ -65,9 +65,11 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
using ::osl::MutexGuard;
+using ::com::sun::star::chart2::XAnyDescriptionAccess;
using ::com::sun::star::chart::XComplexDescriptionAccess;
using ::com::sun::star::chart::XChartData;
using ::com::sun::star::chart::XChartDataArray;
+using ::com::sun::star::chart::XDateCategories;
namespace
{
@@ -133,7 +135,7 @@ struct lcl_Operator
virtual ~lcl_Operator()
{
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess ) = 0;
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) = 0;
virtual bool setsCategories( bool /*bDataInColumns*/ )
{
@@ -156,13 +158,20 @@ struct lcl_AllOperator : public lcl_Operator
return true;
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( !xDataAccess.is() )
return;
+ Reference< XAnyDescriptionAccess > xNewAny( m_xDataToApply, uno::UNO_QUERY );
Reference< XComplexDescriptionAccess > xNewComplex( m_xDataToApply, uno::UNO_QUERY );
- if( xNewComplex.is() )
+ if( xNewAny.is() )
+ {
+ xDataAccess->setData( xNewAny->getData() );
+ xDataAccess->setComplexRowDescriptions( xNewAny->getComplexRowDescriptions() );
+ xDataAccess->setComplexColumnDescriptions( xNewAny->getComplexColumnDescriptions() );
+ }
+ else if( xNewComplex.is() )
{
xDataAccess->setData( xNewComplex->getData() );
xDataAccess->setComplexRowDescriptions( xNewComplex->getComplexRowDescriptions() );
@@ -193,7 +202,7 @@ struct lcl_DataOperator : public lcl_Operator
{
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( xDataAccess.is() )
xDataAccess->setData( lcl_getNANInsteadDBL_MIN( m_rData ) );
@@ -206,96 +215,208 @@ struct lcl_DataOperator : public lcl_Operator
struct lcl_RowDescriptionsOperator : public lcl_Operator
{
- lcl_RowDescriptionsOperator( const Sequence< OUString >& rRowDescriptions )
+ lcl_RowDescriptionsOperator( const Sequence< OUString >& rRowDescriptions
+ , const Reference< chart2::XChartDocument >& xChartDoc )
: lcl_Operator()
, m_rRowDescriptions( rRowDescriptions )
+ , m_xChartDoc(xChartDoc)
+ , m_bDataInColumns(true)
{
}
virtual bool setsCategories( bool bDataInColumns )
{
+ m_bDataInColumns = bDataInColumns;
return bDataInColumns;
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( xDataAccess.is() )
+ {
xDataAccess->setRowDescriptions( m_rRowDescriptions );
+ if( m_bDataInColumns )
+ DiagramHelper::switchToTextCategories( m_xChartDoc );
+ }
}
const Sequence< OUString >& m_rRowDescriptions;
+ Reference< chart2::XChartDocument > m_xChartDoc;
+ bool m_bDataInColumns;
};
//--------------------------------------------------------------------------
struct lcl_ComplexRowDescriptionsOperator : public lcl_Operator
{
- lcl_ComplexRowDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexRowDescriptions )
+ lcl_ComplexRowDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexRowDescriptions
+ , const Reference< chart2::XChartDocument >& xChartDoc )
: lcl_Operator()
, m_rComplexRowDescriptions( rComplexRowDescriptions )
+ , m_xChartDoc(xChartDoc)
+ , m_bDataInColumns(true)
{
}
virtual bool setsCategories( bool bDataInColumns )
{
- return !bDataInColumns;
+ m_bDataInColumns = bDataInColumns;
+ return bDataInColumns;
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( xDataAccess.is() )
+ {
xDataAccess->setComplexRowDescriptions( m_rComplexRowDescriptions );
+ if( m_bDataInColumns )
+ DiagramHelper::switchToTextCategories( m_xChartDoc );
+ }
}
const Sequence< Sequence< OUString > >& m_rComplexRowDescriptions;
+ Reference< chart2::XChartDocument > m_xChartDoc;
+ bool m_bDataInColumns;
+};
+//--------------------------------------------------------------------------
+
+struct lcl_AnyRowDescriptionsOperator : public lcl_Operator
+{
+ lcl_AnyRowDescriptionsOperator( const Sequence< Sequence< uno::Any > >& rAnyRowDescriptions )
+ : lcl_Operator()
+ , m_rAnyRowDescriptions( rAnyRowDescriptions )
+ {
+ }
+
+ virtual bool setsCategories( bool bDataInColumns )
+ {
+ return bDataInColumns;
+ }
+
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
+ {
+ if( xDataAccess.is() )
+ xDataAccess->setAnyRowDescriptions( m_rAnyRowDescriptions );
+ }
+
+ const Sequence< Sequence< uno::Any > >& m_rAnyRowDescriptions;
};
//--------------------------------------------------------------------------
struct lcl_ColumnDescriptionsOperator : public lcl_Operator
{
- lcl_ColumnDescriptionsOperator( const Sequence< OUString >& rColumnDescriptions )
+ lcl_ColumnDescriptionsOperator( const Sequence< OUString >& rColumnDescriptions
+ , const Reference< chart2::XChartDocument >& xChartDoc )
: lcl_Operator()
, m_rColumnDescriptions( rColumnDescriptions )
+ , m_xChartDoc(xChartDoc)
+ , m_bDataInColumns(true)
{
}
virtual bool setsCategories( bool bDataInColumns )
{
+ m_bDataInColumns = bDataInColumns;
return !bDataInColumns;
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( xDataAccess.is() )
+ {
xDataAccess->setColumnDescriptions( m_rColumnDescriptions );
+ if( !m_bDataInColumns )
+ DiagramHelper::switchToTextCategories( m_xChartDoc );
+ }
}
const Sequence< OUString >& m_rColumnDescriptions;
+ Reference< chart2::XChartDocument > m_xChartDoc;
+ bool m_bDataInColumns;
};
//--------------------------------------------------------------------------
struct lcl_ComplexColumnDescriptionsOperator : public lcl_Operator
{
- lcl_ComplexColumnDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexColumnDescriptions )
+ lcl_ComplexColumnDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexColumnDescriptions
+ , const Reference< chart2::XChartDocument >& xChartDoc )
: lcl_Operator()
, m_rComplexColumnDescriptions( rComplexColumnDescriptions )
+ , m_xChartDoc(xChartDoc)
+ , m_bDataInColumns(true)
{
}
virtual bool setsCategories( bool bDataInColumns )
{
+ m_bDataInColumns = bDataInColumns;
return !bDataInColumns;
}
- virtual void apply( const Reference< XComplexDescriptionAccess >& xDataAccess )
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
{
if( xDataAccess.is() )
+ {
xDataAccess->setComplexColumnDescriptions( m_rComplexColumnDescriptions );
+ if( !m_bDataInColumns )
+ DiagramHelper::switchToTextCategories( m_xChartDoc );
+ }
}
const Sequence< Sequence< OUString > >& m_rComplexColumnDescriptions;
+ Reference< chart2::XChartDocument > m_xChartDoc;
+ bool m_bDataInColumns;
+};
+
+//--------------------------------------------------------------------------
+
+struct lcl_AnyColumnDescriptionsOperator : public lcl_Operator
+{
+ lcl_AnyColumnDescriptionsOperator( const Sequence< Sequence< uno::Any > >& rAnyColumnDescriptions )
+ : lcl_Operator()
+ , m_rAnyColumnDescriptions( rAnyColumnDescriptions )
+ {
+ }
+
+ virtual bool setsCategories( bool bDataInColumns )
+ {
+ return bDataInColumns;
+ }
+
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
+ {
+ if( xDataAccess.is() )
+ xDataAccess->setAnyColumnDescriptions( m_rAnyColumnDescriptions );
+ }
+
+ const Sequence< Sequence< uno::Any > >& m_rAnyColumnDescriptions;
+};
+
+//--------------------------------------------------------------------------
+
+struct lcl_DateCategoriesOperator : public lcl_Operator
+{
+ lcl_DateCategoriesOperator( const Sequence< double >& rDates )
+ : lcl_Operator()
+ , m_rDates( rDates )
+ {
+ }
+
+ virtual bool setsCategories( bool /*bDataInColumns*/ )
+ {
+ return true;
+ }
+
+ virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess )
+ {
+ Reference< XDateCategories > xDateCategories( xDataAccess, uno::UNO_QUERY );
+ if( xDateCategories.is() )
+ xDateCategories->setDateCategories( m_rDates );
+ }
+
+ const Sequence< double >& m_rDates;
};
//--------------------------------------------------------------------------
@@ -354,6 +475,7 @@ Sequence< OUString > SAL_CALL ChartDataWrapper::getColumnDescriptions()
return m_xDataAccess->getColumnDescriptions();
return Sequence< OUString > ();
}
+
// ____ XComplexDescriptionAccess (read) ____
Sequence< Sequence< OUString > > SAL_CALL ChartDataWrapper::getComplexRowDescriptions() throw (uno::RuntimeException)
{
@@ -370,6 +492,32 @@ Sequence< Sequence< OUString > > SAL_CALL ChartDataWrapper::getComplexColumnDesc
return Sequence< Sequence< OUString > >();
}
+// ____ XAnyDescriptionAccess (read) ____
+Sequence< Sequence< uno::Any > > SAL_CALL ChartDataWrapper::getAnyRowDescriptions() throw (uno::RuntimeException)
+{
+ initDataAccess();
+ if( m_xDataAccess.is() )
+ return m_xDataAccess->getAnyRowDescriptions();
+ return Sequence< Sequence< uno::Any > >();
+}
+Sequence< Sequence< uno::Any > > SAL_CALL ChartDataWrapper::getAnyColumnDescriptions() throw (uno::RuntimeException)
+{
+ initDataAccess();
+ if( m_xDataAccess.is() )
+ return m_xDataAccess->getAnyColumnDescriptions();
+ return Sequence< Sequence< uno::Any > >();
+}
+
+// ____ XDateCategories (read) ____
+Sequence< double > SAL_CALL ChartDataWrapper::getDateCategories() throw (uno::RuntimeException)
+{
+ initDataAccess();
+ Reference< XDateCategories > xDateCategories( m_xDataAccess, uno::UNO_QUERY );
+ if( xDateCategories.is() )
+ return xDateCategories->getDateCategories();
+ return Sequence< double >();
+}
+
// ____ XChartDataArray (write)____
void SAL_CALL ChartDataWrapper::setData( const Sequence< Sequence< double > >& rData )
throw (uno::RuntimeException)
@@ -380,28 +528,50 @@ void SAL_CALL ChartDataWrapper::setData( const Sequence< Sequence< double > >& r
void SAL_CALL ChartDataWrapper::setRowDescriptions( const Sequence< OUString >& rRowDescriptions )
throw (uno::RuntimeException)
{
- lcl_RowDescriptionsOperator aOperator( rRowDescriptions );
+ lcl_RowDescriptionsOperator aOperator( rRowDescriptions, m_spChart2ModelContact->getChart2Document() );
applyData( aOperator );
}
void SAL_CALL ChartDataWrapper::setColumnDescriptions( const Sequence< OUString >& rColumnDescriptions )
throw (uno::RuntimeException)
{
- lcl_ColumnDescriptionsOperator aOperator( rColumnDescriptions );
+ lcl_ColumnDescriptionsOperator aOperator( rColumnDescriptions, m_spChart2ModelContact->getChart2Document() );
applyData( aOperator );
}
// ____ XComplexDescriptionAccess (write) ____
void SAL_CALL ChartDataWrapper::setComplexRowDescriptions( const Sequence< Sequence< ::rtl::OUString > >& rRowDescriptions ) throw (uno::RuntimeException)
{
- lcl_ComplexRowDescriptionsOperator aOperator( rRowDescriptions );
+ lcl_ComplexRowDescriptionsOperator aOperator( rRowDescriptions, m_spChart2ModelContact->getChart2Document() );
applyData( aOperator );
}
void SAL_CALL ChartDataWrapper::setComplexColumnDescriptions( const Sequence< Sequence< ::rtl::OUString > >& rColumnDescriptions ) throw (uno::RuntimeException)
{
- lcl_ComplexColumnDescriptionsOperator aOperator( rColumnDescriptions );
+ lcl_ComplexColumnDescriptionsOperator aOperator( rColumnDescriptions, m_spChart2ModelContact->getChart2Document() );
+ applyData( aOperator );
+}
+
+// ____ XAnyDescriptionAccess (write) ____
+void SAL_CALL ChartDataWrapper::setAnyRowDescriptions( const Sequence< Sequence< uno::Any > >& rRowDescriptions ) throw (uno::RuntimeException)
+{
+ lcl_AnyRowDescriptionsOperator aOperator( rRowDescriptions );
+ applyData( aOperator );
+}
+void SAL_CALL ChartDataWrapper::setAnyColumnDescriptions( const Sequence< Sequence< uno::Any > >& rColumnDescriptions ) throw (uno::RuntimeException)
+{
+ lcl_AnyColumnDescriptionsOperator aOperator( rColumnDescriptions );
applyData( aOperator );
}
+// ____ XDateCategories (write) ____
+void SAL_CALL ChartDataWrapper::setDateCategories( const Sequence< double >& rDates ) throw (uno::RuntimeException)
+{
+ Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
+ ControllerLockGuard aCtrlLockGuard( uno::Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
+ lcl_DateCategoriesOperator aOperator( rDates );
+ applyData( aOperator );
+ DiagramHelper::switchToDateCategories( xChartDoc );
+}
+
//--------------------------------------------------------------------------------------
// ____ XChartData (base of XChartDataArray) ____
@@ -504,11 +674,11 @@ void ChartDataWrapper::initDataAccess()
if( !xChartDoc.is() )
return;
if( xChartDoc->hasInternalDataProvider() )
- m_xDataAccess = Reference< XComplexDescriptionAccess >( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
+ m_xDataAccess = Reference< XAnyDescriptionAccess >( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
else
{
//create a separate "internal data provider" that is not connected to the model
- m_xDataAccess = Reference< XComplexDescriptionAccess >( ChartModelHelper::createInternalDataProvider(
+ m_xDataAccess = Reference< XAnyDescriptionAccess >( ChartModelHelper::createInternalDataProvider(
xChartDoc, false /*bConnectToModel*/ ), uno::UNO_QUERY_THROW );
}
}
@@ -565,30 +735,9 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
return;
uno::Reference< chart2::data::XDataSource > xSource( xDataProvider->createDataSource( aArguments ) );
- // determine a template
- uno::Reference< lang::XMultiServiceFactory > xFact( xChartDoc->getChartTypeManager(), uno::UNO_QUERY );
- uno::Reference< chart2::XDiagram > xDia( xChartDoc->getFirstDiagram());
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDia, xFact );
- ::rtl::OUString aServiceName( aTemplateAndService.second );
- uno::Reference< chart2::XChartTypeTemplate > xTemplate = aTemplateAndService.first;
-
- // (fall-back)
- if( ! xTemplate.is())
- {
- if( aServiceName.getLength() == 0 )
- aServiceName = C2U("com.sun.star.chart2.template.Column");
- xTemplate.set( xFact->createInstance( aServiceName ), uno::UNO_QUERY );
- }
- OSL_ASSERT( xTemplate.is());
-
- if( xTemplate.is() && xSource.is())
- {
- // argument detection works with internal knowledge of the
- // ArrayDataProvider
- OSL_ASSERT( xDia.is());
- xTemplate->changeDiagramData( xDia, xSource, aArguments );
- }
+ uno::Reference< chart2::XDiagram > xDia( xChartDoc->getFirstDiagram() );
+ if( xDia.is() )
+ xDia->setDiagramData( xSource, aArguments );
//correct stacking mode
if( bStacked || bPercent || bDeep )
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
index de3ed722de60..ac28d23cfb41 100644..100755
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx
@@ -30,9 +30,10 @@
#include "ServiceMacros.hxx"
#include "MutexContainer.hxx"
-#include <cppuhelper/implbase4.hxx>
+#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/interfacecontainer.hxx>
-#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
+#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
+#include <com/sun/star/chart/XDateCategories.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -49,8 +50,9 @@ class Chart2ModelContact;
struct lcl_Operator;
class ChartDataWrapper : public MutexContainer, public
- ::cppu::WeakImplHelper4<
- com::sun::star::chart::XComplexDescriptionAccess,
+ ::cppu::WeakImplHelper5<
+ com::sun::star::chart2::XAnyDescriptionAccess,
+ com::sun::star::chart::XDateCategories,
com::sun::star::lang::XServiceInfo,
com::sun::star::lang::XEventListener,
com::sun::star::lang::XComponent >
@@ -65,7 +67,25 @@ public:
APPHELPER_XSERVICEINFO_DECL()
protected:
- // ____ XComplexDescriptionAccess ____
+ // ____ XDateCategories ____
+ virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getDateCategories() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDateCategories( const ::com::sun::star::uno::Sequence< double >& rDates ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XAnyDescriptionAccess ____
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL
+ getAnyRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAnyRowDescriptions(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aRowDescriptions )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL
+ getAnyColumnDescriptions() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAnyColumnDescriptions(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aColumnDescriptions )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XComplexDescriptionAccess (base of XAnyDescriptionAccess) ____
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL
getComplexRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setComplexRowDescriptions(
@@ -137,7 +157,7 @@ private: //methods
private: //member
::com::sun::star::uno::Reference<
- ::com::sun::star::chart::XComplexDescriptionAccess > m_xDataAccess;
+ ::com::sun::star::chart2::XAnyDescriptionAccess > m_xDataAccess;
::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index e61821a117f5..baca5d41cf27 100644..100755
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -57,11 +57,9 @@
#include "WrappedAddInProperty.hxx"
#include "WrappedIgnoreProperty.hxx"
#include "ChartRenderer.hxx"
-#include "UndoManager.hxx"
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
-#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
#include <comphelper/InlineContainer.hxx>
// header for function SvxShapeCollection_NewInstance
#include <svx/unoshcol.hxx>
@@ -83,8 +81,8 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart;
-using ::com::sun::star::chart::XComplexDescriptionAccess;
using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::beans::Property;
@@ -251,27 +249,30 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT ) );
}
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticChartDocumentWrapperPropertyArray_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticChartDocumentWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticChartDocumentWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -1401,12 +1402,6 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
xResult.set( m_xChartView );
bServiceFound = true;
}
- else if ( aServiceSpecifier.equals( CHART_UNDOMANAGER_SERVICE_NAME ) )
- {
- Reference< chart2::XUndoManager > xUndoManager( new UndoManager() );
- xResult.set( xUndoManager );
- bServiceFound = true;
- }
else
{
// try to create a shape
@@ -1559,7 +1554,7 @@ Reference< beans::XPropertySet > ChartDocumentWrapper::getInnerPropertySet()
}
const Sequence< beans::Property >& ChartDocumentWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticChartDocumentWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > ChartDocumentWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index 39b2a0ef9b77..1dd3a94ff833 100644..100755
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -174,43 +174,55 @@ void lcl_AddPropertiesToVector_SeriesOnly(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const uno::Sequence< Property > & lcl_GetPropertySequence( DataSeriesPointWrapper::eType _eType )
+uno::Sequence< Property > lcl_GetPropertySequence( DataSeriesPointWrapper::eType _eType )
{
- static uno::Sequence< Property > aSeriesPropSeq;
- static uno::Sequence< Property > aPointPropSeq;
+ ::std::vector< ::com::sun::star::beans::Property > aProperties;
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- uno::Sequence< Property >& rPropSeq =
- (_eType == DataSeriesPointWrapper::DATA_SERIES) ? aSeriesPropSeq : aPointPropSeq;
- if( 0 == rPropSeq.getLength() )
+ lcl_AddPropertiesToVector_PointProperties( aProperties );
+ if( _eType == DataSeriesPointWrapper::DATA_SERIES )
{
- // get properties
- ::std::vector< ::com::sun::star::beans::Property > aProperties;
+ lcl_AddPropertiesToVector_SeriesOnly( aProperties );
+ WrappedStatisticProperties::addProperties( aProperties );
+ }
+ WrappedSymbolProperties::addProperties( aProperties ); //for series and points
+ WrappedDataCaptionProperties::addProperties( aProperties ); //for series and points
- lcl_AddPropertiesToVector_PointProperties( aProperties );
- if( _eType == DataSeriesPointWrapper::DATA_SERIES )
- {
- lcl_AddPropertiesToVector_SeriesOnly( aProperties );
- WrappedStatisticProperties::addProperties( aProperties );
- }
- WrappedSymbolProperties::addProperties( aProperties ); //for series and points
- WrappedDataCaptionProperties::addProperties( aProperties ); //for series and points
+ ::chart::FillProperties::AddPropertiesToVector( aProperties );
+ ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
+ ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
+ ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
- ::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
- ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
+ ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() );
- // and sort them for access via bsearch
- ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
+}
- // transfer result to static Sequence
- rPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+struct StaticSeriesWrapperPropertyArray_Initializer
+{
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence( DataSeriesPointWrapper::DATA_SERIES ) );
+ return &aPropSeq;
}
+};
- return rPropSeq;
-}
+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 >
+{
+};
//----------------------------------------------------------------------------------------------------------------------
@@ -702,7 +714,10 @@ Reference< beans::XPropertySet > DataSeriesPointWrapper::getInnerPropertySet()
const Sequence< beans::Property >& DataSeriesPointWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence( m_eType );
+ if( m_eType == DATA_SERIES )
+ return *StaticSeriesWrapperPropertyArray::get();
+ else
+ return *StaticPointWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > DataSeriesPointWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index 4819f51d1713..07ca51845cb0 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -31,14 +31,11 @@
#include "DiagramWrapper.hxx"
#include "macros.hxx"
#include "servicenames_charttypes.hxx"
-#include "TitleWrapper.hxx"
#include "DataSeriesPointWrapper.hxx"
#include "AxisWrapper.hxx"
#include "AxisHelper.hxx"
#include "Chart2ModelContact.hxx"
#include "PositionAndSizeHelper.hxx"
-#include "TitleHelper.hxx"
-#include "GridWrapper.hxx"
#include "WallFloorWrapper.hxx"
#include "MinMaxLineWrapper.hxx"
#include "UpDownBarWrapper.hxx"
@@ -89,6 +86,7 @@ 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;
using ::rtl::OUString;
@@ -435,14 +433,17 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticDiagramWrapperPropertyArray_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
@@ -456,16 +457,16 @@ const uno::Sequence< Property > & lcl_GetPropertySequence()
WrappedStockProperties::addProperties( aProperties );
WrappedAutomaticPositionProperties::addProperties( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticDiagramWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticDiagramWrapperPropertyArray_Initializer >
+{
+};
bool lcl_isXYChart( const Reference< chart2::XDiagram > xDiagram )
{
@@ -883,193 +884,209 @@ void SAL_CALL DiagramWrapper::setDiagramPositionIncludingAxesAndAxisTitles( cons
return m_spChart2ModelContact->GetDiagramRectangleIncludingTitle();
}
-// ____ XAxisZSupplier ____
-Reference<
- drawing::XShape > SAL_CALL DiagramWrapper::getZAxisTitle()
+// ____ XAxisSupplier ____
+Reference< XAxis > SAL_CALL DiagramWrapper::getAxis( sal_Int32 nDimensionIndex )
throw (uno::RuntimeException)
{
- if( !m_xZAxisTitle.is() )
+ Reference< XAxis > xAxis;
+ if(!nDimensionIndex)
+ {
+ if( !m_xXAxis.is() )
+ m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact );
+ xAxis = m_xXAxis;
+ }
+ else if(1==nDimensionIndex)
{
- m_xZAxisTitle = new TitleWrapper( TitleHelper::Z_AXIS_TITLE, m_spChart2ModelContact );
+ if( !m_xYAxis.is() )
+ m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact );
+ xAxis = m_xYAxis;
}
- return m_xZAxisTitle;
+ else if(2==nDimensionIndex)
+ {
+ if( !m_xZAxis.is() )
+ m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact );
+ xAxis = m_xZAxis;
+ }
+ return xAxis;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getZMainGrid()
+Reference< XAxis > SAL_CALL DiagramWrapper::getSecondaryAxis( sal_Int32 nDimensionIndex )
throw (uno::RuntimeException)
{
- if( ! m_xZMainGrid.is())
+ Reference< XAxis > xAxis;
+ if(!nDimensionIndex)
+ {
+ if( !m_xSecondXAxis.is() )
+ m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact );
+ xAxis = m_xSecondXAxis;
+ }
+ else if(1==nDimensionIndex)
{
- m_xZMainGrid = new GridWrapper( GridWrapper::Z_MAIN_GRID, m_spChart2ModelContact );
+ if( !m_xSecondYAxis.is() )
+ m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact );
+ xAxis = m_xSecondYAxis;
}
- return m_xZMainGrid;
+ return xAxis;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getZHelpGrid()
+// ____ XAxisZSupplier ____
+Reference< drawing::XShape > SAL_CALL DiagramWrapper::getZAxisTitle()
throw (uno::RuntimeException)
{
- if( !m_xZHelpGrid.is() )
- {
- m_xZHelpGrid = new GridWrapper( GridWrapper::Z_SUB_GRID, m_spChart2ModelContact );
- }
- return m_xZHelpGrid;
+ Reference< drawing::XShape > xRet;
+ Reference< XAxis > xAxis( getAxis(2) );
+ if( xAxis.is() )
+ xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xRet;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getZAxis()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZMainGrid()
+ throw (uno::RuntimeException)
+{
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(2) );
+ if( xAxis.is() )
+ xRet = xAxis->getMajorGrid();
+ return xRet;
+}
+
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZHelpGrid()
+ throw (uno::RuntimeException)
+{
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(2) );
+ if( xAxis.is() )
+ xRet = xAxis->getMinorGrid();
+ return xRet;
+}
+
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZAxis()
throw (uno::RuntimeException)
{
if( ! m_xZAxis.is())
- {
m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact );
- }
- return m_xZAxis;
+ return Reference< beans::XPropertySet >( m_xZAxis, uno::UNO_QUERY );
}
// ____ XTwoAxisXSupplier ____
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryXAxis()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryXAxis()
throw (uno::RuntimeException)
{
if( ! m_xSecondXAxis.is())
- {
m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact );
- }
- return m_xSecondXAxis;
+ return Reference< beans::XPropertySet >( m_xSecondXAxis, uno::UNO_QUERY );
}
// ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____
-Reference<
- drawing::XShape > SAL_CALL DiagramWrapper::getXAxisTitle()
+Reference< drawing::XShape > SAL_CALL DiagramWrapper::getXAxisTitle()
throw (uno::RuntimeException)
{
-
- if( !m_xXAxisTitle.is() )
- {
- m_xXAxisTitle = new TitleWrapper( TitleHelper::X_AXIS_TITLE, m_spChart2ModelContact );
- }
- return m_xXAxisTitle;
+ Reference< drawing::XShape > xRet;
+ Reference< XAxis > xAxis( getAxis(0) );
+ if( xAxis.is() )
+ xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xRet;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getXAxis()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXAxis()
throw (uno::RuntimeException)
{
if( ! m_xXAxis.is())
- {
m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact );
- }
-
- return m_xXAxis;
+ return Reference< beans::XPropertySet >( m_xXAxis, uno::UNO_QUERY );
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getXMainGrid()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXMainGrid()
throw (uno::RuntimeException)
{
- if( ! m_xXMainGrid.is())
- {
- m_xXMainGrid = new GridWrapper( GridWrapper::X_MAIN_GRID, m_spChart2ModelContact );
- }
-
- return m_xXMainGrid;
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(0) );
+ if( xAxis.is() )
+ xRet = xAxis->getMajorGrid();
+ return xRet;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getXHelpGrid()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXHelpGrid()
throw (uno::RuntimeException)
{
- if( ! m_xXHelpGrid.is())
- {
- m_xXHelpGrid = new GridWrapper( GridWrapper::X_SUB_GRID, m_spChart2ModelContact );
- }
- return m_xXHelpGrid;
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(0) );
+ if( xAxis.is() )
+ xRet = xAxis->getMinorGrid();
+ return xRet;
}
// ____ XTwoAxisYSupplier ____
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryYAxis()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryYAxis()
throw (uno::RuntimeException)
{
if( ! m_xSecondYAxis.is())
- {
m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact );
- }
- return m_xSecondYAxis;
+ return Reference< beans::XPropertySet >( m_xSecondYAxis, uno::UNO_QUERY );
}
// ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____
-Reference<
- drawing::XShape > SAL_CALL DiagramWrapper::getYAxisTitle()
+Reference< drawing::XShape > SAL_CALL DiagramWrapper::getYAxisTitle()
throw (uno::RuntimeException)
{
- if( !m_xYAxisTitle.is() )
- {
- m_xYAxisTitle = new TitleWrapper( TitleHelper::Y_AXIS_TITLE, m_spChart2ModelContact );
- }
- return m_xYAxisTitle;
+ Reference< drawing::XShape > xRet;
+ Reference< XAxis > xAxis( getAxis(1) );
+ if( xAxis.is() )
+ xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xRet;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getYAxis()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYAxis()
throw (uno::RuntimeException)
{
if( ! m_xYAxis.is())
- {
m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact );
- }
- return m_xYAxis;
+ return Reference< beans::XPropertySet >( m_xYAxis, uno::UNO_QUERY );
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getYHelpGrid()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYMainGrid()
throw (uno::RuntimeException)
{
- if( ! m_xYHelpGrid.is())
- {
- m_xYHelpGrid = new GridWrapper( GridWrapper::Y_SUB_GRID, m_spChart2ModelContact );
- }
- return m_xYHelpGrid;
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(1) );
+ if( xAxis.is() )
+ xRet = xAxis->getMajorGrid();
+ return xRet;
}
-Reference<
- beans::XPropertySet > SAL_CALL DiagramWrapper::getYMainGrid()
+Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYHelpGrid()
throw (uno::RuntimeException)
{
- if( ! m_xYMainGrid.is())
- {
- m_xYMainGrid = new GridWrapper( GridWrapper::Y_MAIN_GRID, m_spChart2ModelContact );
- }
- return m_xYMainGrid;
+ Reference< beans::XPropertySet > xRet;
+ Reference< XAxis > xAxis( getAxis(1) );
+ if( xAxis.is() )
+ xRet = xAxis->getMinorGrid();
+ return xRet;
}
// ____ XSecondAxisTitleSupplier ____
-Reference<
- drawing::XShape > SAL_CALL DiagramWrapper::getSecondXAxisTitle()
+Reference< drawing::XShape > SAL_CALL DiagramWrapper::getSecondXAxisTitle()
throw (uno::RuntimeException)
{
- if( !m_xSecondXAxisTitle.is() )
- {
- m_xSecondXAxisTitle = new TitleWrapper( TitleHelper::SECONDARY_X_AXIS_TITLE, m_spChart2ModelContact );
- }
- return m_xSecondXAxisTitle;
+ Reference< drawing::XShape > xRet;
+ Reference< XAxis > xAxis( getSecondaryAxis(0) );
+ if( xAxis.is() )
+ xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xRet;
}
-Reference<
- drawing::XShape > SAL_CALL DiagramWrapper::getSecondYAxisTitle()
+Reference< drawing::XShape > SAL_CALL DiagramWrapper::getSecondYAxisTitle()
throw (uno::RuntimeException)
{
- if( !m_xSecondYAxisTitle.is() )
- {
- m_xSecondYAxisTitle = new TitleWrapper( TitleHelper::SECONDARY_Y_AXIS_TITLE, m_spChart2ModelContact );
- }
- return m_xSecondYAxisTitle;
+ Reference< drawing::XShape > xRet;
+ Reference< XAxis > xAxis( getSecondaryAxis(1) );
+ if( xAxis.is() )
+ xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
+ return xRet;
}
// ____ XStatisticDisplay ____
@@ -1161,22 +1178,11 @@ void SAL_CALL DiagramWrapper::dispose()
MutexGuard aGuard( GetMutex());
- DisposeHelper::DisposeAndClear( m_xXAxisTitle );
- DisposeHelper::DisposeAndClear( m_xYAxisTitle );
- DisposeHelper::DisposeAndClear( m_xZAxisTitle );
- DisposeHelper::DisposeAndClear( m_xSecondXAxisTitle );
- DisposeHelper::DisposeAndClear( m_xSecondYAxisTitle );
DisposeHelper::DisposeAndClear( m_xXAxis );
DisposeHelper::DisposeAndClear( m_xYAxis );
DisposeHelper::DisposeAndClear( m_xZAxis );
DisposeHelper::DisposeAndClear( m_xSecondXAxis );
DisposeHelper::DisposeAndClear( m_xSecondYAxis );
- DisposeHelper::DisposeAndClear( m_xXMainGrid );
- DisposeHelper::DisposeAndClear( m_xYMainGrid );
- DisposeHelper::DisposeAndClear( m_xZMainGrid );
- DisposeHelper::DisposeAndClear( m_xXHelpGrid );
- DisposeHelper::DisposeAndClear( m_xYHelpGrid );
- DisposeHelper::DisposeAndClear( m_xZHelpGrid );
DisposeHelper::DisposeAndClear( m_xWall );
DisposeHelper::DisposeAndClear( m_xFloor );
DisposeHelper::DisposeAndClear( m_xMinMaxLineWrapper );
@@ -2055,7 +2061,7 @@ Reference< beans::XPropertySet > DiagramWrapper::getInnerPropertySet()
const Sequence< beans::Property >& DiagramWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticDiagramWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
index bee3961eeaac..c58fb6ab0fa2 100644..100755
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx
@@ -31,7 +31,13 @@
#include "WrappedPropertySet.hxx"
#include "ServiceMacros.hxx"
#include "DiagramHelper.hxx"
-#include <cppuhelper/implbase12.hxx>
+
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 13
+#include "comphelper/implbase_var.hxx"
+#endif
+
#include <comphelper/uno3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -42,6 +48,7 @@
#include <com/sun/star/chart2/XChartTypeTemplate.hpp>
#include <com/sun/star/chart2/XChartTypeManager.hpp>
#include <com/sun/star/chart/XDiagram.hpp>
+#include <com/sun/star/chart/XAxisSupplier.hpp>
#include <com/sun/star/chart/XAxisZSupplier.hpp>
#include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
#include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
@@ -57,15 +64,15 @@
namespace chart
{
-
namespace wrapper
{
class Chart2ModelContact;
-class DiagramWrapper : public ::cppu::ImplInheritanceHelper12<
+class DiagramWrapper : public ::comphelper::ImplInheritanceHelper13<
WrappedPropertySet
, ::com::sun::star::chart::XDiagram
+ , ::com::sun::star::chart::XAxisSupplier
, ::com::sun::star::chart::XAxisZSupplier
, ::com::sun::star::chart::XTwoAxisXSupplier // : XAxisXSupplier
, ::com::sun::star::chart::XTwoAxisYSupplier // : XAxisYSupplier
@@ -123,6 +130,14 @@ public:
virtual ::rtl::OUString SAL_CALL getShapeType()
throw (::com::sun::star::uno::RuntimeException);
+ // ____ XAxisSupplier ____
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart::XAxis > SAL_CALL getAxis( sal_Int32 nDimensionIndex )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart::XAxis > SAL_CALL getSecondaryAxis( sal_Int32 nDimensionIndex )
+ throw (::com::sun::star::uno::RuntimeException);
+
// ____ XAxisZSupplier ____
virtual ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShape > SAL_CALL getZAxisTitle()
@@ -239,72 +254,27 @@ private:
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >
- m_xXAxisTitle;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >
- m_xYAxisTitle;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >
- m_xZAxisTitle;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >
- m_xSecondXAxisTitle;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape >
- m_xSecondYAxisTitle;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xXAxis;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xYAxis;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xZAxis;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xSecondXAxis;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xSecondYAxis;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xXMainGrid;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xYMainGrid;
+ ::com::sun::star::chart::XAxis > m_xXAxis;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xZMainGrid;
+ ::com::sun::star::chart::XAxis > m_xYAxis;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xXHelpGrid;
+ ::com::sun::star::chart::XAxis > m_xZAxis;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xYHelpGrid;
+ ::com::sun::star::chart::XAxis > m_xSecondXAxis;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xZHelpGrid;
+ ::com::sun::star::chart::XAxis > m_xSecondYAxis;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xWall;
+ ::com::sun::star::beans::XPropertySet > m_xWall;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xFloor;
+ ::com::sun::star::beans::XPropertySet > m_xFloor;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xMinMaxLineWrapper;
+ ::com::sun::star::beans::XPropertySet > m_xMinMaxLineWrapper;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xUpBarWrapper;
+ ::com::sun::star::beans::XPropertySet > m_xUpBarWrapper;
::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >
- m_xDownBarWrapper;
+ ::com::sun::star::beans::XPropertySet > m_xDownBarWrapper;
};
} // namespace wrapper
diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
index 94862f800e7f..be184b30150d 100644..100755
--- a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
@@ -60,28 +60,30 @@ namespace
static const OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.Grid" ));
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticGridWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticGridWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticGridWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -110,17 +112,17 @@ void GridWrapper::getDimensionAndSubGridBool( tGridType eType, sal_Int32& rnDime
switch( eType )
{
- case X_MAIN_GRID:
+ case X_MAJOR_GRID:
rnDimensionIndex = 0; rbSubGrid = false; break;
- case Y_MAIN_GRID:
+ case Y_MAJOR_GRID:
rnDimensionIndex = 1; rbSubGrid = false; break;
- case Z_MAIN_GRID:
+ case Z_MAJOR_GRID:
rnDimensionIndex = 2; rbSubGrid = false; break;
- case X_SUB_GRID:
+ case X_MINOR_GRID:
rnDimensionIndex = 0; rbSubGrid = true; break;
- case Y_SUB_GRID:
+ case Y_MINOR_GRID:
rnDimensionIndex = 1; rbSubGrid = true; break;
- case Z_SUB_GRID:
+ case Z_MINOR_GRID:
rnDimensionIndex = 2; rbSubGrid = true; break;
}
}
@@ -177,7 +179,7 @@ Reference< beans::XPropertySet > GridWrapper::getInnerPropertySet()
const Sequence< beans::Property >& GridWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticGridWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > GridWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.hxx b/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
index bd075cba2666..5d4769574d7f 100644..100755
--- a/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/GridWrapper.hxx
@@ -43,7 +43,6 @@
namespace chart
{
-
namespace wrapper
{
@@ -58,12 +57,12 @@ class GridWrapper : public ::cppu::ImplInheritanceHelper2<
public:
enum tGridType
{
- X_MAIN_GRID,
- Y_MAIN_GRID,
- Z_MAIN_GRID,
- X_SUB_GRID,
- Y_SUB_GRID,
- Z_SUB_GRID
+ X_MAJOR_GRID,
+ Y_MAJOR_GRID,
+ Z_MAJOR_GRID,
+ X_MINOR_GRID,
+ Y_MINOR_GRID,
+ Z_MINOR_GRID
};
GridWrapper( tGridType eType, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
diff --git a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
index 38b444c49dda..c2982c11451e 100644..100755
--- a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
@@ -38,7 +38,7 @@
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart/ChartLegendPosition.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
@@ -139,13 +139,13 @@ void WrappedLegendAlignmentProperty::setPropertyValue( const Any& rOuterValue, c
chart2::LegendPosition eNewInnerPos(chart2::LegendPosition_LINE_END);
if( aInnerValue >>= eNewInnerPos )
{
- chart2::LegendExpansion eNewExpansion =
+ ::com::sun::star::chart::ChartLegendExpansion eNewExpansion =
( eNewInnerPos == chart2::LegendPosition_LINE_END ||
eNewInnerPos == chart2::LegendPosition_LINE_START )
- ? chart2::LegendExpansion_HIGH
- : chart2::LegendExpansion_WIDE;
+ ? ::com::sun::star::chart::ChartLegendExpansion_HIGH
+ : ::com::sun::star::chart::ChartLegendExpansion_WIDE;
- chart2::LegendExpansion eOldExpansion( chart2::LegendExpansion_HIGH );
+ ::com::sun::star::chart::ChartLegendExpansion eOldExpansion( ::com::sun::star::chart::ChartLegendExpansion_HIGH );
bool bExpansionWasSet(
xInnerPropertySet->getPropertyValue( C2U( "Expansion" ) ) >>= eOldExpansion );
@@ -229,7 +229,8 @@ static const ::rtl::OUString lcl_aServiceName(
enum
{
- PROP_LEGEND_ALIGNMENT
+ PROP_LEGEND_ALIGNMENT,
+ PROP_LEGEND_EXPANSION
};
void lcl_AddPropertiesToVector(
@@ -241,16 +242,26 @@ void lcl_AddPropertiesToVector(
::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartLegendPosition * >(0)),
//#i111967# no PropertyChangeEvent is fired on change so far
beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( C2U( "Expansion" ),
+ PROP_LEGEND_EXPANSION,
+ ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartLegendExpansion * >(0)),
+ //#i111967# no PropertyChangeEvent is fired on change so far
+ beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticLegendWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
@@ -260,16 +271,17 @@ const Sequence< Property > & lcl_GetPropertySequence()
::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
+
+struct StaticLegendWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticLegendWrapperPropertyArray_Initializer >
+{
+};
- return aPropSeq;
-}
} // anonymous namespace
// --------------------------------------------------------------------------------
@@ -410,7 +422,7 @@ Reference< beans::XPropertySet > LegendWrapper::getInnerPropertySet()
const Sequence< beans::Property >& LegendWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticLegendWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > LegendWrapper::createWrappedProperties()
@@ -418,6 +430,7 @@ const std::vector< WrappedProperty* > LegendWrapper::createWrappedProperties()
::std::vector< ::chart::WrappedProperty* > aWrappedProperties;
aWrappedProperties.push_back( new WrappedLegendAlignmentProperty() );
+ aWrappedProperties.push_back( new WrappedProperty( C2U("Expansion"), C2U("Expansion") ));
WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this );
//same problem as for wall: thje defaults ion the old chart are different for different charttypes, so we need to export explicitly
aWrappedProperties.push_back( new WrappedDirectStateProperty( C2U("FillStyle"), C2U("FillStyle") ) );
diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
index 29a6576b3697..6190d1ced60c 100644..100755
--- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
@@ -57,29 +57,78 @@ namespace
static const OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.ChartLine" ));
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticMinMaxLineWrapperDefaults_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ }
+};
+
+struct StaticMinMaxLineWrapperDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticMinMaxLineWrapperDefaults_Initializer >
+{
+};
+
+struct StaticMinMaxLineWrapperPropertyArray_Initializer
+{
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticMinMaxLineWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticMinMaxLineWrapperPropertyArray_Initializer >
+{
+};
+
+struct StaticMinMaxLineWrapperInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( *StaticMinMaxLineWrapperPropertyArray::get() );
+ return &aPropHelper;
+ }
+};
+
+struct StaticMinMaxLineWrapperInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticMinMaxLineWrapperInfoHelper_Initializer >
+{
+};
+
+struct StaticMinMaxLineWrapperInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticMinMaxLineWrapperInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticMinMaxLineWrapperInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticMinMaxLineWrapperInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -93,7 +142,6 @@ namespace wrapper
MinMaxLineWrapper::MinMaxLineWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
: m_spChart2ModelContact( spChart2ModelContact )
, m_aEventListenerContainer( m_aMutex )
- , m_pPropertyArrayHelper()
, m_aWrappedLineJointProperty( C2U("LineJoint"), uno::makeAny( drawing::LineJoint_NONE ))
{
}
@@ -108,9 +156,6 @@ void SAL_CALL MinMaxLineWrapper::dispose()
{
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
-
- MutexGuard aGuard( GetMutex());
- m_xInfo.clear();
}
void SAL_CALL MinMaxLineWrapper::addEventListener(
@@ -129,30 +174,16 @@ void SAL_CALL MinMaxLineWrapper::removeEventListener(
::cppu::IPropertyArrayHelper& MinMaxLineWrapper::getInfoHelper()
{
- if(!m_pPropertyArrayHelper.get())
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if(!m_pPropertyArrayHelper.get())
- {
- sal_Bool bSorted = sal_True;
- m_pPropertyArrayHelper = ::boost::shared_ptr< ::cppu::OPropertyArrayHelper >( new ::cppu::OPropertyArrayHelper( lcl_GetPropertySequence(), bSorted ) );
- }
- }
- return *m_pPropertyArrayHelper.get();
+ return *StaticMinMaxLineWrapperInfoHelper::get();
}
//XPropertySet
uno::Reference< beans::XPropertySetInfo > SAL_CALL MinMaxLineWrapper::getPropertySetInfo()
throw (uno::RuntimeException)
{
- if( !m_xInfo.is() )
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if( !m_xInfo.is() )
- m_xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
- }
- return m_xInfo;
+ return *StaticMinMaxLineWrapperInfo::get();
}
+
void SAL_CALL MinMaxLineWrapper::setPropertyValue( const ::rtl::OUString& rPropertyName, const uno::Any& rValue )
throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -344,25 +375,14 @@ void SAL_CALL MinMaxLineWrapper::setPropertyToDefault( const ::rtl::OUString& rP
{
this->setPropertyValue( rPropertyName, this->getPropertyDefault(rPropertyName) );
}
+
uno::Any SAL_CALL MinMaxLineWrapper::getPropertyDefault( const ::rtl::OUString& rPropertyName )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- }
-
- sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticMinMaxLineWrapperDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( getInfoHelper().getHandleByName( rPropertyName ) ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
@@ -371,7 +391,7 @@ uno::Any SAL_CALL MinMaxLineWrapper::getPropertyDefault( const ::rtl::OUString&
void SAL_CALL MinMaxLineWrapper::setAllPropertiesToDefault( )
throw (uno::RuntimeException)
{
- const Sequence< beans::Property >& rPropSeq = lcl_GetPropertySequence();
+ const Sequence< beans::Property >& rPropSeq = *StaticMinMaxLineWrapperPropertyArray::get();
for(sal_Int32 nN=0; nN<rPropSeq.getLength(); nN++)
{
::rtl::OUString aPropertyName( rPropSeq[nN].Name );
diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
index 6ecc276382c0..0e02ed3294e4 100644..100755
--- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.hxx
@@ -121,12 +121,6 @@ private: //member
::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySetInfo >
- m_xInfo;//outer PropertySetInfo
-
- ::boost::shared_ptr< ::cppu::OPropertyArrayHelper > m_pPropertyArrayHelper;
-
WrappedIgnoreProperty m_aWrappedLineJointProperty;
};
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index 0f88ab67e23b..aa111eb46063 100644..100755
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -178,14 +178,17 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticTitleWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
@@ -195,16 +198,16 @@ const Sequence< Property > & lcl_GetPropertySequence()
::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticTitleWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticTitleWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -518,7 +521,7 @@ Reference< beans::XPropertySet > TitleWrapper::getInnerPropertySet()
const Sequence< beans::Property >& TitleWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticTitleWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > TitleWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
index 45fb4495344f..b789a34d5f94 100644..100755
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
@@ -57,30 +57,80 @@ namespace
static const OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.ChartArea" ));
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticUpDownBarWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticUpDownBarWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticUpDownBarWrapperPropertyArray_Initializer >
+{
+};
+
+struct StaticUpDownBarWrapperInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( *StaticUpDownBarWrapperPropertyArray::get() );
+ return &aPropHelper;
+ }
+};
+
+struct StaticUpDownBarWrapperInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticUpDownBarWrapperInfoHelper_Initializer >
+{
+};
+
+struct StaticUpDownBarWrapperInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticUpDownBarWrapperInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticUpDownBarWrapperInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticUpDownBarWrapperInfo_Initializer >
+{
+};
+
+struct StaticUpDownBarWrapperDefaults_Initializer
+{
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::FillProperties::AddDefaultsToMap( rOutMap );
+ }
+};
+
+struct StaticUpDownBarWrapperDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticUpDownBarWrapperDefaults_Initializer >
+{
+};
} // anonymous namespace
@@ -96,8 +146,6 @@ UpDownBarWrapper::UpDownBarWrapper(
: m_spChart2ModelContact( spChart2ModelContact )
, m_aEventListenerContainer( m_aMutex )
, m_aPropertySetName( bUp ? C2U("WhiteDay") : C2U("BlackDay") )
- , m_xInfo(0)
- , m_pPropertyArrayHelper()
{
}
@@ -111,9 +159,6 @@ void SAL_CALL UpDownBarWrapper::dispose()
{
Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
-
- MutexGuard aGuard( GetMutex());
- m_xInfo.clear();
}
void SAL_CALL UpDownBarWrapper::addEventListener(
@@ -132,29 +177,14 @@ void SAL_CALL UpDownBarWrapper::removeEventListener(
::cppu::IPropertyArrayHelper& UpDownBarWrapper::getInfoHelper()
{
- if(!m_pPropertyArrayHelper.get())
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if(!m_pPropertyArrayHelper.get())
- {
- sal_Bool bSorted = sal_True;
- m_pPropertyArrayHelper = ::boost::shared_ptr< ::cppu::OPropertyArrayHelper >( new ::cppu::OPropertyArrayHelper( lcl_GetPropertySequence(), bSorted ) );
- }
- }
- return *m_pPropertyArrayHelper.get();
+ return *StaticUpDownBarWrapperInfoHelper::get();
}
//XPropertySet
uno::Reference< beans::XPropertySetInfo > SAL_CALL UpDownBarWrapper::getPropertySetInfo()
throw (uno::RuntimeException)
{
- if( !m_xInfo.is() )
- {
- ::osl::MutexGuard aGuard( GetMutex() );
- if( !m_xInfo.is() )
- m_xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
- }
- return m_xInfo;
+ return *StaticUpDownBarWrapperInfo::get();
}
void SAL_CALL UpDownBarWrapper::setPropertyValue( const ::rtl::OUString& rPropertyName, const uno::Any& rValue )
throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
@@ -308,26 +338,14 @@ void SAL_CALL UpDownBarWrapper::setPropertyToDefault( const ::rtl::OUString& rPr
{
this->setPropertyValue( rPropertyName, this->getPropertyDefault(rPropertyName) );
}
+
uno::Any SAL_CALL UpDownBarWrapper::getPropertyDefault( const ::rtl::OUString& rPropertyName )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- FillProperties::AddDefaultsToMap( aStaticDefaults );
- }
-
- sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticUpDownBarWrapperDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( getInfoHelper().getHandleByName( rPropertyName ) ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
@@ -336,7 +354,7 @@ uno::Any SAL_CALL UpDownBarWrapper::getPropertyDefault( const ::rtl::OUString& r
void SAL_CALL UpDownBarWrapper::setAllPropertiesToDefault( )
throw (uno::RuntimeException)
{
- const Sequence< beans::Property >& rPropSeq = lcl_GetPropertySequence();
+ const Sequence< beans::Property >& rPropSeq = *StaticUpDownBarWrapperPropertyArray::get();
for(sal_Int32 nN=0; nN<rPropSeq.getLength(); nN++)
{
::rtl::OUString aPropertyName( rPropSeq[nN].Name );
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
index 0ccef58f2583..7e3602f0aa36 100644..100755
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.hxx
@@ -121,11 +121,6 @@ private: //member
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
rtl::OUString m_aPropertySetName;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySetInfo >
- m_xInfo;//outer PropertySetInfo
- ::boost::shared_ptr< ::cppu::OPropertyArrayHelper > m_pPropertyArrayHelper;
-
};
} // namespace wrapper
diff --git a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
index e18d6baae881..76ef90ffffc9 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
@@ -60,29 +60,32 @@ namespace
static const OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.WallOrFloor" ));
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticWallFloorWrapperPropertyArray_Initializer
{
- static Sequence< Property > aPropSeq;
+ Sequence< Property >* operator()()
+ {
+ static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
+ return &aPropSeq;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticWallFloorWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticWallFloorWrapperPropertyArray_Initializer >
+{
+};
} // anonymous namespace
@@ -152,7 +155,7 @@ Reference< beans::XPropertySet > WallFloorWrapper::getInnerPropertySet()
const Sequence< beans::Property >& WallFloorWrapper::getPropertySequence()
{
- return lcl_GetPropertySequence();
+ return *StaticWallFloorWrapperPropertyArray::get();
}
const std::vector< WrappedProperty* > WallFloorWrapper::createWrappedProperties()
diff --git a/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx
index ab91436809f9..ab91436809f9 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx
diff --git a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
index 75eee8549812..75eee8549812 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
diff --git a/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
index b0c62d859694..b0c62d859694 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
diff --git a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
index 45539f76f5a6..45539f76f5a6 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
index 4894d86a0a49..3fb83c749c1b 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
@@ -34,9 +34,8 @@
#include "CommonConverters.hxx"
#include "AxisHelper.hxx"
#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
-#include <com/sun/star/chart2/AxisOrientation.hpp>
+#include <com/sun/star/chart/ChartAxisType.hpp>
+#include <chartview/ExplicitScaleValues.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
@@ -44,6 +43,7 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
+using ::com::sun::star::chart::TimeIncrement;
//.............................................................................
namespace chart
@@ -92,6 +92,15 @@ WrappedScaleProperty::WrappedScaleProperty( tScaleProperty eScaleProperty
case SCALE_PROP_AUTO_STEPHELP:
m_aOuterName = C2U("AutoStepHelp");
break;
+ case SCALE_PROP_AXIS_TYPE:
+ m_aOuterName = C2U("AxisType");
+ break;
+ case SCALE_PROP_DATE_INCREMENT:
+ m_aOuterName = C2U("TimeIncrement");
+ break;
+ case SCALE_PROP_EXPLICIT_DATE_INCREMENT:
+ m_aOuterName = C2U("ExplicitTimeIncrement");
+ break;
case SCALE_PROP_LOGARITHMIC:
m_aOuterName = C2U("Logarithmic");
break;
@@ -122,6 +131,9 @@ void WrappedScaleProperty::addWrappedProperties( std::vector< WrappedProperty* >
rList.push_back( new WrappedScaleProperty( SCALE_PROP_AUTO_ORIGIN, spChart2ModelContact ) );
rList.push_back( new WrappedScaleProperty( SCALE_PROP_AUTO_STEPMAIN, spChart2ModelContact ) );
rList.push_back( new WrappedScaleProperty( SCALE_PROP_AUTO_STEPHELP, spChart2ModelContact ) );
+ rList.push_back( new WrappedScaleProperty( SCALE_PROP_AXIS_TYPE, spChart2ModelContact ) );
+ rList.push_back( new WrappedScaleProperty( SCALE_PROP_DATE_INCREMENT, spChart2ModelContact ) );
+ rList.push_back( new WrappedScaleProperty( SCALE_PROP_EXPLICIT_DATE_INCREMENT, spChart2ModelContact ) );
rList.push_back( new WrappedScaleProperty( SCALE_PROP_LOGARITHMIC, spChart2ModelContact ) );
rList.push_back( new WrappedScaleProperty( SCALE_PROP_REVERSEDIRECTION, spChart2ModelContact ) );
}
@@ -267,6 +279,43 @@ void WrappedScaleProperty::setPropertyValue( tScaleProperty eScaleProperty, cons
bSetScaleData = true;
break;
}
+ case SCALE_PROP_AXIS_TYPE:
+ {
+ sal_Int32 nType = 0;
+ if( (rOuterValue >>= nType) )
+ {
+ if( ::com::sun::star::chart::ChartAxisType::AUTOMATIC == nType )
+ {
+ aScaleData.AutoDateAxis = true;
+ if( aScaleData.AxisType == AxisType::DATE )
+ aScaleData.AxisType = AxisType::CATEGORY;
+ }
+ else if( ::com::sun::star::chart::ChartAxisType::CATEGORY == nType )
+ {
+ aScaleData.AutoDateAxis = false;
+ if( aScaleData.AxisType == AxisType::DATE )
+ aScaleData.AxisType = AxisType::CATEGORY;
+ }
+ else if( ::com::sun::star::chart::ChartAxisType::DATE == nType )
+ {
+ if( aScaleData.AxisType == AxisType::CATEGORY )
+ aScaleData.AxisType = AxisType::DATE;
+ }
+ bSetScaleData = true;
+ }
+ break;
+ }
+ case SCALE_PROP_DATE_INCREMENT:
+ {
+ TimeIncrement aTimeIncrement;
+ rOuterValue >>= aTimeIncrement;
+ aScaleData.TimeIncrement = aTimeIncrement;
+ bSetScaleData = true;
+ break;
+ }
+ case SCALE_PROP_EXPLICIT_DATE_INCREMENT:
+ //read only property
+ break;
case SCALE_PROP_LOGARITHMIC:
{
if( rOuterValue >>= bBool )
@@ -321,8 +370,8 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
chart2::ScaleData aScaleData( xAxis->getScaleData() );
- chart2::ExplicitScaleData aExplicitScale;
- chart2::ExplicitIncrementData aExplicitIncrement;
+ ExplicitScaleData aExplicitScale;
+ ExplicitIncrementData aExplicitIncrement;
switch( eScaleProperty )
{
@@ -402,7 +451,8 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
{
m_spChart2ModelContact->getExplicitValuesForAxis(
xAxis, aExplicitScale, aExplicitIncrement );
- if( aExplicitIncrement.SubIncrements.getLength() > 0 &&
+
+ if( !aExplicitIncrement.SubIncrements.empty() &&
aExplicitIncrement.SubIncrements[ 0 ].IntervalCount > 0 )
{
if( bLogarithmic )
@@ -441,7 +491,7 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
if( bNeedToCalculateExplicitValues )
{
m_spChart2ModelContact->getExplicitValuesForAxis( xAxis, aExplicitScale, aExplicitIncrement );
- if( aExplicitIncrement.SubIncrements.getLength() > 0 )
+ if( !aExplicitIncrement.SubIncrements.empty() )
nIntervalCount = aExplicitIncrement.SubIncrements[ 0 ].IntervalCount;
}
aRet = uno::makeAny( nIntervalCount );
@@ -487,6 +537,46 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
aRet <<= !hasDoubleValue(aScaleData.Origin);
break;
}
+ case SCALE_PROP_AXIS_TYPE:
+ {
+ sal_Int32 nType = ::com::sun::star::chart::ChartAxisType::AUTOMATIC;
+ if( aScaleData.AxisType == AxisType::DATE )
+ {
+ nType = ::com::sun::star::chart::ChartAxisType::DATE;
+ }
+ else if( aScaleData.AxisType == AxisType::CATEGORY )
+ {
+ if( !aScaleData.AutoDateAxis )
+ nType = ::com::sun::star::chart::ChartAxisType::CATEGORY;
+ }
+ aRet = uno::makeAny( nType );
+ break;
+ }
+ case SCALE_PROP_DATE_INCREMENT:
+ {
+ if( aScaleData.AxisType == AxisType::DATE || aScaleData.AutoDateAxis )
+ aRet = uno::makeAny( aScaleData.TimeIncrement );
+ break;
+ }
+ case SCALE_PROP_EXPLICIT_DATE_INCREMENT:
+ {
+ if( aScaleData.AxisType == AxisType::DATE || aScaleData.AutoDateAxis )
+ {
+ m_spChart2ModelContact->getExplicitValuesForAxis( xAxis, aExplicitScale, aExplicitIncrement );
+ if( aExplicitScale.AxisType == AxisType::DATE )
+ {
+ TimeIncrement aTimeIncrement;
+ aTimeIncrement.MajorTimeInterval = uno::makeAny( aExplicitIncrement.MajorTimeInterval );
+ aTimeIncrement.MinorTimeInterval = uno::makeAny( aExplicitIncrement.MinorTimeInterval );
+ aTimeIncrement.TimeResolution = uno::makeAny( aExplicitScale.TimeResolution );
+ aRet = uno::makeAny(aTimeIncrement);
+ }
+ }
+
+ if( aScaleData.AxisType == AxisType::DATE || aScaleData.AutoDateAxis )
+ aRet = uno::makeAny( aScaleData.TimeIncrement );
+ break;
+ }
case SCALE_PROP_LOGARITHMIC:
{
aRet <<= static_cast< sal_Bool >( AxisHelper::isLogarithmic(aScaleData.Scaling) );
@@ -508,7 +598,7 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const
}
} // namespace wrapper
-} //namespace chart
+} // namespace chart
//.............................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx
index 73bb17bc158e..8863906c8db9 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.hxx
@@ -56,6 +56,9 @@ public:
, SCALE_PROP_AUTO_ORIGIN
, SCALE_PROP_AUTO_STEPMAIN
, SCALE_PROP_AUTO_STEPHELP
+ , SCALE_PROP_AXIS_TYPE
+ , SCALE_PROP_DATE_INCREMENT
+ , SCALE_PROP_EXPLICIT_DATE_INCREMENT
, SCALE_PROP_LOGARITHMIC
, SCALE_PROP_REVERSEDIRECTION
};
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
index a76f6e17436c..a76f6e17436c 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
index 23039f73f7a7..23039f73f7a7 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
index 24abf9cfda71..ae2910d865be 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
@@ -223,7 +223,7 @@ void WrappedSplineProperties::addWrappedProperties( std::vector< WrappedProperty
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
rList.push_back( new WrappedSplineTypeProperty( spChart2ModelContact ) );
- rList.push_back( new WrappedSplineProperty<sal_Int32>( C2U("SplineOrder"), C2U("SplineOrder"), uno::makeAny(sal_Int32(2)), spChart2ModelContact ) );
+ rList.push_back( new WrappedSplineProperty<sal_Int32>( C2U("SplineOrder"), C2U("SplineOrder"), uno::makeAny(sal_Int32(3)), spChart2ModelContact ) );
rList.push_back( new WrappedSplineProperty<sal_Int32>( C2U("SplineResolution"), C2U("CurveResolution"), uno::makeAny(sal_Int32(20)), spChart2ModelContact ) );
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
index aea06297bcee..aea06297bcee 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
index 7dc04fe121ad..7dc04fe121ad 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
index 88bdc8c971d2..5707a0aa8f21 100644..100755
--- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
@@ -555,8 +555,19 @@ void WrappedSymbolAndLinesProperty::setValueToSeries(
if(!xSeriesPropertySet.is())
return;
- drawing::LineStyle eLineStyle( bDrawLines ? drawing::LineStyle_SOLID : drawing::LineStyle_NONE );
- xSeriesPropertySet->setPropertyValue( C2U("LineStyle"), uno::makeAny( eLineStyle ) );
+ drawing::LineStyle eOldLineStyle( drawing::LineStyle_SOLID );
+ xSeriesPropertySet->getPropertyValue( C2U("LineStyle") ) >>= eOldLineStyle;
+ if( bDrawLines )
+ {
+ //#i114298# don't overwrite dashed lines with solid lines here
+ if( eOldLineStyle == drawing::LineStyle_NONE )
+ xSeriesPropertySet->setPropertyValue( C2U("LineStyle"), uno::makeAny( drawing::LineStyle_SOLID ) );
+ }
+ else
+ {
+ if( eOldLineStyle != drawing::LineStyle_NONE )
+ xSeriesPropertySet->setPropertyValue( C2U("LineStyle"), uno::makeAny( drawing::LineStyle_NONE ) );
+ }
}
beans::PropertyState WrappedSymbolAndLinesProperty::getPropertyState( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
diff --git a/chart2/source/controller/chartcontroller.component b/chart2/source/controller/chartcontroller.component
new file mode 100644
index 000000000000..fc99913b5a74
--- /dev/null
+++ b/chart2/source/controller/chartcontroller.component
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.chart.ElementSelectorToolbarController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartController">
+ <service name="com.sun.star.chart2.ChartController"/>
+ <service name="com.sun.star.frame.Controller"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartDocumentWrapper">
+ <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.UserDefinedAttributeSupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartFrameLoader">
+ <service name="com.sun.star.frame.SynchronousFrameLoader"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartTypeDialog">
+ <service name="com.sun.star.chart2.ChartTypeDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ShapeToolbarController">
+ <service name="com.sun.star.chart2.ShapeToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.WizardDialog">
+ <service name="com.sun.star.chart2.WizardDialog"/>
+ </implementation>
+</component>
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index e8984a0e0b4f..1ecca13d84f8 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -1167,6 +1167,8 @@ void CombiColumnLineChartDialogController::showExtraControls( Window* pParent, c
m_pFT_NumberOfLines->Show();
m_pMF_NumberOfLines->Show();
+ m_pMF_NumberOfLines->SetAccessibleName(m_pFT_NumberOfLines->GetText());
+ m_pMF_NumberOfLines->SetAccessibleRelationLabeledBy(m_pFT_NumberOfLines);
}
void CombiColumnLineChartDialogController::hideExtraControls() const
{
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 85bbc8c82fda..bebbf410a89c 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -48,7 +48,7 @@
#include "ChartModelHelper.hxx"
#include "CommonConverters.hxx"
#include "macros.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "servicenames_charttypes.hxx"
#include "ResId.hxx"
#include "Bitmaps.hrc"
@@ -64,6 +64,7 @@
#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/container/XIndexReplace.hpp>
+#include <com/sun/star/util/XNumberFormats.hpp>
#include <algorithm>
#include <functional>
@@ -102,7 +103,7 @@ sal_Int32 lcl_getRowInData( long nRow )
return static_cast< sal_Int32 >( nRow );
}
-sal_Int32 lcl_getColumnInData( USHORT nCol )
+sal_Int32 lcl_getColumnInData( sal_uInt16 nCol )
{
return static_cast< sal_Int32 >( nCol ) - 1;
}
@@ -237,7 +238,7 @@ SeriesHeader::SeriesHeader( Window * pParent ) :
m_spSeriesName->EnableUpdateData( 4 * EDIT_UPDATEDATA_TIMEOUT ); // define is in vcl/edit.hxx
m_spSeriesName->SetUpdateDataHdl( LINK( this, SeriesHeader, SeriesNameChanged ));
m_spSeriesName->SetModifyHdl( LINK( this, SeriesHeader, SeriesNameEdited ));
- m_spSeriesName->SetSmartHelpId( SmartId( HID_SCH_DATA_SERIES_LABEL ));
+ m_spSeriesName->SetHelpId( HID_SCH_DATA_SERIES_LABEL );
Show();
}
@@ -471,13 +472,13 @@ bool lcl_SeriesHeaderHasFocus(
}
sal_Int32 lcl_getColumnInDataOrHeader(
- USHORT nCol, const ::std::vector< ::boost::shared_ptr< ::chart::impl::SeriesHeader > > & rSeriesHeader )
+ sal_uInt16 nCol, const ::std::vector< ::boost::shared_ptr< ::chart::impl::SeriesHeader > > & rSeriesHeader )
{
sal_Int32 nColIdx = 0;
bool bHeaderHasFocus( lcl_SeriesHeaderHasFocus( rSeriesHeader, &nColIdx ));
if( bHeaderHasFocus )
- nColIdx = lcl_getColumnInData( static_cast< USHORT >( rSeriesHeader[nColIdx]->GetStartColumn()));
+ nColIdx = lcl_getColumnInData( static_cast< sal_uInt16 >( rSeriesHeader[nColIdx]->GetStartColumn()));
else
nColIdx = lcl_getColumnInData( nCol );
@@ -502,7 +503,7 @@ DataBrowser::DataBrowser( Window* pParent, const ResId& rId, bool bLiveUpdate )
double fNan;
::rtl::math::setNan( & fNan );
m_aNumberEditField.SetDefaultValue( fNan );
- m_aNumberEditField.TreatAsNumber( TRUE );
+ m_aNumberEditField.TreatAsNumber( sal_True );
RenewTable();
SetClean();
}
@@ -578,10 +579,10 @@ void DataBrowser::RenewTable()
return;
long nOldRow = GetCurRow();
- USHORT nOldColId = GetCurColumnId();
+ sal_uInt16 nOldColId = GetCurColumnId();
- BOOL bLastUpdateMode = GetUpdateMode();
- SetUpdateMode( FALSE );
+ sal_Bool bLastUpdateMode = GetUpdateMode();
+ SetUpdateMode( sal_False );
if( IsModified() )
SaveModified();
@@ -609,7 +610,7 @@ void DataBrowser::RenewTable()
RowInserted( 1, nRowCountLocal );
GoToRow( ::std::min( nOldRow, GetRowCount() - 1 ));
- GoToColumnId( ::std::min( nOldColId, static_cast< USHORT >( ColCount() - 1 )));
+ GoToColumnId( ::std::min( nOldColId, static_cast< sal_uInt16 >( ColCount() - 1 )));
Window * pWin = this->GetParent();
if( !pWin )
@@ -665,7 +666,7 @@ String DataBrowser::GetRowString( sal_Int32 nRow ) const
return String::CreateFromInt32( nRow + 1 );
}
-String DataBrowser::GetCellText( long nRow, USHORT nColumnId ) const
+String DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
{
String aResult;
@@ -690,6 +691,23 @@ String DataBrowser::GetCellText( long nRow, USHORT nColumnId ) const
GetNumberFormatKey( nRow, nColumnId ),
fData, nLabelColor, bColorChanged ));
}
+ else if( m_apDataBrowserModel->getCellType( nColIndex, nRow ) == DataBrowserModel::TEXTORDATE )
+ {
+ uno::Any aAny = m_apDataBrowserModel->getCellAny( nColIndex, nRow );
+ OUString aText;
+ double fDouble=0.0;
+ if( aAny>>=aText )
+ aResult = aText;
+ else if( aAny>>=fDouble )
+ {
+ sal_Int32 nLabelColor;
+ bool bColorChanged = false;
+ sal_Int32 nDateNumberFormat = DiagramHelper::getDateNumberFormat( Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY) );
+ if( ! ::rtl::math::isNan( fDouble ) && m_spNumberFormatterWrapper.get() )
+ aResult = String( m_spNumberFormatterWrapper->getFormattedString(
+ nDateNumberFormat, fDouble, nLabelColor, bColorChanged ));
+ }
+ }
else
{
OSL_ASSERT( m_apDataBrowserModel->getCellType( nColIndex, nRow ) == DataBrowserModel::TEXT );
@@ -700,7 +718,7 @@ String DataBrowser::GetCellText( long nRow, USHORT nColumnId ) const
return aResult;
}
-double DataBrowser::GetCellNumber( long nRow, USHORT nColumnId ) const
+double DataBrowser::GetCellNumber( long nRow, sal_uInt16 nColumnId ) const
{
double fResult;
::rtl::math::setNan( & fResult );
@@ -717,8 +735,8 @@ double DataBrowser::GetCellNumber( long nRow, USHORT nColumnId ) const
void DataBrowser::Resize()
{
- BOOL bLastUpdateMode = GetUpdateMode();
- SetUpdateMode( FALSE );
+ sal_Bool bLastUpdateMode = GetUpdateMode();
+ SetUpdateMode( sal_False );
::svt::EditBrowseBox::Resize();
ImplAdjustHeaderControls();
@@ -848,6 +866,9 @@ void DataBrowser::SetDataFromModel(
new NumberFormatterWrapper(
Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY )));
+ if( m_spNumberFormatterWrapper.get() )
+ m_aNumberEditField.SetFormatter( m_spNumberFormatterWrapper->getSvNumberFormatter() );
+
RenewTable();
const sal_Int32 nColCnt = m_apDataBrowserModel->getColumnCount();
@@ -1115,6 +1136,22 @@ sal_uInt32 DataBrowser::GetNumberFormatKey( sal_Int32 nRow, sal_uInt16 nCol ) co
return m_apDataBrowserModel->getNumberFormatKey( lcl_getColumnInData( nCol ), lcl_getRowInData( nRow ));
}
+bool DataBrowser::isDateString( rtl::OUString aInputString, double& fOutDateValue )
+{
+ sal_uInt32 nNumberFormat=0;
+ SvNumberFormatter* pSvNumberFormatter = m_spNumberFormatterWrapper.get() ? m_spNumberFormatterWrapper->getSvNumberFormatter() : 0;
+ if( aInputString.getLength() > 0 && pSvNumberFormatter && pSvNumberFormatter->IsNumberFormat( aInputString, nNumberFormat, fOutDateValue ) )
+ {
+ Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( m_xChartDoc, uno::UNO_QUERY );
+ Reference< util::XNumberFormats > xNumberFormats;
+ if( xNumberFormatsSupplier.is() )
+ xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() );
+ if( DiagramHelper::isDateNumberFormat( nNumberFormat, xNumberFormats ) )
+ return true;
+ }
+ return false;
+}
+
sal_Bool DataBrowser::SaveModified()
{
if( ! IsModified() )
@@ -1127,6 +1164,7 @@ sal_Bool DataBrowser::SaveModified()
DBG_ASSERT( nRow >= 0 || nCol >= 0, "This cell should not be modified!" );
+ SvNumberFormatter* pSvNumberFormatter = m_spNumberFormatterWrapper.get() ? m_spNumberFormatterWrapper->getSvNumberFormatter() : 0;
switch( m_apDataBrowserModel->getCellType( nCol, nRow ))
{
case DataBrowserModel::NUMBER:
@@ -1136,11 +1174,8 @@ sal_Bool DataBrowser::SaveModified()
String aText( m_aNumberEditField.GetText());
// an empty string is valid, if no numberformatter exists, all
// values are treated as valid
- if( aText.Len() > 0 &&
- m_spNumberFormatterWrapper.get() &&
- m_spNumberFormatterWrapper->getSvNumberFormatter() &&
- ! m_spNumberFormatterWrapper->getSvNumberFormatter()->IsNumberFormat(
- aText, nDummy, fDummy ))
+ if( aText.Len() > 0 && pSvNumberFormatter &&
+ ! pSvNumberFormatter->IsNumberFormat( aText, nDummy, fDummy ) )
{
bChangeValid = sal_False;
}
@@ -1151,6 +1186,17 @@ sal_Bool DataBrowser::SaveModified()
}
}
break;
+ case DataBrowserModel::TEXTORDATE:
+ {
+ OUString aText( m_aTextEditField.GetText() );
+ double fDateValue=0.0;
+ bChangeValid = sal_False;
+ if( isDateString( aText, fDateValue ) )
+ bChangeValid = m_apDataBrowserModel->setCellAny( nCol, nRow, uno::makeAny( fDateValue ) );
+ if(!bChangeValid)
+ bChangeValid = m_apDataBrowserModel->setCellAny( nCol, nRow, uno::makeAny( aText ) );
+ }
+ break;
case DataBrowserModel::TEXT:
{
OUString aText( m_aTextEditField.GetText());
@@ -1191,10 +1237,10 @@ sal_Int16 DataBrowser::GetFirstVisibleColumNumber() const
return GetFirstVisibleColNumber();
}
-void DataBrowser::ColumnResized( USHORT nColId )
+void DataBrowser::ColumnResized( sal_uInt16 nColId )
{
- BOOL bLastUpdateMode = GetUpdateMode();
- SetUpdateMode( FALSE );
+ sal_Bool bLastUpdateMode = GetUpdateMode();
+ SetUpdateMode( sal_False );
EditBrowseBox::ColumnResized( nColId );
ImplAdjustHeaderControls();
@@ -1203,8 +1249,8 @@ void DataBrowser::ColumnResized( USHORT nColId )
void DataBrowser::EndScroll()
{
- BOOL bLastUpdateMode = GetUpdateMode();
- SetUpdateMode( FALSE );
+ sal_Bool bLastUpdateMode = GetUpdateMode();
+ SetUpdateMode( sal_False );
EditBrowseBox::EndScroll();
RenewSeriesHeaders();
@@ -1331,8 +1377,8 @@ IMPL_LINK( DataBrowser, SeriesHeaderChanged, impl::SeriesHeaderEdit*, pEdit )
sal_Int32 DataBrowser::GetTotalWidth() const
{
- ULONG nWidth = 0;
- for ( USHORT nCol = 0; nCol < ColCount(); ++nCol )
+ sal_uLong nWidth = 0;
+ for ( sal_uInt16 nCol = 0; nCol < ColCount(); ++nCol )
nWidth += GetColumnWidth( nCol );
return static_cast< sal_Int32 >( nWidth );
}
diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx
index 9ebaca3f860e..4f63138cd619 100644
--- a/chart2/source/controller/dialogs/DataBrowser.hxx
+++ b/chart2/source/controller/dialogs/DataBrowser.hxx
@@ -69,7 +69,7 @@ protected:
virtual void CursorMoved();
// called whenever the control of the current cell has been modified
virtual void CellModified();
- virtual void ColumnResized( USHORT nColId );
+ virtual void ColumnResized( sal_uInt16 nColId );
virtual void EndScroll();
virtual void MouseButtonDown( const BrowserMouseEvent& rEvt );
@@ -87,12 +87,14 @@ public:
@return
the text out of the cell
*/
- virtual String GetCellText(long nRow, USHORT nColId) const;
+ virtual String GetCellText(long nRow, sal_uInt16 nColId) const;
/** returns the number in the given cell. If a cell is empty or contains a
string, the result will be Nan
*/
- double GetCellNumber( long nRow, USHORT nColumnId ) const;
+ double GetCellNumber( long nRow, sal_uInt16 nColumnId ) const;
+
+ bool isDateString( rtl::OUString aInputString, double& fOutDateValue );
// Window
virtual void Resize();
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index d092d81d7383..f5d9628a1b31 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -44,6 +44,7 @@
#include "ExplicitCategoriesProvider.hxx"
#include <com/sun/star/container/XIndexReplace.hpp>
+#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/XInternalDataProvider.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -589,7 +590,7 @@ Reference< chart2::XDataSeries >
return 0;
}
-DataBrowserModel::eCellType DataBrowserModel::getCellType( sal_Int32 nAtColumn, sal_Int32 /* nAtRow */ )
+DataBrowserModel::eCellType DataBrowserModel::getCellType( sal_Int32 nAtColumn, sal_Int32 /* nAtRow */ ) const
{
eCellType eResult = TEXT;
tDataColumnVector::size_type nIndex( nAtColumn );
@@ -619,6 +620,26 @@ double DataBrowserModel::getCellNumber( sal_Int32 nAtColumn, sal_Int32 nAtRow )
return fResult;
}
+uno::Any DataBrowserModel::getCellAny( sal_Int32 nAtColumn, sal_Int32 nAtRow )
+{
+ uno::Any aResult;
+
+ tDataColumnVector::size_type nIndex( nAtColumn );
+ if( nIndex < m_aColumns.size() &&
+ m_aColumns[ nIndex ].m_xLabeledDataSequence.is())
+ {
+ Reference< chart2::data::XDataSequence > xData(
+ m_aColumns[ nIndex ].m_xLabeledDataSequence->getValues() );
+ if( xData.is() )
+ {
+ Sequence< uno::Any > aValues( xData->getData());
+ if( nAtRow < aValues.getLength())
+ aResult = aValues[nAtRow];
+ }
+ }
+ return aResult;
+}
+
OUString DataBrowserModel::getCellText( sal_Int32 nAtColumn, sal_Int32 nAtRow )
{
OUString aResult;
@@ -800,7 +821,7 @@ void DataBrowserModel::updateFromModel()
aCategories.m_aUIRoleName = DialogModel::GetRoleDataLabel();
else
aCategories.m_aUIRoleName = lcl_getUIRoleName( xCategories );
- aCategories.m_eCellType = TEXT;
+ aCategories.m_eCellType = TEXTORDATE;
m_aColumns.push_back( aCategories );
++nHeaderStart;
}
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.hxx b/chart2/source/controller/dialogs/DataBrowserModel.hxx
index 58d64be83a80..ee48fa0d8065 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.hxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.hxx
@@ -82,18 +82,20 @@ public:
enum eCellType
{
NUMBER,
- TEXT
+ TEXT,
+ TEXTORDATE
};
- eCellType getCellType( sal_Int32 nAtColumn, sal_Int32 nAtRow );
+ eCellType getCellType( sal_Int32 nAtColumn, sal_Int32 nAtRow ) const;
/// If getCellType( nAtColumn, nAtRow ) returns TEXT, the result will be Nan
double getCellNumber( sal_Int32 nAtColumn, sal_Int32 nAtRow );
::rtl::OUString getCellText( sal_Int32 nAtColumn, sal_Int32 nAtRow );
+ ::com::sun::star::uno::Any getCellAny( sal_Int32 nAtColumn, sal_Int32 nAtRow );
sal_uInt32 getNumberFormatKey( sal_Int32 nAtColumn, sal_Int32 nAtRow );
- /// returns </TRUE> if the number could successfully be set at the given position
+ /// returns </sal_True> if the number could successfully be set at the given position
bool setCellNumber( sal_Int32 nAtColumn, sal_Int32 nAtRow, double fValue );
- /// returns </TRUE> if the text could successfully be set at the given position
+ /// returns </sal_True> if the text could successfully be set at the given position
bool setCellText( sal_Int32 nAtColumn, sal_Int32 nAtRow, const ::rtl::OUString & rText );
bool setCellAny( sal_Int32 nAtColumn, sal_Int32 nAtRow, const ::com::sun::star::uno::Any & aValue );
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index 8a86162061ae..ac2d4fa07129 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -162,7 +162,7 @@ void lcl_createRoleIndexMap( lcl_tRoleIndexMap & rOutMap )
struct lcl_DataSeriesContainerAppend : public
::std::iterator< ::std::output_iterator_tag, Reference< XDataSeriesContainer > >
{
- typedef ::std::vector< chart::DialogModel::tSeriesWithChartTypeByName > tContainerType;
+ typedef ::std::vector< ::chart::DialogModel::tSeriesWithChartTypeByName > tContainerType;
explicit lcl_DataSeriesContainerAppend( tContainerType & rCnt )
: m_rDestCnt( rCnt )
@@ -182,7 +182,7 @@ struct lcl_DataSeriesContainerAppend : public
for( sal_Int32 nI = 0; nI < aSeq.getLength(); ++ nI )
{
m_rDestCnt.push_back(
- chart::DialogModel::tSeriesWithChartTypeByName(
+ ::chart::DialogModel::tSeriesWithChartTypeByName(
::chart::DataSeriesHelper::getDataSeriesLabel( aSeq[nI], aRole ),
::std::make_pair( aSeq[nI], xCT )));
}
@@ -383,7 +383,6 @@ DialogModel::DialogModel(
m_xContext( xContext ),
m_aTimerTriggeredControllerLock( uno::Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) )
{
- createBackup();
}
DialogModel::~DialogModel()
@@ -752,20 +751,6 @@ sal_Int32 DialogModel::GetRoleIndexForSorting( const ::rtl::OUString & rInternal
// private methods
-void DialogModel::createBackup()
-{
- OSL_ENSURE( ! m_xBackupChartDocument.is(), "Cloning already cloned model" );
- try
- {
- Reference< util::XCloneable > xCloneable( m_xChartDocument, uno::UNO_QUERY_THROW );
- m_xBackupChartDocument.set( xCloneable->createClone(), uno::UNO_QUERY_THROW );
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
-}
-
void DialogModel::applyInterpretedData(
const InterpretedData & rNewData,
const ::std::vector< Reference< XDataSeries > > & rSeriesToReUse,
diff --git a/chart2/source/controller/dialogs/DialogModel.hxx b/chart2/source/controller/dialogs/DialogModel.hxx
index 3f79356e8675..8b113311e927 100644
--- a/chart2/source/controller/dialogs/DialogModel.hxx
+++ b/chart2/source/controller/dialogs/DialogModel.hxx
@@ -164,10 +164,6 @@ private:
m_xChartDocument;
::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XChartDocument >
- m_xBackupChartDocument;
-
- ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartTypeTemplate >
m_xTemplate;
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 86b85c427828..34838abaeee3 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -41,7 +41,7 @@
#include "AxisIndexDefines.hxx"
#include "ExplicitCategoriesProvider.hxx"
#include "CommonConverters.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "RegressionCurveHelper.hxx"
#include <rtl/math.hxx>
#include <tools/debug.hxx>
@@ -192,14 +192,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
if( aX.getLength() == 0 )
{
- rtl::OUString aCategory = ::rtl::OUString( String(SchResId(STR_TIP_CATEGORY_VALUE)));
-
- replaceParamterInString( aCategory
- , C2U("%CATEGORYVALUE")
- , ExplicitCategoriesProvider::getCategoryByIndex( xCooSys, xChartModel, nPointIndex )
- );
-
- aRet = aCategory;
+ aRet = ExplicitCategoriesProvider::getCategoryByIndex( xCooSys, xChartModel, nPointIndex );
}
else
{
diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src
index cf189b1b82bf..67967140ae71 100644
--- a/chart2/source/controller/dialogs/Strings.src
+++ b/chart2/source/controller/dialogs/Strings.src
@@ -101,6 +101,15 @@ String STR_PAGE_POSITION
Text [ en-US ] = "Position" ;
};
+String STR_BUTTON_UP
+{
+ Text [ en-US ] = "Up";
+};
+String STR_BUTTON_DOWN
+{
+ Text [ en-US ] = "Down";
+};
+
String STR_PAGE_LAYOUT
{
Text [ en-US ] = "Layout";
@@ -383,11 +392,6 @@ String STR_TIP_DATAPOINT_VALUES
Text [ en-US ] = "Values: %POINTVALUES";
};
-String STR_TIP_CATEGORY_VALUE
-{
- Text [ en-US ] = "'%CATEGORYVALUE'";
-};
-
String STR_TIP_DATAPOINT
{
Text [ en-US ] = "Data Point %POINTNUMBER, data series %SERIESNUMBER, values: %POINTVALUES";
@@ -458,6 +462,10 @@ String STR_ACTION_NOTPOSSIBLE
{
Text [ en-US ] = "This function cannot be completed with the selected objects." ;
};
+String STR_ACTION_EDIT_TEXT
+{
+ Text [ en-US ] = "Edit text";
+};
String STR_COLUMN_LABEL
{
diff --git a/chart2/source/controller/dialogs/Strings_Scale.src b/chart2/source/controller/dialogs/Strings_Scale.src
index e7a3d6c2b1cf..6f8b75d9509c 100644
--- a/chart2/source/controller/dialogs/Strings_Scale.src
+++ b/chart2/source/controller/dialogs/Strings_Scale.src
@@ -42,3 +42,11 @@ String STR_MIN_GREATER_MAX
{
Text [ en-US ] = "The minimum must be lower than the maximum. Check your input." ;
};
+String STR_INVALID_INTERVALS
+{
+ Text [ en-US ] = "The major interval needs to be greater than the minor interval. Check your input." ;
+};
+String STR_INVALID_TIME_UNIT
+{
+ Text [ en-US ] = "The major and minor interval need to be greater or equal to the resolution. Check your input." ;
+};
diff --git a/chart2/source/controller/dialogs/Strings_Statistic.src b/chart2/source/controller/dialogs/Strings_Statistic.src
index f2dc4235f783..10c59a4c9b1d 100644
--- a/chart2/source/controller/dialogs/Strings_Statistic.src
+++ b/chart2/source/controller/dialogs/Strings_Statistic.src
@@ -51,22 +51,22 @@ String STR_CONTROLTEXT_ERROR_BARS_FROM_DATA
String STR_REGRESSION_LINEAR
{
- Text [ en-US ] = "Linear Regression" ;
+ Text [ en-US ] = "Linear (%SERIESNAME)" ;
};
String STR_REGRESSION_LOG
{
- Text [ en-US ] = "Logarithmic Regression" ;
+ Text [ en-US ] = "Logarithmic (%SERIESNAME)" ;
};
String STR_REGRESSION_EXP
{
- Text [ en-US ] = "Exponential Regression" ;
+ Text [ en-US ] = "Exponential (%SERIESNAME)" ;
};
String STR_REGRESSION_POWER
{
- Text [ en-US ] = "Power Regression" ;
+ Text [ en-US ] = "Power (%SERIESNAME)" ;
};
-String STR_STATISTICS_IN_LEGEND
+String STR_REGRESSION_MEAN
{
- Text [ en-US ] = "%REGRESSIONCURVE for %SERIESNAME" ;
+ Text [ en-US ] = "Mean (%SERIESNAME)" ;
};
diff --git a/chart2/source/controller/dialogs/TabPages.hrc b/chart2/source/controller/dialogs/TabPages.hrc
index 697f700d4de9..c43ef24cd003 100644
--- a/chart2/source/controller/dialogs/TabPages.hrc
+++ b/chart2/source/controller/dialogs/TabPages.hrc
@@ -77,28 +77,9 @@
#define FL_SEPARATOR 18
#define FT_AXIS_TEXTDIR 19
#define LB_AXIS_TEXTDIR 20
-#define FL_SCALE 1
-
-#define TXT_MIN 1
-#define TXT_MAX 2
-#define TXT_STEP_MAIN 3
-#define TXT_STEP_HELP 4
-#define TXT_ORIGIN 5
-
-#define CBX_AUTO_MIN 1
-#define CBX_AUTO_MAX 2
-#define CBX_AUTO_STEP_MAIN 3
-#define CBX_AUTO_STEP_HELP 4
-#define CBX_AUTO_ORIGIN 5
-#define CBX_LOGARITHM 6
-#define CBX_REVERSE 7
-
-#define EDT_STEP_MAIN 1
-#define EDT_MAX 2
-#define EDT_MIN 3
-#define EDT_ORIGIN 4
-
-#define MT_STEPHELP 10
+
+//#define TP_AXIS_POSITIONS 904
+
#define FL_AXIS_LINE 1
#define FL_LABELS 2
#define FL_TICKS 3
diff --git a/chart2/source/controller/dialogs/dlg_ChartType.src b/chart2/source/controller/dialogs/dlg_ChartType.src
index 5523ad8956db..57e1f281a613 100644
--- a/chart2/source/controller/dialogs/dlg_ChartType.src
+++ b/chart2/source/controller/dialogs/dlg_ChartType.src
@@ -38,7 +38,7 @@
ModalDialog DLG_DIAGRAM_TYPE
{
- HelpID = SID_DIAGRAM_TYPE ;
+ HelpID = HID_DIAGRAM_TYPE ;
Size = MAP_APPFONT ( CHART_TYPE_DLG_WIDTH , CHART_TYPE_DLG_HEIGHT ) ;
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
index 31e9d542ec05..d4e7147ac23a 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
@@ -84,7 +84,7 @@ CreationWizard::CreationWizard( Window* pParent, const uno::Reference< frame::XM
m_apDialogModel.reset( new DialogModel( m_xChartModel, m_xCC ));
// Do not call FreeResource(), because there are no sub-elements defined in
// the dialog resource
- ShowButtonFixedLine( TRUE );
+ ShowButtonFixedLine( sal_True );
defaultButton( WZB_FINISH );
if( m_nOnePageOnlyIndex < 0 || m_nOnePageOnlyIndex >= nPageCount )
@@ -102,7 +102,7 @@ CreationWizard::CreationWizard( Window* pParent, const uno::Reference< frame::XM
, STATE_OBJECTS
, WZS_INVALID_STATE
);
- this->SetRoadmapSmartHelpId( SmartId( HID_SCH_WIZARD_ROADMAP ) );
+ this->SetRoadmapHelpId( HID_SCH_WIZARD_ROADMAP );
this->SetRoadmapInteractive( sal_True );
Size aAdditionalRoadmapSize( LogicToPixel( Size( 85, 0 ), MAP_APPFONT ) );
Size aSize( this->GetSizePixel() );
@@ -213,7 +213,7 @@ void CreationWizard::setValidPage( TabPage * /* pTabPage */ )
String CreationWizard::getStateDisplayName( WizardState nState ) const
{
- USHORT nResId = 0;
+ sal_uInt16 nResId = 0;
switch( nState )
{
case STATE_CHARTTYPE:
diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx
index 8f3502204107..574b464b5dac 100644
--- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx
@@ -186,13 +186,13 @@ void DataEditor::SetReadOnly( bool bReadOnly )
m_bReadOnly = bReadOnly;
if( m_bReadOnly )
{
- m_aTbxData.EnableItem( TBI_DATA_INSERT_ROW, FALSE );
- m_aTbxData.EnableItem( TBI_DATA_INSERT_COL, FALSE );
- m_aTbxData.EnableItem( TBI_DATA_INSERT_TEXT_COL, FALSE );
- m_aTbxData.EnableItem( TBI_DATA_DELETE_ROW, FALSE );
- m_aTbxData.EnableItem( TBI_DATA_DELETE_COL, FALSE );
- m_aTbxData.EnableItem( TBI_DATA_SWAP_COL, FALSE );
- m_aTbxData.EnableItem( TBI_DATA_SWAP_ROW, FALSE );
+ m_aTbxData.EnableItem( TBI_DATA_INSERT_ROW, sal_False );
+ m_aTbxData.EnableItem( TBI_DATA_INSERT_COL, sal_False );
+ m_aTbxData.EnableItem( TBI_DATA_INSERT_TEXT_COL, sal_False );
+ m_aTbxData.EnableItem( TBI_DATA_DELETE_ROW, sal_False );
+ m_aTbxData.EnableItem( TBI_DATA_DELETE_COL, sal_False );
+ m_aTbxData.EnableItem( TBI_DATA_SWAP_COL, sal_False );
+ m_aTbxData.EnableItem( TBI_DATA_SWAP_ROW, sal_False );
}
m_apBrwData->SetReadOnly( m_bReadOnly );
@@ -235,12 +235,12 @@ void DataEditor::Resize()
AdaptBrowseBoxSize();
}
-BOOL DataEditor::Close()
+sal_Bool DataEditor::Close()
{
if( ApplyChangesToModel() )
return ModalDialog::Close();
else
- return TRUE;
+ return sal_True;
}
bool DataEditor::ApplyChangesToModel()
diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.src b/chart2/source/controller/dialogs/dlg_DataEditor.src
index 4f4d33ebb832..1bee31dd21fe 100644
--- a/chart2/source/controller/dialogs/dlg_DataEditor.src
+++ b/chart2/source/controller/dialogs/dlg_DataEditor.src
@@ -36,7 +36,7 @@
ModalDialog DLG_DIAGRAM_DATA
{
- HelpID = SID_DIAGRAM_DATA ;
+ HelpID = HID_DIAGRAM_DATA ;
OutputSize = TRUE ;
Hide = TRUE ;
SVLook = TRUE ;
diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx
index ec72cd6c0381..b90f9a569665 100644
--- a/chart2/source/controller/dialogs/dlg_DataSource.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx
@@ -147,7 +147,7 @@ void DataSourceTabControl::EnableTabToggling()
// ----------------------------------------
-USHORT DataSourceDialog::m_nLastPageId = 0;
+sal_uInt16 DataSourceDialog::m_nLastPageId = 0;
DataSourceDialog::DataSourceDialog(
Window * pParent,
@@ -221,7 +221,7 @@ void DataSourceDialog::setInvalidPage( TabPage * pTabPage )
if( ! (m_bRangeChooserTabIsValid && m_bDataSourceTabIsValid ))
{
- m_aBtnOK.Enable( FALSE );
+ m_aBtnOK.Enable( sal_False );
OSL_ASSERT( m_pTabControl );
// note: there seems to be no suitable mechanism to address pages by
// identifier, at least it is unclear what the page identifiers are.
@@ -243,7 +243,7 @@ void DataSourceDialog::setValidPage( TabPage * pTabPage )
if( m_bRangeChooserTabIsValid && m_bDataSourceTabIsValid )
{
- m_aBtnOK.Enable( TRUE );
+ m_aBtnOK.Enable( sal_True );
OSL_ASSERT( m_pTabControl );
m_pTabControl->EnableTabToggling();
}
diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
index 0ca0a2abc497..7e0bc698f436 100644
--- a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
@@ -64,7 +64,7 @@ InsertAxisOrGridDialogData::InsertAxisOrGridDialogData()
//==============================
SchAxisDlg::SchAxisDlg( Window* pWindow
- , const InsertAxisOrGridDialogData& rInput, BOOL bAxisDlg )
+ , const InsertAxisOrGridDialogData& rInput, sal_Bool bAxisDlg )
:
ModalDialog( pWindow, SchResId( DLG_AXIS_OR_GRID )),
@@ -89,7 +89,7 @@ SchAxisDlg::SchAxisDlg( Window* pWindow
FreeResource();
if(!bAxisDlg)
{
- SetHelpId( SID_INSERT_GRIDS );
+ SetHelpId( HID_INSERT_GRIDS );
SetText( ObjectNameProvider::getName(OBJECTTYPE_GRID,true) );
aCbPrimaryX.SetHelpId( HID_SCH_CB_XGRID );
diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.src b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.src
index 91d995b5231c..03faaa4ede45 100644
--- a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.src
+++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.src
@@ -33,7 +33,7 @@
ModalDialog DLG_AXIS_OR_GRID
{
- HelpID = SID_INSERT_AXIS ;
+ HelpID = HID_INSERT_AXIS ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 160 , 113 ) ;
diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.src b/chart2/source/controller/dialogs/dlg_InsertDataLabel.src
index 8f8a64485778..24ae2f63fce1 100644
--- a/chart2/source/controller/dialogs/dlg_InsertDataLabel.src
+++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.src
@@ -32,7 +32,7 @@
ModalDialog DLG_DATA_DESCR
{
- HelpID = SID_INSERT_DESCRIPTION ;
+ HelpID = HID_INSERT_DESCRIPTION ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 316 , 185 ) ;
diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
index 78218e2e4ae1..d804d19e3cf8 100644
--- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
@@ -119,7 +119,7 @@ double InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals(
pExplicitValueProvider->getExplicitValuesForAxis( xAxis,aExplicitScale, aExplicitIncrement );
fStepWidth = aExplicitIncrement.Distance;
- if( aExplicitIncrement.SubIncrements.getLength() && aExplicitIncrement.SubIncrements[0].IntervalCount>0 )
+ if( !aExplicitIncrement.SubIncrements.empty() && aExplicitIncrement.SubIncrements[0].IntervalCount>0 )
fStepWidth=fStepWidth/double(aExplicitIncrement.SubIncrements[0].IntervalCount);
else
fStepWidth/=10;
diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.src b/chart2/source/controller/dialogs/dlg_InsertErrorBars.src
index f7a61cf1e283..462c81211011 100644
--- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.src
+++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.src
@@ -33,6 +33,7 @@
ModalDialog DLG_DATA_YERRORBAR
{
+ HelpID = "chart2:ModalDialog:DLG_DATA_YERRORBAR";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 300 , 156 ) ;
diff --git a/chart2/source/controller/dialogs/dlg_InsertLegend.src b/chart2/source/controller/dialogs/dlg_InsertLegend.src
index 95a1d5516ab5..1f768f7c065b 100644
--- a/chart2/source/controller/dialogs/dlg_InsertLegend.src
+++ b/chart2/source/controller/dialogs/dlg_InsertLegend.src
@@ -36,7 +36,7 @@
ModalDialog DLG_LEGEND
{
- HelpID = SID_INSERT_CHART_LEGEND ;
+ HelpID = HID_INSERT_CHART_LEGEND ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 156 , 80 ) ;
diff --git a/chart2/source/controller/dialogs/dlg_InsertTitle.src b/chart2/source/controller/dialogs/dlg_InsertTitle.src
index f84ff2c6acd7..446763e93b9e 100644
--- a/chart2/source/controller/dialogs/dlg_InsertTitle.src
+++ b/chart2/source/controller/dialogs/dlg_InsertTitle.src
@@ -32,7 +32,7 @@
ModalDialog DLG_TITLE
{
- HelpID = SID_INSERT_TITLE ;
+ HelpID = HID_INSERT_TITLE ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 220 , 156 ) ;
diff --git a/chart2/source/controller/dialogs/dlg_InsertTrendline.src b/chart2/source/controller/dialogs/dlg_InsertTrendline.src
index 24704f0d0c7c..3a866501ef92 100644
--- a/chart2/source/controller/dialogs/dlg_InsertTrendline.src
+++ b/chart2/source/controller/dialogs/dlg_InsertTrendline.src
@@ -37,7 +37,7 @@
ModalDialog DLG_DATA_TRENDLINE
{
- HelpID = SID_INSERT_STATISTICS ;
+ HelpID = HID_INSERT_STATISTICS ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT( DLG_DATA_TRENDLINE_RES_WIDTH + DLG_DATA_TRENDLINE_ADD_TO_RES, 172 );
diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
index 87533fc9069c..b50398309700 100644
--- a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
+++ b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
@@ -70,7 +70,7 @@ NumberFormatDialog::~NumberFormatDialog()
SfxItemSet NumberFormatDialog::CreateEmptyItemSetForNumberFormatDialog( SfxItemPool& rItemPool )
{
- static const USHORT nWhichPairs[] =
+ static const sal_uInt16 nWhichPairs[] =
{
SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO,
SID_ATTR_NUMBERFORMAT_NOLANGUAGE, SID_ATTR_NUMBERFORMAT_NOLANGUAGE,
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index a7f30165c0c2..54e0a606cd3d 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -57,9 +57,10 @@
#include "ChartTypeHelper.hxx"
#include "ObjectNameProvider.hxx"
#include "DiagramHelper.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "AxisIndexDefines.hxx"
#include "AxisHelper.hxx"
+#include "ExplicitCategoriesProvider.hxx"
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XChartType.hpp>
@@ -117,6 +118,7 @@ ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const rtl::OUS
, m_bIsCrossingAxisIsCategoryAxis(false)
, m_aCategories()
, m_xChartDocument( 0 )
+ , m_bComplexCategoriesAxis( false )
{
rtl::OUString aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID );
m_bAffectsMultipleObjects = aParticleID.equals(C2U("ALLELEMENTS"));
@@ -180,7 +182,7 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel
ScaleData aData( xAxis->getScaleData() );
if( chart2::AxisType::SERIES == aData.AxisType )
m_bHasScaleProperties = false;
- if( chart2::AxisType::REALNUMBER == aData.AxisType || chart2::AxisType::PERCENT == aData.AxisType )
+ if( chart2::AxisType::SERIES != aData.AxisType )
m_bHasNumberProperties = true;
sal_Int32 nCooSysIndex=0;
@@ -207,6 +209,13 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel
if( m_bIsCrossingAxisIsCategoryAxis )
m_aCategories = DiagramHelper::getExplicitSimpleCategories( Reference< chart2::XChartDocument >( xChartModel, uno::UNO_QUERY) );
}
+
+ m_bComplexCategoriesAxis = false;
+ if ( nDimensionIndex == 0 && aData.AxisType == chart2::AxisType::CATEGORY )
+ {
+ ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys, xChartModel );
+ m_bComplexCategoriesAxis = aExplicitCategoriesProvider.hasComplexCategories();
+ }
}
}
@@ -323,8 +332,12 @@ uno::Reference< chart2::XChartDocument > ObjectPropertiesDialogParameter::getDoc
{
return m_xChartDocument;
}
+bool ObjectPropertiesDialogParameter::IsComplexCategoriesAxis() const
+{
+ return m_bComplexCategoriesAxis;
+}
-const USHORT nNoArrowNoShadowDlg = 1101;
+const sal_uInt16 nNoArrowNoShadowDlg = 1101;
//-------------------------------------------------------------------
//-------------------------------------------------------------------
@@ -505,7 +518,7 @@ SchAttribTabDlg::~SchAttribTabDlg()
delete m_pAutoSymbolGraphic;
}
-void SchAttribTabDlg::PageCreated(USHORT nId, SfxTabPage &rPage)
+void SchAttribTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
switch (nId)
@@ -561,6 +574,7 @@ void SchAttribTabDlg::PageCreated(USHORT nId, SfxTabPage &rPage)
{
bool bShowStaggeringControls = m_pParameter->CanAxisLabelsBeStaggered();
((SchAxisLabelTabPage&)rPage).ShowStaggeringControls( bShowStaggeringControls );
+ ( dynamic_cast< SchAxisLabelTabPage& >( rPage ) ).SetComplexCategories( m_pParameter->IsComplexCategoriesAxis() );
break;
}
@@ -604,7 +618,7 @@ void SchAttribTabDlg::PageCreated(USHORT nId, SfxTabPage &rPage)
break;
case RID_SVXPAGE_NUMBERFORMAT:
- aSet.Put (SvxNumberInfoItem( m_pNumberFormatter, (const USHORT)SID_ATTR_NUMBERFORMAT_INFO));
+ aSet.Put (SvxNumberInfoItem( m_pNumberFormatter, (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO));
rPage.PageCreated(aSet);
break;
diff --git a/chart2/source/controller/dialogs/dlg_ShapeFont.cxx b/chart2/source/controller/dialogs/dlg_ShapeFont.cxx
index 3f188aa90bfd..5bf73b537b59 100644
--- a/chart2/source/controller/dialogs/dlg_ShapeFont.cxx
+++ b/chart2/source/controller/dialogs/dlg_ShapeFont.cxx
@@ -64,7 +64,7 @@ ShapeFontDialog::~ShapeFontDialog()
{
}
-void ShapeFontDialog::PageCreated( USHORT nId, SfxTabPage& rPage )
+void ShapeFontDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
{
SfxAllItemSet aSet( *( GetInputSetImpl()->GetPool() ) );
switch ( nId )
diff --git a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
index ee43d301255f..b53851f20779 100644
--- a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
+++ b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
@@ -70,7 +70,7 @@ ShapeParagraphDialog::~ShapeParagraphDialog()
{
}
-void ShapeParagraphDialog::PageCreated( USHORT nId, SfxTabPage& rPage )
+void ShapeParagraphDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
{
SfxAllItemSet aSet( *( GetInputSetImpl()->GetPool() ) );
switch ( nId )
diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx
index 11170fa5a466..b852d561764d 100644
--- a/chart2/source/controller/dialogs/dlg_View3D.cxx
+++ b/chart2/source/controller/dialogs/dlg_View3D.cxx
@@ -57,7 +57,8 @@ using namespace ::com::sun::star::chart2;
//-----------------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
-USHORT View3DDialog::m_nLastPageId = 0;
+
+sal_uInt16 View3DDialog::m_nLastPageId = 0;
View3DDialog::View3DDialog(Window* pParent, const uno::Reference< frame::XModel > & xChartModel, XColorTable* pColorTable )
: TabDialog(pParent,SchResId(DLG_3D_VIEW))
diff --git a/chart2/source/controller/dialogs/dlg_View3D.src b/chart2/source/controller/dialogs/dlg_View3D.src
index 0f1fb639d326..02818733b2a9 100644
--- a/chart2/source/controller/dialogs/dlg_View3D.src
+++ b/chart2/source/controller/dialogs/dlg_View3D.src
@@ -28,10 +28,11 @@
#include "dlg_View3D.hrc"
#include "SchSlotIds.hxx"
#include "CommonResources.hrc"
+#include "HelpIds.hrc"
TabDialog DLG_3D_VIEW
{
- HelpID = SID_3D_VIEW ;
+ HelpID = HID_3D_VIEW ;
OutputSize = TRUE ;
SVLook = TRUE ;
Moveable = TRUE ;
diff --git a/chart2/source/controller/dialogs/hidother.src b/chart2/source/controller/dialogs/hidother.src
index 4b006f0f1f93..195115e93bd1 100644
--- a/chart2/source/controller/dialogs/hidother.src
+++ b/chart2/source/controller/dialogs/hidother.src
@@ -25,9 +25,6 @@
*
************************************************************************/
#include "HelpIds.hrc"
-#include "SchSlotIds.hxx"
-
-hidspecial SID_INSERT_GRIDS {HelpId= SID_INSERT_GRIDS; };
hidspecial HID_SCH_CB_XAXIS {HelpId= HID_SCH_CB_XAXIS; };
hidspecial HID_SCH_CB_YAXIS {HelpId= HID_SCH_CB_YAXIS; };
diff --git a/chart2/source/controller/dialogs/res_BarGeometry.cxx b/chart2/source/controller/dialogs/res_BarGeometry.cxx
index 06b8be7a3f6e..45465066db7e 100644
--- a/chart2/source/controller/dialogs/res_BarGeometry.cxx
+++ b/chart2/source/controller/dialogs/res_BarGeometry.cxx
@@ -47,6 +47,8 @@ BarGeometryResources::BarGeometryResources( Window* pWindow )
{
m_aFT_Geometry.SetText( String( SchResId( STR_BAR_GEOMETRY )) );
m_aFT_Geometry.SetSizePixel( m_aFT_Geometry.CalcMinimumSize() );
+ m_aLB_Geometry.SetAccessibleName(m_aFT_Geometry.GetText());
+ m_aLB_Geometry.SetAccessibleRelationLabeledBy(&m_aFT_Geometry);
}
void BarGeometryResources::SetPosPixel( const Point& rPosition )
{
@@ -91,15 +93,15 @@ void BarGeometryResources::Enable( bool bEnable )
m_aLB_Geometry.Enable( bEnable );
}
-USHORT BarGeometryResources::GetSelectEntryCount() const
+sal_uInt16 BarGeometryResources::GetSelectEntryCount() const
{
return m_aLB_Geometry.GetSelectEntryCount();
}
-USHORT BarGeometryResources::GetSelectEntryPos() const
+sal_uInt16 BarGeometryResources::GetSelectEntryPos() const
{
return m_aLB_Geometry.GetSelectEntryPos();
}
-void BarGeometryResources::SelectEntryPos( USHORT nPos )
+void BarGeometryResources::SelectEntryPos( sal_uInt16 nPos )
{
if( nPos < m_aLB_Geometry.GetEntryCount() )
m_aLB_Geometry.SelectEntryPos( nPos );
diff --git a/chart2/source/controller/dialogs/res_BarGeometry.hxx b/chart2/source/controller/dialogs/res_BarGeometry.hxx
index cdddd9cfb4ce..07d853d74dca 100644
--- a/chart2/source/controller/dialogs/res_BarGeometry.hxx
+++ b/chart2/source/controller/dialogs/res_BarGeometry.hxx
@@ -50,9 +50,9 @@ public:
void Show( bool bShow );
void Enable( bool bEnable );
- USHORT GetSelectEntryCount() const;
- USHORT GetSelectEntryPos() const;
- void SelectEntryPos( USHORT nPos );
+ sal_uInt16 GetSelectEntryCount() const;
+ sal_uInt16 GetSelectEntryPos() const;
+ void SelectEntryPos( sal_uInt16 nPos );
void SetSelectHdl( const Link& rLink );
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 27f54002c1d4..e7d3ed750f54 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -66,11 +66,11 @@ namespace chart
namespace
{
-bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, USHORT nValueWhich, USHORT nSourceFormatWhich, ULONG& rnFormatKeyOut, bool& rbSourceFormatOut, bool& rbSourceFormatMixedStateOut )
+bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, sal_uInt16 nValueWhich, sal_uInt16 nSourceFormatWhich, sal_uLong& rnFormatKeyOut, bool& rbSourceFormatOut, bool& rbSourceFormatMixedStateOut )
{
bool bSet = false;
const SfxPoolItem *pItem1 = NULL;
- if( rSet.GetItemState( nValueWhich, TRUE, &pItem1 ) == SFX_ITEM_SET )
+ if( rSet.GetItemState( nValueWhich, sal_True, &pItem1 ) == SFX_ITEM_SET )
{
const SfxUInt32Item * pNumItem = dynamic_cast< const SfxUInt32Item * >( pItem1 );
if( pNumItem )
@@ -82,7 +82,7 @@ bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, USHORT nValueWhich
rbSourceFormatMixedStateOut=true;
const SfxPoolItem *pItem2 = NULL;
- if( rSet.GetItemState( nSourceFormatWhich, TRUE, &pItem2 ) == SFX_ITEM_SET )
+ if( rSet.GetItemState( nSourceFormatWhich, sal_True, &pItem2 ) == SFX_ITEM_SET )
{
const SfxBoolItem * pBoolItem = dynamic_cast< const SfxBoolItem * >( pItem2 );
if( pBoolItem )
@@ -94,16 +94,16 @@ bool lcl_ReadNumberFormatFromItemSet( const SfxItemSet& rSet, USHORT nValueWhich
return bSet;
}
-void lcl_setBoolItemToCheckBox( const SfxItemSet& rInAttrs, USHORT nWhichId, CheckBox& rCheckbox )
+void lcl_setBoolItemToCheckBox( const SfxItemSet& rInAttrs, sal_uInt16 nWhichId, CheckBox& rCheckbox )
{
- rCheckbox.EnableTriState( FALSE );
+ rCheckbox.EnableTriState( sal_False );
const SfxPoolItem *pPoolItem = NULL;
- if( rInAttrs.GetItemState(nWhichId, TRUE, &pPoolItem) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState(nWhichId, sal_True, &pPoolItem) == SFX_ITEM_SET )
rCheckbox.Check( ((const SfxBoolItem*)pPoolItem)->GetValue() );
else
{
- rCheckbox.EnableTriState( TRUE );
+ rCheckbox.EnableTriState( sal_True );
rCheckbox.SetState( STATE_DONTKNOW );
}
}
@@ -141,17 +141,17 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt
//fill label placement list
std::map< sal_Int32, XubString > aPlacementToStringMap;
for( sal_Int32 nEnum=0; nEnum<m_aLB_LabelPlacement.GetEntryCount(); ++nEnum )
- aPlacementToStringMap[nEnum]=m_aLB_LabelPlacement.GetEntry(static_cast<USHORT>(nEnum));
+ aPlacementToStringMap[nEnum]=m_aLB_LabelPlacement.GetEntry(static_cast<sal_uInt16>(nEnum));
::com::sun::star::uno::Sequence < sal_Int32 > aAvailabelPlacementList;
const SfxPoolItem *pPoolItem = NULL;
- if( rInAttrs.GetItemState(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, TRUE, &pPoolItem) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, sal_True, &pPoolItem) == SFX_ITEM_SET )
aAvailabelPlacementList =((const SfxIntegerListItem*)pPoolItem)->GetConstSequence();
m_aLB_LabelPlacement.Clear();
for( sal_Int32 nN=0; nN<aAvailabelPlacementList.getLength(); ++nN )
{
- USHORT nListBoxPos = static_cast<USHORT>( nN );
+ sal_uInt16 nListBoxPos = static_cast<sal_uInt16>( nN );
sal_Int32 nPlacement = aAvailabelPlacementList[nN];
m_aPlacementToListBoxMap[nPlacement]=nListBoxPos;
m_aListBoxToPlacementMap[nListBoxPos]=nPlacement;
@@ -213,7 +213,7 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt
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) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState(SCHATTR_DATADESCR_NO_PERCENTVALUE, sal_True, &pPoolItem) == SFX_ITEM_SET )
{
bool bForbidPercentValue = (static_cast< const SfxBoolItem & >( rInAttrs.Get( SCHATTR_DATADESCR_NO_PERCENTVALUE )).GetValue() );
if( bForbidPercentValue )
@@ -246,11 +246,11 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
m_aCBPercent.Check();
SfxItemSet aNumberSet = NumberFormatDialog::CreateEmptyItemSetForNumberFormatDialog( *m_pPool );
- aNumberSet.Put (SvxNumberInfoItem( m_pNumberFormatter, (const USHORT)SID_ATTR_NUMBERFORMAT_INFO));
+ aNumberSet.Put (SvxNumberInfoItem( m_pNumberFormatter, (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO));
bool bPercent = ( pButton == &m_aPB_NumberFormatForPercent );
- ULONG& rnFormatKey = bPercent ? m_nNumberFormatForPercent : m_nNumberFormatForValue;
+ sal_uLong& rnFormatKey = bPercent ? m_nNumberFormatForPercent : m_nNumberFormatForValue;
bool& rUseSourceFormat = bPercent ? m_bSourceFormatForPercent : m_bSourceFormatForValue;
bool& rbMixedState = bPercent ? m_bPercentFormatMixedState : m_bNumberFormatMixedState;
bool& rbSourceMixedState = bPercent ? m_bPercentSourceMixedState : m_bSourceFormatMixedState;
@@ -268,7 +268,7 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
if( pResult )
{
bool bOldSource = rUseSourceFormat;
- ULONG nOldFormat = rnFormatKey;
+ sal_uLong nOldFormat = rnFormatKey;
bool bOldMixedState = rbMixedState || rbSourceMixedState;
rbMixedState = !lcl_ReadNumberFormatFromItemSet( *pResult, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, rnFormatKey, rUseSourceFormat, rbSourceMixedState );
@@ -284,7 +284,7 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
IMPL_LINK( DataLabelResources, CheckHdl, CheckBox*, pBox )
{
if( pBox )
- pBox->EnableTriState( FALSE );
+ pBox->EnableTriState( sal_False );
EnableControls();
return 0;
}
@@ -321,7 +321,7 @@ void DataLabelResources::EnableControls()
m_aNF_Degrees.Enable( bEnableRotation );
}
-BOOL DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
+sal_Bool DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
{
if( m_aCBNumber.IsChecked() )
{
@@ -348,7 +348,7 @@ BOOL DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
rOutAttrs.Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYMBOL, m_aCBSymbol.IsChecked()) );
rOutAttrs.Put( SfxStringItem( SCHATTR_DATADESCR_SEPARATOR, m_aSeparatorResources.GetValue() ) );
- ::std::map< USHORT, sal_Int32 >::const_iterator aIt( m_aListBoxToPlacementMap.find(m_aLB_LabelPlacement.GetSelectEntryPos()) );
+ ::std::map< sal_uInt16, sal_Int32 >::const_iterator aIt( m_aListBoxToPlacementMap.find(m_aLB_LabelPlacement.GetSelectEntryPos()) );
if(aIt!=m_aListBoxToPlacementMap.end())
{
sal_Int32 nValue = aIt->second;
@@ -364,13 +364,13 @@ BOOL DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
rOutAttrs.Put(SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) );
}
- return TRUE;
+ return sal_True;
}
void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
{
// default state
- m_aCBSymbol.Enable( FALSE );
+ m_aCBSymbol.Enable( sal_False );
lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_NUMBER, m_aCBNumber );
lcl_setBoolItemToCheckBox( rInAttrs, SCHATTR_DATADESCR_SHOW_PERCENTAGE, m_aCBPercent );
@@ -381,18 +381,18 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState);
const SfxPoolItem *pPoolItem = NULL;
- if( rInAttrs.GetItemState(SCHATTR_DATADESCR_SEPARATOR, TRUE, &pPoolItem) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState(SCHATTR_DATADESCR_SEPARATOR, sal_True, &pPoolItem) == SFX_ITEM_SET )
m_aSeparatorResources.SetValue( ((const SfxStringItem*)pPoolItem)->GetValue() );
else
m_aSeparatorResources.SetDefault();
- if( rInAttrs.GetItemState(SCHATTR_DATADESCR_PLACEMENT, TRUE, &pPoolItem) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState(SCHATTR_DATADESCR_PLACEMENT, sal_True, &pPoolItem) == SFX_ITEM_SET )
{
sal_Int32 nPlacement = ((const SfxInt32Item*)pPoolItem)->GetValue();
- ::std::map< sal_Int32, USHORT >::const_iterator aIt( m_aPlacementToListBoxMap.find(nPlacement) );
+ ::std::map< sal_Int32, sal_uInt16 >::const_iterator aIt( m_aPlacementToListBoxMap.find(nPlacement) );
if(aIt!=m_aPlacementToListBoxMap.end())
{
- USHORT nPos = aIt->second;
+ sal_uInt16 nPos = aIt->second;
m_aLB_LabelPlacement.SelectEntryPos( nPos );
}
else
@@ -401,10 +401,10 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
else
m_aLB_LabelPlacement.SetNoSelection();
- if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, TRUE, &pPoolItem ) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET )
m_aLB_TextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) );
- if( rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, TRUE, &pPoolItem ) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, sal_True, &pPoolItem ) == SFX_ITEM_SET )
{
sal_Int32 nDegrees = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
m_aDC_Dial.SetRotation( nDegrees );
diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx
index 525d52b8da3b..f8b56fb9e855 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.hxx
@@ -50,7 +50,7 @@ public:
DataLabelResources( Window* pParent, const SfxItemSet& rInAttrs );
virtual ~DataLabelResources();
- BOOL FillItemSet(SfxItemSet& rOutAttrs) const;
+ sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const;
void Reset(const SfxItemSet& rInAttrs);
void SetNumberFormatter( SvNumberFormatter* pFormatter );
@@ -76,14 +76,14 @@ private:
FixedText m_aFT_TextDirection;
TextDirectionListBox m_aLB_TextDirection;
- ::std::map< sal_Int32, USHORT > m_aPlacementToListBoxMap;
- ::std::map< USHORT, sal_Int32 > m_aListBoxToPlacementMap;
+ ::std::map< sal_Int32, sal_uInt16 > m_aPlacementToListBoxMap;
+ ::std::map< sal_uInt16, sal_Int32 > m_aListBoxToPlacementMap;
SvNumberFormatter* m_pNumberFormatter;
bool m_bNumberFormatMixedState;
bool m_bPercentFormatMixedState;
- ULONG m_nNumberFormatForValue;
- ULONG m_nNumberFormatForPercent;
+ sal_uLong m_nNumberFormatForValue;
+ sal_uLong m_nNumberFormatForPercent;
bool m_bSourceFormatMixedState;
bool m_bPercentSourceMixedState;
diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx
index 1cd110439e7f..9a645ab0cf4b 100644
--- a/chart2/source/controller/dialogs/res_ErrorBar.cxx
+++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx
@@ -51,8 +51,8 @@ void lcl_enableRangeChoosing( bool bEnable, Dialog * pDialog )
{
if( pDialog )
{
- pDialog->Show( bEnable ? FALSE : TRUE );
- pDialog->SetModalInputMode( bEnable ? FALSE : TRUE );
+ pDialog->Show( bEnable ? sal_False : sal_True );
+ pDialog->SetModalInputMode( bEnable ? sal_False : sal_True );
}
}
@@ -158,7 +158,7 @@ ErrorBarResources::ErrorBarResources( Window* pParent, Dialog * pParentDialog,
m_aRbRange.SetClickHdl( LINK( this, ErrorBarResources, CategoryChosen ));
m_aLbFunction.SetSelectHdl( LINK( this, ErrorBarResources, CategoryChosen ));
- m_aCbSyncPosNeg.Check( FALSE );
+ m_aCbSyncPosNeg.Check( sal_False );
m_aCbSyncPosNeg.SetToggleHdl( LINK( this, ErrorBarResources, SynchronizePosAndNeg ));
m_aMfPositive.SetModifyHdl( LINK( this, ErrorBarResources, PosValueChanged ));
@@ -470,12 +470,12 @@ IMPL_LINK( ErrorBarResources, ChooseRange, RangeSelectionButton *, pButton )
if( pButton == &m_aIbRangePositive )
{
m_pCurrentRangeChoosingField = &m_aEdRangePositive;
- aUIString = ::rtl::OUString( String( SchResId( STR_DATA_SELECT_RANGE_FOR_POSITIVE_ERRORBARS )));
+ aUIString = String( SchResId( STR_DATA_SELECT_RANGE_FOR_POSITIVE_ERRORBARS ));
}
else
{
m_pCurrentRangeChoosingField = &m_aEdRangeNegative;
- aUIString = ::rtl::OUString( String( SchResId( STR_DATA_SELECT_RANGE_FOR_NEGATIVE_ERRORBARS )));
+ aUIString = String( SchResId( STR_DATA_SELECT_RANGE_FOR_NEGATIVE_ERRORBARS ));
}
OSL_ASSERT( m_pParentDialog );
@@ -516,7 +516,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
// category
m_eErrorKind = CHERROR_NONE;
- aState = rInAttrs.GetItemState( SCHATTR_STAT_KIND_ERROR, TRUE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_STAT_KIND_ERROR, sal_True, &pPoolItem );
m_bErrorKindUnique = ( aState != SFX_ITEM_DONTCARE );
if( aState == SFX_ITEM_SET )
@@ -550,14 +550,14 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
}
else
{
- m_aRbNone.Check( FALSE );
- m_aRbConst.Check( FALSE );
- m_aRbPercent.Check( FALSE );
- m_aRbFunction.Check( FALSE );
+ m_aRbNone.Check( sal_False );
+ m_aRbConst.Check( sal_False );
+ m_aRbPercent.Check( sal_False );
+ m_aRbFunction.Check( sal_False );
}
// parameters
- aState = rInAttrs.GetItemState( SCHATTR_STAT_CONSTPLUS, TRUE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_STAT_CONSTPLUS, sal_True, &pPoolItem );
m_bPlusUnique = ( aState != SFX_ITEM_DONTCARE );
double fPlusValue = 0.0;
if( aState == SFX_ITEM_SET )
@@ -567,7 +567,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
m_aMfPositive.SetValue( nPlusValue );
}
- aState = rInAttrs.GetItemState( SCHATTR_STAT_CONSTMINUS, TRUE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_STAT_CONSTMINUS, sal_True, &pPoolItem );
m_bMinusUnique = ( aState != SFX_ITEM_DONTCARE );
if( aState == SFX_ITEM_SET )
{
@@ -581,7 +581,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
}
// indicator
- aState = rInAttrs.GetItemState( SCHATTR_STAT_INDICATE, TRUE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_STAT_INDICATE, sal_True, &pPoolItem );
m_bIndicatorUnique = ( aState != SFX_ITEM_DONTCARE );
if( aState == SFX_ITEM_SET)
m_eIndicate = ((const SvxChartIndicateItem * ) pPoolItem)->GetValue();
@@ -604,13 +604,13 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
}
else
{
- m_aRbBoth.Check( FALSE );
- m_aRbPositive.Check( FALSE );
- m_aRbNegative.Check( FALSE );
+ m_aRbBoth.Check( sal_False );
+ m_aRbPositive.Check( sal_False );
+ m_aRbNegative.Check( sal_False );
}
// ranges
- aState = rInAttrs.GetItemState( SCHATTR_STAT_RANGE_POS, TRUE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_STAT_RANGE_POS, sal_True, &pPoolItem );
m_bRangePosUnique = ( aState != SFX_ITEM_DONTCARE );
if( aState == SFX_ITEM_SET )
{
@@ -618,7 +618,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
m_aEdRangePositive.SetText( sRangePositive );
}
- aState = rInAttrs.GetItemState( SCHATTR_STAT_RANGE_NEG, TRUE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_STAT_RANGE_NEG, sal_True, &pPoolItem );
m_bRangeNegUnique = ( aState != SFX_ITEM_DONTCARE );
if( aState == SFX_ITEM_SET )
{
@@ -633,7 +633,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
UpdateControlStates();
}
-BOOL ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const
+sal_Bool ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const
{
if( m_bErrorKindUnique )
rOutAttrs.Put( SvxChartKindErrorItem( m_eErrorKind, SCHATTR_STAT_KIND_ERROR ));
@@ -686,7 +686,7 @@ BOOL ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const
}
}
- return TRUE;
+ return sal_True;
}
void ErrorBarResources::FillValueSets()
diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx b/chart2/source/controller/dialogs/res_LegendPosition.cxx
index 33f02c442f1b..6d99a2fbea3c 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx
@@ -40,13 +40,12 @@
#include <svtools/controldims.hrc>
#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
//itemset stuff
#include "chartview/ChartSfxItemIds.hxx"
-#include <svx/chrtitem.hxx>
-// header for class SfxItemPool
-#include <svl/itempool.hxx>
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
//.............................................................................
namespace chart
@@ -60,8 +59,8 @@ LegendPositionResources::LegendPositionResources( Window* pWindow )
: m_xCC() //unused in this scenario
, m_aCbxShow( pWindow ) //unused in this scenario
, m_aRbtLeft( pWindow, SchResId(RBT_LEFT) )
- , m_aRbtTop( pWindow, SchResId(RBT_TOP) )
, m_aRbtRight( pWindow, SchResId(RBT_RIGHT) )
+ , m_aRbtTop( pWindow, SchResId(RBT_TOP) )
, m_aRbtBottom( pWindow, SchResId(RBT_BOTTOM) )
{
m_aCbxShow.Check();//legend is assumed to be visible in this scenario
@@ -72,12 +71,17 @@ LegendPositionResources::LegendPositionResources( Window* pWindow, const uno::Re
: m_xCC( xCC )
, m_aCbxShow( pWindow, SchResId(CBX_SHOWLEGEND) )
, m_aRbtLeft( pWindow, SchResId(RBT_LEFT) )
- , m_aRbtTop( pWindow, SchResId(RBT_TOP) )
, m_aRbtRight( pWindow, SchResId(RBT_RIGHT) )
+ , m_aRbtTop( pWindow, SchResId(RBT_TOP) )
, m_aRbtBottom( pWindow, SchResId(RBT_BOTTOM) )
{
m_aCbxShow.SetToggleHdl( LINK( this, LegendPositionResources, PositionEnableHdl ) );
impl_setRadioButtonToggleHdl();
+ m_aCbxShow.SetAccessibleRelationMemberOf(&m_aCbxShow);
+ m_aRbtLeft.SetAccessibleRelationMemberOf(&m_aCbxShow);
+ m_aRbtRight.SetAccessibleRelationMemberOf(&m_aCbxShow);
+ m_aRbtTop.SetAccessibleRelationMemberOf(&m_aCbxShow);
+ m_aRbtBottom.SetAccessibleRelationMemberOf(&m_aCbxShow);
}
void LegendPositionResources::impl_setRadioButtonToggleHdl()
@@ -150,7 +154,7 @@ void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Referen
//position
chart2::LegendPosition eNewPos;
- chart2::LegendExpansion eExp = chart2::LegendExpansion_HIGH;
+ ::com::sun::star::chart::ChartLegendExpansion eExp = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
if( m_aRbtLeft.IsChecked() )
eNewPos = chart2::LegendPosition_LINE_START;
@@ -161,12 +165,12 @@ void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Referen
else if( m_aRbtTop.IsChecked() )
{
eNewPos = chart2::LegendPosition_PAGE_START;
- eExp = chart2::LegendExpansion_WIDE;
+ eExp = ::com::sun::star::chart::ChartLegendExpansion_WIDE;
}
else if( m_aRbtBottom.IsChecked() )
{
eNewPos = chart2::LegendPosition_PAGE_END;
- eExp = chart2::LegendExpansion_WIDE;
+ eExp = ::com::sun::star::chart::ChartLegendExpansion_WIDE;
}
xProp->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny( eNewPos ));
@@ -182,7 +186,7 @@ void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Referen
IMPL_LINK( LegendPositionResources, PositionEnableHdl, void*, EMPTYARG )
{
- BOOL bEnable = m_aCbxShow.IsChecked();
+ sal_Bool bEnable = m_aCbxShow.IsChecked();
m_aRbtLeft.Enable( bEnable );
m_aRbtTop.Enable( bEnable );
@@ -196,51 +200,50 @@ IMPL_LINK( LegendPositionResources, PositionEnableHdl, void*, EMPTYARG )
void LegendPositionResources::initFromItemSet( const SfxItemSet& rInAttrs )
{
- SvxChartLegendPos ePos = CHLEGEND_NONE;
-
const SfxPoolItem* pPoolItem = NULL;
- if( rInAttrs.GetItemState( SCHATTR_LEGEND_POS,
- TRUE, &pPoolItem ) != SFX_ITEM_SET )
- pPoolItem = &(rInAttrs.GetPool()->GetDefaultItem( SCHATTR_LEGEND_POS ));
-
- if( pPoolItem )
- ePos = ((const SvxChartLegendPosItem*)pPoolItem)->GetValue();
+ if( rInAttrs.GetItemState( SCHATTR_LEGEND_POS, sal_True, &pPoolItem ) == SFX_ITEM_SET )
+ {
+ sal_Int32 nLegendPosition = ((const SfxInt32Item*)pPoolItem)->GetValue();
+ switch( nLegendPosition )
+ {
+ case chart2::LegendPosition_LINE_START:
+ m_aRbtLeft.Check(sal_True);
+ break;
+ case chart2::LegendPosition_PAGE_START:
+ m_aRbtTop.Check(sal_True);
+ break;
+ case chart2::LegendPosition_LINE_END:
+ m_aRbtRight.Check(sal_True);
+ break;
+ case chart2::LegendPosition_PAGE_END:
+ m_aRbtBottom.Check(sal_True);
+ break;
+ default:
+ break;
+ }
+ }
- switch( ePos )
+ if( rInAttrs.GetItemState( SCHATTR_LEGEND_SHOW, sal_True, &pPoolItem ) == SFX_ITEM_SET )
{
- case CHLEGEND_LEFT:
- m_aRbtLeft.Check(TRUE);
- break;
- case CHLEGEND_TOP:
- m_aRbtTop.Check(TRUE);
- break;
- case CHLEGEND_RIGHT:
- m_aRbtRight.Check(TRUE);
- break;
- case CHLEGEND_BOTTOM:
- m_aRbtBottom.Check(TRUE);
- break;
- default:
- break;
+ bool bShow = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
+ m_aCbxShow.Check(bShow);
}
}
void LegendPositionResources::writeToItemSet( SfxItemSet& rOutAttrs ) const
{
- SvxChartLegendPos ePos;
-
+ sal_Int32 nLegendPosition = chart2::LegendPosition_CUSTOM;
if( m_aRbtLeft.IsChecked() )
- ePos = CHLEGEND_LEFT;
+ nLegendPosition = chart2::LegendPosition_LINE_START;
else if( m_aRbtTop.IsChecked() )
- ePos = CHLEGEND_TOP;
+ nLegendPosition = chart2::LegendPosition_PAGE_START;
else if( m_aRbtRight.IsChecked() )
- ePos = CHLEGEND_RIGHT;
+ nLegendPosition = chart2::LegendPosition_LINE_END;
else if( m_aRbtBottom.IsChecked() )
- ePos = CHLEGEND_BOTTOM;
- else
- ePos = CHLEGEND_NONE;
+ nLegendPosition = chart2::LegendPosition_PAGE_END;
+ rOutAttrs.Put(SfxInt32Item(SCHATTR_LEGEND_POS, nLegendPosition ));
- rOutAttrs.Put(SvxChartLegendPosItem( ePos, SCHATTR_LEGEND_POS ));
+ rOutAttrs.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, m_aCbxShow.IsChecked()) );
}
IMPL_LINK( LegendPositionResources, PositionChangeHdl, RadioButton*, pRadio )
@@ -258,6 +261,14 @@ void LegendPositionResources::SetChangeHdl( const Link& rLink )
m_aChangeLink = rLink;
}
+void LegendPositionResources::SetAccessibleRelationMemberOf(Window* pMemberOf)
+{
+ m_aRbtLeft.SetAccessibleRelationMemberOf(pMemberOf);
+ m_aRbtRight.SetAccessibleRelationMemberOf(pMemberOf);
+ m_aRbtTop.SetAccessibleRelationMemberOf(pMemberOf);
+ m_aRbtBottom.SetAccessibleRelationMemberOf(pMemberOf);
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/controller/dialogs/res_LegendPosition.hxx b/chart2/source/controller/dialogs/res_LegendPosition.hxx
index 0fc13b3b068b..bee192ff8b03 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.hxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.hxx
@@ -43,6 +43,7 @@ namespace chart
class LegendPositionResources
{
+
public:
//constructor without Display checkbox
LegendPositionResources( Window* pParent );
@@ -65,6 +66,8 @@ public:
DECL_LINK( PositionEnableHdl, void* );
DECL_LINK( PositionChangeHdl, RadioButton* );
+ void SetAccessibleRelationMemberOf(Window* pMemberOf); //IAccessibility2 Implementation 2009-----
+
private:
void impl_setRadioButtonToggleHdl();
@@ -75,8 +78,8 @@ private:
CheckBox m_aCbxShow;
RadioButton m_aRbtLeft;
- RadioButton m_aRbtTop;
RadioButton m_aRbtRight;
+ RadioButton m_aRbtTop;
RadioButton m_aRbtBottom;
Link m_aChangeLink;
diff --git a/chart2/source/controller/dialogs/res_TextSeparator.cxx b/chart2/source/controller/dialogs/res_TextSeparator.cxx
index cef13277d9cf..7bf1cc0c8221 100644
--- a/chart2/source/controller/dialogs/res_TextSeparator.cxx
+++ b/chart2/source/controller/dialogs/res_TextSeparator.cxx
@@ -58,6 +58,9 @@ TextSeparatorResources::TextSeparatorResources( Window* pWindow )
m_aEntryMap[ C2U( ", " ) ] = 1;
m_aEntryMap[ C2U( "; " ) ] = 2;
m_aEntryMap[ C2U( "\n" ) ] = 3;
+
+ m_aLB_Separator.SetAccessibleName(m_aFT_Separator.GetText());
+ m_aLB_Separator.SetAccessibleRelationLabeledBy(&m_aFT_Separator);
}
TextSeparatorResources::~TextSeparatorResources()
{
@@ -123,7 +126,7 @@ Size TextSeparatorResources::GetCurrentListBoxSize() const
void TextSeparatorResources::SetValue( const rtl::OUString& rSeparator )
{
- ::std::map< ::rtl::OUString, USHORT >::iterator aIter( m_aEntryMap.find(rSeparator) );
+ ::std::map< ::rtl::OUString, sal_uInt16 >::iterator aIter( m_aEntryMap.find(rSeparator) );
if( aIter == m_aEntryMap.end() )
m_aLB_Separator.SelectEntryPos( m_nDefaultPos );
else
@@ -137,8 +140,8 @@ void TextSeparatorResources::SetDefault()
rtl::OUString TextSeparatorResources::GetValue() const
{
- USHORT nPos = m_aLB_Separator.GetSelectEntryPos();
- ::std::map< ::rtl::OUString, USHORT >::const_iterator aIter( m_aEntryMap.begin() );
+ sal_uInt16 nPos = m_aLB_Separator.GetSelectEntryPos();
+ ::std::map< ::rtl::OUString, sal_uInt16 >::const_iterator aIter( m_aEntryMap.begin() );
while( aIter != m_aEntryMap.end() )
{
if(aIter->second==nPos )
diff --git a/chart2/source/controller/dialogs/res_TextSeparator.hxx b/chart2/source/controller/dialogs/res_TextSeparator.hxx
index b2701bf0aaec..9113c6bdcfa5 100644
--- a/chart2/source/controller/dialogs/res_TextSeparator.hxx
+++ b/chart2/source/controller/dialogs/res_TextSeparator.hxx
@@ -64,9 +64,9 @@ private:
FixedText m_aFT_Separator;
ListBox m_aLB_Separator;
- ::std::map< ::rtl::OUString, USHORT > m_aEntryMap;
+ ::std::map< ::rtl::OUString, sal_uInt16 > m_aEntryMap;
- const USHORT m_nDefaultPos;
+ const sal_uInt16 m_nDefaultPos;
};
//.............................................................................
diff --git a/chart2/source/controller/dialogs/res_Titles.cxx b/chart2/source/controller/dialogs/res_Titles.cxx
index 2b164216c28a..b24dc911ab94 100644
--- a/chart2/source/controller/dialogs/res_Titles.cxx
+++ b/chart2/source/controller/dialogs/res_Titles.cxx
@@ -127,7 +127,7 @@ TitleResources::~TitleResources()
void TitleResources::SetUpdateDataHdl( const Link& rLink )
{
- ULONG nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT;
+ sal_uLong nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT;
m_aEd_Main.EnableUpdateData( nTimeout );
m_aEd_Main.SetUpdateDataHdl( rLink );
diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index dadfd998940a..dcd376530a90 100644
--- a/chart2/source/controller/dialogs/res_Trendline.cxx
+++ b/chart2/source/controller/dialogs/res_Trendline.cxx
@@ -184,7 +184,7 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
const SfxPoolItem *pPoolItem = NULL;
SfxItemState aState = SFX_ITEM_UNKNOWN;
- aState = rInAttrs.GetItemState( SCHATTR_REGRESSION_TYPE, TRUE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_REGRESSION_TYPE, sal_True, &pPoolItem );
m_bTrendLineUnique = ( aState != SFX_ITEM_DONTCARE );
if( aState == SFX_ITEM_SET )
{
@@ -193,28 +193,28 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
m_eTrendLineType = pItem->GetValue();
}
- aState = rInAttrs.GetItemState( SCHATTR_REGRESSION_SHOW_EQUATION, TRUE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_REGRESSION_SHOW_EQUATION, sal_True, &pPoolItem );
if( aState == SFX_ITEM_DONTCARE )
{
- m_aCBShowEquation.EnableTriState( TRUE );
+ m_aCBShowEquation.EnableTriState( sal_True );
m_aCBShowEquation.SetState( STATE_DONTKNOW );
}
else
{
- m_aCBShowEquation.EnableTriState( FALSE );
+ m_aCBShowEquation.EnableTriState( sal_False );
if( aState == SFX_ITEM_SET )
m_aCBShowEquation.Check( static_cast< const SfxBoolItem * >( pPoolItem )->GetValue());
}
- aState = rInAttrs.GetItemState( SCHATTR_REGRESSION_SHOW_COEFF, TRUE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_REGRESSION_SHOW_COEFF, sal_True, &pPoolItem );
if( aState == SFX_ITEM_DONTCARE )
{
- m_aCBShowCorrelationCoeff.EnableTriState( TRUE );
+ m_aCBShowCorrelationCoeff.EnableTriState( sal_True );
m_aCBShowCorrelationCoeff.SetState( STATE_DONTKNOW );
}
else
{
- m_aCBShowCorrelationCoeff.EnableTriState( FALSE );
+ m_aCBShowCorrelationCoeff.EnableTriState( sal_False );
if( aState == SFX_ITEM_SET )
m_aCBShowCorrelationCoeff.Check( static_cast< const SfxBoolItem * >( pPoolItem )->GetValue());
}
@@ -243,7 +243,7 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
}
}
-BOOL TrendlineResources::FillItemSet(SfxItemSet& rOutAttrs) const
+sal_Bool TrendlineResources::FillItemSet(SfxItemSet& rOutAttrs) const
{
if( m_bTrendLineUnique )
rOutAttrs.Put( SvxChartRegressItem( m_eTrendLineType, SCHATTR_REGRESSION_TYPE ));
@@ -251,7 +251,7 @@ BOOL TrendlineResources::FillItemSet(SfxItemSet& rOutAttrs) const
rOutAttrs.Put( SfxBoolItem( SCHATTR_REGRESSION_SHOW_EQUATION, m_aCBShowEquation.IsChecked() ));
if( m_aCBShowCorrelationCoeff.GetState() != STATE_DONTKNOW )
rOutAttrs.Put( SfxBoolItem( SCHATTR_REGRESSION_SHOW_COEFF, m_aCBShowCorrelationCoeff.IsChecked() ));
- return TRUE;
+ return sal_True;
}
void TrendlineResources::FillValueSets()
diff --git a/chart2/source/controller/dialogs/res_Trendline.hxx b/chart2/source/controller/dialogs/res_Trendline.hxx
index 45a054e4ae57..6e290f850328 100644
--- a/chart2/source/controller/dialogs/res_Trendline.hxx
+++ b/chart2/source/controller/dialogs/res_Trendline.hxx
@@ -45,7 +45,7 @@ public:
virtual ~TrendlineResources();
void Reset(const SfxItemSet& rInAttrs);
- BOOL FillItemSet(SfxItemSet& rOutAttrs) const;
+ sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const;
void FillValueSets();
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
index ff26d19ea7f0..6a5cacf52807 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
@@ -111,9 +111,9 @@ ThreeD_SceneAppearance_TabPage::ThreeD_SceneAppearance_TabPage(
, m_aFT_Scheme ( this, SchResId( FT_SCHEME ) )
, m_aLB_Scheme ( this, SchResId( LB_SCHEME ) )
, m_aFL_Seperator ( this, SchResId( FL_SEPERATOR ) )
- , m_aCB_RoundedEdge ( this, SchResId( CB_ROUNDEDEDGE ) )
, m_aCB_Shading ( this, SchResId( CB_SHADING ) )
, m_aCB_ObjectLines ( this, SchResId( CB_OBJECTLINES ) )
+ , m_aCB_RoundedEdge ( this, SchResId( CB_ROUNDEDEDGE ) )
, m_bUpdateOtherControls( true )
, m_bCommitToModel( true )
, m_rControllerLockHelper( rControllerLockHelper )
@@ -129,9 +129,9 @@ ThreeD_SceneAppearance_TabPage::ThreeD_SceneAppearance_TabPage(
m_aCB_Shading.SetToggleHdl( LINK( this, ThreeD_SceneAppearance_TabPage, SelectShading ) );
m_aCB_ObjectLines.SetToggleHdl( LINK( this, ThreeD_SceneAppearance_TabPage, SelectRoundedEdgeOrObjectLines ) );
- m_aCB_RoundedEdge.EnableTriState( TRUE );
- m_aCB_Shading.EnableTriState( TRUE );
- m_aCB_ObjectLines.EnableTriState( TRUE );
+ m_aCB_RoundedEdge.EnableTriState( sal_True );
+ m_aCB_Shading.EnableTriState( sal_True );
+ m_aCB_ObjectLines.EnableTriState( sal_True );
initControlsFromModel();
}
@@ -220,50 +220,50 @@ void ThreeD_SceneAppearance_TabPage::initControlsFromModel()
if(aProps.m_aShadeMode == drawing::ShadeMode_FLAT)
{
- m_aCB_Shading.EnableTriState( FALSE );
- m_aCB_Shading.Check(FALSE);
+ m_aCB_Shading.EnableTriState( sal_False );
+ m_aCB_Shading.Check(sal_False);
}
else if(aProps.m_aShadeMode == drawing::ShadeMode_SMOOTH)
{
- m_aCB_Shading.EnableTriState( FALSE );
- m_aCB_Shading.Check(TRUE);
+ m_aCB_Shading.EnableTriState( sal_False );
+ m_aCB_Shading.Check(sal_True);
}
else
{
- m_aCB_Shading.EnableTriState( TRUE );
+ m_aCB_Shading.EnableTriState( sal_True );
m_aCB_Shading.SetState( STATE_DONTKNOW );
}
if(aProps.m_nObjectLines == 0)
{
- m_aCB_ObjectLines.EnableTriState( FALSE );
- m_aCB_ObjectLines.Check(FALSE);
+ m_aCB_ObjectLines.EnableTriState( sal_False );
+ m_aCB_ObjectLines.Check(sal_False);
}
else if(aProps.m_nObjectLines==1)
{
- m_aCB_ObjectLines.EnableTriState( FALSE );
- m_aCB_ObjectLines.Check(TRUE);
+ m_aCB_ObjectLines.EnableTriState( sal_False );
+ m_aCB_ObjectLines.Check(sal_True);
}
else
{
- m_aCB_ObjectLines.EnableTriState( TRUE );
+ m_aCB_ObjectLines.EnableTriState( sal_True );
m_aCB_ObjectLines.SetState( STATE_DONTKNOW );
}
if(aProps.m_nRoundedEdges >= 5)
{
- m_aCB_RoundedEdge.EnableTriState( FALSE );
- m_aCB_RoundedEdge.Check(TRUE);
+ m_aCB_RoundedEdge.EnableTriState( sal_False );
+ m_aCB_RoundedEdge.Check(sal_True);
}
else if(aProps.m_nRoundedEdges<0)
{
- m_aCB_RoundedEdge.EnableTriState( FALSE );
+ m_aCB_RoundedEdge.EnableTriState( sal_False );
m_aCB_RoundedEdge.SetState( STATE_DONTKNOW );
}
else
{
- m_aCB_RoundedEdge.EnableTriState( TRUE );
- m_aCB_RoundedEdge.Check(FALSE);
+ m_aCB_RoundedEdge.EnableTriState( sal_True );
+ m_aCB_RoundedEdge.Check(sal_False);
}
m_aCB_RoundedEdge.Enable( !m_aCB_ObjectLines.IsChecked() );
@@ -331,7 +331,7 @@ IMPL_LINK( ThreeD_SceneAppearance_TabPage, SelectShading, void*, EMPTYARG )
if( !m_bUpdateOtherControls )
return 0;
- m_aCB_Shading.EnableTriState( FALSE );
+ m_aCB_Shading.EnableTriState( sal_False );
applyShadeModeToModel();
updateScheme();
return 0;
@@ -343,15 +343,15 @@ IMPL_LINK( ThreeD_SceneAppearance_TabPage, SelectRoundedEdgeOrObjectLines, Check
if( pCheckBox == &m_aCB_ObjectLines )
{
- m_aCB_ObjectLines.EnableTriState( FALSE );
+ m_aCB_ObjectLines.EnableTriState( sal_False );
m_bUpdateOtherControls = false;
m_aCB_RoundedEdge.Enable( !m_aCB_ObjectLines.IsChecked() );
if(!m_aCB_RoundedEdge.IsEnabled())
- m_aCB_RoundedEdge.Check(FALSE);
+ m_aCB_RoundedEdge.Check(sal_False);
m_bUpdateOtherControls = true;
}
else
- m_aCB_RoundedEdge.EnableTriState( FALSE );
+ m_aCB_RoundedEdge.EnableTriState( sal_False );
applyRoundedEdgeAndObjectLinesToModel();
updateScheme();
return 0;
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
index db7d91e59766..7ec53947dd52 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
@@ -81,9 +81,9 @@ private:
FixedLine m_aFL_Seperator;
- CheckBox m_aCB_RoundedEdge;
CheckBox m_aCB_Shading;
CheckBox m_aCB_ObjectLines;
+ CheckBox m_aCB_RoundedEdge;
bool m_bUpdateOtherControls;
bool m_bCommitToModel;
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.src b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.src
index e9b4887da21a..5f193db7e252 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.src
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.src
@@ -51,6 +51,7 @@
TabPage TP_3D_SCENEAPPEARANCE
{
+ HelpID = "chart2:TabPage:TP_3D_SCENEAPPEARANCE";
OutputSize = TRUE ;
SVLook = TRUE ;
Hide = TRUE ;
@@ -64,6 +65,7 @@ TabPage TP_3D_SCENEAPPEARANCE
};
ListBox LB_SCHEME
{
+ HelpID = "chart2:ListBox:TP_3D_SCENEAPPEARANCE:LB_SCHEME";
Border = TRUE;
TabStop = TRUE;
DropDown = TRUE;
@@ -78,12 +80,14 @@ TabPage TP_3D_SCENEAPPEARANCE
CheckBox CB_SHADING
{
+ HelpID = "chart2:CheckBox:TP_3D_SCENEAPPEARANCE:CB_SHADING";
Pos = MAP_APPFONT ( POS_X_1 , POS_Y_SHADING ) ;
Size = MAP_APPFONT ( WIDTH_FL , HEIGHT_LB ) ;
Text [ en-US ] = "~Shading" ;
};
CheckBox CB_OBJECTLINES
{
+ HelpID = "chart2:CheckBox:TP_3D_SCENEAPPEARANCE:CB_OBJECTLINES";
Pos = MAP_APPFONT ( POS_X_1 , POS_Y_OBJECTLINES ) ;
Size = MAP_APPFONT ( WIDTH_FL , HEIGHT_LB ) ;
Text [ en-US ] = "~Object borders" ;
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
index b280f0476357..536ecce1eeca 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
@@ -116,7 +116,7 @@ ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage( Window* pWindow
m_aMFYRotation.SetValue(m_nYRotation);
m_aMFZRotation.SetValue(m_nZRotation);
- const ULONG nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT;
+ const sal_uLong nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT;
Link aAngleChangedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleChanged ));
Link aAngleEditedLink( LINK( this, ThreeD_SceneGeometry_TabPage, AngleEdited ));
@@ -162,6 +162,8 @@ ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage( Window* pWindow
{
m_aCbxRightAngledAxes.Enable(false);
}
+ m_aMFPerspective.SetAccessibleName(m_aCbxPerspective.GetText());
+ m_aMFPerspective.SetAccessibleRelationLabeledBy(&m_aCbxPerspective);
}
ThreeD_SceneGeometry_TabPage::~ThreeD_SceneGeometry_TabPage()
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.src b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.src
index 85b306523960..ac277d34c4f9 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.src
+++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.src
@@ -28,6 +28,7 @@
#include "tp_3D_SceneGeometry.hrc"
#include "dlg_View3D.hrc"
#include "SchSlotIds.hxx"
+#include "HelpIds.hrc"
#ifndef _SVT_CONTROLDIMS_HRC_
#include <svtools/controldims.hrc>
@@ -68,7 +69,7 @@ CustomUnitText [ en-US ] = " degrees" ;
TabPage TP_3D_SCENEGEOMETRY
{
- HelpID = SID_3D_VIEW ;
+ HelpID = HID_3D_VIEW ;
OutputSize = TRUE ;
SVLook = TRUE ;
Hide = TRUE ;
@@ -76,6 +77,7 @@ TabPage TP_3D_SCENEGEOMETRY
CheckBox CBX_RIGHT_ANGLED_AXES
{
+ HelpID = "chart2:CheckBox:TP_3D_SCENEGEOMETRY:CBX_RIGHT_ANGLED_AXES";
Pos = MAP_APPFONT ( POS_X_1 , POS_Y_0 ) ;
Size = MAP_APPFONT ( (WIDTH_FT+WIDTH_MF) , HEIGHT_FT ) ;
TabStop = TRUE ;
@@ -101,18 +103,21 @@ TabPage TP_3D_SCENEGEOMETRY
};
MetricField MTR_FLD_X_ROTATION
{
+ HelpID = "chart2:MetricField:TP_3D_SCENEGEOMETRY:MTR_FLD_X_ROTATION";
Pos = MAP_APPFONT ( POS_X_2 , POS_Y_1-2 ) ;
Size = MAP_APPFONT ( WIDTH_MF , HEIGHT_MF ) ;
CUSTOMUNITTEXT_DEGREE
};
MetricField MTR_FLD_Y_ROTATION
{
+ HelpID = "chart2:MetricField:TP_3D_SCENEGEOMETRY:MTR_FLD_Y_ROTATION";
Pos = MAP_APPFONT ( POS_X_2 , POS_Y_2-2 ) ;
Size = MAP_APPFONT ( WIDTH_MF , HEIGHT_MF ) ;
CUSTOMUNITTEXT_DEGREE
};
MetricField MTR_FLD_Z_ROTATION
{
+ HelpID = "chart2:MetricField:TP_3D_SCENEGEOMETRY:MTR_FLD_Z_ROTATION";
Pos = MAP_APPFONT ( POS_X_2 , POS_Y_3-2 ) ;
Size = MAP_APPFONT ( WIDTH_MF , HEIGHT_MF ) ;
CUSTOMUNITTEXT_DEGREE
@@ -120,6 +125,7 @@ TabPage TP_3D_SCENEGEOMETRY
CheckBox CBX_PERSPECTIVE
{
+ HelpID = "chart2:CheckBox:TP_3D_SCENEGEOMETRY:CBX_PERSPECTIVE";
Pos = MAP_APPFONT ( POS_X_1 , POS_Y_4 ) ;
Size = MAP_APPFONT ( WIDTH_FT , HEIGHT_FT ) ;
TabStop = TRUE ;
@@ -127,6 +133,7 @@ TabPage TP_3D_SCENEGEOMETRY
};
MetricField MTR_FLD_PERSPECTIVE
{
+ HelpID = "chart2:MetricField:TP_3D_SCENEGEOMETRY:MTR_FLD_PERSPECTIVE";
Pos = MAP_APPFONT ( POS_X_2 , POS_Y_4-2 ) ;
Size = MAP_APPFONT ( WIDTH_MF , HEIGHT_MF ) ;
Border = TRUE ;
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index dcf70f841db7..bd818fc3a29c 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -163,13 +163,13 @@ namespace
rtl::OUString lcl_makeColorName( Color rColor )
{
String aStr(SVX_RES(RID_SVXFLOAT3D_FIX_R));
- aStr += String::CreateFromInt32((INT32)rColor.GetRed());
+ aStr += String::CreateFromInt32((sal_Int32)rColor.GetRed());
aStr += sal_Unicode(' ');
aStr += String(SVX_RES(RID_SVXFLOAT3D_FIX_G));
- aStr += String::CreateFromInt32((INT32)rColor.GetGreen());
+ aStr += String::CreateFromInt32((sal_Int32)rColor.GetGreen());
aStr += sal_Unicode(' ');
aStr += String(SVX_RES(RID_SVXFLOAT3D_FIX_B));
- aStr += String::CreateFromInt32((INT32)rColor.GetBlue());
+ aStr += String::CreateFromInt32((sal_Int32)rColor.GetBlue());
return aStr;
}
void lcl_selectColor( ColorListBox& rListBox, const Color& rColor )
@@ -178,7 +178,7 @@ namespace
rListBox.SelectEntry( rColor );
if( rListBox.GetSelectEntryCount() == 0 )
{
- USHORT nPos = rListBox.InsertEntry( rColor, lcl_makeColorName( rColor ) );
+ sal_uInt16 nPos = rListBox.InsertEntry( rColor, lcl_makeColorName( rColor ) );
rListBox.SelectEntryPos( nPos );
}
}
@@ -354,6 +354,15 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWin
ClickLightSourceButtonHdl(&m_aBtn_Light2);
m_aModelChangeListener.startListening( uno::Reference< util::XModifyBroadcaster >(m_xSceneProperties, uno::UNO_QUERY) );
+ m_aBtn_Light1.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light2.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light3.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light4.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light5.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light6.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light7.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aBtn_Light8.SetAccessibleRelationLabeledBy(&m_aFT_LightSource);
+ m_aCtl_Preview.SetAccessibleName(String(SchResId( STR_LIGHT_PREVIEW )));
}
ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage()
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc
index e2d031955867..f5ae0dcda267 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hrc
@@ -42,5 +42,7 @@
#define BTN_LIGHT_6 8
#define BTN_LIGHT_7 9
#define BTN_LIGHT_8 10
-
+//IAccessibility2 Implementation 2009-----
+#define STR_LIGHT_PREVIEW 6000
+//-----IAccessibility2 Implementation 2009
#define CTL_LIGHT_PREVIEW 1
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src
index 57f15a1894d7..cf5898af8c85 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.src
@@ -59,6 +59,7 @@
TabPage TP_3D_SCENEILLUMINATION
{
+ HelpID = "chart2:TabPage:TP_3D_SCENEILLUMINATION";
OutputSize = TRUE ;
SVLook = TRUE ;
Hide = TRUE ;
@@ -72,46 +73,55 @@ TabPage TP_3D_SCENEILLUMINATION
};
ImageButton BTN_LIGHT_1
{
+ HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_1";
Pos = MAP_APPFONT ( POS_X_0 , POS_Y_LIGHTSOURCE_BUTTONS ) ;
Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ;
};
ImageButton BTN_LIGHT_2
{
+ HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_2";
Pos = MAP_APPFONT ( POS_X_0+BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS ) ;
Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ;
};
ImageButton BTN_LIGHT_3
{
+ HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_3";
Pos = MAP_APPFONT ( POS_X_0+2*BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS ) ;
Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ;
};
ImageButton BTN_LIGHT_4
{
+ HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_4";
Pos = MAP_APPFONT ( POS_X_0+3*BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS ) ;
Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ;
};
ImageButton BTN_LIGHT_5
{
+ HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_5";
Pos = MAP_APPFONT ( POS_X_0 , POS_Y_LIGHTSOURCE_BUTTONS_2 ) ;
Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ;
};
ImageButton BTN_LIGHT_6
{
+ HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_6";
Pos = MAP_APPFONT ( POS_X_0+1*BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS_2 ) ;
Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ;
};
ImageButton BTN_LIGHT_7
{
+ HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_7";
Pos = MAP_APPFONT ( POS_X_0+2*BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS_2 ) ;
Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ;
};
ImageButton BTN_LIGHT_8
{
+ HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHT_8";
Pos = MAP_APPFONT ( POS_X_0+3*BUTTON_DISTANCE , POS_Y_LIGHTSOURCE_BUTTONS_2 ) ;
Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ;
};
ListBox LB_LIGHTSOURCE
{
+ HelpID = "chart2:ListBox:TP_3D_SCENEILLUMINATION:LB_LIGHTSOURCE";
Border = TRUE ;
Pos = MAP_APPFONT ( POS_X_0 , POS_Y_LIGHTSOURCE ) ;
Size = MAP_APPFONT ( WIDTH_LB , HEIGHT_LB ) ;
@@ -120,6 +130,7 @@ TabPage TP_3D_SCENEILLUMINATION
};
ImageButton BTN_LIGHTSOURCE_COLOR
{
+ HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_LIGHTSOURCE_COLOR";
Pos = MAP_APPFONT ( POS_X_1 , POS_Y_LIGHTSOURCE ) ;
Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ;
TabStop = TRUE ;
@@ -136,6 +147,7 @@ TabPage TP_3D_SCENEILLUMINATION
};
ListBox LB_AMBIENTLIGHT
{
+ HelpID = "chart2:ListBox:TP_3D_SCENEILLUMINATION:LB_AMBIENTLIGHT";
Border = TRUE ;
Pos = MAP_APPFONT ( POS_X_0 , POS_Y_AMBIENT ) ;
Size = MAP_APPFONT ( WIDTH_LB , HEIGHT_LB ) ;
@@ -144,6 +156,7 @@ TabPage TP_3D_SCENEILLUMINATION
};
ImageButton BTN_AMBIENT_COLOR
{
+ HelpID = "chart2:ImageButton:TP_3D_SCENEILLUMINATION:BTN_AMBIENT_COLOR";
Pos = MAP_APPFONT ( POS_X_1 , POS_Y_AMBIENT ) ;
Size = MAP_APPFONT ( WIDTH_IB , HEIGHT_IB ) ;
TabStop = TRUE ;
@@ -160,3 +173,8 @@ TabPage TP_3D_SCENEILLUMINATION
};
};
+String STR_LIGHT_PREVIEW
+{
+ Text [ en-US ] = "Light Preview" ;
+};
+
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
index fd21bacca0b2..4da8cd64b08c 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
@@ -79,11 +79,12 @@ SchAxisLabelTabPage::SchAxisLabelTabPage( Window* pParent, const SfxItemSet& rIn
m_nInitialDegrees( 0 ),
m_bHasInitialDegrees( true ),
m_bInitialStacking( false ),
- m_bHasInitialStacking( true )
+ m_bHasInitialStacking( true ),
+ m_bComplexCategories( false )
{
FreeResource();
- aCbStacked.EnableTriState( FALSE );
+ aCbStacked.EnableTriState( sal_False );
aOrientHlp.AddDependentWindow( aFlOrient );
aOrientHlp.AddDependentWindow( aFtRotate, STATE_CHECK );
@@ -108,7 +109,7 @@ SfxTabPage* SchAxisLabelTabPage::Create( Window* pParent, const SfxItemSet& rAtt
return new SchAxisLabelTabPage( pParent, rAttrs );
}
-BOOL SchAxisLabelTabPage::FillItemSet( SfxItemSet& rOutAttrs )
+sal_Bool SchAxisLabelTabPage::FillItemSet( SfxItemSet& rOutAttrs )
{
bool bStacked = false;
if( aOrientHlp.GetStackedState() != STATE_DONTKNOW )
@@ -142,20 +143,20 @@ BOOL SchAxisLabelTabPage::FillItemSet( SfxItemSet& rOutAttrs )
bRadioButtonChecked = false;
if( bRadioButtonChecked )
- rOutAttrs.Put( SvxChartTextOrderItem( eOrder, SCHATTR_TEXT_ORDER ));
+ rOutAttrs.Put( SvxChartTextOrderItem( eOrder, SCHATTR_AXIS_LABEL_ORDER ));
}
if( aCbTextOverlap.GetState() != STATE_DONTKNOW )
- rOutAttrs.Put( SfxBoolItem( SCHATTR_TEXT_OVERLAP, aCbTextOverlap.IsChecked() ) );
+ rOutAttrs.Put( SfxBoolItem( SCHATTR_AXIS_LABEL_OVERLAP, aCbTextOverlap.IsChecked() ) );
if( aCbTextBreak.GetState() != STATE_DONTKNOW )
- rOutAttrs.Put( SfxBoolItem( SCHATTR_TEXTBREAK, aCbTextBreak.IsChecked() ) );
+ rOutAttrs.Put( SfxBoolItem( SCHATTR_AXIS_LABEL_BREAK, aCbTextBreak.IsChecked() ) );
if( aCbShowDescription.GetState() != STATE_DONTKNOW )
rOutAttrs.Put( SfxBoolItem( SCHATTR_AXIS_SHOWDESCR, aCbShowDescription.IsChecked() ) );
if( m_aLbTextDirection.GetSelectEntryCount() > 0 )
rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_aLbTextDirection.GetSelectEntryValue() ) );
- return TRUE;
+ return sal_True;
}
void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
@@ -164,16 +165,16 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
SfxItemState aState = SFX_ITEM_UNKNOWN;
// show description ----------
- aState = rInAttrs.GetItemState( SCHATTR_AXIS_SHOWDESCR, FALSE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_AXIS_SHOWDESCR, sal_False, &pPoolItem );
if( aState == SFX_ITEM_DONTCARE )
{
- aCbShowDescription.EnableTriState( TRUE );
+ aCbShowDescription.EnableTriState( sal_True );
aCbShowDescription.SetState( STATE_DONTKNOW );
}
else
{
- aCbShowDescription.EnableTriState( FALSE );
- BOOL bCheck = FALSE;
+ aCbShowDescription.EnableTriState( sal_False );
+ sal_Bool bCheck = sal_False;
if( aState == SFX_ITEM_SET )
bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
aCbShowDescription.Check( bCheck );
@@ -186,7 +187,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
// check new degree item
m_nInitialDegrees = 0;
- aState = rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, FALSE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, sal_False, &pPoolItem );
if( aState == SFX_ITEM_SET )
m_nInitialDegrees = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
@@ -198,7 +199,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
// check stacked item
m_bInitialStacking = false;
- aState = rInAttrs.GetItemState( SCHATTR_TEXT_STACKED, FALSE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_TEXT_STACKED, sal_False, &pPoolItem );
if( aState == SFX_ITEM_SET )
m_bInitialStacking = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
@@ -208,20 +209,20 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
else
aOrientHlp.SetStackedState( STATE_DONTKNOW );
- if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, TRUE, &pPoolItem ) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET )
m_aLbTextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) );
// Text overlap ----------
- aState = rInAttrs.GetItemState( SCHATTR_TEXT_OVERLAP, FALSE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_AXIS_LABEL_OVERLAP, sal_False, &pPoolItem );
if( aState == SFX_ITEM_DONTCARE )
{
- aCbTextOverlap.EnableTriState( TRUE );
+ aCbTextOverlap.EnableTriState( sal_True );
aCbTextOverlap.SetState( STATE_DONTKNOW );
}
else
{
- aCbTextOverlap.EnableTriState( FALSE );
- BOOL bCheck = FALSE;
+ aCbTextOverlap.EnableTriState( sal_False );
+ sal_Bool bCheck = sal_False;
if( aState == SFX_ITEM_SET )
bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
aCbTextOverlap.Check( bCheck );
@@ -231,16 +232,16 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
}
// text break ----------
- aState = rInAttrs.GetItemState( SCHATTR_TEXTBREAK, FALSE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_AXIS_LABEL_BREAK, sal_False, &pPoolItem );
if( aState == SFX_ITEM_DONTCARE )
{
- aCbTextBreak.EnableTriState( TRUE );
+ aCbTextBreak.EnableTriState( sal_True );
aCbTextBreak.SetState( STATE_DONTKNOW );
}
else
{
- aCbTextBreak.EnableTriState( FALSE );
- BOOL bCheck = FALSE;
+ aCbTextBreak.EnableTriState( sal_False );
+ sal_Bool bCheck = sal_False;
if( aState == SFX_ITEM_SET )
bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
aCbTextBreak.Check( bCheck );
@@ -256,7 +257,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
// text order ----------
if( m_bShowStaggeringControls )
{
- aState = rInAttrs.GetItemState( SCHATTR_TEXT_ORDER, FALSE, &pPoolItem );
+ aState = rInAttrs.GetItemState( SCHATTR_AXIS_LABEL_ORDER, sal_False, &pPoolItem );
if( aState == SFX_ITEM_SET )
{
SvxChartTextOrder eOrder = static_cast< const SvxChartTextOrderItem * >( pPoolItem )->GetValue();
@@ -282,7 +283,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs )
ToggleShowLabel( (void*)0 );
}
-void SchAxisLabelTabPage::ShowStaggeringControls( BOOL bShowStaggeringControls )
+void SchAxisLabelTabPage::ShowStaggeringControls( sal_Bool bShowStaggeringControls )
{
m_bShowStaggeringControls = bShowStaggeringControls;
@@ -296,12 +297,17 @@ void SchAxisLabelTabPage::ShowStaggeringControls( BOOL bShowStaggeringControls )
}
}
+void SchAxisLabelTabPage::SetComplexCategories( bool bComplexCategories )
+{
+ m_bComplexCategories = bComplexCategories;
+}
+
// event handling routines
// -----------------------
IMPL_LINK ( SchAxisLabelTabPage, ToggleShowLabel, void *, EMPTYARG )
{
- BOOL bEnable = ( aCbShowDescription.GetState() != STATE_NOCHECK );
+ sal_Bool bEnable = ( aCbShowDescription.GetState() != STATE_NOCHECK );
aOrientHlp.Enable( bEnable );
aFlOrder.Enable( bEnable );
@@ -311,7 +317,7 @@ IMPL_LINK ( SchAxisLabelTabPage, ToggleShowLabel, void *, EMPTYARG )
aRbAuto.Enable( bEnable );
aFlTextFlow.Enable( bEnable );
- aCbTextOverlap.Enable( bEnable );
+ aCbTextOverlap.Enable( bEnable && !m_bComplexCategories );
aCbTextBreak.Enable( bEnable );
m_aFtTextDirection.Enable( bEnable );
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.hxx b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
index 8e234b76af47..e56ed843fad6 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.hxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
@@ -71,12 +71,13 @@ private:
FixedText m_aFtTextDirection;
TextDirectionListBox m_aLbTextDirection;
- BOOL m_bShowStaggeringControls;
+ sal_Bool m_bShowStaggeringControls;
sal_Int32 m_nInitialDegrees;
bool m_bHasInitialDegrees; /// false = DialControl in tristate
bool m_bInitialStacking;
bool m_bHasInitialStacking; /// false = checkbox in tristate
+ bool m_bComplexCategories;
DECL_LINK ( ToggleShowLabel, void* );
@@ -87,10 +88,11 @@ public:
void Construct();
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs );
- virtual BOOL FillItemSet( SfxItemSet& rOutAttrs );
+ virtual sal_Bool FillItemSet( SfxItemSet& rOutAttrs );
virtual void Reset( const SfxItemSet& rInAttrs );
- void ShowStaggeringControls( BOOL bShowStaggeringControls );
+ void ShowStaggeringControls( sal_Bool bShowStaggeringControls );
+ void SetComplexCategories( bool bComplexCategories );
};
//.............................................................................
} //namespace chart
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.src b/chart2/source/controller/dialogs/tp_AxisLabel.src
index bcba1926c242..75da7dc5e653 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.src
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.src
@@ -35,6 +35,7 @@ TabPage TP_AXIS_LABEL
CheckBox CB_AXIS_LABEL_SCHOW_DESCR
{
+ HelpID = "chart2:CheckBox:TP_AXIS_LABEL:CB_AXIS_LABEL_SCHOW_DESCR";
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 248 , 12 ) ;
@@ -112,6 +113,7 @@ TabPage TP_AXIS_LABEL
};
CheckBox CB_AXIS_LABEL_TEXTOVERLAP
{
+ HelpID = "chart2:CheckBox:TP_AXIS_LABEL:CB_AXIS_LABEL_TEXTOVERLAP";
Pos = MAP_APPFONT ( 139 , 33 ) ;
Size = MAP_APPFONT ( 115 , 10 ) ;
TabStop = TRUE ;
@@ -120,6 +122,7 @@ TabPage TP_AXIS_LABEL
};
CheckBox CB_AXIS_LABEL_TEXTBREAK
{
+ HelpID = "chart2:CheckBox:TP_AXIS_LABEL:CB_AXIS_LABEL_TEXTBREAK";
Pos = MAP_APPFONT ( 139 , 47 ) ;
Size = MAP_APPFONT ( 115 , 10 ) ;
TabStop = TRUE ;
@@ -137,6 +140,7 @@ TabPage TP_AXIS_LABEL
};
RadioButton RB_AXIS_LABEL_SIDEBYSIDE
{
+ HelpID = "chart2:RadioButton:TP_AXIS_LABEL:RB_AXIS_LABEL_SIDEBYSIDE";
Pos = MAP_APPFONT ( 12 , 33 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
TabStop = TRUE ;
@@ -145,6 +149,7 @@ TabPage TP_AXIS_LABEL
};
RadioButton RB_AXIS_LABEL_UPDOWN
{
+ HelpID = "chart2:RadioButton:TP_AXIS_LABEL:RB_AXIS_LABEL_UPDOWN";
Pos = MAP_APPFONT ( 12 , 47 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
TabStop = TRUE ;
@@ -153,6 +158,7 @@ TabPage TP_AXIS_LABEL
};
RadioButton RB_AXIS_LABEL_DOWNUP
{
+ HelpID = "chart2:RadioButton:TP_AXIS_LABEL:RB_AXIS_LABEL_DOWNUP";
Pos = MAP_APPFONT ( 12 , 61 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
TabStop = TRUE ;
@@ -161,6 +167,7 @@ TabPage TP_AXIS_LABEL
};
RadioButton RB_AXIS_LABEL_AUTOORDER
{
+ HelpID = "chart2:RadioButton:TP_AXIS_LABEL:RB_AXIS_LABEL_AUTOORDER";
Pos = MAP_APPFONT ( 12 , 75 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
TabStop = TRUE ;
@@ -176,6 +183,7 @@ TabPage TP_AXIS_LABEL
};
ListBox LB_AXIS_TEXTDIR
{
+ HelpID = "chart2:ListBox:TP_AXIS_LABEL:LB_AXIS_TEXTDIR";
Pos = MAP_APPFONT ( 78 , 154 ) ;
Size = MAP_APPFONT ( 170 , 100 ) ;
Border = TRUE;
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
index c4d073e3d03d..61cde8fabf56 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
@@ -221,6 +221,10 @@ AxisPositionsTabPage::AxisPositionsTabPage(Window* pWindow,const SfxItemSet& rIn
m_aLB_PlaceLabels.SetSelectHdl( LINK( this, AxisPositionsTabPage, PlaceLabelsSelectHdl ) );
m_aLB_PlaceLabels.SetDropDownLineCount( m_aLB_PlaceLabels.GetEntryCount() );
m_aLB_PlaceTicks.SetDropDownLineCount( m_aLB_PlaceTicks.GetEntryCount() );
+ m_aCB_TicksInner.SetAccessibleRelationLabeledBy(&m_aFT_Major);
+ m_aCB_TicksOuter.SetAccessibleRelationLabeledBy(&m_aFT_Major);
+ m_aCB_MinorInner.SetAccessibleRelationLabeledBy(&m_aFT_Minor);
+ m_aCB_MinorOuter.SetAccessibleRelationLabeledBy(&m_aFT_Minor);
}
SfxTabPage* AxisPositionsTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs)
@@ -228,10 +232,10 @@ SfxTabPage* AxisPositionsTabPage::Create(Window* pWindow,const SfxItemSet& rOutA
return new AxisPositionsTabPage(pWindow, rOutAttrs);
}
-BOOL AxisPositionsTabPage::FillItemSet(SfxItemSet& rOutAttrs)
+sal_Bool AxisPositionsTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{
// axis line
- USHORT nPos = m_aLB_CrossesAt.GetSelectEntryPos();
+ sal_uInt16 nPos = m_aLB_CrossesAt.GetSelectEntryPos();
rOutAttrs.Put( SfxInt32Item( SCHATTR_AXIS_POSITION, nPos+1 ));
if( 2==nPos )
{
@@ -242,7 +246,7 @@ BOOL AxisPositionsTabPage::FillItemSet(SfxItemSet& rOutAttrs)
}
// labels
- USHORT nLabelPos = m_aLB_PlaceLabels.GetSelectEntryPos();
+ sal_uInt16 nLabelPos = m_aLB_PlaceLabels.GetSelectEntryPos();
if( nLabelPos != LISTBOX_ENTRY_NOTFOUND )
rOutAttrs.Put( SfxInt32Item( SCHATTR_AXIS_LABEL_POSITION, nLabelPos ));
@@ -262,11 +266,11 @@ BOOL AxisPositionsTabPage::FillItemSet(SfxItemSet& rOutAttrs)
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_TICKS,nTicks));
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_HELPTICKS,nMinorTicks));
- USHORT nMarkPos = m_aLB_PlaceTicks.GetSelectEntryPos();
+ sal_uInt16 nMarkPos = m_aLB_PlaceTicks.GetSelectEntryPos();
if( nMarkPos != LISTBOX_ENTRY_NOTFOUND )
rOutAttrs.Put( SfxInt32Item( SCHATTR_AXIS_MARK_POSITION, nMarkPos ));
- return TRUE;
+ return sal_True;
}
void AxisPositionsTabPage::Reset(const SfxItemSet& rInAttrs)
@@ -280,7 +284,7 @@ void AxisPositionsTabPage::Reset(const SfxItemSet& rInAttrs)
for( sal_Int32 nN=0; nN<m_aCategories.getLength() && nN<nMaxCount; nN++ )
m_aED_CrossesAtCategory.InsertEntry( m_aCategories[nN] );
- USHORT nCount = m_aED_CrossesAtCategory.GetEntryCount();
+ sal_uInt16 nCount = m_aED_CrossesAtCategory.GetEntryCount();
if( nCount>30 )
nCount=30;
m_aED_CrossesAtCategory.SetDropDownLineCount( nCount );
@@ -298,10 +302,10 @@ void AxisPositionsTabPage::Reset(const SfxItemSet& rInAttrs)
const SfxPoolItem *pPoolItem = NULL;
//axis line
- if(rInAttrs.GetItemState(SCHATTR_AXIS_POSITION,TRUE, &pPoolItem)== SFX_ITEM_SET)
+ if(rInAttrs.GetItemState(SCHATTR_AXIS_POSITION,sal_True, &pPoolItem)== SFX_ITEM_SET)
{
bool bZero = false;
- USHORT nPos = (USHORT)static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ sal_uInt16 nPos = (sal_uInt16)static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
if(nPos==0)
{
//switch to value
@@ -315,13 +319,13 @@ void AxisPositionsTabPage::Reset(const SfxItemSet& rInAttrs)
m_aLB_CrossesAt.SelectEntryPos( nPos );
CrossesAtSelectHdl( (void*)0 );
- if( rInAttrs.GetItemState(SCHATTR_AXIS_POSITION_VALUE,TRUE, &pPoolItem)== SFX_ITEM_SET || bZero )
+ if( rInAttrs.GetItemState(SCHATTR_AXIS_POSITION_VALUE,sal_True, &pPoolItem)== SFX_ITEM_SET || bZero )
{
double fCrossover = 0.0;
if( !bZero )
fCrossover = (((const SvxDoubleItem*)pPoolItem)->GetValue());
if( m_bCrossingAxisIsCategoryAxis )
- m_aED_CrossesAtCategory.SelectEntryPos( static_cast<USHORT>(::rtl::math::round(fCrossover-1.0)) );
+ m_aED_CrossesAtCategory.SelectEntryPos( static_cast<sal_uInt16>(::rtl::math::round(fCrossover-1.0)) );
else
m_aED_CrossesAt.SetValue(fCrossover);
}
@@ -334,13 +338,13 @@ void AxisPositionsTabPage::Reset(const SfxItemSet& rInAttrs)
else
{
m_aLB_CrossesAt.SetNoSelection();
- m_aED_CrossesAt.Enable( FALSE );
+ m_aED_CrossesAt.Enable( sal_False );
}
// Labels
- if( rInAttrs.GetItemState( SCHATTR_AXIS_LABEL_POSITION, FALSE, &pPoolItem ) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState( SCHATTR_AXIS_LABEL_POSITION, sal_False, &pPoolItem ) == SFX_ITEM_SET )
{
- USHORT nPos = (USHORT)static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ sal_uInt16 nPos = (sal_uInt16)static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
if( nPos < m_aLB_PlaceLabels.GetEntryCount() )
m_aLB_PlaceLabels.SelectEntryPos( nPos );
}
@@ -350,20 +354,20 @@ void AxisPositionsTabPage::Reset(const SfxItemSet& rInAttrs)
// Tick marks
long nTicks=0,nMinorTicks=0;
- if(rInAttrs.GetItemState(SCHATTR_AXIS_TICKS,TRUE, &pPoolItem)== SFX_ITEM_SET)
+ if(rInAttrs.GetItemState(SCHATTR_AXIS_TICKS,sal_True, &pPoolItem)== SFX_ITEM_SET)
nTicks=((const SfxInt32Item*)pPoolItem)->GetValue();
- if(rInAttrs.GetItemState(SCHATTR_AXIS_HELPTICKS,TRUE, &pPoolItem)== SFX_ITEM_SET)
+ if(rInAttrs.GetItemState(SCHATTR_AXIS_HELPTICKS,sal_True, &pPoolItem)== SFX_ITEM_SET)
nMinorTicks=((const SfxInt32Item*)pPoolItem)->GetValue();
- m_aCB_TicksInner.Check(BOOL(nTicks&CHAXIS_MARK_INNER));
- m_aCB_TicksOuter.Check(BOOL(nTicks&CHAXIS_MARK_OUTER));
- m_aCB_MinorInner.Check(BOOL(nMinorTicks&CHAXIS_MARK_INNER));
- m_aCB_MinorOuter.Check(BOOL(nMinorTicks&CHAXIS_MARK_OUTER));
+ m_aCB_TicksInner.Check(sal_Bool(nTicks&CHAXIS_MARK_INNER));
+ m_aCB_TicksOuter.Check(sal_Bool(nTicks&CHAXIS_MARK_OUTER));
+ m_aCB_MinorInner.Check(sal_Bool(nMinorTicks&CHAXIS_MARK_INNER));
+ m_aCB_MinorOuter.Check(sal_Bool(nMinorTicks&CHAXIS_MARK_OUTER));
// Tick position
- if( rInAttrs.GetItemState( SCHATTR_AXIS_MARK_POSITION, FALSE, &pPoolItem ) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState( SCHATTR_AXIS_MARK_POSITION, sal_False, &pPoolItem ) == SFX_ITEM_SET )
{
- USHORT nPos = (USHORT)static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ sal_uInt16 nPos = (sal_uInt16)static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
if( nPos < m_aLB_PlaceTicks.GetEntryCount() )
m_aLB_PlaceTicks.SelectEntryPos( nPos );
}
@@ -438,9 +442,9 @@ void AxisPositionsTabPage::SetNumFormatter( SvNumberFormatter* pFormatter )
m_aED_CrossesAt.UseInputStringForFormatting();
const SfxPoolItem *pPoolItem = NULL;
- if( GetItemSet().GetItemState( SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT, TRUE, &pPoolItem ) == SFX_ITEM_SET )
+ if( GetItemSet().GetItemState( SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT, sal_True, &pPoolItem ) == SFX_ITEM_SET )
{
- ULONG nFmt = (ULONG)((const SfxInt32Item*)pPoolItem)->GetValue();
+ sal_uLong nFmt = (sal_uLong)((const SfxInt32Item*)pPoolItem)->GetValue();
m_aED_CrossesAt.SetFormatKey( nFmt );
}
}
@@ -462,7 +466,7 @@ void AxisPositionsTabPage::SupportAxisPositioning( bool bSupportAxisPositioning
IMPL_LINK ( AxisPositionsTabPage, CrossesAtSelectHdl, void *, EMPTYARG )
{
- USHORT nPos = m_aLB_CrossesAt.GetSelectEntryPos();
+ sal_uInt16 nPos = m_aLB_CrossesAt.GetSelectEntryPos();
m_aED_CrossesAt.Show( (2==nPos) && !m_bCrossingAxisIsCategoryAxis );
m_aED_CrossesAtCategory.Show( (2==nPos) && m_bCrossingAxisIsCategoryAxis );
@@ -477,12 +481,12 @@ IMPL_LINK ( AxisPositionsTabPage, CrossesAtSelectHdl, void *, EMPTYARG )
IMPL_LINK ( AxisPositionsTabPage, PlaceLabelsSelectHdl, void *, EMPTYARG )
{
- USHORT nLabelPos = m_aLB_PlaceLabels.GetSelectEntryPos();
+ sal_uInt16 nLabelPos = m_aLB_PlaceLabels.GetSelectEntryPos();
bool bEnableTickmarkPlacement = (nLabelPos>1);
if( bEnableTickmarkPlacement )
{
- USHORT nAxisPos = m_aLB_CrossesAt.GetSelectEntryPos();
+ sal_uInt16 nAxisPos = m_aLB_CrossesAt.GetSelectEntryPos();
if( nLabelPos-2 == nAxisPos )
bEnableTickmarkPlacement=false;
}
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.hxx b/chart2/source/controller/dialogs/tp_AxisPositions.hxx
index 61fb13ecedd3..5bfc694b8939 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.hxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.hxx
@@ -47,7 +47,7 @@ public:
AxisPositionsTabPage( Window* pParent, const SfxItemSet& rInAttrs );
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs );
- virtual BOOL FillItemSet( SfxItemSet& rOutAttrs );
+ virtual sal_Bool FillItemSet( SfxItemSet& rOutAttrs );
virtual void Reset( const SfxItemSet& rInAttrs );
using TabPage::DeactivatePage;
virtual int DeactivatePage( SfxItemSet* pItemSet = NULL );
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.src b/chart2/source/controller/dialogs/tp_AxisPositions.src
index 8ce1ba39056a..1173b841354a 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.src
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.src
@@ -60,6 +60,7 @@
TabPage TP_AXIS_POSITIONS
{
+ HelpID = "chart2:TabPage:TP_AXIS_POSITIONS";
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 185 ) ;
@@ -79,6 +80,7 @@ TabPage TP_AXIS_POSITIONS
};
ListBox LB_CROSSES_OTHER_AXIS_AT
{
+ HelpID = "chart2:ListBox:TP_AXIS_POSITIONS:LB_CROSSES_OTHER_AXIS_AT";
Border = TRUE ;
AutoHScroll = TRUE ;
Pos = MAP_APPFONT ( X4 , Y1-2 ) ;
@@ -98,6 +100,7 @@ TabPage TP_AXIS_POSITIONS
};
SpinField EDT_CROSSES_OTHER_AXIS_AT
{
+ HelpID = "chart2:SpinField:TP_AXIS_POSITIONS:EDT_CROSSES_OTHER_AXIS_AT";
Border = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( X5 , Y1-2 ) ;
@@ -106,6 +109,7 @@ TabPage TP_AXIS_POSITIONS
};
ComboBox EDT_CROSSES_OTHER_AXIS_AT_CATEGORY
{
+ HelpID = "chart2:ComboBox:TP_AXIS_POSITIONS:EDT_CROSSES_OTHER_AXIS_AT_CATEGORY";
Border = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( X5 , Y1-2 ) ;
@@ -116,6 +120,7 @@ TabPage TP_AXIS_POSITIONS
CheckBox CB_AXIS_BETWEEN_CATEGORIES
{
+ HelpID = "chart2:CheckBox:TP_AXIS_POSITIONS:CB_AXIS_BETWEEN_CATEGORIES";
Hide = TRUE;
Pos = MAP_APPFONT ( X2 , Y2 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
@@ -137,6 +142,7 @@ TabPage TP_AXIS_POSITIONS
};
ListBox LB_PLACE_LABELS
{
+ HelpID = "chart2:ListBox:TP_AXIS_POSITIONS:LB_PLACE_LABELS";
Border = TRUE ;
AutoHScroll = TRUE ;
Pos = MAP_APPFONT ( X4 , Y4-2 ) ;
@@ -164,6 +170,7 @@ TabPage TP_AXIS_POSITIONS
};
SpinField EDT_AXIS_LABEL_DISTANCE
{
+ HelpID = "chart2:SpinField:TP_AXIS_POSITIONS:EDT_AXIS_LABEL_DISTANCE";
Hide = TRUE;
Border = TRUE ;
SVLook = TRUE ;
@@ -186,12 +193,14 @@ TabPage TP_AXIS_POSITIONS
};
CheckBox CB_TICKS_INNER
{
+ HelpID = "chart2:CheckBox:TP_AXIS_POSITIONS:CB_TICKS_INNER";
Pos = MAP_APPFONT ( XTICK_2 , Y7 ) ;
Size = MAP_APPFONT ( TICKWIDTH , 10 ) ;
Text [ en-US ] = "~Inner";
};
CheckBox CB_TICKS_OUTER
{
+ HelpID = "chart2:CheckBox:TP_AXIS_POSITIONS:CB_TICKS_OUTER";
Pos = MAP_APPFONT ( XTICK_3 , Y7 ) ;
Size = MAP_APPFONT ( TICKWIDTH , 10 ) ;
Text [ en-US ] = "~Outer";
@@ -205,12 +214,14 @@ TabPage TP_AXIS_POSITIONS
};
CheckBox CB_MINOR_INNER
{
+ HelpID = "chart2:CheckBox:TP_AXIS_POSITIONS:CB_MINOR_INNER";
Pos = MAP_APPFONT ( XTICK_2 , Y8 );
Size = MAP_APPFONT ( TICKWIDTH , 10 ) ;
Text [ en-US ] = "I~nner";
};
CheckBox CB_MINOR_OUTER
{
+ HelpID = "chart2:CheckBox:TP_AXIS_POSITIONS:CB_MINOR_OUTER";
Pos = MAP_APPFONT ( XTICK_3 , Y8 ) ;
Size = MAP_APPFONT ( TICKWIDTH , 10 ) ;
Text [ en-US ] = "O~uter";
@@ -232,6 +243,7 @@ TabPage TP_AXIS_POSITIONS
};
ListBox LB_PLACE_TICKS
{
+ HelpID = "chart2:ListBox:TP_AXIS_POSITIONS:LB_PLACE_TICKS";
Border = TRUE ;
AutoHScroll = TRUE ;
Pos = MAP_APPFONT ( X3 , Y9-2 ) ;
@@ -259,6 +271,7 @@ TabPage TP_AXIS_POSITIONS
};
CheckBox CB_MAJOR_GRID
{
+ HelpID = "chart2:CheckBox:TP_AXIS_POSITIONS:CB_MAJOR_GRID";
Hide = TRUE ;
Pos = MAP_APPFONT ( X2 , Y11 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
@@ -267,6 +280,7 @@ TabPage TP_AXIS_POSITIONS
};
PushButton PB_MAJOR_GRID
{
+ HelpID = "chart2:PushButton:TP_AXIS_POSITIONS:PB_MAJOR_GRID";
Hide = TRUE ;
TabStop = TRUE;
Pos = MAP_APPFONT ( X3 , Y11-2 );
@@ -275,6 +289,7 @@ TabPage TP_AXIS_POSITIONS
};
CheckBox CB_MINOR_GRID
{
+ HelpID = "chart2:CheckBox:TP_AXIS_POSITIONS:CB_MINOR_GRID";
Hide = TRUE ;
Pos = MAP_APPFONT ( X2 , Y12 ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
@@ -283,6 +298,7 @@ TabPage TP_AXIS_POSITIONS
};
PushButton PB_MINOR_GRID
{
+ HelpID = "chart2:PushButton:TP_AXIS_POSITIONS:PB_MINOR_GRID";
Hide = TRUE ;
TabStop = TRUE;
Pos = MAP_APPFONT ( X3 , Y12-2 );
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 728e7e6cf443..5774f9d9dc7c 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -179,6 +179,8 @@ Dim3DLookResourceGroup::Dim3DLookResourceGroup( Window* pWindow )
m_aLB_Scheme.SetDropDownLineCount(2);
m_aLB_Scheme.SetSelectHdl( LINK( this, Dim3DLookResourceGroup, SelectSchemeHdl ) );
+ m_aLB_Scheme.SetAccessibleName(m_aCB_3DLook.GetText());
+ m_aLB_Scheme.SetAccessibleRelationLabeledBy(&m_aCB_3DLook);
}
Dim3DLookResourceGroup::~Dim3DLookResourceGroup()
{
@@ -218,7 +220,7 @@ void Dim3DLookResourceGroup::fillControls( const ChartTypeParameter& rParameter
void Dim3DLookResourceGroup::fillParameter( ChartTypeParameter& rParameter )
{
rParameter.b3DLook = m_aCB_3DLook.IsChecked();
- USHORT nPos = m_aLB_Scheme.GetSelectEntryPos();
+ sal_uInt16 nPos = m_aLB_Scheme.GetSelectEntryPos();
if( POS_3DSCHEME_SIMPLE == nPos )
rParameter.eThreeDLookScheme = ThreeDLookScheme_Simple;
else if( POS_3DSCHEME_REALISTIC == nPos )
@@ -334,6 +336,9 @@ StackingResourceGroup::StackingResourceGroup( Window* pWindow )
m_aRB_Stack_Y.SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) );
m_aRB_Stack_Y_Percent.SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) );
m_aRB_Stack_Z.SetToggleHdl( LINK( this, StackingResourceGroup, StackingChangeHdl ) );
+ m_aRB_Stack_Y.SetAccessibleRelationMemberOf(&m_aCB_Stacked);
+ m_aRB_Stack_Y_Percent.SetAccessibleRelationMemberOf(&m_aCB_Stacked);
+ m_aRB_Stack_Z.SetAccessibleRelationMemberOf(&m_aCB_Stacked);
}
StackingResourceGroup::~StackingResourceGroup()
{
@@ -462,9 +467,9 @@ private:
MetricField m_aMF_SplineOrder;
FixedLine m_aFL_DialogButtons;
+ HelpButton m_aBP_Help;
OKButton m_aBP_OK;
CancelButton m_aBP_Cancel;
- HelpButton m_aBP_Help;
};
SplinePropertiesDialog::SplinePropertiesDialog( Window* pParent )
@@ -477,9 +482,9 @@ SplinePropertiesDialog::SplinePropertiesDialog( Window* pParent )
, m_aFT_SplineOrder( this, SchResId( FT_SPLINE_ORDER ) )
, m_aMF_SplineOrder( this, SchResId( MF_SPLINE_ORDER ) )
, m_aFL_DialogButtons( this, SchResId( FL_SPLINE_DIALOGBUTTONS ) )
+ , m_aBP_Help( this, SchResId(BTN_HELP) )
, m_aBP_OK( this, SchResId(BTN_OK) )
- , m_aBP_Cancel( this, SchResId(BTN_CANCEL) )
- , m_aBP_Help( this, SchResId(BTN_HELP) )
+ , m_aBP_Cancel( this, SchResId(BTN_CANCEL) )
{
FreeResource();
@@ -697,7 +702,7 @@ IMPL_LINK( SplineResourceGroup, SplineDetailsDialogHdl, void*, EMPTYARG )
ChartTypeParameter aOldParameter;
getSplinePropertiesDialog().fillParameter( aOldParameter, m_aCB_Splines.IsChecked() );
- BOOL bOldSmoothLines = m_aCB_Splines.IsChecked();
+ sal_Bool bOldSmoothLines = m_aCB_Splines.IsChecked();
m_aCB_Splines.Check();
if( RET_OK == getSplinePropertiesDialog().Execute() )
{
@@ -758,7 +763,7 @@ void GeometryResourceGroup::setPosition( const Point& rPoint )
void GeometryResourceGroup::fillControls( const ChartTypeParameter& rParameter )
{
- USHORT nGeometry3D = static_cast<USHORT>(rParameter.nGeometry3D);
+ sal_uInt16 nGeometry3D = static_cast<sal_uInt16>(rParameter.nGeometry3D);
m_aGeometryResources.SelectEntryPos(nGeometry3D);
m_aGeometryResources.Enable(rParameter.b3DLook);
}
@@ -1074,8 +1079,11 @@ void ChartTypeTabPage::fillAllControls( const ChartTypeParameter& rParameter, bo
{
m_nChangingCalls++;
if( m_pCurrentMainType && bAlsoResetSubTypeList )
- m_pCurrentMainType->fillSubTypeList( m_aSubTypeList, rParameter );
- m_aSubTypeList.SelectItem( static_cast<USHORT>( rParameter.nSubTypeIndex) );
+ {
+ bool bIsHighContrast = ( true && GetSettings().GetStyleSettings().GetHighContrastMode() );
+ m_pCurrentMainType->fillSubTypeList( m_aSubTypeList, bIsHighContrast, rParameter );
+ }
+ m_aSubTypeList.SelectItem( static_cast<sal_uInt16>( rParameter.nSubTypeIndex) );
m_pAxisTypeResourceGroup->fillControls( rParameter );
m_pDim3DLookResourceGroup->fillControls( rParameter );
m_pStackingResourceGroup->fillControls( rParameter );
@@ -1100,7 +1108,7 @@ void ChartTypeTabPage::initializePage()
::std::vector< ChartTypeDialogController* >::iterator aIter = m_aChartTypeDialogControllerList.begin();
const ::std::vector< ChartTypeDialogController* >::const_iterator aEnd = m_aChartTypeDialogControllerList.end();
- for( USHORT nM=0; aIter != aEnd; aIter++, nM++ )
+ for( sal_uInt16 nM=0; aIter != aEnd; aIter++, nM++ )
{
if( (*aIter)->isSubType(aServiceName) )
{
diff --git a/chart2/source/controller/dialogs/tp_ChartType.src b/chart2/source/controller/dialogs/tp_ChartType.src
index a9bb2a039f3c..69c33cd14021 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.src
+++ b/chart2/source/controller/dialogs/tp_ChartType.src
@@ -69,7 +69,7 @@
TabPage TP_CHARTTYPE
{
Hide = TRUE ;
- HelpID = SID_DIAGRAM_TYPE;
+ HelpID = HID_DIAGRAM_TYPE;
SVLook = TRUE ;
Size = MAP_APPFONT ( CHART_WIZARD_PAGEWIDTH , CHART_WIZARD_PAGEHEIGHT ) ;
@@ -99,18 +99,21 @@ TabPage TP_CHARTTYPE
CheckBox CB_X_AXIS_CATEGORIES
{
+ HelpID = "chart2:CheckBox:TP_CHARTTYPE:CB_X_AXIS_CATEGORIES";
Pos = MAP_APPFONT ( POS_X_IMAGELIST , POS_Y_VALUE_X_AXIS ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text [ en-US ] = "X axis with Categories" ;
};
CheckBox CB_3D_LOOK
{
+ HelpID = "chart2:CheckBox:TP_CHARTTYPE:CB_3D_LOOK";
Pos = MAP_APPFONT ( POS_X_IMAGELIST , POS_Y_3D_LOOK ) ;
Size = MAP_APPFONT ( WIDTH_3D , 10 ) ;
Text [ en-US ] = "~3D Look" ;
};
ListBox LB_3D_SCHEME
{
+ HelpID = "chart2:ListBox:TP_CHARTTYPE:LB_3D_SCHEME";
Border = TRUE;
TabStop = TRUE;
DropDown = TRUE;
@@ -120,12 +123,14 @@ TabPage TP_CHARTTYPE
CheckBox CB_STACKED
{
+ HelpID = "chart2:CheckBox:TP_CHARTTYPE:CB_STACKED";
Pos = MAP_APPFONT ( POS_X_IMAGELIST , POS_Y_STACKING ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text [ en-US ] = "~Stack series" ;
};
RadioButton RB_STACK_Y
{
+ HelpID = "chart2:RadioButton:TP_CHARTTYPE:RB_STACK_Y";
Pos = MAP_APPFONT ( POS_X_IMAGELIST+RSC_SP_CHK_TEXTINDENT, POS_Y_STACKING+12 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
@@ -135,6 +140,7 @@ TabPage TP_CHARTTYPE
};
RadioButton RB_STACK_Y_PERCENT
{
+ HelpID = "chart2:RadioButton:TP_CHARTTYPE:RB_STACK_Y_PERCENT";
Pos = MAP_APPFONT ( POS_X_IMAGELIST+RSC_SP_CHK_TEXTINDENT, POS_Y_STACKING+2*12 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
@@ -142,6 +148,7 @@ TabPage TP_CHARTTYPE
};
RadioButton RB_STACK_Z
{
+ HelpID = "chart2:RadioButton:TP_CHARTTYPE:RB_STACK_Z";
Pos = MAP_APPFONT ( POS_X_IMAGELIST+RSC_SP_CHK_TEXTINDENT, POS_Y_STACKING+3*12 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
@@ -152,6 +159,7 @@ TabPage TP_CHARTTYPE
CheckBox CB_SPLINES
{
+ HelpID = "chart2:CheckBox:TP_CHARTTYPE:CB_SPLINES";
Pos = MAP_APPFONT ( POS_X_IMAGELIST , POS_Y_SPLINES ) ;
Size = MAP_APPFONT ( 150 , 10 ) ;
Text [ en-US ] = "S~mooth lines" ;
@@ -159,6 +167,7 @@ TabPage TP_CHARTTYPE
PushButton PB_SPLINE_DIALOG
{
+ HelpID = "chart2:PushButton:TP_CHARTTYPE:PB_SPLINE_DIALOG";
TabStop = TRUE ;
Pos = MAP_APPFONT ( POS_X_IMAGELIST , POS_Y_SPLINES-6 ) ;
Size = MAP_APPFONT ( 12 , 14 ) ;
@@ -167,6 +176,7 @@ TabPage TP_CHARTTYPE
CheckBox CB_XVALUE_SORTING
{
+ HelpID = "chart2:CheckBox:TP_CHARTTYPE:CB_XVALUE_SORTING";
TabStop = TRUE ;
Pos = MAP_APPFONT ( POS_X_IMAGELIST , POS_Y_XVALUE_SORTING ) ;
Size = MAP_APPFONT ( WIDTH_XVALUE_SORTING , 10 ) ;
@@ -185,6 +195,7 @@ ModalDialog DLG_SPLINE_PROPERTIES
Closeable = TRUE;
RadioButton RB_SPLINES_CUBIC
{
+ HelpID = "chart2:RadioButton:DLG_SPLINE_PROPERTIES:RB_SPLINES_CUBIC";
Pos = MAP_APPFONT ( POS_X_SPLINES_1, POS_Y_SPLINES_2 ) ;
Size = MAP_APPFONT ( SPLINES_WIDTH_RADIO , 10 ) ;
TabStop = TRUE ;
@@ -192,6 +203,7 @@ ModalDialog DLG_SPLINE_PROPERTIES
};
RadioButton RB_SPLINES_B
{
+ HelpID = "chart2:RadioButton:DLG_SPLINE_PROPERTIES:RB_SPLINES_B";
Pos = MAP_APPFONT ( POS_X_SPLINES_1, POS_Y_SPLINES_3 ) ;
Size = MAP_APPFONT ( SPLINES_WIDTH_RADIO , 10 ) ;
TabStop = TRUE ;
@@ -213,6 +225,7 @@ ModalDialog DLG_SPLINE_PROPERTIES
};
MetricField MF_SPLINE_RESOLUTION
{
+ HelpID = "chart2:MetricField:DLG_SPLINE_PROPERTIES:MF_SPLINE_RESOLUTION";
Border = TRUE ;
Pos = MAP_APPFONT ( POS_X_SPLINE_EXTRAS+SPLINES_WIDTH_METRIC_TEXT+RSC_SP_FLGR_SPACE_X , POS_Y_SPLINES_2-2 ) ;
Size = MAP_APPFONT ( 25 , 12 ) ;
@@ -236,6 +249,7 @@ ModalDialog DLG_SPLINE_PROPERTIES
};
MetricField MF_SPLINE_ORDER
{
+ HelpID = "chart2:MetricField:DLG_SPLINE_PROPERTIES:MF_SPLINE_ORDER";
Border = TRUE ;
Pos = MAP_APPFONT ( POS_X_SPLINE_EXTRAS+SPLINES_WIDTH_METRIC_TEXT+RSC_SP_FLGR_SPACE_X , POS_Y_SPLINES_3-2 ) ;
Size = MAP_APPFONT ( 25 , 12 ) ;
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx
index a53c205d9ecc..78b730cfb9ed 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx
@@ -55,7 +55,7 @@ SfxTabPage* DataLabelsTabPage::Create(Window* pWindow,
return new DataLabelsTabPage(pWindow, rOutAttrs);
}
-BOOL DataLabelsTabPage::FillItemSet(SfxItemSet& rOutAttrs)
+sal_Bool DataLabelsTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{
return m_aDataLabelResources.FillItemSet(rOutAttrs);
}
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.hxx b/chart2/source/controller/dialogs/tp_DataLabel.hxx
index ed49bd58cab7..5c40ec6872f4 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/tp_DataLabel.hxx
@@ -53,7 +53,7 @@ public:
void SetNumberFormatter( SvNumberFormatter* pFormatter );
virtual void Reset(const SfxItemSet& rInAttrs);
- virtual BOOL FillItemSet(SfxItemSet& rOutAttrs);
+ virtual sal_Bool FillItemSet(SfxItemSet& rOutAttrs);
private:
DataLabelResources m_aDataLabelResources;
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.src b/chart2/source/controller/dialogs/tp_DataLabel.src
index 615e81c2c550..0f8f12c3e48b 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.src
+++ b/chart2/source/controller/dialogs/tp_DataLabel.src
@@ -28,10 +28,6 @@
#include "TabPages.hrc"
#include "res_DataLabel.hrc"
-#ifndef _GLOBLMN_HRC
-#include <svx/globlmn.hrc>
-#endif
-
TabPage TP_DATA_DESCR
{
Hide = TRUE ;
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index 557de8492384..d18fe55d2951 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -152,7 +152,7 @@ static long lcl_pRoleListBoxTabs[] =
void lcl_ShowChooserButton(
::chart::RangeSelectionButton & rChooserButton,
Edit & rEditField,
- BOOL bShow )
+ sal_Bool bShow )
{
if( rChooserButton.IsVisible() != bShow )
{
@@ -170,8 +170,8 @@ void lcl_enableRangeChoosing( bool bEnable, Dialog * pDialog )
{
if( pDialog )
{
- pDialog->Show( bEnable ? FALSE : TRUE );
- pDialog->SetModalInputMode( bEnable ? FALSE : TRUE );
+ pDialog->Show( bEnable ? sal_False : sal_True );
+ pDialog->SetModalInputMode( bEnable ? sal_False : sal_True );
}
}
@@ -312,7 +312,7 @@ DataSourceTabPage::DataSourceTabPage(
// set handlers
m_apLB_SERIES->SetSelectHdl( LINK( this, DataSourceTabPage, SeriesSelectionChangedHdl ));
- m_aLB_ROLE.SetWindowBits( WB_HSCROLL | WB_CLIPCHILDREN );
+ m_aLB_ROLE.SetStyle( m_aLB_ROLE.GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN );
m_aLB_ROLE.SetSelectionMode( SINGLE_SELECTION );
m_aLB_ROLE.SetSelectHdl( LINK( this, DataSourceTabPage, RoleSelectionChangedHdl ));
@@ -360,6 +360,8 @@ DataSourceTabPage::DataSourceTabPage(
if( m_apLB_SERIES->First())
m_apLB_SERIES->Select( m_apLB_SERIES->First());
m_apLB_SERIES->GrabFocus();
+ m_aBTN_UP.SetAccessibleName(String(SchResId(STR_BUTTON_UP)));
+ m_aBTN_DOWN.SetAccessibleName(String(SchResId(STR_BUTTON_DOWN)));
}
DataSourceTabPage::~DataSourceTabPage()
@@ -460,7 +462,7 @@ void DataSourceTabPage::updateControlsFromDialogModel()
void DataSourceTabPage::fillSeriesListBox()
{
- m_apLB_SERIES->SetUpdateMode( FALSE );
+ m_apLB_SERIES->SetUpdateMode( sal_False );
Reference< XDataSeries > xSelected;
SeriesEntry * pEntry = dynamic_cast< SeriesEntry * >( m_apLB_SERIES->FirstSelected());
@@ -512,7 +514,7 @@ void DataSourceTabPage::fillSeriesListBox()
if( bHasSelectedEntry && pSelectedEntry )
m_apLB_SERIES->Select( pSelectedEntry );
- m_apLB_SERIES->SetUpdateMode( TRUE );
+ m_apLB_SERIES->SetUpdateMode( sal_True );
}
void DataSourceTabPage::fillRoleListBox()
@@ -521,7 +523,7 @@ void DataSourceTabPage::fillRoleListBox()
bool bHasSelectedEntry = (pSeriesEntry != 0);
SvLBoxEntry * pRoleEntry = m_aLB_ROLE.FirstSelected();
- ULONG nRoleIndex = SAL_MAX_UINT32;
+ sal_uLong nRoleIndex = SAL_MAX_UINT32;
if( pRoleEntry )
nRoleIndex = m_aLB_ROLE.GetModel()->GetAbsPos( pRoleEntry );
@@ -534,7 +536,7 @@ void DataSourceTabPage::fillRoleListBox()
pSeriesEntry->m_xChartType ));
// fill role list
- m_aLB_ROLE.SetUpdateMode( FALSE );
+ m_aLB_ROLE.SetUpdateMode( sal_False );
m_aLB_ROLE.Clear();
m_aLB_ROLE.RemoveSelection();
@@ -552,7 +554,7 @@ void DataSourceTabPage::fillRoleListBox()
m_aLB_ROLE.Select( m_aLB_ROLE.GetEntry( nRoleIndex ));
}
- m_aLB_ROLE.SetUpdateMode( TRUE );
+ m_aLB_ROLE.SetUpdateMode( sal_True );
}
}
@@ -579,7 +581,7 @@ void DataSourceTabPage::updateControlState()
m_aFT_DATALABELS.Show(!bHasCategories);
m_aFT_CATEGORIES.Show( bHasCategories);
- BOOL bShowIB = bHasRangeChooser;
+ sal_Bool bShowIB = bHasRangeChooser;
lcl_ShowChooserButton( m_aIMB_RANGE_CAT, m_aEDT_CATEGORIES, bShowIB );
m_aFT_SERIES.Enable();
diff --git a/chart2/source/controller/dialogs/tp_DataSource.hxx b/chart2/source/controller/dialogs/tp_DataSource.hxx
index 291e3719a9a0..f606e9899e66 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.hxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.hxx
@@ -125,12 +125,12 @@ protected:
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XRangeSelectionListener >
getSelectionRangeListener();
- /** @return </TRUE>, if the edit field contains a valid range entry. if no
- XCellRangesAccess can be obtained, </TRUE> is returned.
+ /** @return </sal_True>, if the edit field contains a valid range entry. if no
+ XCellRangesAccess can be obtained, </sal_True> is returned.
*/
bool isRangeFieldContentValid( Edit & rEdit );
- /** @return </TRUE>, if the tab-page is in a consistent (commitable) state
+ /** @return </sal_True>, if the tab-page is in a consistent (commitable) state
*/
bool isValid();
void setDirty();
diff --git a/chart2/source/controller/dialogs/tp_DataSource.src b/chart2/source/controller/dialogs/tp_DataSource.src
index 3e1f8a51c68a..9173a9c709ab 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.src
+++ b/chart2/source/controller/dialogs/tp_DataSource.src
@@ -29,6 +29,7 @@
TabPage TP_DATA_SOURCE
{
+ HelpID = "chart2:TabPage:TP_DATA_SOURCE";
Hide = TRUE;
Size = MAP_APPFONT ( 248, 140 );
SVLook = TRUE ;
@@ -86,6 +87,7 @@ TabPage TP_DATA_SOURCE
};
Edit EDT_RANGE
{
+ HelpID = "chart2:Edit:TP_DATA_SOURCE:EDT_RANGE";
Border = TRUE;
TabStop = TRUE;
Pos = MAP_APPFONT ( 82 , 89 );
@@ -93,6 +95,7 @@ TabPage TP_DATA_SOURCE
};
ImageButton IMB_RANGE_MAIN
{
+ HelpID = "chart2:ImageButton:TP_DATA_SOURCE:IMB_RANGE_MAIN";
TabStop = TRUE;
Pos = MAP_APPFONT ( 228 , 88 );
Size = MAP_APPFONT ( 14 , 14 );
@@ -118,6 +121,7 @@ TabPage TP_DATA_SOURCE
Edit EDT_CATEGORIES
{
+ HelpID = "chart2:Edit:TP_DATA_SOURCE:EDT_CATEGORIES";
Border = TRUE;
TabStop = TRUE;
Pos = MAP_APPFONT ( 82 , 117 );
@@ -125,6 +129,7 @@ TabPage TP_DATA_SOURCE
};
ImageButton IMB_RANGE_CAT
{
+ HelpID = "chart2:ImageButton:TP_DATA_SOURCE:IMB_RANGE_CAT";
TabStop = TRUE;
Pos = MAP_APPFONT ( 228 , 116 );
Size = MAP_APPFONT ( 14 , 14 );
@@ -134,6 +139,7 @@ TabPage TP_DATA_SOURCE
PushButton BTN_ADD
{
+ HelpID = "chart2:PushButton:TP_DATA_SOURCE:BTN_ADD";
TabStop = TRUE;
Disable = FALSE;
Pos = MAP_APPFONT ( 6 , 105 );
@@ -143,6 +149,7 @@ TabPage TP_DATA_SOURCE
};
PushButton BTN_REMOVE
{
+ HelpID = "chart2:PushButton:TP_DATA_SOURCE:BTN_REMOVE";
TabStop = TRUE;
Disable = TRUE;
Pos = MAP_APPFONT ( 6 , 121 );
@@ -154,6 +161,7 @@ TabPage TP_DATA_SOURCE
// Note: Text is only a black triangle symbol
PushButton BTN_UP
{
+ HelpID = "chart2:PushButton:TP_DATA_SOURCE:BTN_UP";
TabStop = TRUE;
Disable = TRUE;
Pos = MAP_APPFONT ( 64 , 105 );
@@ -163,6 +171,7 @@ TabPage TP_DATA_SOURCE
// Note: Text is only a black triangle symbol
PushButton BTN_DOWN
{
+ HelpID = "chart2:PushButton:TP_DATA_SOURCE:BTN_DOWN";
TabStop = TRUE;
Disable = TRUE;
Pos = MAP_APPFONT ( 64 , 121 );
diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.cxx b/chart2/source/controller/dialogs/tp_ErrorBars.cxx
index 14214eb4189a..0c945846af44 100644
--- a/chart2/source/controller/dialogs/tp_ErrorBars.cxx
+++ b/chart2/source/controller/dialogs/tp_ErrorBars.cxx
@@ -62,7 +62,7 @@ SfxTabPage* ErrorBarsTabPage::Create(
return new ErrorBarsTabPage( pParent, rOutAttrs );
}
-BOOL ErrorBarsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
+sal_Bool ErrorBarsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
{
return m_aErrorBarResources.FillItemSet( rOutAttrs );
}
diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.hxx b/chart2/source/controller/dialogs/tp_ErrorBars.hxx
index cc581dd7afac..1d7c291f4fb3 100644
--- a/chart2/source/controller/dialogs/tp_ErrorBars.hxx
+++ b/chart2/source/controller/dialogs/tp_ErrorBars.hxx
@@ -50,7 +50,7 @@ public:
::com::sun::star::chart2::XChartDocument > & xChartDocument );
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs );
- virtual BOOL FillItemSet( SfxItemSet& rOutAttrs );
+ virtual sal_Bool FillItemSet( SfxItemSet& rOutAttrs );
virtual void Reset( const SfxItemSet& rInAttrs );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.src b/chart2/source/controller/dialogs/tp_ErrorBars.src
index aede04751907..b649cb4474c9 100644
--- a/chart2/source/controller/dialogs/tp_ErrorBars.src
+++ b/chart2/source/controller/dialogs/tp_ErrorBars.src
@@ -30,6 +30,7 @@
TabPage TP_YERRORBAR
{
+ HelpID = "chart2:TabPage:TP_YERRORBAR";
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 185 ) ;
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
index 9b7d34b72930..8cbdc35b1d44 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
@@ -52,6 +52,7 @@ SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow,
, m_aFtTextDirection( this, SchResId( FT_LEGEND_TEXTDIR ) )
, m_aLbTextDirection( this, SchResId( LB_LEGEND_TEXTDIR ), &m_aFlTextOrient, &m_aFtTextDirection )
{
+ m_apLegendPositionResources->SetAccessibleRelationMemberOf(&aGrpLegend);
FreeResource();
}
@@ -65,14 +66,14 @@ SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow,
return new SchLegendPosTabPage(pWindow, rOutAttrs);
}
-BOOL SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs)
+sal_Bool SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{
m_apLegendPositionResources->writeToItemSet(rOutAttrs);
if( m_aLbTextDirection.GetSelectEntryCount() > 0 )
rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_aLbTextDirection.GetSelectEntryValue() ) );
- return TRUE;
+ return sal_True;
}
void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs)
@@ -80,7 +81,7 @@ void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs)
m_apLegendPositionResources->initFromItemSet(rInAttrs);
const SfxPoolItem* pPoolItem = 0;
- if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, TRUE, &pPoolItem ) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, sal_True, &pPoolItem ) == SFX_ITEM_SET )
m_aLbTextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) );
}
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.hxx b/chart2/source/controller/dialogs/tp_LegendPosition.hxx
index 521877af30b1..6140e7395623 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.hxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.hxx
@@ -58,7 +58,7 @@ public:
virtual ~SchLegendPosTabPage();
static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs);
- virtual BOOL FillItemSet(SfxItemSet& rOutAttrs);
+ virtual sal_Bool FillItemSet(SfxItemSet& rOutAttrs);
virtual void Reset(const SfxItemSet& rInAttrs);
};
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.src b/chart2/source/controller/dialogs/tp_LegendPosition.src
index 54b1065259df..2b0f93892fa9 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.src
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.src
@@ -60,6 +60,7 @@ TabPage TP_LEGEND_POS
ListBox LB_LEGEND_TEXTDIR
{
+ HelpID = "chart2:ListBox:TP_LEGEND_POS:LB_LEGEND_TEXTDIR";
Pos = MAP_APPFONT ( 78 , 14 + RESOURCE_LEGENDPOSITION_HEIGHT + 17 ) ;
Size = MAP_APPFONT ( 170 , 100 ) ;
Border = TRUE;
diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.cxx b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
index 5dd8f7cb44e6..1dd218a71d30 100644
--- a/chart2/source/controller/dialogs/tp_PointGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
@@ -67,7 +67,7 @@ SfxTabPage* SchLayoutTabPage::Create(Window* pWindow,
return new SchLayoutTabPage(pWindow, rOutAttrs);
}
-BOOL SchLayoutTabPage::FillItemSet(SfxItemSet& rOutAttrs)
+sal_Bool SchLayoutTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{
if(m_pGeometryResources && m_pGeometryResources->GetSelectEntryCount())
@@ -82,19 +82,19 @@ BOOL SchLayoutTabPage::FillItemSet(SfxItemSet& rOutAttrs)
rOutAttrs.Put(SfxInt32Item(SCHATTR_STYLE_SHAPE,nShape));
rOutAttrs.Put(Svx3DHorizontalSegmentsItem(nSegs));
}
- return TRUE;
+ return sal_True;
}
void SchLayoutTabPage::Reset(const SfxItemSet& rInAttrs)
{
const SfxPoolItem *pPoolItem = NULL;
- if (rInAttrs.GetItemState(SCHATTR_STYLE_SHAPE,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_STYLE_SHAPE,sal_True, &pPoolItem) == SFX_ITEM_SET)
{
long nVal=((const SfxInt32Item*)pPoolItem)->GetValue();
if(m_pGeometryResources)
{
- m_pGeometryResources->SelectEntryPos(static_cast<USHORT>(nVal));
+ m_pGeometryResources->SelectEntryPos(static_cast<sal_uInt16>(nVal));
m_pGeometryResources->Show( true );
}
}
diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.hxx b/chart2/source/controller/dialogs/tp_PointGeometry.hxx
index aafe7856aafe..8a868158cf09 100644
--- a/chart2/source/controller/dialogs/tp_PointGeometry.hxx
+++ b/chart2/source/controller/dialogs/tp_PointGeometry.hxx
@@ -44,7 +44,7 @@ public:
virtual ~SchLayoutTabPage();
static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs);
- virtual BOOL FillItemSet(SfxItemSet& rOutAttrs);
+ virtual sal_Bool FillItemSet(SfxItemSet& rOutAttrs);
virtual void Reset(const SfxItemSet& rInAttrs);
private:
diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.src b/chart2/source/controller/dialogs/tp_PointGeometry.src
index 39e1e1e9e21d..b6862cba3b77 100644
--- a/chart2/source/controller/dialogs/tp_PointGeometry.src
+++ b/chart2/source/controller/dialogs/tp_PointGeometry.src
@@ -29,6 +29,7 @@
TabPage TP_LAYOUT
{
+ HelpID = "chart2:TabPage:TP_LAYOUT";
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 185 ) ;
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index e71f29c54d9f..e1dc637948b6 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -66,7 +66,7 @@ SfxTabPage* PolarOptionsTabPage::Create( Window* pWindow,const SfxItemSet& rOutA
return new PolarOptionsTabPage( pWindow, rOutAttrs );
}
-BOOL PolarOptionsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
+sal_Bool PolarOptionsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
{
if( m_aAngleDial.IsVisible() )
{
@@ -80,14 +80,15 @@ BOOL PolarOptionsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
if (m_aCB_IncludeHiddenCells.IsVisible())
rOutAttrs.Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_aCB_IncludeHiddenCells.IsChecked()));
- return TRUE;
+ return sal_True;
}
void PolarOptionsTabPage::Reset(const SfxItemSet& rInAttrs)
{
const SfxPoolItem *pPoolItem = NULL;
- if (rInAttrs.GetItemState(SCHATTR_STARTING_ANGLE, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ long nTmp;
+ if (rInAttrs.GetItemState(SCHATTR_STARTING_ANGLE, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
long nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue();
@@ -95,29 +96,29 @@ void PolarOptionsTabPage::Reset(const SfxItemSet& rInAttrs)
}
else
{
- m_aFL_StartingAngle.Show(FALSE);
- m_aAngleDial.Show(FALSE);
- m_aNF_StartingAngle.Show(FALSE);
- m_aFT_Degrees.Show(FALSE);
+ m_aFL_StartingAngle.Show(sal_False);
+ m_aAngleDial.Show(sal_False);
+ m_aNF_StartingAngle.Show(sal_False);
+ m_aFT_Degrees.Show(sal_False);
}
- if (rInAttrs.GetItemState(SCHATTR_CLOCKWISE, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_CLOCKWISE, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
- BOOL bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
+ sal_Bool bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
m_aCB_Clockwise.Check(bCheck);
}
else
{
- m_aCB_Clockwise.Show(FALSE);
+ m_aCB_Clockwise.Show(sal_False);
}
- if (rInAttrs.GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
m_aCB_IncludeHiddenCells.Check(bVal);
}
else
{
- m_aCB_IncludeHiddenCells.Show(FALSE);
- m_aFL_PlotOptions.Show(FALSE);
+ m_aCB_IncludeHiddenCells.Show(sal_False);
+ m_aFL_PlotOptions.Show(sal_False);
}
}
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hxx b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
index 73ade4a4cecb..51a0e5c9ec3c 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
@@ -47,7 +47,7 @@ public:
virtual ~PolarOptionsTabPage();
static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs);
- virtual BOOL FillItemSet(SfxItemSet& rOutAttrs);
+ virtual sal_Bool FillItemSet(SfxItemSet& rOutAttrs);
virtual void Reset(const SfxItemSet& rInAttrs);
private:
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.src b/chart2/source/controller/dialogs/tp_PolarOptions.src
index 237fa027b55f..96463a97341b 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.src
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.src
@@ -30,12 +30,14 @@
TabPage TP_POLAROPTIONS
{
+ HelpID = "chart2:TabPage:TP_POLAROPTIONS";
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 185 ) ;
CheckBox CB_CLOCKWISE
{
+ HelpID = "chart2:CheckBox:TP_POLAROPTIONS:CB_CLOCKWISE";
Pos = MAP_APPFONT ( 12 , 8 );
Size = MAP_APPFONT ( 248 , 10 );
TabStop = TRUE;
@@ -61,6 +63,7 @@ TabPage TP_POLAROPTIONS
};
NumericField NF_STARTING_ANGLE
{
+ HelpID = "chart2:NumericField:TP_POLAROPTIONS:NF_STARTING_ANGLE";
Pos = MAP_APPFONT ( 61 , 53 ) ;
Size = MAP_APPFONT ( 28 , 12 ) ;
Border = TRUE ;
@@ -79,6 +82,7 @@ TabPage TP_POLAROPTIONS
};
CheckBox CB_INCLUDE_HIDDEN_CELLS_POLAR
{
+ HelpID = "chart2:CheckBox:TP_POLAROPTIONS:CB_INCLUDE_HIDDEN_CELLS_POLAR";
Pos = MAP_APPFONT ( 12 , 104 ) ;
Size = MAP_APPFONT ( 200 , 10 ) ;
TabStop = TRUE ;
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
index 083dd668a1ff..43ba8a16d307 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
@@ -49,7 +49,7 @@ namespace
void lcl_ShowChooserButton(
::chart::RangeSelectionButton & rChooserButton,
Edit & rEditField,
- BOOL bShow )
+ sal_Bool bShow )
{
if( rChooserButton.IsVisible() != bShow )
{
@@ -66,8 +66,8 @@ void lcl_enableRangeChoosing( bool bEnable, Dialog * pDialog )
{
if( pDialog )
{
- pDialog->Show( bEnable ? FALSE : TRUE );
- pDialog->SetModalInputMode( bEnable ? FALSE : TRUE );
+ pDialog->Show( bEnable ? sal_False : sal_True );
+ pDialog->SetModalInputMode( bEnable ? sal_False : sal_True );
}
}
void lcl_shiftControlY( Control & rControl, long nYOffset )
@@ -340,7 +340,7 @@ bool RangeChooserTabPage::isValid()
m_aCB_FirstRowAsLabel.Enable( bIsValid );
m_aCB_FirstColumnAsLabel.Enable( bIsValid );
}
- BOOL bShowIB = m_rDialogModel.getRangeSelectionHelper()->hasRangeSelection();
+ sal_Bool bShowIB = m_rDialogModel.getRangeSelectionHelper()->hasRangeSelection();
lcl_ShowChooserButton( m_aIB_Range, m_aED_Range, bShowIB );
return bIsValid;
@@ -365,7 +365,7 @@ IMPL_LINK( RangeChooserTabPage, ChooseRangeHdl, void *, EMPTYARG )
{
rtl::OUString aRange = m_aED_Range.GetText();
// using assignment for broken gcc 3.3
- rtl::OUString aTitle = ::rtl::OUString( String( SchResId( STR_PAGE_DATA_RANGE ) ));
+ rtl::OUString aTitle = String( SchResId( STR_PAGE_DATA_RANGE ) );
lcl_enableRangeChoosing( true, m_pParentDialog );
m_rDialogModel.getRangeSelectionHelper()->chooseRange( aRange, aTitle, *this );
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.src b/chart2/source/controller/dialogs/tp_RangeChooser.src
index de07c9763b7d..962722b41c71 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.src
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.src
@@ -37,6 +37,7 @@
TabPage TP_RANGECHOOSER
{
+ HelpID = "chart2:TabPage:TP_RANGECHOOSER";
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 248, 140 ) ;
@@ -55,18 +56,21 @@ TabPage TP_RANGECHOOSER
};
Edit ED_RANGE
{
+ HelpID = "chart2:Edit:TP_RANGECHOOSER:ED_RANGE";
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 32 ) ;
Size = MAP_APPFONT ( 220 , 12 ) ;
};
ImageButton IB_RANGE
{
+ HelpID = "chart2:ImageButton:TP_RANGECHOOSER:IB_RANGE";
Pos = MAP_APPFONT ( 228 , 31 ) ;
Size = MAP_APPFONT ( 14 , 14 ) ;
TabStop = FALSE ;
};
RadioButton RB_DATAROWS
{
+ HelpID = "chart2:RadioButton:TP_RANGECHOOSER:RB_DATAROWS";
Pos = MAP_APPFONT ( 6 , 52 ) ;
Size = MAP_APPFONT ( 236 , 10 ) ;
TabStop = TRUE ;
@@ -74,6 +78,7 @@ TabPage TP_RANGECHOOSER
};
RadioButton RB_DATACOLS
{
+ HelpID = "chart2:RadioButton:TP_RANGECHOOSER:RB_DATACOLS";
Pos = MAP_APPFONT ( 6 , 66 ) ;
Size = MAP_APPFONT ( 236 , 10 ) ;
TabStop = TRUE ;
@@ -81,12 +86,14 @@ TabPage TP_RANGECHOOSER
};
CheckBox CB_FIRST_ROW_ASLABELS
{
+ HelpID = "chart2:CheckBox:TP_RANGECHOOSER:CB_FIRST_ROW_ASLABELS";
Pos = MAP_APPFONT ( 6 , 84 ) ;
Size = MAP_APPFONT ( 236 , 10 ) ;
Text [ en-US ] = "~First row as label" ;
};
CheckBox CB_FIRST_COLUMN_ASLABELS
{
+ HelpID = "chart2:CheckBox:TP_RANGECHOOSER:CB_FIRST_COLUMN_ASLABELS";
Pos = MAP_APPFONT ( 6 , 98 ) ;
Size = MAP_APPFONT ( 236 , 10 ) ;
Text [ en-US ] = "F~irst column as label" ;
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx
index 195be46fedf6..df4a46a13ed6 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -29,9 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
#include "tp_Scale.hxx"
+#include "tp_Scale.hrc"
#include "ResId.hxx"
-#include "TabPages.hrc"
#include "Strings.hrc"
#include "chartview/ChartSfxItemIds.hxx"
#include "NoWarningThisInCTOR.hxx"
@@ -71,6 +71,20 @@ namespace chart
namespace
{
+void lcl_placeControlAtX( Control& rControl, long nNewXPos )
+{
+ Point aPos( rControl.GetPosPixel() );
+ aPos.X() = nNewXPos;
+ rControl.SetPosPixel(aPos);
+}
+
+void lcl_placeControlAtY( Control& rControl, long nNewYPos )
+{
+ Point aPos( rControl.GetPosPixel() );
+ aPos.Y() = nNewYPos;
+ rControl.SetPosPixel(aPos);
+}
+
void lcl_shiftControls( Control& rEdit, Control& rAuto, long nNewXPos )
{
Point aPos( rEdit.GetPosPixel() );
@@ -83,16 +97,15 @@ void lcl_shiftControls( Control& rEdit, Control& rAuto, long nNewXPos )
rAuto.SetPosPixel(aPos);
}
-void lcl_placeControlsAtY( Control& rTop, Control& rBottom, long nNewYPos )
+long lcl_getLabelDistance( Control& rControl )
{
- Point aPos( rTop.GetPosPixel() );
- long nShift = nNewYPos - aPos.Y();
- aPos.Y() = nNewYPos;
- rTop.SetPosPixel(aPos);
+ return rControl.LogicToPixel( Size(RSC_SP_CTRL_DESC_X, 0), MapMode(MAP_APPFONT) ).Width();
+}
- aPos = rBottom.GetPosPixel();
- aPos.Y() += nShift;
- rBottom.SetPosPixel(aPos);
+void lcl_setValue( FormattedField& rFmtField, double fValue )
+{
+ rFmtField.SetValue( fValue );
+ rFmtField.SetDefaultValue( fValue );
}
}
@@ -101,32 +114,51 @@ ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
SfxTabPage(pWindow, SchResId(TP_SCALE), rInAttrs),
aFlScale(this, SchResId(FL_SCALE)),
+
+ aCbxReverse(this, SchResId(CBX_REVERSE)),
+ aCbxLogarithm(this, SchResId(CBX_LOGARITHM)),
+
+ m_aTxt_AxisType(this, SchResId (TXT_AXIS_TYPE)),
+ m_aLB_AxisType(this, SchResId(LB_AXIS_TYPE)),
+
aTxtMin (this, SchResId (TXT_MIN)),
aFmtFldMin(this, SchResId(EDT_MIN)),
aCbxAutoMin(this, SchResId(CBX_AUTO_MIN)),
+
aTxtMax(this, SchResId (TXT_MAX)),
aFmtFldMax(this, SchResId(EDT_MAX)),
aCbxAutoMax(this, SchResId(CBX_AUTO_MAX)),
+
+ m_aTxt_TimeResolution(this, SchResId (TXT_TIME_RESOLUTION)),
+ m_aLB_TimeResolution(this, SchResId(LB_TIME_RESOLUTION)),
+ m_aCbx_AutoTimeResolution(this, SchResId(CBX_AUTO_TIME_RESOLUTION)),
+
aTxtMain (this, SchResId (TXT_STEP_MAIN)),
aFmtFldStepMain(this, SchResId(EDT_STEP_MAIN)),
+ m_aMt_MainDateStep(this, SchResId(MT_MAIN_DATE_STEP)),
+ m_aLB_MainTimeUnit(this, SchResId(LB_MAIN_TIME_UNIT)),
aCbxAutoStepMain(this, SchResId(CBX_AUTO_STEP_MAIN)),
+
+ aTxtHelpCount (this, SchResId (TXT_STEP_HELP_COUNT)),
aTxtHelp (this, SchResId (TXT_STEP_HELP)),
aMtStepHelp (this, SchResId (MT_STEPHELP)),
+ m_aLB_HelpTimeUnit(this, SchResId(LB_HELP_TIME_UNIT)),
aCbxAutoStepHelp(this, SchResId(CBX_AUTO_STEP_HELP)),
aTxtOrigin (this, SchResId (TXT_ORIGIN)),
aFmtFldOrigin(this, SchResId(EDT_ORIGIN)),
aCbxAutoOrigin(this, SchResId(CBX_AUTO_ORIGIN)),
- aCbxLogarithm(this, SchResId(CBX_LOGARITHM)),
- aCbxReverse(this, SchResId(CBX_REVERSE)),
-
fMin(0.0),
fMax(0.0),
fStepMain(0.0),
nStepHelp(0),
fOrigin(0.0),
- nAxisType(chart2::AxisType::REALNUMBER),
+ m_nTimeResolution(1),
+ m_nMainTimeUnit(1),
+ m_nHelpTimeUnit(1),
+ m_nAxisType(chart2::AxisType::REALNUMBER),
+ m_bAllowDateAxis(false),
pNumFormatter(NULL),
m_bShowAxisOrigin(false)
{
@@ -138,6 +170,26 @@ ScaleTabPage::ScaleTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
aCbxAutoStepMain.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
aCbxAutoStepHelp.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
aCbxAutoOrigin.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
+ m_aCbx_AutoTimeResolution.SetClickHdl(LINK(this, ScaleTabPage, EnableValueHdl));
+
+ m_aLB_AxisType.SetDropDownLineCount(3);
+ m_aLB_AxisType.SetSelectHdl(LINK(this, ScaleTabPage, SelectAxisTypeHdl));
+
+ m_aLB_TimeResolution.SetDropDownLineCount(3);
+ m_aLB_MainTimeUnit.SetDropDownLineCount(3);
+ m_aLB_HelpTimeUnit.SetDropDownLineCount(3);
+
+ aFmtFldMin.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+ aFmtFldMax.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+ aFmtFldStepMain.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+ aFmtFldOrigin.SetModifyHdl(LINK(this, ScaleTabPage, FmtFieldModifiedHdl));
+}
+
+IMPL_LINK( ScaleTabPage, FmtFieldModifiedHdl, FormattedField*, pFmtFied )
+{
+ if( pFmtFied )
+ pFmtFied->SetDefaultValue( pFmtFied->GetValue() );
+ return 0;
}
void ScaleTabPage::StateChanged( StateChangedType nType )
@@ -154,10 +206,13 @@ void ScaleTabPage::AdjustControlPositions()
long nLabelWidth = ::std::max( aTxtMin.CalcMinimumSize().Width(), aTxtMax.CalcMinimumSize().Width() );
nLabelWidth = ::std::max( aTxtMain.CalcMinimumSize().Width(), nLabelWidth );
nLabelWidth = ::std::max( aTxtHelp.CalcMinimumSize().Width(), nLabelWidth );
+ nLabelWidth = ::std::max( aTxtHelpCount.CalcMinimumSize().Width(), nLabelWidth );
nLabelWidth = ::std::max( aTxtOrigin.CalcMinimumSize().Width(), nLabelWidth );
+ nLabelWidth = ::std::max( m_aTxt_TimeResolution.CalcMinimumSize().Width(), nLabelWidth );
+ nLabelWidth = ::std::max( m_aTxt_AxisType.CalcMinimumSize().Width(), nLabelWidth );
nLabelWidth+=1;
- long nLabelDistance = aTxtMin.LogicToPixel( Size(RSC_SP_CTRL_DESC_X, 0), MapMode(MAP_APPFONT) ).Width();
+ long nLabelDistance = lcl_getLabelDistance(aTxtMin);
long nNewXPos = aTxtMin.GetPosPixel().X() + nLabelWidth + nLabelDistance;
//ensure that the auto checkboxes are wide enough and have correct size for calculation
@@ -166,9 +221,10 @@ void ScaleTabPage::AdjustControlPositions()
aCbxAutoStepMain.SetSizePixel( aCbxAutoStepMain.CalcMinimumSize() );
aCbxAutoStepHelp.SetSizePixel( aCbxAutoStepHelp.CalcMinimumSize() );
aCbxAutoOrigin.SetSizePixel( aCbxAutoOrigin.CalcMinimumSize() );
+ m_aCbx_AutoTimeResolution.SetSizePixel( m_aCbx_AutoTimeResolution.CalcMinimumSize() );
//ensure new pos is ok
- long nWidthOfOtherControls = aCbxAutoMin.GetPosPixel().X() + aCbxAutoMin.GetSizePixel().Width() - aFmtFldMin.GetPosPixel().X();
+ long nWidthOfOtherControls = m_aLB_MainTimeUnit.GetPosPixel().X() + m_aLB_MainTimeUnit.GetSizePixel().Width() - aFmtFldMin.GetPosPixel().X();
long nDialogWidth = GetSizePixel().Width();
long nLeftSpace = nDialogWidth - nNewXPos - nWidthOfOtherControls;
@@ -180,85 +236,201 @@ void ScaleTabPage::AdjustControlPositions()
aTxtMax.SetSizePixel(aSize);
aTxtMain.SetSizePixel(aSize);
aTxtHelp.SetSizePixel(aSize);
+ aTxtHelpCount.SetSizePixel(aSize);
aTxtOrigin.SetSizePixel(aSize);
+ m_aTxt_TimeResolution.SetSizePixel(aSize);
+ m_aTxt_AxisType.SetSizePixel(aSize);
+
+ long nOrgAutoCheckX = aCbxAutoMin.GetPosPixel().X();
+ lcl_placeControlAtX( aCbxAutoStepMain, nOrgAutoCheckX );
+ lcl_placeControlAtX( aCbxAutoStepHelp, nOrgAutoCheckX );
lcl_shiftControls( aFmtFldMin, aCbxAutoMin, nNewXPos );
lcl_shiftControls( aFmtFldMax, aCbxAutoMax, nNewXPos );
lcl_shiftControls( aFmtFldStepMain, aCbxAutoStepMain, nNewXPos );
+ lcl_placeControlAtX( m_aMt_MainDateStep, aFmtFldStepMain.GetPosPixel().X() );
lcl_shiftControls( aMtStepHelp, aCbxAutoStepHelp, nNewXPos );
lcl_shiftControls( aFmtFldOrigin, aCbxAutoOrigin, nNewXPos );
+ lcl_shiftControls( m_aLB_TimeResolution, m_aCbx_AutoTimeResolution, nNewXPos );
+ lcl_placeControlAtX( m_aLB_AxisType, nNewXPos );
+
+ nNewXPos = aCbxAutoStepMain.GetPosPixel().X() + aCbxAutoStepMain.GetSizePixel().Width() + nLabelDistance;
+ lcl_placeControlAtX( m_aLB_MainTimeUnit, nNewXPos );
+ lcl_placeControlAtX( m_aLB_HelpTimeUnit, nNewXPos );
}
+ PlaceIntervalControlsAccordingToAxisType();
}
-void ScaleTabPage::EnableControls()
+void ScaleTabPage::PlaceIntervalControlsAccordingToAxisType()
{
- bool bEnableForValueOrPercentAxis = chart2::AxisType::REALNUMBER == nAxisType || chart2::AxisType::PERCENT == nAxisType;
- aFlScale.Enable( bEnableForValueOrPercentAxis );
- aTxtMin.Enable( bEnableForValueOrPercentAxis );
- aFmtFldMin.Enable( bEnableForValueOrPercentAxis );
- aCbxAutoMin.Enable( bEnableForValueOrPercentAxis );
- aTxtMax.Enable( bEnableForValueOrPercentAxis );
- aFmtFldMax.Enable( bEnableForValueOrPercentAxis );
- aCbxAutoMax.Enable( bEnableForValueOrPercentAxis );
- aTxtMain.Enable( bEnableForValueOrPercentAxis );
- aFmtFldStepMain.Enable( bEnableForValueOrPercentAxis );
- aCbxAutoStepMain.Enable( bEnableForValueOrPercentAxis );
- aTxtHelp.Enable( bEnableForValueOrPercentAxis );
- aMtStepHelp.Enable( bEnableForValueOrPercentAxis );
- aCbxAutoStepHelp.Enable( bEnableForValueOrPercentAxis );
- aCbxLogarithm.Enable( bEnableForValueOrPercentAxis );
-
- aTxtOrigin.Show( m_bShowAxisOrigin && bEnableForValueOrPercentAxis );
- aFmtFldOrigin.Show( m_bShowAxisOrigin && bEnableForValueOrPercentAxis );
- aCbxAutoOrigin.Show( m_bShowAxisOrigin && bEnableForValueOrPercentAxis );
-
- long nNewYPos = aTxtOrigin.GetPosPixel().Y();
- if( m_bShowAxisOrigin )
- nNewYPos += ( aTxtOrigin.GetPosPixel().Y() - aTxtHelp.GetPosPixel().Y() );
- lcl_placeControlsAtY( aCbxLogarithm, aCbxReverse, nNewYPos );
+ long nMinX = std::min( aCbxAutoStepMain.GetPosPixel().X(), m_aLB_MainTimeUnit.GetPosPixel().X() );
+ long nLabelDistance = lcl_getLabelDistance(aTxtMin);
+ long nListWidth = m_aLB_MainTimeUnit.GetSizePixel().Width();
+
+ if( chart2::AxisType::DATE == m_nAxisType )
+ {
+ lcl_placeControlAtX( m_aLB_MainTimeUnit, nMinX );
+ lcl_placeControlAtX( m_aLB_HelpTimeUnit, nMinX );
+ long nSecondX = nMinX + nListWidth + nLabelDistance;
+ lcl_placeControlAtX( aCbxAutoStepMain, nSecondX );
+ lcl_placeControlAtX( aCbxAutoStepHelp, nSecondX );
+
+ long nOne = m_aMt_MainDateStep.LogicToPixel( Size(0, 1), MapMode(MAP_APPFONT) ).Height();
+
+ long nYMajor = m_aMt_MainDateStep.GetPosPixel().Y();
+ lcl_placeControlAtY( aCbxAutoStepMain , nYMajor+(3*nOne));
+ lcl_placeControlAtY( aTxtMain , nYMajor+nOne+nOne);
+
+ long nYMinor = m_aLB_HelpTimeUnit.GetPosPixel().Y();
+ lcl_placeControlAtY( aMtStepHelp , nYMinor );
+ lcl_placeControlAtY( aCbxAutoStepHelp , nYMinor+(3*nOne));
+ }
+ else
+ {
+ lcl_placeControlAtX( aCbxAutoStepMain, nMinX );
+ lcl_placeControlAtX( aCbxAutoStepHelp, nMinX );
+ long nSecondX = nMinX + aCbxAutoStepMain.GetSizePixel().Width() + nLabelDistance;
+ long nSecondXMax = GetSizePixel().Width() - nListWidth;
+ if( nSecondX > nSecondXMax )
+ nSecondX = nSecondXMax;
+ lcl_placeControlAtX( m_aLB_MainTimeUnit, nSecondX );
+ lcl_placeControlAtX( m_aLB_HelpTimeUnit, nSecondX );
+ }
}
+void ScaleTabPage::EnableControls()
+{
+ bool bValueAxis = chart2::AxisType::REALNUMBER == m_nAxisType || chart2::AxisType::PERCENT == m_nAxisType || chart2::AxisType::DATE == m_nAxisType;
+ bool bDateAxis = chart2::AxisType::DATE == m_nAxisType;
+
+ m_aTxt_AxisType.Show(m_bAllowDateAxis);
+ m_aLB_AxisType.Show(m_bAllowDateAxis);
+
+ aCbxLogarithm.Show( bValueAxis && !bDateAxis );
+ aTxtMin.Show( bValueAxis );
+ aFmtFldMin.Show( bValueAxis );
+ aCbxAutoMin.Show( bValueAxis );
+ aTxtMax.Show( bValueAxis );
+ aFmtFldMax.Show( bValueAxis );
+ aCbxAutoMax.Show( bValueAxis );
+ aTxtMain.Show( bValueAxis );
+ aFmtFldStepMain.Show( bValueAxis );
+ aCbxAutoStepMain.Show( bValueAxis );
+ aTxtHelp.Show( bValueAxis );
+ aTxtHelpCount.Show( bValueAxis );
+ aMtStepHelp.Show( bValueAxis );
+ aCbxAutoStepHelp.Show( bValueAxis );
+
+ aTxtOrigin.Show( m_bShowAxisOrigin && bValueAxis );
+ aFmtFldOrigin.Show( m_bShowAxisOrigin && bValueAxis );
+ aCbxAutoOrigin.Show( m_bShowAxisOrigin && bValueAxis );
+
+ aTxtHelpCount.Show( bValueAxis && !bDateAxis );
+ aTxtHelp.Show( bDateAxis );
+
+ m_aTxt_TimeResolution.Show( bDateAxis );
+ m_aLB_TimeResolution.Show( bDateAxis );
+ m_aCbx_AutoTimeResolution.Show( bDateAxis );
+
+ bool bWasDateAxis = m_aMt_MainDateStep.IsVisible();
+ if( bWasDateAxis != bDateAxis )
+ {
+ //transport value from one to other control
+ if( bWasDateAxis )
+ lcl_setValue( aFmtFldStepMain, m_aMt_MainDateStep.GetValue() );
+ else
+ m_aMt_MainDateStep.SetValue( static_cast<sal_Int32>(aFmtFldStepMain.GetValue()) );
+ }
+ aFmtFldStepMain.Show( bValueAxis && !bDateAxis );
+ m_aMt_MainDateStep.Show( bDateAxis );
+
+ m_aLB_MainTimeUnit.Show( bDateAxis );
+ m_aLB_HelpTimeUnit.Show( bDateAxis );
+ EnableValueHdl(&aCbxAutoMin);
+ EnableValueHdl(&aCbxAutoMax);
+ EnableValueHdl(&aCbxAutoStepMain);
+ EnableValueHdl(&aCbxAutoStepHelp);
+ EnableValueHdl(&aCbxAutoOrigin);
+ EnableValueHdl(&m_aCbx_AutoTimeResolution);
+}
IMPL_LINK( ScaleTabPage, EnableValueHdl, CheckBox *, pCbx )
{
+ bool bEnable = pCbx && !pCbx->IsChecked() && pCbx->IsEnabled();
if (pCbx == &aCbxAutoMin)
{
- aFmtFldMin.Enable(!aCbxAutoMin.IsChecked());
+ aFmtFldMin.Enable( bEnable );
}
else if (pCbx == &aCbxAutoMax)
{
- aFmtFldMax.Enable(!aCbxAutoMax.IsChecked());
+ aFmtFldMax.Enable( bEnable );
}
else if (pCbx == &aCbxAutoStepMain)
{
- aFmtFldStepMain.Enable(!aCbxAutoStepMain.IsChecked());
+ aFmtFldStepMain.Enable( bEnable );
+ m_aMt_MainDateStep.Enable( bEnable );
+ m_aLB_MainTimeUnit.Enable( bEnable );
}
else if (pCbx == &aCbxAutoStepHelp)
{
- aMtStepHelp.Show ();
- aMtStepHelp.Enable( ! aCbxAutoStepHelp.IsChecked() );
+ aMtStepHelp.Enable( bEnable );
+ m_aLB_HelpTimeUnit.Enable( bEnable );
+ }
+ else if (pCbx == &m_aCbx_AutoTimeResolution)
+ {
+ m_aLB_TimeResolution.Enable( bEnable );
}
else if (pCbx == &aCbxAutoOrigin)
{
- aFmtFldOrigin.Enable(!aCbxAutoOrigin.IsChecked());
+ aFmtFldOrigin.Enable( bEnable );
}
return 0;
}
+enum AxisTypeListBoxEntry
+{
+ TYPE_AUTO=0,
+ TYPE_TEXT=1,
+ TYPE_DATE=2
+};
+
+IMPL_LINK( ScaleTabPage, SelectAxisTypeHdl, void *, EMPTYARG )
+{
+ sal_uInt16 nPos = m_aLB_AxisType.GetSelectEntryPos();
+ if( nPos==TYPE_DATE )
+ m_nAxisType = chart2::AxisType::DATE;
+ else
+ m_nAxisType = chart2::AxisType::CATEGORY;
+ if( chart2::AxisType::DATE == m_nAxisType )
+ aCbxLogarithm.Check(false);
+ EnableControls();
+ PlaceIntervalControlsAccordingToAxisType();
+ SetNumFormat();
+ return 0;
+}
+
SfxTabPage* ScaleTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs)
{
return new ScaleTabPage(pWindow, rOutAttrs);
}
-BOOL ScaleTabPage::FillItemSet(SfxItemSet& rOutAttrs)
+sal_Bool ScaleTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{
DBG_ASSERT( pNumFormatter, "No NumberFormatter available" );
- rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MIN ,aCbxAutoMin.IsChecked()));
- rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MAX ,aCbxAutoMax.IsChecked()));
- rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP,aCbxAutoStepHelp.IsChecked()));
- rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN ,aCbxAutoOrigin.IsChecked()));
+ rOutAttrs.Put(SfxInt32Item(SCHATTR_AXISTYPE, m_nAxisType));
+ if(m_bAllowDateAxis)
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_DATEAXIS, TYPE_AUTO==m_aLB_AxisType.GetSelectEntryPos()));
+
+ bool bAutoScale = false;
+ if( m_nAxisType==chart2::AxisType::CATEGORY )
+ bAutoScale = true;//reset scaling for category charts
+
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MIN ,bAutoScale || aCbxAutoMin.IsChecked()));
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MAX ,bAutoScale || aCbxAutoMax.IsChecked()));
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP,bAutoScale || aCbxAutoStepHelp.IsChecked()));
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN ,bAutoScale || aCbxAutoOrigin.IsChecked()));
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_LOGARITHM ,aCbxLogarithm.IsChecked()));
rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_REVERSE ,aCbxReverse.IsChecked()));
rOutAttrs.Put(SvxDoubleItem(fMax , SCHATTR_AXIS_MAX));
@@ -266,10 +438,16 @@ BOOL ScaleTabPage::FillItemSet(SfxItemSet& rOutAttrs)
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_STEP_HELP, nStepHelp));
rOutAttrs.Put(SvxDoubleItem(fOrigin , SCHATTR_AXIS_ORIGIN));
- rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN,aCbxAutoStepMain.IsChecked()));
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN,bAutoScale || aCbxAutoStepMain.IsChecked()));
rOutAttrs.Put(SvxDoubleItem(fStepMain,SCHATTR_AXIS_STEP_MAIN));
- return TRUE;
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_TIME_RESOLUTION,bAutoScale || m_aCbx_AutoTimeResolution.IsChecked()));
+ rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_TIME_RESOLUTION,m_nTimeResolution));
+
+ rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_MAIN_TIME_UNIT,m_nMainTimeUnit));
+ rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_HELP_TIME_UNIT,m_nHelpTimeUnit));
+
+ return sal_True;
}
void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
@@ -279,63 +457,110 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs)
return;
const SfxPoolItem *pPoolItem = NULL;
- nAxisType=chart2::AxisType::REALNUMBER;
- if (rInAttrs.GetItemState(SCHATTR_AXISTYPE, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_ALLOW_DATEAXIS, sal_True, &pPoolItem) == SFX_ITEM_SET)
+ m_bAllowDateAxis = (bool) ((const SfxBoolItem*)pPoolItem)->GetValue();
+ m_nAxisType=chart2::AxisType::REALNUMBER;
+ if (rInAttrs.GetItemState(SCHATTR_AXISTYPE, sal_True, &pPoolItem) == SFX_ITEM_SET)
+ m_nAxisType = (int) ((const SfxInt32Item*)pPoolItem)->GetValue();
+ if( m_nAxisType==chart2::AxisType::DATE && !m_bAllowDateAxis )
+ m_nAxisType=chart2::AxisType::CATEGORY;
+ if( m_bAllowDateAxis )
{
- nAxisType = (int) ((const SfxInt32Item*)pPoolItem)->GetValue();
- EnableControls();
+ bool bAutoDateAxis = false;
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_DATEAXIS, sal_True, &pPoolItem) == SFX_ITEM_SET)
+ bAutoDateAxis = (bool) ((const SfxBoolItem*)pPoolItem)->GetValue();
+
+ sal_uInt16 nPos = 0;
+ if( m_nAxisType==chart2::AxisType::DATE )
+ nPos=TYPE_DATE;
+ else if( bAutoDateAxis )
+ nPos=TYPE_AUTO;
+ else
+ nPos=TYPE_TEXT;
+ m_aLB_AxisType.SelectEntryPos( nPos );
}
- if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MIN,TRUE,&pPoolItem) == SFX_ITEM_SET)
+ if( m_bAllowDateAxis )
+ aCbxReverse.SetHelpId("chart2:CheckBox:TP_SCALE:CBX_REVERSE:MayBeDateAxis");
+ else if( m_nAxisType==chart2::AxisType::CATEGORY || m_nAxisType==chart2::AxisType::SERIES )
+ aCbxReverse.SetHelpId("chart2:CheckBox:TP_SCALE:CBX_REVERSE:Category");
+
+ PlaceIntervalControlsAccordingToAxisType();
+
+ aCbxAutoMin.Check( true );
+ aCbxAutoMax.Check( true );
+ aCbxAutoStepMain.Check( true );
+ aCbxAutoStepHelp.Check( true );
+ aCbxAutoOrigin.Check( true );
+ m_aCbx_AutoTimeResolution.Check( true );
+
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MIN,sal_True,&pPoolItem) == SFX_ITEM_SET)
aCbxAutoMin.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
- if (rInAttrs.GetItemState(SCHATTR_AXIS_MIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_MIN,sal_True, &pPoolItem) == SFX_ITEM_SET)
{
fMin = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldMin.SetValue( fMin );
+ lcl_setValue( aFmtFldMin, fMin );
}
- if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MAX,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MAX,sal_True, &pPoolItem) == SFX_ITEM_SET)
aCbxAutoMax.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
- if (rInAttrs.GetItemState(SCHATTR_AXIS_MAX,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_MAX,sal_True, &pPoolItem) == SFX_ITEM_SET)
{
fMax = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldMax.SetValue( fMax );
+ lcl_setValue( aFmtFldMax, fMax );
}
- if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_MAIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_MAIN,sal_True, &pPoolItem) == SFX_ITEM_SET)
aCbxAutoStepMain.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
- if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_MAIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_MAIN,sal_True, &pPoolItem) == SFX_ITEM_SET)
{
fStepMain = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldStepMain.SetValue( fStepMain );
+ lcl_setValue( aFmtFldStepMain, fStepMain );
+ m_aMt_MainDateStep.SetValue( static_cast<sal_Int32>(fStepMain) );
}
- if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_HELP,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_HELP,sal_True, &pPoolItem) == SFX_ITEM_SET)
aCbxAutoStepHelp.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
- if (rInAttrs.GetItemState(SCHATTR_AXIS_LOGARITHM,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_LOGARITHM,sal_True, &pPoolItem) == SFX_ITEM_SET)
aCbxLogarithm.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
- if (rInAttrs.GetItemState(SCHATTR_AXIS_REVERSE,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_REVERSE,sal_True, &pPoolItem) == SFX_ITEM_SET)
aCbxReverse.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
- if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_HELP,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_HELP,sal_True, &pPoolItem) == SFX_ITEM_SET)
{
nStepHelp = ((const SfxInt32Item*)pPoolItem)->GetValue();
aMtStepHelp.SetValue( nStepHelp );
}
- if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_ORIGIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_ORIGIN,sal_True, &pPoolItem) == SFX_ITEM_SET)
aCbxAutoOrigin.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
- if (rInAttrs.GetItemState(SCHATTR_AXIS_ORIGIN,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_ORIGIN,sal_True, &pPoolItem) == SFX_ITEM_SET)
{
fOrigin = ((const SvxDoubleItem*)pPoolItem)->GetValue();
- aFmtFldOrigin.SetValue( fOrigin );
+ lcl_setValue( aFmtFldOrigin, fOrigin );
}
- EnableValueHdl(&aCbxAutoMin);
- EnableValueHdl(&aCbxAutoMax);
- EnableValueHdl(&aCbxAutoStepMain);
- EnableValueHdl(&aCbxAutoStepHelp);
- EnableValueHdl(&aCbxAutoOrigin);
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_TIME_RESOLUTION,sal_True, &pPoolItem) == SFX_ITEM_SET)
+ m_aCbx_AutoTimeResolution.Check(((const SfxBoolItem*)pPoolItem)->GetValue());
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_TIME_RESOLUTION,sal_True, &pPoolItem) == SFX_ITEM_SET)
+ {
+ m_nTimeResolution = ((const SfxInt32Item*)pPoolItem)->GetValue();
+ m_aLB_TimeResolution.SelectEntryPos( m_nTimeResolution );
+ }
+
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_MAIN_TIME_UNIT,sal_True, &pPoolItem) == SFX_ITEM_SET)
+ {
+ m_nMainTimeUnit = ((const SfxInt32Item*)pPoolItem)->GetValue();
+ m_aLB_MainTimeUnit.SelectEntryPos( m_nMainTimeUnit );
+ }
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_HELP_TIME_UNIT,sal_True, &pPoolItem) == SFX_ITEM_SET)
+ {
+ m_nHelpTimeUnit = ((const SfxInt32Item*)pPoolItem)->GetValue();
+ m_aLB_HelpTimeUnit.SelectEntryPos( m_nHelpTimeUnit );
+ }
+
+ EnableControls();
+ SetNumFormat();
}
int ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet)
@@ -346,84 +571,116 @@ int ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet)
return LEAVE_PAGE;
}
+ bool bDateAxis = chart2::AxisType::DATE == m_nAxisType;
+
sal_uInt32 nIndex = pNumFormatter->GetStandardIndex(LANGUAGE_SYSTEM);
const SfxPoolItem *pPoolItem = NULL;
- if( GetItemSet().GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, TRUE, &pPoolItem ) == SFX_ITEM_SET )
+ if( GetItemSet().GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, sal_True, &pPoolItem ) == SFX_ITEM_SET )
nIndex = static_cast< sal_uInt32 >( static_cast< const SfxInt32Item* >(pPoolItem)->GetValue());
else
{
OSL_ENSURE( false, "Using Standard Language" );
}
- Edit* pEdit = NULL;
- USHORT nErrStrId = 0;
+ Control* pControl = NULL;
+ sal_uInt16 nErrStrId = 0;
double fDummy;
fMax = aFmtFldMax.GetValue();
fMin = aFmtFldMin.GetValue();
fOrigin = aFmtFldOrigin.GetValue();
- fStepMain = aFmtFldStepMain.GetValue();
+ fStepMain = bDateAxis ? m_aMt_MainDateStep.GetValue() : aFmtFldStepMain.GetValue();
nStepHelp = static_cast< sal_Int32 >( aMtStepHelp.GetValue());
+ m_nTimeResolution = m_aLB_TimeResolution.GetSelectEntryPos();
+ m_nMainTimeUnit = m_aLB_MainTimeUnit.GetSelectEntryPos();
+ m_nHelpTimeUnit = m_aLB_HelpTimeUnit.GetSelectEntryPos();
+
+ if( chart2::AxisType::REALNUMBER != m_nAxisType )
+ aCbxLogarithm.Show( false );
+
+ //check wich entries need user action
- //do some reasonable automatic correction of user input if necessary
- if (!aCbxAutoMax.IsChecked() && !aCbxAutoMin.IsChecked() &&
- fMin >= fMax)
- {
- pEdit = &aFmtFldMin;
- nErrStrId = STR_MIN_GREATER_MAX;
- }
- // check for entries in invalid ranges
if ( aCbxLogarithm.IsChecked() &&
( ( !aCbxAutoMin.IsChecked() && fMin <= 0.0 )
|| ( !aCbxAutoMax.IsChecked() && fMax <= 0.0 ) ) )
{
- pEdit = &aFmtFldMin;
+ pControl = &aFmtFldMin;
nErrStrId = STR_BAD_LOGARITHM;
}
- if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0)
+ else if (!aCbxAutoMax.IsChecked() && !aCbxAutoMin.IsChecked() &&
+ fMin >= fMax)
+ {
+ pControl = &aFmtFldMin;
+ nErrStrId = STR_MIN_GREATER_MAX;
+ }
+ else if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0)
{
- pEdit = &aFmtFldStepMain;
+ pControl = &aFmtFldStepMain;
nErrStrId = STR_STEP_GT_ZERO;
}
-
- //check wich entries need user action
-
// check for entries that cannot be parsed for the current number format
- if ( aFmtFldMin.IsModified()
+ else if ( aFmtFldMin.IsModified()
&& !aCbxAutoMin.IsChecked()
&& !pNumFormatter->IsNumberFormat(aFmtFldMin.GetText(), nIndex, fDummy))
{
- pEdit = &aFmtFldMin;
+ pControl = &aFmtFldMin;
nErrStrId = STR_INVALID_NUMBER;
}
else if (aFmtFldMax.IsModified() && !aCbxAutoMax.IsChecked() &&
!pNumFormatter->IsNumberFormat(aFmtFldMax.GetText(),
nIndex, fDummy))
{
- pEdit = &aFmtFldMax;
+ pControl = &aFmtFldMax;
nErrStrId = STR_INVALID_NUMBER;
}
- else if (aFmtFldStepMain.IsModified() && !aCbxAutoStepMain.IsChecked() &&
+ else if ( !bDateAxis && aFmtFldStepMain.IsModified() && !aCbxAutoStepMain.IsChecked() &&
!pNumFormatter->IsNumberFormat(aFmtFldStepMain.GetText(),
nIndex, fDummy))
{
- pEdit = &aFmtFldStepMain;
+ pControl = &aFmtFldStepMain;
nErrStrId = STR_STEP_GT_ZERO;
}
else if (aFmtFldOrigin.IsModified() && !aCbxAutoOrigin.IsChecked() &&
!pNumFormatter->IsNumberFormat(aFmtFldOrigin.GetText(),
nIndex, fDummy))
{
- pEdit = &aFmtFldOrigin;
+ pControl = &aFmtFldOrigin;
nErrStrId = STR_INVALID_NUMBER;
}
else if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0.0)
{
- pEdit = &aFmtFldStepMain;
+ pControl = &aFmtFldStepMain;
nErrStrId = STR_STEP_GT_ZERO;
}
+ else if( bDateAxis )
+ {
+ if( !aCbxAutoStepMain.IsChecked() && !aCbxAutoStepHelp.IsChecked() )
+ {
+ if( m_nHelpTimeUnit > m_nMainTimeUnit )
+ {
+ pControl = &m_aLB_MainTimeUnit;
+ nErrStrId = STR_INVALID_INTERVALS;
+ }
+ else if( m_nHelpTimeUnit == m_nMainTimeUnit && nStepHelp > fStepMain )
+ {
+ pControl = &m_aLB_MainTimeUnit;
+ nErrStrId = STR_INVALID_INTERVALS;
+ }
+ }
+ if( !nErrStrId && !m_aCbx_AutoTimeResolution.IsChecked() )
+ {
+ if( (!aCbxAutoStepMain.IsChecked() && m_nTimeResolution > m_nMainTimeUnit )
+ ||
+ (!aCbxAutoStepHelp.IsChecked() && m_nTimeResolution > m_nHelpTimeUnit )
+ )
+ {
+ pControl = &m_aLB_TimeResolution;
+ nErrStrId = STR_INVALID_TIME_UNIT;
+ }
+ }
+ }
- if( ShowWarning( nErrStrId, pEdit ) )
+ if( ShowWarning( nErrStrId, pControl ) )
return KEEP_PAGE;
if( pItemSet )
@@ -456,9 +713,9 @@ void ScaleTabPage::SetNumFormat()
{
const SfxPoolItem *pPoolItem = NULL;
- if( GetItemSet().GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, TRUE, &pPoolItem ) == SFX_ITEM_SET )
+ if( GetItemSet().GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, sal_True, &pPoolItem ) == SFX_ITEM_SET )
{
- ULONG nFmt = (ULONG)((const SfxInt32Item*)pPoolItem)->GetValue();
+ sal_uLong nFmt = (sal_uLong)((const SfxInt32Item*)pPoolItem)->GetValue();
aFmtFldMax.SetFormatKey( nFmt );
aFmtFldMin.SetFormatKey( nFmt );
@@ -485,6 +742,19 @@ void ScaleTabPage::SetNumFormat()
else
nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_TIME );
}
+
+ if( chart2::AxisType::DATE == m_nAxisType && ( eType != NUMBERFORMAT_DATE && eType != NUMBERFORMAT_DATETIME) )
+ {
+ const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
+ if( pFormat )
+ nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_DATE, pFormat->GetLanguage() );
+ else
+ nFmt = pNumFormatter->GetStandardFormat( NUMBERFORMAT_DATE );
+
+ aFmtFldMax.SetFormatKey( nFmt );
+ aFmtFldMin.SetFormatKey( nFmt );
+ aFmtFldOrigin.SetFormatKey( nFmt );
+ }
}
aFmtFldStepMain.SetFormatKey( nFmt );
@@ -498,7 +768,7 @@ void ScaleTabPage::ShowAxisOrigin( bool bShowOrigin )
m_bShowAxisOrigin = true;
}
-bool ScaleTabPage::ShowWarning( USHORT nResIdMessage, Edit * pControl /* = NULL */ )
+bool ScaleTabPage::ShowWarning( sal_uInt16 nResIdMessage, Control* pControl /* = NULL */ )
{
if( nResIdMessage == 0 )
return false;
@@ -507,7 +777,9 @@ bool ScaleTabPage::ShowWarning( USHORT nResIdMessage, Edit * pControl /* = NULL
if( pControl )
{
pControl->GrabFocus();
- pControl->SetSelection( Selection( 0, SELECTION_MAX ));
+ Edit* pEdit = dynamic_cast<Edit*>(pControl);
+ if(pEdit)
+ pEdit->SetSelection( Selection( 0, SELECTION_MAX ));
}
return true;
}
diff --git a/chart2/source/controller/dialogs/tp_Scale.hrc b/chart2/source/controller/dialogs/tp_Scale.hrc
new file mode 100644
index 000000000000..bde6c21c7924
--- /dev/null
+++ b/chart2/source/controller/dialogs/tp_Scale.hrc
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "ResourceIds.hrc"
+
+#define FL_SCALE 1
+
+#define TXT_MIN 1
+#define TXT_MAX 2
+#define TXT_STEP_MAIN 3
+#define TXT_STEP_HELP_COUNT 4
+#define TXT_ORIGIN 5
+#define TXT_TIME_RESOLUTION 6
+#define TXT_AXIS_TYPE 7
+#define TXT_STEP_HELP 8
+
+#define CBX_AUTO_MIN 1
+#define CBX_AUTO_MAX 2
+#define CBX_AUTO_STEP_MAIN 3
+#define CBX_AUTO_STEP_HELP 4
+#define CBX_AUTO_ORIGIN 5
+#define CBX_LOGARITHM 6
+#define CBX_REVERSE 7
+#define CBX_AUTO_TIME_RESOLUTION 8
+
+#define EDT_STEP_MAIN 1
+#define EDT_MAX 2
+#define EDT_MIN 3
+#define EDT_ORIGIN 4
+
+#define MT_STEPHELP 10
+#define MT_MAIN_DATE_STEP 11
+
+#define LB_AXIS_TYPE 1
+#define LB_MAIN_TIME_UNIT 2
+#define LB_HELP_TIME_UNIT 3
+#define LB_TIME_RESOLUTION 4
+
+#define STR_LIST_TIME_UNIT 1
diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx
index 47745657dd53..f062ed438383 100644
--- a/chart2/source/controller/dialogs/tp_Scale.hxx
+++ b/chart2/source/controller/dialogs/tp_Scale.hxx
@@ -38,6 +38,8 @@
#include <vcl/button.hxx>
// header for MetricField
#include <vcl/field.hxx>
+// header for class ListBox
+#include <vcl/lstbox.hxx>
//.............................................................................
namespace chart
@@ -50,7 +52,7 @@ public:
ScaleTabPage( Window* pParent, const SfxItemSet& rInAttrs );
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs );
- virtual BOOL FillItemSet( SfxItemSet& rOutAttrs );
+ virtual sal_Bool FillItemSet( SfxItemSet& rOutAttrs );
virtual void Reset( const SfxItemSet& rInAttrs );
using TabPage::DeactivatePage;
virtual int DeactivatePage( SfxItemSet* pItemSet = NULL );
@@ -65,6 +67,13 @@ public:
private:
FixedLine aFlScale;
+ CheckBox aCbxReverse;
+
+ CheckBox aCbxLogarithm;
+
+ FixedText m_aTxt_AxisType;
+ ListBox m_aLB_AxisType;
+
FixedText aTxtMin;
FormattedField aFmtFldMin;
CheckBox aCbxAutoMin;
@@ -73,35 +82,47 @@ private:
FormattedField aFmtFldMax;
CheckBox aCbxAutoMax;
+ FixedText m_aTxt_TimeResolution;
+ ListBox m_aLB_TimeResolution;
+ CheckBox m_aCbx_AutoTimeResolution;
+
FixedText aTxtMain;
FormattedField aFmtFldStepMain;
+ MetricField m_aMt_MainDateStep;
+ ListBox m_aLB_MainTimeUnit;
CheckBox aCbxAutoStepMain;
+ FixedText aTxtHelpCount;
FixedText aTxtHelp;
MetricField aMtStepHelp;
+ ListBox m_aLB_HelpTimeUnit;
CheckBox aCbxAutoStepHelp;
FixedText aTxtOrigin;
FormattedField aFmtFldOrigin;
CheckBox aCbxAutoOrigin;
- CheckBox aCbxLogarithm;
- CheckBox aCbxReverse;
-
double fMin;
double fMax;
double fStepMain;
sal_Int32 nStepHelp;
double fOrigin;
- int nAxisType;
+ sal_Int32 m_nTimeResolution;
+ sal_Int32 m_nMainTimeUnit;
+ sal_Int32 m_nHelpTimeUnit;
+ int m_nAxisType;
+ bool m_bAllowDateAxis;
SvNumberFormatter* pNumFormatter;
bool m_bShowAxisOrigin;
void AdjustControlPositions();
void EnableControls();
+ void PlaceIntervalControlsAccordingToAxisType();
+ DECL_LINK( SelectAxisTypeHdl, void* );
DECL_LINK( EnableValueHdl, CheckBox* );
+ DECL_LINK( FmtFieldModifiedHdl, FormattedField* );
/** shows a warning window due to an invalid input.
@@ -116,7 +137,7 @@ private:
@return false, if nResIdMessage was 0, true otherwise
*/
- bool ShowWarning( USHORT nResIdMessage, Edit * pControl = NULL );
+ bool ShowWarning( sal_uInt16 nResIdMessage, Control* pControl = NULL );
};
//.............................................................................
diff --git a/chart2/source/controller/dialogs/tp_Scale.src b/chart2/source/controller/dialogs/tp_Scale.src
index e0705fc32083..eb27b586f24b 100644..100755
--- a/chart2/source/controller/dialogs/tp_Scale.src
+++ b/chart2/source/controller/dialogs/tp_Scale.src
@@ -25,7 +25,7 @@
*
************************************************************************/
#include "HelpIds.hrc"
-#include "TabPages.hrc"
+#include "tp_Scale.hrc"
#define YLine1 3
#define Y1 (YLine1+13)
@@ -33,19 +33,30 @@
#define Y3 (Y2+16)
#define Y4 (Y3+16)
#define Y5 (Y4+16)
-#define Y6 (Y5+17)
-#define Y7 (Y6+15)
+#define Y6 (Y5+16)
+#define Y7 (Y6+16)
+#define Y8 (Y7+16)
#define LABELWIDTH 88
-#define AUTOCHECKWIDTH 88
+#define AUTOCHECKWIDTH 41
#define EDITWIDTH 50
#define X1 6
#define X2 11
#define X3 (X2+LABELWIDTH+4)
#define X4 (X3+EDITWIDTH+5)
+#define X5 (X4+AUTOCHECKWIDTH+5)
+
+#define STR_LIST_TIME_UNIT \
+ StringList [ en-US ] = \
+ { \
+ "Days" ; \
+ "Months" ; \
+ "Years" ; \
+ };
TabPage TP_SCALE
{
+ HelpID = "chart2:TabPage:TP_SCALE";
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 185 ) ;
@@ -57,25 +68,71 @@ TabPage TP_SCALE
Text [ en-US ] = "Scale" ;
};
- FixedText TXT_MIN
+ CheckBox CBX_REVERSE
{
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_REVERSE:ValueAxis";
Pos = MAP_APPFONT ( X2 , Y1 ) ;
+ Size = MAP_APPFONT ( 244 , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "~Reverse direction" ;
+ };
+ //---------------------------
+ CheckBox CBX_LOGARITHM
+ {
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_LOGARITHM";
+ Pos = MAP_APPFONT ( X2 , Y2 ) ;
+ Size = MAP_APPFONT ( 244 , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "~Logarithmic scale" ;
+ };
+ //---------------------------
+ FixedText TXT_AXIS_TYPE
+ {
+ Pos = MAP_APPFONT ( X2 , Y2 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
- Text [ en-US ] = "~Minimum:" ;
+ Text [ en-US ] = "T~ype" ;
+ };
+ ListBox LB_AXIS_TYPE
+ {
+ HelpID = "chart2:ListBox:TP_SCALE:LB_AXIS_TYPE";
+ Border = TRUE ;
+ AutoHScroll = TRUE ;
+ Pos = MAP_APPFONT ( X3 , Y2-2 ) ;
+ Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ DropDown=TRUE;
+ DDExtraWidth = TRUE ;
+
+ StringList [ en-US ] =
+ {
+ "Automatic" ;
+ "Text" ;
+ "Date" ;
+ };
+ };
+ //---------------------------
+ FixedText TXT_MIN
+ {
+ Pos = MAP_APPFONT ( X2 , Y3 ) ;
+ Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
+ Text [ en-US ] = "~Minimum" ;
};
SpinField EDT_MIN
{
+ HelpID = "chart2:SpinField:TP_SCALE:EDT_MIN";
Border = TRUE ;
SVLook = TRUE ;
- Pos = MAP_APPFONT ( X3 , Y1-2 ) ;
+ Pos = MAP_APPFONT ( X3 , Y3-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
CheckBox CBX_AUTO_MIN
{
- Pos = MAP_APPFONT ( X4 , Y1-1 ) ;
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_MIN";
+ Pos = MAP_APPFONT ( X4 , Y3+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Automatic" ;
@@ -83,62 +140,134 @@ TabPage TP_SCALE
FixedText TXT_MAX
{
- Pos = MAP_APPFONT ( X2 , Y2 ) ;
+ Pos = MAP_APPFONT ( X2 , Y4 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
- Text [ en-US ] = "Ma~ximum:" ;
+ Text [ en-US ] = "Ma~ximum" ;
};
SpinField EDT_MAX
{
+ HelpID = "chart2:SpinField:TP_SCALE:EDT_MAX";
Border = TRUE ;
SVLook = TRUE ;
- Pos = MAP_APPFONT ( X3 , Y2-2 ) ;
+ Pos = MAP_APPFONT ( X3 , Y4-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
CheckBox CBX_AUTO_MAX
{
- Pos = MAP_APPFONT ( X4 , Y2-1 ) ;
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_MAX";
+ Pos = MAP_APPFONT ( X4 , Y4+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "A~utomatic" ;
};
+ //---------------------------
+ FixedText TXT_TIME_RESOLUTION
+ {
+ Pos = MAP_APPFONT ( X2 , Y5 ) ;
+ Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
+ Text [ en-US ] = "R~esolution" ;
+ };
+ ListBox LB_TIME_RESOLUTION
+ {
+ HelpID = "chart2:ListBox:TP_SCALE:LB_TIME_RESOLUTION";
+ Border = TRUE ;
+ AutoHScroll = TRUE ;
+ Pos = MAP_APPFONT ( X3 , Y5-2 ) ;
+ Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ DropDown=TRUE;
+ DDExtraWidth = TRUE ;
+ STR_LIST_TIME_UNIT
+ };
+ CheckBox CBX_AUTO_TIME_RESOLUTION
+ {
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_TIME_RESOLUTION";
+ Pos = MAP_APPFONT ( X4 , Y5+1 ) ;
+ Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Automat~ic" ;
+ };
+ //---------------------------
FixedText TXT_STEP_MAIN
{
- Pos = MAP_APPFONT ( X2 , Y3 ) ;
+ Pos = MAP_APPFONT ( X2 , Y5 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
- Text [ en-US ] = "Ma~jor interval:" ;
+ Text [ en-US ] = "Ma~jor interval" ;
};
SpinField EDT_STEP_MAIN
{
+ HelpID = "chart2:SpinField:TP_SCALE:EDT_STEP_MAIN";
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( X3 , Y5-2 ) ;
+ Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
+ TabStop = TRUE ;
+ };
+ MetricField MT_MAIN_DATE_STEP
+ {
+ HelpID = "chart2:MetricField:TP_SCALE:MT_MAIN_DATE_STEP";
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( X3 , Y6-2 ) ;
+ Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 1 ;
+ Maximum = 100000 ;
+ StrictFormat = TRUE ;
+ Unit = FUNIT_CUSTOM ;
+ First = 1 ;
+ Last = 100000 ;
+ SpinSize = 1 ;
+ };
+
+ ListBox LB_MAIN_TIME_UNIT
+ {
+ HelpID = "chart2:ListBox:TP_SCALE:LB_MAIN_TIME_UNIT";
Border = TRUE ;
- Pos = MAP_APPFONT ( X3 , Y3-2 ) ;
+ AutoHScroll = TRUE ;
+ Pos = MAP_APPFONT ( X5 , Y6-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
+ Group = TRUE ;
+ DropDown=TRUE;
+ DDExtraWidth = TRUE ;
+
+ STR_LIST_TIME_UNIT
};
CheckBox CBX_AUTO_STEP_MAIN
{
- Pos = MAP_APPFONT ( X4 , Y3-1 ) ;
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_STEP_MAIN";
+ Pos = MAP_APPFONT ( X4 , Y5+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Au~tomatic" ;
};
-
+ //---------------------------
+ FixedText TXT_STEP_HELP_COUNT
+ {
+ Pos = MAP_APPFONT ( X2 , Y6 ) ;
+ Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
+ Text [ en-US ] = "Minor inter~val count" ;
+ };
FixedText TXT_STEP_HELP
{
- Pos = MAP_APPFONT ( X2 , Y4 ) ;
+ Pos = MAP_APPFONT ( X2 , Y7 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
- Text [ en-US ] = "Minor interval ~count:" ;
+ Text [ en-US ] = "Minor inter~val" ;
};
MetricField MT_STEPHELP
{
+ HelpID = "chart2:MetricField:TP_SCALE:MT_STEPHELP";
Border = TRUE ;
- Pos = MAP_APPFONT ( X3 , Y4-2 ) ;
+ Pos = MAP_APPFONT ( X3 , Y6-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
Repeat = TRUE ;
@@ -151,10 +280,24 @@ TabPage TP_SCALE
Last = 100 ;
SpinSize = 1 ;
};
+ ListBox LB_HELP_TIME_UNIT
+ {
+ HelpID = "chart2:ListBox:TP_SCALE:LB_HELP_TIME_UNIT";
+ Border = TRUE ;
+ AutoHScroll = TRUE ;
+ Pos = MAP_APPFONT ( X5 , Y7-2 ) ;
+ Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ DropDown=TRUE;
+ DDExtraWidth = TRUE ;
+ STR_LIST_TIME_UNIT
+ };
CheckBox CBX_AUTO_STEP_HELP
{
- Pos = MAP_APPFONT ( X4 , Y4-1 ) ;
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_STEP_HELP";
+ Pos = MAP_APPFONT ( X4 , Y6+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Aut~omatic" ;
@@ -162,40 +305,27 @@ TabPage TP_SCALE
FixedText TXT_ORIGIN
{
- Pos = MAP_APPFONT ( X2 , Y5 ) ;
+ Pos = MAP_APPFONT ( X2 , Y7 ) ;
Size = MAP_APPFONT ( LABELWIDTH , 8 ) ;
- Text [ en-US ] = "Reference ~value:" ;
+ Text [ en-US ] = "Re~ference value" ;
};
SpinField EDT_ORIGIN
{
+ HelpID = "chart2:SpinField:TP_SCALE:EDT_ORIGIN";
Border = TRUE ;
SVLook = TRUE ;
- Pos = MAP_APPFONT ( X3 , Y5-2 ) ;
+ Pos = MAP_APPFONT ( X3 , Y7-2 ) ;
Size = MAP_APPFONT ( EDITWIDTH , 12 ) ;
TabStop = TRUE ;
};
CheckBox CBX_AUTO_ORIGIN
{
- Pos = MAP_APPFONT ( X4 , Y5-1 ) ;
+ HelpID = "chart2:CheckBox:TP_SCALE:CBX_AUTO_ORIGIN";
+ Pos = MAP_APPFONT ( X4 , Y7+1 ) ;
Size = MAP_APPFONT ( AUTOCHECKWIDTH , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Automat~ic" ;
};
-
- CheckBox CBX_LOGARITHM
- {
- Pos = MAP_APPFONT ( X2 , Y6 ) ;
- Size = MAP_APPFONT ( 244 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Logarithmic scale" ;
- };
-
- CheckBox CBX_REVERSE
- {
- Pos = MAP_APPFONT ( X2 , Y7 ) ;
- Size = MAP_APPFONT ( 244 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Reverse direction" ;
- };
+ //---------------------------
};
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
index b99675652084..c3f00f1c2ace 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
@@ -97,7 +97,7 @@ SfxTabPage* SchOptionTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs
return new SchOptionTabPage(pWindow, rOutAttrs);
}
-BOOL SchOptionTabPage::FillItemSet(SfxItemSet& rOutAttrs)
+sal_Bool SchOptionTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{
if(aRbtAxis2.IsChecked())
rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS,CHART_AXIS_SECONDARY_Y));
@@ -128,113 +128,113 @@ BOOL SchOptionTabPage::FillItemSet(SfxItemSet& rOutAttrs)
if (m_aCBIncludeHiddenCells.IsVisible())
rOutAttrs.Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_aCBIncludeHiddenCells.IsChecked()));
- return TRUE;
+ return sal_True;
}
void SchOptionTabPage::Reset(const SfxItemSet& rInAttrs)
{
const SfxPoolItem *pPoolItem = NULL;
- aRbtAxis1.Check(TRUE);
- aRbtAxis2.Check(FALSE);
- if (rInAttrs.GetItemState(SCHATTR_AXIS,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ aRbtAxis1.Check(sal_True);
+ aRbtAxis2.Check(sal_False);
+ if (rInAttrs.GetItemState(SCHATTR_AXIS,sal_True, &pPoolItem) == SFX_ITEM_SET)
{
long nVal=((const SfxInt32Item*)pPoolItem)->GetValue();
if(nVal==CHART_AXIS_SECONDARY_Y)
{
- aRbtAxis2.Check(TRUE);
- aRbtAxis1.Check(FALSE);
+ aRbtAxis2.Check(sal_True);
+ aRbtAxis1.Check(sal_False);
}
}
long nTmp;
- if (rInAttrs.GetItemState(SCHATTR_BAR_GAPWIDTH, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_BAR_GAPWIDTH, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue();
aMTGap.SetValue(nTmp);
}
- if (rInAttrs.GetItemState(SCHATTR_BAR_OVERLAP, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_BAR_OVERLAP, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue();
aMTOverlap.SetValue(nTmp);
}
- if (rInAttrs.GetItemState(SCHATTR_BAR_CONNECT, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_BAR_CONNECT, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
- BOOL bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
+ sal_Bool bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
aCBConnect.Check(bCheck);
}
- if (rInAttrs.GetItemState(SCHATTR_AXIS_FOR_ALL_SERIES, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_AXIS_FOR_ALL_SERIES, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
m_nAllSeriesAxisIndex = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
aCBAxisSideBySide.Disable();
}
- if (rInAttrs.GetItemState(SCHATTR_GROUP_BARS_PER_AXIS, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_GROUP_BARS_PER_AXIS, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
// 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();
+ sal_Bool bCheck = ! static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
aCBAxisSideBySide.Check( bCheck );
}
else
{
- aCBAxisSideBySide.Show(FALSE);
+ aCBAxisSideBySide.Show(sal_False);
}
//missing value treatment
{
::com::sun::star::uno::Sequence < sal_Int32 > aMissingValueTreatments;
- if( rInAttrs.GetItemState(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, TRUE, &pPoolItem) == SFX_ITEM_SET )
+ if( rInAttrs.GetItemState(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, sal_True, &pPoolItem) == SFX_ITEM_SET )
aMissingValueTreatments =((const SfxIntegerListItem*)pPoolItem)->GetConstSequence();
- if ( aMissingValueTreatments.getLength()>1 && rInAttrs.GetItemState(SCHATTR_MISSING_VALUE_TREATMENT,TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if ( aMissingValueTreatments.getLength()>1 && rInAttrs.GetItemState(SCHATTR_MISSING_VALUE_TREATMENT,sal_True, &pPoolItem) == SFX_ITEM_SET)
{
- m_aRB_DontPaint.Enable(FALSE);
- m_aRB_AssumeZero.Enable(FALSE);
- m_aRB_ContinueLine.Enable(FALSE);
+ m_aRB_DontPaint.Enable(sal_False);
+ m_aRB_AssumeZero.Enable(sal_False);
+ m_aRB_ContinueLine.Enable(sal_False);
for( sal_Int32 nN =0; nN<aMissingValueTreatments.getLength(); nN++ )
{
sal_Int32 nVal = aMissingValueTreatments[nN];
if(nVal==::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP)
- m_aRB_DontPaint.Enable(TRUE);
+ m_aRB_DontPaint.Enable(sal_True);
else if(nVal==::com::sun::star::chart::MissingValueTreatment::USE_ZERO)
- m_aRB_AssumeZero.Enable(TRUE);
+ m_aRB_AssumeZero.Enable(sal_True);
else if(nVal==::com::sun::star::chart::MissingValueTreatment::CONTINUE)
- m_aRB_ContinueLine.Enable(TRUE);
+ m_aRB_ContinueLine.Enable(sal_True);
}
long nVal=((const SfxInt32Item*)pPoolItem)->GetValue();
if(nVal==::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP)
- m_aRB_DontPaint.Check(TRUE);
+ m_aRB_DontPaint.Check(sal_True);
else if(nVal==::com::sun::star::chart::MissingValueTreatment::USE_ZERO)
- m_aRB_AssumeZero.Check(TRUE);
+ m_aRB_AssumeZero.Check(sal_True);
else if(nVal==::com::sun::star::chart::MissingValueTreatment::CONTINUE)
- m_aRB_ContinueLine.Check(TRUE);
+ m_aRB_ContinueLine.Check(sal_True);
}
else
{
- m_aFT_MissingValues.Show(FALSE);
- m_aRB_DontPaint.Show(FALSE);
- m_aRB_AssumeZero.Show(FALSE);
- m_aRB_ContinueLine.Show(FALSE);
+ m_aFT_MissingValues.Show(sal_False);
+ m_aRB_DontPaint.Show(sal_False);
+ m_aRB_AssumeZero.Show(sal_False);
+ m_aRB_ContinueLine.Show(sal_False);
}
}
// Include hidden cells
- if (rInAttrs.GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ if (rInAttrs.GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, sal_True, &pPoolItem) == SFX_ITEM_SET)
{
bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
m_aCBIncludeHiddenCells.Check(bVal);
}
else
{
- m_aCBIncludeHiddenCells.Show(FALSE);
+ m_aCBIncludeHiddenCells.Show(sal_False);
if(!m_aFT_MissingValues.IsVisible())
- m_aFL_PlotOptions.Show(FALSE);
+ m_aFL_PlotOptions.Show(sal_False);
}
AdaptControlPositionsAndVisibility();
@@ -276,7 +276,7 @@ void SchOptionTabPage::AdaptControlPositionsAndVisibility()
if( !aMTGap.IsVisible() && !aMTOverlap.IsVisible() )
{
- aGrpBar.Show(FALSE);
+ aGrpBar.Show(sal_False);
Point aPos;
if( !aRbtAxis1.IsVisible() && !aRbtAxis2.IsVisible() )
aPos = aGrpAxis.GetPosPixel();
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
index baa8c5e8b4d1..f09b24814511 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
@@ -49,7 +49,7 @@ public:
virtual ~SchOptionTabPage();
static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs);
- virtual BOOL FillItemSet(SfxItemSet& rOutAttrs);
+ virtual sal_Bool FillItemSet(SfxItemSet& rOutAttrs);
virtual void Reset(const SfxItemSet& rInAttrs);
void Init( bool bProvidesSecondaryYAxis, bool bProvidesOverlapAndGapWidth, bool bProvidesBarConnectors );
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.src b/chart2/source/controller/dialogs/tp_SeriesToAxis.src
index 0d67feb22cee..f307d4750062 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.src
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.src
@@ -29,6 +29,7 @@
TabPage TP_OPTIONS
{
+ HelpID = "chart2:TabPage:TP_OPTIONS";
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 185 ) ;
@@ -42,6 +43,7 @@ TabPage TP_OPTIONS
RadioButton RBT_OPT_AXIS_1
{
+ HelpID = "chart2:RadioButton:TP_OPTIONS:RBT_OPT_AXIS_1";
Pos = MAP_APPFONT ( 12 , 20 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
@@ -50,6 +52,7 @@ TabPage TP_OPTIONS
RadioButton RBT_OPT_AXIS_2
{
+ HelpID = "chart2:RadioButton:TP_OPTIONS:RBT_OPT_AXIS_2";
Pos = MAP_APPFONT ( 12 , 34 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
@@ -72,6 +75,7 @@ TabPage TP_OPTIONS
MetricField MT_OVERLAP
{
+ HelpID = "chart2:MetricField:TP_OPTIONS:MT_OVERLAP";
Border = TRUE ;
Pos = MAP_APPFONT ( 63 , 78 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
@@ -98,6 +102,7 @@ TabPage TP_OPTIONS
MetricField MT_GAP
{
+ HelpID = "chart2:MetricField:TP_OPTIONS:MT_GAP";
Border = TRUE ;
Pos = MAP_APPFONT ( 63 , 62 ) ;
Size = MAP_APPFONT ( 40 , 12 ) ;
@@ -117,6 +122,7 @@ TabPage TP_OPTIONS
CheckBox CB_CONNECTOR
{
+ HelpID = "chart2:CheckBox:TP_OPTIONS:CB_CONNECTOR";
Pos = MAP_APPFONT ( 12 , 97 ) ;
Size = MAP_APPFONT ( 200 , 10 ) ;
TabStop = TRUE ;
@@ -125,6 +131,7 @@ TabPage TP_OPTIONS
CheckBox CB_BARS_SIDE_BY_SIDE
{
+ HelpID = "chart2:CheckBox:TP_OPTIONS:CB_BARS_SIDE_BY_SIDE";
Pos = MAP_APPFONT ( 12 , 97 ) ;
Size = MAP_APPFONT ( 200 , 10 ) ;
TabStop = TRUE ;
@@ -147,6 +154,7 @@ TabPage TP_OPTIONS
RadioButton RB_DONT_PAINT
{
+ HelpID = "chart2:RadioButton:TP_OPTIONS:RB_DONT_PAINT";
Pos = MAP_APPFONT ( 82 , 127 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
@@ -155,6 +163,7 @@ TabPage TP_OPTIONS
RadioButton RB_ASSUME_ZERO
{
+ HelpID = "chart2:RadioButton:TP_OPTIONS:RB_ASSUME_ZERO";
Pos = MAP_APPFONT ( 82 , 141 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
@@ -163,6 +172,7 @@ TabPage TP_OPTIONS
RadioButton RB_CONTINUE_LINE
{
+ HelpID = "chart2:RadioButton:TP_OPTIONS:RB_CONTINUE_LINE";
Pos = MAP_APPFONT ( 82 , 155 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
@@ -171,6 +181,7 @@ TabPage TP_OPTIONS
CheckBox CB_INCLUDE_HIDDEN_CELLS
{
+ HelpID = "chart2:CheckBox:TP_OPTIONS:CB_INCLUDE_HIDDEN_CELLS";
Pos = MAP_APPFONT ( 12 , 172 ) ;
Size = MAP_APPFONT ( 200 , 10 ) ;
TabStop = TRUE ;
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
index ecbeb6f6d7b0..8e9e66e30f03 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
@@ -59,7 +59,7 @@ SchAlignmentTabPage::SchAlignmentTabPage(Window* pWindow,
{
FreeResource();
- aCbStacked.EnableTriState( FALSE );
+ aCbStacked.EnableTriState( sal_False );
aOrientHlp.AddDependentWindow( aFtRotate, STATE_CHECK );
if( !bWithRotation )
@@ -89,7 +89,7 @@ SfxTabPage* SchAlignmentTabPage::CreateWithoutRotation(Window* pParent,
return new SchAlignmentTabPage(pParent, rInAttrs, false);
}
-BOOL SchAlignmentTabPage::FillItemSet(SfxItemSet& rOutAttrs)
+sal_Bool SchAlignmentTabPage::FillItemSet(SfxItemSet& rOutAttrs)
{
//Since 04/1998 text can be rotated by an arbitrary angle: SCHATTR_TEXT_DEGREES
bool bStacked = aOrientHlp.GetStackedState() == STATE_CHECK;
@@ -101,7 +101,7 @@ BOOL SchAlignmentTabPage::FillItemSet(SfxItemSet& rOutAttrs)
SvxFrameDirection aDirection( aLbTextDirection.GetSelectEntryValue() );
rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, aDirection ) );
- return TRUE;
+ return sal_True;
}
void SchAlignmentTabPage::Reset(const SfxItemSet& rInAttrs)
@@ -116,7 +116,7 @@ void SchAlignmentTabPage::Reset(const SfxItemSet& rInAttrs)
aOrientHlp.SetStackedState( bStacked ? STATE_CHECK : STATE_NOCHECK );
- if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, TRUE, &pItem) == SFX_ITEM_SET)
+ if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, sal_True, &pItem) == SFX_ITEM_SET)
aLbTextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pItem)->GetValue()) );
}
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.hxx b/chart2/source/controller/dialogs/tp_TitleRotation.hxx
index 190bbcaf1d42..87c3e43a914a 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.hxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.hxx
@@ -59,7 +59,7 @@ public:
static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs);
static SfxTabPage* CreateWithoutRotation(Window* pParent, const SfxItemSet& rInAttrs);
- virtual BOOL FillItemSet(SfxItemSet& rOutAttrs);
+ virtual sal_Bool FillItemSet(SfxItemSet& rOutAttrs);
virtual void Reset(const SfxItemSet& rInAttrs);
};
diff --git a/chart2/source/controller/dialogs/tp_Trendline.cxx b/chart2/source/controller/dialogs/tp_Trendline.cxx
index 97859daa14fc..f64e40f8f5a9 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.cxx
+++ b/chart2/source/controller/dialogs/tp_Trendline.cxx
@@ -55,7 +55,7 @@ SfxTabPage* TrendlineTabPage::Create(
return new TrendlineTabPage( pParent, rOutAttrs );
}
-BOOL TrendlineTabPage::FillItemSet( SfxItemSet& rOutAttrs )
+sal_Bool TrendlineTabPage::FillItemSet( SfxItemSet& rOutAttrs )
{
return m_aTrendlineResources.FillItemSet( rOutAttrs );
}
diff --git a/chart2/source/controller/dialogs/tp_Trendline.hxx b/chart2/source/controller/dialogs/tp_Trendline.hxx
index d4d3726c01a2..f2a1ac94b395 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.hxx
+++ b/chart2/source/controller/dialogs/tp_Trendline.hxx
@@ -44,7 +44,7 @@ public:
virtual ~TrendlineTabPage ();
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs );
- virtual BOOL FillItemSet( SfxItemSet& rOutAttrs );
+ virtual sal_Bool FillItemSet( SfxItemSet& rOutAttrs );
virtual void Reset( const SfxItemSet& rInAttrs );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
diff --git a/chart2/source/controller/dialogs/tp_Trendline.src b/chart2/source/controller/dialogs/tp_Trendline.src
index f7a3fa33a6d8..1a283844a8d1 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.src
+++ b/chart2/source/controller/dialogs/tp_Trendline.src
@@ -30,6 +30,7 @@
TabPage TP_TRENDLINE
{
+ HelpID = "chart2:TabPage:TP_TRENDLINE";
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 185 ) ;
diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.src b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.src
index a17f5655e751..473007f1c32b 100644
--- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.src
+++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.src
@@ -59,6 +59,7 @@
TabPage TP_WIZARD_TITLEANDOBJECTS
{
+ HelpID = "chart2:TabPage:TP_WIZARD_TITLEANDOBJECTS";
Hide = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( CHART_WIZARD_PAGEWIDTH , CHART_WIZARD_PAGEHEIGHT ) ;
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index 9a4d9ecdf76b..56ee37614ba4 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -195,7 +195,7 @@ void DrawViewWrapper::SetMarkHandles()
SdrObject* DrawViewWrapper::getHitObject( const Point& rPnt ) const
{
SdrObject* pRet = NULL;
- ULONG nOptions = SDRSEARCH_DEEP | SDRSEARCH_TESTMARKABLE;
+ sal_uLong nOptions = SDRSEARCH_DEEP | SDRSEARCH_TESTMARKABLE;
SdrPageView* pSdrPageView = this->GetPageView();
this->SdrView::PickObj(rPnt, lcl_getHitTolerance( this->GetFirstOutputDevice() ), pRet, pSdrPageView, nOptions);
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
index 8aefcfe40b24..bf1096a26e25 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -182,7 +182,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
aVDev.SetMapMode(MapMode(MAP_100TH_MM));
SdrModel* pModel = new SdrModel();
pModel->GetItemPool().FreezeIdRanges();
- SdrPage* pPage = new SdrPage( *pModel, FALSE );
+ SdrPage* pPage = new SdrPage( *pModel, sal_False );
pPage->SetSize(Size(1000,1000));
pModel->InsertPage( pPage, 0 );
SdrView* pView = new SdrView( pModel, &aVDev );
@@ -225,7 +225,7 @@ FontList* ViewElementListProvider::getFontList() const
OutputDevice* pDefaultOut = Application::GetDefaultDevice();
m_pFontList = new FontList( pRefDev ? pRefDev : pDefaultOut
, pRefDev ? pDefaultOut : NULL
- , FALSE );
+ , sal_False );
}
return m_pFontList;
}
diff --git a/chart2/source/controller/inc/AxisItemConverter.hxx b/chart2/source/controller/inc/AxisItemConverter.hxx
index 7cae06bd446b..eb43cb984f76 100644
--- a/chart2/source/controller/inc/AxisItemConverter.hxx
+++ b/chart2/source/controller/inc/AxisItemConverter.hxx
@@ -28,8 +28,7 @@
#ifndef CHART_AXISITEMCONVERTER_HXX
#define CHART_AXISITEMCONVERTER_HXX
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
+#include <chartview/ExplicitScaleValues.hxx>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/awt/Size.hpp>
@@ -56,8 +55,8 @@ public:
SdrModel& rDrawModel,
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDoc,
- ::com::sun::star::chart2::ExplicitScaleData * pScale = NULL,
- ::com::sun::star::chart2::ExplicitIncrementData * pIncrement = NULL,
+ ExplicitScaleData * pScale = NULL,
+ ExplicitIncrementData * pIncrement = NULL,
::std::auto_ptr< ::com::sun::star::awt::Size > pRefSize =
::std::auto_ptr< ::com::sun::star::awt::Size >() );
virtual ~AxisItemConverter();
@@ -66,12 +65,12 @@ public:
virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
private:
@@ -82,8 +81,8 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > m_xChartDoc;
- ::com::sun::star::chart2::ExplicitScaleData * m_pExplicitScale;
- ::com::sun::star::chart2::ExplicitIncrementData * m_pExplicitIncrement;
+ ExplicitScaleData* m_pExplicitScale;
+ ExplicitIncrementData* m_pExplicitIncrement;
};
} // namespace wrapper
diff --git a/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx b/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx
index 05086b005271..51b91c0dd3dd 100644
--- a/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx
+++ b/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx
@@ -60,12 +60,12 @@ public:
virtual ~CharacterPropertyItemConverter();
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
::com::sun::star::uno::Reference<
diff --git a/chart2/source/controller/inc/ConfigurationAccess.hxx b/chart2/source/controller/inc/ConfigurationAccess.hxx
index a28177ed236f..2964e9f889ea 100644
--- a/chart2/source/controller/inc/ConfigurationAccess.hxx
+++ b/chart2/source/controller/inc/ConfigurationAccess.hxx
@@ -30,7 +30,7 @@
#define _CHART2_CONFIGURATIONACCESS_HXX
// header for enum FieldUnit
-#include <vcl/fldunit.hxx>
+#include <tools/fldunit.hxx>
//.............................................................................
namespace chart
diff --git a/chart2/source/controller/inc/DataPointItemConverter.hxx b/chart2/source/controller/inc/DataPointItemConverter.hxx
index 618979ac43da..9f9d6174289d 100644
--- a/chart2/source/controller/inc/DataPointItemConverter.hxx
+++ b/chart2/source/controller/inc/DataPointItemConverter.hxx
@@ -30,7 +30,7 @@
#include "ItemConverter.hxx"
#include "GraphicPropertyItemConverter.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/awt/Size.hpp>
@@ -82,12 +82,12 @@ public:
virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
private:
diff --git a/chart2/source/controller/inc/DrawViewWrapper.hxx b/chart2/source/controller/inc/DrawViewWrapper.hxx
index 93b5b4d64312..fda4898f274c 100644
--- a/chart2/source/controller/inc/DrawViewWrapper.hxx
+++ b/chart2/source/controller/inc/DrawViewWrapper.hxx
@@ -70,11 +70,11 @@ public:
SdrPageView* GetPageView() const;
SdrObject* getHitObject( const Point& rPnt ) const;
- //BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions, SdrObject** ppRootObj, ULONG* pnMarkNum=NULL, USHORT* pnPassNum=NULL) const;
- //BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const;
- //BOOL PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); }
+ //sal_Bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uLong nOptions, SdrObject** ppRootObj, sal_uLong* pnMarkNum=NULL, sal_uInt16* pnPassNum=NULL) const;
+ //sal_Bool PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uLong nOptions=0) const;
+ //sal_Bool PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, sal_uLong nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); }
- //void MarkObj(SdrObject* pObj, SdrPageView* pPV, BOOL bUnmark=FALSE, BOOL bImpNoSetMarkHdl=FALSE);
+ //void MarkObj(SdrObject* pObj, SdrPageView* pPV, sal_Bool bUnmark=sal_False, sal_Bool bImpNoSetMarkHdl=sal_False);
void MarkObject( SdrObject* pObj );
//----------------------
diff --git a/chart2/source/controller/inc/ErrorBarItemConverter.hxx b/chart2/source/controller/inc/ErrorBarItemConverter.hxx
index e1e4af7b2350..8251e1e73ba7 100644
--- a/chart2/source/controller/inc/ErrorBarItemConverter.hxx
+++ b/chart2/source/controller/inc/ErrorBarItemConverter.hxx
@@ -30,7 +30,7 @@
#include "ItemConverter.hxx"
#include "GraphicPropertyItemConverter.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -64,12 +64,12 @@ public:
virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
private:
diff --git a/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx b/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx
index 420d776abf2d..1d8ab0b96901 100644
--- a/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx
+++ b/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx
@@ -64,12 +64,12 @@ public:
virtual ~GraphicPropertyItemConverter();
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
private:
diff --git a/chart2/source/controller/inc/HelpIds.hrc b/chart2/source/controller/inc/HelpIds.hrc
index 3515497b240f..5e20b7980c8b 100644
--- a/chart2/source/controller/inc/HelpIds.hrc
+++ b/chart2/source/controller/inc/HelpIds.hrc
@@ -27,131 +27,136 @@
#ifndef CHART_HELPIDS_HRC
#define CHART_HELPIDS_HRC
-#include <svl/solar.hrc>
-//next is 120
-//free: 20, 21, 22, 30, 31, 32, 33
+#define HID_SCH_ALIGNMENT "CHART2_HID_SCH_ALIGNMENT"
+#define HID_SCH_LEGEND_POS "CHART2_HID_SCH_LEGEND_POS"
+#define HID_SCH_DATA_DESCR "CHART2_HID_SCH_DATA_DESCR"
-//see old chart: schhids.h
+#define HID_SCH_STAT "CHART2_HID_SCH_STAT"
+#define HID_SCH_WIN_DOCUMENT "CHART2_HID_SCH_WIN_DOCUMENT"
+#define HID_SCH_CTL_DATA "CHART2_HID_SCH_CTL_DATA"
-#define HID_SCH_ALIGNMENT (HID_SCH_START + 4)
-#define HID_SCH_LEGEND_POS (HID_SCH_START + 5)
-#define HID_SCH_DATA_DESCR (HID_SCH_START + 6)
-
-#define HID_SCH_STAT (HID_SCH_START + 8)
-#define HID_SCH_WIN_DOCUMENT (HID_SCH_START + 9)
-#define HID_SCH_CTL_DATA (HID_SCH_START + 10)
-
-#define HID_SCH_CT_INDICATE (HID_SCH_START + 11)
+#define HID_SCH_CT_INDICATE "CHART2_HID_SCH_CT_INDICATE"
//for chart type dialog:
-#define HID_SCH_CTL_TYPE (HID_SCH_START + 13)
-#define HID_SCH_CTL_VARIANT (HID_SCH_START + 14)
-#define HID_SCH_NUM_OF_LINES (HID_SCH_START + 43)
-#define HID_SCH_SERIES_LIST (HID_SCH_START + 15)
-#define HID_SCH_DATA_RANGES_LIST (HID_SCH_START + 16)
-
-#define HID_SCH_TBI_DATA_INSERT_ROW (HID_SCH_START + 23)
-#define HID_SCH_TBI_DATA_INSERT_COL (HID_SCH_START + 24)
-#define HID_SCH_TBI_DATA_DELETE_ROW (HID_SCH_START + 25)
-#define HID_SCH_TBI_DATA_DELETE_COL (HID_SCH_START + 26)
-#define HID_SCH_TBI_DATA_SWAP_COL (HID_SCH_START + 27)
-#define HID_SCH_TBI_DATA_SWAP_ROW (HID_SCH_START + 28)
-#define HID_SCH_TBI_DATA_INSERT_TEXT_COL (HID_SCH_START + 29)
-#define HID_SCH_TBX_DATA (HID_SCH_START + 34)
-
-#define HID_SCH_ALIGNMENT_CTR_DIAL (HID_SCH_START + 35)
-#define HID_SCH_ALIGNMENT_STACKED (HID_SCH_START + 36)
-#define HID_SCH_ALIGNMENT_DEGREES (HID_SCH_START + 37)
-#define HID_SCH_TP_AXIS_LABEL (HID_SCH_START + 42)
-
-#define HID_SCH_CHART_AUTO_FORMAT (HID_SCH_START + 44)
-#define HID_SCH_LB_BAR_GEOMETRY (HID_SCH_START + 45)
-#define HID_SCH_DLG_SPLINE_PROPERTIES (HID_SCH_START + 46)
-#define HID_SCH_DLG_RANGES (HID_SCH_START + 47)
-
-#define HID_SCH_CB_XAXIS (HID_SCH_START + 48)
-#define HID_SCH_CB_YAXIS (HID_SCH_START + 49)
-#define HID_SCH_CB_ZAXIS (HID_SCH_START + 50)
-#define HID_SCH_CB_SECONDARY_XAXIS (HID_SCH_START + 51)
-#define HID_SCH_CB_SECONDARY_YAXIS (HID_SCH_START + 52)
-#define HID_SCH_CB_SECONDARY_ZAXIS (HID_SCH_START + 53)
-
-#define HID_SCH_CB_XGRID (HID_SCH_START + 54)
-#define HID_SCH_CB_YGRID (HID_SCH_START + 55)
-#define HID_SCH_CB_ZGRID (HID_SCH_START + 56)
-#define HID_SCH_CB_SECONDARY_XGRID (HID_SCH_START + 57)
-#define HID_SCH_CB_SECONDARY_YGRID (HID_SCH_START + 58)
-#define HID_SCH_CB_SECONDARY_ZGRID (HID_SCH_START + 59)
-
-#define HID_SCH_LEGEND_POS_LEFT (HID_SCH_START + 60)
-#define HID_SCH_LEGEND_POS_TOP (HID_SCH_START + 61)
-#define HID_SCH_LEGEND_POS_RIGHT (HID_SCH_START + 62)
-#define HID_SCH_LEGEND_POS_BOTTOM (HID_SCH_START + 63)
-
-#define HID_SCH_STATISTIK_MEANVALUE (HID_SCH_START + 64)
-#define HID_SCH_STATISTIK_NO_ERROR (HID_SCH_START + 65)
-#define HID_SCH_STATISTIK_VARIANT (HID_SCH_START + 66)
-#define HID_SCH_STATISTIK_SIGMA (HID_SCH_START + 67)
-#define HID_SCH_STATISTIK_PERCENT (HID_SCH_START + 68)
-#define HID_SCH_STATISTIK_BIGERROR (HID_SCH_START + 69)
-#define HID_SCH_STATISTIK_CONSTERROR (HID_SCH_START + 70)
-#define HID_SCH_STATISTIK_PERCENT_VALUE (HID_SCH_START + 71)
-#define HID_SCH_STATISTIK_BIGERROR_VALUE (HID_SCH_START + 72)
-#define HID_SCH_STATISTIK_PLUS_VALUE (HID_SCH_START + 73)
-#define HID_SCH_STATISTIK_MINUS_VALUE (HID_SCH_START + 74)
-
-#define HID_SCH_DATALABEL_VALUE (HID_SCH_START + 75)
-#define HID_SCH_DATALABEL_NUMBER (HID_SCH_START + 76)
-#define HID_SCH_DATALABEL_PERCENT (HID_SCH_START + 77)
-#define HID_SCH_DATALABEL_TEXT (HID_SCH_START + 78)
-#define HID_SCH_DATALABEL_SYMBOL (HID_SCH_START + 79)
-#define HID_SCH_PB_NUMBERFORMAT (HID_SCH_START + 88)
-#define HID_SCH_PB_PERCENT_NUMBERFORMAT (HID_SCH_START + 89)
-#define HID_SCH_DATALABEL_SEPARATOR (HID_SCH_START + 90)
-#define HID_SCH_DATALABEL_PLACEMENT (HID_SCH_START + 91)
-#define HID_SCH_TEXTDIRECTION (HID_SCH_START + 115)
-#define HID_SCH_TEXTDIRECTION_TITLE (HID_SCH_START + 116)
-#define HID_SCH_TEXTDIRECTION_EQUATION (HID_SCH_START + 117)
-#define HID_SCH_DATALABEL_ROTATION_KNOB (HID_SCH_START + 118)
-#define HID_SCH_DATALABEL_ROTATION_EDIT (HID_SCH_START + 119)
-
-#define HID_SCH_TITLE_MAIN (HID_SCH_START + 80)
-#define HID_SCH_TITLE_SUB (HID_SCH_START + 81)
-#define HID_SCH_TITLE_X (HID_SCH_START + 82)
-#define HID_SCH_TITLE_Y (HID_SCH_START + 83)
-#define HID_SCH_TITLE_Z (HID_SCH_START + 84)
-#define HID_SCH_TITLE_SECONDARY_X (HID_SCH_START + 92)
-#define HID_SCH_TITLE_SECONDARY_Y (HID_SCH_START + 93)
-
-#define HID_SCH_WIZARD_ROADMAP (HID_SCH_START + 85)
-#define HID_SCH_LEGEND_SHOW (HID_SCH_START + 86)
-#define HID_SCH_DATA_SERIES_LABEL (HID_SCH_START + 87)
-
-#define HID_SCH_STARTING_ANGLE_DIAL (HID_SCH_START + 94)
-
-#define HID_SCH_TRENDLINE_RB_NONE (HID_SCH_START + 95)
-#define HID_SCH_TRENDLINE_RB_LINEAR (HID_SCH_START + 96)
-#define HID_SCH_TRENDLINE_RB_LOGARITHMIC (HID_SCH_START + 97)
-#define HID_SCH_TRENDLINE_RB_EXPONENTIAL (HID_SCH_START + 98)
-#define HID_SCH_TRENDLINE_RB_POWER (HID_SCH_START + 99)
-#define HID_SCH_TRENDLINE_SHOW_EQUATION (HID_SCH_START + 100)
-#define HID_SCH_TRENDLINE_SHOW_R_SQUARED (HID_SCH_START + 101)
-
-#define HID_SCH_STATISTIK_FUNCTION (HID_SCH_START + 102)
-#define HID_SCH_STATISTIK_RANGE (HID_SCH_START + 103)
-#define HID_SCH_STATISTIK_FUNCTION_LB (HID_SCH_START + 104)
-#define HID_SCH_STATISTIK_POSITIVE_VALUE (HID_SCH_START + 105)
-#define HID_SCH_STATISTIK_POSITIVE_RANGE (HID_SCH_START + 106)
-#define HID_SCH_STATISTIK_POSITIVE_RANGE_CHOOSER (HID_SCH_START + 107)
-#define HID_SCH_STATISTIK_NEGATIVE_VALUE (HID_SCH_START + 108)
-#define HID_SCH_STATISTIK_NEGATIVE_RANGE (HID_SCH_START + 109)
-#define HID_SCH_STATISTIK_NEGATIVE_RANGE_CHOOSER (HID_SCH_START + 110)
-#define HID_SCH_STATISTIK_SAME_FOR_BOTH (HID_SCH_START + 111)
-#define HID_SCH_STATISTIK_SHOW_BOTH (HID_SCH_START + 112)
-#define HID_SCH_STATISTIK_SHOW_POSITIVE (HID_SCH_START + 113)
-#define HID_SCH_STATISTIK_SHOW_NEGATIVE (HID_SCH_START + 114)
-
-
-// HID_SCH_START should be 63280 (checked 25.Nov 2002)
+#define HID_SCH_CTL_TYPE "CHART2_HID_SCH_CTL_TYPE"
+#define HID_SCH_CTL_VARIANT "CHART2_HID_SCH_CTL_VARIANT"
+#define HID_SCH_NUM_OF_LINES "CHART2_HID_SCH_NUM_OF_LINES"
+#define HID_SCH_SERIES_LIST "CHART2_HID_SCH_SERIES_LIST"
+#define HID_SCH_DATA_RANGES_LIST "CHART2_HID_SCH_DATA_RANGES_LIST"
+//
+
+#define HID_SCH_TBI_DATA_INSERT_ROW "CHART2_HID_SCH_TBI_DATA_INSERT_ROW"
+#define HID_SCH_TBI_DATA_INSERT_COL "CHART2_HID_SCH_TBI_DATA_INSERT_COL"
+#define HID_SCH_TBI_DATA_DELETE_ROW "CHART2_HID_SCH_TBI_DATA_DELETE_ROW"
+#define HID_SCH_TBI_DATA_DELETE_COL "CHART2_HID_SCH_TBI_DATA_DELETE_COL"
+#define HID_SCH_TBI_DATA_SWAP_COL "CHART2_HID_SCH_TBI_DATA_SWAP_COL"
+#define HID_SCH_TBI_DATA_SWAP_ROW "CHART2_HID_SCH_TBI_DATA_SWAP_ROW"
+#define HID_SCH_TBI_DATA_INSERT_TEXT_COL "CHART2_HID_SCH_TBI_DATA_INSERT_TEXT_COL"
+#define HID_SCH_TBX_DATA "CHART2_HID_SCH_TBX_DATA"
+
+#define HID_SCH_ALIGNMENT_CTR_DIAL "CHART2_HID_SCH_ALIGNMENT_CTR_DIAL"
+#define HID_SCH_ALIGNMENT_STACKED "CHART2_HID_SCH_ALIGNMENT_STACKED"
+#define HID_SCH_ALIGNMENT_DEGREES "CHART2_HID_SCH_ALIGNMENT_DEGREES"
+
+#define HID_SCH_TP_AXIS_LABEL "CHART2_HID_SCH_TP_AXIS_LABEL"
+
+#define HID_SCH_CHART_AUTO_FORMAT "CHART2_HID_SCH_CHART_AUTO_FORMAT"
+#define HID_SCH_LB_BAR_GEOMETRY "CHART2_HID_SCH_LB_BAR_GEOMETRY"
+#define HID_SCH_DLG_SPLINE_PROPERTIES "CHART2_HID_SCH_DLG_SPLINE_PROPERTIES"
+#define HID_SCH_DLG_RANGES "CHART2_HID_SCH_DLG_RANGES"
+
+#define HID_SCH_CB_XAXIS "CHART2_HID_SCH_CB_XAXIS"
+#define HID_SCH_CB_YAXIS "CHART2_HID_SCH_CB_YAXIS"
+#define HID_SCH_CB_ZAXIS "CHART2_HID_SCH_CB_ZAXIS"
+#define HID_SCH_CB_SECONDARY_XAXIS "CHART2_HID_SCH_CB_SECONDARY_XAXIS"
+#define HID_SCH_CB_SECONDARY_YAXIS "CHART2_HID_SCH_CB_SECONDARY_YAXIS"
+#define HID_SCH_CB_SECONDARY_ZAXIS "CHART2_HID_SCH_CB_SECONDARY_ZAXIS"
+
+#define HID_SCH_CB_XGRID "CHART2_HID_SCH_CB_XGRID"
+#define HID_SCH_CB_YGRID "CHART2_HID_SCH_CB_YGRID"
+#define HID_SCH_CB_ZGRID "CHART2_HID_SCH_CB_ZGRID"
+#define HID_SCH_CB_SECONDARY_XGRID "CHART2_HID_SCH_CB_SECONDARY_XGRID"
+#define HID_SCH_CB_SECONDARY_YGRID "CHART2_HID_SCH_CB_SECONDARY_YGRID"
+#define HID_SCH_CB_SECONDARY_ZGRID "CHART2_HID_SCH_CB_SECONDARY_ZGRID"
+
+#define HID_SCH_LEGEND_POS_LEFT "CHART2_HID_SCH_LEGEND_POS_LEFT"
+#define HID_SCH_LEGEND_POS_TOP "CHART2_HID_SCH_LEGEND_POS_TOP"
+#define HID_SCH_LEGEND_POS_RIGHT "CHART2_HID_SCH_LEGEND_POS_RIGHT"
+#define HID_SCH_LEGEND_POS_BOTTOM "CHART2_HID_SCH_LEGEND_POS_BOTTOM"
+
+#define HID_SCH_STATISTIK_MEANVALUE "CHART2_HID_SCH_STATISTIK_MEANVALUE"
+#define HID_SCH_STATISTIK_NO_ERROR "CHART2_HID_SCH_STATISTIK_NO_ERROR"
+#define HID_SCH_STATISTIK_VARIANT "CHART2_HID_SCH_STATISTIK_VARIANT"
+#define HID_SCH_STATISTIK_SIGMA "CHART2_HID_SCH_STATISTIK_SIGMA"
+#define HID_SCH_STATISTIK_PERCENT "CHART2_HID_SCH_STATISTIK_PERCENT"
+#define HID_SCH_STATISTIK_BIGERROR "CHART2_HID_SCH_STATISTIK_BIGERROR"
+#define HID_SCH_STATISTIK_CONSTERROR "CHART2_HID_SCH_STATISTIK_CONSTERROR"
+#define HID_SCH_STATISTIK_PERCENT_VALUE "CHART2_HID_SCH_STATISTIK_PERCENT_VALUE"
+#define HID_SCH_STATISTIK_BIGERROR_VALUE "CHART2_HID_SCH_STATISTIK_BIGERROR_VALUE"
+#define HID_SCH_STATISTIK_PLUS_VALUE "CHART2_HID_SCH_STATISTIK_PLUS_VALUE"
+#define HID_SCH_STATISTIK_MINUS_VALUE "CHART2_HID_SCH_STATISTIK_MINUS_VALUE"
+
+#define HID_SCH_DATALABEL_VALUE "CHART2_HID_SCH_DATALABEL_VALUE"
+#define HID_SCH_DATALABEL_NUMBER "CHART2_HID_SCH_DATALABEL_NUMBER"
+#define HID_SCH_DATALABEL_PERCENT "CHART2_HID_SCH_DATALABEL_PERCENT"
+#define HID_SCH_DATALABEL_TEXT "CHART2_HID_SCH_DATALABEL_TEXT"
+#define HID_SCH_DATALABEL_SYMBOL "CHART2_HID_SCH_DATALABEL_SYMBOL"
+#define HID_SCH_PB_NUMBERFORMAT "CHART2_HID_SCH_PB_NUMBERFORMAT"
+#define HID_SCH_PB_PERCENT_NUMBERFORMAT "CHART2_HID_SCH_PB_PERCENT_NUMBERFORMAT"
+#define HID_SCH_DATALABEL_SEPARATOR "CHART2_HID_SCH_DATALABEL_SEPARATOR"
+#define HID_SCH_DATALABEL_PLACEMENT "CHART2_HID_SCH_DATALABEL_PLACEMENT"
+#define HID_SCH_TEXTDIRECTION "CHART2_HID_SCH_TEXTDIRECTION"
+#define HID_SCH_TEXTDIRECTION_TITLE "CHART2_HID_SCH_TEXTDIRECTION_TITLE"
+#define HID_SCH_TEXTDIRECTION_EQUATION "CHART2_HID_SCH_TEXTDIRECTION_EQUATION"
+#define HID_SCH_DATALABEL_ROTATION_KNOB "CHART2_HID_SCH_DATALABEL_ROTATION_KNOB"
+#define HID_SCH_DATALABEL_ROTATION_EDIT "CHART2_HID_SCH_DATALABEL_ROTATION_EDIT"
+
+#define HID_SCH_TITLE_MAIN "CHART2_HID_SCH_TITLE_MAIN"
+#define HID_SCH_TITLE_SUB "CHART2_HID_SCH_TITLE_SUB"
+#define HID_SCH_TITLE_X "CHART2_HID_SCH_TITLE_X"
+#define HID_SCH_TITLE_Y "CHART2_HID_SCH_TITLE_Y"
+#define HID_SCH_TITLE_Z "CHART2_HID_SCH_TITLE_Z"
+#define HID_SCH_TITLE_SECONDARY_X "CHART2_HID_SCH_TITLE_SECONDARY_X"
+#define HID_SCH_TITLE_SECONDARY_Y "CHART2_HID_SCH_TITLE_SECONDARY_Y"
+
+#define HID_SCH_WIZARD_ROADMAP "CHART2_HID_SCH_WIZARD_ROADMAP"
+#define HID_SCH_LEGEND_SHOW "CHART2_HID_SCH_LEGEND_SHOW"
+#define HID_SCH_DATA_SERIES_LABEL "CHART2_HID_SCH_DATA_SERIES_LABEL"
+
+#define HID_SCH_STARTING_ANGLE_DIAL "CHART2_HID_SCH_STARTING_ANGLE_DIAL"
+
+#define HID_SCH_TRENDLINE_RB_NONE "CHART2_HID_SCH_TRENDLINE_RB_NONE"
+#define HID_SCH_TRENDLINE_RB_LINEAR "CHART2_HID_SCH_TRENDLINE_RB_LINEAR"
+#define HID_SCH_TRENDLINE_RB_LOGARITHMIC "CHART2_HID_SCH_TRENDLINE_RB_LOGARITHMIC"
+#define HID_SCH_TRENDLINE_RB_EXPONENTIAL "CHART2_HID_SCH_TRENDLINE_RB_EXPONENTIAL"
+#define HID_SCH_TRENDLINE_RB_POWER "CHART2_HID_SCH_TRENDLINE_RB_POWER"
+#define HID_SCH_TRENDLINE_SHOW_EQUATION "CHART2_HID_SCH_TRENDLINE_SHOW_EQUATION"
+#define HID_SCH_TRENDLINE_SHOW_R_SQUARED "CHART2_HID_SCH_TRENDLINE_SHOW_R_SQUARED"
+
+#define HID_SCH_STATISTIK_FUNCTION "CHART2_HID_SCH_STATISTIK_FUNCTION"
+#define HID_SCH_STATISTIK_RANGE "CHART2_HID_SCH_STATISTIK_RANGE"
+#define HID_SCH_STATISTIK_FUNCTION_LB "CHART2_HID_SCH_STATISTIK_FUNCTION_LB"
+#define HID_SCH_STATISTIK_POSITIVE_VALUE "CHART2_HID_SCH_STATISTIK_POSITIVE_VALUE"
+#define HID_SCH_STATISTIK_POSITIVE_RANGE "CHART2_HID_SCH_STATISTIK_POSITIVE_RANGE"
+#define HID_SCH_STATISTIK_POSITIVE_RANGE_CHOOSER "CHART2_HID_SCH_STATISTIK_POSITIVE_RANGE_CHOOSER"
+#define HID_SCH_STATISTIK_NEGATIVE_VALUE "CHART2_HID_SCH_STATISTIK_NEGATIVE_VALUE"
+#define HID_SCH_STATISTIK_NEGATIVE_RANGE "CHART2_HID_SCH_STATISTIK_NEGATIVE_RANGE"
+#define HID_SCH_STATISTIK_NEGATIVE_RANGE_CHOOSER "CHART2_HID_SCH_STATISTIK_NEGATIVE_RANGE_CHOOSER"
+#define HID_SCH_STATISTIK_SAME_FOR_BOTH "CHART2_HID_SCH_STATISTIK_SAME_FOR_BOTH"
+#define HID_SCH_STATISTIK_SHOW_BOTH "CHART2_HID_SCH_STATISTIK_SHOW_BOTH"
+#define HID_SCH_STATISTIK_SHOW_POSITIVE "CHART2_HID_SCH_STATISTIK_SHOW_POSITIVE"
+#define HID_SCH_STATISTIK_SHOW_NEGATIVE "CHART2_HID_SCH_STATISTIK_SHOW_NEGATIVE"
+
+#define HID_INSERT_GRIDS "CHART2_HID_INSERT_GRIDS"
+
+#define HID_DIAGRAM_TYPE "CHART2_HID_DIAGRAM_TYPE"
+#define HID_3D_VIEW "CHART2_HID_3D_VIEW"
+#define HID_DIAGRAM_DATA "CHART2_HID_DIAGRAM_DATA"
+#define HID_INSERT_AXIS "CHART2_HID_INSERT_AXIS"
+#define HID_INSERT_STATISTICS "CHART2_HID_INSERT_STATISTICS"
+#define HID_INSERT_TITLE "CHART2_HID_INSERT_TITLE"
+#define HID_INSERT_CHART_LEGEND "CHART2_HID_INSERT_CHART_LEGEND"
+#define HID_INSERT_DESCRIPTION "CHART2_HID_INSERT_DESCRIPTION"
+
#endif
diff --git a/chart2/source/controller/inc/ItemConverter.hxx b/chart2/source/controller/inc/ItemConverter.hxx
index 619ea1b483d4..25c5ef5a817c 100644
--- a/chart2/source/controller/inc/ItemConverter.hxx
+++ b/chart2/source/controller/inc/ItemConverter.hxx
@@ -90,9 +90,9 @@ public:
// typedefs -------------------------------
- typedef USHORT tWhichIdType;
+ typedef sal_uInt16 tWhichIdType;
typedef ::rtl::OUString tPropertyNameType;
- typedef BYTE tMemberIdType;
+ typedef sal_uInt8 tMemberIdType;
typedef ::std::pair< tPropertyNameType, tMemberIdType > tPropertyNameWithMemberId;
@@ -134,7 +134,7 @@ protected:
/** implement this method to provide an array of which-ranges of the form:
- const USHORT aMyPairs[] =
+ const sal_uInt16 aMyPairs[] =
{
from_1, to_1,
from_2, to_2,
@@ -143,7 +143,7 @@ protected:
0
};
*/
- virtual const USHORT * GetWhichPairs() const = 0;
+ virtual const sal_uInt16 * GetWhichPairs() const = 0;
/** implement this method to return a Property object for a given which id.
@@ -162,7 +162,7 @@ protected:
The default implementation does nothing except showing an assertion
*/
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
/** for items that can not be mapped directly to a property.
@@ -174,7 +174,7 @@ protected:
@return true if the item changed a property, false otherwise.
*/
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
// ________
diff --git a/chart2/source/controller/inc/LegendItemConverter.hxx b/chart2/source/controller/inc/LegendItemConverter.hxx
index 9c008f972b74..9ec794aed482 100644
--- a/chart2/source/controller/inc/LegendItemConverter.hxx
+++ b/chart2/source/controller/inc/LegendItemConverter.hxx
@@ -61,12 +61,12 @@ public:
virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
private:
diff --git a/chart2/source/controller/inc/MultipleChartConverters.hxx b/chart2/source/controller/inc/MultipleChartConverters.hxx
index 00f05c32f8da..a4f08c697525 100644
--- a/chart2/source/controller/inc/MultipleChartConverters.hxx
+++ b/chart2/source/controller/inc/MultipleChartConverters.hxx
@@ -56,7 +56,7 @@ public:
virtual ~AllAxisItemConverter();
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
};
class AllGridItemConverter : public ::comphelper::MultipleItemConverter
@@ -72,7 +72,7 @@ public:
virtual ~AllGridItemConverter();
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
};
class AllDataLabelItemConverter : public ::comphelper::MultipleItemConverter
@@ -90,7 +90,7 @@ public:
virtual ~AllDataLabelItemConverter();
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
};
class AllTitleItemConverter : public ::comphelper::MultipleItemConverter
@@ -108,7 +108,7 @@ public:
virtual ~AllTitleItemConverter();
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
};
class AllSeriesStatisticsConverter : public ::comphelper::MultipleItemConverter
@@ -121,7 +121,7 @@ public:
virtual ~AllSeriesStatisticsConverter();
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
};
} // namespace wrapper
diff --git a/chart2/source/controller/inc/MultipleItemConverter.hxx b/chart2/source/controller/inc/MultipleItemConverter.hxx
index 89e27a67c7e1..7ac432bd1c7d 100644
--- a/chart2/source/controller/inc/MultipleItemConverter.hxx
+++ b/chart2/source/controller/inc/MultipleItemConverter.hxx
@@ -37,7 +37,7 @@
namespace comphelper
{
-/** Note: virtual const USHORT * GetWhichPairs() const; is still pure virtual
+/** Note: virtual const sal_uInt16 * GetWhichPairs() const; is still pure virtual
*/
class MultipleItemConverter : public ItemConverter
{
diff --git a/chart2/source/controller/inc/RegressionCurveItemConverter.hxx b/chart2/source/controller/inc/RegressionCurveItemConverter.hxx
index 9aa85a8858c9..a02a0d956515 100644
--- a/chart2/source/controller/inc/RegressionCurveItemConverter.hxx
+++ b/chart2/source/controller/inc/RegressionCurveItemConverter.hxx
@@ -62,12 +62,12 @@ public:
virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
private:
diff --git a/chart2/source/controller/inc/RegressionEquationItemConverter.hxx b/chart2/source/controller/inc/RegressionEquationItemConverter.hxx
index 2064cb77fc50..799189ff1017 100644
--- a/chart2/source/controller/inc/RegressionEquationItemConverter.hxx
+++ b/chart2/source/controller/inc/RegressionEquationItemConverter.hxx
@@ -65,12 +65,12 @@ public:
virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
private:
diff --git a/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx b/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
index f900d1096976..1029accb3f3a 100644
--- a/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
+++ b/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
@@ -55,12 +55,12 @@ public:
virtual ~SeriesOptionsItemConverter();
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
private:
diff --git a/chart2/source/controller/inc/StatisticsItemConverter.hxx b/chart2/source/controller/inc/StatisticsItemConverter.hxx
index e20a3f839068..44e157039a89 100644
--- a/chart2/source/controller/inc/StatisticsItemConverter.hxx
+++ b/chart2/source/controller/inc/StatisticsItemConverter.hxx
@@ -32,7 +32,7 @@
#include "ItemConverter.hxx"
#include "GraphicPropertyItemConverter.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include <vector>
@@ -56,12 +56,12 @@ public:
virtual ~StatisticsItemConverter();
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
private:
diff --git a/chart2/source/controller/inc/TitleItemConverter.hxx b/chart2/source/controller/inc/TitleItemConverter.hxx
index e5ba911fa411..cb149ffdd43f 100644
--- a/chart2/source/controller/inc/TitleItemConverter.hxx
+++ b/chart2/source/controller/inc/TitleItemConverter.hxx
@@ -62,12 +62,12 @@ public:
virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
- virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( ::com::sun::star::uno::Exception );
- virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+ virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( ::com::sun::star::uno::Exception );
private:
diff --git a/chart2/source/controller/inc/dlg_DataEditor.hxx b/chart2/source/controller/inc/dlg_DataEditor.hxx
index 1ea3fe942b1b..74ef15aa9fce 100644
--- a/chart2/source/controller/inc/dlg_DataEditor.hxx
+++ b/chart2/source/controller/inc/dlg_DataEditor.hxx
@@ -63,7 +63,7 @@ public:
virtual void Resize();
// Dialog
- virtual BOOL Close();
+ virtual sal_Bool Close();
void SetReadOnly( bool bReadOnly );
bool ApplyChangesToModel();
diff --git a/chart2/source/controller/inc/dlg_DataSource.hxx b/chart2/source/controller/inc/dlg_DataSource.hxx
index c385ebc26dfa..140066f5b5c1 100644
--- a/chart2/source/controller/inc/dlg_DataSource.hxx
+++ b/chart2/source/controller/inc/dlg_DataSource.hxx
@@ -90,7 +90,7 @@ private:
bool m_bRangeChooserTabIsValid;
bool m_bDataSourceTabIsValid;
- static USHORT m_nLastPageId;
+ static sal_uInt16 m_nLastPageId;
};
} // namespace chart
diff --git a/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx b/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx
index c0512731db4c..62d9c0cf578b 100644
--- a/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx
+++ b/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx
@@ -74,7 +74,7 @@ protected:
HelpButton aPbHelp;
public:
- SchAxisDlg( Window* pParent, const InsertAxisOrGridDialogData& rInput, BOOL bAxisDlg=true );
+ SchAxisDlg( Window* pParent, const InsertAxisOrGridDialogData& rInput, sal_Bool bAxisDlg=true );
virtual ~SchAxisDlg();
void getResult( InsertAxisOrGridDialogData& rOutput );
diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
index 02deda974fc3..2f40c7dcc20c 100644
--- a/chart2/source/controller/inc/dlg_ObjectProperties.hxx
+++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
@@ -70,6 +70,8 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
getDocument() const;
+ bool IsComplexCategoriesAxis() const;
+
private:
rtl::OUString m_aObjectCID;
ObjectType m_eObjectType;
@@ -97,6 +99,8 @@ private:
::com::sun::star::uno::Sequence< rtl::OUString > m_aCategories;
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > m_xChartDocument;
+
+ bool m_bComplexCategoriesAxis;
};
/*************************************************************************
@@ -112,8 +116,8 @@ class SchAttribTabDlg : public SfxTabDialog
private:
ObjectType eObjectType;
bool bAffectsMultipleObjects;//is true if more than one object of the given type will be changed (e.g. all axes or all titles)
- USHORT nDlgType;
- USHORT nPageType;
+ sal_uInt16 nDlgType;
+ sal_uInt16 nPageType;
const ObjectPropertiesDialogParameter * const m_pParameter;
const ViewElementListProvider* const m_pViewElementListProvider;
@@ -125,7 +129,7 @@ private:
double m_fAxisMinorStepWidthForErrorBarDecimals;
bool m_bOKPressed;
- virtual void PageCreated(USHORT nId, SfxTabPage& rPage);
+ virtual void PageCreated(sal_uInt16 nId, SfxTabPage& rPage);
Link m_aOriginalOKClickHdl;
DECL_LINK( OKPressed, void * );
diff --git a/chart2/source/controller/inc/dlg_ShapeFont.hxx b/chart2/source/controller/inc/dlg_ShapeFont.hxx
index cc9f29cb8e2f..6fdab7a1eca3 100644
--- a/chart2/source/controller/inc/dlg_ShapeFont.hxx
+++ b/chart2/source/controller/inc/dlg_ShapeFont.hxx
@@ -47,7 +47,7 @@ public:
virtual ~ShapeFontDialog();
private:
- virtual void PageCreated( USHORT nId, SfxTabPage& rPage );
+ virtual void PageCreated( sal_uInt16 nId, SfxTabPage& rPage );
const ViewElementListProvider* m_pViewElementListProvider;
};
diff --git a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
index 8eeaecb6e9de..404bb6e0081a 100644
--- a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
+++ b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
@@ -44,7 +44,7 @@ public:
virtual ~ShapeParagraphDialog();
private:
- virtual void PageCreated( USHORT nId, SfxTabPage& rPage );
+ virtual void PageCreated( sal_uInt16 nId, SfxTabPage& rPage );
};
//.............................................................................
diff --git a/chart2/source/controller/inc/dlg_View3D.hxx b/chart2/source/controller/inc/dlg_View3D.hxx
index f11a9c2d7895..d9e82e93000c 100644
--- a/chart2/source/controller/inc/dlg_View3D.hxx
+++ b/chart2/source/controller/inc/dlg_View3D.hxx
@@ -73,7 +73,7 @@ private:
ControllerLockHelper m_aControllerLocker;
- static USHORT m_nLastPageId;
+ static sal_uInt16 m_nLastPageId;
};
//.............................................................................
diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx b/chart2/source/controller/inc/res_ErrorBar.hxx
index ad8871dbbc33..74ee6de625fe 100644
--- a/chart2/source/controller/inc/res_ErrorBar.hxx
+++ b/chart2/source/controller/inc/res_ErrorBar.hxx
@@ -74,7 +74,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDocument );
void Reset(const SfxItemSet& rInAttrs);
- BOOL FillItemSet(SfxItemSet& rOutAttrs) const;
+ sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const;
void FillValueSets();
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index 0f1ce591ad4f..4eb1a92d21c0 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -39,12 +39,14 @@
#include "ChartModelHelper.hxx"
#include "AxisHelper.hxx"
#include "CommonConverters.hxx"
+#include "ChartTypeHelper.hxx"
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/AxisOrientation.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
// for SfxBoolItem
#include <svl/eitem.hxx>
@@ -59,6 +61,8 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
+using ::com::sun::star::chart::TimeInterval;
+using ::com::sun::star::chart::TimeIncrement;
namespace
{
@@ -66,13 +70,13 @@ namespace
{
static ::comphelper::ItemPropertyMapType aAxisPropertyMap(
::comphelper::MakeItemPropertyMap
- IPM_MAP_ENTRY( SCHATTR_AXIS_SHOWDESCR, "DisplayLabels", 0 )
- IPM_MAP_ENTRY( SCHATTR_AXIS_TICKS, "MajorTickmarks", 0 )
- IPM_MAP_ENTRY( SCHATTR_AXIS_HELPTICKS, "MinorTickmarks", 0 )
- IPM_MAP_ENTRY( SCHATTR_TEXT_ORDER, "ArrangeOrder", 0 )
- IPM_MAP_ENTRY( SCHATTR_TEXT_STACKED, "StackCharacters", 0 )
- IPM_MAP_ENTRY( SCHATTR_TEXTBREAK, "TextBreak", 0 )
- IPM_MAP_ENTRY( SCHATTR_TEXT_OVERLAP, "TextOverlap", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_SHOWDESCR, "DisplayLabels", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_TICKS, "MajorTickmarks", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_HELPTICKS, "MinorTickmarks", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_ORDER, "ArrangeOrder", 0 )
+ IPM_MAP_ENTRY( SCHATTR_TEXT_STACKED, "StackCharacters", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_BREAK, "TextBreak", 0 )
+ IPM_MAP_ENTRY( SCHATTR_AXIS_LABEL_OVERLAP, "TextOverlap", 0 )
);
return aAxisPropertyMap;
@@ -89,8 +93,8 @@ AxisItemConverter::AxisItemConverter(
SfxItemPool& rItemPool,
SdrModel& rDrawModel,
const Reference< chart2::XChartDocument > & xChartDoc,
- chart2::ExplicitScaleData * pScale /* = NULL */,
- chart2::ExplicitIncrementData * pIncrement /* = NULL */,
+ ::chart::ExplicitScaleData * pScale /* = NULL */,
+ ::chart::ExplicitIncrementData * pIncrement /* = NULL */,
::std::auto_ptr< awt::Size > pRefSize /* = NULL */ ) :
ItemConverter( rPropertySet, rItemPool ),
m_xChartDoc( xChartDoc ),
@@ -100,9 +104,9 @@ AxisItemConverter::AxisItemConverter(
Reference< lang::XMultiServiceFactory > xNamedPropertyContainerFactory( xChartDoc, uno::UNO_QUERY );
if( pScale )
- m_pExplicitScale = new chart2::ExplicitScaleData( *pScale );
+ m_pExplicitScale = new ::chart::ExplicitScaleData( *pScale );
if( pIncrement )
- m_pExplicitIncrement = new chart2::ExplicitIncrementData( *pIncrement );
+ m_pExplicitIncrement = new ::chart::ExplicitIncrementData( *pIncrement );
m_aConverters.push_back( new GraphicPropertyItemConverter(
rPropertySet, rItemPool, rDrawModel,
@@ -144,7 +148,7 @@ bool AxisItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
}
-const USHORT * AxisItemConverter::GetWhichPairs() const
+const sal_uInt16 * AxisItemConverter::GetWhichPairs() const
{
// must span all used items!
return nAxisWhichPairs;
@@ -163,30 +167,40 @@ bool AxisItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNameWit
return true;
}
-void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+bool lcl_hasTimeIntervalValue( const uno::Any& rAny )
+{
+ bool bRet = false;
+ TimeInterval aValue;
+ if( rAny >>= aValue )
+ bRet = true;
+ return bRet;
+}
+
+void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
- if( ! m_xAxis.is() )
+ if( !m_xAxis.is() )
return;
- const chart2::ScaleData aScale( m_xAxis->getScaleData() );
- const chart2::IncrementData aInc( aScale.IncrementData );
- const uno::Sequence< chart2::SubIncrement > aSubIncs( aScale.IncrementData.SubIncrements );
+ 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 = (chart2::AxisType::DATE == rScale.AxisType);
+ if( m_pExplicitScale )
+ bDateAxis = (chart2::AxisType::DATE == m_pExplicitScale->AxisType);
switch( nWhichId )
{
case SCHATTR_AXIS_AUTO_MAX:
- // if the any has no value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aScale.Maximum) ) );
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rScale.Maximum) ) );
break;
case SCHATTR_AXIS_MAX:
{
double fMax = 10.0;
- if( aScale.Maximum >>= fMax )
- {
+ if( rScale.Maximum >>= fMax )
rOutItemSet.Put( SvxDoubleItem( fMax, nWhichId ) );
- }
else
{
if( m_pExplicitScale )
@@ -197,106 +211,141 @@ void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemS
break;
case SCHATTR_AXIS_AUTO_MIN:
- // if the any has no value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aScale.Minimum) ) );
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rScale.Minimum) ) );
break;
case SCHATTR_AXIS_MIN:
{
double fMin = 0.0;
- if( aScale.Minimum >>= fMin )
- {
+ if( rScale.Minimum >>= fMin )
rOutItemSet.Put( SvxDoubleItem( fMin, nWhichId ) );
- }
- else
- {
- if( m_pExplicitScale )
- rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId ));
- }
+ else if( m_pExplicitScale )
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId ));
}
break;
case SCHATTR_AXIS_LOGARITHM:
- {
- BOOL bValue = AxisHelper::isLogarithmic( aScale.Scaling );
- rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
- }
- break;
+ {
+ sal_Bool bValue = AxisHelper::isLogarithmic( rScale.Scaling );
+ rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
+ }
+ break;
case SCHATTR_AXIS_REVERSE:
- rOutItemSet.Put( SfxBoolItem( nWhichId, (AxisOrientation_REVERSE == aScale.Orientation) ));
+ rOutItemSet.Put( SfxBoolItem( nWhichId, (AxisOrientation_REVERSE == rScale.Orientation) ));
break;
// Increment
case SCHATTR_AXIS_AUTO_STEP_MAIN:
- // if the any has no value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aInc.Distance) ) );
+ if( bDateAxis )
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !lcl_hasTimeIntervalValue(rTimeIncrement.MajorTimeInterval) ) );
+ else
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(rIncrement.Distance) ) );
+ break;
+
+ case SCHATTR_AXIS_MAIN_TIME_UNIT:
+ {
+ TimeInterval aTimeInterval;
+ if( rTimeIncrement.MajorTimeInterval >>= aTimeInterval )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.TimeUnit ) );
+ else if( m_pExplicitIncrement )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MajorTimeInterval.TimeUnit ) );
+ }
break;
case SCHATTR_AXIS_STEP_MAIN:
+ if( bDateAxis )
+ {
+ TimeInterval aTimeInterval;
+ if( rTimeIncrement.MajorTimeInterval >>= aTimeInterval )
+ rOutItemSet.Put( SvxDoubleItem(aTimeInterval.Number, nWhichId ));
+ else if( m_pExplicitIncrement )
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->MajorTimeInterval.Number, nWhichId ));
+ }
+ else
{
double fDistance = 1.0;
- if( aInc.Distance >>= fDistance )
- {
+ if( rIncrement.Distance >>= fDistance )
rOutItemSet.Put( SvxDoubleItem(fDistance, nWhichId ));
- }
- else
- {
- if( m_pExplicitIncrement )
- rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId ));
- }
+ else if( m_pExplicitIncrement )
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId ));
}
break;
// SubIncrement
case SCHATTR_AXIS_AUTO_STEP_HELP:
- {
- // if the any has no value => auto is on
- rOutItemSet.Put(
- SfxBoolItem(
- nWhichId,
- ! ( aSubIncs.getLength() > 0 &&
- aSubIncs[0].IntervalCount.hasValue() )));
- }
- break;
+ if( bDateAxis )
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !lcl_hasTimeIntervalValue(rTimeIncrement.MinorTimeInterval) ) );
+ else
+ rOutItemSet.Put( SfxBoolItem( nWhichId,
+ ! ( rSubIncrements.getLength() > 0 && rSubIncrements[0].IntervalCount.hasValue() )));
+ break;
+
+ case SCHATTR_AXIS_HELP_TIME_UNIT:
+ {
+ TimeInterval aTimeInterval;
+ if( rTimeIncrement.MinorTimeInterval >>= aTimeInterval )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.TimeUnit ) );
+ else if( m_pExplicitIncrement )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MinorTimeInterval.TimeUnit ) );
+ }
+ break;
case SCHATTR_AXIS_STEP_HELP:
- {
- if( aSubIncs.getLength() > 0 &&
- aSubIncs[0].IntervalCount.hasValue())
+ if( bDateAxis )
{
- OSL_ASSERT( aSubIncs[0].IntervalCount.getValueTypeClass() == uno::TypeClass_LONG );
- rOutItemSet.Put(
- SfxInt32Item(
- nWhichId,
- *reinterpret_cast< const sal_Int32 * >(
- aSubIncs[0].IntervalCount.getValue()) ));
+ TimeInterval aTimeInterval;
+ if( rTimeIncrement.MinorTimeInterval >>= aTimeInterval )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, aTimeInterval.Number ));
+ else if( m_pExplicitIncrement )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitIncrement->MinorTimeInterval.Number ));
}
else
{
- if( m_pExplicitIncrement &&
- m_pExplicitIncrement->SubIncrements.getLength() > 0 )
+ if( rSubIncrements.getLength() > 0 && rSubIncrements[0].IntervalCount.hasValue())
+ {
+ OSL_ASSERT( rSubIncrements[0].IntervalCount.getValueTypeClass() == uno::TypeClass_LONG );
+ rOutItemSet.Put( SfxInt32Item( nWhichId,
+ *reinterpret_cast< const sal_Int32 * >(
+ rSubIncrements[0].IntervalCount.getValue()) ));
+ }
+ else
{
- rOutItemSet.Put(
- SfxInt32Item(
- nWhichId,
- m_pExplicitIncrement->SubIncrements[0].IntervalCount ));
+ if( m_pExplicitIncrement && !m_pExplicitIncrement->SubIncrements.empty() )
+ {
+ rOutItemSet.Put( SfxInt32Item( nWhichId,
+ m_pExplicitIncrement->SubIncrements[0].IntervalCount ));
+ }
}
}
- }
- break;
+ break;
+
+ case SCHATTR_AXIS_AUTO_TIME_RESOLUTION:
+ {
+ rOutItemSet.Put( SfxBoolItem( nWhichId,
+ !rTimeIncrement.TimeResolution.hasValue() ));
+ }
+ break;
+ case SCHATTR_AXIS_TIME_RESOLUTION:
+ {
+ long nTimeResolution=0;
+ if( rTimeIncrement.TimeResolution >>= nTimeResolution )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, nTimeResolution ) );
+ else if( m_pExplicitScale )
+ rOutItemSet.Put( SfxInt32Item( nWhichId, m_pExplicitScale->TimeResolution ) );
+ }
+ break;
case SCHATTR_AXIS_AUTO_ORIGIN:
{
- // if the any has no double value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, ( !hasDoubleValue(aScale.Origin) )));
+ rOutItemSet.Put( SfxBoolItem( nWhichId, ( !hasDoubleValue(rScale.Origin) )));
}
break;
case SCHATTR_AXIS_ORIGIN:
{
double fOrigin = 0.0;
- if( !(aScale.Origin >>= fOrigin) )
+ if( !(rScale.Origin >>= fOrigin) )
{
if( m_pExplicitScale )
fOrigin = m_pExplicitScale->Origin;
@@ -391,12 +440,45 @@ void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemS
break;
case SCHATTR_AXISTYPE:
- rOutItemSet.Put( SfxInt32Item( nWhichId, aScale.AxisType ));
+ rOutItemSet.Put( SfxInt32Item( nWhichId, rScale.AxisType ));
+ break;
+
+ case SCHATTR_AXIS_AUTO_DATEAXIS:
+ rOutItemSet.Put( SfxBoolItem( nWhichId, rScale.AutoDateAxis ));
+ break;
+
+ case SCHATTR_AXIS_ALLOW_DATEAXIS:
+ {
+ Reference< chart2::XCoordinateSystem > xCooSys(
+ AxisHelper::getCoordinateSystemOfAxis( m_xAxis, ChartModelHelper::findDiagram( m_xChartDoc ) ) );
+ sal_Int32 nDimensionIndex=0; sal_Int32 nAxisIndex=0;
+ AxisHelper::getIndicesForAxis(m_xAxis, xCooSys, nDimensionIndex, nAxisIndex );
+ bool bChartTypeAllowsDateAxis = ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( xCooSys, 0 ), 2, nDimensionIndex );
+ rOutItemSet.Put( SfxBoolItem( nWhichId, bChartTypeAllowsDateAxis ));
+ }
break;
}
}
-bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+bool lcl_isDateAxis( const SfxItemSet & rItemSet )
+{
+ sal_Int32 nAxisType = static_cast< const SfxInt32Item & >( rItemSet.Get( SCHATTR_AXISTYPE )).GetValue();//::com::sun::star::chart2::AxisType
+ return (chart2::AxisType::DATE == nAxisType);
+}
+
+bool lcl_isAutoMajor( const SfxItemSet & rItemSet )
+{
+ bool bRet = static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_MAIN )).GetValue();
+ return bRet;
+}
+
+bool lcl_isAutoMinor( const SfxItemSet & rItemSet )
+{
+ bool bRet = static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_HELP )).GetValue();
+ return bRet;
+}
+
+bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
if( !m_xAxis.is() )
@@ -502,23 +584,47 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI
// Increment
case SCHATTR_AXIS_AUTO_STEP_MAIN:
- if( (static_cast< const SfxBoolItem & >(
- rItemSet.Get( nWhichId )).GetValue() ))
+ if( lcl_isAutoMajor(rItemSet) )
{
aScale.IncrementData.Distance.clear();
+ aScale.TimeIncrement.MajorTimeInterval.clear();
bSetScale = true;
}
// else SCHATTR_AXIS_STEP_MAIN must have some value
break;
+ case SCHATTR_AXIS_MAIN_TIME_UNIT:
+ if( !lcl_isAutoMajor(rItemSet) )
+ {
+ if( rItemSet.Get( nWhichId ).QueryValue( aValue ) )
+ {
+ TimeInterval aTimeInterval;
+ aScale.TimeIncrement.MajorTimeInterval >>= aTimeInterval;
+ aValue >>= aTimeInterval.TimeUnit;
+ aScale.TimeIncrement.MajorTimeInterval = uno::makeAny( aTimeInterval );
+ bSetScale = true;
+ }
+ }
+ break;
+
case SCHATTR_AXIS_STEP_MAIN:
// only if auto if false
- if( ! (static_cast< const SfxBoolItem & >(
- rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_MAIN )).GetValue() ))
+ if( !lcl_isAutoMajor(rItemSet) )
{
rItemSet.Get( nWhichId ).QueryValue( aValue );
-
- if( aScale.IncrementData.Distance != aValue )
+ if( lcl_isDateAxis(rItemSet) )
+ {
+ double fValue = 1.0;
+ if( aValue >>= fValue )
+ {
+ TimeInterval aTimeInterval;
+ aScale.TimeIncrement.MajorTimeInterval >>= aTimeInterval;
+ aTimeInterval.Number = static_cast<double>(fValue);
+ aScale.TimeIncrement.MajorTimeInterval = uno::makeAny( aTimeInterval );
+ bSetScale = true;
+ }
+ }
+ else if( aScale.IncrementData.Distance != aValue )
{
aScale.IncrementData.Distance = aValue;
bSetScale = true;
@@ -528,35 +634,85 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI
// SubIncrement
case SCHATTR_AXIS_AUTO_STEP_HELP:
- if( (static_cast< const SfxBoolItem & >(
- rItemSet.Get( nWhichId )).GetValue() ) &&
- aScale.IncrementData.SubIncrements.getLength() > 0 &&
- aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() )
+ if( lcl_isAutoMinor(rItemSet) )
{
- aScale.IncrementData.SubIncrements[0].IntervalCount.clear();
+ if( aScale.IncrementData.SubIncrements.getLength() > 0 &&
+ aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() )
+ {
+ aScale.IncrementData.SubIncrements[0].IntervalCount.clear();
+ bSetScale = true;
+ }
+ if( aScale.TimeIncrement.MinorTimeInterval.hasValue() )
+ {
+ aScale.TimeIncrement.MinorTimeInterval.clear();
bSetScale = true;
+ }
}
// else SCHATTR_AXIS_STEP_MAIN must have some value
break;
+ case SCHATTR_AXIS_HELP_TIME_UNIT:
+ if( !lcl_isAutoMinor(rItemSet) )
+ {
+ if( rItemSet.Get( nWhichId ).QueryValue( aValue ) )
+ {
+ TimeInterval aTimeInterval;
+ aScale.TimeIncrement.MinorTimeInterval >>= aTimeInterval;
+ aValue >>= aTimeInterval.TimeUnit;
+ aScale.TimeIncrement.MinorTimeInterval = uno::makeAny( aTimeInterval );
+ bSetScale = true;
+ }
+ }
+ break;
+
case SCHATTR_AXIS_STEP_HELP:
- // only if auto if false
- if( ! (static_cast< const SfxBoolItem & >(
- rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_HELP )).GetValue() ) &&
- aScale.IncrementData.SubIncrements.getLength() > 0 )
+ // only if auto is false
+ if( !lcl_isAutoMinor(rItemSet) )
+ {
+ rItemSet.Get( nWhichId ).QueryValue( aValue );
+ if( lcl_isDateAxis(rItemSet) )
+ {
+ TimeInterval aTimeInterval;
+ aScale.TimeIncrement.MinorTimeInterval >>= aTimeInterval;
+ aValue >>= aTimeInterval.Number;
+ aScale.TimeIncrement.MinorTimeInterval = uno::makeAny(aTimeInterval);
+ bSetScale = true;
+ }
+ else if( aScale.IncrementData.SubIncrements.getLength() > 0 )
+ {
+ if( ! aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() ||
+ aScale.IncrementData.SubIncrements[0].IntervalCount != aValue )
+ {
+ OSL_ASSERT( aValue.getValueTypeClass() == uno::TypeClass_LONG );
+ aScale.IncrementData.SubIncrements[0].IntervalCount = aValue;
+ bSetScale = true;
+ }
+ }
+ }
+ break;
+
+ case SCHATTR_AXIS_AUTO_TIME_RESOLUTION:
+ if( (static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue() ))
+ {
+ aScale.TimeIncrement.TimeResolution.clear();
+ bSetScale = true;
+ }
+ break;
+ case SCHATTR_AXIS_TIME_RESOLUTION:
+ // only if auto is false
+ if( ! (static_cast< const SfxBoolItem & >( rItemSet.Get( SCHATTR_AXIS_AUTO_TIME_RESOLUTION )).GetValue() ))
{
rItemSet.Get( nWhichId ).QueryValue( aValue );
- if( ! aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() ||
- aScale.IncrementData.SubIncrements[0].IntervalCount != aValue )
+ if( aScale.TimeIncrement.TimeResolution != aValue )
{
- OSL_ASSERT( aValue.getValueTypeClass() == uno::TypeClass_LONG );
- aScale.IncrementData.SubIncrements[0].IntervalCount = aValue;
+ aScale.TimeIncrement.TimeResolution = aValue;
bSetScale = true;
}
}
break;
+
case SCHATTR_AXIS_AUTO_ORIGIN:
{
if( (static_cast< const SfxBoolItem & >(
@@ -820,7 +976,23 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI
break;
case SCHATTR_AXISTYPE:
- //don't allow to change the axis type so far
+ {
+ sal_Int32 nNewAxisType = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();//::com::sun::star::chart2::AxisType
+ aScale.AxisType = nNewAxisType;
+ bSetScale = true;
+ }
+ break;
+
+ case SCHATTR_AXIS_AUTO_DATEAXIS:
+ {
+ bool bNewValue = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue();
+ bool bOldValue = aScale.AutoDateAxis;
+ if( bOldValue != bNewValue )
+ {
+ aScale.AutoDateAxis = bNewValue;
+ bSetScale = true;
+ }
+ }
break;
}
diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
index 3993a98a90ae..d047a6ac03b6 100644
--- a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
@@ -103,7 +103,7 @@ CharacterPropertyItemConverter::CharacterPropertyItemConverter(
CharacterPropertyItemConverter::~CharacterPropertyItemConverter()
{}
-const USHORT * CharacterPropertyItemConverter::GetWhichPairs() const
+const sal_uInt16 * CharacterPropertyItemConverter::GetWhichPairs() const
{
return nCharacterPropertyWhichPairs;
}
@@ -121,7 +121,7 @@ bool CharacterPropertyItemConverter::GetItemProperty( tWhichIdType nWhichId, tPr
}
void CharacterPropertyItemConverter::FillSpecialItem(
- USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
switch( nWhichId )
@@ -289,7 +289,7 @@ void CharacterPropertyItemConverter::FillSpecialItem(
}
bool CharacterPropertyItemConverter::ApplySpecialItem(
- USHORT nWhichId, const SfxItemSet & rItemSet )
+ sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
bool bChanged = false;
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 4359efa95909..e399e4ba82b1 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -108,13 +108,13 @@ sal_Int32 lcl_getSymbolStyleForSymbol( const chart2::Symbol & rSymbol )
return nStyle;
}
-bool lcl_NumberFormatFromItemToPropertySet( USHORT nWhichId, const SfxItemSet & rItemSet, const uno::Reference< beans::XPropertySet > & xPropertySet, bool bOverwriteAttributedDataPointsAlso )
+bool lcl_NumberFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSet & rItemSet, const uno::Reference< beans::XPropertySet > & xPropertySet, bool bOverwriteAttributedDataPointsAlso )
{
bool bChanged = false;
if( !xPropertySet.is() )
return bChanged;
rtl::OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? C2U( "NumberFormat" ) : C2U( "PercentageNumberFormat" );
- USHORT nSourceWhich = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE;
+ sal_uInt16 nSourceWhich = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE;
if( SFX_ITEM_SET != rItemSet.GetItemState( nSourceWhich ) )
return bChanged;
@@ -155,13 +155,13 @@ bool lcl_NumberFormatFromItemToPropertySet( USHORT nWhichId, const SfxItemSet &
return bChanged;
}
-bool lcl_UseSourceFormatFromItemToPropertySet( USHORT nWhichId, const SfxItemSet & rItemSet, const uno::Reference< beans::XPropertySet > & xPropertySet, bool bOverwriteAttributedDataPointsAlso )
+bool lcl_UseSourceFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSet & rItemSet, const uno::Reference< beans::XPropertySet > & xPropertySet, bool bOverwriteAttributedDataPointsAlso )
{
bool bChanged = false;
if( !xPropertySet.is() )
return bChanged;
rtl::OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? C2U( "NumberFormat" ) : C2U( "PercentageNumberFormat" );
- USHORT nFormatWhich = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE;
+ sal_uInt16 nFormatWhich = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE;
if( SFX_ITEM_SET != rItemSet.GetItemState( nWhichId ) )
return bChanged;
@@ -291,7 +291,7 @@ bool DataPointItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
}
-const USHORT * DataPointItemConverter::GetWhichPairs() const
+const sal_uInt16 * DataPointItemConverter::GetWhichPairs() const
{
// must span all used items!
if( m_bDataSeries )
@@ -313,7 +313,7 @@ bool DataPointItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNa
bool DataPointItemConverter::ApplySpecialItem(
- USHORT nWhichId, const SfxItemSet & rItemSet )
+ sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
bool bChanged = false;
@@ -545,7 +545,7 @@ bool DataPointItemConverter::ApplySpecialItem(
}
void DataPointItemConverter::FillSpecialItem(
- USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
switch( nWhichId )
@@ -643,7 +643,7 @@ void DataPointItemConverter::FillSpecialItem(
{
SvULongs aList;
for ( sal_Int32 nN=0; nN<m_aAvailableLabelPlacements.getLength(); nN++ )
- aList.Insert( m_aAvailableLabelPlacements[nN], sal::static_int_cast< USHORT >(nN) );
+ aList.Insert( m_aAvailableLabelPlacements[nN], sal::static_int_cast< sal_uInt16 >(nN) );
rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
}
break;
diff --git a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
index 072768c13658..59a24c238544 100644
--- a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
@@ -134,7 +134,7 @@ bool ErrorBarItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
}
-const USHORT * ErrorBarItemConverter::GetWhichPairs() const
+const sal_uInt16 * ErrorBarItemConverter::GetWhichPairs() const
{
// must span all used items!
return nErrorBarWhichPairs;
@@ -148,7 +148,7 @@ bool ErrorBarItemConverter::GetItemProperty(
}
bool ErrorBarItemConverter::ApplySpecialItem(
- USHORT nWhichId, const SfxItemSet & rItemSet )
+ sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
bool bChanged = false;
@@ -343,7 +343,7 @@ bool ErrorBarItemConverter::ApplySpecialItem(
}
void ErrorBarItemConverter::FillSpecialItem(
- USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
switch( nWhichId )
diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
index dd41bb4af525..b593f8d19f47 100644
--- a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
@@ -140,7 +140,7 @@ bool lcl_supportsLineProperties( ::chart::wrapper::GraphicPropertyItemConverter:
bool lcl_SetContentForNamedProperty(
const uno::Reference< lang::XMultiServiceFactory > & xFactory,
const ::rtl::OUString & rTableName,
- NameOrIndex & rItem, BYTE nMemberId )
+ NameOrIndex & rItem, sal_uInt8 nMemberId )
{
bool bResult = false;
if( xFactory.is())
@@ -184,9 +184,9 @@ GraphicPropertyItemConverter::GraphicPropertyItemConverter(
GraphicPropertyItemConverter::~GraphicPropertyItemConverter()
{}
-const USHORT * GraphicPropertyItemConverter::GetWhichPairs() const
+const sal_uInt16 * GraphicPropertyItemConverter::GetWhichPairs() const
{
- const USHORT * pResult = NULL;
+ const sal_uInt16 * pResult = NULL;
switch( m_eGraphicObjectType )
{
@@ -251,7 +251,7 @@ bool GraphicPropertyItemConverter::GetItemProperty( tWhichIdType nWhichId, tProp
}
void GraphicPropertyItemConverter::FillSpecialItem(
- USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
switch( nWhichId )
@@ -294,7 +294,7 @@ void GraphicPropertyItemConverter::FillSpecialItem(
if( (aValue >>= aName) &&
aName.getLength())
{
- aItem.SetEnabled( TRUE );
+ aItem.SetEnabled( sal_True );
rOutItemSet.Put( aItem );
}
}
@@ -453,7 +453,7 @@ void GraphicPropertyItemConverter::FillSpecialItem(
}
bool GraphicPropertyItemConverter::ApplySpecialItem(
- USHORT nWhichId, const SfxItemSet & rItemSet )
+ sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
bool bChanged = false;
diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
index 322061b61b06..57cf1143ecf9 100644
--- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
@@ -101,7 +101,7 @@ void ItemConverter::_disposing( const lang::EventObject& rSource )
void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
{
- const USHORT * pRanges = rOutItemSet.GetRanges();
+ const sal_uInt16 * pRanges = rOutItemSet.GetRanges();
tPropertyNameWithMemberId aProperty;
SfxItemPool & rPool = GetItemPool();
@@ -111,13 +111,13 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
while( (*pRanges) != 0)
{
- USHORT nBeg = (*pRanges);
+ sal_uInt16 nBeg = (*pRanges);
++pRanges;
- USHORT nEnd = (*pRanges);
+ sal_uInt16 nEnd = (*pRanges);
++pRanges;
OSL_ASSERT( nBeg <= nEnd );
- for( USHORT nWhich = nBeg; nWhich <= nEnd; ++nWhich )
+ for( sal_uInt16 nWhich = nBeg; nWhich <= nEnd; ++nWhich )
{
if( GetItemProperty( nWhich, aProperty ))
{
@@ -172,14 +172,14 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const
}
void ItemConverter::FillSpecialItem(
- USHORT /*nWhichId*/, SfxItemSet & /*rOutItemSet*/ ) const
+ sal_uInt16 /*nWhichId*/, SfxItemSet & /*rOutItemSet*/ ) const
throw( uno::Exception )
{
OSL_ENSURE( false, "ItemConverter: Unhandled special item found!" );
}
bool ItemConverter::ApplySpecialItem(
- USHORT /*nWhichId*/, const SfxItemSet & /*rItemSet*/ )
+ sal_uInt16 /*nWhichId*/, const SfxItemSet & /*rItemSet*/ )
throw( uno::Exception )
{
OSL_ENSURE( false, "ItemConverter: Unhandled special item found!" );
@@ -198,7 +198,7 @@ bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
while( pItem )
{
- if( rItemSet.GetItemState( pItem->Which(), FALSE ) == SFX_ITEM_SET )
+ if( rItemSet.GetItemState( pItem->Which(), sal_False ) == SFX_ITEM_SET )
{
if( GetItemProperty( pItem->Which(), aProperty ))
{
@@ -242,13 +242,13 @@ bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
void ItemConverter::InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItemSet &rSourceSet )
{
SfxWhichIter aIter (rSourceSet);
- USHORT nWhich = aIter.FirstWhich ();
+ sal_uInt16 nWhich = aIter.FirstWhich ();
const SfxPoolItem *pPoolItem = NULL;
while (nWhich)
{
- if ((rSourceSet.GetItemState(nWhich, TRUE, &pPoolItem) == SFX_ITEM_SET) &&
- (rDestSet.GetItemState(nWhich, TRUE, &pPoolItem) == SFX_ITEM_SET))
+ if ((rSourceSet.GetItemState(nWhich, sal_True, &pPoolItem) == SFX_ITEM_SET) &&
+ (rDestSet.GetItemState(nWhich, sal_True, &pPoolItem) == SFX_ITEM_SET))
{
if (rSourceSet.Get(nWhich) != rDestSet.Get(nWhich))
{
@@ -258,7 +258,7 @@ void ItemConverter::InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItem
}
}
}
- else if( rSourceSet.GetItemState(nWhich, TRUE, &pPoolItem) == SFX_ITEM_DONTCARE )
+ else if( rSourceSet.GetItemState(nWhich, sal_True, &pPoolItem) == SFX_ITEM_DONTCARE )
rDestSet.InvalidateItem(nWhich);
nWhich = aIter.NextWhich ();
diff --git a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
index d17feda59b48..75f2254c2218 100644
--- a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
@@ -34,10 +34,12 @@
#include "ItemPropertyMap.hxx"
#include "GraphicPropertyItemConverter.hxx"
#include "CharacterPropertyItemConverter.hxx"
-#include <svx/chrtitem.hxx>
#include <com/sun/star/chart2/XLegend.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
+
+#include <svl/intitem.hxx>
+#include <svl/eitem.hxx>
#include <functional>
#include <algorithm>
@@ -92,7 +94,7 @@ bool LegendItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
}
-const USHORT * LegendItemConverter::GetWhichPairs() const
+const sal_uInt16 * LegendItemConverter::GetWhichPairs() const
{
// must span all used items!
return nLegendWhichPairs;
@@ -105,52 +107,19 @@ bool LegendItemConverter::GetItemProperty( tWhichIdType /*nWhichId*/, tPropertyN
}
-bool LegendItemConverter::ApplySpecialItem(
- USHORT nWhichId, const SfxItemSet & rItemSet )
+bool LegendItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet& rInItemSet )
throw( uno::Exception )
{
bool bChanged = false;
switch( nWhichId )
{
- case SCHATTR_LEGEND_POS:
+ case SCHATTR_LEGEND_SHOW:
{
- chart2::LegendPosition eNewPos = chart2::LegendPosition_LINE_END;
- chart2::LegendPosition eOldPos;
- bool bIsWide = false;
- sal_Bool bShow = sal_True;
-
- SvxChartLegendPos eItemPos =
- static_cast< const SvxChartLegendPosItem & >(
- rItemSet.Get( nWhichId )).GetValue();
- switch( eItemPos )
- {
- case CHLEGEND_LEFT:
- eNewPos = chart2::LegendPosition_LINE_START;
- break;
- case CHLEGEND_RIGHT:
- eNewPos = chart2::LegendPosition_LINE_END;
- break;
- case CHLEGEND_TOP:
- eNewPos = chart2::LegendPosition_PAGE_START;
- bIsWide = true;
- break;
- case CHLEGEND_BOTTOM:
- eNewPos = chart2::LegendPosition_PAGE_END;
- bIsWide = true;
- break;
-
- case CHLEGEND_NONE:
- case CHLEGEND_NONE_LEFT:
- case CHLEGEND_NONE_RIGHT:
- case CHLEGEND_NONE_TOP:
- case CHLEGEND_NONE_BOTTOM:
- bShow = sal_False;
- break;
- }
-
- try
+ const SfxPoolItem* pPoolItem = NULL;
+ if( rInItemSet.GetItemState( SCHATTR_LEGEND_SHOW, sal_True, &pPoolItem ) == SFX_ITEM_SET )
{
+ sal_Bool bShow = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue();
sal_Bool bWasShown = sal_True;
if( ! (GetPropertySet()->getPropertyValue( C2U("Show")) >>= bWasShown) ||
( bWasShown != bShow ))
@@ -158,25 +127,48 @@ bool LegendItemConverter::ApplySpecialItem(
GetPropertySet()->setPropertyValue( C2U("Show"), uno::makeAny( bShow ));
bChanged = true;
}
+ }
+
+ }
+ break;
+ case SCHATTR_LEGEND_POS:
+ {
+ const SfxPoolItem* pPoolItem = NULL;
+ if( rInItemSet.GetItemState( SCHATTR_LEGEND_POS, sal_True, &pPoolItem ) == SFX_ITEM_SET )
+ {
+ chart2::LegendPosition eNewPos = static_cast<chart2::LegendPosition>(((const SfxInt32Item*)pPoolItem)->GetValue());
- if( bShow )
+ ::com::sun::star::chart::ChartLegendExpansion eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
+ switch( eNewPos )
{
+ case chart2::LegendPosition_LINE_START:
+ case chart2::LegendPosition_LINE_END:
+ eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
+ break;
+ case chart2::LegendPosition_PAGE_START:
+ case chart2::LegendPosition_PAGE_END:
+ eExpansion = ::com::sun::star::chart::ChartLegendExpansion_WIDE;
+ break;
+ default:
+ break;
+ }
+
+ try
+ {
+ chart2::LegendPosition eOldPos;
if( ! ( GetPropertySet()->getPropertyValue( C2U( "AnchorPosition" )) >>= eOldPos ) ||
( eOldPos != eNewPos ))
{
GetPropertySet()->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny( eNewPos ));
- chart2::LegendExpansion eExp = bIsWide
- ? chart2::LegendExpansion_WIDE
- : chart2::LegendExpansion_HIGH;
- GetPropertySet()->setPropertyValue( C2U( "Expansion" ), uno::makeAny( eExp ));
+ GetPropertySet()->setPropertyValue( C2U( "Expansion" ), uno::makeAny( eExpansion ));
GetPropertySet()->setPropertyValue( C2U( "RelativePosition" ), uno::Any());
bChanged = true;
}
}
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
}
}
break;
@@ -186,48 +178,23 @@ bool LegendItemConverter::ApplySpecialItem(
}
void LegendItemConverter::FillSpecialItem(
- USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
switch( nWhichId )
{
- case SCHATTR_LEGEND_POS:
+ case SCHATTR_LEGEND_SHOW:
{
- SvxChartLegendPos eItemPos( CHLEGEND_RIGHT );
- chart2::LegendPosition ePos;
-
sal_Bool bShow = sal_True;
GetPropertySet()->getPropertyValue( C2U( "Show" )) >>= bShow;
-
- if( ! bShow )
- {
- eItemPos = CHLEGEND_NONE;
- }
- else if( GetPropertySet()->getPropertyValue( C2U( "AnchorPosition" )) >>= ePos )
- {
- switch( ePos )
- {
- case chart2::LegendPosition_LINE_START:
- eItemPos = CHLEGEND_LEFT;
- break;
- case chart2::LegendPosition_LINE_END:
- eItemPos = CHLEGEND_RIGHT;
- break;
- case chart2::LegendPosition_PAGE_START:
- eItemPos = CHLEGEND_TOP;
- break;
- case chart2::LegendPosition_PAGE_END:
- eItemPos = CHLEGEND_BOTTOM;
- break;
-
- case chart2::LegendPosition_CUSTOM:
- default:
- eItemPos = CHLEGEND_RIGHT;
- break;
- }
- }
-
- rOutItemSet.Put( SvxChartLegendPosItem( eItemPos, SCHATTR_LEGEND_POS ) );
+ rOutItemSet.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, bShow) );
+ }
+ break;
+ case SCHATTR_LEGEND_POS:
+ {
+ chart2::LegendPosition eLegendPos( chart2::LegendPosition_LINE_END );
+ GetPropertySet()->getPropertyValue( C2U( "AnchorPosition" )) >>= eLegendPos;
+ rOutItemSet.Put( SfxInt32Item(SCHATTR_LEGEND_POS, eLegendPos ) );
}
break;
}
diff --git a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
index 9ba75dbbe6ea..46d5269793de 100644
--- a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
+++ b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
@@ -84,7 +84,7 @@ AllAxisItemConverter::~AllAxisItemConverter()
{
}
-const USHORT * AllAxisItemConverter::GetWhichPairs() const
+const sal_uInt16 * AllAxisItemConverter::GetWhichPairs() const
{
// must span all used items!
return nAllAxisWhichPairs;
@@ -114,7 +114,7 @@ AllGridItemConverter::~AllGridItemConverter()
{
}
-const USHORT * AllGridItemConverter::GetWhichPairs() const
+const sal_uInt16 * AllGridItemConverter::GetWhichPairs() const
{
// must span all used items!
return nGridWhichPairs;
@@ -162,7 +162,7 @@ AllDataLabelItemConverter::~AllDataLabelItemConverter()
{
}
-const USHORT * AllDataLabelItemConverter::GetWhichPairs() const
+const sal_uInt16 * AllDataLabelItemConverter::GetWhichPairs() const
{
// must span all used items!
return nDataLabelWhichPairs;
@@ -196,7 +196,7 @@ AllTitleItemConverter::~AllTitleItemConverter()
{
}
-const USHORT * AllTitleItemConverter::GetWhichPairs() const
+const sal_uInt16 * AllTitleItemConverter::GetWhichPairs() const
{
// must span all used items!
return nTitleWhichPairs;
@@ -224,7 +224,7 @@ AllSeriesStatisticsConverter::AllSeriesStatisticsConverter(
AllSeriesStatisticsConverter::~AllSeriesStatisticsConverter()
{}
-const USHORT * AllSeriesStatisticsConverter::GetWhichPairs() const
+const sal_uInt16 * AllSeriesStatisticsConverter::GetWhichPairs() const
{
// must span all used items!
return nStatWhichPairs;
diff --git a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
index 672bf52ab652..e517fdd82702 100644
--- a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx
@@ -112,7 +112,7 @@ bool RegressionCurveItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
}
-const USHORT * RegressionCurveItemConverter::GetWhichPairs() const
+const sal_uInt16 * RegressionCurveItemConverter::GetWhichPairs() const
{
// must span all used items!
return nRegressionCurveWhichPairs;
@@ -127,7 +127,7 @@ bool RegressionCurveItemConverter::GetItemProperty(
bool RegressionCurveItemConverter::ApplySpecialItem(
- USHORT nWhichId, const SfxItemSet & rItemSet )
+ sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
uno::Reference< chart2::XRegressionCurve > xCurve( GetPropertySet(), uno::UNO_QUERY );
@@ -172,7 +172,7 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
OSL_ASSERT( xCurve.is());
if( xCurve.is())
{
- bool bNewShow = static_cast< BOOL >(
+ bool bNewShow = static_cast< sal_Bool >(
static_cast< const SfxBoolItem & >(
rItemSet.Get( nWhichId )).GetValue());
@@ -195,7 +195,7 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
OSL_ASSERT( xCurve.is());
if( xCurve.is())
{
- bool bNewShow = static_cast< BOOL >(
+ bool bNewShow = static_cast< sal_Bool >(
static_cast< const SfxBoolItem & >(
rItemSet.Get( nWhichId )).GetValue());
@@ -218,7 +218,7 @@ bool RegressionCurveItemConverter::ApplySpecialItem(
}
void RegressionCurveItemConverter::FillSpecialItem(
- USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
uno::Reference< chart2::XRegressionCurve > xCurve( GetPropertySet(), uno::UNO_QUERY );
diff --git a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
index e4e95884461c..0244bc6cba92 100644
--- a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
@@ -105,7 +105,7 @@ bool RegressionEquationItemConverter::ApplyItemSet( const SfxItemSet & rItemSet
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
}
-const USHORT * RegressionEquationItemConverter::GetWhichPairs() const
+const sal_uInt16 * RegressionEquationItemConverter::GetWhichPairs() const
{
// must span all used items!
return nRegEquationWhichPairs;
@@ -124,7 +124,7 @@ bool RegressionEquationItemConverter::GetItemProperty( tWhichIdType nWhichId, tP
}
bool RegressionEquationItemConverter::ApplySpecialItem(
- USHORT nWhichId, const SfxItemSet & rItemSet )
+ sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
bool bChanged = false;
@@ -149,7 +149,7 @@ bool RegressionEquationItemConverter::ApplySpecialItem(
}
void RegressionEquationItemConverter::FillSpecialItem(
- USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
switch( nWhichId )
diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
index 596c495b8635..7a842dfe2174 100644
--- a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
+++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
@@ -42,10 +42,9 @@ namespace
EE_ITEMS_START, EE_ITEMS_END, \
SID_CHAR_DLG_PREVIEW_STRING, SID_CHAR_DLG_PREVIEW_STRING
-const USHORT nTitleWhichPairs[] =
+const sal_uInt16 nTitleWhichPairs[] =
{
- SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx
- SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx
+ SCHATTR_TEXT_START, SCHATTR_TEXT_END,
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
@@ -53,40 +52,33 @@ const USHORT nTitleWhichPairs[] =
0
};
-const USHORT nAxisWhichPairs[] =
+const sal_uInt16 nAxisWhichPairs[] =
{
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
CHARACTER_WHICHPAIRS,
SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE, // 10585 - 10585 svx/svxids.hrc
SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, // 11432 svx/svxids.hrc
- SCHATTR_AXISTYPE, SCHATTR_AXISTYPE, // 39 sch/schattr.hxx
- SCHATTR_TEXT_START, SCHATTR_TEXT_END, // 4 - 6 sch/schattr.hxx
- SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx
- SCHATTR_TEXT_OVERLAP, SCHATTR_TEXT_OVERLAP, // 54 sch/schattr.hxx
- SCHATTR_AXIS_START, SCHATTR_AXIS_END, // 70 - 95 sch/schattr.hxx
- SCHATTR_TEXTBREAK, SCHATTR_TEXTBREAK, // 30587 sch/schattr.hxx
+ SCHATTR_AXIS_START, SCHATTR_AXIS_END,
+ SCHATTR_TEXT_START, SCHATTR_TEXT_END,
0
};
-const USHORT nAllAxisWhichPairs[] =
+const sal_uInt16 nAllAxisWhichPairs[] =
{
- XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
+ XATTR_LINE_FIRST, XATTR_LINE_LAST,
CHARACTER_WHICHPAIRS,
- SCHATTR_TEXT_START, SCHATTR_TEXT_END, // 4 - 6 sch/schattr.hxx
- SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx
- SCHATTR_TEXT_OVERLAP, SCHATTR_TEXT_OVERLAP, // 54 sch/schattr.hxx
- SCHATTR_AXIS_SHOWDESCR, SCHATTR_AXIS_SHOWDESCR, // 85 sch/schattr.hxx
- SCHATTR_TEXTBREAK, SCHATTR_TEXTBREAK, // 30587 sch/schattr.hxx
+ SCHATTR_AXIS_LABEL_START, SCHATTR_AXIS_LABEL_END,
+ SCHATTR_TEXT_START, SCHATTR_TEXT_END,
0
};
-const USHORT nGridWhichPairs[] =
+const sal_uInt16 nGridWhichPairs[] =
{
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
0
};
-const USHORT nLegendWhichPairs[] =
+const sal_uInt16 nLegendWhichPairs[] =
{
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx
@@ -96,13 +88,11 @@ const USHORT nLegendWhichPairs[] =
0
};
-const USHORT nDataLabelWhichPairs[] =
+const sal_uInt16 nDataLabelWhichPairs[] =
{
SCHATTR_DATADESCR_START, SCHATTR_DATADESCR_END,
SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO, /* 10585 - 10585 svx/svxids.hrc */ \
SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, /* 11432 svx/svxids.hrc */ \
- SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, /* 40 sch/schattr.hxx*/ \
- SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, /* 41 sch/schattr.hxx*/ \
SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES,
EE_PARA_WRITINGDIR,EE_PARA_WRITINGDIR,
0
@@ -116,15 +106,13 @@ const USHORT nDataLabelWhichPairs[] =
SCHATTR_DATADESCR_START, SCHATTR_DATADESCR_END, /* 1 - 2 sch/schattr.hxx*/ \
SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO, /* 10585 - 10585 svx/svxids.hrc */ \
SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, /* 11432 svx/svxids.hrc */ \
- SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, /* 40 sch/schattr.hxx*/ \
- SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, /* 41 sch/schattr.hxx*/ \
SCHATTR_TEXT_DEGREES, SCHATTR_TEXT_DEGREES, \
SCHATTR_STYLE_START,SCHATTR_STYLE_END, /* 59 - 68 sch/schattr.hxx*/ \
SCHATTR_SYMBOL_BRUSH,SCHATTR_SYMBOL_BRUSH, /* 94 sch/schattr.hxx*/ \
SCHATTR_SYMBOL_SIZE,SCHATTR_SYMBOL_SIZE, /* 97 sch/schattr.hxx*/ \
SDRATTR_3D_FIRST, SDRATTR_3D_LAST /* 1244 - 1334 svx/svddef.hxx */
-const USHORT nDataPointWhichPairs[] =
+const sal_uInt16 nDataPointWhichPairs[] =
{
CHART_POINT_WHICHPAIRS,
0
@@ -140,20 +128,20 @@ const USHORT nDataPointWhichPairs[] =
SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, \
SCHATTR_INCLUDE_HIDDEN_CELLS,SCHATTR_INCLUDE_HIDDEN_CELLS
-const USHORT nSeriesOptionsWhichPairs[] =
+const sal_uInt16 nSeriesOptionsWhichPairs[] =
{
CHART_SERIES_OPTIONS_WHICHPAIRS,
0
};
-const USHORT nRowWhichPairs[] =
+const sal_uInt16 nRowWhichPairs[] =
{
CHART_POINT_WHICHPAIRS,
CHART_SERIES_OPTIONS_WHICHPAIRS,
0
};
-const USHORT nAreaWhichPairs[] =
+const sal_uInt16 nAreaWhichPairs[] =
{
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1000 - 1016 svx/xdef.hxx
@@ -161,30 +149,28 @@ const USHORT nAreaWhichPairs[] =
0
};
-const USHORT nTextWhichPairs[] =
+const sal_uInt16 nTextWhichPairs[] =
{
CHARACTER_WHICHPAIRS,
- SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx
- SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx
+ SCHATTR_TEXT_START, SCHATTR_TEXT_END,
0
};
-const USHORT nTextOrientWhichPairs[] =
+const sal_uInt16 nTextOrientWhichPairs[] =
{
CHARACTER_WHICHPAIRS,
- SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx
- SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx
+ SCHATTR_TEXT_START, SCHATTR_TEXT_END,
0
};
-const USHORT nStatWhichPairs[]=
+const sal_uInt16 nStatWhichPairs[]=
{
SCHATTR_STAT_START, SCHATTR_STAT_END, // 45 - 52 sch/schattr.hxx
SCHATTR_REGRESSION_START, SCHATTR_REGRESSION_END, // 108 - 109
0
};
-const USHORT nErrorBarWhichPairs[]=
+const sal_uInt16 nErrorBarWhichPairs[]=
{
SCHATTR_STAT_START, SCHATTR_STAT_END, // 45 - 52 sch/schattr.hxx
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
@@ -193,26 +179,26 @@ const USHORT nErrorBarWhichPairs[]=
// for CharacterProperties
-const USHORT nCharacterPropertyWhichPairs[] =
+const sal_uInt16 nCharacterPropertyWhichPairs[] =
{
CHARACTER_WHICHPAIRS,
0
};
-const USHORT nLinePropertyWhichPairs[] =
+const sal_uInt16 nLinePropertyWhichPairs[] =
{
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
0
};
-const USHORT nFillPropertyWhichPairs[] =
+const sal_uInt16 nFillPropertyWhichPairs[] =
{
XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1000 - 1016 svx/xdef.hxx
SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, // 1067 - 1078 svx/svddef.hxx
0
};
-const USHORT nLineAndFillPropertyWhichPairs[] =
+const sal_uInt16 nLineAndFillPropertyWhichPairs[] =
{
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1000 - 1016 svx/xdef.hxx
@@ -220,7 +206,7 @@ const USHORT nLineAndFillPropertyWhichPairs[] =
0
};
-const USHORT nChartStyleWhichPairs[] =
+const sal_uInt16 nChartStyleWhichPairs[] =
{
SCHATTR_DIAGRAM_STYLE, SCHATTR_DIAGRAM_STYLE,
SCHATTR_STYLE_SHAPE, SCHATTR_STYLE_SHAPE,
@@ -230,14 +216,14 @@ const USHORT nChartStyleWhichPairs[] =
0
};
-const USHORT nRegressionCurveWhichPairs[] =
+const sal_uInt16 nRegressionCurveWhichPairs[] =
{
SCHATTR_REGRESSION_START, SCHATTR_REGRESSION_END, // 108 - 109
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
0
};
-const USHORT nRegEquationWhichPairs[] =
+const sal_uInt16 nRegEquationWhichPairs[] =
{
XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx
XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index ce2bf41a7479..1782d9513caa 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -187,7 +187,7 @@ SeriesOptionsItemConverter::~SeriesOptionsItemConverter()
{
}
-const USHORT * SeriesOptionsItemConverter::GetWhichPairs() const
+const sal_uInt16 * SeriesOptionsItemConverter::GetWhichPairs() const
{
// must span all used items!
return nSeriesOptionsWhichPairs;
@@ -198,7 +198,7 @@ bool SeriesOptionsItemConverter::GetItemProperty( tWhichIdType /*nWhichId*/, tPr
return false;
}
-bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
+bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
bool bChanged = false;
@@ -373,7 +373,7 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte
}
void SeriesOptionsItemConverter::FillSpecialItem(
- USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
switch( nWhichId )
@@ -435,7 +435,7 @@ void SeriesOptionsItemConverter::FillSpecialItem(
{
SvULongs aList;
for ( sal_Int32 nN=0; nN<m_aSupportedMissingValueTreatments.getLength(); nN++ )
- aList.Insert( m_aSupportedMissingValueTreatments[nN], sal::static_int_cast< USHORT >(nN) );
+ aList.Insert( m_aSupportedMissingValueTreatments[nN], sal::static_int_cast< sal_uInt16 >(nN) );
rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
break;
}
diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
index 409b675e41b9..6b35080a5cb3 100644
--- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
@@ -154,7 +154,7 @@ uno::Reference< beans::XPropertySet > lcl_getEquationProperties(
{
SvxChartRegress eRegress = CHREGRESS_NONE;
const SfxPoolItem *pPoolItem = NULL;
- if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, TRUE, &pPoolItem ) == SFX_ITEM_SET )
+ if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, sal_True, &pPoolItem ) == SFX_ITEM_SET )
{
eRegress = static_cast< const SvxChartRegressItem * >( pPoolItem )->GetValue();
bEquationExists = ( eRegress != CHREGRESS_NONE );
@@ -204,7 +204,7 @@ StatisticsItemConverter::StatisticsItemConverter(
StatisticsItemConverter::~StatisticsItemConverter()
{}
-const USHORT * StatisticsItemConverter::GetWhichPairs() const
+const sal_uInt16 * StatisticsItemConverter::GetWhichPairs() const
{
// must span all used items!
return nStatWhichPairs;
@@ -218,7 +218,7 @@ bool StatisticsItemConverter::GetItemProperty(
}
bool StatisticsItemConverter::ApplySpecialItem(
- USHORT nWhichId, const SfxItemSet & rItemSet )
+ sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
bool bChanged = false;
@@ -522,7 +522,7 @@ bool StatisticsItemConverter::ApplySpecialItem(
}
void StatisticsItemConverter::FillSpecialItem(
- USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
switch( nWhichId )
diff --git a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx
index fffaa31a8590..2dd9d8730055 100644
--- a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx
@@ -76,7 +76,7 @@ public:
virtual ~FormattedStringsConverter();
protected:
- virtual const USHORT * GetWhichPairs() const;
+ virtual const sal_uInt16 * GetWhichPairs() const;
};
// ----------------------------------------
@@ -110,7 +110,7 @@ FormattedStringsConverter::~FormattedStringsConverter()
{
}
-const USHORT * FormattedStringsConverter::GetWhichPairs() const
+const sal_uInt16 * FormattedStringsConverter::GetWhichPairs() const
{
return nCharacterPropertyWhichPairs;
}
@@ -171,7 +171,7 @@ bool TitleItemConverter::ApplyItemSet( const SfxItemSet & rItemSet )
return ItemConverter::ApplyItemSet( rItemSet ) || bResult;
}
-const USHORT * TitleItemConverter::GetWhichPairs() const
+const sal_uInt16 * TitleItemConverter::GetWhichPairs() const
{
// must span all used items!
return nTitleWhichPairs;
@@ -191,7 +191,7 @@ bool TitleItemConverter::GetItemProperty( tWhichIdType nWhichId, tPropertyNameWi
bool TitleItemConverter::ApplySpecialItem(
- USHORT nWhichId, const SfxItemSet & rItemSet )
+ sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
throw( uno::Exception )
{
bool bChanged = false;
@@ -222,7 +222,7 @@ bool TitleItemConverter::ApplySpecialItem(
}
void TitleItemConverter::FillSpecialItem(
- USHORT nWhichId, SfxItemSet & rOutItemSet ) const
+ sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
throw( uno::Exception )
{
switch( nWhichId )
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 8c6e46057d9a..daba0c7f3b01 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -53,13 +53,12 @@
#include "AccessibleChartView.hxx"
#include "DrawCommandDispatch.hxx"
#include "ShapeController.hxx"
-#include "UndoManager.hxx"
+#include "UndoActions.hxx"
#include <comphelper/InlineContainer.hxx>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XUndoSupplier.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/frame/XLoadable.hpp>
#include <com/sun/star/util/XCloneable.hpp>
@@ -67,6 +66,8 @@
#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/document/XUndoManagerSupplier.hpp>
+#include <com/sun/star/document/XUndoAction.hpp>
//-------
// header for define RET_OK
@@ -86,6 +87,7 @@
// object in the DTOR
#include <svtools/acceleratorexecute.hxx>
#include <svx/ActionDescriptionProvider.hxx>
+#include <tools/diagnose_ex.h>
// enable the following define to let the controller listen to model changes and
// react on this by rebuilding the view
@@ -470,6 +472,7 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
if( rEvent.NewMode.equals(C2U("dirty")) )
{
//the view has become dirty, we should repaint it if we have a window
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
m_pChartWindow->ForceInvalidate();
}
@@ -512,8 +515,11 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
impl_initializeAccessible();
- if( m_pChartWindow )
- m_pChartWindow->Invalidate();
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( m_pChartWindow )
+ m_pChartWindow->Invalidate();
+ }
}
m_bConnectingToView = false;
@@ -531,14 +537,10 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
//is called to attach the controller to a new model.
//return true if attach was successfully, false otherwise (e.g. if you do not work with a model)
- {
- // FIXME: ths is suspicious: why just proctect the call to isDisposedOrSuspened
- // and not all the way until he new model is attached ?
- // seems racy to me
- SolarMutexGuard aGuard;
- if( impl_isDisposedOrSuspended() ) //@todo? allow attaching a new model while suspended?
- return sal_False; //behave passive if already disposed or suspended
- }
+ SolarMutexGuard aGuard;
+ if( impl_isDisposedOrSuspended() ) //@todo? allow attaching a new model while suspended?
+ return sal_False; //behave passive if already disposed or suspended
+ aClearableGuard.clear();
TheModelRef aNewModelRef( new TheModel( xModel), m_aModelMutex);
@@ -608,12 +610,14 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
}
//the frameloader is responsible to call xModel->connectController
- if( m_pChartWindow )
- m_pChartWindow->Invalidate();
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( m_pChartWindow )
+ m_pChartWindow->Invalidate();
+ }
- uno::Reference< chart2::XUndoSupplier > xUndoSupplier( getModel(), uno::UNO_QUERY );
- if( xUndoSupplier.is())
- m_xUndoManager.set( xUndoSupplier->getUndoManager());
+ uno::Reference< document::XUndoManagerSupplier > xSuppUndo( getModel(), uno::UNO_QUERY_THROW );
+ m_xUndoManager.set( xSuppUndo->getUndoManager(), uno::UNO_QUERY_THROW );
return sal_True;
}
@@ -1084,6 +1088,7 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
else if(aCommand.equals("Update")) //Update Chart
{
ChartViewHelper::setViewToDirtyState( getModel() );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
m_pChartWindow->Invalidate();
}
@@ -1286,7 +1291,7 @@ void SAL_CALL ChartController::executeDispatch_ChartType()
{
// using assignment for broken gcc 3.3
UndoLiveUpdateGuard aUndoGuard = UndoLiveUpdateGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_EDIT_CHARTTYPE ))), m_xUndoManager, getModel() );
+ String( SchResId( STR_ACTION_EDIT_CHARTTYPE )), m_xUndoManager );
SolarMutexGuard aSolarGuard;
//prepare and open dialog
@@ -1294,7 +1299,7 @@ void SAL_CALL ChartController::executeDispatch_ChartType()
if( aDlg.Execute() == RET_OK )
{
impl_adaptDataSeriesAutoResize();
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -1309,7 +1314,7 @@ void SAL_CALL ChartController::executeDispatch_SourceData()
// using assignment for broken gcc 3.3
UndoLiveUpdateGuard aUndoGuard = UndoLiveUpdateGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_EDIT_DATA_RANGES ))), m_xUndoManager, getModel() );
+ String( SchResId( STR_ACTION_EDIT_DATA_RANGES )), m_xUndoManager );
if( xChartDoc.is())
{
SolarMutexGuard aSolarGuard;
@@ -1317,7 +1322,7 @@ void SAL_CALL ChartController::executeDispatch_SourceData()
if( aDlg.Execute() == RET_OK )
{
impl_adaptDataSeriesAutoResize();
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
}
@@ -1334,14 +1339,14 @@ void SAL_CALL ChartController::executeDispatch_MoveSeries( sal_Bool bForward )
UndoGuardWithSelection aUndoGuard(
ActionDescriptionProvider::createDescription(
(bForward ? ActionDescriptionProvider::MOVE_TOTOP : ActionDescriptionProvider::MOVE_TOBOTTOM),
- ::rtl::OUString( String( SchResId( STR_OBJECT_DATASERIES )))),
- m_xUndoManager, getModel());
+ String( SchResId( STR_OBJECT_DATASERIES ))),
+ m_xUndoManager );
bool bChanged = DiagramHelper::moveSeries( ChartModelHelper::findDiagram( getModel() ), xGivenDataSeries, bForward );
if( bChanged )
{
m_aSelection.setSelection( ObjectIdentifier::getMovedSeriesCID( aObjectCID, bForward ) );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -1396,13 +1401,21 @@ void SAL_CALL ChartController::modified( const lang::EventObject& /* aEvent */ )
IMPL_LINK( ChartController, NotifyUndoActionHdl, SdrUndoAction*, pUndoAction )
{
+ ENSURE_OR_RETURN( pUndoAction, "invalid Undo action", 1L );
+
::rtl::OUString aObjectCID = m_aSelection.getSelectedCID();
if ( aObjectCID.getLength() == 0 )
{
- UndoManager* pUndoManager = UndoManager::getImplementation( m_xUndoManager );
- if ( pUndoManager )
+ try
+ {
+ const Reference< document::XUndoManagerSupplier > xSuppUndo( getModel(), uno::UNO_QUERY_THROW );
+ const Reference< document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), uno::UNO_QUERY_THROW );
+ const Reference< document::XUndoAction > xAction( new impl::ShapeUndoElement( *pUndoAction ) );
+ xUndoManager->addUndoAction( xAction );
+ }
+ catch( const uno::Exception& )
{
- pUndoManager->addShapeUndoAction( pUndoAction );
+ DBG_UNHANDLED_EXCEPTION();
}
}
return 0L;
@@ -1441,6 +1454,7 @@ uno::Reference< XAccessible > ChartController::CreateAccessible()
void ChartController::impl_invalidateAccessible()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
{
Reference< lang::XInitialization > xInit( m_pChartWindow->GetAccessible(false), uno::UNO_QUERY );
@@ -1453,6 +1467,7 @@ void ChartController::impl_invalidateAccessible()
}
void ChartController::impl_initializeAccessible()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
this->impl_initializeAccessible( Reference< lang::XInitialization >( m_pChartWindow->GetAccessible(false), uno::UNO_QUERY ) );
}
@@ -1467,11 +1482,14 @@ void ChartController::impl_initializeAccessible( const uno::Reference< lang::XIn
aArguments[1]=uno::makeAny(xModel);
aArguments[2]=uno::makeAny(m_xChartView);
uno::Reference< XAccessible > xParent;
- if( m_pChartWindow )
{
- Window* pParentWin( m_pChartWindow->GetAccessibleParentWindow());
- if( pParentWin )
- xParent.set( pParentWin->GetAccessible());
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( m_pChartWindow )
+ {
+ Window* pParentWin( m_pChartWindow->GetAccessibleParentWindow());
+ if( pParentWin )
+ xParent.set( pParentWin->GetAccessible());
+ }
}
aArguments[3]=uno::makeAny(xParent);
aArguments[4]=uno::makeAny(m_xViewWindow);
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index 8ddc44ddb592..829fbe50918d 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -43,7 +43,7 @@
#include <cppuhelper/implbase12.hxx>
#include <com/sun/star/accessibility/XAccessible.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
+#include <com/sun/star/document/XUndoManager.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
@@ -90,6 +90,8 @@ namespace chart
{
//.............................................................................
+class UndoGuard;
+
enum ChartDrawMode { CHARTDRAW_INSERT, CHARTDRAW_SELECT };
class WindowController
@@ -125,7 +127,7 @@ public:
@param rOutEqualRect is filled with a rectangle that denotes the region
in which the quick help does not change.
- @return </TRUE>, if a quick help should be shown.
+ @return </sal_True>, if a quick help should be shown.
*/
virtual bool requestQuickHelp(
::Point aAtLogicPosition, bool bIsBalloonHelp,
@@ -579,7 +581,8 @@ private:
bool volatile m_bConnectingToView;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > m_xUndoManager;
+ ::std::auto_ptr< UndoGuard > m_pTextActionUndoGuard;
/// needed for dispatching URLs in FeatureStateEvents
mutable ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
@@ -701,7 +704,7 @@ private:
MOVE_OBJECT,
CENTERED_RESIZE_OBJECT
};
- /// @return </TRUE>, if resize/move was successful
+ /// @return </sal_True>, if resize/move was successful
bool impl_moveOrResizeObject(
const ::rtl::OUString & rCID, eMoveOrResizeType eType, double fAmountLogicX, double fAmountLogicY );
bool impl_DragDataPoint( const ::rtl::OUString & rCID, double fOffset );
diff --git a/chart2/source/controller/main/ChartController_EditData.cxx b/chart2/source/controller/main/ChartController_EditData.cxx
index 4f1cc58bb06b..666ef87eb881 100644
--- a/chart2/source/controller/main/ChartController_EditData.cxx
+++ b/chart2/source/controller/main/ChartController_EditData.cxx
@@ -66,12 +66,12 @@ void ChartController::executeDispatch_EditData()
SolarMutexGuard aSolarGuard;
// using assignment for broken gcc 3.3
UndoLiveUpdateGuardWithData aUndoGuard = UndoLiveUpdateGuardWithData(
- ::rtl::OUString( String( SchResId( STR_ACTION_EDIT_CHART_DATA ))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_ACTION_EDIT_CHART_DATA )),
+ m_xUndoManager );
DataEditor aDataEditorDialog( pParent, xChartDoc, m_xCC );
// the dialog has no OK/Cancel
aDataEditorDialog.Execute();
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
}
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 50d5d6b7fda6..238009d9a8d3 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -45,7 +45,7 @@
#include "DiagramHelper.hxx"
#include "macros.hxx"
#include "chartview/DrawModelWrapper.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "ViewElementListProvider.hxx"
#include "MultipleChartConverters.hxx"
#include "ControllerLockGuard.hxx"
@@ -122,8 +122,8 @@ void ChartController::executeDispatch_InsertAxes()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AXES )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_AXES ))),
+ m_xUndoManager );
try
{
@@ -147,7 +147,7 @@ void ChartController::executeDispatch_InsertAxes()
, aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC
, mpRefSizeProvider.get() );
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -160,8 +160,8 @@ void ChartController::executeDispatch_InsertGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_GRIDS )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_GRIDS ))),
+ m_xUndoManager );
try
{
@@ -181,7 +181,7 @@ void ChartController::executeDispatch_InsertGrid()
bool bChanged = AxisHelper::changeVisibilityOfGrids( xDiagram
, aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC );
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -197,8 +197,8 @@ void ChartController::executeDispatch_InsertTitles()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_TITLES )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_TITLES ))),
+ m_xUndoManager );
try
{
@@ -215,7 +215,7 @@ void ChartController::executeDispatch_InsertTitles()
aDlg.getResult( aDialogOutput );
bool bChanged = aDialogOutput.writeDifferenceToModel( getModel(), m_xCC, &aDialogInput );
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -228,30 +228,30 @@ void ChartController::executeDispatch_DeleteLegend()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_LEGEND ))),
+ m_xUndoManager );
LegendHelper::hideLegend( getModel() );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_InsertLegend()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_LEGEND ))),
+ m_xUndoManager );
Reference< chart2::XLegend > xLegend = LegendHelper::showLegend( getModel(), m_xCC );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_OpenLegendDialog()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_LEGEND ))),
+ m_xUndoManager );
try
{
@@ -265,7 +265,7 @@ void ChartController::executeDispatch_OpenLegendDialog()
ControllerLockGuard aCLGuard( getModel() );
bool bChanged = aDlg.writeToModel( getModel() );
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -281,8 +281,8 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_DATALABELS )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_DATALABELS ))),
+ m_xUndoManager );
//if a series is selected insert labels for that series only:
uno::Reference< chart2::XDataSeries > xSeries(
@@ -299,7 +299,7 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
bool bSuccess = ChartController::executeDlg_ObjectProperties_withoutUndoGuard( aObjectCID, true );
if( bSuccess )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
return;
}
@@ -331,7 +331,7 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
ControllerLockGuard aCLGuard( getModel() );
bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -355,7 +355,7 @@ void ChartController::executeDispatch_InsertMenu_YErrorBars()
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::INSERT, ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_ERRORS ) ),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
try
{
@@ -381,7 +381,7 @@ void ChartController::executeDispatch_InsertMenu_YErrorBars()
ControllerLockGuard aCLGuard( getModel() );
bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -394,19 +394,19 @@ void ChartController::executeDispatch_InsertMeanValue()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_AVERAGE_LINE ))),
+ m_xUndoManager );
lcl_InsertMeanValueLine( m_xCC ).operator()(
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ));
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_InsertMenu_MeanValues()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_AVERAGE_LINE ))),
+ m_xUndoManager );
uno::Reference< chart2::XDataSeries > xSeries(
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ), uno::UNO_QUERY );
@@ -421,7 +421,7 @@ void ChartController::executeDispatch_InsertMenu_MeanValues()
DiagramHelper::getDataSeriesFromDiagram( ChartModelHelper::findDiagram( getModel() )));
::std::for_each( aSeries.begin(), aSeries.end(), lcl_InsertMeanValueLine( m_xCC ));
}
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_InsertMenu_Trendlines()
@@ -438,7 +438,7 @@ void ChartController::executeDispatch_InsertMenu_Trendlines()
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::INSERT, ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_CURVE ) ),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
try
{
@@ -461,7 +461,7 @@ void ChartController::executeDispatch_InsertMenu_Trendlines()
ControllerLockGuard aCLGuard( getModel() );
bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -478,8 +478,8 @@ void ChartController::executeDispatch_InsertTrendline()
{
UndoLiveUpdateGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_CURVE ))),
+ m_xUndoManager );
// add a linear curve
RegressionCurveHelper::addRegressionCurve(
@@ -519,7 +519,7 @@ void ChartController::executeDispatch_InsertTrendline()
ControllerLockGuard aCLGuard( getModel() );
aItemConverter.ApplyItemSet( *pOutItemSet );
}
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
}
@@ -532,8 +532,8 @@ void ChartController::executeDispatch_InsertYErrorBars()
{
UndoLiveUpdateGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_ERROR_BARS )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_ERROR_BARS ))),
+ m_xUndoManager );
// add error bars with standard deviation
uno::Reference< beans::XPropertySet > xErrorBarProp(
@@ -569,7 +569,7 @@ void ChartController::executeDispatch_InsertYErrorBars()
ControllerLockGuard aCLGuard( getModel() );
aItemConverter.ApplyItemSet( *pOutItemSet );
}
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
}
@@ -592,11 +592,11 @@ void ChartController::executeDispatch_InsertTrendlineEquation( bool bInsertR2 )
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_CURVE_EQUATION ))),
+ m_xUndoManager );
xEqProp->setPropertyValue( C2U("ShowEquation"), uno::makeAny( true ));
xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( bInsertR2 ));
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
}
@@ -609,10 +609,10 @@ void ChartController::executeDispatch_InsertR2Value()
{
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_CURVE_EQUATION ))),
+ m_xUndoManager );
xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( true ));
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -624,10 +624,10 @@ void ChartController::executeDispatch_DeleteR2Value()
{
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_CURVE_EQUATION ))),
+ m_xUndoManager );
xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( false ));
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -639,10 +639,10 @@ void ChartController::executeDispatch_DeleteMeanValue()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_AVERAGE_LINE ))),
+ m_xUndoManager );
RegressionCurveHelper::removeMeanValueLine( xRegCurveCnt );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -654,10 +654,10 @@ void ChartController::executeDispatch_DeleteTrendline()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_CURVE ))),
+ m_xUndoManager );
RegressionCurveHelper::removeAllExceptMeanValueLine( xRegCurveCnt );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -669,10 +669,10 @@ void ChartController::executeDispatch_DeleteTrendlineEquation()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_CURVE_EQUATION ))),
+ m_xUndoManager );
RegressionCurveHelper::removeEquations( xRegCurveCnt );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -684,10 +684,10 @@ void ChartController::executeDispatch_DeleteYErrorBars()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_CURVE ))),
+ m_xUndoManager );
StatisticsHelper::removeErrorBars( xDataSeries );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -698,20 +698,20 @@ void ChartController::executeDispatch_InsertDataLabels()
if( xSeries.is() )
{
UndoGuard aUndoGuard = UndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::INSERT,
- ::rtl::OUString( String( SchResId( STR_OBJECT_DATALABELS )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_DATALABELS ))),
+ m_xUndoManager );
DataSeriesHelper::insertDataLabelsToSeriesAndAllPoints( xSeries );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
void ChartController::executeDispatch_InsertDataLabel()
{
UndoGuard aUndoGuard = UndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::INSERT,
- ::rtl::OUString( String( SchResId( STR_OBJECT_LABEL )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_LABEL ))),
+ m_xUndoManager );
DataSeriesHelper::insertDataLabelToPoint( ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), getModel() ) );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_DeleteDataLabels()
@@ -721,44 +721,44 @@ void ChartController::executeDispatch_DeleteDataLabels()
if( xSeries.is() )
{
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::DELETE,
- ::rtl::OUString( String( SchResId( STR_OBJECT_DATALABELS )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_DATALABELS ))),
+ m_xUndoManager );
DataSeriesHelper::deleteDataLabelsFromSeriesAndAllPoints( xSeries );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
void ChartController::executeDispatch_DeleteDataLabel()
{
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::DELETE,
- ::rtl::OUString( String( SchResId( STR_OBJECT_LABEL )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_LABEL ))),
+ m_xUndoManager );
DataSeriesHelper::deleteDataLabelsFromPoint( ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), getModel() ) );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_ResetAllDataPoints()
{
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::FORMAT,
- ::rtl::OUString( String( SchResId( STR_OBJECT_DATAPOINTS )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_DATAPOINTS ))),
+ m_xUndoManager );
uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ), uno::UNO_QUERY );
if( xSeries.is() )
xSeries->resetAllDataPoints();
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_ResetDataPoint()
{
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::FORMAT,
- ::rtl::OUString( String( SchResId( STR_OBJECT_DATAPOINT )))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_OBJECT_DATAPOINT ))),
+ m_xUndoManager );
uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ), uno::UNO_QUERY );
if( xSeries.is() )
{
sal_Int32 nPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( m_aSelection.getSelectedCID() );
xSeries->resetDataPoint( nPointIndex );
}
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_InsertAxisTitle()
@@ -769,8 +769,8 @@ void ChartController::executeDispatch_InsertAxisTitle()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_TITLE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_TITLE ))),
+ m_xUndoManager );
Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getModel() );
sal_Int32 nDimensionIndex = -1;
@@ -788,7 +788,7 @@ void ChartController::executeDispatch_InsertAxisTitle()
::std::auto_ptr< ReferenceSizeProvider > apRefSizeProvider( impl_createReferenceSizeProvider());
xTitle = TitleHelper::createTitle( eTitleType, ObjectNameProvider::getTitleNameByType(eTitleType), getModel(), m_xCC, apRefSizeProvider.get() );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -801,8 +801,8 @@ void ChartController::executeDispatch_InsertAxis()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AXIS )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_AXIS ))),
+ m_xUndoManager );
try
{
@@ -810,7 +810,7 @@ void ChartController::executeDispatch_InsertAxis()
if( xAxis.is() )
{
AxisHelper::makeAxisVisible( xAxis );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -823,8 +823,8 @@ void ChartController::executeDispatch_DeleteAxis()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_AXIS )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_AXIS ))),
+ m_xUndoManager );
try
{
@@ -832,7 +832,7 @@ void ChartController::executeDispatch_DeleteAxis()
if( xAxis.is() )
{
AxisHelper::makeAxisInvisible( xAxis );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -845,8 +845,8 @@ void ChartController::executeDispatch_InsertMajorGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_GRID ))),
+ m_xUndoManager );
try
{
@@ -854,7 +854,7 @@ void ChartController::executeDispatch_InsertMajorGrid()
if( xAxis.is() )
{
AxisHelper::makeGridVisible( xAxis->getGridProperties() );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -867,8 +867,8 @@ void ChartController::executeDispatch_DeleteMajorGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_GRID ))),
+ m_xUndoManager );
try
{
@@ -876,7 +876,7 @@ void ChartController::executeDispatch_DeleteMajorGrid()
if( xAxis.is() )
{
AxisHelper::makeGridInvisible( xAxis->getGridProperties() );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -889,8 +889,8 @@ void ChartController::executeDispatch_InsertMinorGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_GRID ))),
+ m_xUndoManager );
try
{
@@ -900,7 +900,7 @@ void ChartController::executeDispatch_InsertMinorGrid()
Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
for( sal_Int32 nN=0; nN<aSubGrids.getLength(); nN++)
AxisHelper::makeGridVisible( aSubGrids[nN] );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
@@ -913,8 +913,8 @@ void ChartController::executeDispatch_DeleteMinorGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_GRID ))),
+ m_xUndoManager );
try
{
@@ -924,7 +924,7 @@ void ChartController::executeDispatch_DeleteMinorGrid()
Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
for( sal_Int32 nN=0; nN<aSubGrids.getLength(); nN++)
AxisHelper::makeGridInvisible( aSubGrids[nN] );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException& e)
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index 96942d1bf055..ffbaf72d8677 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -38,6 +38,7 @@
#include "UndoGuard.hxx"
#include "Strings.hrc"
#include "ObjectNameProvider.hxx"
+#include "DiagramHelper.hxx"
#include "chartview/ExplicitValueProvider.hxx"
#include "CommonConverters.hxx"
#include <svx/ActionDescriptionProvider.hxx>
@@ -73,16 +74,16 @@ void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, Rectangle& r
const SfxPoolItem* pPoolItem=NULL;
//read position
- if (SFX_ITEM_SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_POS_X,TRUE,&pPoolItem))
+ if (SFX_ITEM_SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_POS_X,sal_True,&pPoolItem))
nPosX=((const SfxInt32Item*)pPoolItem)->GetValue();
- if (SFX_ITEM_SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_POS_Y,TRUE,&pPoolItem))
+ if (SFX_ITEM_SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_POS_Y,sal_True,&pPoolItem))
nPosY=((const SfxInt32Item*)pPoolItem)->GetValue();
//read size
- if (SFX_ITEM_SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_WIDTH,TRUE,&pPoolItem))
+ if (SFX_ITEM_SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_WIDTH,sal_True,&pPoolItem))
nSizX=((const SfxUInt32Item*)pPoolItem)->GetValue();
- if (SFX_ITEM_SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,TRUE,&pPoolItem))
+ if (SFX_ITEM_SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,sal_True,&pPoolItem))
nSizY=((const SfxUInt32Item*)pPoolItem)->GetValue();
- if (SFX_ITEM_SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT,TRUE,&pPoolItem))
+ if (SFX_ITEM_SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT,sal_True,&pPoolItem))
eRP=(RECT_POINT)((const SfxAllEnumItem*)pPoolItem)->GetValue();
switch( eRP )
@@ -136,11 +137,13 @@ void SAL_CALL ChartController::executeDispatch_PositionAndSize()
if( pProvider )
aSelectedSize = ToSize( ( pProvider->getRectangleOfObject( aCID ) ) );
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( aCID );
+
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::POS_SIZE,
- ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aCID ))),
- m_xUndoManager, getModel() );
+ ObjectNameProvider::getName( eObjectType)),
+ m_xUndoManager );
SfxAbstractTabDialog * pDlg = NULL;
try
@@ -170,12 +173,15 @@ void SAL_CALL ChartController::executeDispatch_PositionAndSize()
awt::Size aPageSize( ChartModelHelper::getPageSize( getModel() ) );
Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height );
- bool bChanged = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID()
- , getModel()
+ bool bChanged = false;
+ if ( eObjectType == OBJECTTYPE_LEGEND )
+ bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( getModel(), false , true );
+
+ bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID(), getModel()
, awt::Rectangle(aObjectRect.getX(),aObjectRect.getY(),aObjectRect.getWidth(),aObjectRect.getHeight())
, awt::Rectangle(aPageRect.getX(),aPageRect.getY(),aPageRect.getWidth(),aPageRect.getHeight()) );
- if( bChanged )
- aUndoGuard.commitAction();
+ if( bMoved || bChanged )
+ aUndoGuard.commit();
}
}
delete pDlg;
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index 62a3d8bdc929..a84dccbaa2ef 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -715,11 +715,11 @@ void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUStrin
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::FORMAT,
ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aObjectCID ))),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
bool bSuccess = ChartController::executeDlg_ObjectProperties_withoutUndoGuard( aObjectCID, false );
if( bSuccess )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( const ::rtl::OUString& rObjectCID, bool bOkClickOnUnchangedDialogSouldBeRatedAsSuccessAlso )
@@ -831,14 +831,14 @@ void SAL_CALL ChartController::executeDispatch_View3D()
{
// using assignment for broken gcc 3.3
UndoLiveUpdateGuard aUndoGuard = UndoLiveUpdateGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_EDIT_3D_VIEW ))),
- m_xUndoManager, getModel());
+ String( SchResId( STR_ACTION_EDIT_3D_VIEW )),
+ m_xUndoManager );
//open dialog
SolarMutexGuard aSolarGuard;
View3DDialog aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorTable() );
if( aDlg.Execute() == RET_OK )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
catch( uno::RuntimeException& e)
{
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index 8635e80a6597..b748688664e6 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -30,6 +30,8 @@
#include "precompiled_chart2.hxx"
#include "ChartController.hxx"
+#include "ResId.hxx"
+#include "UndoGuard.hxx"
#include "DrawViewWrapper.hxx"
#include "ChartWindow.hxx"
#include "TitleHelper.hxx"
@@ -37,6 +39,7 @@
#include "macros.hxx"
#include "ControllerLockGuard.hxx"
#include "AccessibleTextHelper.hxx"
+#include "Strings.hrc"
#include "chartview/DrawModelWrapper.hxx"
#include <svx/svdotext.hxx>
@@ -74,11 +77,14 @@ void ChartController::StartTextEdit( const Point* pMousePixel )
{
//the first marked object will be edited
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
SdrObject* pTextObj = m_pDrawViewWrapper->getTextEditObject();
if(!pTextObj)
return;
- m_xUndoManager->preAction( getModel());
+ OSL_PRECOND( !m_pTextActionUndoGuard.get(), "ChartController::StartTextEdit: already have a TextUndoGuard!?" );
+ m_pTextActionUndoGuard.reset( new UndoGuard(
+ String( SchResId( STR_ACTION_EDIT_TEXT ) ), m_xUndoManager ) );
SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner();
//#i77362 change notification for changes on additional shapes are missing
@@ -152,26 +158,11 @@ bool ChartController::EndTextEdit()
TitleHelper::setCompleteString( aString, uno::Reference<
::com::sun::star::chart2::XTitle >::query( xPropSet ), m_xCC );
- try
- {
- m_xUndoManager->postAction( C2U("Edit Text") );
- }
- catch( uno::RuntimeException& e)
- {
- ASSERT_EXCEPTION( e );
- }
- }
- else
- {
- try
- {
- m_xUndoManager->cancelAction();
- }
- catch ( uno::RuntimeException& e )
- {
- ASSERT_EXCEPTION( e );
- }
+ OSL_ENSURE( m_pTextActionUndoGuard.get(), "ChartController::EndTextEdit: no TextUndoGuard!" );
+ if ( m_pTextActionUndoGuard.get() )
+ m_pTextActionUndoGuard->commit();
}
+ m_pTextActionUndoGuard.reset();
}
return true;
}
@@ -190,10 +181,10 @@ void SAL_CALL ChartController::executeDispatch_InsertSpecialCharacter()
DBG_ASSERT( pFact, "No dialog factory" );
SfxAllItemSet aSet( m_pDrawModelWrapper->GetItemPool() );
- aSet.Put( SfxBoolItem( FN_PARAM_1, FALSE ) );
+ aSet.Put( SfxBoolItem( FN_PARAM_1, sal_False ) );
//set fixed current font
- aSet.Put( SfxBoolItem( FN_PARAM_2, TRUE ) ); //maybe not necessary in future
+ aSet.Put( SfxBoolItem( FN_PARAM_2, sal_True ) ); //maybe not necessary in future
Font aCurFont = m_pDrawViewWrapper->getOutliner()->GetRefDevice()->GetFont();
aSet.Put( SvxFontItem( aCurFont.GetFamily(), aCurFont.GetName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), SID_ATTR_CHAR_FONT ) );
@@ -205,7 +196,7 @@ void SAL_CALL ChartController::executeDispatch_InsertSpecialCharacter()
const SfxItemSet* pSet = pDlg->GetOutputItemSet();
const SfxPoolItem* pItem=0;
String aString;
- if ( pSet && pSet->GetItemState( SID_CHARMAP, TRUE, &pItem) == SFX_ITEM_SET &&
+ if ( pSet && pSet->GetItemState( SID_CHARMAP, sal_True, &pItem) == SFX_ITEM_SET &&
pItem->ISA(SfxStringItem) )
aString = dynamic_cast<const SfxStringItem*>(pItem)->GetValue();
@@ -219,13 +210,13 @@ void SAL_CALL ChartController::executeDispatch_InsertSpecialCharacter()
// prevent flicker
pOutlinerView->HideCursor();
- pOutliner->SetUpdateMode(FALSE);
+ pOutliner->SetUpdateMode(sal_False);
// delete current selection by inserting empty String, so current
// attributes become unique (sel. has to be erased anyway)
pOutlinerView->InsertText(String());
- pOutlinerView->InsertText(aString, TRUE);
+ pOutlinerView->InsertText(aString, true);
ESelection aSel = pOutlinerView->GetSelection();
aSel.nStartPara = aSel.nEndPara;
@@ -233,7 +224,7 @@ void SAL_CALL ChartController::executeDispatch_InsertSpecialCharacter()
pOutlinerView->SetSelection(aSel);
// show changes
- pOutliner->SetUpdateMode(TRUE);
+ pOutliner->SetUpdateMode(sal_True);
pOutlinerView->ShowCursor();
}
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 23dc588dd13f..faabf7f8a5d5 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -103,7 +103,7 @@ namespace
bool lcl_deleteDataSeries(
const OUString & rCID,
const Reference< frame::XModel > & xModel,
- const Reference< chart2::XUndoManager > & xUndoManager )
+ const Reference< document::XUndoManager > & xUndoManager )
{
bool bResult = false;
uno::Reference< chart2::XDataSeries > xSeries( ::chart::ObjectIdentifier::getDataSeriesForCID( rCID, xModel ));
@@ -116,8 +116,8 @@ bool lcl_deleteDataSeries(
{
::chart::UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( ::chart::SchResId( STR_OBJECT_DATASERIES )))),
- xUndoManager, xModel );
+ ActionDescriptionProvider::DELETE, String( ::chart::SchResId( STR_OBJECT_DATASERIES ))),
+ xUndoManager );
Reference< chart2::XDiagram > xDiagram( ::chart::ChartModelHelper::findDiagram( xModel ) );
uno::Reference< chart2::XAxis > xAxis( ::chart::DiagramHelper::getAttachedAxis( xSeries, xDiagram ) );
@@ -127,7 +127,7 @@ bool lcl_deleteDataSeries(
::chart::AxisHelper::hideAxisIfNoDataIsAttached( xAxis, xDiagram );
bResult = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
return bResult;
@@ -136,7 +136,7 @@ bool lcl_deleteDataSeries(
bool lcl_deleteDataCurve(
const OUString & rCID,
const Reference< frame::XModel > & xModel,
- const Reference< chart2::XUndoManager > & xUndoManager )
+ const Reference< document::XUndoManager > & xUndoManager )
{
bool bResult = false;
uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
@@ -146,11 +146,11 @@ bool lcl_deleteDataCurve(
{
::chart::UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( ::chart::SchResId( STR_OBJECT_CURVE )))),
- xUndoManager, xModel );
+ ActionDescriptionProvider::DELETE, String( ::chart::SchResId( STR_OBJECT_CURVE ))),
+ xUndoManager );
::chart::RegressionCurveHelper::removeAllExceptMeanValueLine( xRegCurveCnt );
bResult = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
return bResult;
}
@@ -191,8 +191,8 @@ void ChartController::executeDispatch_NewArrangement()
{
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_REARRANGE_CHART ))),
- m_xUndoManager, xModel );
+ String( SchResId( STR_ACTION_REARRANGE_CHART )),
+ m_xUndoManager );
ControllerLockGuard aCtlLockGuard( xModel );
// diagram
@@ -207,7 +207,11 @@ void ChartController::executeDispatch_NewArrangement()
// legend
Reference< beans::XPropertyState > xLegendState( xDiagram->getLegend(), uno::UNO_QUERY );
if( xLegendState.is())
+ {
xLegendState->setPropertyToDefault( C2U("RelativePosition"));
+ xLegendState->setPropertyToDefault( C2U("RelativeSize"));
+ xLegendState->setPropertyToDefault( C2U("AnchorPosition"));
+ }
// titles
for( sal_Int32 eType = TitleHelper::TITLE_BEGIN;
@@ -227,7 +231,7 @@ void ChartController::executeDispatch_NewArrangement()
::std::for_each( aRegressionCurves.begin(), aRegressionCurves.end(),
RegressionCurveHelper::resetEquationPosition );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
catch( uno::RuntimeException & ex )
@@ -241,18 +245,19 @@ void ChartController::executeDispatch_ScaleText()
SolarMutexGuard aSolarGuard;
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_SCALE_TEXT ))),
- m_xUndoManager, getModel() );
+ String( SchResId( STR_ACTION_SCALE_TEXT )),
+ m_xUndoManager );
ControllerLockGuard aCtlLockGuard( getModel() );
::std::auto_ptr< ReferenceSizeProvider > apRefSizeProv( impl_createReferenceSizeProvider());
OSL_ASSERT( apRefSizeProv.get());
if( apRefSizeProv.get())
apRefSizeProv->toggleAutoResizeState();
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_Paste()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
{
Graphic aGraphic;
@@ -610,12 +615,12 @@ bool ChartController::executeDispatch_Delete()
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_TITLE )))),
- m_xUndoManager, getModel());
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_TITLE ))),
+ m_xUndoManager );
TitleHelper::removeTitle(
ObjectIdentifier::getTitleTypeForCID( aCID ), getModel() );
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
break;
}
case OBJECTTYPE_LEGEND:
@@ -629,11 +634,11 @@ bool ChartController::executeDispatch_Delete()
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_LEGEND ))),
+ m_xUndoManager );
xLegendProp->setPropertyValue( C2U("Show"), uno::makeAny( false ));
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
break;
@@ -651,6 +656,11 @@ bool ChartController::executeDispatch_Delete()
bReturn = lcl_deleteDataSeries( aCID, getModel(), m_xUndoManager );
else if( eParentObjectType == OBJECTTYPE_DATA_CURVE )
bReturn = lcl_deleteDataCurve( aCID, getModel(), m_xUndoManager );
+ else if( eParentObjectType == OBJECTTYPE_DATA_AVERAGE_LINE )
+ {
+ executeDispatch_DeleteMeanValue();
+ bReturn = true;
+ }
break;
}
@@ -664,11 +674,11 @@ bool ChartController::executeDispatch_Delete()
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
- m_xUndoManager, getModel() );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_AVERAGE_LINE ))),
+ m_xUndoManager );
RegressionCurveHelper::removeMeanValueLine( xRegCurveCnt );
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
break;
}
@@ -687,15 +697,15 @@ bool ChartController::executeDispatch_Delete()
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
- m_xUndoManager, xModel );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_CURVE_EQUATION ))),
+ m_xUndoManager );
{
ControllerLockGuard aCtlLockGuard( xModel );
xEqProp->setPropertyValue( C2U("ShowEquation"), uno::makeAny( false ));
xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( false ));
}
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
break;
}
@@ -710,8 +720,8 @@ bool ChartController::executeDispatch_Delete()
// using assignment for broken gcc 3.3
UndoGuard aUndoGuard = UndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_ERROR_BARS )))),
- m_xUndoManager, xModel );
+ ActionDescriptionProvider::DELETE, String( SchResId( STR_OBJECT_ERROR_BARS ))),
+ m_xUndoManager );
{
ControllerLockGuard aCtlLockGuard( xModel );
xErrorBarProp->setPropertyValue(
@@ -719,7 +729,7 @@ bool ChartController::executeDispatch_Delete()
uno::makeAny( ::com::sun::star::chart::ErrorBarStyle::NONE ));
}
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
break;
}
@@ -735,7 +745,7 @@ bool ChartController::executeDispatch_Delete()
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::DELETE, ::rtl::OUString( String(
SchResId( aObjectType == OBJECTTYPE_DATA_LABEL ? STR_OBJECT_LABEL : STR_OBJECT_DATALABELS )))),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
chart2::DataPointLabel aLabel;
xObjectProperties->getPropertyValue( C2U( "Label" ) ) >>= aLabel;
aLabel.ShowNumber = false;
@@ -750,7 +760,7 @@ bool ChartController::executeDispatch_Delete()
else
xObjectProperties->setPropertyValue( C2U( "Label" ), uno::makeAny(aLabel) );
bReturn = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
break;
}
@@ -799,7 +809,7 @@ void ChartController::executeDispatch_ToggleLegend()
{
Reference< frame::XModel > xModel( getModel() );
UndoGuard aUndoGuard = UndoGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_TOGGLE_LEGEND ))), m_xUndoManager, xModel );
+ String( SchResId( STR_ACTION_TOGGLE_LEGEND )), m_xUndoManager );
Reference< beans::XPropertySet > xLegendProp( LegendHelper::getLegend( xModel ), uno::UNO_QUERY );
bool bChanged = false;
if( xLegendProp.is())
@@ -826,14 +836,14 @@ void ChartController::executeDispatch_ToggleLegend()
}
if( bChanged )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
void ChartController::executeDispatch_ToggleGridHorizontal()
{
Reference< frame::XModel > xModel( getModel() );
UndoGuard aUndoGuard = UndoGuard(
- ::rtl::OUString( String( SchResId( STR_ACTION_TOGGLE_GRID_HORZ ))), m_xUndoManager, xModel );
+ String( SchResId( STR_ACTION_TOGGLE_GRID_HORZ )), m_xUndoManager );
Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( getModel() ));
if( xDiagram.is())
{
@@ -848,7 +858,7 @@ void ChartController::executeDispatch_ToggleGridHorizontal()
else
AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, bIsMainGrid, xDiagram, m_xCC );
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -866,9 +876,9 @@ void ChartController::impl_switchDiagramPositioningToExcludingPositioning()
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::POS_SIZE,
ObjectNameProvider::getName( OBJECTTYPE_DIAGRAM)),
- m_xUndoManager, m_aModel->getModel() );
+ m_xUndoManager );
if( DiagramHelper::switchDiagramPositioningToExcludingPositioning( m_aModel->getModel(), true, true ) )
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
} // namespace chart
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 9e214900ab06..c71137c074ec 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -244,12 +244,12 @@ const short HITPIX=2; //hit-tolerance in pixel
, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags )
throw (uno::RuntimeException)
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
- Window* pWindow = m_pChartWindow;
- if(xWindow.is() && pWindow)
+ if(xWindow.is() && m_pChartWindow)
{
- Size aLogicSize = pWindow->PixelToLogic( Size( Width, Height ), MapMode( MAP_100TH_MM ) );
+ Size aLogicSize = m_pChartWindow->PixelToLogic( Size( Width, Height ), MapMode( MAP_100TH_MM ) );
bool bIsEmbedded = true;
//todo: for standalone chart: detect wether we are standalone
@@ -264,8 +264,8 @@ const short HITPIX=2; //hit-tolerance in pixel
MapMode aNewMapMode( MAP_100TH_MM, Point(0,0)
, Fraction(nScaleXNumerator,nScaleXDenominator)
, Fraction(nScaleYNumerator,nScaleYDenominator) );
- pWindow->SetMapMode(aNewMapMode);
- pWindow->SetPosSizePixel( X, Y, Width, Height, Flags );
+ m_pChartWindow->SetMapMode(aNewMapMode);
+ m_pChartWindow->SetPosSizePixel( X, Y, Width, Height, 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 );
@@ -286,7 +286,7 @@ const short HITPIX=2; //hit-tolerance in pixel
//a correct work area is at least necessary for correct values in the position and size dialog and for dragging area
if(m_pDrawViewWrapper)
{
- Rectangle aRect(Point(0,0), pWindow->GetOutputSize());
+ Rectangle aRect(Point(0,0), m_pChartWindow->GetOutputSize());
m_pDrawViewWrapper->SetWorkArea( aRect );
}
}
@@ -294,9 +294,9 @@ const short HITPIX=2; //hit-tolerance in pixel
{
//change visarea
ChartModelHelper::setPageSize( awt::Size( aLogicSize.Width(), aLogicSize.Height() ), getModel() );
- pWindow->SetPosSizePixel( X, Y, Width, Height, Flags );
+ m_pChartWindow->SetPosSizePixel( X, Y, Width, Height, Flags );
}
- pWindow->Invalidate();
+ m_pChartWindow->Invalidate();
}
}
@@ -534,12 +534,11 @@ void ChartController::execute_Paint( const Rectangle& rRect )
if( xUpdatable.is() )
xUpdatable->update();
- Window* pWindow = m_pChartWindow;
{
SolarMutexGuard aGuard;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
if(pDrawViewWrapper)
- pDrawViewWrapper->CompleteRedraw(pWindow, Region(rRect) );
+ pDrawViewWrapper->CompleteRedraw(m_pChartWindow, Region(rRect) );
}
}
catch( uno::Exception & ex )
@@ -563,9 +562,11 @@ bool isDoubleClick( const MouseEvent& rMEvt )
void ChartController::startDoubleClickWaiting()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
m_bWaitingForDoubleClick = true;
- ULONG nDblClkTime = 500;
+ sal_uLong nDblClkTime = 500;
if( m_pChartWindow )
{
const MouseSettings& rMSettings = m_pChartWindow->GetSettings().GetMouseSettings();
@@ -588,11 +589,12 @@ IMPL_LINK( ChartController, DoubleClickWaitingHdl, void*, EMPTYARG )
if( !m_bWaitingForMouseUp && m_aSelection.maybeSwitchSelectionAfterSingleClickWasEnsured() )
{
this->impl_selectObjectAndNotiy();
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pChartWindow )
{
Window::PointerState aPointerState( m_pChartWindow->GetPointerState() );
MouseEvent aMouseEvent( aPointerState.maPos,1/*nClicks*/,
- 0/*nMode*/, static_cast< USHORT >( aPointerState.mnState )/*nButtons*/,
+ 0/*nMode*/, static_cast< sal_uInt16 >( aPointerState.mnState )/*nButtons*/,
0/*nModifier*/ );
impl_SetMousePointer( aMouseEvent );
}
@@ -616,17 +618,16 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
m_aSelection.remindSelectionBeforeMouseDown();
- Window* pWindow = m_pChartWindow;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(!pWindow || !pDrawViewWrapper )
+ if(!m_pChartWindow || !pDrawViewWrapper )
return;
- Point aMPos = pWindow->PixelToLogic(rMEvt.GetPosPixel());
+ Point aMPos = m_pChartWindow->PixelToLogic(rMEvt.GetPosPixel());
if ( MOUSE_LEFT == rMEvt.GetButtons() )
{
- pWindow->GrabFocus();
- pWindow->CaptureMouse();
+ m_pChartWindow->GrabFocus();
+ m_pChartWindow->CaptureMouse();
}
if( pDrawViewWrapper->IsTextEdit() )
@@ -711,7 +712,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
&& !rMEvt.IsRight() )
{
//start drag
- USHORT nDrgLog = (USHORT)pWindow->PixelToLogic(Size(DRGPIX,0)).Width();
+ sal_uInt16 nDrgLog = (sal_uInt16)m_pChartWindow->PixelToLogic(Size(DRGPIX,0)).Width();
SdrDragMethod* pDragMethod = NULL;
//change selection to 3D scene if rotate mode
@@ -751,9 +752,8 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt )
{
SolarMutexGuard aGuard;
- Window* pWindow = m_pChartWindow;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(!pWindow || !pDrawViewWrapper)
+ if(!m_pChartWindow || !pDrawViewWrapper)
return;
if( m_pDrawViewWrapper->IsTextEdit() )
@@ -764,7 +764,7 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt )
if(pDrawViewWrapper->IsAction())
{
- pDrawViewWrapper->MovAction( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
+ pDrawViewWrapper->MovAction( m_pChartWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
}
impl_SetMousePointer( rMEvt );
@@ -784,12 +784,11 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
{
SolarMutexGuard aGuard;
- Window* pWindow = m_pChartWindow;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(!pWindow || !pDrawViewWrapper)
+ if(!m_pChartWindow || !pDrawViewWrapper)
return;
- Point aMPos = pWindow->PixelToLogic(rMEvt.GetPosPixel());
+ Point aMPos = m_pChartWindow->PixelToLogic(rMEvt.GetPosPixel());
if(pDrawViewWrapper->IsTextEdit())
{
@@ -801,7 +800,11 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
if ( m_eDrawMode == CHARTDRAW_INSERT && pDrawViewWrapper->IsCreateObj() )
{
pDrawViewWrapper->EndCreateObj( SDRCREATE_FORCEEND );
- impl_switchDiagramPositioningToExcludingPositioning();
+ {
+ HiddenUndoContext aUndoContext( m_xUndoManager );
+ // don't want the positioning Undo action to appear in the UI
+ impl_switchDiagramPositioningToExcludingPositioning();
+ }
if ( pDrawViewWrapper->AreObjectsMarked() )
{
if ( pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT )
@@ -838,12 +841,12 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
if( pChartDragMethod )
{
UndoGuard aUndoGuard( pChartDragMethod->getUndoDescription(),
- m_xUndoManager, getModel() );
+ m_xUndoManager );
if( pDrawViewWrapper->EndDragObj(false) )
{
bDraggingDone = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
@@ -867,19 +870,25 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
if( !bIsMoveOnly && m_aSelection.isResizeableObjectSelected() )
eActionType = ActionDescriptionProvider::RESIZE;
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() );
+
UndoGuard aUndoGuard(
- ActionDescriptionProvider::createDescription(
- eActionType,
- ObjectNameProvider::getName( ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() ))),
- m_xUndoManager, getModel() );
- bool bChanged = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID()
+ ActionDescriptionProvider::createDescription( eActionType, ObjectNameProvider::getName( eObjectType)),
+ m_xUndoManager );
+
+ bool bChanged = false;
+ if ( eObjectType == OBJECTTYPE_LEGEND )
+ bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( getModel(), false , true );
+
+ bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID()
, getModel()
, awt::Rectangle(aObjectRect.getX(),aObjectRect.getY(),aObjectRect.getWidth(),aObjectRect.getHeight())
, awt::Rectangle(aPageRect.getX(),aPageRect.getY(),aPageRect.getWidth(),aPageRect.getHeight()) );
- if( bChanged )
+
+ if( bMoved || bChanged )
{
bDraggingDone = true;
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
}
@@ -919,7 +928,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
}
//@todo ForcePointer(&rMEvt);
- pWindow->ReleaseMouse();
+ m_pChartWindow->ReleaseMouse();
if( m_aSelection.isSelectionDifferentFromBeforeMouseDown() )
bNotifySelectionChange = true;
@@ -968,16 +977,18 @@ void ChartController::execute_DoubleClick( const Point* pMousePixel )
void ChartController::execute_Resize()
{
- m_pChartWindow->Invalidate();
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if(m_pChartWindow)
+ m_pChartWindow->Invalidate();
}
void ChartController::execute_Activate()
{
- ///// pDrawViewWrapper->SetEditMode(TRUE);
+ ///// pDrawViewWrapper->SetEditMode(sal_True);
}
void ChartController::execute_Deactivate()
{
/*
- pDrawViewWrapper->SetEditMode(FALSE);
+ pDrawViewWrapper->SetEditMode(sal_False);
this->ReleaseMouse();
*/
}
@@ -991,13 +1002,11 @@ void ChartController::execute_LoseFocus()
void ChartController::execute_Command( const CommandEvent& rCEvt )
{
- Window* pWindow = m_pChartWindow;
-
bool bIsAction = false;
{
SolarMutexGuard aGuard;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(!pWindow || !pDrawViewWrapper)
+ if(!m_pChartWindow || !pDrawViewWrapper)
return;
bIsAction = m_pDrawViewWrapper->IsAction();
}
@@ -1005,7 +1014,11 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
// pop-up menu
if(rCEvt.GetCommand() == COMMAND_CONTEXTMENU && !bIsAction)
{
- m_pChartWindow->ReleaseMouse();
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if(m_pChartWindow)
+ m_pChartWindow->ReleaseMouse();
+ }
if( m_aSelection.isSelectionDifferentFromBeforeMouseDown() )
impl_notifySelectionChangeListeners();
@@ -1019,7 +1032,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
Point aPos( rCEvt.GetMousePosPixel() );
if( !rCEvt.IsMouseEvent() )
{
- aPos = m_pChartWindow->GetPointerState().maPos;
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if(m_pChartWindow)
+ aPos = m_pChartWindow->GetPointerState().maPos;
}
aContextMenuHelper.completeAndExecute( aPos, aContextMenu );
}
@@ -1280,7 +1295,11 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
::svt::ContextMenuHelper aContextMenuHelper( m_xFrame );
Point aPos( rCEvt.GetMousePosPixel() );
if( !rCEvt.IsMouseEvent() )
- aPos = m_pChartWindow->GetPointerState().maPos;
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if(m_pChartWindow)
+ aPos = m_pChartWindow->GetPointerState().maPos;
+ }
aContextMenuHelper.completeAndExecute( aPos, xPopupMenu );
}
}
@@ -1291,6 +1310,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
( rCEvt.GetCommand() == COMMAND_INPUTCONTEXTCHANGE ) )
{
//#i84417# enable editing with IME
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if( m_pDrawViewWrapper )
m_pDrawViewWrapper->Command( rCEvt, m_pChartWindow );
}
@@ -1300,9 +1320,8 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
{
bool bReturn=false;
- Window* pWindow = m_pChartWindow;
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if(!pWindow || !pDrawViewWrapper)
+ if(!m_pChartWindow || !pDrawViewWrapper)
return bReturn;
// handle accelerators
@@ -1324,14 +1343,17 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
if( bReturn )
return bReturn;
- if( pDrawViewWrapper->IsTextEdit() )
{
- if( pDrawViewWrapper->KeyInput(rKEvt,pWindow) )
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( pDrawViewWrapper->IsTextEdit() )
{
- bReturn = true;
- if( nCode == KEY_ESCAPE )
+ if( pDrawViewWrapper->KeyInput(rKEvt,m_pChartWindow) )
{
- this->EndTextEdit();
+ bReturn = true;
+ if( nCode == KEY_ESCAPE )
+ {
+ this->EndTextEdit();
+ }
}
}
}
@@ -1421,12 +1443,16 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
// default 1 mm in each direction
double fGrowAmountX = 200.0;
double fGrowAmountY = 200.0;
- if( bAlternate && pWindow )
+ if( bAlternate && m_pChartWindow )
{
// together with Alt-key: 1 px in each direction
- Size aPixelSize = pWindow->PixelToLogic( Size( 2, 2 ));
- fGrowAmountX = static_cast< double >( aPixelSize.Width());
- fGrowAmountY = static_cast< double >( aPixelSize.Height());
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if( m_pChartWindow )
+ {
+ Size aPixelSize = m_pChartWindow->PixelToLogic( Size( 2, 2 ));
+ fGrowAmountX = static_cast< double >( aPixelSize.Width());
+ fGrowAmountY = static_cast< double >( aPixelSize.Height());
+ }
}
if( nCode == KEY_SUBTRACT )
{
@@ -1448,12 +1474,16 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
// default 1 mm
double fShiftAmountX = 100.0;
double fShiftAmountY = 100.0;
- if( bAlternate && pWindow )
+ if( bAlternate && m_pChartWindow )
{
// together with Alt-key: 1 px
- Size aPixelSize = pWindow->PixelToLogic( Size( 1, 1 ));
- fShiftAmountX = static_cast< double >( aPixelSize.Width());
- fShiftAmountY = static_cast< double >( aPixelSize.Height());
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if(m_pChartWindow)
+ {
+ Size aPixelSize = m_pChartWindow->PixelToLogic( Size( 1, 1 ));
+ fShiftAmountX = static_cast< double >( aPixelSize.Width());
+ fShiftAmountY = static_cast< double >( aPixelSize.Height());
+ }
}
switch( nCode )
{
@@ -1544,6 +1574,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
bReturn = executeDispatch_Delete();
if( ! bReturn )
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
InfoBox( m_pChartWindow, String(SchResId( STR_ACTION_NOTPOSSIBLE ))).Execute();
}
}
@@ -1701,11 +1732,14 @@ bool ChartController::requestQuickHelp(
void ChartController::impl_selectObjectAndNotiy()
{
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
- if( pDrawViewWrapper )
{
- pDrawViewWrapper->SetDragMode( m_eDragMode );
- m_aSelection.applySelection( m_pDrawViewWrapper );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
+ if( pDrawViewWrapper )
+ {
+ pDrawViewWrapper->SetDragMode( m_eDragMode );
+ m_aSelection.applySelection( m_pDrawViewWrapper );
+ }
}
impl_notifySelectionChangeListeners();
}
@@ -1780,7 +1814,7 @@ bool ChartController::impl_moveOrResizeObject(
ObjectType eObjectType = ObjectIdentifier::getObjectType( rCID );
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
- eActionType, ObjectNameProvider::getName( eObjectType )), m_xUndoManager, xChartModel );
+ eActionType, ObjectNameProvider::getName( eObjectType )), m_xUndoManager );
{
ControllerLockGuard aCLGuard( xChartModel );
if( bNeedShift )
@@ -1788,7 +1822,7 @@ bool ChartController::impl_moveOrResizeObject(
if( bNeedResize || (eObjectType == OBJECTTYPE_DIAGRAM) )//Also set an explicat size at the diagram when an explicit position is set
xObjProp->setPropertyValue( C2U("RelativeSize"), uno::makeAny( aRelSize ));
}
- aUndoGuard.commitAction();
+ aUndoGuard.commit();
}
}
return bResult;
@@ -1834,19 +1868,18 @@ bool ChartController::impl_DragDataPoint( const ::rtl::OUString & rCID, double f
void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
{
SolarMutexGuard aGuard;
- Window* pWindow = m_pChartWindow;
- if( m_pDrawViewWrapper && pWindow )
+ if( m_pDrawViewWrapper && m_pChartWindow )
{
- Point aMousePos( pWindow->PixelToLogic( rEvent.GetPosPixel()));
+ Point aMousePos( m_pChartWindow->PixelToLogic( rEvent.GetPosPixel()));
sal_uInt16 nModifier = rEvent.GetModifier();
- BOOL bLeftDown = rEvent.IsLeft();
+ sal_Bool bLeftDown = rEvent.IsLeft();
if ( m_pDrawViewWrapper->IsTextEdit() )
{
if( m_pDrawViewWrapper->IsTextEditHit( aMousePos, HITPIX) )
{
- pWindow->SetPointer( m_pDrawViewWrapper->GetPreferedPointer(
- aMousePos, pWindow, nModifier, bLeftDown ) );
+ m_pChartWindow->SetPointer( m_pDrawViewWrapper->GetPreferedPointer(
+ aMousePos, m_pChartWindow, nModifier, bLeftDown ) );
return;
}
}
@@ -1863,7 +1896,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
{
Pointer aPointer = m_pDrawViewWrapper->GetPreferedPointer(
- aMousePos, pWindow, nModifier, bLeftDown );
+ aMousePos, m_pChartWindow, nModifier, bLeftDown );
bool bForceArrowPointer = false;
ObjectIdentifier aOID( m_aSelection.getSelectedOID() );
@@ -1896,9 +1929,9 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
}
if( bForceArrowPointer )
- pWindow->SetPointer( Pointer( POINTER_ARROW ));
+ m_pChartWindow->SetPointer( Pointer( POINTER_ARROW ));
else
- pWindow->SetPointer( aPointer );
+ m_pChartWindow->SetPointer( aPointer );
}
else
{
@@ -1947,7 +1980,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
}
break;
}
- pWindow->SetPointer( Pointer( ePointerStyle ) );
+ m_pChartWindow->SetPointer( Pointer( ePointerStyle ) );
return;
}
@@ -1959,7 +1992,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
{
if( aHitObjectCID.equals(m_aSelection.getSelectedCID()) )
{
- pWindow->SetPointer( Pointer( POINTER_ARROW ));
+ m_pChartWindow->SetPointer( Pointer( POINTER_ARROW ));
return;
}
}
@@ -1967,14 +2000,14 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
if( !aHitObjectCID.getLength() )
{
//additional shape was hit
- pWindow->SetPointer( POINTER_MOVE );
+ m_pChartWindow->SetPointer( POINTER_MOVE );
}
else if( ObjectIdentifier::isDragableObject( aHitObjectCID ) )
{
if( (m_eDragMode == SDRDRAG_ROTATE)
&& SelectionHelper::isRotateableObject( aHitObjectCID
, getModel() ) )
- pWindow->SetPointer( Pointer( POINTER_ROTATE ) );
+ m_pChartWindow->SetPointer( Pointer( POINTER_ROTATE ) );
else
{
ObjectType eHitObjectType = ObjectIdentifier::getObjectType( aHitObjectCID );
@@ -1983,15 +2016,15 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent )
if( !ObjectIdentifier::areSiblings(aHitObjectCID,m_aSelection.getSelectedCID())
&& !ObjectIdentifier::areIdenticalObjects(aHitObjectCID,m_aSelection.getSelectedCID()) )
{
- pWindow->SetPointer( Pointer( POINTER_ARROW ));
+ m_pChartWindow->SetPointer( Pointer( POINTER_ARROW ));
return;
}
}
- pWindow->SetPointer( POINTER_MOVE );
+ m_pChartWindow->SetPointer( POINTER_MOVE );
}
}
else
- pWindow->SetPointer( Pointer( POINTER_ARROW ));
+ m_pChartWindow->SetPointer( Pointer( POINTER_ARROW ));
}
}
}
diff --git a/chart2/source/controller/main/ChartDropTargetHelper.cxx b/chart2/source/controller/main/ChartDropTargetHelper.cxx
index 0e779b3833a1..7975aa12c90c 100644
--- a/chart2/source/controller/main/ChartDropTargetHelper.cxx
+++ b/chart2/source/controller/main/ChartDropTargetHelper.cxx
@@ -138,58 +138,47 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const ExecuteDropEvent& rEvt )
// parent)
if( bDataComesFromParent )
{
+ Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram() );
Reference< chart2::data::XDataProvider > xDataProvider( m_xChartDocument->getDataProvider());
- if( xDataProvider.is() &&
+ if( xDataProvider.is() && xDiagram.is() &&
DataSourceHelper::allArgumentsForRectRangeDetected( m_xChartDocument ))
{
- DiagramHelper::tTemplateWithServiceName aTempWithServ(
- DiagramHelper::getTemplateForDiagram(
- m_xChartDocument->getFirstDiagram(),
- Reference< lang::XMultiServiceFactory >(
- m_xChartDocument->getChartTypeManager(), uno::UNO_QUERY )));
- if( aTempWithServ.first.is())
+ Reference< chart2::data::XDataSource > xDataSource(
+ DataSourceHelper::pressUsedDataIntoRectangularFormat( m_xChartDocument ));
+ Sequence< beans::PropertyValue > aArguments(
+ xDataProvider->detectArguments( xDataSource ));
+
+ OUString aOldRange;
+ beans::PropertyValue * pCellRange = 0;
+ for( sal_Int32 i=0; i<aArguments.getLength(); ++i )
{
- Reference< chart2::data::XDataSource > xDataSource(
- DataSourceHelper::pressUsedDataIntoRectangularFormat( m_xChartDocument ));
- Sequence< beans::PropertyValue > aArguments(
- xDataProvider->detectArguments( xDataSource ));
-
- OUString aOldRange;
- beans::PropertyValue * pCellRange = 0;
- for( sal_Int32 i=0; i<aArguments.getLength(); ++i )
+ if( aArguments[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("CellRangeRepresentation")))
{
- if( aArguments[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("CellRangeRepresentation")))
- {
- pCellRange = (aArguments.getArray() + i);
- aArguments[i].Value >>= aOldRange;
- break;
- }
+ pCellRange = (aArguments.getArray() + i);
+ aArguments[i].Value >>= aOldRange;
+ break;
}
- if( pCellRange )
+ }
+ if( pCellRange )
+ {
+ // copy means add ranges, move means replace
+ if( rEvt.mnAction == DND_ACTION_COPY )
+ {
+ // @todo: using implcit knowledge that ranges can be
+ // merged with ";". This should be done more general
+ pCellRange->Value <<= (aOldRange + OUString( sal_Unicode(';')) + aRangeString );
+ }
+ // move means replace range
+ else
{
- // copy means add ranges, move means replace
- if( rEvt.mnAction == DND_ACTION_COPY )
- {
- // @todo: using implcit knowledge that ranges can be
- // merged with ";". This should be done more general
- pCellRange->Value <<= (aOldRange + OUString( sal_Unicode(';')) + aRangeString );
- }
- // move means replace range
- else
- {
- pCellRange->Value <<= aRangeString;
- }
-
- xDataSource.set( xDataProvider->createDataSource( aArguments ));
- aTempWithServ.first->changeDiagramData(
- m_xChartDocument->getFirstDiagram(),
- xDataSource,
- aArguments );
-
- // always return copy state to avoid deletion of the
- // dragged range
- nResult = DND_ACTION_COPY;
+ pCellRange->Value <<= aRangeString;
}
+
+ xDataSource.set( xDataProvider->createDataSource( aArguments ));
+ xDiagram->setDiagramData( xDataSource, aArguments );
+
+ // always return copy state to avoid deletion of the dragged range
+ nResult = DND_ACTION_COPY;
}
}
}
diff --git a/chart2/source/controller/main/ChartModelClone.cxx b/chart2/source/controller/main/ChartModelClone.cxx
new file mode 100755
index 000000000000..69991eb081df
--- /dev/null
+++ b/chart2/source/controller/main/ChartModelClone.cxx
@@ -0,0 +1,280 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_chart2.hxx"
+
+#include "ChartModelClone.hxx"
+#include "ChartModelHelper.hxx"
+#include "ControllerLockGuard.hxx"
+#include "DataSourceHelper.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
+#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>
+/** === end UNO includes === **/
+
+#include <comphelper/property.hxx>
+#include <tools/diagnose_ex.h>
+
+//......................................................................................................................
+namespace chart
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::frame::XModel;
+ using ::com::sun::star::util::XCloneable;
+ using ::com::sun::star::chart2::XChartDocument;
+ 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;
+ /** === end UNO using === **/
+
+ // =================================================================================================================
+ // = helper
+ // =================================================================================================================
+ namespace
+ {
+ Reference< XModel > lcl_cloneModel( const Reference< XModel > & xModel )
+ {
+ Reference< XModel > xResult;
+ try
+ {
+ const Reference< XCloneable > xCloneable( xModel, UNO_QUERY_THROW );
+ xResult.set( xCloneable->createClone(), UNO_QUERY_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return xResult;
+ }
+
+ }
+
+ // =================================================================================================================
+ // = ChartModelClone
+ // =================================================================================================================
+ // -----------------------------------------------------------------------------------------------------------------
+ ChartModelClone::ChartModelClone( const Reference< XModel >& i_model, const ModelFacet i_facet )
+ {
+ m_xModelClone.set( lcl_cloneModel( i_model ) );
+
+ try
+ {
+ if ( i_facet == E_MODEL_WITH_DATA )
+ {
+ const Reference< XChartDocument > xChartDoc( m_xModelClone, UNO_QUERY_THROW );
+ ENSURE_OR_THROW( xChartDoc->hasInternalDataProvider(), "invalid chart model" );
+
+ const Reference< XCloneable > xCloneable( xChartDoc->getDataProvider(), UNO_QUERY_THROW );
+ m_xDataClone.set( xCloneable->createClone(), UNO_QUERY_THROW );
+ }
+
+ if ( i_facet == E_MODEL_WITH_SELECTION )
+ {
+ const Reference< XSelectionSupplier > xSelSupp( m_xModelClone->getCurrentController(), UNO_QUERY_THROW );
+ m_aSelection = xSelSupp->getSelection();
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+
+ // -----------------------------------------------------------------------------------------------------------------
+ ChartModelClone::~ChartModelClone()
+ {
+ if ( !impl_isDisposed() )
+ dispose();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void ChartModelClone::dispose()
+ {
+ if ( impl_isDisposed() )
+ return;
+
+ try
+ {
+ Reference< XComponent > xComp( m_xModelClone, UNO_QUERY_THROW );
+ xComp->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ m_xModelClone.clear();
+ m_xDataClone.clear();
+ m_aSelection.clear();
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ ModelFacet ChartModelClone::getFacet() const
+ {
+ if ( m_aSelection.hasValue() )
+ return E_MODEL_WITH_SELECTION;
+ if ( m_xDataClone.is() )
+ return E_MODEL_WITH_DATA;
+ return E_MODEL;
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void ChartModelClone::applyToModel( const Reference< XModel >& i_model ) const
+ {
+ applyModelContentToModel( i_model, m_xModelClone, m_xDataClone );
+
+ if ( m_aSelection.hasValue() )
+ {
+ try
+ {
+ Reference< XSelectionSupplier > xCurrentSelectionSuppl( i_model->getCurrentController(), UNO_QUERY_THROW );
+ xCurrentSelectionSuppl->select( m_aSelection );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ void ImplApplyDataToModel( const Reference< XModel >& i_model, const Reference< XInternalDataProvider > & i_data )
+ {
+ Reference< XChartDocument > xDoc( i_model, UNO_QUERY );
+ OSL_ASSERT( xDoc.is() && xDoc->hasInternalDataProvider() );
+
+ // copy data from stored internal data provider
+ if( xDoc.is() && xDoc->hasInternalDataProvider())
+ {
+ Reference< XAnyDescriptionAccess > xCurrentData( xDoc->getDataProvider(), UNO_QUERY );
+ Reference< XAnyDescriptionAccess > xSavedData( i_data, UNO_QUERY );
+ if ( xCurrentData.is() && xSavedData.is() )
+ {
+ xCurrentData->setData( xSavedData->getData() );
+ xCurrentData->setAnyRowDescriptions( xSavedData->getAnyRowDescriptions());
+ xCurrentData->setAnyColumnDescriptions( xSavedData->getAnyColumnDescriptions());
+ }
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ void ChartModelClone::applyModelContentToModel( const Reference< XModel >& i_model,
+ const Reference< XModel >& i_modelToCopyFrom, const Reference< XInternalDataProvider >& i_data )
+ {
+ ENSURE_OR_RETURN_VOID( i_model.is(), "ChartModelElement::applyModelContentToModel: invalid source model!" );
+ ENSURE_OR_RETURN_VOID( i_modelToCopyFrom.is(), "ChartModelElement::applyModelContentToModel: invalid source model!" );
+ try
+ {
+ // /-- loccked controllers of destination
+ ControllerLockGuard aLockedControllers( i_model );
+ Reference< XChartDocument > xSource( i_modelToCopyFrom, UNO_QUERY_THROW );
+ Reference< XChartDocument > xDestination( i_model, UNO_QUERY_THROW );
+
+ // 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 );
+
+ // diagram
+ xDestination->setFirstDiagram( xSource->getFirstDiagram() );
+
+ // main title
+ Reference< XTitled > xDestinationTitled( xDestination, UNO_QUERY_THROW );
+ Reference< XTitled > xSourceTitled( xSource, UNO_QUERY_THROW );
+ xDestinationTitled->setTitleObject( xSourceTitled->getTitleObject() );
+
+ // page background
+ ::comphelper::copyProperties(
+ xSource->getPageBackground(),
+ xDestination->getPageBackground() );
+
+ // apply data (not applied in standard Undo)
+ if ( i_data.is() )
+ ImplApplyDataToModel( i_model, i_data );
+
+ // register all sequences at the internal data provider to get adapted
+ // indexes when columns are added/removed
+ if ( xDestination->hasInternalDataProvider() )
+ {
+ Reference< XInternalDataProvider > xNewDataProvider( xDestination->getDataProvider(), UNO_QUERY );
+ Reference< XDataSource > xUsedData( DataSourceHelper::getUsedData( i_model ) );
+ if ( xUsedData.is() && xNewDataProvider.is() )
+ {
+ Sequence< Reference< XLabeledDataSequence > > aData( xUsedData->getDataSequences() );
+ for( sal_Int32 i=0; i<aData.getLength(); ++i )
+ {
+ xNewDataProvider->registerDataSequenceForChanges( aData[i]->getValues() );
+ xNewDataProvider->registerDataSequenceForChanges( aData[i]->getLabel() );
+ }
+ }
+ }
+
+ // restore modify status
+ Reference< XModifiable > xSourceMod( xSource, UNO_QUERY );
+ Reference< XModifiable > xDestMod( xDestination, UNO_QUERY );
+ if ( xSourceMod.is() && xDestMod.is() && !xSourceMod->isModified() )
+ {
+ xDestMod->setModified( sal_False );
+ }
+ // \-- loccked controllers of destination
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+
+//......................................................................................................................
+} // namespace chart
+//......................................................................................................................
diff --git a/chart2/source/controller/main/ChartModelClone.hxx b/chart2/source/controller/main/ChartModelClone.hxx
new file mode 100755
index 000000000000..d5653b8e1ccc
--- /dev/null
+++ b/chart2/source/controller/main/ChartModelClone.hxx
@@ -0,0 +1,89 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef CHART2_CHARTMODELCLONE_HXX
+#define CHART2_CHARTMODELCLONE_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/chart2/XInternalDataProvider.hpp>
+/** === end UNO includes === **/
+
+#include <boost/noncopyable.hpp>
+
+//......................................................................................................................
+namespace chart
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= ModelFacet
+ //==================================================================================================================
+ enum ModelFacet
+ {
+ E_MODEL,
+ E_MODEL_WITH_DATA,
+ E_MODEL_WITH_SELECTION
+ };
+
+ //==================================================================================================================
+ //= ChartModelClone
+ //==================================================================================================================
+ class ChartModelClone : public ::boost::noncopyable
+ {
+ public:
+ ChartModelClone(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_model,
+ const ModelFacet i_facet
+ );
+
+ ~ChartModelClone();
+
+ ModelFacet getFacet() const;
+
+ void applyToModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_model ) const;
+
+ static void applyModelContentToModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & i_model,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & i_modelToCopyFrom,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XInternalDataProvider > & i_data );
+
+ void dispose();
+
+ private:
+ bool impl_isDisposed() const { return !m_xModelClone.is(); }
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModelClone;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XInternalDataProvider > m_xDataClone;
+ ::com::sun::star::uno::Any m_aSelection;
+ };
+
+//......................................................................................................................
+} // namespace chart
+//......................................................................................................................
+
+#endif // CHART2_CHARTMODELCLONE_HXX
diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx
index bb142a212985..35819ef2a648 100644
--- a/chart2/source/controller/main/ChartTransferable.cxx
+++ b/chart2/source/controller/main/ChartTransferable.cxx
@@ -65,7 +65,7 @@ ChartTransferable::ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelected
pExchgView->MarkObj( pSelectedObj, pPv );
else
pExchgView->MarkAllObj( pPv );
- Graphic aGraphic( pExchgView->GetMarkedObjMetaFile( TRUE ));
+ Graphic aGraphic( pExchgView->GetMarkedObjMetaFile( sal_True ));
m_xMetaFileGraphic.set( aGraphic.GetXGraphic());
if ( m_bDrawing )
{
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 45a206abff55..c1dc9924f291 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -60,14 +60,14 @@ ChartWindow::ChartWindow( WindowController* pWindowController, Window* pParent,
, m_pWindowController( pWindowController )
, m_bInPaint(false)
{
- this->SetSmartHelpId( SmartId( HID_SCH_WIN_DOCUMENT ) );
+ this->SetHelpId( HID_SCH_WIN_DOCUMENT );
this->SetMapMode( MapMode(MAP_100TH_MM) );
adjustHighContrastMode();
// chart does not depend on exact pixel painting => enable antialiased drawing
SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW | GetAntialiasing() );
- EnableRTL( FALSE );
+ EnableRTL( sal_False );
if( pParent )
- pParent->EnableRTL( FALSE );// #i96215# necessary for a correct position of the context menu in rtl mode
+ pParent->EnableRTL( sal_False );// #i96215# necessary for a correct position of the context menu in rtl mode
}
ChartWindow::~ChartWindow()
@@ -248,19 +248,19 @@ void ChartWindow::ForceInvalidate()
{
::Window::Invalidate();
}
-void ChartWindow::Invalidate( USHORT nFlags )
+void ChartWindow::Invalidate( sal_uInt16 nFlags )
{
if( m_bInPaint ) // #i101928# superfluous paint calls while entering and editing charts"
return;
::Window::Invalidate( nFlags );
}
-void ChartWindow::Invalidate( const Rectangle& rRect, USHORT nFlags )
+void ChartWindow::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags )
{
if( m_bInPaint ) // #i101928# superfluous paint calls while entering and editing charts"
return;
::Window::Invalidate( rRect, nFlags );
}
-void ChartWindow::Invalidate( const Region& rRegion, USHORT nFlags )
+void ChartWindow::Invalidate( const Region& rRegion, sal_uInt16 nFlags )
{
if( m_bInPaint ) // #i101928# superfluous paint calls while entering and editing charts"
return;
diff --git a/chart2/source/controller/main/ChartWindow.hxx b/chart2/source/controller/main/ChartWindow.hxx
index d471b51d28d7..99737e469c90 100644
--- a/chart2/source/controller/main/ChartWindow.hxx
+++ b/chart2/source/controller/main/ChartWindow.hxx
@@ -69,9 +69,9 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt );
void ForceInvalidate();
- virtual void Invalidate( USHORT nFlags = 0 );
- virtual void Invalidate( const Rectangle& rRect, USHORT nFlags = 0 );
- virtual void Invalidate( const Region& rRegion, USHORT nFlags = 0 );
+ virtual void Invalidate( sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
+ virtual void Invalidate( const Region& rRegion, sal_uInt16 nFlags = 0 );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
diff --git a/chart2/source/controller/main/CommandDispatchContainer.hxx b/chart2/source/controller/main/CommandDispatchContainer.hxx
index b698494a9f1e..7c9f0dc2122c 100644
--- a/chart2/source/controller/main/CommandDispatchContainer.hxx
+++ b/chart2/source/controller/main/CommandDispatchContainer.hxx
@@ -29,7 +29,6 @@
#define CHART2_COMMANDDISPATCHCONTAINER_HXX
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/DispatchDescriptor.hpp>
@@ -138,9 +137,8 @@ private:
mutable tDispatchMap m_aCachedDispatches;
mutable tDisposeVector m_aToBeDisposedDispatches;
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
- ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XModel > m_xModel;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XModel > m_xModel;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xChartDispatcher;
::std::set< ::rtl::OUString > m_aChartCommands;
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index 4f4f91022c18..b4d25161f467 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -387,7 +387,7 @@ void DrawCommandDispatch::execute( const ::rtl::OUString& rCommand, const Sequen
{
SolarMutexGuard aGuard;
m_pChartController->setDrawMode( eDrawMode );
- setInsertObj( sal::static_int_cast< USHORT >( eKind ) );
+ setInsertObj( sal::static_int_cast< sal_uInt16 >( eKind ) );
if ( bCreate )
{
pDrawViewWrapper->SetCreateMode();
@@ -444,7 +444,7 @@ void DrawCommandDispatch::describeSupportedFeatures()
implDescribeSupportedFeature( ".uno:StarShapes", COMMAND_ID_DRAWTBX_CS_STAR, CommandGroup::INSERT );
}
-void DrawCommandDispatch::setInsertObj( USHORT eObj )
+void DrawCommandDispatch::setInsertObj( sal_uInt16 eObj )
{
DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
if ( pDrawViewWrapper )
@@ -528,13 +528,13 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
if ( pTextObj )
{
pTextObj->SetLogicRect( aRect );
- BOOL bVertical = ( nID == SID_DRAW_TEXT_VERTICAL );
+ sal_Bool bVertical = ( nID == SID_DRAW_TEXT_VERTICAL );
pTextObj->SetVerticalWriting( bVertical );
if ( bVertical )
{
SfxItemSet aSet( pDrawModelWrapper->GetItemPool() );
- aSet.Put( SdrTextAutoGrowWidthItem( TRUE ) );
- aSet.Put( SdrTextAutoGrowHeightItem( FALSE ) );
+ aSet.Put( SdrTextAutoGrowWidthItem( sal_True ) );
+ aSet.Put( SdrTextAutoGrowHeightItem( sal_False ) );
aSet.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_TOP ) );
aSet.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_RIGHT ) );
pTextObj->SetMergedItemSet( aSet );
diff --git a/chart2/source/controller/main/DrawCommandDispatch.hxx b/chart2/source/controller/main/DrawCommandDispatch.hxx
index 1af8086d6f72..6ac74e052c10 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.hxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.hxx
@@ -77,7 +77,7 @@ protected:
virtual void describeSupportedFeatures();
private:
- void setInsertObj( USHORT eObj );
+ void setInsertObj( sal_uInt16 eObj );
SdrObject* createDefaultObject( const sal_uInt16 nID );
bool parseCommandURL( const ::rtl::OUString& rCommandURL, sal_uInt16* pnFeatureId, ::rtl::OUString* pBaseCommand, ::rtl::OUString* pCustomShapeType );
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index 16f7592fe5a9..49d13eca7112 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -163,9 +163,9 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
}
}
- USHORT nEntryPosToSelect = 0; bool bSelectionFound = false;
+ sal_uInt16 nEntryPosToSelect = 0; bool bSelectionFound = false;
aIt = m_aEntries.begin();
- for( USHORT nN=0; aIt != m_aEntries.end(); ++aIt, ++nN )
+ for( sal_uInt16 nN=0; aIt != m_aEntries.end(); ++aIt, ++nN )
{
InsertEntry( aIt->UIName );
if ( !bSelectionFound && aSelectedOID == aIt->OID )
@@ -178,7 +178,7 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
if( bSelectionFound )
SelectEntryPos(nEntryPosToSelect);
- USHORT nEntryCount = GetEntryCount();
+ sal_uInt16 nEntryCount = GetEntryCount();
if( nEntryCount > 100 )
nEntryCount = 100;
SetDropDownLineCount( nEntryCount );
@@ -206,7 +206,7 @@ void SelectorListBox::Select()
if ( !IsTravelSelect() )
{
- USHORT nPos = GetSelectEntryPos();
+ sal_uInt16 nPos = GetSelectEntryPos();
if( nPos < m_aEntries.size() )
{
ObjectHierarchy::tOID aOID = m_aEntries[nPos].OID;
@@ -224,7 +224,7 @@ long SelectorListBox::Notify( NotifyEvent& rNEvt )
if ( rNEvt.GetType() == EVENT_KEYINPUT )
{
- USHORT nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode();
+ sal_uInt16 nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode();
switch ( nCode )
{
diff --git a/chart2/source/controller/main/ImplUndoManager.cxx b/chart2/source/controller/main/ImplUndoManager.cxx
deleted file mode 100644
index 90bc3394ba2f..000000000000
--- a/chart2/source/controller/main/ImplUndoManager.cxx
+++ /dev/null
@@ -1,506 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_chart2.hxx"
-
-#include "ImplUndoManager.hxx"
-#include "DisposeHelper.hxx"
-#include "CommonFunctors.hxx"
-#include "ControllerLockGuard.hxx"
-#include "PropertyHelper.hxx"
-#include "DataSourceHelper.hxx"
-#include "ChartModelHelper.hxx"
-
-#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XInternalDataProvider.hpp>
-#include <com/sun/star/chart2/XTitled.hpp>
-#include <com/sun/star/util/XCloneable.hpp>
-#include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/view/XSelectionSupplier.hpp>
-
-#include <boost/bind.hpp>
-#include <algorithm>
-
-using namespace ::com::sun::star;
-
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::rtl::OUString;
-using ::com::sun::star::chart::XComplexDescriptionAccess;
-
-namespace chart
-{
-namespace impl
-{
-
-void ImplApplyDataToModel(
- Reference< frame::XModel > & xInOutModelToChange,
- const Reference< chart2::XInternalDataProvider > & xData )
-{
- Reference< chart2::XChartDocument > xDoc( xInOutModelToChange, uno::UNO_QUERY );
- OSL_ASSERT( xDoc.is() && xDoc->hasInternalDataProvider());
-
- // copy data from stored internal data provider
- if( xDoc.is() && xDoc->hasInternalDataProvider())
- {
- Reference< XComplexDescriptionAccess > xCurrentData( xDoc->getDataProvider(), uno::UNO_QUERY );
- Reference< XComplexDescriptionAccess > xSavedData( xData, uno::UNO_QUERY );
- if( xCurrentData.is() && xSavedData.is())
- {
- xCurrentData->setData( xSavedData->getData());
- xCurrentData->setComplexRowDescriptions( xSavedData->getComplexRowDescriptions());
- xCurrentData->setComplexColumnDescriptions( xSavedData->getComplexColumnDescriptions());
- }
- }
-}
-
-// ----------------------------------------
-
-UndoElement::UndoElement(
- const OUString & rActionString,
- const Reference< frame::XModel > & xModel ) :
- m_aActionString( rActionString )
-{
- initialize( xModel );
-}
-
-UndoElement::UndoElement(
- const Reference< frame::XModel > & xModel )
-{
- initialize( xModel );
-}
-
-UndoElement::UndoElement( const UndoElement & rOther ) :
- m_aActionString( rOther.m_aActionString )
-{
- initialize( rOther.m_xModel );
-}
-
-UndoElement::~UndoElement()
-{}
-
-void UndoElement::initialize( const Reference< frame::XModel > & xModel )
-{
- if ( xModel.is() )
- {
- m_xModel.set( UndoElement::cloneModel( xModel ) );
- }
-}
-
-void UndoElement::dispose()
-{
- Reference< lang::XComponent > xComp( m_xModel, uno::UNO_QUERY );
- if( xComp.is())
- xComp->dispose();
- m_xModel.set( 0 );
-}
-
-void UndoElement::applyToModel(
- Reference< frame::XModel > & xInOutModelToChange )
-{
- UndoElement::applyModelContentToModel( xInOutModelToChange, m_xModel );
-}
-
-UndoElement * UndoElement::createFromModel(
- const Reference< frame::XModel > & xModel )
-{
- return new UndoElement( getActionString(), xModel );
-}
-
-void UndoElement::setActionString( const ::rtl::OUString & rActionString )
-{
- m_aActionString = rActionString;
-}
-
-OUString UndoElement::getActionString() const
-{
- return m_aActionString;
-}
-
-Reference< frame::XModel > UndoElement::cloneModel( const Reference< frame::XModel > & xModel )
-{
- Reference< frame::XModel > xResult;
- uno::Reference< util::XCloneable > xCloneable( xModel, uno::UNO_QUERY );
- OSL_ENSURE( xCloneable.is(), "Cannot clone model" );
- if( xCloneable.is())
- xResult.set( xCloneable->createClone(), uno::UNO_QUERY );
-
- return xResult;
-}
-
-void UndoElement::applyModelContentToModel(
- Reference< frame::XModel > & xInOutModelToChange,
- const Reference< frame::XModel > & xModelToCopyFrom,
- const Reference< chart2::XInternalDataProvider > & xData /* = 0 */ )
-{
-
- if( xModelToCopyFrom.is() && xInOutModelToChange.is())
- {
- try
- {
- // /-- loccked controllers of destination
- ControllerLockGuard aLockedControllers( xInOutModelToChange );
- Reference< chart2::XChartDocument > xSource( xModelToCopyFrom, uno::UNO_QUERY_THROW );
- Reference< chart2::XChartDocument > xDestination( xInOutModelToChange, uno::UNO_QUERY_THROW );
-
- // propagate the correct flag for plotting of hidden values to the data provider and all used sequences
- ChartModelHelper::setIncludeHiddenCells( ChartModelHelper::isIncludeHiddenCells( xModelToCopyFrom ) , xInOutModelToChange );
-
- // diagram
- xDestination->setFirstDiagram( xSource->getFirstDiagram());
-
- // main title
- Reference< chart2::XTitled > xDestinationTitled( xDestination, uno::UNO_QUERY_THROW );
- Reference< chart2::XTitled > xSourceTitled( xSource, uno::UNO_QUERY_THROW );
- xDestinationTitled->setTitleObject( xSourceTitled->getTitleObject());
-
- // page background
- comphelper::copyProperties(
- xSource->getPageBackground(),
- xDestination->getPageBackground() );
-
- // apply data (not applied in standard Undo)
- if( xData.is())
- ImplApplyDataToModel( xInOutModelToChange, xData );
-
- // register all sequences at the internal data provider to get adapted
- // indexes when columns are added/removed
- if( xDestination->hasInternalDataProvider())
- {
- Reference< chart2::XInternalDataProvider > xNewDataProvider( xDestination->getDataProvider(), uno::UNO_QUERY );
- Reference< chart2::data::XDataSource > xUsedData( DataSourceHelper::getUsedData( xInOutModelToChange ));
- if( xUsedData.is() && xNewDataProvider.is())
- {
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aData( xUsedData->getDataSequences());
- for( sal_Int32 i=0; i<aData.getLength(); ++i )
- {
- xNewDataProvider->registerDataSequenceForChanges( aData[i]->getValues());
- xNewDataProvider->registerDataSequenceForChanges( aData[i]->getLabel());
- }
- }
- }
-
- // restore modify status
- Reference< util::XModifiable > xSourceMod( xSource, uno::UNO_QUERY );
- Reference< util::XModifiable > xDestMod( xDestination, uno::UNO_QUERY );
- if( xSourceMod.is() && xDestMod.is() &&
- ! xSourceMod->isModified() )
- {
- xDestMod->setModified( sal_False );
- }
- // \-- loccked controllers of destination
- }
- catch( uno::Exception & )
- {
- }
- }
-}
-
-// ----------------------------------------
-
-UndoElementWithData::UndoElementWithData(
- const OUString & rActionString,
- const Reference< frame::XModel > & xModel ) :
- UndoElement( rActionString, xModel )
-{
- initializeData();
-}
-
-UndoElementWithData::UndoElementWithData(
- const Reference< frame::XModel > & xModel ) :
- UndoElement( xModel )
-{
- initializeData();
-}
-
-
-UndoElementWithData::UndoElementWithData(
- const UndoElementWithData & rOther ) :
- UndoElement( rOther )
-{
- initializeData();
-}
-
-UndoElementWithData::~UndoElementWithData()
-{}
-
-void UndoElementWithData::initializeData()
-{
- try
- {
- Reference< chart2::XChartDocument > xChartDoc( m_xModel, uno::UNO_QUERY_THROW );
- OSL_ASSERT( xChartDoc->hasInternalDataProvider());
- if( xChartDoc->hasInternalDataProvider())
- {
- Reference< util::XCloneable > xCloneable( xChartDoc->getDataProvider(), uno::UNO_QUERY );
- OSL_ENSURE( xCloneable.is(), "Cannot clone data" );
- if( xCloneable.is())
- m_xData.set( xCloneable->createClone(), uno::UNO_QUERY );
- }
- }
- catch( uno::Exception & )
- {
- }
-}
-
-void UndoElementWithData::dispose()
-{
- UndoElement::dispose();
- m_xData.set( 0 );
-}
-
-void UndoElementWithData::applyToModel(
- Reference< frame::XModel > & xInOutModelToChange )
-{
- UndoElement::applyModelContentToModel( xInOutModelToChange, m_xModel, m_xData );
-}
-
-UndoElement * UndoElementWithData::createFromModel(
- const Reference< frame::XModel > & xModel )
-{
- return new UndoElementWithData( getActionString(), xModel );
-}
-
-// ========================================
-
-// ----------------------------------------
-
-UndoElementWithSelection::UndoElementWithSelection(
- const OUString & rActionString,
- const Reference< frame::XModel > & xModel ) :
- UndoElement( rActionString, xModel )
-{
- initialize( xModel );
-}
-
-UndoElementWithSelection::UndoElementWithSelection(
- const Reference< frame::XModel > & xModel ) :
- UndoElement( xModel )
-{
- initialize( xModel );
-}
-
-UndoElementWithSelection::UndoElementWithSelection(
- const UndoElementWithSelection & rOther ) :
- UndoElement( rOther )
-{
- initialize( rOther.m_xModel );
-}
-
-UndoElementWithSelection::~UndoElementWithSelection()
-{}
-
-void UndoElementWithSelection::initialize( const Reference< frame::XModel > & xModel )
-{
- try
- {
- uno::Reference< view::XSelectionSupplier > xSelSupp( xModel->getCurrentController(), uno::UNO_QUERY );
- OSL_ASSERT( xSelSupp.is() );
-
- if( xSelSupp.is() )
- m_aSelection = xSelSupp->getSelection();
- }
- catch( const uno::Exception & )
- {
- }
-}
-
-void UndoElementWithSelection::dispose()
-{
- UndoElement::dispose();
- m_aSelection.clear();
-}
-
-void UndoElementWithSelection::applyToModel(
- Reference< frame::XModel > & xInOutModelToChange )
-{
- UndoElement::applyModelContentToModel( xInOutModelToChange, m_xModel );
- Reference< view::XSelectionSupplier > xCurrentSelectionSuppl( xInOutModelToChange->getCurrentController(), uno::UNO_QUERY );
- OSL_ASSERT( xCurrentSelectionSuppl.is() );
-
- if( xCurrentSelectionSuppl.is())
- xCurrentSelectionSuppl->select( m_aSelection );
-}
-
-UndoElement * UndoElementWithSelection::createFromModel(
- const Reference< frame::XModel > & xModel )
-{
- return new UndoElementWithSelection( getActionString(), xModel );
-}
-
-// ----------------------------------------
-
-ShapeUndoElement::ShapeUndoElement( const OUString& rActionString, SdrUndoAction* pAction )
- :UndoElement( rActionString, Reference< frame::XModel >() )
- ,m_pAction( pAction )
-{
-}
-
-ShapeUndoElement::ShapeUndoElement( const ShapeUndoElement& rOther )
- :UndoElement( rOther )
- ,m_pAction( rOther.m_pAction )
-{
-}
-
-ShapeUndoElement::~ShapeUndoElement()
-{
-}
-
-SdrUndoAction* ShapeUndoElement::getSdrUndoAction()
-{
- return m_pAction;
-}
-
-// ========================================
-
-UndoStack::UndoStack() :
- m_nSizeLimit( 1000 )
-{
-}
-
-UndoStack::~UndoStack()
-{
- disposeAndClear();
-}
-
-void UndoStack::pop()
-{
- if( ! empty())
- {
- top()->dispose();
- delete top();
- m_aStack.pop_back();
- }
-}
-
-void UndoStack::push( UndoElement * pElement )
-{
- m_aStack.push_back( pElement );
- applyLimitation();
-}
-
-UndoElement * UndoStack::top() const
-{
- return m_aStack.back();
-}
-
-OUString UndoStack::topUndoString() const
-{
- if( ! empty())
- return top()->getActionString();
- return OUString();
-}
-
-Sequence< OUString > UndoStack::getUndoStrings() const
-{
- sal_Int32 nSize( static_cast< sal_Int32 >( m_aStack.size()));
- Sequence< OUString > aResult( nSize );
- for( sal_Int32 i=0; i<nSize; ++i )
- aResult[i] = m_aStack[i]->getActionString();
- return aResult;
-}
-
-bool UndoStack::empty() const
-{
- return m_aStack.empty();
-}
-
-void UndoStack::disposeAndClear()
-{
- ::std::for_each( m_aStack.begin(), m_aStack.end(), ::boost::mem_fn( & UndoElement::dispose ));
- ::std::for_each( m_aStack.begin(), m_aStack.end(), CommonFunctors::DeletePtr< UndoElement >() );
- m_aStack.clear();
-}
-
-void UndoStack::limitSize( sal_Int32 nMaxSize )
-{
- m_nSizeLimit = nMaxSize;
- applyLimitation();
-}
-
-void UndoStack::applyLimitation()
-{
- if( m_aStack.size() > static_cast< sal_uInt32 >( m_nSizeLimit ))
- {
- tUndoStackType::iterator aBegin( m_aStack.begin());
- tUndoStackType::iterator aEnd( aBegin + (m_aStack.size() - m_nSizeLimit));
- // dispose and remove all undo elements that are over the limit
- ::std::for_each( aBegin, aEnd, ::boost::mem_fn( & UndoElement::dispose ));
- ::std::for_each( aBegin, aEnd, CommonFunctors::DeletePtr< UndoElement >() );
- m_aStack.erase( aBegin, aEnd );
- }
-}
-
-// ================================================================================
-
-namespace
-{
-static const OUString aUndoStepsPropName( RTL_CONSTASCII_USTRINGPARAM("Steps"));
-} // anonymous namespace
-
-UndoStepsConfigItem::UndoStepsConfigItem( ConfigItemListener & rListener ) :
- ::utl::ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Undo"))),
- m_rListener( rListener )
-{
- EnableNotification( Sequence< OUString >( & aUndoStepsPropName, 1 ));
-}
-
-UndoStepsConfigItem::~UndoStepsConfigItem()
-{
-}
-
-void UndoStepsConfigItem::Notify( const Sequence< OUString > & aPropertyNames )
-{
- for( sal_Int32 nIdx=0; nIdx<aPropertyNames.getLength(); ++nIdx )
- {
- if( aPropertyNames[nIdx].equals( aUndoStepsPropName ))
- m_rListener.notify( aPropertyNames[nIdx] );
- }
-}
-
-void UndoStepsConfigItem::Commit()
-{
-}
-
-// mtehod is not const, because GetProperties is not const
-sal_Int32 UndoStepsConfigItem::getUndoSteps()
-{
- sal_Int32 nSteps = -1;
- Sequence< uno::Any > aValues(
- GetProperties( Sequence< OUString >( & aUndoStepsPropName, 1 )));
- if( aValues.getLength())
- aValues[0] >>= nSteps;
- return nSteps;
-}
-
-} // namespace impl
-} // namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/main/ImplUndoManager.hxx b/chart2/source/controller/main/ImplUndoManager.hxx
deleted file mode 100644
index 71d56758d51a..000000000000
--- a/chart2/source/controller/main/ImplUndoManager.hxx
+++ /dev/null
@@ -1,230 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CHART2_IMPLUNDOMANAGER_HXX
-#define CHART2_IMPLUNDOMANAGER_HXX
-
-#include "ConfigItemListener.hxx"
-
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#include <rtl/ustring.hxx>
-#include <unotools/configitem.hxx>
-
-#include <utility>
-#include <deque>
-
-
-class SdrUndoAction;
-
-namespace com { namespace sun { namespace star {
-namespace chart2 {
- class XInternalDataProvider;
-}
-}}}
-
-
-namespace chart
-{
-namespace impl
-{
-
-class UndoElement
-{
-public:
- UndoElement( const ::rtl::OUString & rActionString,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElement( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElement( const UndoElement & rOther );
- virtual ~UndoElement();
-
- virtual void dispose();
- virtual UndoElement * createFromModel(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
-
- virtual void applyToModel(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xInOutModelToChange );
-
- void setActionString( const ::rtl::OUString & rActionString );
- ::rtl::OUString getActionString() const;
-
- static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > cloneModel(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel );
-
- static void applyModelContentToModel(
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xInOutModelToChange,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModelToCopyFrom,
- const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XInternalDataProvider > & xData = 0 );
-
-protected:
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > m_xModel;
-
-private:
- void initialize( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
-
- ::rtl::OUString m_aActionString;
-};
-
-class UndoElementWithData : public UndoElement
-{
-public:
- UndoElementWithData( const ::rtl::OUString & rActionString,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElementWithData( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElementWithData( const UndoElementWithData & rOther );
- virtual ~UndoElementWithData();
-
- virtual void dispose();
- virtual UndoElement * createFromModel(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
-
- virtual void applyToModel(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xInOutModelToChange );
-
-private:
- void initializeData();
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XInternalDataProvider > m_xData;
-};
-
-class UndoElementWithSelection : public UndoElement
-{
-public:
- UndoElementWithSelection( const ::rtl::OUString & rActionString,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElementWithSelection( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- UndoElementWithSelection( const UndoElementWithSelection & rOther );
- virtual ~UndoElementWithSelection();
-
- virtual void dispose();
- virtual UndoElement * createFromModel(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
-
- virtual void applyToModel(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xInOutModelToChange );
-
-private:
- void initialize( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
-
- ::com::sun::star::uno::Any m_aSelection;
-};
-
-class ShapeUndoElement : public UndoElement
-{
-public:
- ShapeUndoElement( const ::rtl::OUString& rActionString, SdrUndoAction* pAction );
- ShapeUndoElement( const ShapeUndoElement& rOther );
- virtual ~ShapeUndoElement();
-
- SdrUndoAction* getSdrUndoAction();
-
-private:
- SdrUndoAction* m_pAction;
-};
-
-/** Note that all models that are put into this container are at some point
- disposed of inside this class. (At least in the destructor). That means
- the models retrieved here should never be used, but instead their content
- should be copied to a living model.
- */
-class UndoStack
-{
-public:
- UndoStack();
- // disposes of all models left in the stack
- ~UndoStack();
-
- // removes he last undo action and disposes of the model
- void pop();
- void push( UndoElement * rElement );
-
- // precondition: !empty()
- UndoElement * top() const;
- ::rtl::OUString topUndoString() const;
-
- ::com::sun::star::uno::Sequence< ::rtl::OUString > getUndoStrings() const;
-
- bool empty() const;
- void disposeAndClear();
-
- // removes all actions that have been inserted more than nMaxSize steps ago.
- // The models of those actions are disposed of
- void limitSize( sal_Int32 nMaxSize );
-
-private:
- void applyLimitation();
-
- typedef ::std::deque< UndoElement * > tUndoStackType;
-
- tUndoStackType m_aStack;
- sal_Int32 m_nSizeLimit;
-};
-
-// ----------------------------------------
-
-class UndoStepsConfigItem : public ::utl::ConfigItem
-{
-public:
- explicit UndoStepsConfigItem( ConfigItemListener & rListener );
- virtual ~UndoStepsConfigItem();
-
- sal_Int32 getUndoSteps();
-
-protected:
- // ____ ::utl::ConfigItem ____
- virtual void Notify( const ::com::sun::star::uno::Sequence< ::rtl::OUString > & aPropertyNames );
- virtual void Commit();
-
-private:
- ConfigItemListener & m_rListener;
-};
-
-
-} // namespace impl
-} // namespace chart
-
-// CHART2_IMPLUNDOMANAGER_HXX
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/main/PositionAndSizeHelper.cxx b/chart2/source/controller/main/PositionAndSizeHelper.cxx
index fd88410697f0..a392e3c8c1fc 100644
--- a/chart2/source/controller/main/PositionAndSizeHelper.cxx
+++ b/chart2/source/controller/main/PositionAndSizeHelper.cxx
@@ -34,6 +34,7 @@
#include "ChartModelHelper.hxx"
#include "ControllerLockGuard.hxx"
#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/RelativeSize.hpp>
#include "chartview/ExplicitValueProvider.hxx"
@@ -84,51 +85,12 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType
}
else if(OBJECTTYPE_LEGEND==eObjectType)
{
- LegendPosition ePos = LegendPosition_LINE_END;
- xObjectProp->getPropertyValue( C2U( "AnchorPosition" )) >>= ePos;
+ xObjectProp->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny(LegendPosition(LegendPosition_CUSTOM)));
+ xObjectProp->setPropertyValue( C2U( "Expansion" ), uno::makeAny(::com::sun::star::chart::ChartLegendExpansion_CUSTOM));
chart2::RelativePosition aRelativePosition;
+ chart2::RelativeSize aRelativeSize;
Point aAnchor = aObjectRect.TopLeft();
- switch( ePos )
- {
- case LegendPosition_LINE_START:
- {
- //@todo language dependent positions ...
- aRelativePosition.Anchor = drawing::Alignment_LEFT;
- aAnchor = aObjectRect.LeftCenter();
- }
- break;
- case LegendPosition_LINE_END:
- {
- //@todo language dependent positions ...
- aRelativePosition.Anchor = drawing::Alignment_RIGHT;
- aAnchor = aObjectRect.RightCenter();
- }
- break;
- case LegendPosition_PAGE_START:
- {
- //@todo language dependent positions ...
- aRelativePosition.Anchor = drawing::Alignment_TOP;
- aAnchor = aObjectRect.TopCenter();
- }
- break;
- case LegendPosition_PAGE_END:
- //@todo language dependent positions ...
- {
- aRelativePosition.Anchor = drawing::Alignment_BOTTOM;
- aAnchor = aObjectRect.BottomCenter();
- }
- break;
- case LegendPosition_CUSTOM:
- {
- //@todo language dependent positions ...
- aRelativePosition.Anchor = drawing::Alignment_TOP_LEFT;
- }
- break;
- case LegendPosition_MAKE_FIXED_SIZE:
- OSL_ASSERT( false );
- break;
- }
aRelativePosition.Primary =
static_cast< double >( aAnchor.X()) /
static_cast< double >( aPageRect.getWidth() );
@@ -137,6 +99,19 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType
static_cast< double >( aPageRect.getHeight());
xObjectProp->setPropertyValue( C2U( "RelativePosition" ), uno::makeAny(aRelativePosition) );
+
+ aRelativeSize.Primary =
+ static_cast< double >( aObjectRect.getWidth()) /
+ static_cast< double >( aPageRect.getWidth() );
+ if (aRelativeSize.Primary > 1.0)
+ aRelativeSize.Primary = 1.0;
+ aRelativeSize.Secondary =
+ static_cast< double >( aObjectRect.getHeight()) /
+ static_cast< double >( aPageRect.getHeight());
+ if (aRelativeSize.Secondary > 1.0)
+ aRelativeSize.Secondary = 1.0;
+
+ xObjectProp->setPropertyValue( C2U( "RelativeSize" ), uno::makeAny(aRelativeSize) );
}
else if(OBJECTTYPE_DIAGRAM==eObjectType || OBJECTTYPE_DIAGRAM_WALL==eObjectType || OBJECTTYPE_DIAGRAM_FLOOR==eObjectType)
{
diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx
index 967c059a7fba..12a5fc589878 100644
--- a/chart2/source/controller/main/SelectionHelper.cxx
+++ b/chart2/source/controller/main/SelectionHelper.cxx
@@ -276,10 +276,11 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper*
}
//check wether the diagram was hit but not selected (e.g. because it has no filling):
+ rtl::OUString aDiagramCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, rtl::OUString::valueOf( sal_Int32(0) ) );
rtl::OUString aWallCID( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString() ) );//@todo read CID from model
- if ( m_aSelectedOID.getObjectCID().equals( aPageCID ) || m_aSelectedOID.getObjectCID().equals( aWallCID ) || !m_aSelectedOID.isAutoGeneratedObject() )
+ bool bBackGroundHit = m_aSelectedOID.getObjectCID().equals( aPageCID ) || m_aSelectedOID.getObjectCID().equals( aWallCID ) || !m_aSelectedOID.isAutoGeneratedObject();
+ if( bBackGroundHit )
{
- rtl::OUString aDiagramCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, rtl::OUString::valueOf( sal_Int32(0) ) );
//todo: if more than one diagram is available in future do chack the list of all diagrams here
SdrObject* pDiagram = pDrawViewWrapper->getNamedSdrObject( aDiagramCID );
if( pDiagram )
@@ -291,6 +292,20 @@ void Selection::adaptSelectionToNewPos( const Point& rMousePos, DrawViewWrapper*
}
}
}
+ //check wether the legend was hit but not selected (e.g. because it has no filling):
+ if( bBackGroundHit || m_aSelectedOID.getObjectCID().equals( aDiagramCID ) )
+ {
+ rtl::OUString aLegendCID( ObjectIdentifier::createClassifiedIdentifierForParticle( ObjectIdentifier::createParticleForLegend(0,0) ) );//@todo read CID from model
+ SdrObject* pLegend = pDrawViewWrapper->getNamedSdrObject( aLegendCID );
+ if( pLegend )
+ {
+ if( pDrawViewWrapper->IsObjectHit( pLegend, rMousePos ) )
+ {
+ m_aSelectedOID = ObjectIdentifier( aLegendCID );
+ pNewObj = pLegend;
+ }
+ }
+ }
}
}
@@ -309,6 +324,7 @@ bool Selection::isResizeableObjectSelected()
case OBJECTTYPE_DIAGRAM:
case OBJECTTYPE_DIAGRAM_WALL:
case OBJECTTYPE_SHAPE:
+ case OBJECTTYPE_LEGEND:
return true;
default:
return false;
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index e3a76704abb6..342b421d84b0 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -263,6 +263,7 @@ IMPL_LINK( ShapeController, CheckNameHdl, AbstractSvxNameDialog*, pDialog )
void ShapeController::executeDispatch_FormatLine()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -272,12 +273,11 @@ void ShapeController::executeDispatch_FormatLine()
{
SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ sal_Bool bHasMarked = pDrawViewWrapper->AreObjectsMarked();
if ( bHasMarked )
{
- pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
+ pDrawViewWrapper->MergeAttrFromMarked( aAttr, sal_False );
}
- SolarMutexGuard aGuard;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -289,11 +289,11 @@ void ShapeController::executeDispatch_FormatLine()
const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
if ( bHasMarked )
{
- pDrawViewWrapper->SetAttrToMarked( *pOutAttr, FALSE );
+ pDrawViewWrapper->SetAttrToMarked( *pOutAttr, sal_False );
}
else
{
- pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
+ pDrawViewWrapper->SetDefaultAttr( *pOutAttr, sal_False );
}
}
}
@@ -303,6 +303,7 @@ void ShapeController::executeDispatch_FormatLine()
void ShapeController::executeDispatch_FormatArea()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -311,12 +312,11 @@ void ShapeController::executeDispatch_FormatArea()
if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
{
SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ sal_Bool bHasMarked = pDrawViewWrapper->AreObjectsMarked();
if ( bHasMarked )
{
- pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
+ pDrawViewWrapper->MergeAttrFromMarked( aAttr, sal_False );
}
- SolarMutexGuard aGuard;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -337,11 +337,11 @@ void ShapeController::executeDispatch_FormatArea()
const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
if ( bHasMarked )
{
- pDrawViewWrapper->SetAttrToMarked( *pOutAttr, FALSE );
+ pDrawViewWrapper->SetAttrToMarked( *pOutAttr, sal_False );
}
else
{
- pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
+ pDrawViewWrapper->SetDefaultAttr( *pOutAttr, sal_False );
}
}
}
@@ -352,6 +352,7 @@ void ShapeController::executeDispatch_FormatArea()
void ShapeController::executeDispatch_TextAttributes()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -359,12 +360,11 @@ void ShapeController::executeDispatch_TextAttributes()
if ( pParent && pDrawViewWrapper )
{
SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ sal_Bool bHasMarked = pDrawViewWrapper->AreObjectsMarked();
if ( bHasMarked )
{
- pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
+ pDrawViewWrapper->MergeAttrFromMarked( aAttr, sal_False );
}
- SolarMutexGuard aGuard;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -379,7 +379,7 @@ void ShapeController::executeDispatch_TextAttributes()
}
else
{
- pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
+ pDrawViewWrapper->SetDefaultAttr( *pOutAttr, sal_False );
}
}
}
@@ -389,6 +389,7 @@ void ShapeController::executeDispatch_TextAttributes()
void ShapeController::executeDispatch_TransformDialog()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -403,7 +404,6 @@ void ShapeController::executeDispatch_TransformDialog()
pDrawViewWrapper->GetAttributes( aAttr );
// item set for position and size
SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
- SolarMutexGuard aGuard;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -411,7 +411,7 @@ void ShapeController::executeDispatch_TransformDialog()
pFact->CreateCaptionDialog( pParent, pDrawViewWrapper ) );
if ( pDlg.get() )
{
- const USHORT* pRange = pDlg->GetInputRanges( *aAttr.GetPool() );
+ const sal_uInt16* pRange = pDlg->GetInputRanges( *aAttr.GetPool() );
SfxItemSet aCombAttr( *aAttr.GetPool(), pRange );
aCombAttr.Put( aAttr );
aCombAttr.Put( aGeoAttr );
@@ -428,7 +428,6 @@ void ShapeController::executeDispatch_TransformDialog()
else
{
SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
- SolarMutexGuard aGuard;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -447,6 +446,7 @@ void ShapeController::executeDispatch_TransformDialog()
void ShapeController::executeDispatch_ObjectTitleDescription()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
@@ -457,7 +457,6 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
{
String aTitle( pSelectedObj->GetTitle() );
String aDescription( pSelectedObj->GetDescription() );
- SolarMutexGuard aGuard;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -478,6 +477,7 @@ void ShapeController::executeDispatch_ObjectTitleDescription()
void ShapeController::executeDispatch_RenameObject()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
@@ -487,7 +487,6 @@ void ShapeController::executeDispatch_RenameObject()
if ( pSelectedObj )
{
String aName( pSelectedObj->GetName() );
- SolarMutexGuard aGuard;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -510,10 +509,10 @@ void ShapeController::executeDispatch_RenameObject()
void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
if ( pDrawViewWrapper )
{
- SolarMutexGuard aGuard;
switch ( nId )
{
case COMMAND_ID_BRING_TO_FRONT:
@@ -559,6 +558,7 @@ void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
void ShapeController::executeDispatch_FontDialog()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -569,7 +569,6 @@ void ShapeController::executeDispatch_FontDialog()
SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
pDrawViewWrapper->GetAttributes( aAttr );
ViewElementListProvider aViewElementListProvider( pDrawModelWrapper );
- SolarMutexGuard aGuard;
::boost::scoped_ptr< ShapeFontDialog > pDlg( new ShapeFontDialog( pParent, &aAttr, &aViewElementListProvider ) );
if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
{
@@ -582,6 +581,7 @@ void ShapeController::executeDispatch_FontDialog()
void ShapeController::executeDispatch_ParagraphDialog()
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pChartController )
{
Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
@@ -607,7 +607,6 @@ void ShapeController::executeDispatch_ParagraphDialog()
aNewAttr.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS) );
aNewAttr.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS) );
- SolarMutexGuard aGuard;
::boost::scoped_ptr< ShapeParagraphDialog > pDlg( new ShapeParagraphDialog( pParent, &aNewAttr ) );
if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
{
@@ -702,6 +701,7 @@ bool ShapeController::isBackwardPossible()
{
if ( m_pChartController && m_pChartController->m_aSelection.isAdditionalShapeSelected() )
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pDrawViewWrapper )
{
@@ -720,6 +720,7 @@ bool ShapeController::isForwardPossible()
{
if ( m_pChartController && m_pChartController->m_aSelection.isAdditionalShapeSelected() )
{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pDrawViewWrapper )
{
diff --git a/chart2/source/controller/main/ShapeToolbarController.cxx b/chart2/source/controller/main/ShapeToolbarController.cxx
index 7fe9acad757e..4e2cda70bbf6 100644
--- a/chart2/source/controller/main/ShapeToolbarController.cxx
+++ b/chart2/source/controller/main/ShapeToolbarController.cxx
@@ -127,10 +127,10 @@ void ShapeToolbarController::initialize( const Sequence< uno::Any >& rArguments
ToolBox* pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ) );
if ( pToolBox )
{
- const USHORT nCount = pToolBox->GetItemCount();
- for ( USHORT nPos = 0; nPos < nCount; ++nPos )
+ const sal_uInt16 nCount = pToolBox->GetItemCount();
+ for ( sal_uInt16 nPos = 0; nPos < nCount; ++nPos )
{
- const USHORT nItemId = pToolBox->GetItemId( nPos );
+ const sal_uInt16 nItemId = pToolBox->GetItemId( nPos );
if ( pToolBox->GetItemCommand( nItemId ) == String( m_aCommandURL ) )
{
m_nToolBoxId = nItemId;
@@ -202,9 +202,9 @@ void ShapeToolbarController::statusChanged( const frame::FeatureStateEvent& Even
sal_Bool bCheckmark = sal_False;
ToolBox& rTb = m_pToolbarController->GetToolBox();
- for ( USHORT i = 0; i < rTb.GetItemCount(); ++i )
+ for ( sal_uInt16 i = 0; i < rTb.GetItemCount(); ++i )
{
- USHORT nId = rTb.GetItemId( i );
+ sal_uInt16 nId = rTb.GetItemId( i );
if ( nId == 0 )
{
continue;
diff --git a/chart2/source/controller/main/StatusBarCommandDispatch.cxx b/chart2/source/controller/main/StatusBarCommandDispatch.cxx
index 82620e94acce..bd3d547dfe77 100644
--- a/chart2/source/controller/main/StatusBarCommandDispatch.cxx
+++ b/chart2/source/controller/main/StatusBarCommandDispatch.cxx
@@ -34,9 +34,6 @@
#include "macros.hxx"
#include <com/sun/star/util/XModifyBroadcaster.hpp>
-// for ressource strings STR_UNDO and STR_REDO
-#include <sfx2/sfx.hrc>
-
#include "ResId.hxx"
using namespace ::com::sun::star;
diff --git a/chart2/source/controller/main/UndoActions.cxx b/chart2/source/controller/main/UndoActions.cxx
new file mode 100644
index 000000000000..86c0e365f590
--- /dev/null
+++ b/chart2/source/controller/main/UndoActions.cxx
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "UndoActions.hxx"
+#include "DisposeHelper.hxx"
+#include "CommonFunctors.hxx"
+#include "PropertyHelper.hxx"
+#include "ChartModelClone.hxx"
+
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+
+#include <tools/diagnose_ex.h>
+#include <svx/svdundo.hxx>
+
+#include <boost/bind.hpp>
+#include <algorithm>
+
+using namespace ::com::sun::star;
+
+using ::rtl::OUString;
+
+namespace chart
+{
+namespace impl
+{
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::frame::XModel;
+ using ::com::sun::star::util::XCloneable;
+ using ::com::sun::star::lang::XComponent;
+ using ::com::sun::star::lang::DisposedException;
+ using ::com::sun::star::view::XSelectionSupplier;
+ using ::com::sun::star::chart2::XChartDocument;
+ using ::com::sun::star::document::UndoFailedException;
+ /** === end UNO using === **/
+
+// ---------------------------------------------------------------------------------------------------------------------
+UndoElement::UndoElement( const OUString& i_actionString, const Reference< XModel >& i_documentModel, const ::boost::shared_ptr< ChartModelClone >& i_modelClone )
+ :UndoElement_MBase()
+ ,UndoElement_TBase( m_aMutex )
+ ,m_sActionString( i_actionString )
+ ,m_xDocumentModel( i_documentModel )
+ ,m_pModelClone( i_modelClone )
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+UndoElement::~UndoElement()
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UndoElement::disposing()
+{
+ if ( !!m_pModelClone )
+ m_pModelClone->dispose();
+ m_pModelClone.reset();
+ m_xDocumentModel.clear();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+::rtl::OUString SAL_CALL UndoElement::getTitle() throw (RuntimeException)
+{
+ return m_sActionString;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void UndoElement::impl_toggleModelState()
+{
+ // get a snapshot of the current state of our model
+ ::boost::shared_ptr< ChartModelClone > pNewClone( new ChartModelClone( m_xDocumentModel, m_pModelClone->getFacet() ) );
+ // apply the previous snapshot to our model
+ m_pModelClone->applyToModel( m_xDocumentModel );
+ // remember the new snapshot, for the next toggle
+ m_pModelClone = pNewClone;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UndoElement::undo( ) throw (UndoFailedException, RuntimeException)
+{
+ impl_toggleModelState();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL UndoElement::redo( ) throw (UndoFailedException, RuntimeException)
+{
+ impl_toggleModelState();
+}
+
+// =====================================================================================================================
+// = ShapeUndoElement
+// =====================================================================================================================
+
+// ---------------------------------------------------------------------------------------------------------------------
+ShapeUndoElement::ShapeUndoElement( SdrUndoAction& i_sdrUndoAction )
+ :ShapeUndoElement_MBase()
+ ,ShapeUndoElement_TBase( m_aMutex )
+ ,m_pAction( &i_sdrUndoAction )
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+ShapeUndoElement::~ShapeUndoElement()
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+::rtl::OUString SAL_CALL ShapeUndoElement::getTitle() throw (RuntimeException)
+{
+ if ( !m_pAction )
+ throw DisposedException( ::rtl::OUString(), *this );
+ return m_pAction->GetComment();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL ShapeUndoElement::undo( ) throw (UndoFailedException, RuntimeException)
+{
+ if ( !m_pAction )
+ throw DisposedException( ::rtl::OUString(), *this );
+ m_pAction->Undo();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL ShapeUndoElement::redo( ) throw (UndoFailedException, RuntimeException)
+{
+ if ( !m_pAction )
+ throw DisposedException( ::rtl::OUString(), *this );
+ m_pAction->Redo();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL ShapeUndoElement::disposing()
+{
+}
+
+} // namespace impl
+} // namespace chart
diff --git a/chart2/source/controller/main/UndoActions.hxx b/chart2/source/controller/main/UndoActions.hxx
new file mode 100644
index 000000000000..2c98d6af1d54
--- /dev/null
+++ b/chart2/source/controller/main/UndoActions.hxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef CHART2_IMPLUNDOMANAGER_HXX
+#define CHART2_IMPLUNDOMANAGER_HXX
+
+#include "ConfigItemListener.hxx"
+
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/document/XUndoAction.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <rtl/ustring.hxx>
+#include <unotools/configitem.hxx>
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include <utility>
+#include <deque>
+
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+
+class SdrUndoAction;
+
+namespace com { namespace sun { namespace star {
+namespace chart2 {
+ class XInternalDataProvider;
+}
+}}}
+
+
+namespace chart
+{
+class ChartModelClone;
+
+namespace impl
+{
+
+typedef ::cppu::BaseMutex UndoElement_MBase;
+typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::document::XUndoAction > UndoElement_TBase;
+
+class UndoElement :public UndoElement_MBase
+ ,public UndoElement_TBase
+ ,public ::boost::noncopyable
+{
+public:
+ /** creates a new undo action
+
+ @param i_actionString
+ is the title of the Undo action
+ @param i_documentModel
+ is the actual document model which the undo actions operates on
+ @param i_modelClone
+ 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 ::rtl::OUString & i_actionString,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_documentModel,
+ const ::boost::shared_ptr< ChartModelClone >& i_modelClone
+ );
+
+ // XUndoAction
+ virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL undo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL redo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+protected:
+ virtual ~UndoElement();
+
+private:
+ void impl_toggleModelState();
+
+private:
+ ::rtl::OUString m_sActionString;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocumentModel;
+ ::boost::shared_ptr< ChartModelClone > m_pModelClone;
+};
+
+
+typedef ::cppu::BaseMutex ShapeUndoElement_MBase;
+typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::document::XUndoAction > ShapeUndoElement_TBase;
+class ShapeUndoElement :public ShapeUndoElement_MBase
+ ,public ShapeUndoElement_TBase
+{
+public:
+ ShapeUndoElement( SdrUndoAction& i_sdrUndoAction );
+
+ // XUndoAction
+ virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL undo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL redo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing();
+
+protected:
+ virtual ~ShapeUndoElement();
+
+private:
+ SdrUndoAction* m_pAction;
+};
+
+} // namespace impl
+} // namespace chart
+
+// CHART2_IMPLUNDOMANAGER_HXX
+#endif
diff --git a/chart2/source/controller/main/UndoCommandDispatch.cxx b/chart2/source/controller/main/UndoCommandDispatch.cxx
index d1245b57f27d..fcc396025cfa 100644
--- a/chart2/source/controller/main/UndoCommandDispatch.cxx
+++ b/chart2/source/controller/main/UndoCommandDispatch.cxx
@@ -30,18 +30,19 @@
#include "precompiled_chart2.hxx"
#include "UndoCommandDispatch.hxx"
+#include "ResId.hxx"
#include "macros.hxx"
-#include <com/sun/star/chart2/XUndoSupplier.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
// for ressource strings STR_UNDO and STR_REDO
-#include <sfx2/sfx.hrc>
-
-#include "ResId.hxx"
+#include <svtools/svtools.hrc>
+#include <svtools/svtdata.hxx>
using namespace ::com::sun::star;
@@ -58,10 +59,8 @@ UndoCommandDispatch::UndoCommandDispatch(
CommandDispatch( xContext ),
m_xModel( xModel )
{
- Reference< chart2::XUndoSupplier > xUndoSupplier( xModel, uno::UNO_QUERY );
- OSL_ASSERT( xUndoSupplier.is());
- if( xUndoSupplier.is())
- m_xUndoManager.set( xUndoSupplier->getUndoManager());
+ uno::Reference< document::XUndoManagerSupplier > xSuppUndo( m_xModel, uno::UNO_QUERY_THROW );
+ m_xUndoManager.set( xSuppUndo->getUndoManager(), uno::UNO_QUERY_THROW );
}
UndoCommandDispatch::~UndoCommandDispatch()
@@ -70,10 +69,8 @@ UndoCommandDispatch::~UndoCommandDispatch()
void UndoCommandDispatch::initialize()
{
Reference< util::XModifyBroadcaster > xBroadcaster( m_xUndoManager, uno::UNO_QUERY );
- if( xBroadcaster.is() )
- {
- xBroadcaster->addModifyListener( this );
- }
+ ENSURE_OR_RETURN_VOID( xBroadcaster.is(), "UndoCommandDispatch::initialize: missing modification broadcaster interface!" );
+ xBroadcaster->addModifyListener( this );
}
void UndoCommandDispatch::fireStatusEvent(
@@ -84,23 +81,23 @@ void UndoCommandDispatch::fireStatusEvent(
{
bool bFireAll = (rURL.getLength() == 0);
uno::Any aUndoState, aRedoState;
- if( m_xUndoManager->undoPossible())
+ if( m_xUndoManager->isUndoPossible())
{
// using assignment for broken gcc 3.3
- OUString aUndo = OUString( String( SchResId( STR_UNDO )));
- aUndoState <<= ( aUndo + m_xUndoManager->getCurrentUndoString());
+ OUString aUndo = OUString( String( SvtResId( STR_UNDO )));
+ aUndoState <<= ( aUndo + m_xUndoManager->getCurrentUndoActionTitle());
}
- if( m_xUndoManager->redoPossible())
+ if( m_xUndoManager->isRedoPossible())
{
// using assignment for broken gcc 3.3
- OUString aRedo = OUString( String( SchResId( STR_REDO )));
- aRedoState <<= ( aRedo + m_xUndoManager->getCurrentRedoString());
+ OUString aRedo = OUString( String( SvtResId( STR_REDO )));
+ aRedoState <<= ( aRedo + m_xUndoManager->getCurrentRedoActionTitle());
}
if( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:Undo")))
- fireStatusEventForURL( C2U(".uno:Undo"), aUndoState, m_xUndoManager->undoPossible(), xSingleListener );
+ fireStatusEventForURL( C2U(".uno:Undo"), aUndoState, m_xUndoManager->isUndoPossible(), xSingleListener );
if( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:Redo")))
- fireStatusEventForURL( C2U(".uno:Redo"), aRedoState, m_xUndoManager->redoPossible(), xSingleListener );
+ fireStatusEventForURL( C2U(".uno:Redo"), aRedoState, m_xUndoManager->isRedoPossible(), xSingleListener );
}
}
@@ -114,10 +111,22 @@ void SAL_CALL UndoCommandDispatch::dispatch(
{
// why is it necessary to lock the solar mutex here?
SolarMutexGuard aSolarGuard;
- if( URL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Undo" )))
- m_xUndoManager->undo( m_xModel );
- else
- m_xUndoManager->redo( m_xModel );
+ try
+ {
+ if( URL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Undo" )))
+ m_xUndoManager->undo();
+ else
+ m_xUndoManager->redo();
+ }
+ catch( const document::UndoFailedException& )
+ {
+ // silently ignore
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ // \--
}
}
@@ -126,6 +135,7 @@ void SAL_CALL UndoCommandDispatch::dispatch(
void SAL_CALL UndoCommandDispatch::disposing()
{
Reference< util::XModifyBroadcaster > xBroadcaster( m_xUndoManager, uno::UNO_QUERY );
+ OSL_ENSURE( xBroadcaster.is(), "UndoCommandDispatch::initialize: missing modification broadcaster interface!" );
if( xBroadcaster.is() )
{
xBroadcaster->removeModifyListener( this );
diff --git a/chart2/source/controller/main/UndoCommandDispatch.hxx b/chart2/source/controller/main/UndoCommandDispatch.hxx
index c2b1225780d2..d64f66f63102 100644
--- a/chart2/source/controller/main/UndoCommandDispatch.hxx
+++ b/chart2/source/controller/main/UndoCommandDispatch.hxx
@@ -31,15 +31,12 @@
#include "CommandDispatch.hxx"
#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
+#include <com/sun/star/document/XUndoManager.hpp>
namespace chart
{
/** This is a CommandDispatch implementation for Undo and Redo.
-
- You need to pass an UndoManager to this class that is then used for Undo and
- Redo. The changes are applied to the given XModel.
*/
class UndoCommandDispatch : public CommandDispatch
{
@@ -78,7 +75,7 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel > m_xModel;
::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
+ ::com::sun::star::document::XUndoManager > m_xUndoManager;
};
} // namespace chart
diff --git a/chart2/source/controller/main/UndoGuard.cxx b/chart2/source/controller/main/UndoGuard.cxx
index 17d33f689975..26b13cd0a265 100644
--- a/chart2/source/controller/main/UndoGuard.cxx
+++ b/chart2/source/controller/main/UndoGuard.cxx
@@ -30,6 +30,12 @@
#include "precompiled_chart2.hxx"
#include "UndoGuard.hxx"
+#include "ChartModelClone.hxx"
+#include "UndoActions.hxx"
+
+#include <com/sun/star/container/XChild.hpp>
+
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
@@ -40,105 +46,154 @@ using ::rtl::OUString;
namespace chart
{
-UndoGuard_Base::UndoGuard_Base( const OUString& rUndoString
- , const uno::Reference< chart2::XUndoManager > & xUndoManager
- , const uno::Reference< frame::XModel > & xModel )
- : m_xModel( xModel )
- , m_xUndoManager( xUndoManager )
- , m_aUndoString( rUndoString )
- , m_bActionPosted( false )
+//-----------------------------------------------------------------------------
+
+UndoGuard::UndoGuard( const OUString& i_undoString, const uno::Reference< document::XUndoManager > & i_undoManager,
+ const ModelFacet i_facet )
+ :m_xChartModel( i_undoManager->getParent(), uno::UNO_QUERY_THROW )
+ ,m_xUndoManager( i_undoManager )
+ ,m_pDocumentSnapshot()
+ ,m_aUndoString( i_undoString )
+ ,m_bActionPosted( false )
{
+ m_pDocumentSnapshot.reset( new ChartModelClone( m_xChartModel, i_facet ) );
}
-UndoGuard_Base::~UndoGuard_Base()
+//-----------------------------------------------------------------------------
+
+UndoGuard::~UndoGuard()
{
+ if ( !!m_pDocumentSnapshot )
+ discardSnapshot();
}
-void UndoGuard_Base::commitAction()
+//-----------------------------------------------------------------------------
+
+void UndoGuard::commit()
{
- if( !m_bActionPosted && m_xUndoManager.is() )
- m_xUndoManager->postAction( m_aUndoString );
+ if ( !m_bActionPosted && !!m_pDocumentSnapshot )
+ {
+ try
+ {
+ const Reference< document::XUndoAction > xAction( new impl::UndoElement( m_aUndoString, m_xChartModel, m_pDocumentSnapshot ) );
+ m_pDocumentSnapshot.reset(); // don't dispose, it's data went over to the UndoElement
+ m_xUndoManager->addUndoAction( xAction );
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
m_bActionPosted = true;
}
//-----------------------------------------------------------------------------
-UndoGuard::UndoGuard( const OUString& rUndoString
- , const uno::Reference< chart2::XUndoManager > & xUndoManager
- , const uno::Reference< frame::XModel > & xModel )
- : UndoGuard_Base( rUndoString, xUndoManager, xModel )
+void UndoGuard::rollback()
{
- if( m_xUndoManager.is() )
- m_xUndoManager->preAction( m_xModel );
+ ENSURE_OR_RETURN_VOID( !!m_pDocumentSnapshot, "no snapshot!" );
+ m_pDocumentSnapshot->applyToModel( m_xChartModel );
+ discardSnapshot();
}
-UndoGuard::~UndoGuard()
+//-----------------------------------------------------------------------------
+void UndoGuard::discardSnapshot()
{
- if( !m_bActionPosted && m_xUndoManager.is() )
- m_xUndoManager->cancelAction();
+ ENSURE_OR_RETURN_VOID( !!m_pDocumentSnapshot, "no snapshot!" );
+ m_pDocumentSnapshot->dispose();
+ m_pDocumentSnapshot.reset();
}
//-----------------------------------------------------------------------------
-UndoLiveUpdateGuard::UndoLiveUpdateGuard( const OUString& rUndoString
- , const uno::Reference< chart2::XUndoManager > & xUndoManager
- , const uno::Reference< frame::XModel > & xModel )
- : UndoGuard_Base( rUndoString, xUndoManager, xModel )
+UndoLiveUpdateGuard::UndoLiveUpdateGuard( const OUString& i_undoString, const uno::Reference< document::XUndoManager >& i_undoManager )
+ :UndoGuard( i_undoString, i_undoManager, E_MODEL )
{
- if( m_xUndoManager.is() )
- m_xUndoManager->preAction( m_xModel );
}
UndoLiveUpdateGuard::~UndoLiveUpdateGuard()
{
- if( !m_bActionPosted && m_xUndoManager.is() )
- m_xUndoManager->cancelActionWithUndo( m_xModel );
+ if ( !isActionPosted() )
+ rollback();
}
//-----------------------------------------------------------------------------
-UndoLiveUpdateGuardWithData::UndoLiveUpdateGuardWithData( const OUString& rUndoString
- , const uno::Reference< chart2::XUndoManager > & xUndoManager
- , const uno::Reference< frame::XModel > & xModel )
- : UndoGuard_Base( rUndoString, xUndoManager, xModel )
+UndoLiveUpdateGuardWithData::UndoLiveUpdateGuardWithData(
+ const OUString& i_undoString, const uno::Reference< document::XUndoManager >& i_undoManager )
+ :UndoGuard( i_undoString, i_undoManager, E_MODEL_WITH_DATA )
{
- if( m_xUndoManager.is() )
- {
- Sequence< beans::PropertyValue > aArgs(1);
- aArgs[0] = beans::PropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM("WithData")), -1, uno::Any(),
- beans::PropertyState_DIRECT_VALUE );
- m_xUndoManager->preActionWithArguments( m_xModel, aArgs );
- }
}
UndoLiveUpdateGuardWithData::~UndoLiveUpdateGuardWithData()
{
- if( !m_bActionPosted && m_xUndoManager.is() )
- m_xUndoManager->cancelActionWithUndo( m_xModel );
+ if ( !isActionPosted() )
+ rollback();
}
//-----------------------------------------------------------------------------
-UndoGuardWithSelection::UndoGuardWithSelection( const rtl::OUString& rUndoString
- , const uno::Reference< chart2::XUndoManager > & xUndoManager
- , const uno::Reference< frame::XModel > & xModel )
- : UndoGuard_Base( rUndoString, xUndoManager, xModel )
+UndoGuardWithSelection::UndoGuardWithSelection(
+ const OUString& i_undoString, const uno::Reference< document::XUndoManager >& i_undoManager )
+ :UndoGuard( i_undoString, i_undoManager, E_MODEL_WITH_SELECTION )
{
- if( m_xUndoManager.is() )
+}
+
+//-----------------------------------------------------------------------------
+
+UndoGuardWithSelection::~UndoGuardWithSelection()
+{
+ if ( !isActionPosted() )
+ rollback();
+}
+
+//-----------------------------------------------------------------------------
+
+UndoContext::UndoContext( const Reference< document::XUndoManager > & i_undoManager, const ::rtl::OUString& i_undoTitle )
+ :m_xUndoManager( i_undoManager )
+{
+ ENSURE_OR_THROW( m_xUndoManager.is(), "invalid undo manager!" );
+ m_xUndoManager->enterUndoContext( i_undoTitle );
+}
+
+//-----------------------------------------------------------------------------
+
+UndoContext::~UndoContext()
+{
+ m_xUndoManager->leaveUndoContext();
+}
+
+//-----------------------------------------------------------------------------
+
+HiddenUndoContext::HiddenUndoContext( const Reference< document::XUndoManager > & i_undoManager )
+ :m_xUndoManager( i_undoManager )
+{
+ ENSURE_OR_THROW( m_xUndoManager.is(), "invalid undo manager!" );
+ try
+ {
+ m_xUndoManager->enterHiddenUndoContext();
+ }
+ catch( const uno::Exception& )
{
- Sequence< beans::PropertyValue > aArgs(1);
- aArgs[0] = beans::PropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM("WithSelection")), -1, uno::Any(),
- beans::PropertyState_DIRECT_VALUE );
- m_xUndoManager->preActionWithArguments( m_xModel, aArgs );
+ DBG_UNHANDLED_EXCEPTION();
+ m_xUndoManager.clear();
+ // prevents the leaveUndoContext in the dtor
}
}
-UndoGuardWithSelection::~UndoGuardWithSelection()
+//-----------------------------------------------------------------------------
+
+HiddenUndoContext::~HiddenUndoContext()
{
- if( !m_bActionPosted && m_xUndoManager.is() )
- m_xUndoManager->cancelAction();
+ try
+ {
+ if ( m_xUndoManager.is() )
+ m_xUndoManager->leaveUndoContext();
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
}
} // namespace chart
diff --git a/chart2/source/controller/main/UndoGuard.hxx b/chart2/source/controller/main/UndoGuard.hxx
new file mode 100644
index 000000000000..c5c00dd62d1b
--- /dev/null
+++ b/chart2/source/controller/main/UndoGuard.hxx
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef CHART2_UNDOGUARD_HXX
+#define CHART2_UNDOGUARD_HXX
+
+#include "ChartModelClone.hxx"
+
+#include <com/sun/star/document/XUndoManager.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+
+#include <rtl/ustring.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+namespace chart
+{
+
+/** A guard which which does nothing, unless you explicitly call commitAction. In particular, in its destructor, it
+ does neither auto-commit nor auto-rollback the model changes.
+ */
+class UndoGuard
+{
+public:
+ explicit UndoGuard(
+ const ::rtl::OUString& i_undoMessage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager,
+ const ModelFacet i_facet = E_MODEL
+ );
+ ~UndoGuard();
+
+ void commit();
+ void rollback();
+
+protected:
+ bool isActionPosted() const { return m_bActionPosted; }
+
+private:
+ void discardSnapshot();
+
+private:
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xChartModel;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > m_xUndoManager;
+
+ ::boost::shared_ptr< ChartModelClone > m_pDocumentSnapshot;
+ rtl::OUString m_aUndoString;
+ bool m_bActionPosted;
+};
+
+/** A guard which, in its destructor, restores the model state it found in the constructor. If
+ <member>commitAction</member> is called inbetween, the restouration is not performed.
+ */
+class UndoLiveUpdateGuard : public UndoGuard
+{
+public:
+ explicit UndoLiveUpdateGuard(
+ const ::rtl::OUString& i_undoMessage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager
+ );
+ ~UndoLiveUpdateGuard();
+};
+
+/** Same as UndoLiveUpdateGuard but with additional storage of the chart's data.
+ Only use this if the data has internal data.
+ */
+class UndoLiveUpdateGuardWithData :
+ public UndoGuard
+{
+public:
+ explicit UndoLiveUpdateGuardWithData(
+ const ::rtl::OUString& i_undoMessage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager
+ );
+ ~UndoLiveUpdateGuardWithData();
+};
+
+class UndoGuardWithSelection : public UndoGuard
+{
+public:
+ explicit UndoGuardWithSelection(
+ const ::rtl::OUString& i_undoMessage,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager
+ );
+ virtual ~UndoGuardWithSelection();
+};
+
+class UndoContext
+{
+public:
+ UndoContext(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager,
+ const ::rtl::OUString& i_undoTitle
+ );
+ ~UndoContext();
+
+private:
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > m_xUndoManager;
+};
+
+class HiddenUndoContext
+{
+public:
+ HiddenUndoContext(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > & i_undoManager
+ );
+ ~HiddenUndoContext();
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > m_xUndoManager;
+};
+
+}
+// CHART2_UNDOGUARD_HXX
+#endif
diff --git a/chart2/source/controller/main/UndoManager.cxx b/chart2/source/controller/main/UndoManager.cxx
deleted file mode 100644
index 2f9efb674eaf..000000000000
--- a/chart2/source/controller/main/UndoManager.cxx
+++ /dev/null
@@ -1,441 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_chart2.hxx"
-
-#include "UndoManager.hxx"
-#include "ImplUndoManager.hxx"
-#include "DisposeHelper.hxx"
-#include "MutexContainer.hxx"
-#include "macros.hxx"
-#include "ChartViewHelper.hxx"
-
-#include <com/sun/star/util/XCloneable.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/chart2/XChartDocument.hpp>
-
-#include <unotools/configitem.hxx>
-#include <cppuhelper/compbase1.hxx>
-#include <rtl/uuid.h>
-#include <svx/svdundo.hxx>
-
-#include <functional>
-
-using namespace ::com::sun::star;
-
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::rtl::OUString;
-
-
-// --------------------------------------------------------------------------------
-
-namespace chart
-{
-
-namespace impl
-{
-typedef ::cppu::WeakComponentImplHelper1<
- util::XModifyBroadcaster >
- ModifyBroadcaster_Base;
-
-class ModifyBroadcaster :
- public ::chart::MutexContainer,
- public ModifyBroadcaster_Base
-{
-public:
- ModifyBroadcaster();
-
- void fireEvent();
-
-protected:
- // ____ XModifyBroadcaster ____
- virtual void SAL_CALL addModifyListener( const Reference< util::XModifyListener >& xListener )
- throw (uno::RuntimeException);
- virtual void SAL_CALL removeModifyListener( const Reference< util::XModifyListener >& xListener )
- throw (uno::RuntimeException);
-};
-
-ModifyBroadcaster::ModifyBroadcaster() :
- ModifyBroadcaster_Base( m_aMutex )
-{}
-
-void SAL_CALL ModifyBroadcaster::addModifyListener(
- const Reference< util::XModifyListener >& xListener )
- throw (uno::RuntimeException)
-{
- rBHelper.addListener( ::getCppuType( & xListener ), xListener);
-}
-
-void SAL_CALL ModifyBroadcaster::removeModifyListener(
- const Reference< util::XModifyListener >& xListener )
- throw (uno::RuntimeException)
-{
- rBHelper.removeListener( ::getCppuType( & xListener ), xListener );
-}
-
-void ModifyBroadcaster::fireEvent()
-{
- ::cppu::OInterfaceContainerHelper* pIC = rBHelper.getContainer(
- ::getCppuType((const uno::Reference< util::XModifyListener >*)0) );
- if( pIC )
- {
- lang::EventObject aEvent( static_cast< lang::XComponent* >( this ) );
- ::cppu::OInterfaceIteratorHelper aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- uno::Reference< util::XModifyListener > xListener( aIt.next(), uno::UNO_QUERY );
- if( xListener.is() )
- xListener->modified( aEvent );
- }
- }
-}
-
-} // namespace impl
-
-UndoManager::UndoManager() :
- impl::UndoManager_Base( m_aMutex ),
- m_apUndoStack( new impl::UndoStack()),
- m_apRedoStack( new impl::UndoStack()),
- m_pLastRemeberedUndoElement( 0 ),
- m_nMaxNumberOfUndos( 100 ),
- m_pModifyBroadcaster( 0 )
-{}
-
-UndoManager::~UndoManager()
-{
- DisposeHelper::Dispose( m_xModifyBroadcaster );
- m_apUndoStack->disposeAndClear();
- m_apRedoStack->disposeAndClear();
-
- delete m_pLastRemeberedUndoElement;
- m_pLastRemeberedUndoElement = 0;
-}
-
-void UndoManager::addShapeUndoAction( SdrUndoAction* pAction )
-{
- if ( !pAction )
- {
- return;
- }
-
- impl::ShapeUndoElement* pShapeUndoElement = new impl::ShapeUndoElement( pAction->GetComment(), pAction );
- if ( pShapeUndoElement )
- {
- m_apUndoStack->push( pShapeUndoElement );
- m_apRedoStack->disposeAndClear();
- if ( !m_apUndoStepsConfigItem.get() )
- {
- retrieveConfigUndoSteps();
- }
- fireModifyEvent();
- }
-}
-
-void UndoManager::impl_undoRedo(
- Reference< frame::XModel > & xCurrentModel,
- impl::UndoStack * pStackToRemoveFrom,
- impl::UndoStack * pStackToAddTo,
- bool bUndo )
-{
- if( pStackToRemoveFrom && ! pStackToRemoveFrom->empty() )
- {
- // get model from undo/redo
- impl::UndoElement * pTop( pStackToRemoveFrom->top());
- if( pTop )
- {
- impl::ShapeUndoElement* pShapeUndoElement = dynamic_cast< impl::ShapeUndoElement* >( pTop );
- if ( pShapeUndoElement )
- {
- impl::ShapeUndoElement* pNewShapeUndoElement = new impl::ShapeUndoElement( *pShapeUndoElement );
- pStackToAddTo->push( pNewShapeUndoElement );
- SdrUndoAction* pAction = pNewShapeUndoElement->getSdrUndoAction();
- if ( pAction )
- {
- if ( bUndo )
- {
- pAction->Undo();
- }
- else
- {
- pAction->Redo();
- }
- }
- }
- else
- {
- // put a clone of current model into redo/undo stack with the same
- // action string as the undo/redo
- pStackToAddTo->push( pTop->createFromModel( xCurrentModel ));
- // change current model by properties of the model from undo
- pTop->applyToModel( xCurrentModel );
- }
- // remove the top undo element
- pStackToRemoveFrom->pop(), pTop = 0;
- ChartViewHelper::setViewToDirtyState( xCurrentModel );
- fireModifyEvent();
- }
- }
- else
- {
- OSL_ENSURE( false, "Can't Undo/Redo" );
- }
-}
-
-void UndoManager::fireModifyEvent()
-{
- if( m_xModifyBroadcaster.is())
- m_pModifyBroadcaster->fireEvent();
-}
-
-
-// ____ ConfigItemListener ____
-void UndoManager::notify( const ::rtl::OUString & rPropertyName )
-{
- OSL_ENSURE( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Steps" )),
- "Unwanted config property change Notified" );
- if( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Steps" )))
- retrieveConfigUndoSteps();
-}
-
-void UndoManager::retrieveConfigUndoSteps()
-{
- if( ! m_apUndoStepsConfigItem.get())
- m_apUndoStepsConfigItem.reset( new impl::UndoStepsConfigItem( *this ));
- m_nMaxNumberOfUndos = m_apUndoStepsConfigItem->getUndoSteps();
- m_apUndoStack->limitSize( m_nMaxNumberOfUndos );
- m_apRedoStack->limitSize( m_nMaxNumberOfUndos );
-
- // a list of available undo steps could shrink here
- fireModifyEvent();
-}
-
-// ____ XModifyBroadcaster ____
-void SAL_CALL UndoManager::addModifyListener( const Reference< util::XModifyListener >& aListener )
- throw (uno::RuntimeException)
-{
- if( ! m_xModifyBroadcaster.is())
- {
- m_pModifyBroadcaster = new impl::ModifyBroadcaster();
- m_xModifyBroadcaster.set( static_cast< cppu::OWeakObject* >( m_pModifyBroadcaster ), uno::UNO_QUERY );
- }
- m_xModifyBroadcaster->addModifyListener( aListener );
-}
-
-void SAL_CALL UndoManager::removeModifyListener( const Reference< util::XModifyListener >& aListener )
- throw (uno::RuntimeException)
-{
- if( ! m_xModifyBroadcaster.is())
- {
- m_pModifyBroadcaster = new impl::ModifyBroadcaster();
- m_xModifyBroadcaster.set( static_cast< cppu::OWeakObject* >( m_pModifyBroadcaster ), uno::UNO_QUERY );
- }
- m_xModifyBroadcaster->removeModifyListener( aListener );
-}
-
-// ____ chart2::XUndoManager ____
-void SAL_CALL UndoManager::preAction( const Reference< frame::XModel >& xModelBeforeChange )
- throw (uno::RuntimeException)
-{
- OSL_ENSURE( ! m_pLastRemeberedUndoElement, "Looks like postAction or cancelAction call was missing" );
- m_pLastRemeberedUndoElement = new impl::UndoElement( xModelBeforeChange );
-}
-
-void SAL_CALL UndoManager::preActionWithArguments(
- const Reference< frame::XModel >& xModelBeforeChange,
- const Sequence< beans::PropertyValue >& aArguments )
- throw (uno::RuntimeException)
-{
- bool bActionHandled( false );
- OSL_ENSURE( ! m_pLastRemeberedUndoElement, "Looks like postAction or cancelAction call was missing" );
- if( aArguments.getLength() > 0 )
- {
- OSL_ENSURE( aArguments.getLength() == 1, "More than one argument is not supported yet" );
- if( aArguments[0].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("WithData")))
- {
- m_pLastRemeberedUndoElement = new impl::UndoElementWithData( xModelBeforeChange );
- bActionHandled = true;
- }
- else if( aArguments[0].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("WithSelection")))
- {
- m_pLastRemeberedUndoElement = new impl::UndoElementWithSelection( xModelBeforeChange );
- bActionHandled = true;
- }
- }
-
- if( !bActionHandled )
- preAction( xModelBeforeChange );
-}
-
-void SAL_CALL UndoManager::postAction( const OUString& aUndoText )
- throw (uno::RuntimeException)
-{
- OSL_ENSURE( m_pLastRemeberedUndoElement, "Looks like preAction call was missing" );
- if( m_pLastRemeberedUndoElement )
- {
- m_pLastRemeberedUndoElement->setActionString( aUndoText );
- m_apUndoStack->push( m_pLastRemeberedUndoElement );
- m_pLastRemeberedUndoElement = 0;
-
- // redo no longer possible
- m_apRedoStack->disposeAndClear();
-
- // it suffices to get the number of undo steps from config after the
- // first time postAction has been called
- if( ! m_apUndoStepsConfigItem.get())
- retrieveConfigUndoSteps();
-
- fireModifyEvent();
- }
-}
-
-void SAL_CALL UndoManager::cancelAction()
- throw (uno::RuntimeException)
-{
- delete m_pLastRemeberedUndoElement;
- m_pLastRemeberedUndoElement = 0;
-}
-
-void SAL_CALL UndoManager::cancelActionWithUndo( Reference< frame::XModel >& xModelToRestore )
- throw (uno::RuntimeException)
-{
- if( m_pLastRemeberedUndoElement )
- {
- m_pLastRemeberedUndoElement->applyToModel( xModelToRestore );
- cancelAction();
- }
-}
-
-void SAL_CALL UndoManager::undo( Reference< frame::XModel >& xCurrentModel )
- throw (uno::RuntimeException)
-{
- OSL_ASSERT( m_apUndoStack.get() && m_apRedoStack.get());
- impl_undoRedo( xCurrentModel, m_apUndoStack.get(), m_apRedoStack.get(), true );
-}
-
-void SAL_CALL UndoManager::redo( Reference< frame::XModel >& xCurrentModel )
- throw (uno::RuntimeException)
-{
- OSL_ASSERT( m_apUndoStack.get() && m_apRedoStack.get());
- impl_undoRedo( xCurrentModel, m_apRedoStack.get(), m_apUndoStack.get(), false );
-}
-
-::sal_Bool SAL_CALL UndoManager::undoPossible()
- throw (uno::RuntimeException)
-{
- return ! m_apUndoStack->empty();
-}
-
-::sal_Bool SAL_CALL UndoManager::redoPossible()
- throw (uno::RuntimeException)
-{
- return ! m_apRedoStack->empty();
-}
-
-OUString SAL_CALL UndoManager::getCurrentUndoString()
- throw (uno::RuntimeException)
-{
- return m_apUndoStack->topUndoString();
-}
-
-OUString SAL_CALL UndoManager::getCurrentRedoString()
- throw (uno::RuntimeException)
-{
- return m_apRedoStack->topUndoString();
-}
-
-Sequence< OUString > SAL_CALL UndoManager::getAllUndoStrings()
- throw (uno::RuntimeException)
-{
- return m_apUndoStack->getUndoStrings();
-}
-
-Sequence< OUString > SAL_CALL UndoManager::getAllRedoStrings()
- throw (uno::RuntimeException)
-{
- return m_apRedoStack->getUndoStrings();
-}
-
-// ____ XUndoHelper ____
-Reference< frame::XModel > SAL_CALL UndoManager::getModelCloneForUndo(
- const Reference< frame::XModel >& xModelBeforeChange )
- throw (uno::RuntimeException)
-{
- return impl::UndoElement::cloneModel( xModelBeforeChange );
-}
-
-void SAL_CALL UndoManager::applyModelContent(
- Reference< frame::XModel >& xModelToChange,
- const Reference< frame::XModel >& xModelToCopyFrom )
- throw (uno::RuntimeException)
-{
- impl::UndoElement::applyModelContentToModel( xModelToChange, xModelToCopyFrom );
-}
-
-// ____ XUnoTunnel ____
-sal_Int64 UndoManager::getSomething( const Sequence< sal_Int8 >& rId )
- throw (uno::RuntimeException)
-{
- if ( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
- {
- return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) );
- }
- return 0;
-}
-
-const Sequence< sal_Int8 >& UndoManager::getUnoTunnelId()
-{
- static Sequence< sal_Int8 >* pSeq = 0;
- if( !pSeq )
- {
- osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
- if( !pSeq )
- {
- static Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
-}
-
-UndoManager* UndoManager::getImplementation( const Reference< uno::XInterface > xObj )
-{
- UndoManager* pRet = NULL;
- Reference< lang::XUnoTunnel > xUT( xObj, uno::UNO_QUERY );
- if ( xUT.is() )
- {
- pRet = reinterpret_cast< UndoManager* >( sal::static_int_cast< sal_IntPtr >( xUT->getSomething( getUnoTunnelId() ) ) );
- }
- return pRet;
-}
-
-} // namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/main/_serviceregistration_controller.cxx b/chart2/source/controller/main/_serviceregistration_controller.cxx
index 26576d026b46..40be8ac313fa 100644
--- a/chart2/source/controller/main/_serviceregistration_controller.cxx
+++ b/chart2/source/controller/main/_serviceregistration_controller.cxx
@@ -109,13 +109,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, g_entries_chart2_controller );
-}
-//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
diff --git a/chart2/source/controller/main/makefile.mk b/chart2/source/controller/main/makefile.mk
index 729276d5bd0e..557d6cf6216f 100644
--- a/chart2/source/controller/main/makefile.mk
+++ b/chart2/source/controller/main/makefile.mk
@@ -72,12 +72,9 @@ SLOFILES = \
$(SLO)$/DrawCommandDispatch.obj \
$(SLO)$/ShapeController.obj \
$(SLO)$/ShapeToolbarController.obj \
- $(SLO)$/ImplUndoManager.obj \
- $(SLO)$/UndoManager.obj \
- $(SLO)$/UndoGuard.obj
-
-# $(SLO)$/CommonConverters.obj \
-# $(SLO)$/Scaling.obj \
+ $(SLO)$/UndoActions.obj \
+ $(SLO)$/UndoGuard.obj \
+ $(SLO)$/ChartModelClone.obj \
# --- Targets -----------------------------------------------------------------
diff --git a/chart2/source/controller/makefile.mk b/chart2/source/controller/makefile.mk
index daaae0af0323..dc3ed778b3c8 100644
--- a/chart2/source/controller/makefile.mk
+++ b/chart2/source/controller/makefile.mk
@@ -109,11 +109,10 @@ DEF1NAME= $(SHL1TARGET)
# --- Resources ---------------------------------------------------------------
-# sfx.srs is needed for the strings for UNDO and REDO in the UndoCommandDispatch
RESLIB1LIST=\
$(SRS)$/chcdialogs.srs \
$(SRS)$/chcmenus.srs \
- $(SOLARCOMMONRESDIR)$/sfx.srs
+
RESLIB1NAME= $(TARGET)
RESLIB1IMAGES=$(PRJ)$/res
@@ -123,3 +122,11 @@ RESLIB1DEPN=$(RESLIB1LIST)
# --- Targets -----------------------------------------------------------------
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/chartcontroller.component
+
+$(MISC)/chartcontroller.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt chartcontroller.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt chartcontroller.component
diff --git a/chart2/source/inc/AxisHelper.hxx b/chart2/source/inc/AxisHelper.hxx
index 929d5db82b9b..203806ec1bd0 100644
--- a/chart2/source/inc/AxisHelper.hxx
+++ b/chart2/source/inc/AxisHelper.hxx
@@ -30,10 +30,12 @@
#include "charttoolsdllapi.hxx"
#include "ReferenceSizeProvider.hxx"
+#include "ExplicitCategoriesProvider.hxx"
#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <vector>
@@ -59,6 +61,15 @@ public:
static bool isLogarithmic( const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XScaling >& xScaling );
+ static void checkDateAxis( ::com::sun::star::chart2::ScaleData& rScale, ExplicitCategoriesProvider* pExplicitCategoriesProvider, bool bChartTypeAllowsDateAxis );
+ static ::com::sun::star::chart2::ScaleData getDateCheckedScale( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
+
+ static sal_Int32 getExplicitNumberFormatKeyForAxis(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >& xCorrespondingCoordinateSystem
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier
+ , bool bSearchForParallelAxisIfNothingIsFound );
+
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XAxis >
createAxis( sal_Int32 nDimensionIndex, bool bMainAxis
@@ -179,7 +190,7 @@ public:
, sal_Int32& rOutCooSysIndex, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex );
/** @param bOnlyVisible if </TRUE>, only axes with property "Show" set to
- </TRUE> are returned
+ </sal_True> are returned
*/
static ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Reference<
@@ -189,7 +200,7 @@ public:
, bool bOnlyVisible = false );
/** @param bOnlyVisible if </TRUE>, only axes with property "Show" set to
- </TRUE> are returned
+ </sal_True> are returned
*/
SAL_DLLPRIVATE static std::vector<
::com::sun::star::uno::Reference<
diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx
index f0a2d9380345..4d0c800cef81 100644
--- a/chart2/source/inc/ChartModelHelper.hxx
+++ b/chart2/source/inc/ChartModelHelper.hxx
@@ -32,7 +32,6 @@
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
#include <com/sun/star/chart2/data/XRangeHighlighter.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
diff --git a/chart2/source/inc/ChartTypeHelper.hxx b/chart2/source/inc/ChartTypeHelper.hxx
index da596d1992ae..94c1ebf62600 100644
--- a/chart2/source/inc/ChartTypeHelper.hxx
+++ b/chart2/source/inc/ChartTypeHelper.hxx
@@ -62,8 +62,9 @@ public:
static bool isSupportingStartingAngle( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
//starting value for bars or baseline for areas for example
static bool isSupportingBaseValue( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
- static bool shiftTicksAtXAxisPerDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
+ static bool shiftCategoryPosAtXAxisPerDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
static bool isSupportingAxisPositioning( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex );
+ static bool isSupportingDateAxis( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex );
//returns sequence of ::com::sun::star::chart::DataLabelPlacement
static ::com::sun::star::uno::Sequence < sal_Int32 > getSupportedLabelPlacements(
diff --git a/chart2/source/inc/CommonFunctors.hxx b/chart2/source/inc/CommonFunctors.hxx
index a58bde00d381..e7686ae6dac1 100644
--- a/chart2/source/inc/CommonFunctors.hxx
+++ b/chart2/source/inc/CommonFunctors.hxx
@@ -69,18 +69,7 @@ struct OOO_DLLPUBLIC_CHARTTOOLS AnyToDouble : public ::std::unary_function< ::co
::rtl::math::setNan( & fResult );
::com::sun::star::uno::TypeClass eClass( rAny.getValueType().getTypeClass() );
- if( eClass == ::com::sun::star::uno::TypeClass_STRING )
- {
- rtl_math_ConversionStatus eConversionStatus;
- fResult = ::rtl::math::stringToDouble(
- * reinterpret_cast< const ::rtl::OUString * >( rAny.getValue() ),
- sal_Char( '.' ), sal_Char( ',' ),
- & eConversionStatus, NULL );
-
- if( eConversionStatus != rtl_math_ConversionStatus_Ok )
- ::rtl::math::setNan( & fResult );
- }
- else if( eClass == ::com::sun::star::uno::TypeClass_DOUBLE )
+ if( eClass == ::com::sun::star::uno::TypeClass_DOUBLE )
{
fResult = * reinterpret_cast< const double * >( rAny.getValue() );
}
diff --git a/chart2/source/inc/DiagramHelper.hxx b/chart2/source/inc/DiagramHelper.hxx
index e38c47053295..df6a8cf082cc 100644
--- a/chart2/source/inc/DiagramHelper.hxx
+++ b/chart2/source/inc/DiagramHelper.hxx
@@ -39,6 +39,8 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XNumberFormats.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <utility>
#include <vector>
@@ -109,7 +111,7 @@ public:
);
/** @param bOnlyAtFirstChartType
- If </TRUE>, the stacking mode is only set at the series found inside
+ If </sal_True>, 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
@@ -241,6 +243,21 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XCoordinateSystem > & xCooSys );
+ static void switchToDateCategories(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument > & xChartDoc );
+
+ static void switchToTextCategories(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument > & xChartDoc );
+
+ static bool isSupportingDateAxis( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& xDiagram );
+ static bool isDateNumberFormat( sal_Int32 nNumberFormat, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >& xNumberFormats );
+ static sal_Int32 getDateNumberFormat( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
+
+ static sal_Int32 getPercentNumberFormat( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
+
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartType >
getChartTypeByIndex( const ::com::sun::star::uno::Reference<
@@ -271,7 +288,7 @@ public:
* @param bForward
* Direction of the move to be checked.
*
- * @returns </TRUE> if the series can be moved.
+ * @returns </sal_True> if the series can be moved.
*
*/
static bool isSeriesMoveable(
@@ -293,7 +310,7 @@ public:
* @param bForward
* Direction in which the series should be moved.
*
- * @returns </TRUE> if the series was moved successfully.
+ * @returns </sal_True> if the series was moved successfully.
*
*/
static bool moveSeries(
diff --git a/chart2/source/inc/ExplicitCategoriesProvider.hxx b/chart2/source/inc/ExplicitCategoriesProvider.hxx
index 14d26b68385e..59020869b2d0 100644
--- a/chart2/source/inc/ExplicitCategoriesProvider.hxx
+++ b/chart2/source/inc/ExplicitCategoriesProvider.hxx
@@ -59,6 +59,24 @@ public:
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > getStringsForLevel( sal_Int32 nIndex ) const = 0;
};
+struct DatePlusIndex
+{
+ DatePlusIndex()
+ : fValue(1.0)
+ , nIndex( -1 )
+ {
+ }
+
+ DatePlusIndex( const double& _fValue, sal_Int32 _nIndex )
+ : fValue(_fValue)
+ , nIndex( _nIndex )
+ {
+ }
+
+ double fValue;
+ sal_Int32 nIndex;
+};
+
class OOO_DLLPUBLIC_CHARTTOOLS ExplicitCategoriesProvider
{
public:
@@ -71,6 +89,9 @@ public:
void init();
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XDataSequence > getOriginalCategories();
+
::com::sun::star::uno::Sequence< ::rtl::OUString > getSimpleCategories();
::std::vector< ComplexCategory > getCategoriesByLevel( sal_Int32 nLevel );
@@ -84,23 +105,37 @@ public:
static ::com::sun::star::uno::Sequence< ::rtl::OUString > getExplicitSimpleCategories(
const SplitCategoriesProvider& rSplitCategoriesProvider );
+ static void convertCategoryAnysToText( ::com::sun::star::uno::Sequence< rtl::OUString >& rOutTexts
+ , const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rInAnys
+ , ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xChartModel );
+
bool hasComplexCategories() const;
sal_Int32 getCategoryLevelCount() const;
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence> >& getSplitCategoriesList();
+ bool isDateAxis();
+ const std::vector< DatePlusIndex >& getDateCategories();
+
private: //member
- ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aExplicitCategories;
- ::std::vector< ::std::vector< ComplexCategory > > m_aComplexCats;
bool volatile m_bDirty;
-
::com::sun::star::uno::WeakReference<
- ::com::sun::star::chart2::XCoordinateSystem > m_xCooSysModel;
+ ::com::sun::star::chart2::XCoordinateSystem > m_xCooSysModel;
+ ::com::sun::star::uno::WeakReference<
+ ::com::sun::star::frame::XModel > m_xChartModel;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence> m_xOriginalCategories;
+
+ bool m_bIsExplicitCategoriesInited;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aExplicitCategories;
+ ::std::vector< ::std::vector< ComplexCategory > > m_aComplexCats;
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence> > m_aSplitCategoriesList;
+
+ bool m_bIsDateAxis;
+ bool m_bIsAutoDate;
+ std::vector< DatePlusIndex > m_aDateCategories;
};
} // namespace chart
diff --git a/chart2/source/inc/InternalData.hxx b/chart2/source/inc/InternalData.hxx
index 3a618dcd99a9..d98fda8a54c1 100644
--- a/chart2/source/inc/InternalData.hxx
+++ b/chart2/source/inc/InternalData.hxx
@@ -56,11 +56,11 @@ public:
void setColumnValues( sal_Int32 nColumnIndex, const ::std::vector< double > & rNewData );
void setRowValues( sal_Int32 nRowIndex, const ::std::vector< double > & rNewData );
- void setComplexColumnLabel( sal_Int32 nColumnIndex, const ::std::vector< ::rtl::OUString >& rComplexLabel );
- void setComplexRowLabel( sal_Int32 nRowIndex, const ::std::vector< ::rtl::OUString >& rComplexLabel );
+ void setComplexColumnLabel( sal_Int32 nColumnIndex, const ::std::vector< ::com::sun::star::uno::Any >& rComplexLabel );
+ void setComplexRowLabel( sal_Int32 nRowIndex, const ::std::vector< ::com::sun::star::uno::Any >& rComplexLabel );
- ::std::vector< ::rtl::OUString > getComplexColumnLabel( sal_Int32 nColumnIndex ) const;
- ::std::vector< ::rtl::OUString > getComplexRowLabel( sal_Int32 nRowIndex ) const;
+ ::std::vector< ::com::sun::star::uno::Any > getComplexColumnLabel( sal_Int32 nColumnIndex ) const;
+ ::std::vector< ::com::sun::star::uno::Any > getComplexRowLabel( sal_Int32 nRowIndex ) const;
void swapRowWithNext( sal_Int32 nRowIndex );
void swapColumnWithNext( sal_Int32 nColumnIndex );
@@ -79,12 +79,12 @@ public:
sal_Int32 getColumnCount() const;
typedef ::std::valarray< double > tDataType;
- typedef ::std::vector< ::std::vector< ::rtl::OUString > > tVecVecString; //inner index is hierarchical level
+ typedef ::std::vector< ::std::vector< ::com::sun::star::uno::Any > > tVecVecAny; //inner index is hierarchical level
- void setComplexRowLabels( const tVecVecString& rNewRowLabels );
- tVecVecString getComplexRowLabels() const;
- void setComplexColumnLabels( const tVecVecString& rNewColumnLabels );
- tVecVecString getComplexColumnLabels() const;
+ void setComplexRowLabels( const tVecVecAny& rNewRowLabels );
+ tVecVecAny getComplexRowLabels() const;
+ void setComplexColumnLabels( const tVecVecAny& rNewColumnLabels );
+ tVecVecAny getComplexColumnLabels() const;
#if OSL_DEBUG_LEVEL > 1
void traceData() const;
@@ -94,7 +94,7 @@ private: //methods
/** resizes the data if at least one of the given dimensions is larger than
before. The data is never becoming smaller only larger.
- @return </TRUE>, if the data was enlarged
+ @return </sal_True>, if the data was enlarged
*/
bool enlargeData( sal_Int32 nColumnCount, sal_Int32 nRowCount );
@@ -102,9 +102,9 @@ private:
sal_Int32 m_nColumnCount;
sal_Int32 m_nRowCount;
- tDataType m_aData;
- tVecVecString m_aRowLabels;//outer index is row index, inner index is category level
- tVecVecString m_aColumnLabels;//outer index is column index
+ tDataType m_aData;
+ tVecVecAny m_aRowLabels;//outer index is row index, inner index is category level
+ tVecVecAny m_aColumnLabels;//outer index is column index
};
#endif
diff --git a/chart2/source/inc/InternalDataProvider.hxx b/chart2/source/inc/InternalDataProvider.hxx
index b7a541320d40..adffd61b4263 100644
--- a/chart2/source/inc/InternalDataProvider.hxx
+++ b/chart2/source/inc/InternalDataProvider.hxx
@@ -31,7 +31,8 @@
#include "InternalData.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
+#include <com/sun/star/chart/XDateCategories.hpp>
+#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
#include <com/sun/star/chart2/data/XDataProvider.hpp>
#include <com/sun/star/chart2/XInternalDataProvider.hpp>
#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
@@ -39,7 +40,7 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/util/XCloneable.hpp>
-#include <cppuhelper/implbase6.hxx>
+#include <cppuhelper/implbase7.hxx>
#include "ServiceMacros.hxx"
#include "CachedDataSequence.hxx"
@@ -53,10 +54,11 @@ namespace chart
namespace impl
{
-typedef ::cppu::WeakImplHelper6<
+typedef ::cppu::WeakImplHelper7<
::com::sun::star::chart2::XInternalDataProvider,
::com::sun::star::chart2::data::XRangeXMLConversion,
- ::com::sun::star::chart::XComplexDescriptionAccess,
+ ::com::sun::star::chart2::XAnyDescriptionAccess,
+ ::com::sun::star::chart::XDateCategories,
::com::sun::star::util::XCloneable,
::com::sun::star::lang::XInitialization,
::com::sun::star::lang::XServiceInfo >
@@ -150,7 +152,25 @@ public:
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
- // ____ XComplexDescriptionAccess ____
+ // ____ XDateCategories ____
+ virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getDateCategories() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDateCategories( const ::com::sun::star::uno::Sequence< double >& rDates ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XAnyDescriptionAccess ____
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL
+ getAnyRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAnyRowDescriptions(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aRowDescriptions )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL
+ getAnyColumnDescriptions() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setAnyColumnDescriptions(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aColumnDescriptions )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XComplexDescriptionAccess (base of XAnyDescriptionAccess) ____
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL
getComplexRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setComplexRowDescriptions(
diff --git a/chart2/source/inc/chartview/NumberFormatterWrapper.hxx b/chart2/source/inc/NumberFormatterWrapper.hxx
index 8ccc3e506487..77e2423a266f 100644..100755
--- a/chart2/source/inc/chartview/NumberFormatterWrapper.hxx
+++ b/chart2/source/inc/NumberFormatterWrapper.hxx
@@ -1,4 +1,3 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,12 +24,12 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _CHART2_VIEW_NUMBERFORMATTERWRAPPER_HXX
-#define _CHART2_VIEW_NUMBERFORMATTERWRAPPER_HXX
+#ifndef _CHART2_TOOLS_NUMBERFORMATTERWRAPPER_HXX
+#define _CHART2_TOOLS_NUMBERFORMATTERWRAPPER_HXX
+#include "charttoolsdllapi.hxx"
#include <svl/zforlist.hxx>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include "chartviewdllapi.hxx"
//.............................................................................
namespace chart
@@ -42,7 +41,7 @@ namespace chart
*/
class FixedNumberFormatter;
-class OOO_DLLPUBLIC_CHARTVIEW NumberFormatterWrapper
+class OOO_DLLPUBLIC_CHARTTOOLS NumberFormatterWrapper
{
public:
NumberFormatterWrapper( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xSupplier );
@@ -53,6 +52,7 @@ public:
getNumberFormatsSupplier() { return m_xNumberFormatsSupplier; };
rtl::OUString getFormattedString( sal_Int32 nNumberFormatKey, double fValue, sal_Int32& rLabelColor, bool& rbColorChanged ) const;
+ Date getNullDate() const;
private: //private member
::com::sun::star::uno::Reference< com::sun::star::util::XNumberFormatsSupplier >
@@ -63,7 +63,7 @@ private: //private member
};
-class FixedNumberFormatter
+class OOO_DLLPUBLIC_CHARTTOOLS FixedNumberFormatter
{
public:
FixedNumberFormatter( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xSupplier
@@ -74,12 +74,10 @@ public:
private:
NumberFormatterWrapper m_aNumberFormatterWrapper;
- ULONG m_nNumberFormatKey;
+ sal_uLong m_nNumberFormatKey;
};
//.............................................................................
} //namespace chart
//.............................................................................
#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/OPropertySet.hxx b/chart2/source/inc/OPropertySet.hxx
index 6c4f5673308e..703543a1124b 100644
--- a/chart2/source/inc/OPropertySet.hxx
+++ b/chart2/source/inc/OPropertySet.hxx
@@ -88,41 +88,13 @@ protected:
*/
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() = 0;
- // ____ XPropertySet ____
- /** sample implementation using the InfoHelper:
-
- <pre>
- uno::Reference&lt; beans::XPropertySetInfo &gt; SAL_CALL
- OPropertySet::getPropertySetInfo()
- throw (uno::RuntimeException)
- {
- static uno::Reference&lt; beans::XPropertySetInfo &gt; xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
- }
- </pre>
-
- <p>(The reason why this isn't implemented here is, that the static
- object is only valid per concrete PropertySet. Otherwise all
- PropertySets derived from this base calss would have the same
- properties.)</p>
-
- @see ::cppu::OPropertySetHelper
- */
/** Try to convert the value <code>rValue</code> to the type required by the
property associated with <code>nHandle</code>.
Overload this method to take influence in modification of properties.
- If the conversion changed , </TRUE> is returned and the converted value
+ If the conversion changed , </sal_True> is returned and the converted value
is in <code>rConvertedValue</code>. The former value is contained in
<code>rOldValue</code>.
diff --git a/chart2/source/inc/ReferenceSizeProvider.hxx b/chart2/source/inc/ReferenceSizeProvider.hxx
index 3f701546afb3..3ef1426cd252 100644
--- a/chart2/source/inc/ReferenceSizeProvider.hxx
+++ b/chart2/source/inc/ReferenceSizeProvider.hxx
@@ -85,7 +85,7 @@ public:
/** Sets the ReferencePageSize according to the internal settings of this
class at the XPropertySet, and the adapted font sizes if bAdaptFontSizes
- is </TRUE>.
+ is </sal_True>.
*/
SAL_DLLPRIVATE void setValuesAtPropertySet(
const ::com::sun::star::uno::Reference<
diff --git a/chart2/source/inc/RelativePositionHelper.hxx b/chart2/source/inc/RelativePositionHelper.hxx
index 2298888a67c2..4934d042f794 100644
--- a/chart2/source/inc/RelativePositionHelper.hxx
+++ b/chart2/source/inc/RelativePositionHelper.hxx
@@ -85,10 +85,10 @@ public:
position such that the resize is relative to the former rectangle's
center.
- @param bCheck If </TRUE>, the resize is only done, if after
+ @param bCheck If </sal_True>, the resize is only done, if after
transformation, the position and size are within the bounds [0,1].
- @return </TRUE>, if changes were applied.
+ @return </sal_True>, if changes were applied.
<p>That means, if the position's alignment is center, the position will
not change at all.</p>
@@ -101,12 +101,12 @@ public:
/** shifts a relative position about the given amount
- @param bCheck If </TRUE>, the shift is only done, if after
+ @param bCheck If </sal_True>, the shift is only done, if after
transformation, the object represented by the position
rInOutPosition and its size rObjectSize the position and size are
within the bounds [0,1].
- @return </TRUE>, if changes were applied.
+ @return </sal_True>, if changes were applied.
*/
static bool moveObject(
::com::sun::star::chart2::RelativePosition & rInOutPosition,
diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc
index 358bf3cf82cc..de3c56a914f8 100644
--- a/chart2/source/inc/Strings.hrc
+++ b/chart2/source/inc/Strings.hrc
@@ -30,8 +30,8 @@
// this includes no link dependency
#include <svl/solar.hrc>
-//next free is 291
-//single free is: 134
+//next free is 293
+//single free: 139
//-----------------------------------------------------------------------------
//chart types
@@ -100,6 +100,7 @@
#define STR_REGRESSION_LOG (RID_APP_START + 136)
#define STR_REGRESSION_EXP (RID_APP_START + 137)
#define STR_REGRESSION_POWER (RID_APP_START + 138)
+#define STR_REGRESSION_MEAN (RID_APP_START + 180)
//-----------------------------------------------------------------------------
//for scale tab page
@@ -109,6 +110,8 @@
#define STR_STEP_GT_ZERO (RID_APP_START + 102)
#define STR_BAD_LOGARITHM (RID_APP_START + 111)
#define STR_MIN_GREATER_MAX (RID_APP_START + 101)
+#define STR_INVALID_INTERVALS (RID_APP_START + 291)
+#define STR_INVALID_TIME_UNIT (RID_APP_START + 292)
//-----------------------------------------------------------------------------
//for range didalog
@@ -206,8 +209,6 @@
#define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS (RID_APP_START + 265)
#define STR_OBJECT_CURVE_EQUATION (RID_APP_START + 268)
-#define STR_STATISTICS_IN_LEGEND (RID_APP_START + 180)
-
#define STR_OBJECT_SHAPE (RID_APP_START + 290)
//-----------------------------------------------------------------------------
@@ -254,6 +255,7 @@
#define STR_ACTION_TOGGLE_GRID_HORZ (RID_APP_START + 86)
#define STR_ACTION_SCALE_TEXT (RID_APP_START + 93)
#define STR_ACTION_REARRANGE_CHART (RID_APP_START + 94)
+#define STR_ACTION_EDIT_TEXT (RID_APP_START + 95)
#define STR_TIP_CHOOSECOLOR (RID_APP_START + 233)
#define STR_TIP_LIGHTSOURCE_X (RID_APP_START + 234)
@@ -268,7 +270,6 @@
#define STR_TIP_DATAPOINT (RID_APP_START + 140)
#define STR_TIP_DATAPOINT_INDEX (RID_APP_START + 141)
#define STR_TIP_DATAPOINT_VALUES (RID_APP_START + 142)
-#define STR_TIP_CATEGORY_VALUE (RID_APP_START + 139)
//-----------------------------------------------------------------------------
//warning and info boxes
@@ -285,6 +286,10 @@
#define STR_TEXT_DIRECTION_RTL (RID_APP_START + 279)
#define STR_TEXT_DIRECTION_SUPER (RID_APP_START + 280)
+//IAccessibility2 Implementation 2009-----
+#define STR_BUTTON_UP (RID_APP_START + 500)
+#define STR_BUTTON_DOWN (RID_APP_START + 501)
+//-----IAccessibility2 Implementation 2009
//-----------------------------------------------------------------------------
// ids must not exceed RID_APP_START + 499
diff --git a/chart2/source/inc/UndoGuard.hxx b/chart2/source/inc/UndoGuard.hxx
deleted file mode 100644
index 32513de414e9..000000000000
--- a/chart2/source/inc/UndoGuard.hxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CHART2_UNDOGUARD_HXX
-#define CHART2_UNDOGUARD_HXX
-
-#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
-
-// header for class OUString
-#include <rtl/ustring.hxx>
-
-namespace chart
-{
-/** Base Class for UndoGuard and UndoLiveUpdateGuard
-*/
-class UndoGuard_Base
-{
-public:
- explicit UndoGuard_Base( const rtl::OUString & rUndoMessage
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > & xUndoManager
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- virtual ~UndoGuard_Base();
-
- void commitAction();
-
-protected:
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > m_xModel;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
-
- rtl::OUString m_aUndoString;
- bool m_bActionPosted;
-};
-
-/** This guard calls preAction at the given Model in the CTOR and
- cancelAction in the DTOR if no other method is called.
- If commitAction is called the destructor does nothin anymore.
- */
-class UndoGuard : public UndoGuard_Base
-{
-public:
- explicit UndoGuard( const rtl::OUString& rUndoMessage
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > & xUndoManager
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- virtual ~UndoGuard();
-};
-
-/** This guard calls preAction at the given Model in the CTOR and
- cancelActionUndo in the DTOR if no other method is called.
- If commitAction is called the destructor does nothin anymore.
- */
-class UndoLiveUpdateGuard : public UndoGuard_Base
-{
-public:
- explicit UndoLiveUpdateGuard( const rtl::OUString& rUndoMessage
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > & xUndoManager
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- virtual ~UndoLiveUpdateGuard();
-};
-
-/** Same as UndoLiveUpdateGuard but with additional storage of the chart's data.
- Only use this if the data has internal data.
- */
-class UndoLiveUpdateGuardWithData :
- public UndoGuard_Base
-{
-public:
- explicit UndoLiveUpdateGuardWithData( const rtl::OUString& rUndoMessage
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > & xUndoManager
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- virtual ~UndoLiveUpdateGuardWithData();
-};
-
-class UndoGuardWithSelection : public UndoGuard_Base
-{
-public:
- explicit UndoGuardWithSelection( const rtl::OUString& rUndoMessage
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XUndoManager > & xUndoManager
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xModel );
- virtual ~UndoGuardWithSelection();
-};
-
-}
-// CHART2_UNDOGUARD_HXX
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/UndoManager.hxx b/chart2/source/inc/UndoManager.hxx
deleted file mode 100644
index b87ad91a22c7..000000000000
--- a/chart2/source/inc/UndoManager.hxx
+++ /dev/null
@@ -1,183 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CHART2_UNDOMANAGER_HXX
-#define CHART2_UNDOMANAGER_HXX
-
-#include "ConfigItemListener.hxx"
-#include "MutexContainer.hxx"
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
-#include <com/sun/star/util/XModifyListener.hpp>
-#include <com/sun/star/chart2/XUndoManager.hpp>
-#include <com/sun/star/chart2/XUndoHelper.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-
-#include <cppuhelper/compbase4.hxx>
-#include <rtl/ustring.hxx>
-
-// for pair
-#include <utility>
-// for auto_ptr
-#include <memory>
-
-class SdrUndoAction;
-
-namespace com { namespace sun { namespace star {
-namespace frame {
- class XModel;
-}
-}}}
-
-namespace chart
-{
-// ----------------------------------------
-namespace impl
-{
-
-class UndoStepsConfigItem;
-class UndoElement;
-class UndoStack;
-class ModifyBroadcaster;
-
-typedef ::cppu::WeakComponentImplHelper4<
- ::com::sun::star::util::XModifyBroadcaster,
- ::com::sun::star::chart2::XUndoManager,
- ::com::sun::star::chart2::XUndoHelper,
- ::com::sun::star::lang::XUnoTunnel >
- UndoManager_Base;
-
-} // namespace impl
-// ----------------------------------------
-
-/** Manages undo by storing the entire XModel in the undo- and redo-buffers.
- Note, that therefore this should not be used for "big" XModels.
-
- A prerequisite for this to work is that the XModels added to the undo-
- redo-stacks support the css::util::XCloneable interface, which is
- implemented such that the entire model is cloned.
- */
-class UndoManager :
- public MutexContainer,
- public ConfigItemListener,
- public impl::UndoManager_Base
-{
-public:
- explicit UndoManager();
- virtual ~UndoManager();
-
- void addShapeUndoAction( SdrUndoAction* pAction );
-
- // ____ XUnoTunnel ____
- virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId )
- throw (::com::sun::star::uno::RuntimeException);
-
- static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
- static UndoManager* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xObj );
-
-protected:
- // ____ ConfigItemListener ____
- virtual void notify( const ::rtl::OUString & rPropertyName );
-
- // ____ util::XModifyBroadcaster ____
- virtual void SAL_CALL addModifyListener(
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeModifyListener(
- const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
- throw (::com::sun::star::uno::RuntimeException);
-
- // ____ chart2::XUndoManager ____
- virtual void SAL_CALL preAction( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelBeforeChange )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL preActionWithArguments(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelBeforeChange,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL postAction( const ::rtl::OUString& aUndoText )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelAction()
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelActionWithUndo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelToRestore )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL undo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xCurrentModel )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL redo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xCurrentModel )
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL undoPossible()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::sal_Bool SAL_CALL redoPossible()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCurrentUndoString()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getCurrentRedoString()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoStrings()
- throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoStrings()
- throw (::com::sun::star::uno::RuntimeException);
-
- // ____ XUndoHelper ____
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModelCloneForUndo(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelBeforeChange )
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL applyModelContent(
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelToChange,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModelToCopyFrom )
- throw (::com::sun::star::uno::RuntimeException);
-
-private:
- void retrieveConfigUndoSteps();
- void fireModifyEvent();
- void impl_undoRedo(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > & xCurrentModel,
- impl::UndoStack * pStackToRemoveFrom,
- impl::UndoStack * pStackToAddTo,
- bool bUndo = true );
-
- ::std::auto_ptr< impl::UndoStack > m_apUndoStack;
- ::std::auto_ptr< impl::UndoStack > m_apRedoStack;
-
- impl::UndoElement * m_pLastRemeberedUndoElement;
-
- ::std::auto_ptr< impl::UndoStepsConfigItem > m_apUndoStepsConfigItem;
- sal_Int32 m_nMaxNumberOfUndos;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::util::XModifyBroadcaster > m_xModifyBroadcaster;
- // pointer is valid as long as m_xModifyBroadcaster.is()
- impl::ModifyBroadcaster * m_pModifyBroadcaster;
-};
-
-} // namespace chart
-
-// CHART2_UNDOMANAGER_HXX
-#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 7b407edcfe3a..48b638ea929b 100644
--- a/chart2/source/inc/chartview/ChartSfxItemIds.hxx
+++ b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
@@ -28,8 +28,6 @@
#ifndef CHARTSFXITEMIDS_HXX
#define CHARTSFXITEMIDS_HXX
-#include <sfx2/sfxdefs.hxx>
-
// ============================================================
// SCHATTR
// ============================================================
@@ -46,67 +44,24 @@
#define SCHATTR_DATADESCR_PLACEMENT (SCHATTR_DATADESCR_START + 5)
#define SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS (SCHATTR_DATADESCR_START + 6)
#define SCHATTR_DATADESCR_NO_PERCENTVALUE (SCHATTR_DATADESCR_START + 7) //percentage values should not be offered
-#define SCHATTR_DATADESCR_END SCHATTR_DATADESCR_NO_PERCENTVALUE
+#define SCHATTR_PERCENT_NUMBERFORMAT_VALUE (SCHATTR_DATADESCR_START + 8)
+#define SCHATTR_PERCENT_NUMBERFORMAT_SOURCE (SCHATTR_DATADESCR_START + 9)
+#define SCHATTR_DATADESCR_END SCHATTR_PERCENT_NUMBERFORMAT_SOURCE
+//legend
#define SCHATTR_LEGEND_START (SCHATTR_DATADESCR_END + 1)
#define SCHATTR_LEGEND_POS SCHATTR_LEGEND_START
-#define SCHATTR_LEGEND_END SCHATTR_LEGEND_POS
+#define SCHATTR_LEGEND_SHOW (SCHATTR_LEGEND_START + 1)
+#define SCHATTR_LEGEND_END SCHATTR_LEGEND_SHOW
+//text
#define SCHATTR_TEXT_START (SCHATTR_LEGEND_END + 1)
-// name changed, was SCHATTR_TEXT_ORIENT:
-#define SCHATTR_TEXT_STACKED SCHATTR_TEXT_START
-#define SCHATTR_TEXT_ORDER (SCHATTR_TEXT_START + 1)
-#define SCHATTR_TEXT_END SCHATTR_TEXT_ORDER
-
-#define SCHATTR_Y_AXIS_START (SCHATTR_TEXT_END + 1)
-#define SCHATTR_Y_AXIS_AUTO_MIN SCHATTR_Y_AXIS_START
-#define SCHATTR_Y_AXIS_MIN (SCHATTR_Y_AXIS_START + 1)
-#define SCHATTR_Y_AXIS_AUTO_MAX (SCHATTR_Y_AXIS_START + 2)
-#define SCHATTR_Y_AXIS_MAX (SCHATTR_Y_AXIS_START + 3)
-#define SCHATTR_Y_AXIS_AUTO_STEP_MAIN (SCHATTR_Y_AXIS_START + 4)
-#define SCHATTR_Y_AXIS_STEP_MAIN (SCHATTR_Y_AXIS_START + 5)
-#define SCHATTR_Y_AXIS_AUTO_STEP_HELP (SCHATTR_Y_AXIS_START + 6)
-#define SCHATTR_Y_AXIS_STEP_HELP (SCHATTR_Y_AXIS_START + 7)
-#define SCHATTR_Y_AXIS_LOGARITHM (SCHATTR_Y_AXIS_START + 8)
-#define SCHATTR_Y_AXIS_AUTO_ORIGIN (SCHATTR_Y_AXIS_START + 9)
-#define SCHATTR_Y_AXIS_ORIGIN (SCHATTR_Y_AXIS_START + 10)
-#define SCHATTR_Y_AXIS_END SCHATTR_Y_AXIS_ORIGIN
-
-#define SCHATTR_X_AXIS_START (SCHATTR_Y_AXIS_END + 1)
-#define SCHATTR_X_AXIS_AUTO_MIN SCHATTR_X_AXIS_START
-#define SCHATTR_X_AXIS_MIN (SCHATTR_X_AXIS_START + 1)
-#define SCHATTR_X_AXIS_AUTO_MAX (SCHATTR_X_AXIS_START + 2)
-#define SCHATTR_X_AXIS_MAX (SCHATTR_X_AXIS_START + 3)
-#define SCHATTR_X_AXIS_AUTO_STEP_MAIN (SCHATTR_X_AXIS_START + 4)
-#define SCHATTR_X_AXIS_STEP_MAIN (SCHATTR_X_AXIS_START + 5)
-#define SCHATTR_X_AXIS_AUTO_STEP_HELP (SCHATTR_X_AXIS_START + 6)
-#define SCHATTR_X_AXIS_STEP_HELP (SCHATTR_X_AXIS_START + 7)
-#define SCHATTR_X_AXIS_LOGARITHM (SCHATTR_X_AXIS_START + 8)
-#define SCHATTR_X_AXIS_AUTO_ORIGIN (SCHATTR_X_AXIS_START + 9)
-#define SCHATTR_X_AXIS_ORIGIN (SCHATTR_X_AXIS_START + 10)
-#define SCHATTR_X_AXIS_END SCHATTR_X_AXIS_ORIGIN
-
-#define SCHATTR_Z_AXIS_START (SCHATTR_X_AXIS_END + 1)
-#define SCHATTR_Z_AXIS_AUTO_MIN SCHATTR_Z_AXIS_START
-#define SCHATTR_Z_AXIS_MIN (SCHATTR_Z_AXIS_START + 1)
-#define SCHATTR_Z_AXIS_AUTO_MAX (SCHATTR_Z_AXIS_START + 2)
-#define SCHATTR_Z_AXIS_MAX (SCHATTR_Z_AXIS_START + 3)
-#define SCHATTR_Z_AXIS_AUTO_STEP_MAIN (SCHATTR_Z_AXIS_START + 4)
-#define SCHATTR_Z_AXIS_STEP_MAIN (SCHATTR_Z_AXIS_START + 5)
-#define SCHATTR_Z_AXIS_AUTO_STEP_HELP (SCHATTR_Z_AXIS_START + 6)
-#define SCHATTR_Z_AXIS_STEP_HELP (SCHATTR_Z_AXIS_START + 7)
-#define SCHATTR_Z_AXIS_LOGARITHM (SCHATTR_Z_AXIS_START + 8)
-#define SCHATTR_Z_AXIS_AUTO_ORIGIN (SCHATTR_Z_AXIS_START + 9)
-#define SCHATTR_Z_AXIS_ORIGIN (SCHATTR_Z_AXIS_START + 10)
-#define SCHATTR_Z_AXIS_END SCHATTR_Z_AXIS_ORIGIN
+#define SCHATTR_TEXT_DEGREES SCHATTR_TEXT_START
+#define SCHATTR_TEXT_STACKED (SCHATTR_TEXT_START + 1)
+#define SCHATTR_TEXT_END SCHATTR_TEXT_STACKED
-// miscellaneous
-
-#define SCHATTR_AXISTYPE (SCHATTR_Z_AXIS_END + 1)
-#define SCHATTR_PERCENT_NUMBERFORMAT_VALUE (SCHATTR_Z_AXIS_END + 2)
-#define SCHATTR_PERCENT_NUMBERFORMAT_SOURCE (SCHATTR_Z_AXIS_END + 3)
-
-#define SCHATTR_STAT_START (SCHATTR_PERCENT_NUMBERFORMAT_SOURCE + 1)
+// statistic
+#define SCHATTR_STAT_START (SCHATTR_TEXT_END + 1)
#define SCHATTR_STAT_AVERAGE SCHATTR_STAT_START
#define SCHATTR_STAT_KIND_ERROR (SCHATTR_STAT_START + 1)
#define SCHATTR_STAT_PERCENT (SCHATTR_STAT_START + 2)
@@ -118,16 +73,11 @@
#define SCHATTR_STAT_RANGE_NEG (SCHATTR_STAT_START + 8)
#define SCHATTR_STAT_END SCHATTR_STAT_RANGE_NEG
-#define SCHATTR_TEXT2_START ( SCHATTR_STAT_END + 1)
-#define SCHATTR_TEXT_DEGREES ( SCHATTR_TEXT2_START )
-#define SCHATTR_TEXT_OVERLAP ( SCHATTR_TEXT2_START +1 )
-#define SCHATTR_TEXT2_END ( SCHATTR_TEXT_OVERLAP )
-
// --------------------------------------------------------
// these attributes are for replacement of enum eChartStyle
// --------------------------------------------------------
-#define SCHATTR_STYLE_START ( SCHATTR_TEXT2_END +1 )
+#define SCHATTR_STYLE_START ( SCHATTR_STAT_END +1 )
// for whole chart
#define SCHATTR_STYLE_DEEP ( SCHATTR_STYLE_START )
@@ -151,35 +101,44 @@
#define SCHATTR_AXIS (SCHATTR_STYLE_END + 1)// see chtmodel.hxx defines CHART_AXIS_PRIMARY_X, etc.
//Re-mapped:
#define SCHATTR_AXIS_START (SCHATTR_AXIS + 1)
-#define SCHATTR_AXIS_AUTO_MIN SCHATTR_AXIS_START
-#define SCHATTR_AXIS_MIN (SCHATTR_AXIS_START + 1)
-#define SCHATTR_AXIS_AUTO_MAX (SCHATTR_AXIS_START + 2)
-#define SCHATTR_AXIS_MAX (SCHATTR_AXIS_START + 3)
-#define SCHATTR_AXIS_AUTO_STEP_MAIN (SCHATTR_AXIS_START + 4)
-#define SCHATTR_AXIS_STEP_MAIN (SCHATTR_AXIS_START + 5)
-#define SCHATTR_AXIS_AUTO_STEP_HELP (SCHATTR_AXIS_START + 6)
-// SCHATTR_AXIS_STEP_HELP: type changed from double to sal_Int32 !
-#define SCHATTR_AXIS_STEP_HELP (SCHATTR_AXIS_START + 7)
-#define SCHATTR_AXIS_LOGARITHM (SCHATTR_AXIS_START + 8)
-#define SCHATTR_AXIS_AUTO_ORIGIN (SCHATTR_AXIS_START + 9)
-#define SCHATTR_AXIS_ORIGIN (SCHATTR_AXIS_START + 10)
-//New:
-#define SCHATTR_AXIS_TICKS (SCHATTR_AXIS_START + 11)
-#define SCHATTR_AXIS_NUMFMT (SCHATTR_AXIS_START + 12)
-#define SCHATTR_AXIS_NUMFMTPERCENT (SCHATTR_AXIS_START + 13)
-#define SCHATTR_AXIS_SHOWAXIS (SCHATTR_AXIS_START + 14)
-#define SCHATTR_AXIS_SHOWDESCR (SCHATTR_AXIS_START + 15)
-#define SCHATTR_AXIS_SHOWMAINGRID (SCHATTR_AXIS_START + 16)
-#define SCHATTR_AXIS_SHOWHELPGRID (SCHATTR_AXIS_START + 17)
-#define SCHATTR_AXIS_TOPDOWN (SCHATTR_AXIS_START + 18)
-#define SCHATTR_AXIS_HELPTICKS (SCHATTR_AXIS_START + 19)
-#define SCHATTR_AXIS_REVERSE (SCHATTR_AXIS_START + 20)
-#define SCHATTR_AXIS_POSITION (SCHATTR_AXIS_START + 21)
-#define SCHATTR_AXIS_POSITION_VALUE (SCHATTR_AXIS_START + 22)
-#define SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT (SCHATTR_AXIS_START + 23)
-#define SCHATTR_AXIS_LABEL_POSITION (SCHATTR_AXIS_START + 24)
-#define SCHATTR_AXIS_MARK_POSITION (SCHATTR_AXIS_START + 25)
-#define SCHATTR_AXIS_END SCHATTR_AXIS_MARK_POSITION
+//axis scale
+#define SCHATTR_AXISTYPE SCHATTR_AXIS_START
+#define SCHATTR_AXIS_REVERSE (SCHATTR_AXIS_START + 1)
+#define SCHATTR_AXIS_AUTO_MIN (SCHATTR_AXIS_START + 2)
+#define SCHATTR_AXIS_MIN (SCHATTR_AXIS_START + 3)
+#define SCHATTR_AXIS_AUTO_MAX (SCHATTR_AXIS_START + 4)
+#define SCHATTR_AXIS_MAX (SCHATTR_AXIS_START + 5)
+#define SCHATTR_AXIS_AUTO_STEP_MAIN (SCHATTR_AXIS_START + 6)
+#define SCHATTR_AXIS_STEP_MAIN (SCHATTR_AXIS_START + 7)
+#define SCHATTR_AXIS_MAIN_TIME_UNIT (SCHATTR_AXIS_START + 8)
+#define SCHATTR_AXIS_AUTO_STEP_HELP (SCHATTR_AXIS_START + 9)
+#define SCHATTR_AXIS_STEP_HELP (SCHATTR_AXIS_START + 10)
+#define SCHATTR_AXIS_HELP_TIME_UNIT (SCHATTR_AXIS_START + 11)
+#define SCHATTR_AXIS_AUTO_TIME_RESOLUTION (SCHATTR_AXIS_START + 12)
+#define SCHATTR_AXIS_TIME_RESOLUTION (SCHATTR_AXIS_START + 13)
+#define SCHATTR_AXIS_LOGARITHM (SCHATTR_AXIS_START + 14)
+#define SCHATTR_AXIS_AUTO_DATEAXIS (SCHATTR_AXIS_START + 15)
+#define SCHATTR_AXIS_ALLOW_DATEAXIS (SCHATTR_AXIS_START + 16)
+#define SCHATTR_AXIS_AUTO_ORIGIN (SCHATTR_AXIS_START + 17)
+#define SCHATTR_AXIS_ORIGIN (SCHATTR_AXIS_START + 18)
+//axis position
+#define SCHATTR_AXIS_POSITION_START (SCHATTR_AXIS_ORIGIN +1)
+#define SCHATTR_AXIS_TICKS SCHATTR_AXIS_POSITION_START
+#define SCHATTR_AXIS_HELPTICKS (SCHATTR_AXIS_POSITION_START + 1)
+#define SCHATTR_AXIS_POSITION (SCHATTR_AXIS_POSITION_START + 2)
+#define SCHATTR_AXIS_POSITION_VALUE (SCHATTR_AXIS_POSITION_START + 3)
+#define SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT (SCHATTR_AXIS_POSITION_START + 4)
+#define SCHATTR_AXIS_LABEL_POSITION (SCHATTR_AXIS_POSITION_START + 5)
+#define SCHATTR_AXIS_MARK_POSITION (SCHATTR_AXIS_POSITION_START + 6)
+//axis label
+#define SCHATTR_AXIS_LABEL_START (SCHATTR_AXIS_MARK_POSITION +1)
+#define SCHATTR_AXIS_SHOWDESCR SCHATTR_AXIS_LABEL_START
+#define SCHATTR_AXIS_LABEL_ORDER (SCHATTR_AXIS_LABEL_START + 1)
+#define SCHATTR_AXIS_LABEL_OVERLAP (SCHATTR_AXIS_LABEL_START + 2)
+#define SCHATTR_AXIS_LABEL_BREAK (SCHATTR_AXIS_LABEL_START + 3)
+#define SCHATTR_AXIS_LABEL_END SCHATTR_AXIS_LABEL_BREAK
+
+#define SCHATTR_AXIS_END SCHATTR_AXIS_LABEL_END
#define SCHATTR_SYMBOL_BRUSH (SCHATTR_AXIS_END + 1)
#define SCHATTR_STOCK_VOLUME (SCHATTR_AXIS_END + 2)
@@ -197,13 +156,12 @@
#define SCHATTR_SPLINE_ORDER (SCHATTR_CHARTTYPE_START + 4)
#define SCHATTR_SPLINE_RESOLUTION (SCHATTR_CHARTTYPE_START + 5)
#define SCHATTR_DIAGRAM_STYLE (SCHATTR_CHARTTYPE_START + 6)
-#define SCHATTR_TEXTBREAK (SCHATTR_CHARTTYPE_START + 7)
-#define SCHATTR_GROUP_BARS_PER_AXIS (SCHATTR_CHARTTYPE_START + 8)
-#define SCHATTR_STARTING_ANGLE (SCHATTR_CHARTTYPE_START + 9)
-#define SCHATTR_CLOCKWISE (SCHATTR_CHARTTYPE_START + 10)
-#define SCHATTR_MISSING_VALUE_TREATMENT (SCHATTR_CHARTTYPE_START + 11)
-#define SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 12)
-#define SCHATTR_INCLUDE_HIDDEN_CELLS (SCHATTR_CHARTTYPE_START + 13)
+#define SCHATTR_GROUP_BARS_PER_AXIS (SCHATTR_CHARTTYPE_START + 7)
+#define SCHATTR_STARTING_ANGLE (SCHATTR_CHARTTYPE_START + 8)
+#define SCHATTR_CLOCKWISE (SCHATTR_CHARTTYPE_START + 9)
+#define SCHATTR_MISSING_VALUE_TREATMENT (SCHATTR_CHARTTYPE_START + 10)
+#define SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 11)
+#define SCHATTR_INCLUDE_HIDDEN_CELLS (SCHATTR_CHARTTYPE_START + 12)
#define SCHATTR_CHARTTYPE_END SCHATTR_INCLUDE_HIDDEN_CELLS
@@ -232,9 +190,11 @@
#define CHAXIS_MARK_NONE 0
// values for SCHATTR_AXISTYPE items
-#define CHART_AXIS_X 0
-#define CHART_AXIS_Y 1
-#define CHART_AXIS_Z 2
+#define CHART_AXIS_REALNUMBER 0
+#define CHART_AXIS_PERCENT 1
+#define CHART_AXIS_CATEGORY 2
+#define CHART_AXIS_SERIES 3
+#define CHART_AXIS_DATE 4
// values for SCHATTR_STYLE_SHAPE items
#define CHART_SHAPE3D_IGNORE -2 //internal! (GetChartShapeStyle()!)
diff --git a/chart2/source/inc/chartview/ExplicitScaleValues.hxx b/chart2/source/inc/chartview/ExplicitScaleValues.hxx
new file mode 100644
index 000000000000..48c9ef942d03
--- /dev/null
+++ b/chart2/source/inc/chartview/ExplicitScaleValues.hxx
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CHART2_EXPLICITSCALEVALUES_HXX
+#define _CHART2_EXPLICITSCALEVALUES_HXX
+
+#include "chartviewdllapi.hxx"
+#include <com/sun/star/chart/TimeInterval.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
+#include <com/sun/star/chart2/AxisOrientation.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/XScaling.hpp>
+#include <tools/date.hxx>
+#include <vector>
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+//-----------------------------------------------------------------------------
+/** This structure contains the explicit values for a scale like Minimum and Maximum.
+ See also ::com::sun::star::chart2::ScaleData.
+*/
+
+struct OOO_DLLPUBLIC_CHARTVIEW ExplicitScaleData
+{
+ ExplicitScaleData();
+
+ double Minimum;
+ double Maximum;
+ double Origin;
+
+ ::com::sun::star::chart2::AxisOrientation Orientation;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling > Scaling;
+
+ sal_Int32 AxisType;//see ::com::sun::star::chart2::AxisType
+ bool ShiftedCategoryPosition;
+ sal_Int32 TimeResolution; //constant of type <type>::com::sun::star::chart::TimeUnit</type>
+ Date NullDate;
+};
+
+struct OOO_DLLPUBLIC_CHARTVIEW ExplicitSubIncrement
+{
+ ExplicitSubIncrement();
+
+ /** Numbers of intervals between two superior ticks. For an axis
+ this usually means, that <code>IntervalCount - 1</code>
+ sub-tick-marks are displayed between two superior ticks.
+
+ */
+ sal_Int32 IntervalCount;
+
+ /** If <TRUE/>, the distance between two sub-tick-marks on the
+ screen is always the same. If <FALSE/>, the distances may
+ differ depending on the <type>XScaling</type>.
+ */
+ bool PostEquidistant;
+};
+
+/** describes how tickmarks are positioned on the scale of an axis.
+*/
+struct OOO_DLLPUBLIC_CHARTVIEW ExplicitIncrementData
+{
+ ExplicitIncrementData();
+
+ /** the following two members are only for date-time axis
+ */
+ ::com::sun::star::chart::TimeInterval MajorTimeInterval;
+ ::com::sun::star::chart::TimeInterval MinorTimeInterval;
+
+ /** the other members are for *not* date-time axis
+ */
+
+ /** <member>Distance</member> describes the distance between two
+ neighboring main tickmarks on a <type>Scale</type> of an axis.
+ All neighboring main tickmarks have the same constant distance.
+
+ <p>If the Scale has a <type>XScaling</type> the <member>Distance</member>
+ may be measured in two different ways - that is - before or after the
+ scaling is applied.</p>
+
+ <p>On a logarithmic scale for example the distance between two main
+ tickmarks is typically measured after the scaling is applied:
+ Distance = log(tick2)-log(tick1)
+ ( log(1000)-log(100)==log(100)-log(10)==log(10)-log(1)==1==Distance ).
+ The resulting tickmarks will always look equidistant on the screen.
+ The other possibility is to have a Distance = tick2-tick1 measured constant
+ before a scaling is applied, which may lead to non equidistant tickmarks
+ on the screen.</p>
+
+ <p><member>PostEquidistant</member> rules wether the <member>Distance</member>
+ is meant to be a value before or after scaling.</p>
+ */
+ double Distance;
+
+ /**
+ <member>PostEquidistant</member> rules wether the member <member>Distance</member>
+ describes a distance before or after the scaling is applied.
+
+ <p>If <member>PostEquidistant</member> equals <TRUE/> <member>Distance</member>
+ is given in values after <type>XScaling</type> is applied, thus resulting
+ main tickmarks will always look equidistant on the screen.
+ If <member>PostEquidistant</member> equals <FALSE/> <member>Distance</member>
+ is given in values before <type>XScaling</type> is applied.</p>
+ */
+ bool PostEquidistant;
+
+ /** The <member>BaseValue</member> gives a starting point on the scale
+ to which all further main tickmarks are relatively positioned.
+
+ <p>The <member>BaseValue</member> is always a value on the scale before
+ a possible scaling is applied. If the given value is not valid in the
+ associated scaling the minimum of the scaling is assumed,
+ if there is no minimum any other obvious value will be assumed.</p>
+
+ <p>E.g.: assume a scale from 0 to 6 with identical scaling.
+ Further assume this Increment to have Distance==2 and PostEquidistant==false.
+ Setting BaseValue=0 would lead to main tickmarks 0; 2; 4; 6;
+ Setting BaseValue=1,3 would lead to main tickmarks 1,3; 3,3; 5,3;
+ Setting BaseValue=-0,7 would also lead to main tickmarks 1,3; 3,3; 5,3;
+ And setting BaseValue to 2, -2, 4, -4 etc. in this example
+ leads to the same result as BaseValue=0.</p>
+ */
+ double BaseValue;
+
+ /** <member>SubIncrements</member> describes the positioning of further
+ sub tickmarks on the scale of an axis.
+
+ <p>The first SubIncrement in this sequence determines how the
+ distance between two neighboring main tickmarks is divided for positioning
+ of further sub tickmarks. Every following SubIncrement determines the
+ positions of subsequent tickmarks in relation to their parent tickmarks
+ iven by the preceding SubIncrement.</p>
+ */
+ ::std::vector< ExplicitSubIncrement > SubIncrements;
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
index 436cedde3a98..8d944192b2e9 100644
--- a/chart2/source/inc/chartview/ExplicitValueProvider.hxx
+++ b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
@@ -28,9 +28,9 @@
#ifndef _CHART2_EXPLICITVALUEPROVIDER_HXX
#define _CHART2_EXPLICITVALUEPROVIDER_HXX
+#include "ExplicitScaleValues.hxx"
+
#include <boost/shared_ptr.hpp>
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
@@ -60,8 +60,8 @@ public:
*/
virtual sal_Bool getExplicitValuesForAxis(
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > xAxis
- , ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale
- , ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement )=0;
+ , 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
@@ -100,9 +100,6 @@ public:
, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
- SAL_DLLPRIVATE static sal_Int32 getPercentNumberFormat( const ::com::sun::star::uno::Reference<
- ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
-
static sal_Int32 getExplicitNumberFormatKeyForDataLabel(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesOrPointProp
, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries
diff --git a/chart2/source/inc/exports.dxp b/chart2/source/inc/exports.dxp
index 9630d7e06768..f0e1c69934bc 100644
--- a/chart2/source/inc/exports.dxp
+++ b/chart2/source/inc/exports.dxp
@@ -1,3 +1,2 @@
component_getImplementationEnvironment
-component_writeInfo
component_getFactory
diff --git a/chart2/source/inc/servicenames.hxx b/chart2/source/inc/servicenames.hxx
index f0c90936df31..59836046f40b 100644
--- a/chart2/source/inc/servicenames.hxx
+++ b/chart2/source/inc/servicenames.hxx
@@ -63,8 +63,6 @@ namespace chart
#define CHART_RENDERER_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.ChartRenderer" ))
-#define CHART_UNDOMANAGER_SERVICE_NAME ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.UndoManager" ))
-
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/model/chartmodel.component b/chart2/source/model/chartmodel.component
new file mode 100644
index 000000000000..fa26e51ac401
--- /dev/null
+++ b/chart2/source/model/chartmodel.component
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.chart.AreaChartType">
+ <service name="com.sun.star.chart2.AreaChartType"/>
+ <service name="com.sun.star.chart2.ChartType"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.BarChartType">
+ <service name="com.sun.star.chart2.BarChartType"/>
+ <service name="com.sun.star.chart2.ChartType"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.BubbleChartType">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.BubbleChartType"/>
+ <service name="com.sun.star.chart2.ChartType"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.CandleStickChartType">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.CandleStickChartType"/>
+ <service name="com.sun.star.chart2.ChartType"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.ChartTypeManager">
+ <service name="com.sun.star.chart2.ChartTypeManager"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.ColumnChartType">
+ <service name="com.sun.star.chart2.ChartType"/>
+ <service name="com.sun.star.chart2.ColumnChartType"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.DataSeries">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.DataPointProperties"/>
+ <service name="com.sun.star.chart2.DataSeries"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.FilledNetChartType">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.ChartType"/>
+ <service name="com.sun.star.chart2.FilledNetChartType"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.FormattedString">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.FormattedString"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.LineChartType">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.ChartType"/>
+ <service name="com.sun.star.chart2.LineChartType"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.NetChartType">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.ChartType"/>
+ <service name="com.sun.star.chart2.NetChartType"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.PieChartType">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.ChartType"/>
+ <service name="com.sun.star.chart2.PieChartType"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.ScatterChartType">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.ChartType"/>
+ <service name="com.sun.star.chart2.ScatterChartType"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.Axis">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.Axis"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.CartesianCoordinateSystem2d">
+ <service name="com.sun.star.chart2.CartesianCoordinateSystem2d"/>
+ <service name="com.sun.star.chart2.CoordinateSystems.Cartesian"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.CartesianCoordinateSystem3d">
+ <service name="com.sun.star.chart2.CartesianCoordinateSystem3d"/>
+ <service name="com.sun.star.chart2.CoordinateSystems.Cartesian"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartModel">
+ <service name="com.sun.star.chart.ChartDocument"/>
+ <service name="com.sun.star.chart2.ChartDocument"/>
+ <service name="com.sun.star.document.OfficeDocument"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.Diagram">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.Diagram"/>
+ <service name="com.sun.star.layout.LayoutElement"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.GridProperties">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.GridProperties"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.Legend">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.Legend"/>
+ <service name="com.sun.star.drawing.FillProperties"/>
+ <service name="com.sun.star.drawing.LineProperties"/>
+ <service name="com.sun.star.layout.LayoutElement"/>
+ <service name="com.sun.star.style.CharacterProperties"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.PageBackground">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.PageBackground"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.PolarCoordinateSystem2d">
+ <service name="com.sun.star.chart2.CoordinateSystems.Polar"/>
+ <service name="com.sun.star.chart2.PolarCoordinateSystem2d"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.PolarCoordinateSystem3d">
+ <service name="com.sun.star.chart2.CoordinateSystems.Polar"/>
+ <service name="com.sun.star.chart2.PolarCoordinateSystem3d"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.Title">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.Title"/>
+ <service name="com.sun.star.layout.LayoutElement"/>
+ <service name="com.sun.star.style.ParagraphProperties"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.XMLFilter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ <service name="com.sun.star.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.report.XMLFilter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ <service name="com.sun.star.document.ImportFilter"/>
+ </implementation>
+</component>
diff --git a/chart2/source/model/inc/DataSeries.hxx b/chart2/source/model/inc/DataSeries.hxx
index e0e1440d5a97..2bb82f47a6e7 100644
--- a/chart2/source/model/inc/DataSeries.hxx
+++ b/chart2/source/model/inc/DataSeries.hxx
@@ -199,10 +199,6 @@ protected:
void fireModifyEvent();
- /** const variant of getInfoHelper()
- */
- ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const;
-
private:
::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >
diff --git a/chart2/source/model/inc/Diagram.hxx b/chart2/source/model/inc/Diagram.hxx
index 5b7928e2a34f..1396249bcfd9 100644
--- a/chart2/source/model/inc/Diagram.hxx
+++ b/chart2/source/model/inc/Diagram.hxx
@@ -32,11 +32,13 @@
#include "MutexContainer.hxx"
#include <cppuhelper/implbase8.hxx>
#include <comphelper/uno3.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/chart2/data/XDataSource.hpp>
#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/uno/XComponentContext.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/util/XModifyBroadcaster.hpp>
@@ -128,7 +130,10 @@ protected:
virtual void SAL_CALL setDefaultColorScheme(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme >& xColorScheme )
throw (::com::sun::star::uno::RuntimeException);
-
+ virtual void SAL_CALL setDiagramData(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xDataSource,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments )
+ throw (::com::sun::star::uno::RuntimeException);
// ____ XCoordinateSystemContainer ____
virtual void SAL_CALL addCoordinateSystem(
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index 2920f7316f1a..0720c0dc95b6 100644..100755
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -195,62 +195,86 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
-{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, ::com::sun::star::chart::ChartAxisPosition_ZERO );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_LABELS, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LABEL_POSITION, ::com::sun::star::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, ::com::sun::star::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, ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
-}
+struct StaticAxisDefaults_Initializer
+{
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, ::com::sun::star::chart::ChartAxisPosition_ZERO );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_LABELS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LABEL_POSITION, ::com::sun::star::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, ::com::sun::star::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, ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS );
+ }
+};
+
+struct StaticAxisDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticAxisDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticAxisInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticAxisInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticAxisInfoHelper_Initializer >
+{
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticAxisInfo_Initializer
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticAxisInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
- return aArrayHelper;
-}
+struct StaticAxisInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticAxisInfo_Initializer >
+{
+};
typedef uno::Reference< beans::XPropertySet > lcl_tSubGridType;
typedef uno::Sequence< lcl_tSubGridType > lcl_tSubGridSeq;
@@ -569,48 +593,23 @@ void Axis::fireModifyEvent()
uno::Any Axis::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- CharacterProperties::AddDefaultsToMap( aStaticDefaults );
- LineProperties::AddDefaultsToMap( aStaticDefaults );
-
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticAxisDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL Axis::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticAxisInfoHelper::get();
}
-
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- Axis::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL Axis::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticAxisInfo::get();
}
// ================================================================================
diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx
index bd09a595ff39..05711b1bc3b7 100644..100755
--- a/chart2/source/model/main/BaseCoordinateSystem.cxx
+++ b/chart2/source/model/main/BaseCoordinateSystem.cxx
@@ -70,34 +70,64 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticCooSysDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_COORDINATESYSTEM_SWAPXANDYAXIS, false );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_COORDINATESYSTEM_SWAPXANDYAXIS, false );
+ }
+};
+
+struct StaticCooSysDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticCooSysDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticCooSysInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticCooSysInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticCooSysInfoHelper_Initializer >
+{
+};
+
+struct StaticCooSysInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticCooSysInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticCooSysInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticCooSysInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -352,49 +382,25 @@ void BaseCoordinateSystem::fireModifyEvent()
uno::Any BaseCoordinateSystem::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticCooSysDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL BaseCoordinateSystem::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticCooSysInfoHelper::get();
}
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- BaseCoordinateSystem::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL BaseCoordinateSystem::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticCooSysInfo::get();
}
using impl::BaseCoordinateSystem_Base;
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 5bb4a5ed27db..015dde15f9e1 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -43,6 +43,7 @@
#include "PageBackground.hxx"
#include "CloneHelper.hxx"
#include "NameContainer.hxx"
+#include "UndoManager.hxx"
#include <com/sun/star/chart/ChartDataRowSource.hpp>
@@ -74,6 +75,7 @@
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Any;
using ::rtl::OUString;
using ::osl::MutexGuard;
@@ -104,6 +106,7 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
, m_bModified( sal_False )
, m_nInLoad(0)
, m_bUpdateNotificationsPending(false)
+ , m_pUndoManager( NULL )
, m_aControllers( m_aModelMutex )
, m_nControllerLockCount(0)
, m_xContext( xContext )
@@ -115,14 +118,21 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
C2U( "com.sun.star.xml.NamespaceMap" ), C2U( "com.sun.star.comp.chart.XMLNameSpaceMap" ) ), uno::UNO_QUERY)
{
OSL_TRACE( "ChartModel: CTOR called" );
- osl_incrementInterlockedCount(&m_refCount);
- ModifyListenerHelper::addListener( m_xPageBackground, this );
- m_xChartTypeManager.set( xContext->getServiceManager()->createInstanceWithContext(
- C2U( "com.sun.star.chart2.ChartTypeManager" ), m_xContext ), uno::UNO_QUERY );
- m_xUndoManager = Reference< chart2::XUndoManager >(
- this->createInstance( CHART_UNDOMANAGER_SERVICE_NAME ), uno::UNO_QUERY );
+ osl_incrementInterlockedCount(&m_refCount);
+ {
+ m_xOldModelAgg.set(
+ m_xContext->getServiceManager()->createInstanceWithContext(
+ CHART_CHARTAPIWRAPPER_SERVICE_NAME,
+ m_xContext ), uno::UNO_QUERY_THROW );
+ m_xOldModelAgg->setDelegator( *this );
+ }
+ {
+ ModifyListenerHelper::addListener( m_xPageBackground, this );
+ m_xChartTypeManager.set( xContext->getServiceManager()->createInstanceWithContext(
+ C2U( "com.sun.star.chart2.ChartTypeManager" ), m_xContext ), uno::UNO_QUERY );
+ }
osl_decrementInterlockedCount(&m_refCount);
}
@@ -146,33 +156,39 @@ ChartModel::ChartModel( const ChartModel & rOther )
, m_aGraphicObjectVector( rOther.m_aGraphicObjectVector )
, m_xDataProvider( rOther.m_xDataProvider )
, m_xInternalDataProvider( rOther.m_xInternalDataProvider )
- , m_xUndoManager( rOther.m_xUndoManager )
{
OSL_TRACE( "ChartModel: Copy-CTOR called" );
- osl_incrementInterlockedCount(&m_refCount);
-
- Reference< util::XModifyListener > xListener;
- Reference< chart2::XTitle > xNewTitle = CreateRefClone< Reference< chart2::XTitle > >()( rOther.m_xTitle );
- Reference< chart2::XDiagram > xNewDiagram = CreateRefClone< Reference< chart2::XDiagram > >()( rOther.m_xDiagram );
- Reference< beans::XPropertySet > xNewPageBackground = CreateRefClone< Reference< beans::XPropertySet > >()( rOther.m_xPageBackground );
- Reference< chart2::XChartTypeManager > xChartTypeManager = CreateRefClone< Reference< chart2::XChartTypeManager > >()( rOther.m_xChartTypeManager );
- Reference< container::XNameAccess > xXMLNamespaceMap = CreateRefClone< Reference< container::XNameAccess > >()( rOther.m_xXMLNamespaceMap );
+ osl_incrementInterlockedCount(&m_refCount);
{
- MutexGuard aGuard( m_aModelMutex );
- xListener = this;
- m_xTitle = xNewTitle;
- m_xDiagram = xNewDiagram;
- m_xPageBackground = xNewPageBackground;
- m_xChartTypeManager = xChartTypeManager;
- m_xXMLNamespaceMap = xXMLNamespaceMap;
- }
+ m_xOldModelAgg.set(
+ m_xContext->getServiceManager()->createInstanceWithContext(
+ CHART_CHARTAPIWRAPPER_SERVICE_NAME,
+ m_xContext ), uno::UNO_QUERY_THROW );
+ m_xOldModelAgg->setDelegator( *this );
+
+ Reference< util::XModifyListener > xListener;
+ Reference< chart2::XTitle > xNewTitle = CreateRefClone< Reference< chart2::XTitle > >()( rOther.m_xTitle );
+ Reference< chart2::XDiagram > xNewDiagram = CreateRefClone< Reference< chart2::XDiagram > >()( rOther.m_xDiagram );
+ Reference< beans::XPropertySet > xNewPageBackground = CreateRefClone< Reference< beans::XPropertySet > >()( rOther.m_xPageBackground );
+ Reference< chart2::XChartTypeManager > xChartTypeManager = CreateRefClone< Reference< chart2::XChartTypeManager > >()( rOther.m_xChartTypeManager );
+ Reference< container::XNameAccess > xXMLNamespaceMap = CreateRefClone< Reference< container::XNameAccess > >()( rOther.m_xXMLNamespaceMap );
- ModifyListenerHelper::addListener( xNewTitle, xListener );
- ModifyListenerHelper::addListener( xNewDiagram, xListener );
- ModifyListenerHelper::addListener( xNewPageBackground, xListener );
- xListener.clear();
+ {
+ MutexGuard aGuard( m_aModelMutex );
+ xListener = this;
+ m_xTitle = xNewTitle;
+ m_xDiagram = xNewDiagram;
+ m_xPageBackground = xNewPageBackground;
+ m_xChartTypeManager = xChartTypeManager;
+ m_xXMLNamespaceMap = xXMLNamespaceMap;
+ }
+ ModifyListenerHelper::addListener( xNewTitle, xListener );
+ ModifyListenerHelper::addListener( xNewDiagram, xListener );
+ ModifyListenerHelper::addListener( xNewPageBackground, xListener );
+ xListener.clear();
+ }
osl_decrementInterlockedCount(&m_refCount);
}
@@ -180,9 +196,19 @@ ChartModel::~ChartModel()
{
OSL_TRACE( "ChartModel: DTOR called" );
if( m_xOldModelAgg.is())
- m_xOldModelAgg->setDelegator( 0 );
+ m_xOldModelAgg->setDelegator( NULL );
}
+void SAL_CALL ChartModel::initialize( const Sequence< Any >& /*rArguments*/ )
+ throw (uno::Exception, uno::RuntimeException)
+{
+ //#i113722# avoid duplicate creation
+
+ //maybe additional todo?:
+ //support argument "EmbeddedObject"?
+ //support argument "EmbeddedScriptSupport"?
+ //support argument "DocumentRecoverySupport"?
+}
//-----------------------------------------------------------------
// private methods
@@ -507,6 +533,8 @@ uno::Reference< uno::XInterface > SAL_CALL ChartModel::getCurrentSelection() thr
//-----------------------------------------------------------------
void SAL_CALL ChartModel::dispose() throw(uno::RuntimeException)
{
+ Reference< XInterface > xKeepAlive( *this );
+
//This object should release all resources and references in the
//easiest possible manner
//This object must notify all registered listeners using the method
@@ -519,6 +547,9 @@ void SAL_CALL ChartModel::dispose() throw(uno::RuntimeException)
//--release all resources and references
//// @todo
+ if ( m_xDiagram.is() )
+ ModifyListenerHelper::removeListener( m_xDiagram, this );
+
m_xDataProvider.clear();
m_xInternalDataProvider.clear();
m_xNumberFormatsSupplier.clear();
@@ -530,18 +561,16 @@ void SAL_CALL ChartModel::dispose() throw(uno::RuntimeException)
DisposeHelper::DisposeAndClear( m_xXMLNamespaceMap );
m_xStorage.clear();
+ // just clear, don't dispose - we're not the owner
- if( m_xOldModelAgg.is())
- {
- m_xOldModelAgg->setDelegator( 0 );
- m_xOldModelAgg.clear();
- }
+ if ( m_pUndoManager.is() )
+ m_pUndoManager->disposing();
+ m_pUndoManager.clear();
+ // that's important, since the UndoManager implementation delegates its ref counting to ourself.
m_aControllers.disposeAndClear( lang::EventObject( static_cast< cppu::OWeakObject * >( this )));
m_xCurrentController.clear();
- m_xStorage.clear();
- m_xParent.clear();
DisposeHelper::DisposeAndClear( m_xRangeHighlighter );
OSL_TRACE( "ChartModel: dispose() called" );
}
@@ -671,6 +700,7 @@ uno::Sequence< uno::Type > SAL_CALL ChartModel::getTypes()
uno::Reference< document::XDocumentProperties > SAL_CALL
ChartModel::getDocumentProperties() throw (uno::RuntimeException)
{
+ ::osl::MutexGuard aGuard( m_aModelMutex );
if ( !m_xDocumentProperties.is() )
{
uno::Reference< document::XDocumentProperties > xDocProps(
@@ -682,6 +712,17 @@ uno::Reference< document::XDocumentProperties > SAL_CALL
}
//-----------------------------------------------------------------
+// document::XDocumentPropertiesSupplier
+//-----------------------------------------------------------------
+Reference< document::XUndoManager > SAL_CALL ChartModel::getUndoManager( ) throw (RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aModelMutex );
+ if ( !m_pUndoManager.is() )
+ m_pUndoManager.set( new UndoManager( *this, m_aModelMutex ) );
+ return m_pUndoManager.get();
+}
+
+//-----------------------------------------------------------------
// chart2::XChartDocument
//-----------------------------------------------------------------
@@ -850,28 +891,15 @@ void SAL_CALL ChartModel::setArguments( const Sequence< beans::PropertyValue >&
Reference< chart2::data::XDataSource > xDataSource( m_xDataProvider->createDataSource( aArguments ) );
if( xDataSource.is() )
{
- // set new data
- Reference< chart2::XChartTypeTemplate > xTemplate;
Reference< chart2::XDiagram > xDia( getFirstDiagram() );
- if( xDia.is())
- {
- // apply new data
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram(
- xDia, Reference< lang::XMultiServiceFactory >( m_xChartTypeManager, uno::UNO_QUERY ));
- xTemplate.set( aTemplateAndService.first );
- }
-
- if( !xTemplate.is())
- xTemplate.set( impl_createDefaultChartTypeTemplate() );
-
- if( xTemplate.is())
+ if( !xDia.is() )
{
- if( xDia.is())
- xTemplate->changeDiagramData( xDia, xDataSource, aArguments );
- else
+ Reference< chart2::XChartTypeTemplate > xTemplate( impl_createDefaultChartTypeTemplate() );
+ if( xTemplate.is())
setFirstDiagram( xTemplate->createDiagramByDataSource( xDataSource, aArguments ) );
}
+ else
+ xDia->setDiagramData( xDataSource, aArguments );
}
}
catch( lang::IllegalArgumentException & )
@@ -965,18 +993,6 @@ void SAL_CALL ChartModel::setTitleObject( const uno::Reference< chart2::XTitle >
setModified( sal_True );
}
-void ChartModel::impl_createOldModelAgg()
-{
- if( ! m_xOldModelAgg.is())
- {
- m_xOldModelAgg.set(
- m_xContext->getServiceManager()->createInstanceWithContext(
- CHART_CHARTAPIWRAPPER_SERVICE_NAME,
- m_xContext ), uno::UNO_QUERY_THROW );
- m_xOldModelAgg->setDelegator( static_cast< ::cppu::OWeakObject* >( this ));
- }
-}
-
// ____ XInterface (for old API wrapper) ____
uno::Any SAL_CALL ChartModel::queryInterface( const uno::Type& aType )
throw (uno::RuntimeException)
@@ -988,7 +1004,6 @@ uno::Any SAL_CALL ChartModel::queryInterface( const uno::Type& aType )
// try old API wrapper
try
{
- impl_createOldModelAgg();
if( m_xOldModelAgg.is())
aResult = m_xOldModelAgg->queryAggregation( aType );
}
@@ -1222,7 +1237,6 @@ Reference< uno::XInterface > SAL_CALL ChartModel::createInstance( const OUString
}
else
{
- impl_createOldModelAgg();
if( m_xOldModelAgg.is() )
{
Any aAny = m_xOldModelAgg->queryAggregation( ::getCppuType((const uno::Reference< lang::XMultiServiceFactory >*)0) );
@@ -1250,7 +1264,6 @@ Sequence< OUString > SAL_CALL ChartModel::getAvailableServiceNames()
{
uno::Sequence< ::rtl::OUString > aResult;
- impl_createOldModelAgg();
if( m_xOldModelAgg.is())
{
Any aAny = m_xOldModelAgg->queryAggregation( ::getCppuType((const uno::Reference< lang::XMultiServiceFactory >*)0) );
@@ -1270,7 +1283,8 @@ Reference< util::XNumberFormatsSupplier > ChartModel::impl_getNumberFormatsSuppl
if( !m_xOwnNumberFormatsSupplier.is() )
{
Reference< lang::XMultiServiceFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY );
- m_xOwnNumberFormatsSupplier = new SvNumberFormatsSupplierObj( new SvNumberFormatter( xFactory, LANGUAGE_SYSTEM ) );
+ m_apSvNumberFormatter.reset( new SvNumberFormatter( xFactory, LANGUAGE_SYSTEM ) );
+ m_xOwnNumberFormatsSupplier = new SvNumberFormatsSupplierObj( m_apSvNumberFormatter.get() );
//pOwnNumberFormatter->ChangeStandardPrec( 15 ); todo?
}
m_xNumberFormatsSupplier = m_xOwnNumberFormatsSupplier;
@@ -1326,13 +1340,6 @@ void SAL_CALL ChartModel::setParent( const Reference< uno::XInterface >& Parent
m_xParent.set( Parent, uno::UNO_QUERY );
}
-// ____ XUndoManager ____
-Reference< chart2::XUndoManager > SAL_CALL ChartModel::getUndoManager()
- throw (uno::RuntimeException)
-{
- return m_xUndoManager;
-}
-
// ____ XDataSource ____
uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL ChartModel::getDataSequences()
throw (uno::RuntimeException)
diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/source/model/main/ChartModel.hxx
index c2b6ce2b0299..9d08d283187c 100644..100755
--- a/chart2/source/model/main/ChartModel.hxx
+++ b/chart2/source/model/main/ChartModel.hxx
@@ -36,9 +36,11 @@
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
@@ -46,7 +48,6 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/chart2/XUndoSupplier.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/XChartTypeTemplate.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
@@ -63,21 +64,22 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/datatransfer/XTransferable.hpp>
-#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_20)
-#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_20
-#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 20
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_21)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_21
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 21
#include "comphelper/implbase_var.hxx"
#endif
#include <osl/mutex.hxx>
+#include <rtl/ref.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <svtools/grfmgr.hxx>
// for auto_ptr
#include <memory>
+class SvNumberFormatter;
+
//=============================================================================
-/** this is an example implementation for the service ::com::sun::star::document::OfficeDocument
-*/
namespace chart
{
@@ -86,11 +88,13 @@ namespace impl
{
// Note: needed for queryInterface (if it calls the base-class implementation)
-typedef ::comphelper::WeakImplHelper20<
+typedef ::comphelper::WeakImplHelper21<
+// ::com::sun::star::frame::XModel //comprehends XComponent (required interface), base of XChartDocument
::com::sun::star::util::XCloseable //comprehends XCloseBroadcaster
,::com::sun::star::frame::XStorable2 //(extension of XStorable)
,::com::sun::star::util::XModifiable //comprehends XModifyBroadcaster (required interface)
,::com::sun::star::lang::XServiceInfo
+ ,::com::sun::star::lang::XInitialization
,::com::sun::star::chart2::XChartDocument // derived from XModel
,::com::sun::star::chart2::data::XDataReceiver // public API
,::com::sun::star::chart2::XTitled
@@ -104,13 +108,15 @@ typedef ::comphelper::WeakImplHelper20<
,::com::sun::star::container::XChild
,::com::sun::star::util::XModifyListener
,::com::sun::star::datatransfer::XTransferable
- ,::com::sun::star::chart2::XUndoSupplier
,::com::sun::star::document::XDocumentPropertiesSupplier
,::com::sun::star::chart2::data::XDataSource
+ ,::com::sun::star::document::XUndoManagerSupplier
>
ChartModel_Base;
}
+class UndoManager;
+
class ChartModel : public impl::ChartModel_Base
{
@@ -126,6 +132,7 @@ private:
::rtl::OUString m_aResource;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aMediaDescriptor;
::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > m_xDocumentProperties;
+ ::rtl::Reference< UndoManager > m_pUndoManager;
::cppu::OInterfaceContainerHelper m_aControllers;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > m_xCurrentController;
@@ -151,6 +158,7 @@ private:
m_xOwnNumberFormatsSupplier;
::com::sun::star::uno::Reference< com::sun::star::util::XNumberFormatsSupplier >
m_xNumberFormatsSupplier;
+ std::auto_ptr< SvNumberFormatter > m_apSvNumberFormatter; // #i113784# avoid memory leak
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartTypeManager >
m_xChartTypeManager;
@@ -165,8 +173,6 @@ private:
bool m_bIsDisposed;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
m_xPageBackground;
- ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager >
- m_xUndoManager;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xXMLNamespaceMap;
@@ -197,7 +203,6 @@ private:
void impl_killInternalData() throw( com::sun::star::util::CloseVetoException );
- void impl_createOldModelAgg();
void impl_store(
const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::PropertyValue >& rMediaDescriptor,
@@ -240,6 +245,12 @@ public:
APPHELPER_SERVICE_FACTORY_HELPER(ChartModel)
//-----------------------------------------------------------------
+ // ::com::sun::star::lang::XInitialization
+ //-----------------------------------------------------------------
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ //-----------------------------------------------------------------
// ::com::sun::star::frame::XModel (required interface)
//-----------------------------------------------------------------
@@ -422,6 +433,10 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > SAL_CALL
getDocumentProperties( ) throw (::com::sun::star::uno::RuntimeException);
+ // ____ document::XUndoManagerSupplier ____
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > SAL_CALL
+ getUndoManager( ) throw (::com::sun::star::uno::RuntimeException);
+
//-----------------------------------------------------------------
// ::com::sun::star::chart2::XChartDocument
//-----------------------------------------------------------------
@@ -589,10 +604,6 @@ public:
throw (::com::sun::star::lang::NoSupportException,
::com::sun::star::uno::RuntimeException);
- // ____ XUndoSupplier ____
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > SAL_CALL getUndoManager()
- throw (::com::sun::star::uno::RuntimeException);
-
// ____ XDataSource ____ allows access to the curently used data and data ranges
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences()
throw (::com::sun::star::uno::RuntimeException);
diff --git a/chart2/source/model/main/DataPoint.cxx b/chart2/source/model/main/DataPoint.cxx
index d3b7b49df869..f337ba1c3972 100644..100755
--- a/chart2/source/model/main/DataPoint.cxx
+++ b/chart2/source/model/main/DataPoint.cxx
@@ -54,29 +54,48 @@ using ::rtl::OUString;
namespace
{
-const Sequence< Property > & lcl_GetPropertySequence()
+
+struct StaticDataPointInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::DataPointProperties::AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
+
+struct StaticDataPointInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticDataPointInfoHelper_Initializer >
+{
+};
+
+struct StaticDataPointInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticDataPointInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticDataPointInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticDataPointInfo_Initializer >
+{
+};
- return aPropSeq;
-}
} // anonymous namespace
// ____________________________________________________________
@@ -157,7 +176,7 @@ uno::Reference< util::XCloneable > SAL_CALL DataPoint::createClone()
Reference< uno::XInterface > SAL_CALL DataPoint::getParent()
throw (uno::RuntimeException)
{
- return Reference< uno::XInterface >( m_xParentProperties, uno::UNO_QUERY );
+ return Reference< uno::XInterface >( m_xParentProperties.get(), uno::UNO_QUERY );
}
void SAL_CALL DataPoint::setParent(
@@ -165,7 +184,7 @@ void SAL_CALL DataPoint::setParent(
throw (lang::NoSupportException,
uno::RuntimeException)
{
- m_xParentProperties.set( Parent, uno::UNO_QUERY );
+ m_xParentProperties = Reference< beans::XPropertySet >( Parent, uno::UNO_QUERY );
}
// ____ OPropertySet ____
@@ -173,7 +192,7 @@ uno::Any DataPoint::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
// the value set at the data series is the default
- uno::Reference< beans::XFastPropertySet > xFast( m_xParentProperties, uno::UNO_QUERY );
+ uno::Reference< beans::XFastPropertySet > xFast( m_xParentProperties.get(), uno::UNO_QUERY );
if( !xFast.is())
{
OSL_ENSURE( m_bNoParentPropAllowed, "data point needs a parent property set to provide values correctly" );
@@ -214,33 +233,14 @@ void SAL_CALL DataPoint::setFastPropertyValue_NoBroadcast(
::cppu::IPropertyArrayHelper & SAL_CALL DataPoint::getInfoHelper()
{
- return getInfoHelperConst();
-}
-
-::cppu::IPropertyArrayHelper & SAL_CALL DataPoint::getInfoHelperConst() const
-{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticDataPointInfoHelper::get();
}
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- DataPoint::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL DataPoint::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticDataPointInfo::get();
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/main/DataPoint.hxx b/chart2/source/model/main/DataPoint.hxx
index e0cb67c89cb1..41eeb165bab3 100644..100755
--- a/chart2/source/model/main/DataPoint.hxx
+++ b/chart2/source/model/main/DataPoint.hxx
@@ -30,6 +30,7 @@
#include <osl/mutex.hxx>
#include <cppuhelper/implbase5.hxx>
+#include <cppuhelper/weakref.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/util/XCloneable.hpp>
@@ -102,10 +103,6 @@ protected:
throw (::com::sun::star::lang::NoSupportException,
::com::sun::star::uno::RuntimeException);
- /** const variant of getInfoHelper()
- */
- ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const;
-
// ____ XModifyBroadcaster ____
virtual void SAL_CALL addModifyListener(
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
@@ -131,7 +128,7 @@ protected:
void fireModifyEvent();
private:
- ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::WeakReference<
::com::sun::star::beans::XPropertySet > m_xParentProperties;
::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx
index b9925b8b88a8..97c7c27abd0c 100644..100755
--- a/chart2/source/model/main/DataSeries.cxx
+++ b/chart2/source/model/main/DataSeries.cxx
@@ -56,29 +56,73 @@ using ::osl::MutexGuard;
namespace
{
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+
+struct StaticDataSeriesDefaults_Initializer
+{
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::DataSeriesProperties::AddDefaultsToMap( rOutMap );
+ ::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
+
+ 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 );
+ }
+};
+
+struct StaticDataSeriesDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticDataSeriesDefaults_Initializer >
{
- static uno::Sequence< Property > aPropSeq;
+};
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticDataSeriesInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::DataSeriesProperties::AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
+
+struct StaticDataSeriesInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticDataSeriesInfoHelper_Initializer >
+{
+};
+
+struct StaticDataSeriesInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticDataSeriesInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticDataSeriesInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticDataSeriesInfo_Initializer >
+{
+};
void lcl_SetParent(
const uno::Reference< uno::XInterface > & xChildInterface,
@@ -245,56 +289,24 @@ Sequence< OUString > DataSeries::getSupportedServiceNames_Static()
uno::Any DataSeries::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- DataSeriesProperties::AddDefaultsToMap( aStaticDefaults );
- 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 );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
- throw beans::UnknownPropertyException();
-
+ const tPropertyValueMap& rStaticDefaults = *StaticDataSeriesDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
+ return uno::Any();
return (*aFound).second;
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL DataSeries::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticDataSeriesInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- DataSeries::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL DataSeries::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticDataSeriesInfo::get();
}
void SAL_CALL DataSeries::getFastPropertyValue
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index 00ec27e5ff5e..7c9e3c6294f4 100644..100755
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -34,6 +34,7 @@
#include "Wall.hxx"
#include "UserDefinedProperties.hxx"
#include "ConfigColorScheme.hxx"
+#include "DiagramHelper.hxx"
#include "ContainerHelper.hxx"
#include "ThreeDHelper.hxx"
#include "CloneHelper.hxx"
@@ -42,6 +43,7 @@
#include "DisposeHelper.hxx"
#include "BaseGFXHelper.hxx"
#include <basegfx/numeric/ftools.hxx>
+#include <rtl/instance.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
@@ -177,41 +179,71 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticDiagramDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_POSSIZE_EXCLUDE_LABELS, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_SORT_BY_X_VALUES, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_CONNECT_BARS, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_GROUP_BARS_PER_AXIS, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_POSSIZE_EXCLUDE_LABELS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_SORT_BY_X_VALUES, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_CONNECT_BARS, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_GROUP_BARS_PER_AXIS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 );
+ }
+};
+
+struct StaticDiagramDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticDiagramDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticDiagramInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::SceneProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticDiagramInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticDiagramInfoHelper_Initializer >
+{
+};
+
+struct StaticDiagramInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticDiagramInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticDiagramInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticDiagramInfo_Initializer >
+{
+};
/// clones a UNO-sequence of UNO-References
typedef Reference< chart2::XCoordinateSystem > lcl_tCooSysRef;
@@ -397,6 +429,22 @@ void SAL_CALL Diagram::setDefaultColorScheme( const Reference< chart2::XColorSch
fireModifyEvent();
}
+void SAL_CALL Diagram::setDiagramData(
+ const Reference< chart2::data::XDataSource >& xDataSource,
+ const Sequence< beans::PropertyValue >& aArguments )
+ throw (uno::RuntimeException)
+{
+ uno::Reference< lang::XMultiServiceFactory > xChartTypeManager( m_xContext->getServiceManager()->createInstanceWithContext(
+ C2U( "com.sun.star.chart2.ChartTypeManager" ), m_xContext ), uno::UNO_QUERY );
+ DiagramHelper::tTemplateWithServiceName aTemplateAndService = DiagramHelper::getTemplateForDiagram( this, xChartTypeManager );
+ uno::Reference< chart2::XChartTypeTemplate > xTemplate( aTemplateAndService.first );
+ if( !xTemplate.is() )
+ xTemplate.set( xChartTypeManager->createInstance( C2U("com.sun.star.chart2.template.Column") ), uno::UNO_QUERY );
+ if(!xTemplate.is())
+ return;
+ xTemplate->changeDiagramData( this, xDataSource, aArguments );
+}
+
// ____ XTitled ____
uno::Reference< chart2::XTitle > SAL_CALL Diagram::getTitleObject()
throw (uno::RuntimeException)
@@ -591,50 +639,24 @@ Sequence< OUString > Diagram::getSupportedServiceNames_Static()
uno::Any Diagram::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- ::chart::SceneProperties::AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticDiagramDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL Diagram::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticDiagramInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- Diagram::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL Diagram::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticDiagramInfo::get();
}
// ____ XFastPropertySet ____
diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx
index b0e753e4066b..047c0bc6faa7 100644..100755
--- a/chart2/source/model/main/FormattedString.cxx
+++ b/chart2/source/model/main/FormattedString.cxx
@@ -48,36 +48,64 @@ using ::osl::MutexGuard;
namespace
{
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticFormattedStringDefaults_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
+ }
+};
+
+struct StaticFormattedStringDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticFormattedStringDefaults_Initializer >
+{
+};
+
+struct StaticFormattedStringInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticFormattedStringInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticFormattedStringInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticFormattedStringInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticFormattedStringInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticFormattedStringInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticFormattedStringInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -199,46 +227,25 @@ Sequence< OUString > FormattedString::getSupportedServiceNames_Static()
uno::Any FormattedString::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- CharacterProperties::AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
- throw beans::UnknownPropertyException();
-
+ const tPropertyValueMap& rStaticDefaults = *StaticFormattedStringDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
+ return uno::Any();
return (*aFound).second;
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL FormattedString::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticFormattedStringInfoHelper::get();
}
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- FormattedString::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL FormattedString::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticFormattedStringInfo::get();
}
// ================================================================================
diff --git a/chart2/source/model/main/GridProperties.cxx b/chart2/source/model/main/GridProperties.cxx
index 082fde0c2710..17f647003250 100644..100755
--- a/chart2/source/model/main/GridProperties.cxx
+++ b/chart2/source/model/main/GridProperties.cxx
@@ -72,49 +72,73 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_addDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+struct StaticGridDefaults_Initializer
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_GRID_SHOW, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_GRID_SHOW, false );
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue< sal_Int32 >(
- rOutMap, ::chart::LineProperties::PROP_LINE_COLOR, 0xb3b3b3 ); // gray30
-}
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue< sal_Int32 >(
+ rOutMap, ::chart::LineProperties::PROP_LINE_COLOR, 0xb3b3b3 ); // gray30
+ }
+};
+
+struct StaticGridDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticGridDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_getPropertySequence()
+struct StaticGridInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+};
+
+struct StaticGridInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticGridInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_getPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticGridInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticGridInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticGridInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticGridInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -149,41 +173,23 @@ GridProperties::~GridProperties()
uno::Any GridProperties::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- lcl_addDefaultsToMap( aStaticDefaults );
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticGridDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL GridProperties::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticGridInfoHelper::get();
}
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- GridProperties::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL GridProperties::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- lcl_getInfoHelper());
- }
-
- return xInfo;
+ return *StaticGridInfo::get();
}
// ____ XCloneable ____
diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx
index 710a10c5afa5..7db3e498a098 100644..100755
--- a/chart2/source/model/main/Legend.cxx
+++ b/chart2/source/model/main/Legend.cxx
@@ -41,8 +41,9 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/RelativeSize.hpp>
#include <algorithm>
@@ -64,10 +65,11 @@ static const OUString lcl_aServiceName(
enum
{
PROP_LEGEND_ANCHOR_POSITION,
- PROP_LEGEND_PREFERRED_EXPANSION,
+ PROP_LEGEND_EXPANSION,
PROP_LEGEND_SHOW,
PROP_LEGEND_REF_PAGE_SIZE,
- PROP_LEGEND_REL_POS
+ PROP_LEGEND_REL_POS,
+ PROP_LEGEND_REL_SIZE
};
void lcl_AddPropertiesToVector(
@@ -82,8 +84,8 @@ void lcl_AddPropertiesToVector(
rOutProperties.push_back(
Property( C2U( "Expansion" ),
- PROP_LEGEND_PREFERRED_EXPANSION,
- ::getCppuType( reinterpret_cast< const chart2::LegendExpansion * >(0)),
+ PROP_LEGEND_EXPANSION,
+ ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartLegendExpansion * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
@@ -106,29 +108,57 @@ void lcl_AddPropertiesToVector(
::getCppuType( reinterpret_cast< const chart2::RelativePosition * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
+
+ rOutProperties.push_back(
+ Property( C2U( "RelativeSize" ),
+ PROP_LEGEND_REL_SIZE,
+ ::getCppuType( reinterpret_cast< const chart2::RelativeSize * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEVOID ));
+
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticLegendDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_ANCHOR_POSITION, chart2::LegendPosition_LINE_END );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_PREFERRED_EXPANSION, chart2::LegendExpansion_HIGH );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_SHOW, true );
-
- 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::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::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, ::com::sun::star::chart::ChartLegendExpansion_HIGH );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LEGEND_SHOW, true );
+
+ 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 );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticLegendDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticLegendDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticLegendInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
@@ -136,25 +166,30 @@ const Sequence< Property > & lcl_GetPropertySequence()
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticLegendInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticLegendInfoHelper_Initializer >
+{
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticLegendInfo_Initializer
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticLegendInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
- return aArrayHelper;
-}
+struct StaticLegendInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticLegendInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -173,58 +208,10 @@ Legend::Legend( const Legend & rOther ) :
::property::OPropertySet( rOther, m_aMutex ),
m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
- CloneHelper::CloneRefVector< Reference< chart2::XLegendEntry > >( rOther.m_aLegendEntries, m_aLegendEntries );
- ModifyListenerHelper::addListenerToAllElements( m_aLegendEntries, m_xModifyEventForwarder );
}
Legend::~Legend()
{
- try
- {
- ModifyListenerHelper::removeListenerFromAllElements( m_aLegendEntries, m_xModifyEventForwarder );
- }
- catch( const uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
-}
-
-// ____ XLegend ____
-void SAL_CALL Legend::registerEntry( const Reference< chart2::XLegendEntry >& xEntry )
- throw (lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if( ::std::find( m_aLegendEntries.begin(),
- m_aLegendEntries.end(),
- xEntry ) != m_aLegendEntries.end())
- throw lang::IllegalArgumentException();
-
- m_aLegendEntries.push_back( xEntry );
- ModifyListenerHelper::addListener( xEntry, m_xModifyEventForwarder );
- fireModifyEvent();
-}
-
-void SAL_CALL Legend::revokeEntry( const Reference< chart2::XLegendEntry >& xEntry )
- throw (container::NoSuchElementException,
- uno::RuntimeException)
-{
- tLegendEntries::iterator aIt(
- ::std::find( m_aLegendEntries.begin(),
- m_aLegendEntries.end(),
- xEntry ));
-
- if( aIt == m_aLegendEntries.end())
- throw container::NoSuchElementException();
-
- m_aLegendEntries.erase( aIt );
- ModifyListenerHelper::removeListener( xEntry, m_xModifyEventForwarder );
- fireModifyEvent();
-}
-
-Sequence< Reference< chart2::XLegendEntry > > SAL_CALL Legend::getEntries()
- throw (uno::RuntimeException)
-{
- return ContainerHelper::ContainerToSequence( m_aLegendEntries );
}
// ____ XCloneable ____
@@ -309,48 +296,23 @@ Sequence< OUString > Legend::getSupportedServiceNames_Static()
Any Legend::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- FillProperties::AddDefaultsToMap( aStaticDefaults );
- CharacterProperties::AddDefaultsToMap( aStaticDefaults );
- // call last to overwrite some character property defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
- return Any();
-
+ const tPropertyValueMap& rStaticDefaults = *StaticLegendDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
+ return uno::Any();
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL Legend::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticLegendInfoHelper::get();
}
-
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- Legend::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL Legend::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticLegendInfo::get();
}
// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
diff --git a/chart2/source/model/main/Legend.hxx b/chart2/source/model/main/Legend.hxx
index b28e5ca319da..accbb408ca29 100644..100755
--- a/chart2/source/model/main/Legend.hxx
+++ b/chart2/source/model/main/Legend.hxx
@@ -91,20 +91,6 @@ protected:
getPropertySetInfo()
throw (::com::sun::star::uno::RuntimeException);
- // ____ XLegend ____
- virtual void SAL_CALL registerEntry( const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XLegendEntry >& xEntry )
- throw (::com::sun::star::lang::IllegalArgumentException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL revokeEntry( const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XLegendEntry >& xEntry )
- throw (::com::sun::star::container::NoSuchElementException,
- ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XLegendEntry > > SAL_CALL getEntries()
- throw (::com::sun::star::uno::RuntimeException);
-
// ____ XCloneable ____
virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
throw (::com::sun::star::uno::RuntimeException);
@@ -134,11 +120,6 @@ protected:
void fireModifyEvent();
private:
- typedef ::std::vector<
- ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XLegendEntry > > tLegendEntries;
-
- tLegendEntries m_aLegendEntries;
::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
};
diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx
index 964529f6aa16..8aa631f724e5 100644..100755
--- a/chart2/source/model/main/PageBackground.cxx
+++ b/chart2/source/model/main/PageBackground.cxx
@@ -54,46 +54,71 @@ namespace
static const ::rtl::OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.PageBackground" ));
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticPageBackgroundDefaults_Initializer
{
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::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::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ }
+};
+
+struct StaticPageBackgroundDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticPageBackgroundDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticPageBackgroundInfoHelper_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticPageBackgroundInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticPageBackgroundInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+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 >
+{
+};
} // anonymous namespace
@@ -132,51 +157,25 @@ uno::Reference< util::XCloneable > SAL_CALL PageBackground::createClone()
uno::Any PageBackground::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- FillProperties::AddDefaultsToMap( aStaticDefaults );
- // overrides defaults of FillProperties
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticPageBackgroundDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL PageBackground::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticPageBackgroundInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- PageBackground::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL PageBackground::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticPageBackgroundInfo::get();
}
-
// ____ XModifyBroadcaster ____
void SAL_CALL PageBackground::addModifyListener( const uno::Reference< util::XModifyListener >& aListener )
throw (uno::RuntimeException)
diff --git a/chart2/source/model/main/StockBar.cxx b/chart2/source/model/main/StockBar.cxx
index 71abae7b5095..bbd3e9f2205c 100644..100755
--- a/chart2/source/model/main/StockBar.cxx
+++ b/chart2/source/model/main/StockBar.cxx
@@ -58,45 +58,70 @@ namespace
static const ::rtl::OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.StockBar" ));
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticStockBarInfoHelper_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticStockBarInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticStockBarInfoHelper_Initializer >
{
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff ); // white
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticStockBarInfo_Initializer
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticStockBarInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
- return aArrayHelper;
-}
+struct StaticStockBarInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticStockBarInfo_Initializer >
+{
+};
+
+struct StaticStockBarDefaults_Initializer
+{
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::FillProperties::AddDefaultsToMap( rOutMap );
+
+ // 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 >
+{
+};
} // anonymous namespace
@@ -144,51 +169,25 @@ uno::Reference< util::XCloneable > SAL_CALL StockBar::createClone()
uno::Any StockBar::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- FillProperties::AddDefaultsToMap( aStaticDefaults );
-
- // overrides a line property
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticStockBarDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL StockBar::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticStockBarInfoHelper::get();
}
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- StockBar::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL StockBar::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- lcl_getInfoHelper());
- }
-
- return xInfo;
+ return *StaticStockBarInfo::get();
}
-
// ____ XModifyBroadcaster ____
void SAL_CALL StockBar::addModifyListener( const uno::Reference< util::XModifyListener >& aListener )
throw (uno::RuntimeException)
diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx
index f5fb4432ee98..abb845282797 100644..100755
--- a/chart2/source/model/main/Title.cxx
+++ b/chart2/source/model/main/Title.cxx
@@ -157,61 +157,87 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticTitleDefaults_Initializer
{
- // ParagraphProperties
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_PARA_ADJUST,
- ::com::sun::star::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 );
-
- // 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::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::FillProperties::AddDefaultsToMap( rOutMap );
+
+ // ParagraphProperties
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_TITLE_PARA_ADJUST,
+ ::com::sun::star::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 );
+
+ // 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::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ }
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticTitleDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticTitleDefaults_Initializer >
{
- static uno::Sequence< Property > aPropSeq;
+};
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticTitleInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+};
+
+struct StaticTitleInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticTitleInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticTitleInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticTitleInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticTitleInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticTitleInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -283,50 +309,23 @@ void SAL_CALL Title::setText( const uno::Sequence< uno::Reference< chart2::XForm
uno::Any Title::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- FillProperties::AddDefaultsToMap( aStaticDefaults );
-
- // initialize defaults
- // Note: this should be last to override defaults of the previously
- // added defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticTitleDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL Title::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticTitleInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- Title::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL Title::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticTitleInfo::get();
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/main/UndoManager.cxx b/chart2/source/model/main/UndoManager.cxx
new file mode 100755
index 000000000000..4efe57e17090
--- /dev/null
+++ b/chart2/source/model/main/UndoManager.cxx
@@ -0,0 +1,427 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_chart2.hxx"
+
+#include "UndoManager.hxx"
+#include "ChartViewHelper.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/DisposedException.hpp>
+/** === end UNO includes === **/
+
+#include <framework/undomanagerhelper.hxx>
+#include <svl/undo.hxx>
+#include <unotools/undoopt.hxx>
+
+//......................................................................................................................
+namespace chart
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::lang::DisposedException;
+ using ::com::sun::star::document::XUndoManager;
+ using ::com::sun::star::document::EmptyUndoStackException;
+ using ::com::sun::star::document::UndoContextNotClosedException;
+ using ::com::sun::star::document::UndoFailedException;
+ using ::com::sun::star::util::InvalidStateException;
+ using ::com::sun::star::document::XUndoAction;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::document::XUndoManagerListener;
+ using ::com::sun::star::util::NotLockedException;
+ using ::com::sun::star::lang::NoSupportException;
+ using ::com::sun::star::util::XModifyListener;
+ using ::com::sun::star::frame::XModel;
+ /** === end UNO using === **/
+
+ namespace impl
+ {
+ //==============================================================================================================
+ //= UndoManager_Impl
+ //==============================================================================================================
+ class UndoManager_Impl : public ::framework::IUndoManagerImplementation
+ {
+ public:
+ UndoManager_Impl( UndoManager& i_antiImpl, ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
+ :m_rAntiImpl( i_antiImpl )
+ ,m_rParent( i_parent )
+ ,m_rMutex( i_mutex )
+ ,m_bDisposed( false )
+ ,m_aUndoManager()
+ ,m_aUndoHelper( *this )
+ {
+ m_aUndoManager.SetMaxUndoActionCount( (sal_uInt16)SvtUndoOptions().GetUndoCount() );
+ }
+
+ virtual ~UndoManager_Impl()
+ {
+ }
+
+ // .........................................................................................................
+ // IUndoManagerImplementation
+ virtual ::osl::Mutex& getMutex();
+ virtual ::svl::IUndoManager& getImplUndoManager();
+ virtual Reference< XUndoManager > getThis();
+
+ // .........................................................................................................
+ // attribute access
+ ::cppu::OWeakObject& getParent() { return m_rParent; }
+ ::framework::UndoManagerHelper& getUndoHelper() { return m_aUndoHelper; }
+
+ // .........................................................................................................
+ // public interface
+
+ /// is called when the owner of the UndoManager is being disposed
+ void disposing();
+
+ /// checks whether we're already disposed, throws a DisposedException if so
+ void checkDisposed_lck();
+
+ private:
+ UndoManager& m_rAntiImpl;
+ ::cppu::OWeakObject& m_rParent;
+ ::osl::Mutex& m_rMutex;
+ bool m_bDisposed;
+
+ SfxUndoManager m_aUndoManager;
+ ::framework::UndoManagerHelper m_aUndoHelper;
+ };
+
+ //--------------------------------------------------------------------------------------------------------------
+ ::osl::Mutex& UndoManager_Impl::getMutex()
+ {
+ return m_rMutex;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ ::svl::IUndoManager& UndoManager_Impl::getImplUndoManager()
+ {
+ return m_aUndoManager;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ Reference< XUndoManager > UndoManager_Impl::getThis()
+ {
+ return &m_rAntiImpl;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void UndoManager_Impl::disposing()
+ {
+ {
+ ::osl::MutexGuard aGuard( m_rMutex );
+ m_bDisposed = true;
+ }
+ m_aUndoHelper.disposing();
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void UndoManager_Impl::checkDisposed_lck()
+ {
+ if ( m_bDisposed )
+ throw DisposedException( ::rtl::OUString(), getThis() );
+ }
+
+ //==============================================================================================================
+ //= UndoManagerMethodGuard
+ //==============================================================================================================
+ /** guard for public UNO methods of the UndoManager
+
+ The only purpose of this guard is to check for the instance being disposed already. Everything else,
+ in particular the IMutexGuard functionality required by the UndoManagerHelper class, is a dummy only,
+ as all involved classes (means we ourselves, the UndoManagerHelper, the SfxUndoManager, and the Undo actions
+ we create) are inherently thread-safe, thus need no external lock (in particular no SolarMutex!).
+ */
+ class UndoManagerMethodGuard : public ::framework::IMutexGuard
+ {
+ public:
+ UndoManagerMethodGuard( UndoManager_Impl& i_impl )
+ {
+ ::osl::MutexGuard aGuard( i_impl.getMutex() );
+ // throw if the instance is already disposed
+ i_impl.checkDisposed_lck();
+ }
+ virtual ~UndoManagerMethodGuard()
+ {
+ }
+
+ // IMutexGuard
+ virtual ::framework::IMutex& getGuardedMutex();
+
+ // IGuard
+ virtual void clear();
+ virtual void reset();
+ };
+
+ class DummyMutex : public ::framework::IMutex
+ {
+ public:
+ virtual void acquire() { }
+ virtual void release() { }
+ };
+
+ //--------------------------------------------------------------------------------------------------------------
+ ::framework::IMutex& UndoManagerMethodGuard::getGuardedMutex()
+ {
+ static DummyMutex s_aDummyMutex;
+ return s_aDummyMutex;
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void UndoManagerMethodGuard::clear()
+ {
+ // nothing to do. This interface implementation is a dummy.
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ void UndoManagerMethodGuard::reset()
+ {
+ // nothing to do. This interface implementation is a dummy.
+ }
+ }
+
+ //==================================================================================================================
+ //= UndoManager
+ //==================================================================================================================
+ using impl::UndoManagerMethodGuard;
+
+ //------------------------------------------------------------------------------------------------------------------
+ UndoManager::UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex )
+ :m_pImpl( new impl::UndoManager_Impl( *this, i_parent, i_mutex ) )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ UndoManager::~UndoManager()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::acquire() throw ()
+ {
+ m_pImpl->getParent().acquire();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::release() throw ()
+ {
+ m_pImpl->getParent().release();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void UndoManager::disposing()
+ {
+ m_pImpl->disposing();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::enterUndoContext( const ::rtl::OUString& i_title ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().enterUndoContext( i_title, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::enterHiddenUndoContext( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().enterHiddenUndoContext( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::leaveUndoContext( ) throw (InvalidStateException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().leaveUndoContext( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::addUndoAction( const Reference< XUndoAction >& i_action ) throw (IllegalArgumentException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().addUndoAction( i_action, aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::undo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().undo( aGuard );
+
+ ChartViewHelper::setViewToDirtyState( Reference< XModel >( getParent(), UNO_QUERY ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::redo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().redo( aGuard );
+
+ ChartViewHelper::setViewToDirtyState( Reference< XModel >( getParent(), UNO_QUERY ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL UndoManager::isUndoPossible( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().isUndoPossible();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL UndoManager::isRedoPossible( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().isRedoPossible();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL UndoManager::getCurrentUndoActionTitle( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().getCurrentUndoActionTitle();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL UndoManager::getCurrentRedoActionTitle( ) throw (EmptyUndoStackException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().getCurrentRedoActionTitle();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllUndoActionTitles( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().getAllUndoActionTitles();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllRedoActionTitles( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().getAllRedoActionTitles();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::clear( ) throw (UndoContextNotClosedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().clear( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::clearRedo( ) throw (UndoContextNotClosedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().clearRedo( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::reset( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().reset( aGuard );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().addUndoManagerListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::removeUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().removeUndoManagerListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::lock( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().lock();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::unlock( ) throw (NotLockedException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().unlock();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL UndoManager::isLocked( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return m_pImpl->getUndoHelper().isLocked();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XInterface > SAL_CALL UndoManager::getParent( ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ return *&m_pImpl->getParent();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::setParent( const Reference< XInterface >& i_parent ) throw (NoSupportException, RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ (void)i_parent;
+ throw NoSupportException( ::rtl::OUString(), m_pImpl->getThis() );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::addModifyListener( const Reference< XModifyListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().addModifyListener( i_listener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL UndoManager::removeModifyListener( const Reference< XModifyListener >& i_listener ) throw (RuntimeException)
+ {
+ UndoManagerMethodGuard aGuard( *m_pImpl );
+ m_pImpl->getUndoHelper().removeModifyListener( i_listener );
+ }
+
+//......................................................................................................................
+} // namespace chart
+//......................................................................................................................
diff --git a/chart2/source/model/main/UndoManager.hxx b/chart2/source/model/main/UndoManager.hxx
new file mode 100755
index 000000000000..07091207ebd0
--- /dev/null
+++ b/chart2/source/model/main/UndoManager.hxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef CHART2_UNDOMANAGER_HXX
+#define CHART2_UNDOMANAGER_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/document/XUndoManager.hpp>
+#include <com/sun/star/util/XModifyBroadcaster.hpp>
+#include <com/sun/star/container/XChild.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase2.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace chart
+{
+//......................................................................................................................
+
+ namespace impl
+ {
+ class UndoManager_Impl;
+ typedef ::cppu::ImplHelper2 < ::com::sun::star::document::XUndoManager
+ , ::com::sun::star::util::XModifyBroadcaster
+ > UndoManager_Base;
+ }
+
+ //==================================================================================================================
+ //= UndoManager
+ //==================================================================================================================
+ class UndoManager : public impl::UndoManager_Base
+ {
+ public:
+ UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex );
+ virtual ~UndoManager();
+
+ // XInterface
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ // XComponent equivalents
+ void disposing();
+
+ // XUndoManager
+ virtual void SAL_CALL enterUndoContext( const ::rtl::OUString& i_title ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL enterHiddenUndoContext( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL leaveUndoContext( ) throw (::com::sun::star::util::InvalidStateException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL undo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL redo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isUndoPossible( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isRedoPossible( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCurrentUndoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCurrentRedoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoActionTitles( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoActionTitles( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clear( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL clearRedo( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL reset( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XLockable (base of XUndoManager)
+ virtual void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL unlock( ) throw (::com::sun::star::util::NotLockedException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XChild (base of XUndoManager)
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ // XModifyBroadcaster
+ virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ ::boost::scoped_ptr< impl::UndoManager_Impl > m_pImpl;
+ };
+
+//......................................................................................................................
+} // namespace chart
+//......................................................................................................................
+
+#endif // CHART2_UNDOMANAGER_HXX
diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx
index 344f14c6cb78..1f7a6f8c7215 100644..100755
--- a/chart2/source/model/main/Wall.cxx
+++ b/chart2/source/model/main/Wall.cxx
@@ -60,45 +60,70 @@ namespace
static const ::rtl::OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.Wall" ));
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticWallDefaults_Initializer
{
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::FillProperties::AddDefaultsToMap( rOutMap );
+
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ }
+};
+
+struct StaticWallDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticWallDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticWallInfoHelper_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticWallInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticWallInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+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 >
+{
+};
} // anonymous namespace
@@ -135,51 +160,23 @@ uno::Reference< util::XCloneable > SAL_CALL Wall::createClone()
uno::Any Wall::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- FillProperties::AddDefaultsToMap( aStaticDefaults );
-
- // initialize defaults
- // Note: this should be last to override defaults of the previously
- // added defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticWallDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL Wall::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticWallInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- Wall::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL Wall::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticWallInfo::get();
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/main/_serviceregistration_model.cxx b/chart2/source/model/main/_serviceregistration_model.cxx
index 9eddacfd5cf7..49a0ee73e53c 100644
--- a/chart2/source/model/main/_serviceregistration_model.cxx
+++ b/chart2/source/model/main/_serviceregistration_model.cxx
@@ -192,16 +192,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- return (::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, g_entries_chart2_model ) &&
- ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey,
- ChartTypeEntriesForServiceRegistration::getImplementationEntries() ));
-}
-//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
diff --git a/chart2/source/model/main/makefile.mk b/chart2/source/model/main/makefile.mk
index 8e963dfa0f5c..5ca78bbdea25 100644
--- a/chart2/source/model/main/makefile.mk
+++ b/chart2/source/model/main/makefile.mk
@@ -60,6 +60,7 @@ SLOFILES= \
$(SLO)$/StockBar.obj \
$(SLO)$/Title.obj \
$(SLO)$/Wall.obj \
+ $(SLO)$/UndoManager.obj \
$(SLO)$/_serviceregistration_model.obj
# --- Targets -----------------------------------------------------------------
diff --git a/chart2/source/model/makefile.mk b/chart2/source/model/makefile.mk
index dfb5522a7879..25d4b1b2949a 100644
--- a/chart2/source/model/makefile.mk
+++ b/chart2/source/model/makefile.mk
@@ -79,7 +79,8 @@ SHL1STDLIBS= $(CHARTTOOLS) \
$(SVLLIB) \
$(SVTOOLLIB) \
$(SALLIB) \
- $(UCBHELPERLIB)
+ $(UCBHELPERLIB) \
+ $(FWELIB) \
#--------exports
@@ -98,3 +99,11 @@ DEF1NAME= $(SHL1TARGET)
# --- Targets -----------------------------------------------------------------
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/chartmodel.component
+
+$(MISC)/chartmodel.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ chartmodel.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt chartmodel.component
diff --git a/chart2/source/model/template/AreaChartTypeTemplate.cxx b/chart2/source/model/template/AreaChartTypeTemplate.cxx
index 599e05f54dff..00e2fcffff5c 100644..100755
--- a/chart2/source/model/template/AreaChartTypeTemplate.cxx
+++ b/chart2/source/model/template/AreaChartTypeTemplate.cxx
@@ -71,42 +71,64 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticAreaChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AREA_TEMPLATE_DIMENSION, 2 );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_AREA_TEMPLATE_DIMENSION, 2 );
+ }
+};
+
+struct StaticAreaChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticAreaChartTypeTemplateDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticAreaChartTypeTemplateInfoHelper_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticAreaChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticAreaChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticAreaChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticAreaChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticAreaChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticAreaChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -133,45 +155,23 @@ AreaChartTypeTemplate::~AreaChartTypeTemplate()
uno::Any AreaChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticAreaChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL AreaChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticAreaChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- AreaChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL AreaChartTypeTemplate::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticAreaChartTypeTemplateInfo::get();
}
sal_Int32 AreaChartTypeTemplate::getDimension() const
diff --git a/chart2/source/model/template/BarChartTypeTemplate.cxx b/chart2/source/model/template/BarChartTypeTemplate.cxx
index a40bc31d4123..7ba04435a5ca 100644..100755
--- a/chart2/source/model/template/BarChartTypeTemplate.cxx
+++ b/chart2/source/model/template/BarChartTypeTemplate.cxx
@@ -78,43 +78,65 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticBarChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_BAR_TEMPLATE_DIMENSION, 2 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BAR_TEMPLATE_GEOMETRY3D, ::chart2::DataPointGeometry3D::CUBOID );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ 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 >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticBarChartTypeTemplateInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticBarChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBarChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticBarChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticBarChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticBarChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticBarChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -226,45 +248,23 @@ Reference< chart2::XChartType > SAL_CALL BarChartTypeTemplate::getChartTypeForNe
uno::Any BarChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticBarChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL BarChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticBarChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- BarChartTypeTemplate::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL BarChartTypeTemplate::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticBarChartTypeTemplateInfo::get();
}
void SAL_CALL BarChartTypeTemplate::applyStyle(
diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx
index e863bb4d0a53..8a957c496492 100644..100755
--- a/chart2/source/model/template/BubbleChartType.cxx
+++ b/chart2/source/model/template/BubbleChartType.cxx
@@ -57,32 +57,62 @@ void lcl_AddPropertiesToVector(
{
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & /*rOutMap*/ )
+struct StaticBubbleChartTypeDefaults_Initializer
{
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & /*rOutMap*/ )
+ {
+ }
+};
+
+struct StaticBubbleChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBubbleChartTypeDefaults_Initializer >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticBubbleChartTypeInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+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 >
+{
+};
} // anonymous namespace
@@ -177,49 +207,24 @@ OUString SAL_CALL BubbleChartType::getRoleOfSequenceForSeriesLabel()
uno::Any BubbleChartType::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticBubbleChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticBubbleChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- BubbleChartType::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL BubbleChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticBubbleChartTypeInfo::get();
}
uno::Sequence< ::rtl::OUString > BubbleChartType::getSupportedServiceNames_Static()
diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
index 6f8b41cbe9b9..ad9b0c9fdd63 100644..100755
--- a/chart2/source/model/template/BubbleChartTypeTemplate.cxx
+++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
@@ -37,8 +37,6 @@
#include "servicenames_charttypes.hxx"
#include "ContainerHelper.hxx"
#include "DataSeriesHelper.hxx"
-#include <com/sun/star/chart2/SymbolStyle.hpp>
-#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include "PropertyHelper.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -66,41 +64,63 @@ void lcl_AddPropertiesToVector(
{
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & /*rOutMap*/ )
+struct StaticBubbleChartTypeTemplateDefaults_Initializer
{
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & /*rOutMap*/ )
+ {
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticBubbleChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticBubbleChartTypeTemplateDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticBubbleChartTypeTemplateInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticBubbleChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticBubbleChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+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 >
+{
+};
} // anonymous namespace
@@ -123,45 +143,23 @@ BubbleChartTypeTemplate::~BubbleChartTypeTemplate()
uno::Any BubbleChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticBubbleChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticBubbleChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- BubbleChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL BubbleChartTypeTemplate::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticBubbleChartTypeTemplateInfo::get();
}
sal_Int32 BubbleChartTypeTemplate::getDimension() const
diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx
index 7741c4488f85..678c99ea6806 100644..100755
--- a/chart2/source/model/template/BubbleDataInterpreter.cxx
+++ b/chart2/source/model/template/BubbleDataInterpreter.cxx
@@ -78,16 +78,17 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
Reference< data::XLabeledDataSequence > xCategories;
bool bHasCategories = HasCategories( aArguments, aData );
+ bool bUseCategoriesAsX = UseCategoriesAsX( aArguments );
- bool bHasXValues = false;
+ bool bSetXValues = false;
sal_Int32 nDataSeqCount = aData.getLength();
- bHasXValues = bHasCategories ? ( (nDataSeqCount-1) > 2 && (nDataSeqCount-1) % 2 != 0 )
+ bSetXValues = bHasCategories ? ( (nDataSeqCount-1) > 2 && (nDataSeqCount-1) % 2 != 0 )
:( nDataSeqCount > 2 && nDataSeqCount % 2 != 0 );
bool bCategoriesUsed = false;
bool bNextIsYValues = bHasCategories ? nDataSeqCount>2 : nDataSeqCount>1;
- for( sal_Int32 nDataIdx = 0; nDataIdx < aData.getLength(); ++nDataIdx )
+ for( sal_Int32 nDataIdx = 0; nDataIdx < nDataSeqCount; ++nDataIdx )
{
try
{
@@ -95,10 +96,17 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
{
xCategories.set( aData[nDataIdx] );
if( xCategories.is())
+ {
SetRole( xCategories->getValues(), C2U("categories"));
+ if( bUseCategoriesAsX )
+ {
+ bSetXValues = false;
+ bNextIsYValues = nDataSeqCount > 2;
+ }
+ }
bCategoriesUsed = true;
}
- else if( !xValuesX.is() && bHasXValues )
+ else if( !xValuesX.is() && bSetXValues )
{
xValuesX.set( aData[nDataIdx] );
if( xValuesX.is())
@@ -116,7 +124,7 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
aSizeValuesVector.push_back( aData[nDataIdx] );
if( aData[nDataIdx].is())
SetRole( aData[nDataIdx]->getValues(), C2U("values-size"));
- bNextIsYValues = true;
+ bNextIsYValues = (nDataSeqCount-(nDataIdx+1)) >= 2;//two or more left
}
}
catch( uno::Exception & ex )
@@ -133,26 +141,19 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
Reference< data::XLabeledDataSequence > xClonedXValues = xValuesX;
Reference< util::XCloneable > xCloneableX( xValuesX, uno::UNO_QUERY );
- for( size_t nCount = 0; nCount < aSizeValuesVector.size(); ++nCount, ++nSeriesIndex )
+ for( size_t nN = 0; nN < aSizeValuesVector.size(); ++nN, ++nSeriesIndex )
{
- sal_Int32 nDataSequenceCount = 2;
- if( xValuesX.is() )
- nDataSequenceCount = 3;
- else if( aYValuesVector.empty() )
- nDataSequenceCount = 1;
-
- Sequence< Reference< data::XLabeledDataSequence > > aNewData( nDataSequenceCount );
- sal_Int32 nDataIndex = 0;
+ vector< Reference< data::XLabeledDataSequence > > aNewData;
if( xValuesX.is() )
{
- if( nCount > 0 && xCloneableX.is() )
+ if( nN > 0 && xCloneableX.is() )
xClonedXValues.set( xCloneableX->createClone(), uno::UNO_QUERY );
- aNewData[nDataIndex++] = xClonedXValues;
+ aNewData.push_back( xClonedXValues );
}
- if( aYValuesVector.size() > nCount )
- aNewData[nDataIndex++] = aYValuesVector[nCount];
- if( aSizeValuesVector.size() > nCount )
- aNewData[nDataIndex++] = aSizeValuesVector[nCount];
+ if( aYValuesVector.size() > nN )
+ aNewData.push_back( aYValuesVector[nN] );
+ if( aSizeValuesVector.size() > nN )
+ aNewData.push_back( aSizeValuesVector[nN] );
Reference< XDataSeries > xSeries;
if( nSeriesIndex < aSeriesToReUse.getLength())
@@ -162,7 +163,7 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
OSL_ASSERT( xSeries.is() );
Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY );
OSL_ASSERT( xSink.is() );
- xSink->setData( aNewData );
+ xSink->setData( ContainerHelper::ContainerToSequence( aNewData ) );
aSeriesVec.push_back( xSeries );
}
diff --git a/chart2/source/model/template/CandleStickChartType.cxx b/chart2/source/model/template/CandleStickChartType.cxx
index 96ef8e94325e..84e37e7e72ba 100644..100755
--- a/chart2/source/model/template/CandleStickChartType.cxx
+++ b/chart2/source/model/template/CandleStickChartType.cxx
@@ -96,38 +96,67 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap,
- ::osl::Mutex & rMutex )
+struct StaticCandleStickChartTypeDefaults_Initializer
{
- ::osl::MutexGuard aGuard( rMutex );
- // 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 );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ 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 >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticCandleStickChartTypeInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
+
+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 >
+{
+};
} // anonymous namespace
@@ -261,49 +290,24 @@ OUString SAL_CALL CandleStickChartType::getRoleOfSequenceForSeriesLabel()
uno::Any CandleStickChartType::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults, GetMutex() );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticCandleStickChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL CandleStickChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticCandleStickChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- CandleStickChartType::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL CandleStickChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticCandleStickChartTypeInfo::get();
}
void SAL_CALL CandleStickChartType::setFastPropertyValue_NoBroadcast(
diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx
index 547bf3c103f2..0249d8cc1282 100644..100755
--- a/chart2/source/model/template/ChartType.cxx
+++ b/chart2/source/model/template/ChartType.cxx
@@ -225,32 +225,51 @@ uno::Any ChartType::GetDefaultValue( sal_Int32 /* nHandle */ ) const
return uno::Any();
}
-// ____ OPropertySet ____
-::cppu::IPropertyArrayHelper & SAL_CALL ChartType::getInfoHelper()
+namespace
{
- // using assignment for broken gcc 3.3
- static ::cppu::OPropertyArrayHelper aArrayHelper = ::cppu::OPropertyArrayHelper(
- Sequence< beans::Property >(), /* bSorted */ sal_True );
-
- return aArrayHelper;
-}
+struct StaticChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ // using assignment for broken gcc 3.3
+ static ::cppu::OPropertyArrayHelper aPropHelper = ::cppu::OPropertyArrayHelper(
+ Sequence< beans::Property >() );
+ return &aPropHelper;
+ }
+};
-// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ChartType::getPropertySetInfo()
- throw (uno::RuntimeException)
+struct StaticChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticChartTypeInfoHelper_Initializer >
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
+};
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
+struct StaticChartTypeInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
{
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticChartTypeInfoHelper::get() ) );
+ return &xPropertySetInfo;
}
+};
+
+struct StaticChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticChartTypeInfo_Initializer >
+{
+};
+
+}
- return xInfo;
+// ____ OPropertySet ____
+::cppu::IPropertyArrayHelper & SAL_CALL ChartType::getInfoHelper()
+{
+ return *StaticChartTypeInfoHelper::get();
+}
+
+// ____ XPropertySet ____
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ChartType::getPropertySetInfo()
+ throw (uno::RuntimeException)
+{
+ return *StaticChartTypeInfo::get();
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index 98f11ee3257a..9fee9b342534 100644..100755
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -644,17 +644,30 @@ void ChartTypeTemplate::adaptScales(
sal_Int32 nDim( xCooSys->getDimension());
if( nDim > 0 )
{
- const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(0);
+ const sal_Int32 nDimensionX = 0;
+ const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionX);
for(sal_Int32 nI=0; nI<=nMaxIndex; ++nI)
{
- Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,nI) );
+ Reference< XAxis > xAxis( xCooSys->getAxisByDimension(nDimensionX,nI) );
if( xAxis.is())
{
ScaleData aData( xAxis->getScaleData() );
aData.Categories = xCategories;
- aData.AxisType = bSupportsCategories ? AxisType::CATEGORY : AxisType::REALNUMBER;
- if( bSupportsCategories )
- AxisHelper::removeExplicitScaling( aData );
+ if(bSupportsCategories)
+ {
+
+ Reference< XChartType > xChartType( getChartTypeForNewSeries(Sequence< Reference< XChartType > >() ));
+ bool bSupportsDates = ::chart::ChartTypeHelper::isSupportingDateAxis( xChartType, 2, nDimensionX );
+ if( aData.AxisType != AxisType::CATEGORY && ( aData.AxisType != AxisType::DATE || !bSupportsDates) )
+ {
+ aData.AxisType = AxisType::CATEGORY;
+ aData.AutoDateAxis = true;
+ AxisHelper::removeExplicitScaling( aData );
+ }
+ }
+ else
+ aData.AxisType = AxisType::REALNUMBER;
+
xAxis->setScaleData( aData );
}
}
diff --git a/chart2/source/model/template/ColumnChartType.cxx b/chart2/source/model/template/ColumnChartType.cxx
index c6080cb8e64b..41168ea97ce9 100644..100755
--- a/chart2/source/model/template/ColumnChartType.cxx
+++ b/chart2/source/model/template/ColumnChartType.cxx
@@ -68,39 +68,70 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticColumnChartTypeDefaults_Initializer
{
- Sequence< sal_Int32 > aSeq(2);
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ Sequence< sal_Int32 > aSeq(2);
- aSeq[0] = aSeq[1] = 0;
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_OVERLAP_SEQUENCE, aSeq );
+ aSeq[0] = aSeq[1] = 0;
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_OVERLAP_SEQUENCE, aSeq );
- aSeq[0] = aSeq[1] = 100;
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq );
-}
+ aSeq[0] = aSeq[1] = 100;
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticColumnChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticColumnChartTypeDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticColumnChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
+
+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 >
+{
+};
} // anonymous namespace
@@ -138,47 +169,23 @@ uno::Reference< util::XCloneable > SAL_CALL ColumnChartType::createClone()
uno::Any ColumnChartType::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticColumnChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL ColumnChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
- return aArrayHelper;
+ return *StaticColumnChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ColumnChartType::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ColumnChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticColumnChartTypeInfo::get();
}
diff --git a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
index 716fe9dce6c5..07a060c91e62 100644..100755
--- a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
@@ -77,42 +77,64 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticColumnLineChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_COL_LINE_NUMBER_OF_LINES, 1 );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_COL_LINE_NUMBER_OF_LINES, 1 );
+ }
+};
+
+struct StaticColumnLineChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticColumnLineChartTypeTemplateDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticColumnLineChartTypeTemplateInfoHelper_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticColumnLineChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticColumnLineChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticColumnLineChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticColumnLineChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticColumnLineChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticColumnLineChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -139,45 +161,23 @@ ColumnLineChartTypeTemplate::~ColumnLineChartTypeTemplate()
uno::Any ColumnLineChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticColumnLineChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL ColumnLineChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticColumnLineChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ColumnLineChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ColumnLineChartTypeTemplate::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticColumnLineChartTypeTemplateInfo::get();
}
void ColumnLineChartTypeTemplate::createChartTypes(
diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx
index 301e23a5350f..ec7bc390c700 100644..100755
--- a/chart2/source/model/template/DataInterpreter.cxx
+++ b/chart2/source/model/template/DataInterpreter.cxx
@@ -391,6 +391,14 @@ bool DataInterpreter::HasCategories(
return bHasCategories;
}
+bool DataInterpreter::UseCategoriesAsX( const Sequence< beans::PropertyValue > & rArguments )
+{
+ bool bUseCategoriesAsX = true;
+ if( rArguments.getLength() > 0 )
+ GetProperty( rArguments, C2U(("UseCategoriesAsX"))) >>= bUseCategoriesAsX;
+ return bUseCategoriesAsX;
+}
+
// ------------------------------------------------------------
Sequence< OUString > DataInterpreter::getSupportedServiceNames_Static()
diff --git a/chart2/source/model/template/DataInterpreter.hxx b/chart2/source/model/template/DataInterpreter.hxx
index 5133a39de7a8..cd5cf113b709 100644..100755
--- a/chart2/source/model/template/DataInterpreter.hxx
+++ b/chart2/source/model/template/DataInterpreter.hxx
@@ -74,6 +74,10 @@ public:
::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence > > & rData );
+ static bool UseCategoriesAsX(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue > & rArguments );
+
protected:
// ____ XDataInterpreter ____
virtual ::com::sun::star::chart2::InterpretedData SAL_CALL interpretDataSource(
diff --git a/chart2/source/model/template/LineChartType.cxx b/chart2/source/model/template/LineChartType.cxx
index 9d1c8eeac7a7..3211c8a37f26 100644..100755
--- a/chart2/source/model/template/LineChartType.cxx
+++ b/chart2/source/model/template/LineChartType.cxx
@@ -79,38 +79,69 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticLineChartTypeDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_CURVE_STYLE, ::chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_CURVE_RESOLUTION, 20 );
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ 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 );
-}
+ // 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 );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticLineChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticLineChartTypeDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticLineChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
+
+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;
+ }
+};
+
+struct StaticLineChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticLineChartTypeInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -150,48 +181,23 @@ uno::Reference< util::XCloneable > SAL_CALL LineChartType::createClone()
uno::Any LineChartType::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticLineChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL LineChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticLineChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- LineChartType::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL LineChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticLineChartTypeInfo::get();
}
uno::Sequence< ::rtl::OUString > LineChartType::getSupportedServiceNames_Static()
diff --git a/chart2/source/model/template/LineChartTypeTemplate.cxx b/chart2/source/model/template/LineChartTypeTemplate.cxx
index a6702ac42b0e..a6a9bb5a5e40 100644..100755
--- a/chart2/source/model/template/LineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/LineChartTypeTemplate.cxx
@@ -89,47 +89,69 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticLineChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ 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 );
-}
+ // 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 >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticLineChartTypeTemplateInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticLineChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticLineChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticLineChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticLineChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticLineChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticLineChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -161,45 +183,23 @@ LineChartTypeTemplate::~LineChartTypeTemplate()
uno::Any LineChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticLineChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL LineChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticLineChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- LineChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL LineChartTypeTemplate::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticLineChartTypeTemplateInfo::get();
}
sal_Int32 LineChartTypeTemplate::getDimension() const
diff --git a/chart2/source/model/template/NetChartType.cxx b/chart2/source/model/template/NetChartType.cxx
index 1f1f0f06dfb8..858d5dc388f1 100644..100755
--- a/chart2/source/model/template/NetChartType.cxx
+++ b/chart2/source/model/template/NetChartType.cxx
@@ -109,29 +109,51 @@ uno::Any NetChartType_Base::GetDefaultValue( sal_Int32 /*nHandle*/ ) const
return uno::Any();
}
+namespace
+{
+
+struct StaticNetChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ // using assignment for broken gcc 3.3
+ static ::cppu::OPropertyArrayHelper aPropHelper = ::cppu::OPropertyArrayHelper(
+ 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;
+ }
+};
+
+struct StaticNetChartTypeInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticNetChartTypeInfo_Initializer >
+{
+};
+
+}
+
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL NetChartType_Base::getInfoHelper()
{
- uno::Sequence< beans::Property > aProps;
- static ::cppu::OPropertyArrayHelper aArrayHelper(aProps);
- return aArrayHelper;
+ return *StaticNetChartTypeInfoHelper::get();
}
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- NetChartType_Base::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL NetChartType_Base::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticNetChartTypeInfo::get();
}
//-----------------------------------------------------------------------------
diff --git a/chart2/source/model/template/PieChartType.cxx b/chart2/source/model/template/PieChartType.cxx
index 81760c2d3f39..fac0b9c12787 100644..100755
--- a/chart2/source/model/template/PieChartType.cxx
+++ b/chart2/source/model/template/PieChartType.cxx
@@ -68,33 +68,64 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticPieChartTypeDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIECHARTTYPE_USE_RINGS, false );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PIECHARTTYPE_USE_RINGS, false );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticPieChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticPieChartTypeDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticPieChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
+
+struct StaticPieChartTypeInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticPieChartTypeInfoHelper_Initializer >
+{
+};
+
+struct StaticPieChartTypeInfo_Initializer
+{
+ 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 >
+{
+};
} // anonymous namespace
@@ -174,49 +205,24 @@ Reference< chart2::XCoordinateSystem > SAL_CALL
uno::Any PieChartType::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticPieChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL PieChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticPieChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- PieChartType::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL PieChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticPieChartTypeInfo::get();
}
uno::Sequence< ::rtl::OUString > PieChartType::getSupportedServiceNames_Static()
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx
index 1a36079de078..0273d3b38246 100644..100755
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -101,45 +101,67 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticPieChartTypeTemplateDefaults_Initializer
{
- ::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 );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ 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 >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticPieChartTypeTemplateInfoHelper_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticPieChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticPieChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticPieChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticPieChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticPieChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticPieChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -168,48 +190,25 @@ PieChartTypeTemplate::~PieChartTypeTemplate()
uno::Any PieChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticPieChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL PieChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticPieChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- PieChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL PieChartTypeTemplate::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticPieChartTypeTemplateInfo::get();
}
-
// ____ ChartTypeTemplate ____
sal_Int32 PieChartTypeTemplate::getDimension() const
{
diff --git a/chart2/source/model/template/ScatterChartType.cxx b/chart2/source/model/template/ScatterChartType.cxx
index 3d7b0fff5f28..8080730a7b0e 100644..100755
--- a/chart2/source/model/template/ScatterChartType.cxx
+++ b/chart2/source/model/template/ScatterChartType.cxx
@@ -83,38 +83,69 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticScatterChartTypeDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCATTERCHARTTYPE_CURVE_STYLE, chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_CURVE_RESOLUTION, 20 );
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ 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 );
-}
+ // 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 );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticScatterChartTypeDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticScatterChartTypeDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticScatterChartTypeInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
+
+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 >
+{
+};
} // anonymous namespace
@@ -223,49 +254,24 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScatterChartType::getSupportedOptional
uno::Any ScatterChartType::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticScatterChartTypeDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
// ____ OPropertySet ____
::cppu::IPropertyArrayHelper & SAL_CALL ScatterChartType::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
- return aArrayHelper;
+ return *StaticScatterChartTypeInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ScatterChartType::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ScatterChartType::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticScatterChartTypeInfo::get();
}
uno::Sequence< ::rtl::OUString > ScatterChartType::getSupportedServiceNames_Static()
diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.cxx b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
index f34ae6a52fe4..3c9d61c4babf 100644..100755
--- a/chart2/source/model/template/ScatterChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
@@ -91,47 +91,69 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticScatterChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE, chart2::CurveStyle_LINES );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION, 20 );
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ 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 );
-}
+ // 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 >
+{
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticScatterChartTypeTemplateInfoHelper_Initializer
{
- static Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticScatterChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticScatterChartTypeTemplateInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticScatterChartTypeTemplateInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticScatterChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticScatterChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticScatterChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -162,45 +184,23 @@ ScatterChartTypeTemplate::~ScatterChartTypeTemplate()
uno::Any ScatterChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticScatterChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL ScatterChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticScatterChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ScatterChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ScatterChartTypeTemplate::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticScatterChartTypeTemplateInfo::get();
}
sal_Int32 ScatterChartTypeTemplate::getDimension() const
diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx
index d47bb48f2763..9c93feda749f 100644..100755
--- a/chart2/source/model/template/StockChartTypeTemplate.cxx
+++ b/chart2/source/model/template/StockChartTypeTemplate.cxx
@@ -40,7 +40,6 @@
#include "ContainerHelper.hxx"
#include "AxisIndexDefines.hxx"
#include <com/sun/star/chart2/AxisType.hpp>
-#include <com/sun/star/chart2/SymbolStyle.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
@@ -105,45 +104,66 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticStockChartTypeTemplateDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_VOLUME, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_OPEN, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_LOW_HIGH, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_JAPANESE, false );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_VOLUME, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_OPEN, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_LOW_HIGH, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_STOCKCHARTTYPE_TEMPLATE_JAPANESE, false );
+ }
+};
-const Sequence< Property > & lcl_GetPropertySequence()
+struct StaticStockChartTypeTemplateDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticStockChartTypeTemplateDefaults_Initializer >
{
- static Sequence< Property > aPropSeq;
+};
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+struct StaticStockChartTypeTemplateInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
+
+private:
+ Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticStockChartTypeTemplateInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticStockChartTypeTemplateInfoHelper_Initializer >
+{
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticStockChartTypeTemplateInfo_Initializer
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticStockChartTypeTemplateInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
- return aArrayHelper;
-}
+struct StaticStockChartTypeTemplateInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticStockChartTypeTemplateInfo_Initializer >
+{
+};
} // anonymous namespace
// ----------------------------------------
@@ -180,45 +200,23 @@ StockChartTypeTemplate::~StockChartTypeTemplate()
uno::Any StockChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticStockChartTypeTemplateDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL StockChartTypeTemplate::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticStockChartTypeTemplateInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- StockChartTypeTemplate::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL StockChartTypeTemplate::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticStockChartTypeTemplateInfo::get();
}
sal_Int32 StockChartTypeTemplate::getAxisCountByDimension( sal_Int32 nDimension )
diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx
index 249a6a69c1b2..10cb2d7b9c8b 100644..100755
--- a/chart2/source/model/template/XYDataInterpreter.cxx
+++ b/chart2/source/model/template/XYDataInterpreter.cxx
@@ -76,11 +76,12 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
vector< Reference< data::XLabeledDataSequence > > aSequencesVec;
Reference< data::XLabeledDataSequence > xCategories;
- // check for categories. If true, the the categories bet parked in the axis scale, but not used via setting the Axistype to Not CATEGORY
bool bHasCategories = HasCategories( aArguments, aData );
+ bool bUseCategoriesAsX = UseCategoriesAsX( aArguments );
// parse data
bool bCategoriesUsed = false;
+ bool bSetXValues = aData.getLength()>(bCategoriesUsed?2:1);
for( sal_Int32 nDataIdx= 0; nDataIdx < aData.getLength(); ++nDataIdx )
{
try
@@ -89,10 +90,14 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
{
xCategories.set( aData[nDataIdx] );
if( xCategories.is())
+ {
SetRole( xCategories->getValues(), C2U("categories"));
+ if( bUseCategoriesAsX )
+ bSetXValues = false;
+ }
bCategoriesUsed = true;
}
- else if( !xValuesX.is() && (aData.getLength()>(bCategoriesUsed?2:1)) )
+ else if( !xValuesX.is() && bSetXValues )
{
xValuesX.set( aData[nDataIdx] );
if( xValuesX.is())
@@ -124,22 +129,14 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
for( ;aSequencesVecIt != aSequencesVec.end(); ++aSequencesVecIt, ++nSeriesIndex )
{
- Sequence< Reference< data::XLabeledDataSequence > > aNewData(xValuesX.is()?2:1);
- if( aSequencesVecIt != aSequencesVec.begin() &&
- xCloneable.is() )
- {
- xClonedXValues.set( xCloneable->createClone(), uno::UNO_QUERY );
- }
+ vector< Reference< data::XLabeledDataSequence > > aNewData;
+ if( aSequencesVecIt != aSequencesVec.begin() && xCloneable.is() )
+ xClonedXValues.set( xCloneable->createClone(), uno::UNO_QUERY );
if( xValuesX.is() )
- {
- aNewData[0] = xClonedXValues;
- aNewData[1] = (*aSequencesVecIt);
- }
- else
- {
- aNewData[0] = (*aSequencesVecIt);
- }
+ aNewData.push_back( xClonedXValues );
+
+ aNewData.push_back( *aSequencesVecIt );
Reference< XDataSeries > xSeries;
if( nSeriesIndex < aSeriesToReUse.getLength())
@@ -149,7 +146,7 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource(
OSL_ASSERT( xSeries.is() );
Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY );
OSL_ASSERT( xSink.is() );
- xSink->setData( aNewData );
+ xSink->setData( ContainerHelper::ContainerToSequence( aNewData ) );
aSeriesVec.push_back( xSeries );
}
diff --git a/chart2/source/model/template/_serviceregistration_charttypes.cxx b/chart2/source/model/template/_serviceregistration_charttypes.cxx
index 5888be8b42c8..5888be8b42c8 100644..100755
--- a/chart2/source/model/template/_serviceregistration_charttypes.cxx
+++ b/chart2/source/model/template/_serviceregistration_charttypes.cxx
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index cc92baa54821..9a6217bfbe56 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -39,7 +39,10 @@
#include "servicenames_coosystems.hxx"
#include "DataSeriesHelper.hxx"
#include "Scaling.hxx"
+#include "ChartModelHelper.hxx"
+#include "DataSourceHelper.hxx"
+#include <tools/debug.hxx>
#include <unotools/saveopt.hxx>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
@@ -51,6 +54,8 @@
// header for class OUStringBuffer
#include <rtl/ustrbuf.hxx>
+#include <rtl/math.hxx>
+
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
@@ -79,6 +84,8 @@ ScaleData AxisHelper::createDefaultScale()
{
ScaleData aScaleData;
aScaleData.AxisType = chart2::AxisType::REALNUMBER;
+ aScaleData.AutoDateAxis = true;
+ aScaleData.ShiftedCategoryPosition = false;//this is adapted in the view code currently
Sequence< SubIncrement > aSubIncrements(1);
aSubIncrements[0] = SubIncrement();
aScaleData.IncrementData.SubIncrements = aSubIncrements;
@@ -90,6 +97,9 @@ void AxisHelper::removeExplicitScaling( ScaleData& rScaleData )
uno::Any aEmpty;
rScaleData.Minimum = rScaleData.Maximum = rScaleData.Origin = aEmpty;
rScaleData.Scaling = 0;
+ ScaleData aDefaultScale( createDefaultScale() );
+ rScaleData.IncrementData = aDefaultScale.IncrementData;
+ rScaleData.TimeIncrement = aDefaultScale.TimeIncrement;
}
bool AxisHelper::isLogarithmic( const Reference< XScaling >& xScaling )
@@ -101,6 +111,227 @@ bool AxisHelper::isLogarithmic( const Reference< XScaling >& xScaling )
return bReturn;
}
+chart2::ScaleData AxisHelper::getDateCheckedScale( const Reference< chart2::XAxis >& xAxis, const Reference< frame::XModel >& xChartModel )
+{
+ DBG_ASSERT(xChartModel.is(),"missing chart model");
+ ScaleData aScale = xAxis->getScaleData();
+ Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartModel ) );
+ 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 ), 2, nDimensionIndex );
+ if( bChartTypeAllowsDateAxis )
+ aScale.AxisType = AxisType::DATE;
+ }
+ if( aScale.AxisType == AxisType::DATE )
+ {
+ ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys,xChartModel );
+ if( !aExplicitCategoriesProvider.isDateAxis() )
+ aScale.AxisType = AxisType::CATEGORY;
+ }
+ return aScale;
+}
+
+void AxisHelper::checkDateAxis( chart2::ScaleData& rScale, ExplicitCategoriesProvider* pExplicitCategoriesProvider, bool bChartTypeAllowsDateAxis )
+{
+ if( rScale.AutoDateAxis && rScale.AxisType == AxisType::CATEGORY && bChartTypeAllowsDateAxis )
+ {
+ rScale.AxisType = AxisType::DATE;
+ removeExplicitScaling( rScale );
+ }
+ if( rScale.AxisType == AxisType::DATE && (!pExplicitCategoriesProvider || !pExplicitCategoriesProvider->isDateAxis()) )
+ {
+ rScale.AxisType = AxisType::CATEGORY;
+ removeExplicitScaling( rScale );
+ }
+}
+
+sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
+ const Reference< chart2::XAxis >& xAxis
+ , const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
+ , const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
+ , bool bSearchForParallelAxisIfNothingIsFound )
+{
+ sal_Int32 nNumberFormatKey(0);
+ bool bNumberFormatKeyFoundViaAttachedData = false;
+ sal_Int32 nAxisIndex = 0;
+ sal_Int32 nDimensionIndex = 1;
+ AxisHelper::getIndicesForAxis( xAxis, xCorrespondingCoordinateSystem, nDimensionIndex, nAxisIndex );
+ Reference< chart2::XChartDocument > xChartDoc( xNumberFormatsSupplier, uno::UNO_QUERY );
+
+ Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
+ if( xProp.is() && !( xProp->getPropertyValue( C2U( "NumberFormat" ) ) >>= nNumberFormatKey ) )
+ {
+ bool bFormatSet = false;
+ //check wether we have a percent scale -> use percent format
+ if( xNumberFormatsSupplier.is() )
+ {
+ ScaleData aData = AxisHelper::getDateCheckedScale( xAxis, Reference< frame::XModel >( xNumberFormatsSupplier, uno::UNO_QUERY ) );
+ if( aData.AxisType==AxisType::PERCENT )
+ {
+ sal_Int32 nPercentFormat = DiagramHelper::getPercentNumberFormat( xNumberFormatsSupplier );
+ if( nPercentFormat != -1 )
+ {
+ nNumberFormatKey = nPercentFormat;
+ bFormatSet = true;
+ }
+ }
+ else if( aData.AxisType==AxisType::DATE )
+ {
+ if( aData.Categories.is() )
+ {
+ Reference< data::XDataSequence > xSeq( aData.Categories->getValues());
+ if( xSeq.is() && !( xChartDoc.is() && xChartDoc->hasInternalDataProvider()) )
+ nNumberFormatKey = xSeq->getNumberFormatKeyByIndex( -1 );
+ else
+ nNumberFormatKey = DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
+ bFormatSet = true;
+ }
+ }
+ else if( xChartDoc.is() && xChartDoc->hasInternalDataProvider() && nDimensionIndex == 0 ) //maybe date axis
+ {
+ Reference< chart2::XDiagram > xDiagram( xChartDoc->getFirstDiagram() );
+ if( DiagramHelper::isSupportingDateAxis( xDiagram ) )
+ {
+ nNumberFormatKey = DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
+ }
+ else
+ {
+ Reference< data::XDataSource > xSource( DataSourceHelper::getUsedData( xChartDoc ) );
+ if( xSource.is() )
+ {
+ ::std::vector< Reference< chart2::data::XLabeledDataSequence > > aXValues(
+ DataSeriesHelper::getAllDataSequencesByRole( xSource->getDataSequences(), C2U("values-x"), true ) );
+ if( aXValues.empty() )
+ {
+ Reference< data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
+ if( xCategories.is() )
+ {
+ Reference< data::XDataSequence > xSeq( xCategories->getValues());
+ if( xSeq.is() )
+ {
+ bool bHasValidDoubles = false;
+ double fTest=0.0;
+ Sequence< uno::Any > aCats( xSeq->getData() );
+ sal_Int32 nCount = aCats.getLength();
+ for( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ if( (aCats[i]>>=fTest) && !::rtl::math::isNan(fTest) )
+ {
+ bHasValidDoubles=true;
+ break;
+ }
+ }
+ if( bHasValidDoubles )
+ nNumberFormatKey = DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
+ }
+ }
+ }
+ }
+ }
+ bFormatSet = true;
+ }
+ }
+
+ if( !bFormatSet )
+ {
+ typedef ::std::map< sal_Int32, sal_Int32 > tNumberformatFrequency;
+ tNumberformatFrequency aKeyMap;
+
+ try
+ {
+ Reference< XChartTypeContainer > xCTCnt( xCorrespondingCoordinateSystem, uno::UNO_QUERY_THROW );
+ if( xCTCnt.is() )
+ {
+ ::rtl::OUString aRoleToMatch;
+ if( nDimensionIndex == 0 )
+ aRoleToMatch = C2U("values-x");
+ Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes());
+ for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
+ {
+ if( nDimensionIndex != 0 )
+ aRoleToMatch = ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( aChartTypes[nCTIdx] );
+ Reference< XDataSeriesContainer > xDSCnt( aChartTypes[nCTIdx], uno::UNO_QUERY_THROW );
+ Sequence< Reference< XDataSeries > > aDataSeriesSeq( xDSCnt->getDataSeries());
+ for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aDataSeriesSeq.getLength(); ++nSeriesIdx )
+ {
+ Reference< chart2::XDataSeries > xDataSeries(aDataSeriesSeq[nSeriesIdx]);
+ Reference< data::XDataSource > xSource( xDataSeries, uno::UNO_QUERY_THROW );
+
+ if( nDimensionIndex == 1 )
+ {
+ //only take those series into accoutn that are attached to this axis
+ sal_Int32 nAttachedAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries);
+ if( nAttachedAxisIndex != nAxisIndex )
+ continue;
+ }
+
+ Reference< data::XLabeledDataSequence > xLabeledSeq(
+ DataSeriesHelper::getDataSequenceByRole( xSource, aRoleToMatch ) );
+
+ if( !xLabeledSeq.is() && nDimensionIndex==0 )
+ {
+ ScaleData aData = xAxis->getScaleData();
+ xLabeledSeq = aData.Categories;
+ }
+
+ if( xLabeledSeq.is() )
+ {
+ Reference< data::XDataSequence > xSeq( xLabeledSeq->getValues());
+ if( xSeq.is() )
+ {
+ sal_Int32 nKey = xSeq->getNumberFormatKeyByIndex( -1 );
+ // initialize the value
+ if( aKeyMap.find( nKey ) == aKeyMap.end())
+ aKeyMap[ nKey ] = 0;
+ // increase frequency
+ aKeyMap[ nKey ] = (aKeyMap[ nKey ] + 1);
+ }
+ }
+ }
+ }
+ }
+ }
+ catch( const uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+
+ if( ! aKeyMap.empty())
+ {
+ sal_Int32 nMaxFreq = 0;
+ // find most frequent key
+ for( tNumberformatFrequency::const_iterator aIt = aKeyMap.begin();
+ aIt != aKeyMap.end(); ++aIt )
+ {
+ OSL_TRACE( "NumberFormatKey %d appears %d times", (*aIt).first, (*aIt).second );
+ // all values must at least be 1
+ if( (*aIt).second > nMaxFreq )
+ {
+ nNumberFormatKey = (*aIt).first;
+ bNumberFormatKeyFoundViaAttachedData = true;
+ nMaxFreq = (*aIt).second;
+ }
+ }
+ }
+
+ if( bSearchForParallelAxisIfNothingIsFound )
+ {
+ //no format is set to this axis and no data is set to this axis
+ //--> try to obtain the format from the parallel y-axis
+ if( !bNumberFormatKeyFoundViaAttachedData && nDimensionIndex == 1 )
+ {
+ sal_Int32 nParallelAxisIndex = (nAxisIndex==1) ?0 :1;
+ Reference< XAxis > xParallelAxis( AxisHelper::getAxis( 1, nParallelAxisIndex, xCorrespondingCoordinateSystem ) );
+ nNumberFormatKey = AxisHelper::getExplicitNumberFormatKeyForAxis( xParallelAxis, xCorrespondingCoordinateSystem, xNumberFormatsSupplier, false );
+ }
+ }
+ }
+ }
+ return nNumberFormatKey;
+}
+
Reference< XAxis > AxisHelper::createAxis(
sal_Int32 nDimensionIndex
, sal_Int32 nAxisIndex // 0==main or 1==secondary axis
@@ -132,6 +363,7 @@ Reference< XAxis > AxisHelper::createAxis(
ScaleData aMainScale = xMainAxis->getScaleData();
aScale.AxisType = aMainScale.AxisType;
+ aScale.AutoDateAxis = aMainScale.AutoDateAxis;
aScale.Categories = aMainScale.Categories;
aScale.Orientation = aMainScale.Orientation;
diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx
index aae087fce910..aae087fce910 100644..100755
--- a/chart2/source/tools/CharacterProperties.cxx
+++ b/chart2/source/tools/CharacterProperties.cxx
diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx
index 49c0885f79aa..49c0885f79aa 100644..100755
--- a/chart2/source/tools/ChartModelHelper.cxx
+++ b/chart2/source/tools/ChartModelHelper.cxx
diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx
index 70e70a26127a..c70da42322b1 100644..100755
--- a/chart2/source/tools/ChartTypeHelper.cxx
+++ b/chart2/source/tools/ChartTypeHelper.cxx
@@ -416,13 +416,34 @@ bool ChartTypeHelper::isSupportingAxisPositioning( const uno::Reference< chart2:
return true;
}
-bool ChartTypeHelper::shiftTicksAtXAxisPerDefault( const uno::Reference< chart2::XChartType >& xChartType )
+bool ChartTypeHelper::isSupportingDateAxis( const uno::Reference< chart2::XChartType >& xChartType, sal_Int32 /*nDimensionCount*/, sal_Int32 nDimensionIndex )
+{
+ if( nDimensionIndex!=0 )
+ return false;
+ if( xChartType.is() )
+ {
+ sal_Int32 nType = ChartTypeHelper::getAxisType( xChartType, nDimensionIndex );
+ if( nType != AxisType::CATEGORY )
+ return false;
+ rtl::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::shiftCategoryPosAtXAxisPerDefault( const uno::Reference< chart2::XChartType >& xChartType )
{
if(xChartType.is())
{
rtl::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_BAR)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
return true;
}
return false;
diff --git a/chart2/source/tools/ChartViewHelper.cxx b/chart2/source/tools/ChartViewHelper.cxx
index f64c0e7f7565..f64c0e7f7565 100644..100755
--- a/chart2/source/tools/ChartViewHelper.cxx
+++ b/chart2/source/tools/ChartViewHelper.cxx
diff --git a/chart2/source/tools/ColorPerPointHelper.cxx b/chart2/source/tools/ColorPerPointHelper.cxx
index 422475e9e53e..422475e9e53e 100644..100755
--- a/chart2/source/tools/ColorPerPointHelper.cxx
+++ b/chart2/source/tools/ColorPerPointHelper.cxx
diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx
index 989b86eedff4..f6a1e360f95d 100644..100755
--- a/chart2/source/tools/CommonConverters.cxx
+++ b/chart2/source/tools/CommonConverters.cxx
@@ -474,7 +474,6 @@ uno::Sequence< rtl::OUString > DataSequenceToStringSequence(
const uno::Reference< data::XDataSequence >& xDataSequence )
{
uno::Sequence< rtl::OUString > aResult;
- OSL_ASSERT( xDataSequence.is());
if(!xDataSequence.is())
return aResult;
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index 2e59f6d3f92d..04785deba33b 100644..100755
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -448,24 +448,8 @@ void DataSourceHelper::setRangeSegmentation(
if( !xDataSource.is() )
return;
- DiagramHelper::tTemplateWithServiceName aTemplateAndService =
- DiagramHelper::getTemplateForDiagram( xDiagram, xTemplateFactory );
-
- rtl::OUString aServiceName( aTemplateAndService.second );
- uno::Reference< chart2::XChartTypeTemplate > xTemplate = aTemplateAndService.first;
-
- if( !xTemplate.is() )
- {
- if( aServiceName.getLength() == 0 )
- aServiceName = C2U("com.sun.star.chart2.template.Column");
- xTemplate.set( xTemplateFactory->createInstance( aServiceName ), uno::UNO_QUERY );
- }
- if( !xTemplate.is() )
- return;
-
- // locked controllers
ControllerLockGuard aCtrlLockGuard( xChartModel );
- xTemplate->changeDiagramData( xDiagram, xDataSource, aArguments );
+ xDiagram->setDiagramData( xDataSource, aArguments );
}
Sequence< OUString > DataSourceHelper::getRangesFromLabeledDataSequence(
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 27ebb33e87d3..c50f87468e3f 100644..100755
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -43,10 +43,12 @@
#include "ChartModelHelper.hxx"
#include "RelativePositionHelper.hxx"
#include "ControllerLockGuard.hxx"
+#include "NumberFormatterWrapper.hxx"
#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart/XChartDocument.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>
@@ -58,10 +60,15 @@
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
+#include <com/sun/star/util/NumberFormat.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+
#include <unotools/saveopt.hxx>
#include <rtl/math.hxx>
-
-#include <com/sun/star/util/XModifiable.hpp>
+#include <svl/zformat.hxx>
+// header for class Application
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -69,7 +76,9 @@ using namespace ::std;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Any;
using ::rtl::OUString;
+using ::com::sun::star::chart2::XAnyDescriptionAccess;
namespace chart
{
@@ -865,7 +874,7 @@ bool DiagramHelper::isCategoryDiagram(
if( xAxis.is())
{
ScaleData aScaleData = xAxis->getScaleData();
- if( aScaleData.AxisType == AxisType::CATEGORY )
+ if( aScaleData.AxisType == AxisType::CATEGORY || aScaleData.AxisType == AxisType::DATE )
return true;
}
}
@@ -903,7 +912,7 @@ void DiagramHelper::setCategoriesToDiagram(
{
if( bCategoryAxis )
aScaleData.AxisType = AxisType::CATEGORY;
- else if( aScaleData.AxisType == AxisType::CATEGORY )
+ else if( aScaleData.AxisType == AxisType::CATEGORY || aScaleData.AxisType == AxisType::DATE )
aScaleData.AxisType = AxisType::REALNUMBER;
}
xCatAxis->setScaleData( aScaleData );
@@ -1019,6 +1028,203 @@ Sequence< rtl::OUString > DiagramHelper::getExplicitSimpleCategories(
return aRet;
}
+namespace
+{
+void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, const Reference< XAxis >& xAxis )
+{
+ if( !xAxis.is() )
+ return;
+ if( !xChartDoc.is() )
+ return;
+
+ ScaleData aScale( xAxis->getScaleData() );
+ if( xChartDoc->hasInternalDataProvider() )
+ {
+ //remove all content the is not of type double and remove multiple level
+ Reference< XAnyDescriptionAccess > xDataAccess( xChartDoc->getDataProvider(), uno::UNO_QUERY );
+ if( xDataAccess.is() )
+ {
+ Sequence< Sequence< Any > > aAnyCategories( xDataAccess->getAnyRowDescriptions() );
+ double fTest = 0.0;
+ double fNan = 0.0;
+ ::rtl::math::setNan( & fNan );
+ sal_Int32 nN = aAnyCategories.getLength();
+ for( ; nN--; )
+ {
+ Sequence< Any >& rCat = aAnyCategories[nN];
+ if( rCat.getLength() > 1 )
+ rCat.realloc(1);
+ if( rCat.getLength() == 1 )
+ {
+ Any& rAny = rCat[0];
+ if( !(rAny>>=fTest) )
+ {
+ rAny = uno::makeAny(fNan);
+ }
+ }
+ }
+ xDataAccess->setAnyRowDescriptions( aAnyCategories );
+ }
+ //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() )
+ {
+ sal_Int32 nNumberFormat = -1;
+ xAxisProps->getPropertyValue( C2U("NumberFormat") ) >>= nNumberFormat;
+
+ Reference< util::XNumberFormats > xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() );
+ if( xNumberFormats.is() )
+ {
+ Reference< beans::XPropertySet > xKeyProps;
+ try
+ {
+ xKeyProps = xNumberFormats->getByKey( nNumberFormat );
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+ sal_Int32 nType = util::NumberFormat::UNDEFINED;
+ if( xKeyProps.is() )
+ xKeyProps->getPropertyValue( C2U("Type") ) >>= nType;
+ if( !( nType & util::NumberFormat::DATE ) )
+ {
+ //set a date format to the axis
+ sal_Bool bCreate = sal_True;
+ const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
+ Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE, rLocaleDataWrapper.getLocale(), bCreate );
+ if( aKeySeq.getLength() )
+ {
+ xAxisProps->setPropertyValue( C2U("NumberFormat"), uno::makeAny(aKeySeq[0]) );
+ }
+ }
+ }
+ }
+ }
+ if( aScale.AxisType != chart2::AxisType::DATE )
+ AxisHelper::removeExplicitScaling( aScale );
+ aScale.AxisType = chart2::AxisType::DATE;
+ xAxis->setScaleData( aScale );
+}
+
+void lcl_switchToTextCategories( const Reference< XChartDocument >& xChartDoc, const Reference< XAxis >& xAxis )
+{
+ if( !xAxis.is() )
+ return;
+ if( !xChartDoc.is() )
+ return;
+ ScaleData aScale( xAxis->getScaleData() );
+ if( aScale.AxisType != chart2::AxisType::CATEGORY )
+ AxisHelper::removeExplicitScaling( aScale );
+ //todo migrate dates to text?
+ aScale.AxisType = chart2::AxisType::CATEGORY;
+ aScale.AutoDateAxis = false;
+ xAxis->setScaleData( aScale );
+}
+
+}
+
+void DiagramHelper::switchToDateCategories( const Reference< XChartDocument >& xChartDoc )
+{
+ Reference< frame::XModel > xChartModel( xChartDoc, uno::UNO_QUERY );
+ if(xChartModel.is())
+ {
+ ControllerLockGuard aCtrlLockGuard( xChartModel );
+
+ Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartModel ) );
+ if( xCooSys.is() )
+ {
+ Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,0) );
+ lcl_switchToDateCategories( xChartDoc, xAxis );
+ }
+ }
+}
+
+void DiagramHelper::switchToTextCategories( const Reference< XChartDocument >& xChartDoc )
+{
+ Reference< frame::XModel > xChartModel( xChartDoc, uno::UNO_QUERY );
+ if(xChartModel.is())
+ {
+ ControllerLockGuard aCtrlLockGuard( xChartModel );
+
+ Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartModel ) );
+ if( xCooSys.is() )
+ {
+ Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,0) );
+ lcl_switchToTextCategories( xChartDoc, xAxis );
+ }
+ }
+}
+
+bool DiagramHelper::isSupportingDateAxis( const Reference< chart2::XDiagram >& xDiagram )
+{
+ return ::chart::ChartTypeHelper::isSupportingDateAxis(
+ DiagramHelper::getChartTypeByIndex( xDiagram, 0 ), DiagramHelper::getDimension( xDiagram ), 0 );
+}
+
+bool DiagramHelper::isDateNumberFormat( sal_Int32 nNumberFormat, const Reference< util::XNumberFormats >& xNumberFormats )
+{
+ bool bIsDate = false;
+ if( !xNumberFormats.is() )
+ return bIsDate;
+
+ Reference< beans::XPropertySet > xKeyProps = xNumberFormats->getByKey( nNumberFormat );
+ if( xKeyProps.is() )
+ {
+ sal_Int32 nType = util::NumberFormat::UNDEFINED;
+ xKeyProps->getPropertyValue( C2U("Type") ) >>= nType;
+ bIsDate = nType & util::NumberFormat::DATE;
+ }
+ return bIsDate;
+}
+
+sal_Int32 DiagramHelper::getDateNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
+{
+ sal_Int32 nRet=-1;
+ Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
+ if( xNumberFormats.is() )
+ {
+ sal_Bool bCreate = sal_True;
+ const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
+ Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE,
+ rLocaleDataWrapper.getLocale(), bCreate );
+ if( aKeySeq.getLength() )
+ {
+ nRet = aKeySeq[0];
+ }
+ }
+
+ //try to get a date format with full year display
+ NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
+ SvNumberFormatter* pNumFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
+ if( pNumFormatter )
+ {
+ const SvNumberformat* pFormat = pNumFormatter->GetEntry( nRet );
+ if( pFormat )
+ nRet = pNumFormatter->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, pFormat->GetLanguage() );
+ }
+ return nRet;
+}
+
+sal_Int32 DiagramHelper::getPercentNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
+{
+ sal_Int32 nRet=-1;
+ Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
+ if( xNumberFormats.is() )
+ {
+ sal_Bool bCreate = sal_True;
+ const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
+ Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::PERCENT,
+ rLocaleDataWrapper.getLocale(), bCreate );
+ if( aKeySeq.getLength() )
+ {
+ nRet = aKeySeq[0];
+ }
+ }
+ return nRet;
+}
+
Sequence< Reference< XChartType > >
DiagramHelper::getChartTypesFromDiagram(
const Reference< XDiagram > & xDiagram )
@@ -1487,8 +1693,8 @@ awt::Rectangle DiagramHelper::getDiagramRectangleFromModel( const uno::Reference
xDiaProps->getPropertyValue(C2U("RelativeSize") ) >>= aRelSize;
awt::Size aAbsSize(
- aRelSize.Primary * aPageSize.Width,
- aRelSize.Secondary * aPageSize.Height );
+ static_cast< sal_Int32 >( aRelSize.Primary * aPageSize.Width ),
+ static_cast< sal_Int32 >( aRelSize.Secondary * aPageSize.Height ));
awt::Point aAbsPos(
static_cast< sal_Int32 >( aRelPos.Primary * aPageSize.Width ),
diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx
index 49041d182f35..4c30cd1d169d 100644..100755
--- a/chart2/source/tools/ErrorBar.cxx
+++ b/chart2/source/tools/ErrorBar.cxx
@@ -108,48 +108,72 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticErrorBarDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_STYLE, ::com::sun::star::chart::ErrorBarStyle::NONE );
- ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_POS_ERROR, 0.0 );
- ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_NEG_ERROR, 0.0 );
- ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_WEIGHT, 1.0 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_SHOW_POS_ERROR, true );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_SHOW_NEG_ERROR, true );
-}
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_STYLE, ::com::sun::star::chart::ErrorBarStyle::NONE );
+ ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_POS_ERROR, 0.0 );
+ ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_NEG_ERROR, 0.0 );
+ ::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_ERROR_BAR_WEIGHT, 1.0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_SHOW_POS_ERROR, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_ERROR_BAR_SHOW_NEG_ERROR, true );
+ }
+};
+
+struct StaticErrorBarDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticErrorBarDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticErrorBarInfoHelper_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticErrorBarInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticErrorBarInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticErrorBarInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticErrorBarInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticErrorBarInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticErrorBarInfo_Initializer >
+{
+};
bool lcl_isInternalData( const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq )
{
@@ -208,46 +232,23 @@ uno::Reference< util::XCloneable > SAL_CALL ErrorBar::createClone()
uno::Any ErrorBar::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- lcl_AddDefaultsToMap( aStaticDefaults );
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticErrorBarDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL ErrorBar::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticErrorBarInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- ErrorBar::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL ErrorBar::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticErrorBarInfo::get();
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index e401201362ac..69cbdb0b2d06 100644..100755
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -31,11 +31,18 @@
#include "ExplicitCategoriesProvider.hxx"
#include "DiagramHelper.hxx"
+#include "ChartTypeHelper.hxx"
+#include "AxisHelper.hxx"
#include "CommonConverters.hxx"
#include "DataSourceHelper.hxx"
#include "ChartModelHelper.hxx"
#include "ContainerHelper.hxx"
#include "macros.hxx"
+#include "NumberFormatterWrapper.hxx"
+
+#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/util/NumberFormat.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
//.............................................................................
namespace chart
@@ -54,7 +61,11 @@ ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2:
, const uno::Reference< frame::XModel >& xChartModel )
: m_bDirty(true)
, m_xCooSysModel( xCooSysModel )
+ , m_xChartModel( xChartModel )
, m_xOriginalCategories()
+ , m_bIsExplicitCategoriesInited(false)
+ , m_bIsDateAxis(false)
+ , m_bIsAutoDate(false)
{
try
{
@@ -62,7 +73,12 @@ ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2:
{
uno::Reference< XAxis > xAxis( xCooSysModel->getAxisByDimension(0,0) );
if( xAxis.is() )
- m_xOriginalCategories = xAxis->getScaleData().Categories;
+ {
+ ScaleData aScale( xAxis->getScaleData() );
+ m_xOriginalCategories = aScale.Categories;
+ m_bIsAutoDate = (aScale.AutoDateAxis && aScale.AxisType==chart2::AxisType::CATEGORY);
+ m_bIsDateAxis = (aScale.AxisType == chart2::AxisType::DATE || m_bIsAutoDate);
+ }
}
if( m_xOriginalCategories.is() )
@@ -72,9 +88,9 @@ ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2:
{
uno::Reference< data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() );
- if( xDataProvider.is() )
+ OUString aCatgoriesRange( DataSourceHelper::getRangeFromValues( m_xOriginalCategories ) );
+ if( xDataProvider.is() && aCatgoriesRange.getLength() )
{
- OUString aCatgoriesRange( DataSourceHelper::getRangeFromValues( m_xOriginalCategories ) );
const bool bFirstCellAsLabel = false;
const bool bHasCategories = false;
const uno::Sequence< sal_Int32 > aSequenceMapping;
@@ -135,6 +151,13 @@ ExplicitCategoriesProvider::~ExplicitCategoriesProvider()
{
}
+Reference< chart2::data::XDataSequence > ExplicitCategoriesProvider::getOriginalCategories()
+{
+ if( m_xOriginalCategories.is() )
+ return m_xOriginalCategories->getValues();
+ return 0;
+}
+
const Sequence< Reference< data::XLabeledDataSequence> >& ExplicitCategoriesProvider::getSplitCategoriesList()
{
return m_aSplitCategoriesList;
@@ -168,30 +191,51 @@ std::vector<sal_Int32> lcl_getLimitingBorders( const std::vector< ComplexCategor
return aLimitingBorders;
}
-uno::Sequence< rtl::OUString > lcl_DataToStringSequence( const uno::Reference< data::XDataSequence >& xDataSequence )
+void ExplicitCategoriesProvider::convertCategoryAnysToText( uno::Sequence< rtl::OUString >& rOutTexts, const uno::Sequence< uno::Any >& rInAnys, Reference< frame::XModel > xChartModel )
{
- uno::Sequence< rtl::OUString > aStrings;
+ sal_Int32 nCount = rInAnys.getLength();
+ if(!nCount)
+ return;
+ rOutTexts.realloc(nCount);
+ Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartModel, uno::UNO_QUERY );
+ Reference< util::XNumberFormats > xNumberFormats;
+ if( xNumberFormatsSupplier.is() )
+ xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() );
+
+ sal_Int32 nAxisNumberFormat = 0;
+ Reference< XCoordinateSystem > xCooSysModel( ChartModelHelper::getFirstCoordinateSystem( xChartModel ) );
+ if( xCooSysModel.is() )
+ {
+ Reference< chart2::XAxis > xAxis( xCooSysModel->getAxisByDimension(0,0) );
+ nAxisNumberFormat = AxisHelper::getExplicitNumberFormatKeyForAxis(
+ xAxis, xCooSysModel, xNumberFormatsSupplier, false );
+ }
- OSL_ASSERT( xDataSequence.is());
- if( !xDataSequence.is() )
- return aStrings;
+ sal_Int32 nLabelColor;
+ bool bColorChanged = false;
+ NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
- uno::Reference< data::XTextualDataSequence > xTextualDataSequence( xDataSequence, uno::UNO_QUERY );
- if( xTextualDataSequence.is() )
+ for(sal_Int32 nN=0;nN<nCount;nN++)
{
- aStrings = xTextualDataSequence->getTextualData();
- }
- else
- {
- uno::Sequence< uno::Any > aValues = xDataSequence->getData();
- aStrings.realloc(aValues.getLength());
-
- for(sal_Int32 nN=aValues.getLength();nN--;)
- aValues[nN] >>= aStrings[nN];
+ rtl::OUString aText;
+ uno::Any aAny = rInAnys[nN];
+ if( aAny.hasValue() )
+ {
+ double fDouble = 0;
+ if( aAny>>=fDouble )
+ {
+ if( !::rtl::math::isNan(fDouble) )
+ aText = aNumberFormatterWrapper.getFormattedString(
+ nAxisNumberFormat, fDouble, nLabelColor, bColorChanged );
+ }
+ else
+ {
+ aAny>>=aText;
+ }
+ }
+ rOutTexts[nN] = aText;
}
-
- return aStrings;
}
SplitCategoriesProvider::~SplitCategoriesProvider()
@@ -202,9 +246,13 @@ class SplitCategoriesProvider_ForLabeledDataSequences : public SplitCategoriesPr
{
public:
- explicit SplitCategoriesProvider_ForLabeledDataSequences( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::data::XLabeledDataSequence> >& rSplitCategoriesList )
+ explicit SplitCategoriesProvider_ForLabeledDataSequences(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XLabeledDataSequence> >& rSplitCategoriesList
+ , const Reference< frame::XModel >& xChartModel )
: m_rSplitCategoriesList( rSplitCategoriesList )
+ , m_xChartModel( xChartModel )
{}
virtual ~SplitCategoriesProvider_ForLabeledDataSequences()
{}
@@ -215,6 +263,8 @@ public:
private:
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence> >& m_rSplitCategoriesList;
+
+ Reference< frame::XModel > m_xChartModel;
};
sal_Int32 SplitCategoriesProvider_ForLabeledDataSequences::getLevelCount() const
@@ -226,7 +276,11 @@ uno::Sequence< rtl::OUString > SplitCategoriesProvider_ForLabeledDataSequences::
uno::Sequence< rtl::OUString > aRet;
Reference< data::XLabeledDataSequence > xLabeledDataSequence( m_rSplitCategoriesList[nLevel] );
if( xLabeledDataSequence.is() )
- aRet = lcl_DataToStringSequence( xLabeledDataSequence->getValues() );
+ {
+ uno::Reference< data::XDataSequence > xDataSequence( xLabeledDataSequence->getValues() );
+ if( xDataSequence.is() )
+ ExplicitCategoriesProvider::convertCategoryAnysToText( aRet, xDataSequence->getData(), m_xChartModel );
+ }
return aRet;
}
@@ -363,23 +417,120 @@ Sequence< OUString > ExplicitCategoriesProvider::getExplicitSimpleCategories(
return lcl_getExplicitSimpleCategories( rSplitCategoriesProvider, aComplexCats );
}
+struct DatePlusIndexComparator
+{
+ inline bool operator() ( const DatePlusIndex& aFirst,
+ const DatePlusIndex& aSecond )
+ {
+ return ( aFirst.fValue < aSecond.fValue );
+ }
+};
+
+bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >& xDataSequence, std::vector< DatePlusIndex >& rDateCategories, bool bIsAutoDate, Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier )
+{
+ bool bOnlyDatesFound = true;
+ bool bAnyDataFound = false;
+
+ if( xDataSequence.is() )
+ {
+ uno::Sequence< uno::Any > aValues = xDataSequence->getData();
+ sal_Int32 nCount = aValues.getLength();
+ rDateCategories.reserve(nCount);
+ Reference< util::XNumberFormats > xNumberFormats;
+ if( xNumberFormatsSupplier.is() )
+ xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() );
+
+ bool bOwnData = false;
+ bool bOwnDataAnddAxisHasAnyFormat = false;
+ bool bOwnDataAnddAxisHasDateFormat = false;
+ Reference< chart2::XChartDocument > xChartDoc( xNumberFormatsSupplier, uno::UNO_QUERY );
+ Reference< XCoordinateSystem > xCooSysModel( ChartModelHelper::getFirstCoordinateSystem( Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ) ) );
+ if( xChartDoc.is() && xCooSysModel.is() )
+ {
+ if( xChartDoc->hasInternalDataProvider() )
+ {
+ bOwnData = true;
+ Reference< beans::XPropertySet > xAxisProps( xCooSysModel->getAxisByDimension(0,0), uno::UNO_QUERY );
+ sal_Int32 nAxisNumberFormat = 0;
+ if( xAxisProps.is() && (xAxisProps->getPropertyValue( C2U("NumberFormat") ) >>= nAxisNumberFormat) )
+ {
+ bOwnDataAnddAxisHasAnyFormat = true;
+ bOwnDataAnddAxisHasDateFormat = DiagramHelper::isDateNumberFormat( nAxisNumberFormat, xNumberFormats );
+ }
+ }
+ }
+
+ for(sal_Int32 nN=0;nN<nCount;nN++)
+ {
+ bool bIsDate = false;
+ if( bIsAutoDate )
+ {
+ if( bOwnData )
+ bIsDate = bOwnDataAnddAxisHasAnyFormat ? bOwnDataAnddAxisHasDateFormat : true;
+ else
+ bIsDate = DiagramHelper::isDateNumberFormat( xDataSequence->getNumberFormatKeyByIndex( nN ), xNumberFormats );
+ }
+ else
+ bIsDate = true;
+
+ bool bContainsEmptyString = false;
+ bool bContainsNan = false;
+ uno::Any aAny = aValues[nN];
+ if( aAny.hasValue() )
+ {
+ OUString aTest;
+ double fTest = 0;
+ if( (aAny>>=aTest) && !aTest.getLength() ) //empty String
+ bContainsEmptyString = true;
+ else if( (aAny>>=fTest) && ::rtl::math::isNan(fTest) )
+ bContainsNan = true;
+
+ if( !bContainsEmptyString && !bContainsNan )
+ bAnyDataFound = true;
+ }
+ DatePlusIndex aDatePlusIndex( 1.0, nN );
+ if( bIsDate && (aAny >>= aDatePlusIndex.fValue) )
+ rDateCategories.push_back( aDatePlusIndex );
+ else
+ {
+ if( aAny.hasValue() && !bContainsEmptyString )//empty string does not count as non date value!
+ bOnlyDatesFound=false;
+ ::rtl::math::setNan( &aDatePlusIndex.fValue );
+ rDateCategories.push_back( aDatePlusIndex );
+ }
+ }
+ ::std::sort( rDateCategories.begin(), rDateCategories.end(), DatePlusIndexComparator() );
+ }
+
+ return bAnyDataFound && bOnlyDatesFound;
+}
+
void ExplicitCategoriesProvider::init()
{
if( m_bDirty )
{
- m_aExplicitCategories.realloc(0);
m_aComplexCats.clear();//not one per index
+ m_aDateCategories.clear();
if( m_xOriginalCategories.is() )
{
if( !hasComplexCategories() )
- m_aExplicitCategories = DataSequenceToStringSequence(m_xOriginalCategories->getValues());
+ {
+ if(m_bIsDateAxis)
+ {
+ if( ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( m_xCooSysModel, 0 ), 2, 0 ) )
+ m_bIsDateAxis = lcl_fillDateCategories( m_xOriginalCategories->getValues(), m_aDateCategories, m_bIsAutoDate, Reference< util::XNumberFormatsSupplier >( m_xChartModel.get(), uno::UNO_QUERY ) );
+ else
+ m_bIsDateAxis = false;
+ }
+ }
else
- m_aExplicitCategories = lcl_getExplicitSimpleCategories(
- SplitCategoriesProvider_ForLabeledDataSequences( m_aSplitCategoriesList ), m_aComplexCats );
+ {
+ m_bIsDateAxis = false;
+ }
}
- if(!m_aExplicitCategories.getLength())
- m_aExplicitCategories = DiagramHelper::generateAutomaticCategoriesFromCooSys( m_xCooSysModel );
+ else
+ m_bIsDateAxis=false;
m_bDirty = false;
}
}
@@ -387,7 +538,28 @@ void ExplicitCategoriesProvider::init()
Sequence< ::rtl::OUString > ExplicitCategoriesProvider::getSimpleCategories()
{
- init();
+ if( !m_bIsExplicitCategoriesInited )
+ {
+ init();
+ m_aExplicitCategories.realloc(0);
+ if( m_xOriginalCategories.is() )
+ {
+ if( !hasComplexCategories() )
+ {
+ uno::Reference< data::XDataSequence > xDataSequence( m_xOriginalCategories->getValues() );
+ if( xDataSequence.is() )
+ ExplicitCategoriesProvider::convertCategoryAnysToText( m_aExplicitCategories, xDataSequence->getData(), m_xChartModel );
+ }
+ else
+ {
+ m_aExplicitCategories = lcl_getExplicitSimpleCategories(
+ SplitCategoriesProvider_ForLabeledDataSequences( m_aSplitCategoriesList, m_xChartModel ), m_aComplexCats );
+ }
+ }
+ if(!m_aExplicitCategories.getLength())
+ m_aExplicitCategories = DiagramHelper::generateAutomaticCategoriesFromCooSys( m_xCooSysModel );
+ m_bIsExplicitCategoriesInited = true;
+ }
return m_aExplicitCategories;
}
@@ -416,6 +588,18 @@ OUString ExplicitCategoriesProvider::getCategoryByIndex(
return OUString();
}
+bool ExplicitCategoriesProvider::isDateAxis()
+{
+ init();
+ return m_bIsDateAxis;
+}
+
+const std::vector< DatePlusIndex >& ExplicitCategoriesProvider::getDateCategories()
+{
+ init();
+ return m_aDateCategories;
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/tools/FillProperties.cxx b/chart2/source/tools/FillProperties.cxx
index 5cc2fbc01580..5cc2fbc01580 100644..100755
--- a/chart2/source/tools/FillProperties.cxx
+++ b/chart2/source/tools/FillProperties.cxx
diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index 51d2d4cb0812..a272cee7bdd4 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -40,6 +40,7 @@
using ::com::sun::star::uno::Sequence;
using ::rtl::OUString;
+using namespace ::com::sun::star;
using namespace ::std;
namespace chart
@@ -57,10 +58,10 @@ struct lcl_NumberedStringGenerator
m_nWildcardLength( rWildcard.getLength())
{
}
- vector< OUString > operator()()
+ vector< uno::Any > operator()()
{
- vector< OUString > aRet(1);
- aRet[0] = m_aStub.replaceAt( m_nStubStartIndex, m_nWildcardLength, OUString::valueOf( ++m_nCounter ));
+ vector< uno::Any > aRet(1);
+ aRet[0] = uno::makeAny( m_aStub.replaceAt( m_nStubStartIndex, m_nWildcardLength, OUString::valueOf( ++m_nCounter )) );
return aRet;
}
private:
@@ -116,12 +117,12 @@ void InternalData::createDefaultData()
m_aRowLabels.clear();
m_aRowLabels.reserve( m_nRowCount );
generate_n( back_inserter( m_aRowLabels ), m_nRowCount,
- lcl_NumberedStringGenerator( aRowName, C2U("%ROWNUMBER") ));
+ lcl_NumberedStringGenerator( aRowName, C2U("%ROWNUMBER") ));
m_aColumnLabels.clear();
m_aColumnLabels.reserve( m_nColumnCount );
generate_n( back_inserter( m_aColumnLabels ), m_nColumnCount,
- lcl_NumberedStringGenerator( aColName, C2U("%COLUMNNUMBER") ));
+ lcl_NumberedStringGenerator( aColName, C2U("%COLUMNNUMBER") ));
}
bool InternalData::isDefaultData()
@@ -227,7 +228,7 @@ void InternalData::setRowValues( sal_Int32 nRowIndex, const vector< double > & r
m_aData[ ::std::slice( nRowIndex*m_nColumnCount, m_nColumnCount, 1 ) ]= aSlice;
}
-void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, const vector< OUString >& rComplexLabel )
+void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, const vector< uno::Any >& rComplexLabel )
{
if( nColumnIndex < 0 )
return;
@@ -236,10 +237,10 @@ void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, const vector<
m_aColumnLabels.resize(nColumnIndex+1);
enlargeData( nColumnIndex+1, 0 );
}
-
m_aColumnLabels[nColumnIndex]=rComplexLabel;
}
-void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, const vector< OUString >& rComplexLabel )
+
+void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, const vector< uno::Any >& rComplexLabel )
{
if( nRowIndex < 0 )
return;
@@ -248,23 +249,22 @@ void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, const vector< OUStri
m_aRowLabels.resize(nRowIndex+1);
enlargeData( 0, nRowIndex+1 );
}
-
m_aRowLabels[nRowIndex] = rComplexLabel;
}
-vector< OUString > InternalData::getComplexColumnLabel( sal_Int32 nColumnIndex ) const
+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< OUString >();
+ return vector< uno::Any >();
}
-vector< OUString > InternalData::getComplexRowLabel( sal_Int32 nRowIndex ) const
+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< OUString >();
+ return vector< uno::Any >();
}
void InternalData::swapRowWithNext( sal_Int32 nRowIndex )
@@ -281,7 +281,7 @@ void InternalData::swapRowWithNext( sal_Int32 nRowIndex )
m_aData[nIndex2] = fTemp;
}
- vector< OUString > aTemp( m_aRowLabels[nRowIndex] );
+ vector< uno::Any > aTemp( m_aRowLabels[nRowIndex] );
m_aRowLabels[nRowIndex] = m_aRowLabels[nRowIndex + 1];
m_aRowLabels[nRowIndex + 1] = aTemp;
}
@@ -301,7 +301,7 @@ void InternalData::swapColumnWithNext( sal_Int32 nColumnIndex )
m_aData[nIndex2] = fTemp;
}
- vector< OUString > aTemp( m_aColumnLabels[nColumnIndex] );
+ vector< uno::Any > aTemp( m_aColumnLabels[nColumnIndex] );
m_aColumnLabels[nColumnIndex] = m_aColumnLabels[nColumnIndex + 1];
m_aColumnLabels[nColumnIndex + 1] = aTemp;
}
@@ -364,7 +364,7 @@ void InternalData::insertColumn( sal_Int32 nAfterIndex )
// labels
if( nAfterIndex < static_cast< sal_Int32 >( m_aColumnLabels.size()))
- m_aColumnLabels.insert( m_aColumnLabels.begin() + (nAfterIndex + 1), vector< OUString >(1) );
+ m_aColumnLabels.insert( m_aColumnLabels.begin() + (nAfterIndex + 1), vector< uno::Any >(1) );
#if OSL_DEBUG_LEVEL > 1
traceData();
@@ -416,7 +416,7 @@ void InternalData::insertRow( sal_Int32 nAfterIndex )
// labels
if( nAfterIndex < static_cast< sal_Int32 >( m_aRowLabels.size()))
- m_aRowLabels.insert( m_aRowLabels.begin() + nIndex, vector< OUString> (1));
+ m_aRowLabels.insert( m_aRowLabels.begin() + nIndex, vector< uno::Any > (1));
#if OSL_DEBUG_LEVEL > 1
traceData();
@@ -509,7 +509,7 @@ sal_Int32 InternalData::getColumnCount() const
return m_nColumnCount;
}
-void InternalData::setComplexRowLabels( const vector< vector< OUString > >& rNewRowLabels )
+void InternalData::setComplexRowLabels( const vector< vector< uno::Any > >& rNewRowLabels )
{
m_aRowLabels = rNewRowLabels;
sal_Int32 nNewRowCount = static_cast< sal_Int32 >( m_aRowLabels.size() );
@@ -519,12 +519,12 @@ void InternalData::setComplexRowLabels( const vector< vector< OUString > >& rNew
enlargeData( 0, nNewRowCount );
}
-vector< vector< OUString > > InternalData::getComplexRowLabels() const
+vector< vector< uno::Any > > InternalData::getComplexRowLabels() const
{
return m_aRowLabels;
}
-void InternalData::setComplexColumnLabels( const vector< vector< OUString > >& rNewColumnLabels )
+void InternalData::setComplexColumnLabels( const vector< vector< uno::Any > >& rNewColumnLabels )
{
m_aColumnLabels = rNewColumnLabels;
sal_Int32 nNewColumnCount = static_cast< sal_Int32 >( m_aColumnLabels.size() );
@@ -534,7 +534,7 @@ void InternalData::setComplexColumnLabels( const vector< vector< OUString > >& r
enlargeData( nNewColumnCount, 0 );
}
-vector< vector< OUString > > InternalData::getComplexColumnLabels() const
+vector< vector< uno::Any > > InternalData::getComplexColumnLabels() const
{
return m_aColumnLabels;
}
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index ab1a5bfe4ff6..b088a62df884 100644..100755
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -94,6 +94,24 @@ static const ::rtl::OUString lcl_aCompleteRange(
typedef ::std::multimap< OUString, uno::WeakReference< chart2::data::XDataSequence > >
lcl_tSequenceMap;
+Sequence< OUString > lcl_AnyToStringSequence( const Sequence< uno::Any >& aAnySeq )
+{
+ Sequence< OUString > aResult;
+ aResult.realloc( aAnySeq.getLength() );
+ transform( aAnySeq.getConstArray(), aAnySeq.getConstArray() + aAnySeq.getLength(),
+ aResult.getArray(), CommonFunctors::AnyToString() );
+ return aResult;
+}
+
+Sequence< uno::Any > lcl_StringToAnySequence( const Sequence< OUString >& aStringSeq )
+{
+ Sequence< uno::Any > aResult;
+ aResult.realloc( aStringSeq.getLength() );
+ transform( aStringSeq.getConstArray(), aStringSeq.getConstArray() + aStringSeq.getLength(),
+ aResult.getArray(), CommonFunctors::makeAny< OUString >() );
+ return aResult;
+}
+
struct lcl_setModified : public ::std::unary_function< lcl_tSequenceMap, void >
{
void operator() ( const lcl_tSequenceMap::value_type & rMapEntry )
@@ -155,9 +173,9 @@ struct lcl_internalizeSeries : public ::std::unary_function< Reference< chart2::
if( xLabel.is() )
{
if( m_bDataInColumns )
- m_rInternalData.setComplexColumnLabel( nNewIndex, ContainerHelper::SequenceToVector( xLabel->getTextualData() ) );
+ m_rInternalData.setComplexColumnLabel( nNewIndex, ContainerHelper::SequenceToVector( lcl_StringToAnySequence( xLabel->getTextualData() ) ) );
else
- m_rInternalData.setComplexRowLabel( nNewIndex, ContainerHelper::SequenceToVector( xLabel->getTextualData() ) );
+ m_rInternalData.setComplexRowLabel( nNewIndex, ContainerHelper::SequenceToVector( lcl_StringToAnySequence( xLabel->getTextualData() ) ) );
if( m_bConnectToModel )
{
Reference< chart2::data::XDataSequence > xNewLabel(
@@ -188,37 +206,37 @@ private:
bool m_bDataInColumns;
};
-struct lcl_makeAnyFromLevelVector : public ::std::unary_function< vector< OUString >, uno::Any >
+struct lcl_copyFromLevel : public ::std::unary_function< vector< uno::Any >, uno::Any >
{
public:
- explicit lcl_makeAnyFromLevelVector( sal_Int32 nLevel ) : m_nLevel( nLevel )
+ explicit lcl_copyFromLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- uno::Any operator() ( const vector< OUString >& rVector )
+ uno::Any operator() ( const vector< uno::Any >& rVector )
{
- OUString aString;
+ uno::Any aRet;
if( m_nLevel < static_cast< sal_Int32 >(rVector.size()) )
- aString = rVector[m_nLevel];
- return uno::makeAny( aString );
+ aRet = rVector[m_nLevel];
+ return aRet;
}
private:
sal_Int32 m_nLevel;
};
-struct lcl_getStringFromLevelVector : public ::std::unary_function< vector< OUString >, OUString >
+struct lcl_getStringFromLevelVector : public ::std::unary_function< vector< uno::Any >, OUString >
{
public:
explicit lcl_getStringFromLevelVector( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- OUString operator() ( const vector< OUString >& rVector )
+ OUString operator() ( const vector< uno::Any >& rVector )
{
OUString aString;
if( m_nLevel < static_cast< sal_Int32 >(rVector.size()) )
- aString = rVector[m_nLevel];
+ aString = CommonFunctors::AnyToString()(rVector[m_nLevel]);
return aString;
}
@@ -227,19 +245,39 @@ private:
};
-struct lcl_setStringAtLevel : public ::std::binary_function< vector< OUString >, OUString, vector< OUString > >
+struct lcl_setAnyAtLevel : public ::std::binary_function< vector< uno::Any >, uno::Any, vector< uno::Any > >
+{
+public:
+
+ explicit lcl_setAnyAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
+ {}
+
+ vector< uno::Any > operator() ( const vector< uno::Any >& rVector, const uno::Any& rNewValue )
+ {
+ vector< uno::Any > aRet( rVector );
+ if( m_nLevel >= static_cast< sal_Int32 >(aRet.size()) )
+ aRet.resize( m_nLevel+1 );
+ aRet[ m_nLevel ]=rNewValue;
+ return aRet;
+ }
+
+private:
+ sal_Int32 m_nLevel;
+};
+
+struct lcl_setAnyAtLevelFromStringSequence : public ::std::binary_function< vector< uno::Any >, OUString, vector< uno::Any > >
{
public:
- explicit lcl_setStringAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
+ explicit lcl_setAnyAtLevelFromStringSequence( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- vector< OUString > operator() ( const vector< OUString >& rVector, const OUString& rNewText )
+ vector< uno::Any > operator() ( const vector< uno::Any >& rVector, const OUString& rNewValue )
{
- vector< OUString > aRet( rVector );
+ vector< uno::Any > aRet( rVector );
if( m_nLevel >= static_cast< sal_Int32 >(aRet.size()) )
aRet.resize( m_nLevel+1 );
- aRet[ m_nLevel ]=rNewText;
+ aRet[ m_nLevel ]=uno::makeAny(rNewValue);
return aRet;
}
@@ -247,42 +285,42 @@ private:
sal_Int32 m_nLevel;
};
-struct lcl_insertStringAtLevel : public ::std::unary_function< vector< OUString >, void >
+struct lcl_insertAnyAtLevel : public ::std::unary_function< vector< uno::Any >, void >
{
public:
- explicit lcl_insertStringAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
+ explicit lcl_insertAnyAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- void operator() ( vector< OUString >& rVector )
+ void operator() ( vector< uno::Any >& rVector )
{
if( m_nLevel > static_cast< sal_Int32 >(rVector.size()) )
rVector.resize( m_nLevel );
- vector< OUString >::iterator aIt( rVector.begin() );
- for( sal_Int32 nN=0; aIt<rVector.end(); ++aIt, ++nN)
+ vector< uno::Any >::iterator aIt( rVector.begin() );
+ for( sal_Int32 nN=0; aIt<rVector.end(); aIt++, nN++)
{
if( nN==m_nLevel )
break;
}
- rVector.insert( aIt, OUString() );
+ rVector.insert( aIt, uno::Any() );
}
private:
sal_Int32 m_nLevel;
};
-struct lcl_removeStringAtLevel : public ::std::unary_function< vector< OUString >, void >
+struct lcl_removeAnyAtLevel : public ::std::unary_function< vector< uno::Any >, void >
{
public:
- explicit lcl_removeStringAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
+ explicit lcl_removeAnyAtLevel( sal_Int32 nLevel ) : m_nLevel( nLevel )
{}
- void operator() ( vector< OUString >& rVector )
+ void operator() ( vector< uno::Any >& rVector )
{
- vector< OUString >::iterator aIt( rVector.begin() );
- for( sal_Int32 nN=0; aIt<rVector.end(); ++aIt, ++nN)
+ vector< uno::Any >::iterator aIt( rVector.begin() );
+ for( sal_Int32 nN=0; aIt<rVector.end(); aIt++, nN++)
{
if( nN==m_nLevel )
{
@@ -296,23 +334,6 @@ private:
sal_Int32 m_nLevel;
};
-vector< OUString > lcl_AnyToStringVector( const Sequence< uno::Any >& aAnySeq )
-{
- vector< OUString > aStringVec;
- transform( aAnySeq.getConstArray(), aAnySeq.getConstArray() + aAnySeq.getLength(),
- back_inserter( aStringVec ), CommonFunctors::AnyToString() );
- return aStringVec;
-}
-
-Sequence< OUString > lcl_AnyToStringSequence( const Sequence< uno::Any >& aAnySeq )
-{
- Sequence< OUString > aResult;
- aResult.realloc( aAnySeq.getLength() );
- transform( aAnySeq.getConstArray(), aAnySeq.getConstArray() + aAnySeq.getLength(),
- aResult.getArray(), CommonFunctors::AnyToString() );
- return aResult;
-}
-
} // anonymous namespace
// ================================================================================
@@ -342,9 +363,10 @@ InternalDataProvider::InternalDataProvider( const Reference< chart2::XChartDocum
// categories
{
- vector< vector< OUString > > aNewCategories;//inner count is level
+ vector< vector< uno::Any > > aNewCategories;//inner count is level
{
ExplicitCategoriesProvider aExplicitCategoriesProvider( ChartModelHelper::getFirstCoordinateSystem(xChartModel), xChartModel );
+
const Sequence< Reference< chart2::data::XLabeledDataSequence> >& rSplitCategoriesList( aExplicitCategoriesProvider.getSplitCategoriesList() );
sal_Int32 nLevelCount = rSplitCategoriesList.getLength();
for( sal_Int32 nL = 0; nL<nLevelCount; nL++ )
@@ -352,16 +374,18 @@ InternalDataProvider::InternalDataProvider( const Reference< chart2::XChartDocum
Reference< chart2::data::XLabeledDataSequence > xLDS( rSplitCategoriesList[nL] );
if( !xLDS.is() )
continue;
- Reference< chart2::data::XTextualDataSequence > xSeq( xLDS->getValues(), uno::UNO_QUERY );
- Sequence< OUString > aStringSeq;
+ Sequence< uno::Any > aDataSeq;
+ Reference< chart2::data::XDataSequence > xSeq( xLDS->getValues() );
if( xSeq.is() )
- aStringSeq = xSeq->getTextualData(); // @todo: be able to deal with XDataSequence, too
- sal_Int32 nLength = aStringSeq.getLength();
- if( static_cast< sal_Int32 >(aNewCategories.size()) < nLength )
+ aDataSeq = xSeq->getData();
+ sal_Int32 nLength = aDataSeq.getLength();
+ sal_Int32 nCatLength = static_cast< sal_Int32 >(aNewCategories.size());
+ if( nCatLength < nLength )
aNewCategories.resize( nLength );
-
- transform( aNewCategories.begin(), aNewCategories.end(), aStringSeq.getConstArray(),
- aNewCategories.begin(), lcl_setStringAtLevel(nL) );
+ else if( nLength < nCatLength )
+ aDataSeq.realloc( nCatLength );
+ transform( aNewCategories.begin(), aNewCategories.end(), aDataSeq.getConstArray(),
+ aNewCategories.begin(), lcl_setAnyAtLevel(nL) );
}
if( !nLevelCount )
{
@@ -370,9 +394,9 @@ InternalDataProvider::InternalDataProvider( const Reference< chart2::XChartDocum
aNewCategories.reserve( nLength );
for( sal_Int32 nN=0; nN<nLength; nN++)
{
- vector< OUString > aStringVector(1);
- aStringVector[0] = aSimplecategories[nN];
- aNewCategories.push_back( aStringVector );
+ vector< uno::Any > aVector(1);
+ aVector[0] = uno::makeAny( aSimplecategories[nN] );
+ aNewCategories.push_back( aVector );
}
}
}
@@ -589,14 +613,14 @@ void InternalDataProvider::createDefaultData()
namespace
{
-sal_Int32 lcl_getInnerLevelCount( const vector< vector< OUString > >& rLabels )
+sal_Int32 lcl_getInnerLevelCount( const vector< vector< uno::Any > >& rLabels )
{
sal_Int32 nCount = 1;//minimum is 1!
- vector< vector< OUString > >::const_iterator aLevelIt( rLabels.begin() );
- vector< vector< OUString > >::const_iterator aLevelEnd( rLabels.end() );
+ vector< vector< uno::Any > >::const_iterator aLevelIt( rLabels.begin() );
+ vector< vector< uno::Any > >::const_iterator aLevelEnd( rLabels.end() );
for( ;aLevelIt!=aLevelEnd; ++aLevelIt )
{
- const vector< ::rtl::OUString >& rCurrentLevelLabels = *aLevelIt;
+ const vector< uno::Any >& rCurrentLevelLabels = *aLevelIt;
nCount = std::max<sal_Int32>( rCurrentLevelLabels.size(), nCount );
}
return nCount;
@@ -620,7 +644,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< OUString > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
if( bUseColumns==m_bDataInColumns )
{
sal_Int32 nLevelCount = lcl_getInnerLevelCount( aCategories );
@@ -801,46 +825,48 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
if( aRange.match( lcl_aLabelRangePrefix ) )
{
sal_Int32 nIndex = aRange.copy( lcl_aLabelRangePrefix.getLength()).toInt32();
- vector< OUString > aComplexLabel = m_bDataInColumns
+ vector< uno::Any > aComplexLabel = m_bDataInColumns
? m_aInternalData.getComplexColumnLabel( nIndex )
: m_aInternalData.getComplexRowLabel( nIndex );
if( !aComplexLabel.empty() )
- {
- aResult.realloc( aComplexLabel.size() );
- transform( aComplexLabel.begin(), aComplexLabel.end(),
- aResult.getArray(), CommonFunctors::makeAny< OUString >());
- }
+ aResult = ContainerHelper::ContainerToSequence(aComplexLabel);
}
else if( aRange.match( lcl_aCategoriesPointRangeNamePrefix ) )
{
sal_Int32 nPointIndex = aRange.copy( lcl_aCategoriesPointRangeNamePrefix.getLength() ).toInt32();
- vector< OUString > aComplexCategory = m_bDataInColumns
+ vector< uno::Any > aComplexCategory = m_bDataInColumns
? m_aInternalData.getComplexRowLabel( nPointIndex )
: m_aInternalData.getComplexColumnLabel( nPointIndex );
if( !aComplexCategory.empty() )
- {
- aResult.realloc( aComplexCategory.size() );
- transform( aComplexCategory.begin(), aComplexCategory.end(),
- aResult.getArray(), CommonFunctors::makeAny< OUString >());
- }
+ aResult = ContainerHelper::ContainerToSequence(aComplexCategory);
}
else if( aRange.match( lcl_aCategoriesLevelRangeNamePrefix ) )
{
sal_Int32 nLevel = aRange.copy( lcl_aCategoriesLevelRangeNamePrefix.getLength() ).toInt32();
- vector< vector< OUString > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ vector< 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_makeAnyFromLevelVector(nLevel) );
+ aResult.getArray(), lcl_copyFromLevel(nLevel) );
}
}
else if( aRange.equals( lcl_aCategoriesRangeName ) )
{
- Sequence< OUString > aLabels = m_bDataInColumns ? this->getRowDescriptions() : this->getColumnDescriptions();
- aResult.realloc( aLabels.getLength() );
- transform( aLabels.getConstArray(), aLabels.getConstArray() + aLabels.getLength(),
- aResult.getArray(), CommonFunctors::makeAny< OUString >() );
+ vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ sal_Int32 nLevelCount = lcl_getInnerLevelCount( aCategories );
+ if( nLevelCount == 1 )
+ {
+ sal_Int32 nL=0;
+ aResult = this->getDataByRangeRepresentation( lcl_aCategoriesLevelRangeNamePrefix + OUString::valueOf( nL ) );
+ }
+ else
+ {
+ Sequence< OUString > aLabels = m_bDataInColumns ? this->getRowDescriptions() : this->getColumnDescriptions();
+ aResult.realloc( aLabels.getLength() );
+ transform( aLabels.getConstArray(), aLabels.getConstArray() + aLabels.getLength(),
+ aResult.getArray(), CommonFunctors::makeAny< OUString >() );
+ }
}
else
{
@@ -868,38 +894,36 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation(
const OUString& aRange, const Sequence< uno::Any >& aNewData )
throw (uno::RuntimeException)
{
+ vector< uno::Any > aNewVector( ContainerHelper::SequenceToVector(aNewData) );
if( aRange.match( lcl_aLabelRangePrefix ) )
{
- vector< OUString > aNewStrings( lcl_AnyToStringVector( aNewData ) );
sal_uInt32 nIndex = aRange.copy( lcl_aLabelRangePrefix.getLength()).toInt32();
if( m_bDataInColumns )
- m_aInternalData.setComplexColumnLabel( nIndex, aNewStrings );
+ m_aInternalData.setComplexColumnLabel( nIndex, aNewVector );
else
- m_aInternalData.setComplexRowLabel( nIndex, aNewStrings );
+ m_aInternalData.setComplexRowLabel( nIndex, aNewVector );
}
else if( aRange.match( lcl_aCategoriesPointRangeNamePrefix ) )
{
- vector< OUString > aNewStrings( lcl_AnyToStringVector( aNewData ) );
sal_Int32 nPointIndex = aRange.copy( lcl_aCategoriesLevelRangeNamePrefix.getLength()).toInt32();
if( m_bDataInColumns )
- m_aInternalData.setComplexRowLabel( nPointIndex, aNewStrings );
+ m_aInternalData.setComplexRowLabel( nPointIndex, aNewVector );
else
- m_aInternalData.setComplexColumnLabel( nPointIndex, aNewStrings );
+ m_aInternalData.setComplexColumnLabel( nPointIndex, aNewVector );
}
else if( aRange.match( lcl_aCategoriesLevelRangeNamePrefix ) )
{
- vector< OUString > aNewStrings( lcl_AnyToStringVector( aNewData ) );
sal_Int32 nLevel = aRange.copy( lcl_aCategoriesLevelRangeNamePrefix.getLength()).toInt32();
- vector< vector< OUString > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
+ vector< vector< uno::Any > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
//ensure equal length
- if( aNewStrings.size() > aComplexCategories.size() )
- aComplexCategories.resize( aNewStrings.size() );
- else if( aNewStrings.size() < aComplexCategories.size() )
- aNewStrings.resize( aComplexCategories.size() );
+ if( aNewVector.size() > aComplexCategories.size() )
+ aComplexCategories.resize( aNewVector.size() );
+ else if( aNewVector.size() < aComplexCategories.size() )
+ aNewVector.resize( aComplexCategories.size() );
- transform( aComplexCategories.begin(), aComplexCategories.end(), aNewStrings.begin(),
- aComplexCategories.begin(), lcl_setStringAtLevel(nLevel) );
+ transform( aComplexCategories.begin(), aComplexCategories.end(), aNewVector.begin(),
+ aComplexCategories.begin(), lcl_setAnyAtLevel(nLevel) );
if( m_bDataInColumns )
m_aInternalData.setComplexRowLabels( aComplexCategories );
@@ -908,10 +932,14 @@ void SAL_CALL InternalDataProvider::setDataByRangeRepresentation(
}
else if( aRange.equals( lcl_aCategoriesRangeName ) )
{
+ vector< vector< uno::Any > > aComplexCategories;
+ aComplexCategories.resize( aNewVector.size() );
+ transform( aComplexCategories.begin(), aComplexCategories.end(), aNewVector.begin(),
+ aComplexCategories.begin(), lcl_setAnyAtLevel(0) );
if( m_bDataInColumns )
- this->setRowDescriptions( lcl_AnyToStringSequence(aNewData) );
+ m_aInternalData.setComplexRowLabels( aComplexCategories );
else
- this->setColumnDescriptions( lcl_AnyToStringSequence(aNewData) );
+ m_aInternalData.setComplexColumnLabels( aComplexCategories );
}
else
{
@@ -976,8 +1004,8 @@ 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< OUString > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
- ::std::for_each( aComplexCategories.begin(), aComplexCategories.end(), lcl_insertStringAtLevel(nLevel) );
+ vector< 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( aComplexCategories );
else
@@ -993,8 +1021,8 @@ 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< OUString > > aComplexCategories = m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels();
- ::std::for_each( aComplexCategories.begin(), aComplexCategories.end(), lcl_removeStringAtLevel(nLevel) );
+ vector< 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( aComplexCategories );
else
@@ -1204,7 +1232,36 @@ OUString SAL_CALL InternalDataProvider::convertRangeFromXML( const OUString& aXM
namespace
{
-Sequence< Sequence< OUString > > lcl_convertComplexVectorToSequence( const vector< vector< OUString > >& rIn )
+
+template< class Type >
+Sequence< Sequence< Type > > lcl_convertVectorVectorToSequenceSequence( const vector< vector< Type > >& rIn )
+{
+ Sequence< Sequence< Type > > aRet;
+ sal_Int32 nOuterCount = rIn.size();
+ if( nOuterCount )
+ {
+ aRet.realloc(nOuterCount);
+ for( sal_Int32 nN=0; nN<nOuterCount; nN++)
+ aRet[nN]= ContainerHelper::ContainerToSequence( rIn[nN] );
+ }
+ return aRet;
+}
+
+template< class Type >
+vector< 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]= ContainerHelper::SequenceToVector( rIn[nN] );
+ }
+ return aRet;
+}
+
+Sequence< Sequence< OUString > > lcl_convertComplexAnyVectorToStringSequence( const vector< vector< uno::Any > >& rIn )
{
Sequence< Sequence< OUString > > aRet;
sal_Int32 nOuterCount = rIn.size();
@@ -1212,17 +1269,17 @@ Sequence< Sequence< OUString > > lcl_convertComplexVectorToSequence( const vecto
{
aRet.realloc(nOuterCount);
for( sal_Int32 nN=0; nN<nOuterCount; nN++)
- aRet[nN]=ContainerHelper::ContainerToSequence( rIn[nN] );
+ aRet[nN]= lcl_AnyToStringSequence( ContainerHelper::ContainerToSequence( rIn[nN] ) );
}
return aRet;
}
-vector< vector< OUString > > lcl_convertComplexSequenceToVector( const Sequence< Sequence< OUString > >& rIn )
+vector< vector< uno::Any > > lcl_convertComplexStringSequenceToAnyVector( const Sequence< Sequence< OUString > >& rIn )
{
- vector< vector< OUString > > aRet;
+ vector< vector< uno::Any > > aRet;
sal_Int32 nOuterCount = rIn.getLength();
for( sal_Int32 nN=0; nN<nOuterCount; nN++)
- aRet.push_back( ContainerHelper::SequenceToVector( rIn[nN] ) );
+ aRet.push_back( ContainerHelper::SequenceToVector( lcl_StringToAnySequence( rIn[nN] ) ) );
return aRet;
}
@@ -1230,7 +1287,7 @@ class SplitCategoriesProvider_ForComplexDescriptions : public SplitCategoriesPro
{
public:
- explicit SplitCategoriesProvider_ForComplexDescriptions( const ::std::vector< ::std::vector< ::rtl::OUString > >& rComplexDescriptions )
+ explicit SplitCategoriesProvider_ForComplexDescriptions( const ::std::vector< ::std::vector< uno::Any > >& rComplexDescriptions )
: m_rComplexDescriptions( rComplexDescriptions )
{}
virtual ~SplitCategoriesProvider_ForComplexDescriptions()
@@ -1240,7 +1297,7 @@ public:
virtual uno::Sequence< rtl::OUString > getStringsForLevel( sal_Int32 nIndex ) const;
private:
- const ::std::vector< ::std::vector< ::rtl::OUString > >& m_rComplexDescriptions;
+ const ::std::vector< ::std::vector< uno::Any > >& m_rComplexDescriptions;
};
sal_Int32 SplitCategoriesProvider_ForComplexDescriptions::getLevelCount() const
@@ -1261,22 +1318,78 @@ uno::Sequence< rtl::OUString > SplitCategoriesProvider_ForComplexDescriptions::g
}//anonymous namespace
+// ____ XDateCategories ____
+Sequence< double > SAL_CALL InternalDataProvider::getDateCategories() throw (uno::RuntimeException)
+{
+ double fNan = InternalDataProvider::getNotANumber();
+ double fValue = fNan;
+ vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ sal_Int32 nCount = aCategories.size();
+ Sequence< double > aDoubles( nCount );
+ vector< vector< uno::Any > >::iterator aIt( aCategories.begin() );
+ vector< vector< uno::Any > >::const_iterator aEnd( aCategories.end() );
+ for(sal_Int32 nN=0; nN<nCount && aIt!=aEnd; ++nN, ++aIt )
+ {
+ if( !( !aIt->empty() && ((*aIt)[0]>>=fValue) ) )
+ fValue = fNan;
+ aDoubles[nN]=fValue;
+ }
+ return aDoubles;
+}
+
+void SAL_CALL InternalDataProvider::setDateCategories( const Sequence< double >& rDates ) throw (uno::RuntimeException)
+{
+ sal_Int32 nCount = rDates.getLength();
+ vector< vector< uno::Any > > aNewCategories;
+ aNewCategories.reserve(nCount);
+ vector< uno::Any > aSingleLabel(1);
+
+ for(sal_Int32 nN=0; nN<nCount; ++nN )
+ {
+ aSingleLabel[0]=uno::makeAny(rDates[nN]);
+ aNewCategories.push_back(aSingleLabel);
+ }
+
+ if( m_bDataInColumns )
+ m_aInternalData.setComplexRowLabels( aNewCategories );
+ else
+ m_aInternalData.setComplexColumnLabels( aNewCategories );
+}
+
+// ____ XAnyDescriptionAccess ____
+Sequence< Sequence< uno::Any > > SAL_CALL InternalDataProvider::getAnyRowDescriptions() throw (uno::RuntimeException)
+{
+ return lcl_convertVectorVectorToSequenceSequence( m_aInternalData.getComplexRowLabels() );
+}
+void SAL_CALL InternalDataProvider::setAnyRowDescriptions( const Sequence< Sequence< uno::Any > >& aRowDescriptions ) throw (uno::RuntimeException)
+{
+ m_aInternalData.setComplexRowLabels( lcl_convertSequenceSequenceToVectorVector( aRowDescriptions ) );
+}
+Sequence< Sequence< uno::Any > > SAL_CALL InternalDataProvider::getAnyColumnDescriptions() throw (uno::RuntimeException)
+{
+ return lcl_convertVectorVectorToSequenceSequence( m_aInternalData.getComplexColumnLabels() );
+}
+void SAL_CALL InternalDataProvider::setAnyColumnDescriptions( const Sequence< Sequence< uno::Any > >& aColumnDescriptions ) throw (uno::RuntimeException)
+{
+ m_aInternalData.setComplexColumnLabels( lcl_convertSequenceSequenceToVectorVector( aColumnDescriptions ) );
+}
+
// ____ XComplexDescriptionAccess ____
Sequence< Sequence< OUString > > SAL_CALL InternalDataProvider::getComplexRowDescriptions() throw (uno::RuntimeException)
{
- return lcl_convertComplexVectorToSequence( m_aInternalData.getComplexRowLabels() );
+ return lcl_convertComplexAnyVectorToStringSequence( m_aInternalData.getComplexRowLabels() );
}
void SAL_CALL InternalDataProvider::setComplexRowDescriptions( const Sequence< Sequence< ::rtl::OUString > >& aRowDescriptions ) throw (uno::RuntimeException)
{
- m_aInternalData.setComplexRowLabels( lcl_convertComplexSequenceToVector(aRowDescriptions) );
+ m_aInternalData.setComplexRowLabels( lcl_convertComplexStringSequenceToAnyVector(aRowDescriptions) );
}
Sequence< Sequence< ::rtl::OUString > > SAL_CALL InternalDataProvider::getComplexColumnDescriptions() throw (uno::RuntimeException)
{
- return lcl_convertComplexVectorToSequence( m_aInternalData.getComplexColumnLabels() );
+ return lcl_convertComplexAnyVectorToStringSequence( m_aInternalData.getComplexColumnLabels() );
}
void SAL_CALL InternalDataProvider::setComplexColumnDescriptions( const Sequence< Sequence< ::rtl::OUString > >& aColumnDescriptions ) throw (uno::RuntimeException)
{
- m_aInternalData.setComplexColumnLabels( lcl_convertComplexSequenceToVector(aColumnDescriptions) );
+ m_aInternalData.setComplexColumnLabels( lcl_convertComplexStringSequenceToAnyVector(aColumnDescriptions) );
}
// ____ XChartDataArray ____
@@ -1295,25 +1408,25 @@ void SAL_CALL InternalDataProvider::setData( const Sequence< Sequence< double >
void SAL_CALL InternalDataProvider::setRowDescriptions( const Sequence< OUString >& aRowDescriptions )
throw (uno::RuntimeException)
{
- vector< vector< OUString > > aComplexDescriptions( aRowDescriptions.getLength() );
+ vector< vector< uno::Any > > aComplexDescriptions( aRowDescriptions.getLength() );
transform( aComplexDescriptions.begin(), aComplexDescriptions.end(), aRowDescriptions.getConstArray(),
- aComplexDescriptions.begin(), lcl_setStringAtLevel(0) );
+ aComplexDescriptions.begin(), lcl_setAnyAtLevelFromStringSequence(0) );
m_aInternalData.setComplexRowLabels( aComplexDescriptions );
}
void SAL_CALL InternalDataProvider::setColumnDescriptions( const Sequence< OUString >& aColumnDescriptions )
throw (uno::RuntimeException)
{
- vector< vector< OUString > > aComplexDescriptions( aColumnDescriptions.getLength() );
+ vector< vector< uno::Any > > aComplexDescriptions( aColumnDescriptions.getLength() );
transform( aComplexDescriptions.begin(), aComplexDescriptions.end(), aColumnDescriptions.getConstArray(),
- aComplexDescriptions.begin(), lcl_setStringAtLevel(0) );
+ aComplexDescriptions.begin(), lcl_setAnyAtLevelFromStringSequence(0) );
m_aInternalData.setComplexColumnLabels( aComplexDescriptions );
}
Sequence< OUString > SAL_CALL InternalDataProvider::getRowDescriptions()
throw (uno::RuntimeException)
{
- vector< vector< OUString > > aComplexLabels( m_aInternalData.getComplexRowLabels() );
+ vector< vector< uno::Any > > aComplexLabels( m_aInternalData.getComplexRowLabels() );
SplitCategoriesProvider_ForComplexDescriptions aProvider( aComplexLabels );
return ExplicitCategoriesProvider::getExplicitSimpleCategories( aProvider );
}
@@ -1321,7 +1434,7 @@ Sequence< OUString > SAL_CALL InternalDataProvider::getRowDescriptions()
Sequence< OUString > SAL_CALL InternalDataProvider::getColumnDescriptions()
throw (uno::RuntimeException)
{
- vector< vector< OUString > > aComplexLabels( m_aInternalData.getComplexColumnLabels() );
+ vector< vector< uno::Any > > aComplexLabels( m_aInternalData.getComplexColumnLabels() );
SplitCategoriesProvider_ForComplexDescriptions aProvider( aComplexLabels );
return ExplicitCategoriesProvider::getExplicitSimpleCategories( aProvider );
}
diff --git a/chart2/source/tools/LegendHelper.cxx b/chart2/source/tools/LegendHelper.cxx
index 8ced934fa4d8..886572dca58e 100644..100755
--- a/chart2/source/tools/LegendHelper.cxx
+++ b/chart2/source/tools/LegendHelper.cxx
@@ -30,7 +30,7 @@
#include "precompiled_chart2.hxx"
#include "LegendHelper.hxx"
#include "macros.hxx"
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#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/chart2/XChartDocument.hpp>
@@ -63,11 +63,11 @@ Reference< chart2::XLegend > LegendHelper::showLegend( const Reference< frame::X
if( !(xProp->getPropertyValue( C2U( "AnchorPosition" )) >>= ePos ) )
xProp->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny( ePos ));
- chart2::LegendExpansion eExpansion =
+ ::com::sun::star::chart::ChartLegendExpansion eExpansion =
( ePos == chart2::LegendPosition_LINE_END ||
ePos == chart2::LegendPosition_LINE_START )
- ? chart2::LegendExpansion_HIGH
- : chart2::LegendExpansion_WIDE;
+ ? ::com::sun::star::chart::ChartLegendExpansion_HIGH
+ : ::com::sun::star::chart::ChartLegendExpansion_WIDE;
if( !(xProp->getPropertyValue( C2U( "Expansion" )) >>= eExpansion ) )
xProp->setPropertyValue( C2U( "Expansion" ), uno::makeAny( eExpansion ));
diff --git a/chart2/source/tools/LineProperties.cxx b/chart2/source/tools/LineProperties.cxx
index 136f6e684e0d..136f6e684e0d 100644..100755
--- a/chart2/source/tools/LineProperties.cxx
+++ b/chart2/source/tools/LineProperties.cxx
diff --git a/chart2/source/tools/NamedFillProperties.cxx b/chart2/source/tools/NamedFillProperties.cxx
index 1b03e741be57..1b03e741be57 100644..100755
--- a/chart2/source/tools/NamedFillProperties.cxx
+++ b/chart2/source/tools/NamedFillProperties.cxx
diff --git a/chart2/source/tools/NamedLineProperties.cxx b/chart2/source/tools/NamedLineProperties.cxx
index a761736c1eb7..a761736c1eb7 100644..100755
--- a/chart2/source/tools/NamedLineProperties.cxx
+++ b/chart2/source/tools/NamedLineProperties.cxx
diff --git a/chart2/source/tools/NamedProperties.cxx b/chart2/source/tools/NamedProperties.cxx
index 4286a9c22e00..4286a9c22e00 100644..100755
--- a/chart2/source/tools/NamedProperties.cxx
+++ b/chart2/source/tools/NamedProperties.cxx
diff --git a/chart2/source/view/main/NumberFormatterWrapper.cxx b/chart2/source/tools/NumberFormatterWrapper.cxx
index ba109582aac9..5df81ccaa139 100644..100755
--- a/chart2/source/view/main/NumberFormatterWrapper.cxx
+++ b/chart2/source/tools/NumberFormatterWrapper.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "macros.hxx"
#include <comphelper/processfactory.hxx>
// header for class SvNumberFormatsSupplierObj
@@ -92,6 +92,25 @@ SvNumberFormatter* NumberFormatterWrapper::getSvNumberFormatter() const
return m_pNumberFormatter;
}
+Date NumberFormatterWrapper::getNullDate() const
+{
+ sal_uInt16 nYear = 1899,nDay = 30,nMonth = 12;
+ Date aRet(nDay,nMonth,nYear);
+
+ util::DateTime aUtilDate;
+ if( m_aNullDate.hasValue() && (m_aNullDate >>= aUtilDate) )
+ {
+ aRet = Date(aUtilDate.Day,aUtilDate.Month,aUtilDate.Year);
+ }
+ else if( m_pNumberFormatter )
+ {
+ Date* pDate = m_pNumberFormatter->GetNullDate();
+ if( pDate )
+ aRet = *pDate;
+ }
+ return aRet;
+}
+
rtl::OUString NumberFormatterWrapper::getFormattedString(
sal_Int32 nNumberFormatKey, double fValue, sal_Int32& rLabelColor, bool& rbColorChanged ) const
{
@@ -103,7 +122,7 @@ rtl::OUString NumberFormatterWrapper::getFormattedString(
return aText;
}
// i99104 handle null date correctly
- USHORT nYear = 1899,nDay = 30,nMonth = 12;
+ sal_uInt16 nYear = 1899,nDay = 30,nMonth = 12;
if ( m_aNullDate.hasValue() )
{
Date* pDate = m_pNumberFormatter->GetNullDate();
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index bdb3b0e9693b..bdb3b0e9693b 100644..100755
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
diff --git a/chart2/source/tools/RegressionCurveCalculator.cxx b/chart2/source/tools/RegressionCurveCalculator.cxx
index b8814fcb2fe1..b8814fcb2fe1 100644..100755
--- a/chart2/source/tools/RegressionCurveCalculator.cxx
+++ b/chart2/source/tools/RegressionCurveCalculator.cxx
diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx
index 844b91acd5d5..3ebf3a1de564 100644..100755
--- a/chart2/source/tools/RegressionCurveHelper.cxx
+++ b/chart2/source/tools/RegressionCurveHelper.cxx
@@ -609,9 +609,7 @@ OUString RegressionCurveHelper::getUINameForRegressionCurve( const Reference< XR
if( aServiceName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.MeanValueRegressionCurve" )))
{
- OSL_ENSURE( false, "Meanvalue lines in legend not supported" );
- aResult = OUString();
- // aResult = ::chart::SchResId::getResString( STR_OBJECT_AVERAGE_LINE );
+ aResult = ::chart::SchResId::getResString( STR_REGRESSION_MEAN );
}
else if( aServiceName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.LinearRegressionCurve" )))
diff --git a/chart2/source/tools/RegressionCurveModel.cxx b/chart2/source/tools/RegressionCurveModel.cxx
index cb07e35d228b..908aa5eb1ae4 100644..100755
--- a/chart2/source/tools/RegressionCurveModel.cxx
+++ b/chart2/source/tools/RegressionCurveModel.cxx
@@ -64,36 +64,63 @@ static const OUString lcl_aImplementationName_Potential(
static const OUString lcl_aServiceName(
RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.RegressionCurve" ));
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticXXXDefaults_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ }
+};
+
+struct StaticXXXDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticXXXDefaults_Initializer >
+{
+};
+
+struct StaticRegressionCurveInfoHelper_Initializer
+{
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::LineProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
+};
- return aPropSeq;
-}
+struct StaticRegressionCurveInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticRegressionCurveInfoHelper_Initializer >
+{
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticRegressionCurveInfo_Initializer
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticRegressionCurveInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
- return aArrayHelper;
-}
+struct StaticRegressionCurveInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticRegressionCurveInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -240,45 +267,23 @@ void RegressionCurveModel::fireModifyEvent()
uno::Any RegressionCurveModel::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticXXXDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL RegressionCurveModel::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticRegressionCurveInfoHelper::get();
}
-
// ____ XPropertySet ____
-uno::Reference< beans::XPropertySetInfo > SAL_CALL
- RegressionCurveModel::getPropertySetInfo()
+uno::Reference< beans::XPropertySetInfo > SAL_CALL RegressionCurveModel::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static uno::Reference< beans::XPropertySetInfo > xInfo;
-
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- getInfoHelper());
- }
-
- return xInfo;
+ return *StaticRegressionCurveInfo::get();
}
// ================================================================================
diff --git a/chart2/source/tools/RegressionEquation.cxx b/chart2/source/tools/RegressionEquation.cxx
index d6f6bbe93db9..9b0c07bb3549 100644..100755
--- a/chart2/source/tools/RegressionEquation.cxx
+++ b/chart2/source/tools/RegressionEquation.cxx
@@ -111,30 +111,51 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEVOID ));
}
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+struct StaticRegressionEquationDefaults_Initializer
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SHOW, false );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SHOW_CORRELATION_COEFF, false );
-
- // override other defaults
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::FillProperties::PROP_FILL_STYLE, drawing::FillStyle_NONE );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ ::chart::tPropertyValueMap* operator()()
+ {
+ static ::chart::tPropertyValueMap aStaticDefaults;
+ lcl_AddDefaultsToMap( aStaticDefaults );
+ return &aStaticDefaults;
+ }
+private:
+ void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
+ {
+ ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::FillProperties::AddDefaultsToMap( rOutMap );
+ ::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
+
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SHOW, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SHOW_CORRELATION_COEFF, false );
+ //::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_EQUATION_SEPARATOR, ::rtl::OUString( sal_Unicode( '\n' )));
+
+ // override other defaults
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::FillProperties::PROP_FILL_STYLE, drawing::FillStyle_NONE );
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+
+ 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 );
+ }
+};
- 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 );
-}
+struct StaticRegressionEquationDefaults : public rtl::StaticAggregate< ::chart::tPropertyValueMap, StaticRegressionEquationDefaults_Initializer >
+{
+};
-const uno::Sequence< Property > & lcl_GetPropertySequence()
+struct StaticRegressionEquationInfoHelper_Initializer
{
- static uno::Sequence< Property > aPropSeq;
+ ::cppu::OPropertyArrayHelper* operator()()
+ {
+ static ::cppu::OPropertyArrayHelper aPropHelper( lcl_GetPropertySequence() );
+ return &aPropHelper;
+ }
- MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
+private:
+ uno::Sequence< Property > lcl_GetPropertySequence()
{
- // get properties
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::LineProperties::AddPropertiesToVector( aProperties );
@@ -142,25 +163,31 @@ const uno::Sequence< Property > & lcl_GetPropertySequence()
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
- // and sort them for access via bsearch
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
- // transfer result to static Sequence
- aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+ return ::chart::ContainerHelper::ContainerToSequence( aProperties );
}
- return aPropSeq;
-}
+};
-::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+struct StaticRegressionEquationInfoHelper : public rtl::StaticAggregate< ::cppu::OPropertyArrayHelper, StaticRegressionEquationInfoHelper_Initializer >
{
- static ::cppu::OPropertyArrayHelper aArrayHelper(
- lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
+};
- return aArrayHelper;
-}
+struct StaticRegressionEquationInfo_Initializer
+{
+ uno::Reference< beans::XPropertySetInfo >* operator()()
+ {
+ static uno::Reference< beans::XPropertySetInfo > xPropertySetInfo(
+ ::cppu::OPropertySetHelper::createPropertySetInfo(*StaticRegressionEquationInfoHelper::get() ) );
+ return &xPropertySetInfo;
+ }
+};
+
+struct StaticRegressionEquationInfo : public rtl::StaticAggregate< uno::Reference< beans::XPropertySetInfo >, StaticRegressionEquationInfo_Initializer >
+{
+};
} // anonymous namespace
@@ -197,52 +224,25 @@ uno::Reference< util::XCloneable > SAL_CALL RegressionEquation::createClone()
uno::Any RegressionEquation::GetDefaultValue( sal_Int32 nHandle ) const
throw(beans::UnknownPropertyException)
{
- static tPropertyValueMap aStaticDefaults;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aStaticDefaults.size() )
- {
- // initialize defaults
- LineProperties::AddDefaultsToMap( aStaticDefaults );
- FillProperties::AddDefaultsToMap( aStaticDefaults );
- CharacterProperties::AddDefaultsToMap( aStaticDefaults );
-
- // overrides a line property
- lcl_AddDefaultsToMap( aStaticDefaults );
- }
-
- tPropertyValueMap::const_iterator aFound(
- aStaticDefaults.find( nHandle ));
-
- if( aFound == aStaticDefaults.end())
+ const tPropertyValueMap& rStaticDefaults = *StaticRegressionEquationDefaults::get();
+ tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
+ if( aFound == rStaticDefaults.end() )
return uno::Any();
-
return (*aFound).second;
}
::cppu::IPropertyArrayHelper & SAL_CALL RegressionEquation::getInfoHelper()
{
- return lcl_getInfoHelper();
+ return *StaticRegressionEquationInfoHelper::get();
}
// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL
- RegressionEquation::getPropertySetInfo()
+Reference< beans::XPropertySetInfo > SAL_CALL RegressionEquation::getPropertySetInfo()
throw (uno::RuntimeException)
{
- static Reference< beans::XPropertySetInfo > xInfo;
-
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( !xInfo.is())
- {
- xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
- lcl_getInfoHelper());
- }
-
- return xInfo;
+ return *StaticRegressionEquationInfo::get();
}
-
// ____ XModifyBroadcaster ____
void SAL_CALL RegressionEquation::addModifyListener( const uno::Reference< util::XModifyListener >& aListener )
throw (uno::RuntimeException)
diff --git a/chart2/source/tools/RelativePositionHelper.cxx b/chart2/source/tools/RelativePositionHelper.cxx
index 2487b58ee427..2487b58ee427 100644..100755
--- a/chart2/source/tools/RelativePositionHelper.cxx
+++ b/chart2/source/tools/RelativePositionHelper.cxx
diff --git a/chart2/source/tools/RelativeSizeHelper.cxx b/chart2/source/tools/RelativeSizeHelper.cxx
index 2c656b04f47a..2c656b04f47a 100644..100755
--- a/chart2/source/tools/RelativeSizeHelper.cxx
+++ b/chart2/source/tools/RelativeSizeHelper.cxx
diff --git a/chart2/source/tools/ResId.cxx b/chart2/source/tools/ResId.cxx
index 2b74471495a7..56fe184b3d1d 100644..100755
--- a/chart2/source/tools/ResId.cxx
+++ b/chart2/source/tools/ResId.cxx
@@ -42,7 +42,7 @@ SchResId::SchResId( sal_Int16 nId )
::rtl::OUString SchResId::getResString( sal_Int16 nId )
{
- return ::rtl::OUString( String( SchResId( nId )));
+ return String( SchResId( nId ));
}
} // namespace chart
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx
index 629919530adc..629919530adc 100644..100755
--- a/chart2/source/tools/StatisticsHelper.cxx
+++ b/chart2/source/tools/StatisticsHelper.cxx
diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx
index 43d6e364fd23..43d6e364fd23 100644..100755
--- a/chart2/source/tools/ThreeDHelper.cxx
+++ b/chart2/source/tools/ThreeDHelper.cxx
diff --git a/chart2/source/tools/WrappedIgnoreProperty.cxx b/chart2/source/tools/WrappedIgnoreProperty.cxx
index ddddd215c218..ddddd215c218 100644..100755
--- a/chart2/source/tools/WrappedIgnoreProperty.cxx
+++ b/chart2/source/tools/WrappedIgnoreProperty.cxx
diff --git a/chart2/source/tools/WrappedPropertySet.cxx b/chart2/source/tools/WrappedPropertySet.cxx
index ca3dd7227b5b..06f2b554bdb3 100644..100755
--- a/chart2/source/tools/WrappedPropertySet.cxx
+++ b/chart2/source/tools/WrappedPropertySet.cxx
@@ -67,7 +67,7 @@ Reference< beans::XPropertyState > WrappedPropertySet::getInnerPropertyState()
void WrappedPropertySet::clearWrappedPropertySet()
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence
//delete all wrapped properties
if(m_pWrappedPropertyMap)
@@ -90,14 +90,22 @@ void WrappedPropertySet::clearWrappedPropertySet()
Reference< beans::XPropertySetInfo > SAL_CALL WrappedPropertySet::getPropertySetInfo( )
throw (uno::RuntimeException)
{
- if( !m_xInfo.is() )
+ Reference< beans::XPropertySetInfo > xInfo = m_xInfo;
+ if( !xInfo.is() )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if( !m_xInfo.is() )
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence
+ xInfo = m_xInfo;
+ if( !xInfo.is() )
{
- m_xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
+ xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+ m_xInfo = xInfo;
}
}
+ else
+ {
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+ }
return m_xInfo;
}
@@ -433,15 +441,22 @@ Sequence< Any > SAL_CALL WrappedPropertySet::getPropertyDefaults( const Sequence
::cppu::IPropertyArrayHelper& WrappedPropertySet::getInfoHelper()
{
- if(!m_pPropertyArrayHelper)
+ ::cppu::OPropertyArrayHelper* p = m_pPropertyArrayHelper;
+ if(!p)
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if(!m_pPropertyArrayHelper)
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence
+ p = m_pPropertyArrayHelper;
+ if(!p)
{
- sal_Bool bSorted = sal_True;
- m_pPropertyArrayHelper = new ::cppu::OPropertyArrayHelper( getPropertySequence(), bSorted );
+ p = new ::cppu::OPropertyArrayHelper( getPropertySequence(), sal_True );
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+ m_pPropertyArrayHelper = p;
}
}
+ else
+ {
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+ }
return *m_pPropertyArrayHelper;
}
@@ -449,13 +464,15 @@ Sequence< Any > SAL_CALL WrappedPropertySet::getPropertyDefaults( const Sequence
tWrappedPropertyMap& WrappedPropertySet::getWrappedPropertyMap()
{
- if(!m_pWrappedPropertyMap)
+ tWrappedPropertyMap* p = m_pWrappedPropertyMap;
+ if(!p)
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if(!m_pWrappedPropertyMap)
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );//do not use different mutex than is already used for static property sequence
+ p = m_pWrappedPropertyMap;
+ if(!p)
{
std::vector< WrappedProperty* > aPropList( createWrappedProperties() );
- m_pWrappedPropertyMap = new tWrappedPropertyMap();
+ p = new tWrappedPropertyMap();
for( std::vector< WrappedProperty* >::const_iterator aIt = aPropList.begin(); aIt!=aPropList.end(); ++aIt )
{
@@ -469,18 +486,25 @@ tWrappedPropertyMap& WrappedPropertySet::getWrappedPropertyMap()
OSL_ENSURE( false, "missing property in property list" );
delete pProperty;//we are owner or the created WrappedProperties
}
- else if( m_pWrappedPropertyMap->find( nHandle ) != m_pWrappedPropertyMap->end() )
+ else if( p->find( nHandle ) != p->end() )
{
//duplicate Wrapped property
OSL_ENSURE( false, "duplicate Wrapped property" );
delete pProperty;//we are owner or the created WrappedProperties
}
else
- (*m_pWrappedPropertyMap)[ nHandle ] = pProperty;
+ (*p)[ nHandle ] = pProperty;
}
}
+
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+ m_pWrappedPropertyMap = p;
}
}
+ else
+ {
+ OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+ }
return *m_pWrappedPropertyMap;
}
diff --git a/chart2/source/tools/_serviceregistration_tools.cxx b/chart2/source/tools/_serviceregistration_tools.cxx
index dac0efaf0b47..a517eade97f0 100644
--- a/chart2/source/tools/_serviceregistration_tools.cxx
+++ b/chart2/source/tools/_serviceregistration_tools.cxx
@@ -184,13 +184,6 @@ OOO_DLLPUBLIC_CHARTTOOLS void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-OOO_DLLPUBLIC_CHARTTOOLS sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, g_entries_chart2_tools );
-}
-//==================================================================================================
OOO_DLLPUBLIC_CHARTTOOLS void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
diff --git a/chart2/source/tools/charttools.component b/chart2/source/tools/charttools.component
new file mode 100644
index 000000000000..7ca499a7ba80
--- /dev/null
+++ b/chart2/source/tools/charttools.component
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.chart2.ExponentialScaling">
+ <service name="com.sun.star.chart2.ExponentialScaling"/>
+ </implementation>
+ <implementation name="com.sun.star.chart2.LinearScaling">
+ <service name="com.sun.star.chart2.LinearScaling"/>
+ </implementation>
+ <implementation name="com.sun.star.chart2.LogarithmicScaling">
+ <service name="com.sun.star.chart2.LogarithmicScaling"/>
+ </implementation>
+ <implementation name="com.sun.star.chart2.PowerScaling">
+ <service name="com.sun.star.chart2.PowerScaling"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.CachedDataSequence">
+ <service name="com.sun.star.chart2.data.DataSequence"/>
+ <service name="com.sun.star.chart2.data.NumericalDataSequence"/>
+ <service name="com.sun.star.chart2.data.TextualDataSequence"/>
+ <service name="com.sun.star.comp.chart.CachedDataSequence"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.DataSource">
+ <service name="com.sun.star.chart2.data.DataSource"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart.InternalDataProvider">
+ <service name="com.sun.star.chart2.data.DataProvider"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ConfigDefaultColorScheme">
+ <service name="com.sun.star.chart2.ColorScheme"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ErrorBar">
+ <service name="com.sun.star.chart2.ErrorBar"/>
+ <service name="com.sun.star.comp.chart2.ErrorBar"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ExponentialRegressionCurve">
+ <service name="com.sun.star.chart2.ExponentialRegressionCurve"/>
+ <service name="com.sun.star.chart2.RegressionCurve"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.LabeledDataSequence">
+ <service name="com.sun.star.chart2.data.LabeledDataSequence"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.LinearRegressionCurve">
+ <service name="com.sun.star.chart2.LinearRegressionCurve"/>
+ <service name="com.sun.star.chart2.RegressionCurve"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.LogarithmicRegressionCurve">
+ <service name="com.sun.star.chart2.LogarithmicRegressionCurve"/>
+ <service name="com.sun.star.chart2.RegressionCurve"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.MeanValueRegressionCurve">
+ <service name="com.sun.star.chart2.MeanValueRegressionCurve"/>
+ <service name="com.sun.star.chart2.RegressionCurve"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.PotentialRegressionCurve">
+ <service name="com.sun.star.chart2.PotentialRegressionCurve"/>
+ <service name="com.sun.star.chart2.RegressionCurve"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.RegressionEquation">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart2.RegressionEquation"/>
+ <service name="com.sun.star.drawing.FillProperties"/>
+ <service name="com.sun.star.drawing.LineProperties"/>
+ <service name="com.sun.star.style.CharacterProperties"/>
+ </implementation>
+</component>
diff --git a/chart2/source/tools/makefile.mk b/chart2/source/tools/makefile.mk
index 8eb81ba82d46..5467124eecf7 100644
--- a/chart2/source/tools/makefile.mk
+++ b/chart2/source/tools/makefile.mk
@@ -66,6 +66,7 @@ SLOFILES= \
$(SLO)$/LinearRegressionCurveCalculator.obj \
$(SLO)$/LogarithmicRegressionCurveCalculator.obj \
$(SLO)$/MeanValueRegressionCurveCalculator.obj \
+ $(SLO)$/NumberFormatterWrapper.obj \
$(SLO)$/OPropertySet.obj \
$(SLO)$/WrappedPropertySet.obj \
$(SLO)$/WrappedProperty.obj \
@@ -174,3 +175,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk \
exports.flt
$(TYPE) exports.flt > $@
+
+ALLTAR : $(MISC)/charttools.component
+
+$(MISC)/charttools.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ charttools.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt charttools.component
diff --git a/chart2/source/view/axes/DateHelper.cxx b/chart2/source/view/axes/DateHelper.cxx
new file mode 100644
index 000000000000..7159a733498f
--- /dev/null
+++ b/chart2/source/view/axes/DateHelper.cxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+#include "DateHelper.hxx"
+#include "DateScaling.hxx"
+#include <rtl/math.hxx>
+#include <com/sun/star/chart/TimeUnit.hpp>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+
+bool DateHelper::IsInSameYear( const Date& rD1, const Date& rD2 )
+{
+ return rD1.GetYear() == rD2.GetYear();
+}
+bool DateHelper::IsInSameMonth( const Date& rD1, const Date& rD2 )
+{
+ return (rD1.GetYear() == rD2.GetYear())
+ && (rD1.GetMonth() == rD2.GetMonth());
+}
+long DateHelper::GetMonthsBetweenDates( Date aD1, Date aD2 )
+{
+ Date aHelp = aD1;
+ long nSign = 1;
+ if( aD1 < aD2 )
+ {
+ aD1 = aD2;
+ aD2 = aHelp;
+ nSign = -1;
+ }
+
+ return nSign*( ( aD1.GetMonth() - aD2.GetMonth() )
+ + ( aD1.GetYear() - aD2.GetYear() )*12 );
+}
+
+Date DateHelper::GetDateSomeMonthsAway( const Date& rD, long nMonthDistance )
+{
+ Date aRet(rD);
+ long nMonth = rD.GetMonth()+nMonthDistance;
+ long nNewMonth = nMonth%12;
+ long nNewYear = rD.GetYear() + nMonth/12;
+ if( nMonth <= 0 || !nNewMonth )
+ nNewYear--;
+ if( nNewMonth <= 0 )
+ nNewMonth += 12;
+ aRet.SetMonth( sal_uInt16(nNewMonth) );
+ aRet.SetYear( sal_uInt16(nNewYear) );
+ while(!aRet.IsValid())
+ aRet--;
+ return aRet;
+}
+
+Date DateHelper::GetDateSomeYearsAway( const Date& rD, long nYearDistance )
+{
+ Date aRet(rD);
+ aRet.SetYear( static_cast<sal_uInt16>(rD.GetYear()+nYearDistance) );
+ while(!aRet.IsValid())
+ aRet--;
+ return aRet;
+}
+
+bool DateHelper::IsLessThanOneMonthAway( const Date& rD1, const Date& rD2 )
+{
+ Date aDMin( DateHelper::GetDateSomeMonthsAway( rD1, -1 ) );
+ Date aDMax( DateHelper::GetDateSomeMonthsAway( rD1, 1 ) );
+
+ if( rD2 > aDMin && rD2 < aDMax )
+ return true;
+ return false;
+}
+
+bool DateHelper::IsLessThanOneYearAway( const Date& rD1, const Date& rD2 )
+{
+ Date aDMin( DateHelper::GetDateSomeYearsAway( rD1, -1 ) );
+ Date aDMax( DateHelper::GetDateSomeYearsAway( rD1, 1 ) );
+
+ if( rD2 > aDMin && rD2 < aDMax )
+ return true;
+ return false;
+}
+
+double DateHelper::RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution )
+{
+ Date aDate(rNullDate); aDate += static_cast<long>(::rtl::math::approxFloor(fValue));
+ switch(TimeResolution)
+ {
+ case ::com::sun::star::chart::TimeUnit::DAY:
+ break;
+ case ::com::sun::star::chart::TimeUnit::YEAR:
+ aDate.SetMonth(1);
+ aDate.SetDay(1);
+ break;
+ case ::com::sun::star::chart::TimeUnit::MONTH:
+ default:
+ aDate.SetDay(1);
+ break;
+ }
+ return aDate - rNullDate;
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/axes/DateScaling.cxx b/chart2/source/view/axes/DateScaling.cxx
new file mode 100644
index 000000000000..8a69e83abbc8
--- /dev/null
+++ b/chart2/source/view/axes/DateScaling.cxx
@@ -0,0 +1,216 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+#include "DateScaling.hxx"
+#include <com/sun/star/chart/TimeUnit.hpp>
+#include <rtl/math.hxx>
+#include "com/sun/star/uno/RuntimeException.hpp"
+
+namespace
+{
+
+static const ::rtl::OUString lcl_aServiceName_DateScaling(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.DateScaling" ));
+static const ::rtl::OUString lcl_aServiceName_InverseDateScaling(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.InverseDateScaling" ));
+
+static const ::rtl::OUString lcl_aImplementationName_DateScaling(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.DateScaling" ));
+static const ::rtl::OUString lcl_aImplementationName_InverseDateScaling(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.InverseDateScaling" ));
+
+static const double lcl_fNumberOfMonths = 12.0;//todo: this needs to be offered by basic tools Date class if it should be more generic
+}
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+using ::com::sun::star::chart::TimeUnit::DAY;
+using ::com::sun::star::chart::TimeUnit::MONTH;
+using ::com::sun::star::chart::TimeUnit::YEAR;
+
+DateScaling::DateScaling( const Date& rNullDate, sal_Int32 nTimeUnit, bool bShifted )
+ : m_aNullDate( rNullDate )
+ , m_nTimeUnit( nTimeUnit )
+ , m_bShifted( bShifted )
+{
+}
+
+DateScaling::~DateScaling()
+{
+}
+
+double SAL_CALL DateScaling::doScaling( double value )
+ throw (uno::RuntimeException)
+{
+ double fResult(value);
+ if( ::rtl::math::isNan( value ) || ::rtl::math::isInf( value ) )
+ ::rtl::math::setNan( & fResult );
+ else
+ {
+ Date aDate(m_aNullDate);
+ aDate += static_cast<long>(::rtl::math::approxFloor(value));
+ switch( m_nTimeUnit )
+ {
+ case DAY:
+ fResult = value;
+ if(m_bShifted)
+ fResult+=0.5;
+ break;
+ case YEAR:
+ case MONTH:
+ default:
+ fResult = aDate.GetYear();
+ fResult *= lcl_fNumberOfMonths;//asssuming equal count of months in each year
+ fResult += aDate.GetMonth();
+
+ double fDayOfMonth = aDate.GetDay();
+ fDayOfMonth -= 1.0;
+ double fDaysInMonth = aDate.GetDaysInMonth();
+ fResult += fDayOfMonth/fDaysInMonth;
+ if(m_bShifted)
+ {
+ if( YEAR==m_nTimeUnit )
+ fResult += 0.5*lcl_fNumberOfMonths;
+ else
+ fResult += 0.5;
+ }
+ break;
+ }
+ }
+ return fResult;
+}
+
+uno::Reference< XScaling > SAL_CALL DateScaling::getInverseScaling()
+ throw (uno::RuntimeException)
+{
+ return new InverseDateScaling( m_aNullDate, m_nTimeUnit, m_bShifted );
+}
+
+::rtl::OUString SAL_CALL DateScaling::getServiceName()
+ throw (uno::RuntimeException)
+{
+ return lcl_aServiceName_DateScaling;
+}
+
+uno::Sequence< ::rtl::OUString > DateScaling::getSupportedServiceNames_Static()
+{
+ return uno::Sequence< ::rtl::OUString >( & lcl_aServiceName_DateScaling, 1 );
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+APPHELPER_XSERVICEINFO_IMPL( DateScaling, lcl_aServiceName_DateScaling )
+
+// ----------------------------------------
+
+InverseDateScaling::InverseDateScaling( const Date& rNullDate, sal_Int32 nTimeUnit, bool bShifted )
+ : m_aNullDate( rNullDate )
+ , m_nTimeUnit( nTimeUnit )
+ , m_bShifted( bShifted )
+{
+}
+
+InverseDateScaling::~InverseDateScaling()
+{
+}
+
+double SAL_CALL InverseDateScaling::doScaling( double value )
+ throw (uno::RuntimeException)
+{
+ double fResult(value);
+ if( ::rtl::math::isNan( value ) || ::rtl::math::isInf( value ) )
+ ::rtl::math::setNan( & fResult );
+ else
+ {
+ switch( m_nTimeUnit )
+ {
+ case DAY:
+ if(m_bShifted)
+ value -= 0.5;
+ fResult = value;
+ break;
+ case YEAR:
+ case MONTH:
+ default:
+ //Date aDate(m_aNullDate);
+ if(m_bShifted)
+ {
+ if( YEAR==m_nTimeUnit )
+ value -= 0.5*lcl_fNumberOfMonths;
+ else
+ value -= 0.5;
+ }
+ Date aDate;
+ double fYear = ::rtl::math::approxFloor(value/lcl_fNumberOfMonths);
+ double fMonth = ::rtl::math::approxFloor(value-(fYear*lcl_fNumberOfMonths));
+ if( fMonth==0.0 )
+ {
+ fYear--;
+ fMonth=12.0;
+ }
+ aDate.SetYear( static_cast<sal_uInt16>(fYear) );
+ aDate.SetMonth( static_cast<sal_uInt16>(fMonth) );
+ aDate.SetDay( 1 );
+ double fMonthCount = (fYear*lcl_fNumberOfMonths)+fMonth;
+ double fDay = (value-fMonthCount)*aDate.GetDaysInMonth();
+ fDay += 1.0;
+ aDate.SetDay( static_cast<sal_uInt16>(::rtl::math::round(fDay)) );
+ fResult = aDate - m_aNullDate;
+ break;
+ }
+ }
+ return fResult;
+}
+
+uno::Reference< XScaling > SAL_CALL InverseDateScaling::getInverseScaling()
+ throw (uno::RuntimeException)
+{
+ return new DateScaling( m_aNullDate, m_nTimeUnit, m_bShifted );
+}
+
+::rtl::OUString SAL_CALL InverseDateScaling::getServiceName()
+ throw (uno::RuntimeException)
+{
+ return lcl_aServiceName_InverseDateScaling;
+}
+
+uno::Sequence< ::rtl::OUString > InverseDateScaling::getSupportedServiceNames_Static()
+{
+ return uno::Sequence< ::rtl::OUString >( & lcl_aServiceName_InverseDateScaling, 1 );
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+APPHELPER_XSERVICEINFO_IMPL( InverseDateScaling, lcl_aServiceName_InverseDateScaling )
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/axes/DateScaling.hxx b/chart2/source/view/axes/DateScaling.hxx
new file mode 100644
index 000000000000..5e550604a957
--- /dev/null
+++ b/chart2/source/view/axes/DateScaling.hxx
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CHART2_DATESCALING_HXX
+#define _CHART2_DATESCALING_HXX
+#include "ServiceMacros.hxx"
+#include <com/sun/star/chart2/XScaling.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XServiceName.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <cppuhelper/implbase3.hxx>
+#include <tools/date.hxx>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+//-----------------------------------------------------------------------------
+/**
+*/
+
+class DateScaling :
+ public ::cppu::WeakImplHelper3 <
+ ::com::sun::star::chart2::XScaling,
+ ::com::sun::star::lang::XServiceName,
+ ::com::sun::star::lang::XServiceInfo
+ >
+{
+public:
+ DateScaling( const Date& rNullDate, sal_Int32 nTimeUnit, bool bShifted );
+ virtual ~DateScaling();
+
+ /// declare XServiceInfo methods
+ APPHELPER_XSERVICEINFO_DECL()
+
+ // ____ XScaling ____
+ virtual double SAL_CALL doScaling( double value )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XScaling > SAL_CALL
+ getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XServiceName ____
+ virtual ::rtl::OUString SAL_CALL getServiceName()
+ throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ const Date m_aNullDate;
+ const sal_Int32 m_nTimeUnit;
+ const bool m_bShifted;
+};
+
+class InverseDateScaling :
+ public ::cppu::WeakImplHelper3 <
+ ::com::sun::star::chart2::XScaling,
+ ::com::sun::star::lang::XServiceName,
+ ::com::sun::star::lang::XServiceInfo
+ >
+{
+public:
+ InverseDateScaling( const Date& rNullDate, sal_Int32 nTimeUnit, bool bShifted );
+ virtual ~InverseDateScaling();
+
+ /// declare XServiceInfo methods
+ APPHELPER_XSERVICEINFO_DECL()
+
+ // ____ XScaling ____
+ virtual double SAL_CALL doScaling( double value )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XScaling > SAL_CALL
+ getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XServiceName ____
+ virtual ::rtl::OUString SAL_CALL getServiceName()
+ throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ const Date m_aNullDate;
+ const sal_Int32 m_nTimeUnit;
+ const bool m_bShifted;
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
+
diff --git a/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx b/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
index f9522bdc0005..669c2f9c42b9 100644
--- a/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
+++ b/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
@@ -30,6 +30,9 @@
#include "precompiled_chart2.hxx"
#include "MinimumAndMaximumSupplier.hxx"
+
+#include <com/sun/star/chart/TimeUnit.hpp>
+
#include <rtl/math.hxx>
#include <com/sun/star/awt/Size.hpp>
@@ -197,6 +200,24 @@ void MergedMinimumAndMaximumSupplier::clearMinimumAndMaximumSupplierList()
m_aMinimumAndMaximumSupplierList.clear();
}
+long MergedMinimumAndMaximumSupplier::calculateTimeResolutionOnXAxis()
+{
+ long nRet = ::com::sun::star::chart::TimeUnit::YEAR;
+ for( MinimumAndMaximumSupplierSet::iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
+ {
+ long nCurrent = (*aIt)->calculateTimeResolutionOnXAxis();
+ if(nRet>nCurrent)
+ nRet=nCurrent;
+ }
+ return nRet;
+}
+
+void MergedMinimumAndMaximumSupplier::setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate )
+{
+ for( MinimumAndMaximumSupplierSet::iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt )
+ (*aIt)->setTimeResolutionOnXAxis( nTimeResolution, rNullDate );
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx
index 72256024ef7c..dcd987a0bbc3 100644
--- a/chart2/source/view/axes/ScaleAutomatism.cxx
+++ b/chart2/source/view/axes/ScaleAutomatism.cxx
@@ -30,8 +30,12 @@
#include "precompiled_chart2.hxx"
#include "ScaleAutomatism.hxx"
#include "macros.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks_Equidistant.hxx"
+#include "DateHelper.hxx"
+#include "DateScaling.hxx"
#include "AxisHelper.hxx"
+#include <com/sun/star/chart/TimeUnit.hpp>
+
#include <rtl/math.hxx>
#include <tools/debug.hxx>
@@ -41,6 +45,9 @@ namespace chart
//.............................................................................
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using ::com::sun::star::chart::TimeUnit::DAY;
+using ::com::sun::star::chart::TimeUnit::MONTH;
+using ::com::sun::star::chart::TimeUnit::YEAR;
const sal_Int32 MAXIMUM_MANUAL_INCREMENT_COUNT = 500;
const sal_Int32 MAXIMUM_AUTO_INCREMENT_COUNT = 10;
@@ -57,7 +64,42 @@ void lcl_ensureMaximumSubIncrementCount( sal_Int32& rnSubIntervalCount )
}//end anonymous namespace
-ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale )
+
+//.............................................................................
+
+ExplicitScaleData::ExplicitScaleData()
+ : Minimum(0.0)
+ , Maximum(10.0)
+ , Origin(0.0)
+ , Orientation(::com::sun::star::chart2::AxisOrientation_MATHEMATICAL)
+ , Scaling()
+ , AxisType(::com::sun::star::chart2::AxisType::REALNUMBER)
+ , ShiftedCategoryPosition(false)
+ , TimeResolution(::com::sun::star::chart::TimeUnit::DAY)
+ , NullDate(30,12,1899)
+{
+}
+
+ExplicitSubIncrement::ExplicitSubIncrement()
+ : IntervalCount(2)
+ , PostEquidistant(true)
+{
+}
+
+
+ExplicitIncrementData::ExplicitIncrementData()
+ : MajorTimeInterval(1,::com::sun::star::chart::TimeUnit::DAY)
+ , MinorTimeInterval(1,::com::sun::star::chart::TimeUnit::DAY)
+ , Distance(1.0)
+ , PostEquidistant(true)
+ , BaseValue(0.0)
+ , SubIncrements()
+{
+}
+
+//.............................................................................
+
+ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale, const Date& rNullDate )
: m_aSourceScale( rSourceScale )
, m_fValueMinimum( 0.0 )
, m_fValueMaximum( 0.0 )
@@ -66,6 +108,8 @@ ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale )
, m_bExpandIfValuesCloseToBorder( false )
, m_bExpandWideValuesToZero( false )
, m_bExpandNarrowValuesTowardZero( false )
+ , m_nTimeResolution(::com::sun::star::chart::TimeUnit::DAY)
+ , m_aNullDate(rNullDate)
{
::rtl::math::setNan( &m_fValueMinimum );
::rtl::math::setNan( &m_fValueMaximum );
@@ -112,14 +156,19 @@ void ScaleAutomatism::setMaximumAutoMainIncrementCount( sal_Int32 nMaximumAutoMa
m_nMaximumAutoMainIncrementCount = nMaximumAutoMainIncrementCount;
}
+void ScaleAutomatism::setAutomaticTimeResolution( sal_Int32 nTimeResolution )
+{
+ m_nTimeResolution = nTimeResolution;
+}
+
void ScaleAutomatism::calculateExplicitScaleAndIncrement(
ExplicitScaleData& rExplicitScale, ExplicitIncrementData& rExplicitIncrement ) const
{
// fill explicit scale
rExplicitScale.Orientation = m_aSourceScale.Orientation;
rExplicitScale.Scaling = m_aSourceScale.Scaling;
- rExplicitScale.Breaks = m_aSourceScale.Breaks;
rExplicitScale.AxisType = m_aSourceScale.AxisType;
+ rExplicitScale.NullDate = m_aNullDate;
bool bAutoMinimum = !(m_aSourceScale.Minimum >>= rExplicitScale.Minimum);
bool bAutoMaximum = !(m_aSourceScale.Maximum >>= rExplicitScale.Maximum);
@@ -131,7 +180,12 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
if( m_aSourceScale.AxisType==AxisType::PERCENT )
rExplicitScale.Minimum = 0.0;
else if( ::rtl::math::isNan( m_fValueMinimum ) )
- rExplicitScale.Minimum = 0.0; //@todo get Minimum from scaling or from plotter????
+ {
+ if( m_aSourceScale.AxisType==AxisType::DATE )
+ rExplicitScale.Minimum = 36526.0; //1.1.2000
+ else
+ rExplicitScale.Minimum = 0.0; //@todo get Minimum from scaling or from plotter????
+ }
else
rExplicitScale.Minimum = m_fValueMinimum;
}
@@ -142,7 +196,12 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
if( m_aSourceScale.AxisType==AxisType::PERCENT )
rExplicitScale.Maximum = 1.0;
else if( ::rtl::math::isNan( m_fValueMaximum ) )
- rExplicitScale.Maximum = 10.0; //@todo get Maximum from scaling or from plotter????
+ {
+ if( m_aSourceScale.AxisType==AxisType::DATE )
+ rExplicitScale.Maximum = 40179.0; //1.1.2010
+ else
+ rExplicitScale.Maximum = 10.0; //@todo get Maximum from scaling or from plotter????
+ }
else
rExplicitScale.Maximum = m_fValueMaximum;
}
@@ -150,14 +209,14 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
//---------------------------------------------------------------
//fill explicit increment
- rExplicitIncrement.ShiftedPosition = (m_aSourceScale.AxisType==AxisType::SERIES) ? true : false;
+ rExplicitScale.ShiftedCategoryPosition = m_aSourceScale.ShiftedCategoryPosition;
bool bIsLogarithm = false;
//minimum and maximum of the ExplicitScaleData may be changed if allowed
- if( m_aSourceScale.AxisType==AxisType::CATEGORY || m_aSourceScale.AxisType==AxisType::SERIES )
- {
+ if( m_aSourceScale.AxisType==AxisType::DATE )
+ calculateExplicitIncrementAndScaleForDateTimeAxis( rExplicitScale, rExplicitIncrement, bAutoMinimum, bAutoMaximum );
+ else if( m_aSourceScale.AxisType==AxisType::CATEGORY || m_aSourceScale.AxisType==AxisType::SERIES )
calculateExplicitIncrementAndScaleForCategory( rExplicitScale, rExplicitIncrement, bAutoMinimum, bAutoMaximum );
- }
else
{
bIsLogarithm = AxisHelper::isLogarithmic( rExplicitScale.Scaling );
@@ -187,6 +246,11 @@ ScaleData ScaleAutomatism::getScale() const
return m_aSourceScale;
}
+Date ScaleAutomatism::getNullDate() const
+{
+ return m_aNullDate;
+}
+
// private --------------------------------------------------------------------
void ScaleAutomatism::calculateExplicitIncrementAndScaleForCategory(
@@ -197,6 +261,9 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForCategory(
// no scaling for categories
rExplicitScale.Scaling.clear();
+ if( rExplicitScale.ShiftedCategoryPosition )
+ rExplicitScale.Maximum += 1.0;
+
// ensure that at least one category is visible
if( rExplicitScale.Maximum <= rExplicitScale.Minimum )
rExplicitScale.Maximum = rExplicitScale.Minimum + 1.0;
@@ -208,9 +275,9 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForCategory(
// automatic minimum and maximum
if( bAutoMinimum && m_bExpandBorderToIncrementRhythm )
- rExplicitScale.Minimum = TickmarkHelper::getMinimumAtIncrement( rExplicitScale.Minimum, rExplicitIncrement );
+ rExplicitScale.Minimum = EquidistantTickFactory::getMinimumAtIncrement( rExplicitScale.Minimum, rExplicitIncrement );
if( bAutoMaximum && m_bExpandBorderToIncrementRhythm )
- rExplicitScale.Maximum = TickmarkHelper::getMaximumAtIncrement( rExplicitScale.Maximum, rExplicitIncrement );
+ rExplicitScale.Maximum = EquidistantTickFactory::getMaximumAtIncrement( rExplicitScale.Maximum, rExplicitIncrement );
//prevent performace killover
double fDistanceCount = ::rtl::math::approxFloor( (rExplicitScale.Maximum-rExplicitScale.Minimum) / rExplicitIncrement.Distance );
@@ -224,29 +291,28 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForCategory(
//---------------------------------------------------------------
//fill explicit sub increment
sal_Int32 nSubCount = m_aSourceScale.IncrementData.SubIncrements.getLength();
- rExplicitIncrement.SubIncrements.realloc(nSubCount);
for( sal_Int32 nN=0; nN<nSubCount; nN++ )
{
- const SubIncrement& rSubIncrement = m_aSourceScale.IncrementData.SubIncrements[nN];
- ExplicitSubIncrement& rExplicitSubIncrement = rExplicitIncrement.SubIncrements[nN];
-
- if(!(rSubIncrement.IntervalCount>>=rExplicitSubIncrement.IntervalCount))
+ ExplicitSubIncrement aExplicitSubIncrement;
+ const SubIncrement& rSubIncrement= m_aSourceScale.IncrementData.SubIncrements[nN];
+ if(!(rSubIncrement.IntervalCount>>=aExplicitSubIncrement.IntervalCount))
{
//scaling dependent
//@todo autocalculate IntervalCount dependent on MainIncrement and scaling
- rExplicitSubIncrement.IntervalCount = 2;
+ aExplicitSubIncrement.IntervalCount = 2;
}
- lcl_ensureMaximumSubIncrementCount( rExplicitSubIncrement.IntervalCount );
- if(!(rSubIncrement.PostEquidistant>>=rExplicitSubIncrement.PostEquidistant))
+ lcl_ensureMaximumSubIncrementCount( aExplicitSubIncrement.IntervalCount );
+ if(!(rSubIncrement.PostEquidistant>>=aExplicitSubIncrement.PostEquidistant))
{
//scaling dependent
- rExplicitSubIncrement.PostEquidistant = sal_False;
+ aExplicitSubIncrement.PostEquidistant = sal_False;
}
+ rExplicitIncrement.SubIncrements.push_back(aExplicitSubIncrement);
}
}
-//@todo these method should become part of the scaling interface and implementation somehow
-//@todo problem with outparamters at api
+//-----------------------------------------------------------------------------------------
+
void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
ExplicitScaleData& rExplicitScale,
ExplicitIncrementData& rExplicitIncrement,
@@ -413,7 +479,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
// round to entire multiples of the distance and add additional space
if( bAutoMinimum && m_bExpandBorderToIncrementRhythm )
{
- fAxisMinimum = TickmarkHelper::getMinimumAtIncrement( fAxisMinimum, rExplicitIncrement );
+ fAxisMinimum = EquidistantTickFactory::getMinimumAtIncrement( fAxisMinimum, rExplicitIncrement );
//ensure valid values after scaling #i100995#
if( !bAutoDistance )
@@ -429,7 +495,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
}
if( bAutoMaximum && m_bExpandBorderToIncrementRhythm )
{
- fAxisMaximum = TickmarkHelper::getMaximumAtIncrement( fAxisMaximum, rExplicitIncrement );
+ fAxisMaximum = EquidistantTickFactory::getMaximumAtIncrement( fAxisMaximum, rExplicitIncrement );
//ensure valid values after scaling #i100995#
if( !bAutoDistance )
@@ -489,27 +555,210 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
//---------------------------------------------------------------
//fill explicit sub increment
sal_Int32 nSubCount = m_aSourceScale.IncrementData.SubIncrements.getLength();
- rExplicitIncrement.SubIncrements.realloc(nSubCount);
for( sal_Int32 nN=0; nN<nSubCount; nN++ )
{
- const SubIncrement& rSubIncrement = m_aSourceScale.IncrementData.SubIncrements[nN];
- ExplicitSubIncrement& rExplicitSubIncrement = rExplicitIncrement.SubIncrements[nN];
-
- if(!(rSubIncrement.IntervalCount>>=rExplicitSubIncrement.IntervalCount))
+ ExplicitSubIncrement aExplicitSubIncrement;
+ const SubIncrement& rSubIncrement = m_aSourceScale.IncrementData.SubIncrements[nN];
+ if(!(rSubIncrement.IntervalCount>>=aExplicitSubIncrement.IntervalCount))
{
//scaling dependent
//@todo autocalculate IntervalCount dependent on MainIncrement and scaling
- rExplicitSubIncrement.IntervalCount = 9;
+ aExplicitSubIncrement.IntervalCount = 9;
}
- lcl_ensureMaximumSubIncrementCount( rExplicitSubIncrement.IntervalCount );
- if(!(rSubIncrement.PostEquidistant>>=rExplicitSubIncrement.PostEquidistant))
+ lcl_ensureMaximumSubIncrementCount( aExplicitSubIncrement.IntervalCount );
+ if(!(rSubIncrement.PostEquidistant>>=aExplicitSubIncrement.PostEquidistant))
{
//scaling dependent
- rExplicitSubIncrement.PostEquidistant = sal_False;
+ aExplicitSubIncrement.PostEquidistant = sal_False;
}
+ rExplicitIncrement.SubIncrements.push_back(aExplicitSubIncrement);
}
}
+//-----------------------------------------------------------------------------------------
+
+void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement,
+ bool bAutoMinimum, bool bAutoMaximum ) const
+{
+ Date aMinDate(m_aNullDate); aMinDate += static_cast<long>(::rtl::math::approxFloor(rExplicitScale.Minimum));
+ Date aMaxDate(m_aNullDate); aMaxDate += static_cast<long>(::rtl::math::approxFloor(rExplicitScale.Maximum));
+ rExplicitIncrement.PostEquidistant = sal_False;
+
+ if( aMinDate > aMaxDate )
+ {
+ std::swap(aMinDate,aMaxDate);
+ }
+
+ if( !(m_aSourceScale.TimeIncrement.TimeResolution >>= rExplicitScale.TimeResolution) )
+ rExplicitScale.TimeResolution = m_nTimeResolution;
+
+ rExplicitScale.Scaling = new DateScaling(m_aNullDate,rExplicitScale.TimeResolution,false);
+
+ // choose min and max suitable to time resolution
+ switch( rExplicitScale.TimeResolution )
+ {
+ case DAY:
+ if( rExplicitScale.ShiftedCategoryPosition )
+ aMaxDate++;//for explicit scales we need one interval more (maximum excluded)
+ break;
+ case MONTH:
+ aMinDate.SetDay(1);
+ aMaxDate.SetDay(1);
+ if( rExplicitScale.ShiftedCategoryPosition )
+ aMaxDate = DateHelper::GetDateSomeMonthsAway(aMaxDate,1);//for explicit scales we need one interval more (maximum excluded)
+ if( DateHelper::IsLessThanOneMonthAway( aMinDate, aMaxDate ) )
+ {
+ if( bAutoMaximum || !bAutoMinimum )
+ aMaxDate = DateHelper::GetDateSomeMonthsAway(aMinDate,1);
+ else
+ aMinDate = DateHelper::GetDateSomeMonthsAway(aMaxDate,-1);
+ }
+ break;
+ case YEAR:
+ aMinDate.SetDay(1);
+ aMinDate.SetMonth(1);
+ aMaxDate.SetDay(1);
+ aMaxDate.SetMonth(1);
+ if( rExplicitScale.ShiftedCategoryPosition )
+ aMaxDate = DateHelper::GetDateSomeYearsAway(aMaxDate,1);//for explicit scales we need one interval more (maximum excluded)
+ if( DateHelper::IsLessThanOneYearAway( aMinDate, aMaxDate ) )
+ {
+ if( bAutoMaximum || !bAutoMinimum )
+ aMaxDate = DateHelper::GetDateSomeYearsAway(aMinDate,1);
+ else
+ aMinDate = DateHelper::GetDateSomeYearsAway(aMaxDate,-1);
+ }
+ break;
+ }
+
+ // set the resulting limits (swap back to negative range if needed)
+ rExplicitScale.Minimum = aMinDate - m_aNullDate;
+ rExplicitScale.Maximum = aMaxDate - m_aNullDate;
+
+ bool bAutoMajor = !(m_aSourceScale.TimeIncrement.MajorTimeInterval >>= rExplicitIncrement.MajorTimeInterval);
+ bool bAutoMinor = !(m_aSourceScale.TimeIncrement.MinorTimeInterval >>= rExplicitIncrement.MinorTimeInterval);
+
+ sal_Int32 nMaxMainIncrementCount = bAutoMajor ?
+ m_nMaximumAutoMainIncrementCount : MAXIMUM_MANUAL_INCREMENT_COUNT;
+ if( nMaxMainIncrementCount > 1 )
+ nMaxMainIncrementCount--;
+
+
+ //choose major time interval:
+ long nDayCount = (aMaxDate-aMinDate);
+ long nMainIncrementCount = 1;
+ if( !bAutoMajor )
+ {
+ long nIntervalDayCount = rExplicitIncrement.MajorTimeInterval.Number;
+ if( rExplicitIncrement.MajorTimeInterval.TimeUnit < rExplicitScale.TimeResolution )
+ rExplicitIncrement.MajorTimeInterval.TimeUnit = rExplicitScale.TimeResolution;
+ switch( rExplicitIncrement.MajorTimeInterval.TimeUnit )
+ {
+ case DAY:
+ break;
+ case MONTH:
+ nIntervalDayCount*=31;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ break;
+ case YEAR:
+ nIntervalDayCount*=365;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ break;
+ }
+ nMainIncrementCount = nDayCount/nIntervalDayCount;
+ if( nMainIncrementCount > nMaxMainIncrementCount )
+ bAutoMajor = true;
+ }
+ if( bAutoMajor )
+ {
+ long nNumer = 1;
+ long nIntervalDays = nDayCount / nMaxMainIncrementCount;
+ double nDaysPerInterval = 1.0;
+ if( nIntervalDays>365 || YEAR==rExplicitScale.TimeResolution )
+ {
+ rExplicitIncrement.MajorTimeInterval.TimeUnit = YEAR;
+ nDaysPerInterval = 365.0;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ }
+ else if( nIntervalDays>31 || MONTH==rExplicitScale.TimeResolution )
+ {
+ rExplicitIncrement.MajorTimeInterval.TimeUnit = MONTH;
+ nDaysPerInterval = 31.0;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ }
+ else
+ {
+ rExplicitIncrement.MajorTimeInterval.TimeUnit = DAY;
+ nDaysPerInterval = 1.0;
+ }
+
+ nNumer = static_cast<sal_Int32>( rtl::math::approxCeil( nIntervalDays/nDaysPerInterval ) );
+ if(nNumer<=0)
+ nNumer=1;
+ rExplicitIncrement.MajorTimeInterval.Number = nNumer;
+ nMainIncrementCount = nDayCount/(nNumer*nDaysPerInterval);
+ }
+
+ //choose minor time interval:
+ if( !bAutoMinor )
+ {
+ if( rExplicitIncrement.MinorTimeInterval.TimeUnit > rExplicitIncrement.MajorTimeInterval.TimeUnit )
+ rExplicitIncrement.MinorTimeInterval.TimeUnit = rExplicitIncrement.MajorTimeInterval.TimeUnit;
+ long nIntervalDayCount = rExplicitIncrement.MinorTimeInterval.Number;
+ switch( rExplicitIncrement.MinorTimeInterval.TimeUnit )
+ {
+ case DAY:
+ break;
+ case MONTH:
+ nIntervalDayCount*=31;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ break;
+ case YEAR:
+ nIntervalDayCount*=365;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ...
+ break;
+ }
+ if( nDayCount/nIntervalDayCount > nMaxMainIncrementCount )
+ bAutoMinor = true;
+ }
+ if( bAutoMinor )
+ {
+ rExplicitIncrement.MinorTimeInterval.TimeUnit = rExplicitIncrement.MajorTimeInterval.TimeUnit;
+ rExplicitIncrement.MinorTimeInterval.Number = 1;
+ if( nMainIncrementCount > 100 )
+ rExplicitIncrement.MinorTimeInterval.Number = rExplicitIncrement.MajorTimeInterval.Number;
+ else
+ {
+ if( rExplicitIncrement.MajorTimeInterval.Number >= 2 )
+ {
+ if( !(rExplicitIncrement.MajorTimeInterval.Number%2) )
+ rExplicitIncrement.MinorTimeInterval.Number = rExplicitIncrement.MajorTimeInterval.Number/2;
+ else if( !(rExplicitIncrement.MajorTimeInterval.Number%3) )
+ rExplicitIncrement.MinorTimeInterval.Number = rExplicitIncrement.MajorTimeInterval.Number/3;
+ else if( !(rExplicitIncrement.MajorTimeInterval.Number%5) )
+ rExplicitIncrement.MinorTimeInterval.Number = rExplicitIncrement.MajorTimeInterval.Number/5;
+ else if( rExplicitIncrement.MajorTimeInterval.Number > 50 )
+ rExplicitIncrement.MinorTimeInterval.Number = rExplicitIncrement.MajorTimeInterval.Number;
+ }
+ else
+ {
+ switch( rExplicitIncrement.MajorTimeInterval.TimeUnit )
+ {
+ case DAY:
+ break;
+ case MONTH:
+ if( rExplicitScale.TimeResolution == DAY )
+ rExplicitIncrement.MinorTimeInterval.TimeUnit = DAY;
+ break;
+ case YEAR:
+ if( rExplicitScale.TimeResolution <= MONTH )
+ rExplicitIncrement.MinorTimeInterval.TimeUnit = MONTH;
+ break;
+ }
+ }
+ }
+ }
+
+}
+
+//-----------------------------------------------------------------------------------------
+
void ScaleAutomatism::calculateExplicitIncrementAndScaleForLinear(
ExplicitScaleData& rExplicitScale,
ExplicitIncrementData& rExplicitIncrement,
@@ -693,7 +942,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLinear(
{
// round to entire multiples of the distance, based on the base value
if( m_bExpandBorderToIncrementRhythm )
- fAxisMinimum = TickmarkHelper::getMinimumAtIncrement( fAxisMinimum, rExplicitIncrement );
+ fAxisMinimum = EquidistantTickFactory::getMinimumAtIncrement( fAxisMinimum, rExplicitIncrement );
// additional space, if source minimum is to near at axis minimum
if( m_bExpandIfValuesCloseToBorder )
if( (fAxisMinimum != 0.0) && ((fAxisMaximum - fSourceMinimum) / (fAxisMaximum - fAxisMinimum) > 20.0 / 21.0) )
@@ -703,7 +952,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLinear(
{
// round to entire multiples of the distance, based on the base value
if( m_bExpandBorderToIncrementRhythm )
- fAxisMaximum = TickmarkHelper::getMaximumAtIncrement( fAxisMaximum, rExplicitIncrement );
+ fAxisMaximum = EquidistantTickFactory::getMaximumAtIncrement( fAxisMaximum, rExplicitIncrement );
// additional space, if source maximum is to near at axis maximum
if( m_bExpandIfValuesCloseToBorder )
if( (fAxisMaximum != 0.0) && ((fSourceMaximum - fAxisMinimum) / (fAxisMaximum - fAxisMinimum) > 20.0 / 21.0) )
@@ -735,24 +984,23 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLinear(
//---------------------------------------------------------------
//fill explicit sub increment
sal_Int32 nSubCount = m_aSourceScale.IncrementData.SubIncrements.getLength();
- rExplicitIncrement.SubIncrements.realloc(nSubCount);
for( sal_Int32 nN=0; nN<nSubCount; nN++ )
{
- const SubIncrement& rSubIncrement = m_aSourceScale.IncrementData.SubIncrements[nN];
- ExplicitSubIncrement& rExplicitSubIncrement = rExplicitIncrement.SubIncrements[nN];
-
- if(!(rSubIncrement.IntervalCount>>=rExplicitSubIncrement.IntervalCount))
+ ExplicitSubIncrement aExplicitSubIncrement;
+ const SubIncrement& rSubIncrement= m_aSourceScale.IncrementData.SubIncrements[nN];
+ if(!(rSubIncrement.IntervalCount>>=aExplicitSubIncrement.IntervalCount))
{
//scaling dependent
//@todo autocalculate IntervalCount dependent on MainIncrement and scaling
- rExplicitSubIncrement.IntervalCount = 2;
+ aExplicitSubIncrement.IntervalCount = 2;
}
- lcl_ensureMaximumSubIncrementCount( rExplicitSubIncrement.IntervalCount );
- if(!(rSubIncrement.PostEquidistant>>=rExplicitSubIncrement.PostEquidistant))
+ lcl_ensureMaximumSubIncrementCount( aExplicitSubIncrement.IntervalCount );
+ if(!(rSubIncrement.PostEquidistant>>=aExplicitSubIncrement.PostEquidistant))
{
//scaling dependent
- rExplicitSubIncrement.PostEquidistant = sal_False;
+ aExplicitSubIncrement.PostEquidistant = sal_False;
}
+ rExplicitIncrement.SubIncrements.push_back(aExplicitSubIncrement);
}
}
diff --git a/chart2/source/view/axes/Tickmarks.cxx b/chart2/source/view/axes/Tickmarks.cxx
new file mode 100644
index 000000000000..834fe66eb97b
--- /dev/null
+++ b/chart2/source/view/axes/Tickmarks.cxx
@@ -0,0 +1,333 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+#include "Tickmarks.hxx"
+#include "Tickmarks_Equidistant.hxx"
+#include "Tickmarks_Dates.hxx"
+#include "ViewDefines.hxx"
+#include <rtl/math.hxx>
+#include <tools/debug.hxx>
+#include <memory>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+using namespace ::rtl::math;
+using ::basegfx::B2DVector;
+
+TickInfo::TickInfo( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XScaling >& xInverse )
+: fScaledTickValue( 0.0 )
+, xInverseScaling( xInverse )
+, aTickScreenPosition(0.0,0.0)
+, bPaintIt( true )
+, xTextShape( NULL )
+, nFactorForLimitedTextWidth(1)
+{
+}
+
+double TickInfo::getUnscaledTickValue() const
+{
+ if( xInverseScaling.is() )
+ return xInverseScaling->doScaling( fScaledTickValue );
+ else
+ return fScaledTickValue;
+}
+
+sal_Int32 TickInfo::getScreenDistanceBetweenTicks( const TickInfo& rOherTickInfo ) const
+{
+ //return the positive distance between the two first tickmarks in screen values
+
+ B2DVector aDistance = rOherTickInfo.aTickScreenPosition - aTickScreenPosition;
+ sal_Int32 nRet = static_cast<sal_Int32>(aDistance.getLength());
+ if(nRet<0)
+ nRet *= -1;
+ return nRet;
+}
+
+PureTickIter::PureTickIter( ::std::vector< TickInfo >& rTickInfoVector )
+ : m_rTickVector(rTickInfoVector)
+ , m_aTickIter(m_rTickVector.begin())
+{
+}
+PureTickIter::~PureTickIter()
+{
+}
+TickInfo* PureTickIter::firstInfo()
+{
+ m_aTickIter = m_rTickVector.begin();
+ if(m_aTickIter!=m_rTickVector.end())
+ return &*m_aTickIter;
+ return 0;
+}
+TickInfo* PureTickIter::nextInfo()
+{
+ if(m_aTickIter!=m_rTickVector.end())
+ {
+ m_aTickIter++;
+ if(m_aTickIter!=m_rTickVector.end())
+ return &*m_aTickIter;
+ }
+ return 0;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+TickFactory::TickFactory(
+ const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement )
+ : m_rScale( rScale )
+ , m_rIncrement( rIncrement )
+ , m_xInverseScaling(NULL)
+{
+ //@todo: make sure that the scale is valid for the scaling
+
+ if( m_rScale.Scaling.is() )
+ {
+ m_xInverseScaling = m_rScale.Scaling->getInverseScaling();
+ DBG_ASSERT( m_xInverseScaling.is(), "each Scaling needs to return a inverse Scaling" );
+ }
+
+ m_fScaledVisibleMin = m_rScale.Minimum;
+ if( m_xInverseScaling.is() )
+ m_fScaledVisibleMin = m_rScale.Scaling->doScaling(m_fScaledVisibleMin);
+
+ m_fScaledVisibleMax = m_rScale.Maximum;
+ if( m_xInverseScaling.is() )
+ m_fScaledVisibleMax = m_rScale.Scaling->doScaling(m_fScaledVisibleMax);
+}
+
+TickFactory::~TickFactory()
+{
+}
+
+bool TickFactory::isDateAxis() const
+{
+ return m_rScale.AxisType == AxisType::DATE;
+}
+
+void TickFactory::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ if( isDateAxis() )
+ DateTickFactory( m_rScale, m_rIncrement ).getAllTicks( rAllTickInfos );
+ else
+ EquidistantTickFactory( m_rScale, m_rIncrement ).getAllTicks( rAllTickInfos );
+}
+
+void TickFactory::getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ if( isDateAxis() )
+ DateTickFactory( m_rScale, m_rIncrement ).getAllTicksShifted( rAllTickInfos );
+ else
+ EquidistantTickFactory( m_rScale, m_rIncrement ).getAllTicksShifted( rAllTickInfos );
+}
+
+//-----------------------------------------------------------------------------
+// ___TickFactory_2D___
+//-----------------------------------------------------------------------------
+TickFactory_2D::TickFactory_2D(
+ const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement
+ //, double fStrech_SceneToScreen, double fOffset_SceneToScreen )
+ , const B2DVector& rStartScreenPos, const B2DVector& rEndScreenPos
+ , const B2DVector& rAxisLineToLabelLineShift )
+ : TickFactory( rScale, rIncrement )
+ , m_aAxisStartScreenPosition2D(rStartScreenPos)
+ , m_aAxisEndScreenPosition2D(rEndScreenPos)
+ , m_aAxisLineToLabelLineShift(rAxisLineToLabelLineShift)
+ , m_fStrech_LogicToScreen(1.0)
+ , m_fOffset_LogicToScreen(0.0)
+{
+ double fWidthY = m_fScaledVisibleMax - m_fScaledVisibleMin;
+ if( AxisOrientation_MATHEMATICAL==m_rScale.Orientation )
+ {
+ m_fStrech_LogicToScreen = 1.0/fWidthY;
+ m_fOffset_LogicToScreen = -m_fScaledVisibleMin;
+ }
+ else
+ {
+ B2DVector aSwap(m_aAxisStartScreenPosition2D);
+ m_aAxisStartScreenPosition2D = m_aAxisEndScreenPosition2D;
+ m_aAxisEndScreenPosition2D = aSwap;
+
+ m_fStrech_LogicToScreen = -1.0/fWidthY;
+ m_fOffset_LogicToScreen = -m_fScaledVisibleMax;
+ }
+}
+
+TickFactory_2D::~TickFactory_2D()
+{
+}
+
+bool TickFactory_2D::isHorizontalAxis() const
+{
+ return ( m_aAxisStartScreenPosition2D.getY() == m_aAxisEndScreenPosition2D.getY() );
+}
+bool TickFactory_2D::isVerticalAxis() const
+{
+ return ( m_aAxisStartScreenPosition2D.getX() == m_aAxisEndScreenPosition2D.getX() );
+}
+
+//static
+sal_Int32 TickFactory_2D::getTickScreenDistance( TickIter& rIter )
+{
+ //return the positive distance between the two first tickmarks in screen values
+ //if there are less than two tickmarks -1 is returned
+
+ const TickInfo* pFirstTickInfo = rIter.firstInfo();
+ const TickInfo* pSecondTickInfo = rIter.nextInfo();
+ if(!pSecondTickInfo || !pFirstTickInfo)
+ return -1;
+
+ return pFirstTickInfo->getScreenDistanceBetweenTicks( *pSecondTickInfo );
+}
+
+B2DVector TickFactory_2D::getTickScreenPosition2D( double fScaledLogicTickValue ) const
+{
+ B2DVector aRet(m_aAxisStartScreenPosition2D);
+ aRet += (m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D)
+ *((fScaledLogicTickValue+m_fOffset_LogicToScreen)*m_fStrech_LogicToScreen);
+ return aRet;
+}
+
+void TickFactory_2D::addPointSequenceForTickLine( drawing::PointSequenceSequence& rPoints
+ , sal_Int32 nSequenceIndex
+ , double fScaledLogicTickValue, double fInnerDirectionSign
+ , const TickmarkProperties& rTickmarkProperties
+ , bool bPlaceAtLabels ) const
+{
+ if( fInnerDirectionSign==0.0 )
+ fInnerDirectionSign = 1.0;
+
+ B2DVector aTickScreenPosition = this->getTickScreenPosition2D(fScaledLogicTickValue);
+ if( bPlaceAtLabels )
+ aTickScreenPosition += m_aAxisLineToLabelLineShift;
+
+ B2DVector aMainDirection = m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D;
+ aMainDirection.normalize();
+ B2DVector aOrthoDirection(-aMainDirection.getY(),aMainDirection.getX());
+ aOrthoDirection *= fInnerDirectionSign;
+ aOrthoDirection.normalize();
+
+ B2DVector aStart = aTickScreenPosition + aOrthoDirection*rTickmarkProperties.RelativePos;
+ B2DVector aEnd = aStart - aOrthoDirection*rTickmarkProperties.Length;
+
+ rPoints[nSequenceIndex].realloc(2);
+ rPoints[nSequenceIndex][0].X = static_cast<sal_Int32>(aStart.getX());
+ rPoints[nSequenceIndex][0].Y = static_cast<sal_Int32>(aStart.getY());
+ rPoints[nSequenceIndex][1].X = static_cast<sal_Int32>(aEnd.getX());
+ rPoints[nSequenceIndex][1].Y = static_cast<sal_Int32>(aEnd.getY());
+}
+
+B2DVector TickFactory_2D::getDistanceAxisTickToText( const AxisProperties& rAxisProperties, bool bIncludeFarAwayDistanceIfSo, bool bIncludeSpaceBetweenTickAndText ) const
+{
+ bool bFarAwayLabels = false;
+ if( ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START == rAxisProperties.m_eLabelPos
+ || ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END == rAxisProperties.m_eLabelPos )
+ bFarAwayLabels = true;
+
+ double fInnerDirectionSign = rAxisProperties.m_fInnerDirectionSign;
+ if( fInnerDirectionSign==0.0 )
+ fInnerDirectionSign = 1.0;
+
+ B2DVector aMainDirection = m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D;
+ aMainDirection.normalize();
+ B2DVector aOrthoDirection(-aMainDirection.getY(),aMainDirection.getX());
+ aOrthoDirection *= fInnerDirectionSign;
+ aOrthoDirection.normalize();
+
+ B2DVector aStart(0,0), aEnd(0,0);
+ if( bFarAwayLabels )
+ {
+ TickmarkProperties aProps( AxisProperties::getBiggestTickmarkProperties() );
+ aStart = aOrthoDirection*aProps.RelativePos;
+ aEnd = aStart - aOrthoDirection*aProps.Length;
+ }
+ else
+ {
+ for( sal_Int32 nN=rAxisProperties.m_aTickmarkPropertiesList.size();nN--;)
+ {
+ const TickmarkProperties& rProps = rAxisProperties.m_aTickmarkPropertiesList[nN];
+ B2DVector aNewStart = aOrthoDirection*rProps.RelativePos;
+ B2DVector aNewEnd = aNewStart - aOrthoDirection*rProps.Length;
+ if(aNewStart.getLength()>aStart.getLength())
+ aStart=aNewStart;
+ if(aNewEnd.getLength()>aEnd.getLength())
+ aEnd=aNewEnd;
+ }
+ }
+
+ B2DVector aLabelDirection(aStart);
+ if( rAxisProperties.m_fInnerDirectionSign != rAxisProperties.m_fLabelDirectionSign )
+ aLabelDirection = aEnd;
+
+ B2DVector aOrthoLabelDirection(aOrthoDirection);
+ if( rAxisProperties.m_fInnerDirectionSign != rAxisProperties.m_fLabelDirectionSign )
+ aOrthoLabelDirection*=-1.0;
+ aOrthoLabelDirection.normalize();
+ if( bIncludeSpaceBetweenTickAndText )
+ aLabelDirection += aOrthoLabelDirection*AXIS2D_TICKLABELSPACING;
+ if( bFarAwayLabels && bIncludeFarAwayDistanceIfSo )
+ aLabelDirection += m_aAxisLineToLabelLineShift;
+ return aLabelDirection;
+}
+
+void TickFactory_2D::createPointSequenceForAxisMainLine( drawing::PointSequenceSequence& rPoints ) const
+{
+ rPoints[0].realloc(2);
+ rPoints[0][0].X = static_cast<sal_Int32>(m_aAxisStartScreenPosition2D.getX());
+ rPoints[0][0].Y = static_cast<sal_Int32>(m_aAxisStartScreenPosition2D.getY());
+ rPoints[0][1].X = static_cast<sal_Int32>(m_aAxisEndScreenPosition2D.getX());
+ rPoints[0][1].Y = static_cast<sal_Int32>(m_aAxisEndScreenPosition2D.getY());
+}
+
+void TickFactory_2D::updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ //get the transformed screen values for all tickmarks in rAllTickInfos
+ ::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = rAllTickInfos.begin();
+ const ::std::vector< ::std::vector< TickInfo > >::const_iterator aDepthEnd = rAllTickInfos.end();
+ for( ; aDepthIter != aDepthEnd; aDepthIter++ )
+ {
+ ::std::vector< TickInfo >::iterator aTickIter = (*aDepthIter).begin();
+ const ::std::vector< TickInfo >::const_iterator aTickEnd = (*aDepthIter).end();
+ for( ; aTickIter != aTickEnd; aTickIter++ )
+ {
+ TickInfo& rTickInfo = (*aTickIter);
+ rTickInfo.aTickScreenPosition =
+ this->getTickScreenPosition2D( rTickInfo.fScaledTickValue );
+ }
+ }
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/axes/Tickmarks.hxx b/chart2/source/view/axes/Tickmarks.hxx
new file mode 100644
index 000000000000..62fa5fef92d0
--- /dev/null
+++ b/chart2/source/view/axes/Tickmarks.hxx
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CHART2_TICKMARKS_HXX
+#define _CHART2_TICKMARKS_HXX
+
+#include "TickmarkProperties.hxx"
+#include "VAxisProperties.hxx"
+#include "chartview/ExplicitScaleValues.hxx"
+#include <basegfx/vector/b2dvector.hxx>
+#include <com/sun/star/drawing/PointSequenceSequence.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/uno/Sequence.h>
+
+#include <vector>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+using ::basegfx::B2DVector;
+//-----------------------------------------------------------------------------
+/**
+*/
+
+struct TickInfo
+{
+ double fScaledTickValue;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XScaling > xInverseScaling;
+
+ ::basegfx::B2DVector aTickScreenPosition;
+ bool bPaintIt;
+
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape > xTextShape;
+
+ rtl::OUString aText;//used only for complex categories so far
+ sal_Int32 nFactorForLimitedTextWidth;//categories in higher levels of complex categories can have more place than a single simple category
+
+//methods:
+ TickInfo( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XScaling >& xInverseScaling );
+
+ double getUnscaledTickValue() const;
+ sal_Int32 getScreenDistanceBetweenTicks( const TickInfo& rOherTickInfo ) const;
+private:
+ TickInfo();
+};
+class TickIter
+{
+public:
+ virtual ~TickIter(){};
+ virtual TickInfo* firstInfo()=0;
+ virtual TickInfo* nextInfo()=0;
+};
+
+class PureTickIter : public TickIter
+{
+public:
+ PureTickIter( ::std::vector< TickInfo >& rTickInfoVector );
+ virtual ~PureTickIter();
+ virtual TickInfo* firstInfo();
+ virtual TickInfo* nextInfo();
+
+private:
+ ::std::vector< TickInfo >& m_rTickVector;
+ ::std::vector< TickInfo >::iterator m_aTickIter;
+};
+
+class TickFactory
+{
+public:
+ TickFactory(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement );
+ virtual ~TickFactory();
+
+ void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+ void getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+ virtual void updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& /*rAllTickInfos*/ ) const {}
+
+private: //methods
+ bool isDateAxis() const;
+
+protected: //member
+ ExplicitScaleData m_rScale;
+ ExplicitIncrementData m_rIncrement;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling >
+ m_xInverseScaling;
+
+ //minimum and maximum of the visible range after scaling
+ double m_fScaledVisibleMin;
+ double m_fScaledVisibleMax;
+};
+
+class TickFactory_2D : public TickFactory
+{
+public:
+ TickFactory_2D(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement
+ , const ::basegfx::B2DVector& rStartScreenPos, const ::basegfx::B2DVector& rEndScreenPos
+ , const ::basegfx::B2DVector& rAxisLineToLabelLineShift );
+ //, double fStrech_SceneToScreen, double fOffset_SceneToScreen );
+ virtual ~TickFactory_2D();
+
+ static sal_Int32 getTickScreenDistance( TickIter& rIter );
+
+ void createPointSequenceForAxisMainLine( ::com::sun::star::drawing::PointSequenceSequence& rPoints ) const;
+ void addPointSequenceForTickLine( ::com::sun::star::drawing::PointSequenceSequence& rPoints
+ , sal_Int32 nSequenceIndex
+ , double fScaledLogicTickValue, double fInnerDirectionSign
+ , const TickmarkProperties& rTickmarkProperties, bool bPlaceAtLabels ) const;
+ ::basegfx::B2DVector getDistanceAxisTickToText( const AxisProperties& rAxisProperties
+ , bool bIncludeFarAwayDistanceIfSo = false
+ , bool bIncludeSpaceBetweenTickAndText = true ) const;
+
+ virtual void updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+
+ bool isHorizontalAxis() const;
+ bool isVerticalAxis() const;
+
+protected: //methods
+ ::basegfx::B2DVector getTickScreenPosition2D( double fScaledLogicTickValue ) const;
+
+private: //member
+ ::basegfx::B2DVector m_aAxisStartScreenPosition2D;
+ ::basegfx::B2DVector m_aAxisEndScreenPosition2D;
+
+ //labels might be posioned high or low on the border of the diagram far away from the axis
+ //add this vector to go from the axis line to the label line (border of the diagram)
+ ::basegfx::B2DVector m_aAxisLineToLabelLineShift;
+
+ double m_fStrech_LogicToScreen;
+ double m_fOffset_LogicToScreen;
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
diff --git a/chart2/source/view/axes/Tickmarks_Dates.cxx b/chart2/source/view/axes/Tickmarks_Dates.cxx
new file mode 100644
index 000000000000..b5177fe307b8
--- /dev/null
+++ b/chart2/source/view/axes/Tickmarks_Dates.cxx
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+#include "Tickmarks_Dates.hxx"
+#include "DateScaling.hxx"
+#include <rtl/math.hxx>
+#include <tools/debug.hxx>
+#include "DateHelper.hxx"
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+using namespace ::rtl::math;
+using ::basegfx::B2DVector;
+using ::com::sun::star::chart::TimeUnit::DAY;
+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 )
+ , m_xInverseScaling(NULL)
+{
+ //@todo: make sure that the scale is valid for the scaling
+
+ if( m_aScale.Scaling.is() )
+ {
+ m_xInverseScaling = m_aScale.Scaling->getInverseScaling();
+ DBG_ASSERT( m_xInverseScaling.is(), "each Scaling needs to return a inverse Scaling" );
+ }
+
+ m_fScaledVisibleMin = m_aScale.Minimum;
+ if( m_xInverseScaling.is() )
+ m_fScaledVisibleMin = m_aScale.Scaling->doScaling(m_fScaledVisibleMin);
+
+ m_fScaledVisibleMax = m_aScale.Maximum;
+ if( m_xInverseScaling.is() )
+ m_fScaledVisibleMax = m_aScale.Scaling->doScaling(m_fScaledVisibleMax);
+}
+
+DateTickFactory::~DateTickFactory()
+{
+}
+
+void DateTickFactory::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos, bool bShifted ) const
+{
+ rAllTickInfos.resize(2);
+ ::std::vector< TickInfo >& rMajorTicks = rAllTickInfos[0];
+ ::std::vector< TickInfo >& rMinorTicks = rAllTickInfos[1];
+ rMajorTicks.clear();
+ rMinorTicks.clear();
+
+ Date aNull(m_aScale.NullDate);
+
+ Date aDate = aNull + ::rtl::math::approxFloor(m_aScale.Minimum);
+ Date aMaxDate = aNull + ::rtl::math::approxFloor(m_aScale.Maximum);
+
+ uno::Reference< chart2::XScaling > xScaling(m_aScale.Scaling);
+ uno::Reference< chart2::XScaling > xInverseScaling(m_xInverseScaling);
+ if( bShifted )
+ {
+ xScaling = new DateScaling(aNull,m_aScale.TimeResolution,true/*bShifted*/);
+ xInverseScaling = xScaling->getInverseScaling();
+ }
+
+ //create major date tickinfos
+ while( aDate<= aMaxDate )
+ {
+ if( bShifted && aDate==aMaxDate )
+ break;
+
+ TickInfo aNewTick(xInverseScaling); aNewTick.fScaledTickValue = aDate - aNull;
+
+ if( xInverseScaling.is() )
+ aNewTick.fScaledTickValue = xScaling->doScaling(aNewTick.fScaledTickValue);
+ rMajorTicks.push_back( aNewTick );
+
+ if(m_aIncrement.MajorTimeInterval.Number<=0)
+ break;
+
+ //find next major date
+ switch( m_aIncrement.MajorTimeInterval.TimeUnit )
+ {
+ case DAY:
+ aDate += m_aIncrement.MajorTimeInterval.Number;
+ break;
+ case YEAR:
+ aDate = DateHelper::GetDateSomeYearsAway( aDate, m_aIncrement.MajorTimeInterval.Number );
+ break;
+ case MONTH:
+ default:
+ aDate = DateHelper::GetDateSomeMonthsAway( aDate, m_aIncrement.MajorTimeInterval.Number );
+ break;
+ }
+ }
+
+ //create minor date tickinfos
+ aDate = aNull + ::rtl::math::approxFloor(m_aScale.Minimum);
+ while( aDate<= aMaxDate )
+ {
+ if( bShifted && aDate==aMaxDate )
+ break;
+
+ TickInfo aNewTick(xInverseScaling); aNewTick.fScaledTickValue = aDate - aNull;
+ if( xInverseScaling.is() )
+ aNewTick.fScaledTickValue = xScaling->doScaling(aNewTick.fScaledTickValue);
+ rMinorTicks.push_back( aNewTick );
+
+ if(m_aIncrement.MinorTimeInterval.Number<=0)
+ break;
+
+ //find next minor date
+ switch( m_aIncrement.MinorTimeInterval.TimeUnit )
+ {
+ case DAY:
+ aDate += m_aIncrement.MinorTimeInterval.Number;
+ break;
+ case YEAR:
+ aDate = DateHelper::GetDateSomeYearsAway( aDate, m_aIncrement.MinorTimeInterval.Number );
+ break;
+ case MONTH:
+ default:
+ aDate = DateHelper::GetDateSomeMonthsAway( aDate, m_aIncrement.MinorTimeInterval.Number );
+ break;
+ }
+ }
+}
+
+void DateTickFactory::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ getAllTicks( rAllTickInfos, false );
+}
+
+void DateTickFactory::getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ getAllTicks( rAllTickInfos, true );
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/axes/Tickmarks_Dates.hxx b/chart2/source/view/axes/Tickmarks_Dates.hxx
new file mode 100644
index 000000000000..464e8b4ca24c
--- /dev/null
+++ b/chart2/source/view/axes/Tickmarks_Dates.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CHART2_TICKMARKS_DATES_HXX
+#define _CHART2_TICKMARKS_DATES_HXX
+
+#include "Tickmarks.hxx"
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+class DateTickFactory
+{
+public:
+ DateTickFactory(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement );
+ ~DateTickFactory();
+
+ void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+ void getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+
+private: //methods
+ void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos, bool bShifted ) const;
+
+private: //member
+ ExplicitScaleData m_aScale;
+ ExplicitIncrementData m_aIncrement;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling >
+ m_xInverseScaling;
+
+ //minimum and maximum of the visible range after scaling
+ double m_fScaledVisibleMin;
+ double m_fScaledVisibleMax;
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
diff --git a/chart2/source/view/axes/Tickmarks_Equidistant.cxx b/chart2/source/view/axes/Tickmarks_Equidistant.cxx
new file mode 100644
index 000000000000..9344af1ffac9
--- /dev/null
+++ b/chart2/source/view/axes/Tickmarks_Equidistant.cxx
@@ -0,0 +1,671 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+#include "Tickmarks_Equidistant.hxx"
+#include "ViewDefines.hxx"
+#include <rtl/math.hxx>
+#include <tools/debug.hxx>
+#include <memory>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+using namespace ::rtl::math;
+using ::basegfx::B2DVector;
+
+//static
+double EquidistantTickFactory::getMinimumAtIncrement( double fMin, const ExplicitIncrementData& rIncrement )
+{
+ //the returned value will be <= fMin and on a Major Tick given by rIncrement
+ if(rIncrement.Distance<=0.0)
+ return fMin;
+
+ double fRet = rIncrement.BaseValue +
+ floor( approxSub( fMin, rIncrement.BaseValue )
+ / rIncrement.Distance)
+ *rIncrement.Distance;
+
+ if( fRet > fMin )
+ {
+ if( !approxEqual(fRet, fMin) )
+ fRet -= rIncrement.Distance;
+ }
+ return fRet;
+}
+//static
+double EquidistantTickFactory::getMaximumAtIncrement( double fMax, const ExplicitIncrementData& rIncrement )
+{
+ //the returned value will be >= fMax and on a Major Tick given by rIncrement
+ if(rIncrement.Distance<=0.0)
+ return fMax;
+
+ double fRet = rIncrement.BaseValue +
+ floor( approxSub( fMax, rIncrement.BaseValue )
+ / rIncrement.Distance)
+ *rIncrement.Distance;
+
+ if( fRet < fMax )
+ {
+ if( !approxEqual(fRet, fMax) )
+ fRet += rIncrement.Distance;
+ }
+ return fRet;
+}
+
+EquidistantTickFactory::EquidistantTickFactory(
+ const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement )
+ : m_rScale( rScale )
+ , m_rIncrement( rIncrement )
+ , m_xInverseScaling(NULL)
+ , m_pfCurrentValues(NULL)
+{
+ //@todo: make sure that the scale is valid for the scaling
+
+ m_pfCurrentValues = new double[getTickDepth()];
+
+ if( m_rScale.Scaling.is() )
+ {
+ m_xInverseScaling = m_rScale.Scaling->getInverseScaling();
+ DBG_ASSERT( m_xInverseScaling.is(), "each Scaling needs to return a inverse Scaling" );
+ }
+
+ double fMin = m_fScaledVisibleMin = m_rScale.Minimum;
+ if( m_xInverseScaling.is() )
+ {
+ m_fScaledVisibleMin = m_rScale.Scaling->doScaling(m_fScaledVisibleMin);
+ if(m_rIncrement.PostEquidistant )
+ fMin = m_fScaledVisibleMin;
+ }
+
+ double fMax = m_fScaledVisibleMax = m_rScale.Maximum;
+ if( m_xInverseScaling.is() )
+ {
+ m_fScaledVisibleMax = m_rScale.Scaling->doScaling(m_fScaledVisibleMax);
+ if(m_rIncrement.PostEquidistant )
+ fMax = m_fScaledVisibleMax;
+ }
+
+ //--
+ m_fOuterMajorTickBorderMin = EquidistantTickFactory::getMinimumAtIncrement( fMin, m_rIncrement );
+ m_fOuterMajorTickBorderMax = EquidistantTickFactory::getMaximumAtIncrement( fMax, m_rIncrement );
+ //--
+
+ m_fOuterMajorTickBorderMin_Scaled = m_fOuterMajorTickBorderMin;
+ m_fOuterMajorTickBorderMax_Scaled = m_fOuterMajorTickBorderMax;
+ if(!m_rIncrement.PostEquidistant && m_xInverseScaling.is() )
+ {
+ m_fOuterMajorTickBorderMin_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMin);
+ m_fOuterMajorTickBorderMax_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMax);
+
+ //check validity of new range: m_fOuterMajorTickBorderMin <-> m_fOuterMajorTickBorderMax
+ //it is assumed here, that the original range in the given Scale is valid
+ if( !rtl::math::isFinite(m_fOuterMajorTickBorderMin_Scaled) )
+ {
+ m_fOuterMajorTickBorderMin += m_rIncrement.Distance;
+ m_fOuterMajorTickBorderMin_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMin);
+ }
+ if( !rtl::math::isFinite(m_fOuterMajorTickBorderMax_Scaled) )
+ {
+ m_fOuterMajorTickBorderMax -= m_rIncrement.Distance;
+ m_fOuterMajorTickBorderMax_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMax);
+ }
+ }
+}
+
+EquidistantTickFactory::~EquidistantTickFactory()
+{
+ delete[] m_pfCurrentValues;
+}
+
+sal_Int32 EquidistantTickFactory::getTickDepth() const
+{
+ return static_cast<sal_Int32>(m_rIncrement.SubIncrements.size()) + 1;
+}
+
+void EquidistantTickFactory::addSubTicks( sal_Int32 nDepth, uno::Sequence< uno::Sequence< double > >& rParentTicks ) const
+{
+ EquidistantTickIter aIter( rParentTicks, m_rIncrement, 0, nDepth-1 );
+ double* pfNextParentTick = aIter.firstValue();
+ if(!pfNextParentTick)
+ return;
+ double fLastParentTick = *pfNextParentTick;
+ pfNextParentTick = aIter.nextValue();
+ if(!pfNextParentTick)
+ return;
+
+ sal_Int32 nMaxSubTickCount = this->getMaxTickCount( nDepth );
+ if(!nMaxSubTickCount)
+ return;
+
+ uno::Sequence< double > aSubTicks(nMaxSubTickCount);
+ sal_Int32 nRealSubTickCount = 0;
+ sal_Int32 nIntervalCount = m_rIncrement.SubIncrements[nDepth-1].IntervalCount;
+
+ double* pValue = NULL;
+ for(; pfNextParentTick; fLastParentTick=*pfNextParentTick, pfNextParentTick = aIter.nextValue())
+ {
+ for( sal_Int32 nPartTick = 1; nPartTick<nIntervalCount; nPartTick++ )
+ {
+ pValue = this->getMinorTick( nPartTick, nDepth
+ , fLastParentTick, *pfNextParentTick );
+ if(!pValue)
+ continue;
+
+ aSubTicks[nRealSubTickCount] = *pValue;
+ nRealSubTickCount++;
+ }
+ }
+
+ aSubTicks.realloc(nRealSubTickCount);
+ rParentTicks[nDepth] = aSubTicks;
+ if(static_cast<sal_Int32>(m_rIncrement.SubIncrements.size())>nDepth)
+ addSubTicks( nDepth+1, rParentTicks );
+}
+
+
+sal_Int32 EquidistantTickFactory::getMaxTickCount( sal_Int32 nDepth ) const
+{
+ //return the maximum amount of ticks
+ //possibly open intervals at the two ends of the region are handled as if they were completely visible
+ //(this is necessary for calculating the sub ticks at the borders correctly)
+
+ if( nDepth >= getTickDepth() )
+ return 0;
+ if( m_fOuterMajorTickBorderMax < m_fOuterMajorTickBorderMin )
+ return 0;
+ if( m_rIncrement.Distance<=0.0)
+ return 0;
+
+ double fSub;
+ if(m_rIncrement.PostEquidistant )
+ fSub = approxSub( m_fScaledVisibleMax, m_fScaledVisibleMin );
+ else
+ fSub = approxSub( m_rScale.Maximum, m_rScale.Minimum );
+
+ if (!isFinite(fSub))
+ return 0;
+
+ sal_Int32 nIntervalCount = static_cast<sal_Int32>( fSub / m_rIncrement.Distance );
+
+ nIntervalCount+=3;
+ for(sal_Int32 nN=0; nN<nDepth-1; nN++)
+ {
+ if( m_rIncrement.SubIncrements[nN].IntervalCount>1 )
+ nIntervalCount *= m_rIncrement.SubIncrements[nN].IntervalCount;
+ }
+
+ sal_Int32 nTickCount = nIntervalCount;
+ if(nDepth>0 && m_rIncrement.SubIncrements[nDepth-1].IntervalCount>1)
+ nTickCount = nIntervalCount * (m_rIncrement.SubIncrements[nDepth-1].IntervalCount-1);
+
+ return nTickCount;
+}
+
+double* EquidistantTickFactory::getMajorTick( sal_Int32 nTick ) const
+{
+ m_pfCurrentValues[0] = m_fOuterMajorTickBorderMin + nTick*m_rIncrement.Distance;
+
+ if(m_pfCurrentValues[0]>m_fOuterMajorTickBorderMax)
+ {
+ if( !approxEqual(m_pfCurrentValues[0],m_fOuterMajorTickBorderMax) )
+ return NULL;
+ }
+ if(m_pfCurrentValues[0]<m_fOuterMajorTickBorderMin)
+ {
+ if( !approxEqual(m_pfCurrentValues[0],m_fOuterMajorTickBorderMin) )
+ return NULL;
+ }
+
+ //return always the value after scaling
+ if(!m_rIncrement.PostEquidistant && m_xInverseScaling.is() )
+ m_pfCurrentValues[0] = m_rScale.Scaling->doScaling( m_pfCurrentValues[0] );
+
+ return &m_pfCurrentValues[0];
+}
+
+double* EquidistantTickFactory::getMinorTick( sal_Int32 nTick, sal_Int32 nDepth
+ , double fStartParentTick, double fNextParentTick ) const
+{
+ //check validity of arguments
+ {
+ //DBG_ASSERT( fStartParentTick < fNextParentTick, "fStartParentTick >= fNextParentTick");
+ if(fStartParentTick >= fNextParentTick)
+ return NULL;
+ if(nDepth>static_cast<sal_Int32>(m_rIncrement.SubIncrements.size()) || nDepth<=0)
+ return NULL;
+
+ //subticks are only calculated if they are laying between parent ticks:
+ if(nTick<=0)
+ return NULL;
+ if(nTick>=m_rIncrement.SubIncrements[nDepth-1].IntervalCount)
+ return NULL;
+ }
+
+ bool bPostEquidistant = m_rIncrement.SubIncrements[nDepth-1].PostEquidistant;
+
+ double fAdaptedStartParent = fStartParentTick;
+ double fAdaptedNextParent = fNextParentTick;
+
+ if( !bPostEquidistant && m_xInverseScaling.is() )
+ {
+ fAdaptedStartParent = m_xInverseScaling->doScaling(fStartParentTick);
+ fAdaptedNextParent = m_xInverseScaling->doScaling(fNextParentTick);
+ }
+
+ double fDistance = (fAdaptedNextParent - fAdaptedStartParent)/m_rIncrement.SubIncrements[nDepth-1].IntervalCount;
+
+ m_pfCurrentValues[nDepth] = fAdaptedStartParent + nTick*fDistance;
+
+ //return always the value after scaling
+ if(!bPostEquidistant && m_xInverseScaling.is() )
+ m_pfCurrentValues[nDepth] = m_rScale.Scaling->doScaling( m_pfCurrentValues[nDepth] );
+
+ if( !isWithinOuterBorder( m_pfCurrentValues[nDepth] ) )
+ return NULL;
+
+ return &m_pfCurrentValues[nDepth];
+}
+
+bool EquidistantTickFactory::isWithinOuterBorder( double fScaledValue ) const
+{
+ if(fScaledValue>m_fOuterMajorTickBorderMax_Scaled)
+ return false;
+ if(fScaledValue<m_fOuterMajorTickBorderMin_Scaled)
+ return false;
+
+ return true;
+}
+
+bool EquidistantTickFactory::isVisible( double fScaledValue ) const
+{
+ if(fScaledValue>m_fScaledVisibleMax)
+ {
+ if( !approxEqual(fScaledValue,m_fScaledVisibleMax) )
+ return false;
+ }
+ if(fScaledValue<m_fScaledVisibleMin)
+ {
+ if( !approxEqual(fScaledValue,m_fScaledVisibleMin) )
+ return false;
+ }
+ return true;
+}
+
+void EquidistantTickFactory::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ uno::Sequence< uno::Sequence< double > > aAllTicks;
+
+ //create point sequences for each tick depth
+ sal_Int32 nDepthCount = this->getTickDepth();
+ sal_Int32 nMaxMajorTickCount = this->getMaxTickCount( 0 );
+
+ aAllTicks.realloc(nDepthCount);
+ aAllTicks[0].realloc(nMaxMajorTickCount);
+
+ sal_Int32 nRealMajorTickCount = 0;
+ double* pValue = NULL;
+ for( sal_Int32 nMajorTick=0; nMajorTick<nMaxMajorTickCount; nMajorTick++ )
+ {
+ pValue = this->getMajorTick( nMajorTick );
+ if(!pValue)
+ continue;
+ aAllTicks[0][nRealMajorTickCount] = *pValue;
+ nRealMajorTickCount++;
+ }
+ if(!nRealMajorTickCount)
+ return;
+ aAllTicks[0].realloc(nRealMajorTickCount);
+
+ if(nDepthCount>0)
+ this->addSubTicks( 1, aAllTicks );
+
+ //so far we have added all ticks between the outer major tick marks
+ //this was necessary to create sub ticks correctly
+ //now we reduce all ticks to the visible ones that lie between the real borders
+ sal_Int32 nDepth = 0;
+ sal_Int32 nTick = 0;
+ for( nDepth = 0; nDepth < nDepthCount; nDepth++)
+ {
+ sal_Int32 nInvisibleAtLowerBorder = 0;
+ sal_Int32 nInvisibleAtUpperBorder = 0;
+ //we need only to check all ticks within the first major interval at each border
+ sal_Int32 nCheckCount = 1;
+ for(sal_Int32 nN=0; nN<nDepth; nN++)
+ {
+ if( m_rIncrement.SubIncrements[nN].IntervalCount>1 )
+ nCheckCount *= m_rIncrement.SubIncrements[nN].IntervalCount;
+ }
+ uno::Sequence< double >& rTicks = aAllTicks[nDepth];
+ sal_Int32 nCount = rTicks.getLength();
+ //check lower border
+ for( nTick=0; nTick<nCheckCount && nTick<nCount; nTick++)
+ {
+ if( !isVisible( rTicks[nTick] ) )
+ nInvisibleAtLowerBorder++;
+ }
+ //check upper border
+ for( nTick=nCount-1; nTick>nCount-1-nCheckCount && nTick>=0; nTick--)
+ {
+ if( !isVisible( rTicks[nTick] ) )
+ nInvisibleAtUpperBorder++;
+ }
+ //resize sequence
+ if( !nInvisibleAtLowerBorder && !nInvisibleAtUpperBorder)
+ continue;
+ if( !nInvisibleAtLowerBorder )
+ rTicks.realloc(nCount-nInvisibleAtUpperBorder);
+ else
+ {
+ sal_Int32 nNewCount = nCount-nInvisibleAtUpperBorder-nInvisibleAtLowerBorder;
+ if(nNewCount<0)
+ nNewCount=0;
+
+ uno::Sequence< double > aOldTicks(rTicks);
+ rTicks.realloc(nNewCount);
+ for(nTick = 0; nTick<nNewCount; nTick++)
+ rTicks[nTick] = aOldTicks[nInvisibleAtLowerBorder+nTick];
+ }
+ }
+
+ //fill return value
+ rAllTickInfos.resize(aAllTicks.getLength());
+ for( nDepth=0 ;nDepth<aAllTicks.getLength(); nDepth++ )
+ {
+ sal_Int32 nCount = aAllTicks[nDepth].getLength();
+
+ ::std::vector< TickInfo >& rTickInfoVector = rAllTickInfos[nDepth];
+ rTickInfoVector.clear();
+ rTickInfoVector.reserve( nCount );
+ for(sal_Int32 nN = 0; nN<nCount; nN++)
+ {
+ TickInfo aTickInfo(m_xInverseScaling);
+ aTickInfo.fScaledTickValue = aAllTicks[nDepth][nN];
+ rTickInfoVector.push_back(aTickInfo);
+ }
+ }
+}
+
+void EquidistantTickFactory::getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
+{
+ ExplicitIncrementData aShiftedIncrement( m_rIncrement );
+ aShiftedIncrement.BaseValue = m_rIncrement.BaseValue-m_rIncrement.Distance/2.0;
+ EquidistantTickFactory( m_rScale, aShiftedIncrement ).getAllTicks(rAllTickInfos);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+EquidistantTickIter::EquidistantTickIter( const uno::Sequence< uno::Sequence< double > >& rTicks
+ , const ExplicitIncrementData& rIncrement
+ , sal_Int32 nMinDepth, sal_Int32 nMaxDepth )
+ : m_pSimpleTicks(&rTicks)
+ , m_pInfoTicks(0)
+ , m_rIncrement(rIncrement)
+ , m_nMinDepth(0), m_nMaxDepth(0)
+ , m_nTickCount(0), m_pnPositions(NULL)
+ , m_pnPreParentCount(NULL), m_pbIntervalFinished(NULL)
+ , m_nCurrentDepth(-1), m_nCurrentPos(-1), m_fCurrentValue( 0.0 )
+{
+ initIter( nMinDepth, nMaxDepth );
+}
+
+EquidistantTickIter::EquidistantTickIter( ::std::vector< ::std::vector< TickInfo > >& rTicks
+ , const ExplicitIncrementData& rIncrement
+ , sal_Int32 nMinDepth, sal_Int32 nMaxDepth )
+ : m_pSimpleTicks(NULL)
+ , m_pInfoTicks(&rTicks)
+ , m_rIncrement(rIncrement)
+ , m_nMinDepth(0), m_nMaxDepth(0)
+ , m_nTickCount(0), m_pnPositions(NULL)
+ , m_pnPreParentCount(NULL), m_pbIntervalFinished(NULL)
+ , m_nCurrentDepth(-1), m_nCurrentPos(-1), m_fCurrentValue( 0.0 )
+{
+ initIter( nMinDepth, nMaxDepth );
+}
+
+void EquidistantTickIter::initIter( sal_Int32 /*nMinDepth*/, sal_Int32 nMaxDepth )
+{
+ m_nMaxDepth = nMaxDepth;
+ if(nMaxDepth<0 || m_nMaxDepth>getMaxDepth())
+ m_nMaxDepth=getMaxDepth();
+
+ sal_Int32 nDepth = 0;
+ for( nDepth = 0; nDepth<=m_nMaxDepth ;nDepth++ )
+ m_nTickCount += getTickCount(nDepth);
+
+ if(!m_nTickCount)
+ return;
+
+ m_pnPositions = new sal_Int32[m_nMaxDepth+1];
+
+ m_pnPreParentCount = new sal_Int32[m_nMaxDepth+1];
+ m_pbIntervalFinished = new bool[m_nMaxDepth+1];
+ m_pnPreParentCount[0] = 0;
+ m_pbIntervalFinished[0] = false;
+ double fParentValue = getTickValue(0,0);
+ for( nDepth = 1; nDepth<=m_nMaxDepth ;nDepth++ )
+ {
+ m_pbIntervalFinished[nDepth] = false;
+
+ sal_Int32 nPreParentCount = 0;
+ sal_Int32 nCount = getTickCount(nDepth);
+ for(sal_Int32 nN = 0; nN<nCount; nN++)
+ {
+ if(getTickValue(nDepth,nN) < fParentValue)
+ nPreParentCount++;
+ else
+ break;
+ }
+ m_pnPreParentCount[nDepth] = nPreParentCount;
+ if(nCount)
+ {
+ double fNextParentValue = getTickValue(nDepth,0);
+ if( fNextParentValue < fParentValue )
+ fParentValue = fNextParentValue;
+ }
+ }
+}
+
+EquidistantTickIter::~EquidistantTickIter()
+{
+ delete[] m_pnPositions;
+ delete[] m_pnPreParentCount;
+ delete[] m_pbIntervalFinished;
+}
+
+sal_Int32 EquidistantTickIter::getStartDepth() const
+{
+ //find the depth of the first visible tickmark:
+ //it is the depth of the smallest value
+ sal_Int32 nReturnDepth=0;
+ double fMinValue = DBL_MAX;
+ for(sal_Int32 nDepth = 0; nDepth<=m_nMaxDepth ;nDepth++ )
+ {
+ sal_Int32 nCount = getTickCount(nDepth);
+ if( !nCount )
+ continue;
+ double fThisValue = getTickValue(nDepth,0);
+ if(fThisValue<fMinValue)
+ {
+ nReturnDepth = nDepth;
+ fMinValue = fThisValue;
+ }
+ }
+ return nReturnDepth;
+}
+
+double* EquidistantTickIter::firstValue()
+{
+ if( gotoFirst() )
+ {
+ m_fCurrentValue = getTickValue(m_nCurrentDepth, m_pnPositions[m_nCurrentDepth]);
+ return &m_fCurrentValue;
+ }
+ return NULL;
+}
+
+TickInfo* EquidistantTickIter::firstInfo()
+{
+ if( m_pInfoTicks && gotoFirst() )
+ return &(*m_pInfoTicks)[m_nCurrentDepth][m_pnPositions[m_nCurrentDepth]];
+ return NULL;
+}
+
+sal_Int32 EquidistantTickIter::getIntervalCount( sal_Int32 nDepth )
+{
+ if(nDepth>static_cast<sal_Int32>(m_rIncrement.SubIncrements.size()) || nDepth<0)
+ return 0;
+
+ if(!nDepth)
+ return m_nTickCount;
+
+ return m_rIncrement.SubIncrements[nDepth-1].IntervalCount;
+}
+
+bool EquidistantTickIter::isAtLastPartTick()
+{
+ if(!m_nCurrentDepth)
+ return false;
+ sal_Int32 nIntervalCount = getIntervalCount( m_nCurrentDepth );
+ if(!nIntervalCount || nIntervalCount == 1)
+ return true;
+ if( m_pbIntervalFinished[m_nCurrentDepth] )
+ return false;
+ sal_Int32 nPos = m_pnPositions[m_nCurrentDepth]+1;
+ if(m_pnPreParentCount[m_nCurrentDepth])
+ nPos += nIntervalCount-1 - m_pnPreParentCount[m_nCurrentDepth];
+ bool bRet = nPos && nPos % (nIntervalCount-1) == 0;
+ if(!nPos && !m_pnPreParentCount[m_nCurrentDepth]
+ && m_pnPositions[m_nCurrentDepth-1]==-1 )
+ bRet = true;
+ return bRet;
+}
+
+bool EquidistantTickIter::gotoFirst()
+{
+ if( m_nMaxDepth<0 )
+ return false;
+ if( !m_nTickCount )
+ return false;
+
+ for(sal_Int32 nDepth = 0; nDepth<=m_nMaxDepth ;nDepth++ )
+ m_pnPositions[nDepth] = -1;
+
+ m_nCurrentPos = 0;
+ m_nCurrentDepth = getStartDepth();
+ m_pnPositions[m_nCurrentDepth] = 0;
+ return true;
+}
+
+bool EquidistantTickIter::gotoNext()
+{
+ if( m_nCurrentPos < 0 )
+ return false;
+ m_nCurrentPos++;
+
+ if( m_nCurrentPos >= m_nTickCount )
+ return false;
+
+ if( m_nCurrentDepth==m_nMaxDepth && isAtLastPartTick() )
+ {
+ do
+ {
+ m_pbIntervalFinished[m_nCurrentDepth] = true;
+ m_nCurrentDepth--;
+ }
+ while( m_nCurrentDepth && isAtLastPartTick() );
+ }
+ else if( m_nCurrentDepth<m_nMaxDepth )
+ {
+ do
+ {
+ m_nCurrentDepth++;
+ }
+ while( m_nCurrentDepth<m_nMaxDepth );
+ }
+ m_pbIntervalFinished[m_nCurrentDepth] = false;
+ m_pnPositions[m_nCurrentDepth] = m_pnPositions[m_nCurrentDepth]+1;
+ return true;
+}
+
+bool EquidistantTickIter::gotoIndex( sal_Int32 nTickIndex )
+{
+ if( nTickIndex < 0 )
+ return false;
+ if( nTickIndex >= m_nTickCount )
+ return false;
+
+ if( nTickIndex < m_nCurrentPos )
+ if( !gotoFirst() )
+ return false;
+
+ while( nTickIndex > m_nCurrentPos )
+ if( !gotoNext() )
+ return false;
+
+ return true;
+}
+
+sal_Int32 EquidistantTickIter::getCurrentIndex() const
+{
+ return m_nCurrentPos;
+}
+sal_Int32 EquidistantTickIter::getMaxIndex() const
+{
+ return m_nTickCount-1;
+}
+
+double* EquidistantTickIter::nextValue()
+{
+ if( gotoNext() )
+ {
+ m_fCurrentValue = getTickValue(m_nCurrentDepth, m_pnPositions[m_nCurrentDepth]);
+ return &m_fCurrentValue;
+ }
+ return NULL;
+}
+
+TickInfo* EquidistantTickIter::nextInfo()
+{
+ if( m_pInfoTicks && gotoNext() &&
+ static_cast< sal_Int32 >(
+ (*m_pInfoTicks)[m_nCurrentDepth].size()) > m_pnPositions[m_nCurrentDepth] )
+ {
+ return &(*m_pInfoTicks)[m_nCurrentDepth][m_pnPositions[m_nCurrentDepth]];
+ }
+ return NULL;
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/axes/TickmarkHelper.hxx b/chart2/source/view/axes/Tickmarks_Equidistant.hxx
index 27f7e0ad2086..836a93d28db2 100644
--- a/chart2/source/view/axes/TickmarkHelper.hxx
+++ b/chart2/source/view/axes/Tickmarks_Equidistant.hxx
@@ -1,4 +1,3 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,19 +24,10 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _CHART2_TICKMARKHELPER_HXX
-#define _CHART2_TICKMARKHELPER_HXX
+#ifndef _CHART2_TICKMARKS_EQUIDISTANT_HXX
+#define _CHART2_TICKMARKS_EQUIDISTANT_HXX
-#include "TickmarkProperties.hxx"
-#include "VAxisProperties.hxx"
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
-#include <basegfx/vector/b2dvector.hxx>
-#include <com/sun/star/drawing/PointSequenceSequence.hpp>
-#include <com/sun/star/drawing/XShape.hpp>
-#include <com/sun/star/uno/Sequence.h>
-
-#include <vector>
+#include "Tickmarks.hxx"
//.............................................................................
namespace chart
@@ -49,57 +39,15 @@ using ::basegfx::B2DVector;
/**
*/
-struct TickInfo
-{
- double fScaledTickValue;
- double fUnscaledTickValue;
-
- ::basegfx::B2DVector aTickScreenPosition;
- bool bPaintIt;
-
- ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShape > xTextShape;
-
- rtl::OUString aText;//used only for complex categories so far
- sal_Int32 nFactorForLimitedTextWidth;//categories in higher levels of complex categories can have more place than a single simple category
-
-//methods:
- TickInfo();
- void updateUnscaledValue( const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XScaling >& xInverseScaling );
-
- sal_Int32 getScreenDistanceBetweenTicks( const TickInfo& rOherTickInfo ) const;
-};
-class TickIter
-{
-public:
- virtual ~TickIter(){};
- virtual TickInfo* firstInfo()=0;
- virtual TickInfo* nextInfo()=0;
-};
-
-class PureTickIter : public TickIter
-{
-public:
- PureTickIter( ::std::vector< TickInfo >& rTickInfoVector );
- virtual ~PureTickIter();
- virtual TickInfo* firstInfo();
- virtual TickInfo* nextInfo();
-
-private:
- ::std::vector< TickInfo >& m_rTickVector;
- ::std::vector< TickInfo >::iterator m_aTickIter;
-};
-
class EquidistantTickIter : public TickIter
{
public:
EquidistantTickIter( const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Sequence< double > >& rTicks
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+ , const ExplicitIncrementData& rIncrement
, sal_Int32 nMinDepth=0, sal_Int32 nMaxDepth=-1 );
EquidistantTickIter( ::std::vector< ::std::vector< TickInfo > >& rTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+ , const ExplicitIncrementData& rIncrement
, sal_Int32 nMinDepth=0, sal_Int32 nMaxDepth=-1 );
virtual ~EquidistantTickIter();
@@ -153,7 +101,7 @@ private: //member
const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Sequence< double > >* m_pSimpleTicks;
::std::vector< ::std::vector< TickInfo > >* m_pInfoTicks;
- const ::com::sun::star::chart2::ExplicitIncrementData& m_rIncrement;
+ const ExplicitIncrementData& m_rIncrement;
//iteration from m_nMinDepth to m_nMaxDepth
sal_Int32 m_nMinDepth;
sal_Int32 m_nMaxDepth;
@@ -167,24 +115,21 @@ private: //member
double m_fCurrentValue;
};
-class TickmarkHelper
+class EquidistantTickFactory
{
public:
- TickmarkHelper(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement );
- virtual ~TickmarkHelper();
+ EquidistantTickFactory(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement );
+ ~EquidistantTickFactory();
- virtual TickmarkHelper* createShiftedTickmarkHelper() const;
+ void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+ void getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
- void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
- void getAllTicksShifted( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
+ static double getMinimumAtIncrement( double fMin, const ExplicitIncrementData& rIncrement );
+ static double getMaximumAtIncrement( double fMax, const ExplicitIncrementData& rIncrement );
- //
- static double getMinimumAtIncrement( double fMin, const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement );
- static double getMaximumAtIncrement( double fMax, const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement );
-
-protected: //methods
+private: //methods
void addSubTicks( sal_Int32 nDepth,
::com::sun::star::uno::Sequence<
::com::sun::star::uno::Sequence< double > >& rParentTicks ) const;
@@ -193,87 +138,29 @@ protected: //methods
, double fStartParentTick, double fNextParentTick ) const;
sal_Int32 getMaxTickCount( sal_Int32 nDepth = 0 ) const;
sal_Int32 getTickDepth() const;
+
bool isVisible( double fValue ) const;
bool isWithinOuterBorder( double fScaledValue ) const; //all within the outer major tick marks
- virtual void updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& /*rAllTickInfos*/ ) const {}
-
-protected: //member
- ::com::sun::star::chart2::ExplicitScaleData m_rScale;
- ::com::sun::star::chart2::ExplicitIncrementData m_rIncrement;
-
+private: //member
+ ExplicitScaleData m_rScale;
+ ExplicitIncrementData m_rIncrement;
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling >
m_xInverseScaling;
+
+ //minimum and maximum of the visible range after scaling
+ double m_fScaledVisibleMin;
+ double m_fScaledVisibleMax;
+
double* m_pfCurrentValues;
//major-tick positions that may lay outside the visible range but complete partly visible intervals at the borders
double m_fOuterMajorTickBorderMin;
double m_fOuterMajorTickBorderMax;
double m_fOuterMajorTickBorderMin_Scaled;
double m_fOuterMajorTickBorderMax_Scaled;
-
- //minimum and maximum of the visible range after scaling
- double m_fScaledVisibleMin;
- double m_fScaledVisibleMax;
-};
-
-class TickmarkHelper_2D : public TickmarkHelper
-{
-public:
- TickmarkHelper_2D(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
- , const ::basegfx::B2DVector& rStartScreenPos, const ::basegfx::B2DVector& rEndScreenPos
- , const ::basegfx::B2DVector& rAxisLineToLabelLineShift );
- //, double fStrech_SceneToScreen, double fOffset_SceneToScreen );
- virtual ~TickmarkHelper_2D();
-
- virtual TickmarkHelper* createShiftedTickmarkHelper() const;
-
- static sal_Int32 getTickScreenDistance( TickIter& rIter );
-
- void createPointSequenceForAxisMainLine( ::com::sun::star::drawing::PointSequenceSequence& rPoints ) const;
- void addPointSequenceForTickLine( ::com::sun::star::drawing::PointSequenceSequence& rPoints
- , sal_Int32 nSequenceIndex
- , double fScaledLogicTickValue, double fInnerDirectionSign
- , const TickmarkProperties& rTickmarkProperties, bool bPlaceAtLabels ) const;
- ::basegfx::B2DVector getDistanceAxisTickToText( const AxisProperties& rAxisProperties
- , bool bIncludeFarAwayDistanceIfSo = false
- , bool bIncludeSpaceBetweenTickAndText = true ) const;
-
- virtual void updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
-
- bool isHorizontalAxis() const;
- bool isVerticalAxis() const;
-
-protected: //methods
- ::basegfx::B2DVector getTickScreenPosition2D( double fScaledLogicTickValue ) const;
-
-private: //member
- ::basegfx::B2DVector m_aAxisStartScreenPosition2D;
- ::basegfx::B2DVector m_aAxisEndScreenPosition2D;
-
- //labels might be posioned high or low on the border of the diagram far away from the axis
- //add this vector to go from the axis line to the label line (border of the diagram)
- ::basegfx::B2DVector m_aAxisLineToLabelLineShift;
-
- double m_fStrech_LogicToScreen;
- double m_fOffset_LogicToScreen;
-};
-
-class TickmarkHelper_3D : public TickmarkHelper
-{
-public:
- TickmarkHelper_3D(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement );
- virtual ~TickmarkHelper_3D();
-
- virtual TickmarkHelper* createShiftedTickmarkHelper() const;
};
//.............................................................................
} //namespace chart
//.............................................................................
#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx
index cc9402c669aa..e662634e939d 100644
--- a/chart2/source/view/axes/VAxisBase.cxx
+++ b/chart2/source/view/axes/VAxisBase.cxx
@@ -32,7 +32,7 @@
#include "VAxisBase.hxx"
#include "ShapeFactory.hxx"
#include "CommonConverters.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include "macros.hxx"
// header for define DBG_ASSERT
@@ -71,7 +71,7 @@ sal_Int32 VAxisBase::getDimensionCount()
return m_nDimension;
}
-void SAL_CALL VAxisBase::initAxisLabelProperties( const ::com::sun::star::awt::Size& rFontReferenceSize
+void VAxisBase::initAxisLabelProperties( const ::com::sun::star::awt::Size& rFontReferenceSize
, const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels )
{
m_aAxisLabelProperties.m_aFontReferenceSize = rFontReferenceSize;
@@ -107,6 +107,15 @@ void SAL_CALL VAxisBase::initAxisLabelProperties( const ::com::sun::star::awt::S
m_aAxisLabelProperties.eStaggering = SIDE_BY_SIDE;
}
+bool VAxisBase::isDateAxis() const
+{
+ return AxisType::DATE == m_aScale.AxisType;
+}
+bool VAxisBase::isComplexCategoryAxis() const
+{
+ return m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels;
+}
+
void VAxisBase::recordMaximumTextSize( const Reference< drawing::XShape >& xShape, double fRotationAngleDegree )
{
if( m_bRecordMaximumTextSize && xShape.is() )
@@ -131,7 +140,7 @@ void VAxisBase::setExrtaLinePositionAtOtherAxis( const double& fCrossingAt )
m_aAxisProperties.m_pfExrtaLinePositionAtOtherAxis = new double(fCrossingAt);
}
-sal_Bool SAL_CALL VAxisBase::isAnythingToDraw()
+sal_Bool VAxisBase::isAnythingToDraw()
{
if( !m_aAxisProperties.m_xAxisModel.is() )
return false;
@@ -151,7 +160,7 @@ sal_Bool SAL_CALL VAxisBase::isAnythingToDraw()
return true;
}
-void SAL_CALL VAxisBase::setExplicitScaleAndIncrement(
+void VAxisBase::setExplicitScaleAndIncrement(
const ExplicitScaleData& rScale
, const ExplicitIncrementData& rIncrement )
throw (uno::RuntimeException)
@@ -163,8 +172,11 @@ void SAL_CALL VAxisBase::setExplicitScaleAndIncrement(
void VAxisBase::createAllTickInfos( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos )
{
- std::auto_ptr< TickmarkHelper > apTickmarkHelper( this->createTickmarkHelper() );
- apTickmarkHelper->getAllTicks( rAllTickInfos );
+ std::auto_ptr< TickFactory > apTickFactory( this->createTickFactory() );
+ if( m_aScale.ShiftedCategoryPosition )
+ apTickFactory->getAllTicksShifted( rAllTickInfos );
+ else
+ apTickFactory->getAllTicks( rAllTickInfos );
}
bool VAxisBase::prepareShapeCreation()
@@ -245,7 +257,7 @@ void VAxisBase::updateUnscaledValuesAtTicks( TickIter& rIter )
for( TickInfo* pTickInfo = rIter.firstInfo()
; pTickInfo; pTickInfo = rIter.nextInfo() )
{
- pTickInfo->updateUnscaledValue( xInverseScaling );
+ //xxxxx pTickInfo->updateUnscaledValue( xInverseScaling );
}
}
diff --git a/chart2/source/view/axes/VAxisBase.hxx b/chart2/source/view/axes/VAxisBase.hxx
index fbf1bc6eb0f6..ecee96c8e339 100644
--- a/chart2/source/view/axes/VAxisBase.hxx
+++ b/chart2/source/view/axes/VAxisBase.hxx
@@ -30,7 +30,7 @@
#include "VAxisOrGridBase.hxx"
#include "VAxisProperties.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
//.............................................................................
@@ -53,18 +53,18 @@ public:
sal_Int32 getDimensionCount();
- virtual void SAL_CALL createMaximumLabels()=0;
- virtual void SAL_CALL createLabels()=0;
- virtual void SAL_CALL updatePositions()=0;
+ virtual void createMaximumLabels()=0;
+ virtual void createLabels()=0;
+ virtual void updatePositions()=0;
- virtual sal_Bool SAL_CALL isAnythingToDraw();
- virtual void SAL_CALL initAxisLabelProperties(
+ virtual sal_Bool isAnythingToDraw();
+ virtual void initAxisLabelProperties(
const ::com::sun::star::awt::Size& rFontReferenceSize
, const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels );
- virtual void SAL_CALL setExplicitScaleAndIncrement(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement )
+ virtual void setExplicitScaleAndIncrement(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement )
throw (::com::sun::star::uno::RuntimeException);
virtual sal_Int32 estimateMaximumAutoMainIncrementCount();
@@ -84,6 +84,9 @@ protected: //methods
::com::sun::star::drawing::XShape >& xShape
, double fRotationAngleDegree );
+ bool isDateAxis() const;
+ bool isComplexCategoryAxis() const;
+
protected: //member
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > m_xNumberFormatsSupplier;
AxisProperties m_aAxisProperties;
diff --git a/chart2/source/view/axes/VAxisOrGridBase.cxx b/chart2/source/view/axes/VAxisOrGridBase.cxx
index 19e219e5fb37..489af51f7c0e 100644
--- a/chart2/source/view/axes/VAxisOrGridBase.cxx
+++ b/chart2/source/view/axes/VAxisOrGridBase.cxx
@@ -32,7 +32,7 @@
#include "VAxisOrGridBase.hxx"
#include "ShapeFactory.hxx"
#include "CommonConverters.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
// header for define DBG_ASSERT
#include <tools/debug.hxx>
@@ -58,7 +58,7 @@ VAxisOrGridBase::~VAxisOrGridBase()
{
}
-void SAL_CALL VAxisOrGridBase::setExplicitScaleAndIncrement(
+void VAxisOrGridBase::setExplicitScaleAndIncrement(
const ExplicitScaleData& rScale
, const ExplicitIncrementData& rIncrement )
throw (uno::RuntimeException)
@@ -80,18 +80,9 @@ void VAxisOrGridBase::set3DWallPositions( CuboidPlanePosition eLeftWallPos, Cubo
m_eBottomPos = eBottomPos;
}
-TickmarkHelper* VAxisOrGridBase::createTickmarkHelper()
+TickFactory* VAxisOrGridBase::createTickFactory()
{
- TickmarkHelper* pRet=NULL;
- if( 2==m_nDimension )
- {
- pRet = new TickmarkHelper( m_aScale, m_aIncrement );
- }
- else
- {
- pRet = new TickmarkHelper_3D( m_aScale, m_aIncrement );
- }
- return pRet;
+ return new TickFactory( m_aScale, m_aIncrement );
}
//.............................................................................
diff --git a/chart2/source/view/axes/VAxisOrGridBase.hxx b/chart2/source/view/axes/VAxisOrGridBase.hxx
index e884fe785954..38a89b7b86f9 100644
--- a/chart2/source/view/axes/VAxisOrGridBase.hxx
+++ b/chart2/source/view/axes/VAxisOrGridBase.hxx
@@ -30,9 +30,8 @@
#include "PlotterBase.hxx"
#include "ThreeDHelper.hxx"
+#include "chartview/ExplicitScaleValues.hxx"
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
#include <com/sun/star/drawing/HomogenMatrix.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -47,7 +46,7 @@ namespace chart
/**
*/
class ShapeFactory;
-class TickmarkHelper;
+class TickFactory;
class VAxisOrGridBase : public PlotterBase
{
@@ -56,22 +55,22 @@ public:
virtual ~VAxisOrGridBase();
virtual void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix );
- virtual void SAL_CALL setExplicitScaleAndIncrement(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement )
+ virtual void setExplicitScaleAndIncrement(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement )
throw (::com::sun::star::uno::RuntimeException);
void set3DWallPositions( CuboidPlanePosition eLeftWallPos, CuboidPlanePosition eBackWallPos, CuboidPlanePosition eBottomPos );
- virtual TickmarkHelper* createTickmarkHelper();
+ virtual TickFactory* createTickFactory();
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
protected: //member
- ::com::sun::star::chart2::ExplicitScaleData m_aScale;
- ::com::sun::star::chart2::ExplicitIncrementData m_aIncrement;
- sal_Int32 m_nDimensionIndex;
+ ExplicitScaleData m_aScale;
+ ExplicitIncrementData m_aIncrement;
+ sal_Int32 m_nDimensionIndex;
- ::basegfx::B3DHomMatrix m_aMatrixScreenToScene;
+ ::basegfx::B3DHomMatrix m_aMatrixScreenToScene;
CuboidPlanePosition m_eLeftWallPos;
CuboidPlanePosition m_eBackWallPos;
diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx
index 4bf06fd1c032..1063789d1db7 100644
--- a/chart2/source/view/axes/VAxisProperties.cxx
+++ b/chart2/source/view/axes/VAxisProperties.cxx
@@ -183,7 +183,6 @@ AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel
, m_pfExrtaLinePositionAtOtherAxis(NULL)
, m_bCrossingAxisHasReverseDirection(false)
, m_bCrossingAxisIsCategoryAxes(false)
- , m_bAxisBetweenCategories(false)
, m_fLabelDirectionSign(1.0)
, m_fInnerDirectionSign(1.0)
, m_aLabelAlignment(LABEL_ALIGN_RIGHT_TOP)
@@ -213,7 +212,6 @@ AxisProperties::AxisProperties( const AxisProperties& rAxisProperties )
, m_pfExrtaLinePositionAtOtherAxis( NULL )
, m_bCrossingAxisHasReverseDirection( rAxisProperties.m_bCrossingAxisHasReverseDirection )
, m_bCrossingAxisIsCategoryAxes( rAxisProperties.m_bCrossingAxisIsCategoryAxes )
- , m_bAxisBetweenCategories( rAxisProperties.m_bAxisBetweenCategories )
, m_fLabelDirectionSign( rAxisProperties.m_fLabelDirectionSign )
, m_fInnerDirectionSign( rAxisProperties.m_fInnerDirectionSign )
, m_aLabelAlignment( rAxisProperties.m_aLabelAlignment )
@@ -280,11 +278,7 @@ void AxisProperties::initAxisPositioning( const uno::Reference< beans::XProperty
xAxisProp->getPropertyValue(C2U( "CrossoverValue" )) >>= fValue;
if( m_bCrossingAxisIsCategoryAxes )
- {
fValue = ::rtl::math::round(fValue);
- if( m_bAxisBetweenCategories )
- fValue-=0.5;
- }
m_pfMainLinePositionAtOtherAxis = new double(fValue);
}
else if( ::com::sun::star::chart::ChartAxisPosition_ZERO == m_eCrossoverType )
@@ -318,8 +312,17 @@ void AxisProperties::init( bool bCartesian )
if( m_nDimensionIndex<2 )
initAxisPositioning( xProp );
+ ScaleData aScaleData = m_xAxisModel->getScaleData();
+ if( m_nDimensionIndex==0 )
+ AxisHelper::checkDateAxis( aScaleData, m_pExplicitCategoriesProvider, bCartesian );
+ m_nAxisType = aScaleData.AxisType;
+
if( bCartesian )
{
+ if( m_nDimensionIndex == 0 && m_nAxisType == AxisType::CATEGORY
+ && m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->hasComplexCategories() )
+ m_bComplexCategories = true;
+
if( ::com::sun::star::chart::ChartAxisPosition_END == m_eCrossoverType )
m_fInnerDirectionSign = m_bCrossingAxisHasReverseDirection ? 1 : -1;
else
@@ -361,10 +364,6 @@ void AxisProperties::init( bool bCartesian )
//init display labels
xProp->getPropertyValue( C2U( "DisplayLabels" ) ) >>= m_bDisplayLabels;
- //init categories
- ScaleData aScaleData = m_xAxisModel->getScaleData();
- m_nAxisType = aScaleData.AxisType;
-
//init TickmarkProperties
xProp->getPropertyValue( C2U( "MajorTickmarks" ) ) >>= m_nMajorTickmarks;
xProp->getPropertyValue( C2U( "MinorTickmarks" ) ) >>= m_nMinorTickmarks;
diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx
index 0f2c835cbf29..9e57ee4b5c65 100644
--- a/chart2/source/view/axes/VAxisProperties.hxx
+++ b/chart2/source/view/axes/VAxisProperties.hxx
@@ -112,7 +112,6 @@ struct AxisProperties
bool m_bCrossingAxisHasReverseDirection;
bool m_bCrossingAxisIsCategoryAxes;
- bool m_bAxisBetweenCategories;
//this direction is used to indicate in which direction the labels are to be drawn
double m_fLabelDirectionSign;
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index d22a9ff4b7b8..5451f5cbb9ab 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -37,11 +37,12 @@
#include "macros.hxx"
#include "ViewDefines.hxx"
#include "PropertyMapper.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "LabelPositionHelper.hxx"
#include "TrueGuard.hxx"
#include "BaseGFXHelper.hxx"
#include "AxisHelper.hxx"
+#include "Tickmarks_Equidistant.hxx"
#include <rtl/math.hxx>
#include <tools/color.hxx>
@@ -49,6 +50,8 @@
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <editeng/unoprnms.hxx>
+#include <svx/unoshape.hxx>
+#include <svx/unoshtxt.hxx>
#include <algorithm>
#include <memory>
@@ -111,7 +114,7 @@ Reference< drawing::XShape > createSingleLabel(
//correctPositionForRotation
LabelPositionHelper::correctPositionForRotation( xShape2DText
- , rAxisProperties.m_aLabelAlignment, rAxisLabelProperties.fRotationAngleDegree, false );
+ , rAxisProperties.m_aLabelAlignment, rAxisLabelProperties.fRotationAngleDegree, rAxisProperties.m_bComplexCategories );
return xShape2DText;
}
@@ -177,7 +180,7 @@ void removeShapesAtWrongRhythm( TickIter& rIter
}
}
-class EquidistantLabelIterator : public EquidistantTickIter
+class LabelIterator : public TickIter
{
//this Iterator iterates over existing text labels
@@ -191,39 +194,36 @@ class EquidistantLabelIterator : public EquidistantTickIter
//we iterate through all labels
public:
- EquidistantLabelIterator( ::std::vector< ::std::vector< TickInfo > >& rTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+ LabelIterator( ::std::vector< TickInfo >& rTickInfoVector
, const AxisLabelStaggering eAxisLabelStaggering
- , bool bInnerLine
- , sal_Int32 nMinDepth=0, sal_Int32 nMaxDepth=-1 );
+ , bool bInnerLine );
virtual TickInfo* firstInfo();
virtual TickInfo* nextInfo();
private: //methods
- EquidistantLabelIterator();
+ LabelIterator();
private: //member
+ PureTickIter m_aPureTickIter;
const AxisLabelStaggering m_eAxisLabelStaggering;
- bool m_bInnerLine;
+ bool m_bInnerLine;
};
-EquidistantLabelIterator::EquidistantLabelIterator( ::std::vector< ::std::vector< TickInfo > >& rTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+LabelIterator::LabelIterator( ::std::vector< TickInfo >& rTickInfoVector
, const AxisLabelStaggering eAxisLabelStaggering
- , bool bInnerLine
- , sal_Int32 nMinDepth, sal_Int32 nMaxDepth )
- : EquidistantTickIter( rTickInfos, rIncrement, nMinDepth, nMaxDepth )
+ , bool bInnerLine )
+ : m_aPureTickIter( rTickInfoVector )
, m_eAxisLabelStaggering(eAxisLabelStaggering)
, m_bInnerLine(bInnerLine)
{
}
-TickInfo* EquidistantLabelIterator::firstInfo()
+TickInfo* LabelIterator::firstInfo()
{
- TickInfo* pTickInfo = EquidistantTickIter::firstInfo();
+ TickInfo* pTickInfo = m_aPureTickIter.firstInfo();
while( pTickInfo && !pTickInfo->xTextShape.is() )
- pTickInfo = EquidistantTickIter::nextInfo();
+ pTickInfo = m_aPureTickIter.nextInfo();
if(!pTickInfo)
return NULL;
if( (STAGGER_EVEN==m_eAxisLabelStaggering && m_bInnerLine)
@@ -233,7 +233,7 @@ TickInfo* EquidistantLabelIterator::firstInfo()
{
//skip first label
do
- pTickInfo = EquidistantTickIter::nextInfo();
+ pTickInfo = m_aPureTickIter.nextInfo();
while( pTickInfo && !pTickInfo->xTextShape.is() );
}
if(!pTickInfo)
@@ -241,12 +241,12 @@ TickInfo* EquidistantLabelIterator::firstInfo()
return pTickInfo;
}
-TickInfo* EquidistantLabelIterator::nextInfo()
+TickInfo* LabelIterator::nextInfo()
{
TickInfo* pTickInfo = NULL;
//get next label
do
- pTickInfo = EquidistantTickIter::nextInfo();
+ pTickInfo = m_aPureTickIter.nextInfo();
while( pTickInfo && !pTickInfo->xTextShape.is() );
if( STAGGER_EVEN==m_eAxisLabelStaggering
@@ -254,13 +254,13 @@ TickInfo* EquidistantLabelIterator::nextInfo()
{
//skip one label
do
- pTickInfo = EquidistantTickIter::nextInfo();
+ pTickInfo = m_aPureTickIter.nextInfo();
while( pTickInfo && !pTickInfo->xTextShape.is() );
}
return pTickInfo;
}
-B2DVector lcl_getLabelsDistance( TickIter& rIter, const B2DVector& rDistanceTickToText )
+B2DVector lcl_getLabelsDistance( TickIter& rIter, const B2DVector& rDistanceTickToText, double fRotationAngleDegree )
{
//calculates the height or width of a line of labels
//thus a following line of labels can be shifted for that distance
@@ -283,7 +283,7 @@ B2DVector lcl_getLabelsDistance( TickIter& rIter, const B2DVector& rDistanceTick
xShape2DText = pTickInfo->xTextShape;
if( xShape2DText.is() )
{
- awt::Size aSize = xShape2DText->getSize();
+ awt::Size aSize = ShapeFactory::getSizeAfterRotation( xShape2DText, fRotationAngleDegree );
if(fabs(aStaggerDirection.getX())>fabs(aStaggerDirection.getY()))
nDistance = ::std::max(nDistance,aSize.Width);
else
@@ -320,64 +320,102 @@ void lcl_shiftLables( TickIter& rIter, const B2DVector& rStaggerDistance )
}
}
-class MaxLabelEquidistantTickIter : public EquidistantTickIter
+bool lcl_hasWordBreak( const Reference< drawing::XShape >& rxShape )
+{
+ if ( rxShape.is() )
+ {
+ SvxShape* pShape = SvxShape::getImplementation( rxShape );
+ SvxShapeText* pShapeText = dynamic_cast< SvxShapeText* >( pShape );
+ if ( pShapeText )
+ {
+ SvxTextEditSource* pTextEditSource = dynamic_cast< SvxTextEditSource* >( pShapeText->GetEditSource() );
+ if ( pTextEditSource )
+ {
+ pTextEditSource->UpdateOutliner();
+ SvxTextForwarder* pTextForwarder = pTextEditSource->GetTextForwarder();
+ if ( pTextForwarder )
+ {
+ sal_uInt16 nParaCount = pTextForwarder->GetParagraphCount();
+ for ( sal_uInt16 nPara = 0; nPara < nParaCount; ++nPara )
+ {
+ sal_uInt16 nLineCount = pTextForwarder->GetLineCount( nPara );
+ for ( sal_uInt16 nLine = 0; nLine < nLineCount; ++nLine )
+ {
+ sal_uInt16 nLineStart = 0;
+ sal_uInt16 nLineEnd = 0;
+ pTextForwarder->GetLineBoundaries( nLineStart, nLineEnd, nPara, nLine );
+ sal_uInt16 nWordStart = 0;
+ sal_uInt16 nWordEnd = 0;
+ if ( pTextForwarder->GetWordIndices( nPara, nLineStart, nWordStart, nWordEnd ) &&
+ ( nWordStart != nLineStart ) )
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
+class MaxLabelTickIter : public TickIter
{
//iterate over first two and last two labels and the longest label
public:
- MaxLabelEquidistantTickIter( ::std::vector< ::std::vector< TickInfo > >& rTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+ MaxLabelTickIter( ::std::vector< TickInfo >& rTickInfoVector
, sal_Int32 nLongestLabelIndex );
- virtual ~MaxLabelEquidistantTickIter();
+ virtual ~MaxLabelTickIter();
- virtual TickInfo* nextInfo();
+ virtual TickInfo* firstInfo();
+ virtual TickInfo* nextInfo();
private:
- sal_Int32 m_nLongestLabelIndex;
+ ::std::vector< TickInfo >& m_rTickInfoVector;
+ ::std::vector< sal_Int32 > m_aValidIndices;
+ sal_Int32 m_nCurrentIndex;
};
-MaxLabelEquidistantTickIter::MaxLabelEquidistantTickIter( ::std::vector< ::std::vector< TickInfo > >& rTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
+MaxLabelTickIter::MaxLabelTickIter( ::std::vector< TickInfo >& rTickInfoVector
, sal_Int32 nLongestLabelIndex )
- : EquidistantTickIter( rTickInfos, rIncrement, 0//nMinDepth
- , 0//nMaxDepth
- )
- , m_nLongestLabelIndex( nLongestLabelIndex )
+ : m_rTickInfoVector(rTickInfoVector)
+ , m_nCurrentIndex(0)
{
- sal_Int32 nMaxIndex = getMaxIndex();
-
- //ensure correct value:
- if( m_nLongestLabelIndex<0 || m_nLongestLabelIndex>nMaxIndex)
- m_nLongestLabelIndex = 0;
-
- //last label is checked anyhow
- if( m_nLongestLabelIndex==nMaxIndex )
- m_nLongestLabelIndex = 0;
- //label before last is checked anyhow
- if( m_nLongestLabelIndex+1==nMaxIndex )
- m_nLongestLabelIndex = 0;
+ sal_Int32 nMaxIndex = m_rTickInfoVector.size()-1;
+ if( nLongestLabelIndex<0 || nLongestLabelIndex>=nMaxIndex-1 )
+ nLongestLabelIndex = 0;
+
+ if( nMaxIndex>=0 )
+ m_aValidIndices.push_back(0);
+ if( nMaxIndex>=1 )
+ m_aValidIndices.push_back(1);
+ if( nLongestLabelIndex>1 )
+ m_aValidIndices.push_back(nLongestLabelIndex);
+ if( nMaxIndex > 2 )
+ m_aValidIndices.push_back(nMaxIndex-1);
+ if( nMaxIndex > 1 )
+ m_aValidIndices.push_back(nMaxIndex);
}
-MaxLabelEquidistantTickIter::~MaxLabelEquidistantTickIter()
+MaxLabelTickIter::~MaxLabelTickIter()
{
}
-TickInfo* MaxLabelEquidistantTickIter::nextInfo()
+TickInfo* MaxLabelTickIter::firstInfo()
{
- sal_Int32 nCurrentPos = getCurrentIndex();
- sal_Int32 nMaxIndex = getMaxIndex();
- if( nCurrentPos>0 )
- {
- if( m_nLongestLabelIndex>1 && nCurrentPos<m_nLongestLabelIndex )
- gotoIndex( m_nLongestLabelIndex-1 ) ;
- else
- {
- if( nMaxIndex>3 && nCurrentPos<nMaxIndex-1 )
- gotoIndex( nMaxIndex-2 );
- else if( nMaxIndex>2 && nCurrentPos<nMaxIndex )
- gotoIndex( nMaxIndex-1 );
- }
- }
+ m_nCurrentIndex = 0;
+ if( m_nCurrentIndex < static_cast<sal_Int32>(m_aValidIndices.size()) )
+ return &m_rTickInfoVector[m_aValidIndices[m_nCurrentIndex]];
+ return 0;
+}
- return EquidistantTickIter::nextInfo();
+TickInfo* MaxLabelTickIter::nextInfo()
+{
+ m_nCurrentIndex++;
+ if( m_nCurrentIndex>=0 && m_nCurrentIndex<static_cast<sal_Int32>(m_aValidIndices.size()) )
+ return &m_rTickInfoVector[m_aValidIndices[m_nCurrentIndex]];
+ return 0;
}
bool VCartesianAxis::isBreakOfLabelsAllowed( const AxisLabelProperties& rAxisLabelProperties
@@ -447,27 +485,27 @@ void VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector< ::s
std::vector< ComplexCategory >::const_iterator aEnd(aComplexCategories.end());
for(;aIt!=aEnd;++aIt)
{
- TickInfo aTickInfo;
+ TickInfo aTickInfo(0);
ComplexCategory aCat(*aIt);
sal_Int32 nCount = aCat.Count;
- if( nCatIndex + 0.5 + nCount >= m_aScale.Maximum )
+ if( nCatIndex + 1.0 + nCount >= m_aScale.Maximum )
{
- nCount = static_cast<sal_Int32>(m_aScale.Maximum - 0.5 - nCatIndex);
+ nCount = static_cast<sal_Int32>(m_aScale.Maximum - 1.0 - nCatIndex);
if( nCount <= 0 )
nCount = 1;
}
- aTickInfo.fScaledTickValue = nCatIndex + 0.5 + nCount/2.0;
+ aTickInfo.fScaledTickValue = nCatIndex + 1.0 + nCount/2.0;
aTickInfo.nFactorForLimitedTextWidth = nCount;
aTickInfo.aText = aCat.Text;
aTickInfoVector.push_back(aTickInfo);
nCatIndex += nCount;
- if( nCatIndex + 0.5 >= m_aScale.Maximum )
+ if( nCatIndex + 1.0 >= m_aScale.Maximum )
break;
}
rAllTickInfos.push_back(aTickInfoVector);
}
}
- else //bShiftedPosition==true
+ else //bShiftedPosition==false
{
rAllTickInfos.clear();
sal_Int32 nLevel=0;
@@ -481,19 +519,19 @@ void VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector< ::s
std::vector< ComplexCategory >::const_iterator aEnd(aComplexCategories.end());
for(;aIt!=aEnd;++aIt)
{
- TickInfo aTickInfo;
+ TickInfo aTickInfo(0);
ComplexCategory aCat(*aIt);
- aTickInfo.fScaledTickValue = nCatIndex + 0.5;
+ aTickInfo.fScaledTickValue = nCatIndex + 1.0;
aTickInfoVector.push_back(aTickInfo);
nCatIndex += aCat.Count;
- if( nCatIndex + 0.5 > m_aScale.Maximum )
+ if( nCatIndex + 1.0 > m_aScale.Maximum )
break;
}
//fill up with single ticks until maximum scale
- while( nCatIndex + 0.5 < m_aScale.Maximum )
+ while( nCatIndex + 1.0 < m_aScale.Maximum )
{
- TickInfo aTickInfo;
- aTickInfo.fScaledTickValue = nCatIndex + 0.5;
+ TickInfo aTickInfo(0);
+ aTickInfo.fScaledTickValue = nCatIndex + 1.0;
aTickInfoVector.push_back(aTickInfo);
nCatIndex ++;
if( nLevel>0 )
@@ -501,7 +539,7 @@ void VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector< ::s
}
//add an additional tick at the end
{
- TickInfo aTickInfo;
+ TickInfo aTickInfo(0);
aTickInfo.fScaledTickValue = m_aScale.Maximum;
aTickInfoVector.push_back(aTickInfo);
}
@@ -512,7 +550,7 @@ void VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector< ::s
void VCartesianAxis::createAllTickInfos( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos )
{
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() )
createAllTickInfosFromComplexCategories( rAllTickInfos, false );
else
VAxisBase::createAllTickInfos(rAllTickInfos);
@@ -520,21 +558,13 @@ void VCartesianAxis::createAllTickInfos( ::std::vector< ::std::vector< TickInfo
::std::auto_ptr< TickIter > VCartesianAxis::createLabelTickIterator( sal_Int32 nTextLevel )
{
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
- {
- if( nTextLevel>=0 && nTextLevel < static_cast< sal_Int32 >(m_aAllTickInfos.size()) )
- return ::std::auto_ptr< TickIter >( new PureTickIter( m_aAllTickInfos[nTextLevel] ) );
- }
- else
- {
- if(nTextLevel==0)
- return ::std::auto_ptr< TickIter >( new EquidistantTickIter( m_aAllTickInfos, m_aIncrement, 0, 0 ) );
- }
+ if( nTextLevel>=0 && nTextLevel < static_cast< sal_Int32 >(m_aAllTickInfos.size()) )
+ return ::std::auto_ptr< TickIter >( new PureTickIter( m_aAllTickInfos[nTextLevel] ) );
return ::std::auto_ptr< TickIter >();
}
::std::auto_ptr< TickIter > VCartesianAxis::createMaximumLabelTickIterator( sal_Int32 nTextLevel )
{
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() || isDateAxis() )
{
return createLabelTickIterator( nTextLevel ); //mmmm maybe todo: create less than all texts here
}
@@ -542,8 +572,11 @@ void VCartesianAxis::createAllTickInfos( ::std::vector< ::std::vector< TickInfo
{
if(nTextLevel==0)
{
- sal_Int32 nLongestLabelIndex = m_bUseTextLabels ? this->getIndexOfLongestLabel( m_aTextLabels ) : 0;
- return ::std::auto_ptr< TickIter >( new MaxLabelEquidistantTickIter( m_aAllTickInfos, m_aIncrement, nLongestLabelIndex ) );
+ if( !m_aAllTickInfos.empty() )
+ {
+ sal_Int32 nLongestLabelIndex = m_bUseTextLabels ? this->getIndexOfLongestLabel( m_aTextLabels ) : 0;
+ return ::std::auto_ptr< TickIter >( new MaxLabelTickIter( m_aAllTickInfos[0], nLongestLabelIndex ) );
+ }
}
}
return ::std::auto_ptr< TickIter >();
@@ -552,7 +585,7 @@ void VCartesianAxis::createAllTickInfos( ::std::vector< ::std::vector< TickInfo
sal_Int32 VCartesianAxis::getTextLevelCount() const
{
sal_Int32 nTextLevelCount = 1;
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() )
nTextLevelCount = m_aAxisProperties.m_pExplicitCategoriesProvider->getCategoryLevelCount();
return nTextLevelCount;
}
@@ -561,7 +594,7 @@ bool VCartesianAxis::createTextShapes(
const Reference< drawing::XShapes >& xTarget
, TickIter& rTickIter
, AxisLabelProperties& rAxisLabelProperties
- , TickmarkHelper_2D* pTickmarkHelper
+ , TickFactory_2D* pTickFactory
, sal_Int32 nScreenDistanceBetweenTicks )
{
//returns true if the text shapes have been created succesfully
@@ -575,10 +608,10 @@ bool VCartesianAxis::createTextShapes(
FixedNumberFormatter aFixedNumberFormatter(
m_xNumberFormatsSupplier, rAxisLabelProperties.nNumberFormatKey );
- const bool bIsHorizontalAxis = pTickmarkHelper->isHorizontalAxis();
- const bool bIsVerticalAxis = pTickmarkHelper->isVerticalAxis();
+ const bool bIsHorizontalAxis = pTickFactory->isHorizontalAxis();
+ const bool bIsVerticalAxis = pTickFactory->isVerticalAxis();
bool bIsStaggered = rAxisLabelProperties.getIsStaggered();
- B2DVector aTextToTickDistance( pTickmarkHelper->getDistanceAxisTickToText( m_aAxisProperties, true ) );
+ B2DVector aTextToTickDistance( pTickFactory->getDistanceAxisTickToText( m_aAxisProperties, true ) );
sal_Int32 nLimitedSpaceForText = -1;
if( isBreakOfLabelsAllowed( rAxisLabelProperties, bIsHorizontalAxis ) )
{
@@ -674,7 +707,7 @@ bool VCartesianAxis::createTextShapes(
}
}
- pTickInfo->updateUnscaledValue( xInverseScaling );
+ //xxxxx pTickInfo->updateUnscaledValue( xInverseScaling );
bool bHasExtraColor=false;
sal_Int32 nExtraColor=0;
@@ -682,7 +715,7 @@ bool VCartesianAxis::createTextShapes(
rtl::OUString aLabel;
if(pCategories)
{
- sal_Int32 nIndex = static_cast< sal_Int32 >(pTickInfo->fUnscaledTickValue) - 1; //first category (index 0) matches with real number 1.0
+ sal_Int32 nIndex = static_cast< sal_Int32 >(pTickInfo->getUnscaledTickValue()) - 1; //first category (index 0) matches with real number 1.0
if( nIndex>=0 && nIndex<pCategories->getLength() )
aLabel = (*pCategories)[nIndex];
}
@@ -691,7 +724,7 @@ bool VCartesianAxis::createTextShapes(
aLabel = pTickInfo->aText;
}
else
- aLabel = aFixedNumberFormatter.getFormattedString( pTickInfo->fUnscaledTickValue, nExtraColor, bHasExtraColor );
+ aLabel = aFixedNumberFormatter.getFormattedString( pTickInfo->getUnscaledTickValue(), nExtraColor, bHasExtraColor );
if(pColorAny)
*pColorAny = uno::makeAny(bHasExtraColor?nExtraColor:nColor);
@@ -715,10 +748,23 @@ bool VCartesianAxis::createTextShapes(
recordMaximumTextSize( pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree );
+ //better rotate if single words are broken apart
+ if( nLimitedSpaceForText>0 && !rAxisLabelProperties.bOverlapAllowed
+ && ::rtl::math::approxEqual( rAxisLabelProperties.fRotationAngleDegree, 0.0 )
+ && m_aAxisProperties.m_bComplexCategories
+ && lcl_hasWordBreak( pTickInfo->xTextShape ) )
+ {
+ rAxisLabelProperties.fRotationAngleDegree = 90;
+ rAxisLabelProperties.bLineBreakAllowed = false;
+ m_aAxisLabelProperties.fRotationAngleDegree = rAxisLabelProperties.fRotationAngleDegree;
+ removeTextShapesFromTicks();
+ return false;
+ }
+
//if NO OVERLAP -> remove overlapping shapes
if( pLastVisibleNeighbourTickInfo && !rAxisLabelProperties.bOverlapAllowed )
{
- if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, m_aAxisLabelProperties.fRotationAngleDegree ) )
+ if( doesOverlap( pLastVisibleNeighbourTickInfo->xTextShape, pTickInfo->xTextShape, rAxisLabelProperties.fRotationAngleDegree ) )
{
bool bOverlapAlsoAfterSwitchingOnAutoStaggering = true;
if( !bIsStaggered && isAutoStaggeringOfLabelsAllowed( rAxisLabelProperties, bIsHorizontalAxis, bIsVerticalAxis ) )
@@ -1190,12 +1236,12 @@ void VCartesianAxis::get2DAxisMainLine( B2DVector& rStart, B2DVector& rEnd, doub
}
}
-TickmarkHelper* VCartesianAxis::createTickmarkHelper()
+TickFactory* VCartesianAxis::createTickFactory()
{
- return createTickmarkHelper2D();
+ return createTickFactory2D();
}
-TickmarkHelper_2D* VCartesianAxis::createTickmarkHelper2D()
+TickFactory_2D* VCartesianAxis::createTickFactory2D()
{
B2DVector aStart, aEnd;
this->get2DAxisMainLine( aStart, aEnd, this->getLogicValueWhereMainLineCrossesOtherAxis() );
@@ -1203,7 +1249,7 @@ TickmarkHelper_2D* VCartesianAxis::createTickmarkHelper2D()
B2DVector aLabelLineStart, aLabelLineEnd;
this->get2DAxisMainLine( aLabelLineStart, aLabelLineEnd, this->getLogicValueWhereLabelLineCrossesOtherAxis() );
- return new TickmarkHelper_2D( m_aScale, m_aIncrement, aStart, aEnd, aLabelLineStart-aStart );
+ return new TickFactory_2D( m_aScale, m_aIncrement, aStart, aEnd, aLabelLineStart-aStart );
}
void lcl_hideIdenticalScreenValues( TickIter& rTickIter )
@@ -1227,7 +1273,7 @@ void lcl_hideIdenticalScreenValues( TickIter& rTickIter )
//'hide' tickmarks with identical screen values in aAllTickInfos
void VCartesianAxis::hideIdenticalScreenValues( ::std::vector< ::std::vector< TickInfo > >& rTickInfos ) const
{
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() || isDateAxis() )
{
sal_Int32 nCount = rTickInfos.size();
for( sal_Int32 nN=0; nN<nCount; nN++ )
@@ -1273,12 +1319,12 @@ sal_Int32 VCartesianAxis::estimateMaximumAutoMainIncrementCount()
return nRet;
}
-void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabelProperties, TickmarkHelper_2D* pTickmarkHelper2D )
+void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabelProperties, TickFactory_2D* pTickFactory2D )
{
- if( !pTickmarkHelper2D )
+ if( !pTickFactory2D )
return;
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() )
{
sal_Int32 nTextLevelCount = getTextLevelCount();
B2DVector aCummulatedLabelsDistance(0,0);
@@ -1287,27 +1333,33 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel
::std::auto_ptr< TickIter > apTickIter = createLabelTickIterator( nTextLevel );
if(apTickIter.get())
{
+ double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
if( nTextLevel>0 )
+ {
lcl_shiftLables( *apTickIter.get(), aCummulatedLabelsDistance );
+ fRotationAngleDegree = 0.0;
+ }
aCummulatedLabelsDistance += lcl_getLabelsDistance( *apTickIter.get()
- , pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties ) );
+ , pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties )
+ , fRotationAngleDegree );
}
}
}
else if( rAxisLabelProperties.getIsStaggered() )
{
- EquidistantLabelIterator aInnerIter( m_aAllTickInfos, m_aIncrement
- , rAxisLabelProperties.eStaggering, true, 0, 0 );
- EquidistantLabelIterator aOuterIter( m_aAllTickInfos, m_aIncrement
- , rAxisLabelProperties.eStaggering, false, 0, 0 );
-
- lcl_shiftLables( aOuterIter
- , lcl_getLabelsDistance( aInnerIter
- , pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties ) ) );
+ if( !m_aAllTickInfos.empty() )
+ {
+ LabelIterator aInnerIter( m_aAllTickInfos[0], rAxisLabelProperties.eStaggering, true );
+ LabelIterator aOuterIter( m_aAllTickInfos[0], rAxisLabelProperties.eStaggering, false );
+
+ lcl_shiftLables( aOuterIter
+ , lcl_getLabelsDistance( aInnerIter
+ , pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties ), 0.0 ) );
+ }
}
}
-void SAL_CALL VCartesianAxis::createLabels()
+void VCartesianAxis::createLabels()
{
if( !prepareShapeCreation() )
return;
@@ -1316,14 +1368,14 @@ void SAL_CALL VCartesianAxis::createLabels()
//create labels
if( m_aAxisProperties.m_bDisplayLabels )
{
- std::auto_ptr< TickmarkHelper_2D > apTickmarkHelper2D( this->createTickmarkHelper2D() );
- TickmarkHelper_2D* pTickmarkHelper2D = apTickmarkHelper2D.get();
- if( !pTickmarkHelper2D )
+ std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() );
+ TickFactory_2D* pTickFactory2D = apTickFactory2D.get();
+ if( !pTickFactory2D )
return;
//-----------------------------------------
//get the transformed screen values for all tickmarks in aAllTickInfos
- pTickmarkHelper2D->updateScreenValues( m_aAllTickInfos );
+ pTickFactory2D->updateScreenValues( m_aAllTickInfos );
//-----------------------------------------
//'hide' tickmarks with identical screen values in aAllTickInfos
hideIdenticalScreenValues( m_aAllTickInfos );
@@ -1340,25 +1392,38 @@ void SAL_CALL VCartesianAxis::createLabels()
{
if(nTextLevel==0)
{
- nScreenDistanceBetweenTicks = TickmarkHelper_2D::getTickScreenDistance( *apTickIter.get() );
+ nScreenDistanceBetweenTicks = TickFactory_2D::getTickScreenDistance( *apTickIter.get() );
if( nTextLevelCount>1 )
nScreenDistanceBetweenTicks*=2; //the above used tick iter does contain also the sub ticks -> thus the given distance is only the half
}
- AxisLabelProperties aCopy(m_aAxisLabelProperties);
- aCopy.bRhythmIsFix = true;
- aCopy.nRhythm = 1;
- AxisLabelProperties& rAxisLabelProperties = nTextLevel==0 ? m_aAxisLabelProperties : aCopy;
- while( !createTextShapes( m_xTextTarget, *apTickIter.get(), rAxisLabelProperties, pTickmarkHelper2D, nScreenDistanceBetweenTicks ) )
+ AxisLabelProperties aComplexProps(m_aAxisLabelProperties);
+ if( m_aAxisProperties.m_bComplexCategories )
+ {
+ if( nTextLevel==0 )
+ {
+ aComplexProps.bLineBreakAllowed = true;
+ aComplexProps.bOverlapAllowed = !::rtl::math::approxEqual( aComplexProps.fRotationAngleDegree, 0.0 );
+ }
+ else
+ {
+ aComplexProps.bOverlapAllowed = true;
+ aComplexProps.bRhythmIsFix = true;
+ aComplexProps.nRhythm = 1;
+ aComplexProps.fRotationAngleDegree = 0.0;
+ }
+ }
+ AxisLabelProperties& rAxisLabelProperties = m_aAxisProperties.m_bComplexCategories ? aComplexProps : m_aAxisLabelProperties;
+ while( !createTextShapes( m_xTextTarget, *apTickIter.get(), rAxisLabelProperties, pTickFactory2D, nScreenDistanceBetweenTicks ) )
{
};
}
}
- doStaggeringOfLabels( m_aAxisLabelProperties, pTickmarkHelper2D );
+ doStaggeringOfLabels( m_aAxisLabelProperties, pTickFactory2D );
}
}
-void SAL_CALL VCartesianAxis::createMaximumLabels()
+void VCartesianAxis::createMaximumLabels()
{
TrueGuard aRecordMaximumTextSize(m_bRecordMaximumTextSize);
@@ -1369,20 +1434,20 @@ void SAL_CALL VCartesianAxis::createMaximumLabels()
//create labels
if( m_aAxisProperties.m_bDisplayLabels )
{
- std::auto_ptr< TickmarkHelper_2D > apTickmarkHelper2D( this->createTickmarkHelper2D() );
- TickmarkHelper_2D* pTickmarkHelper2D = apTickmarkHelper2D.get();
- if( !pTickmarkHelper2D )
+ std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() );
+ TickFactory_2D* pTickFactory2D = apTickFactory2D.get();
+ if( !pTickFactory2D )
return;
//-----------------------------------------
//get the transformed screen values for all tickmarks in aAllTickInfos
- pTickmarkHelper2D->updateScreenValues( m_aAllTickInfos );
+ pTickFactory2D->updateScreenValues( m_aAllTickInfos );
//create tick mark text shapes
//@todo: iterate through all tick depth wich should be labeled
AxisLabelProperties aAxisLabelProperties( m_aAxisLabelProperties );
- if( isAutoStaggeringOfLabelsAllowed( aAxisLabelProperties, pTickmarkHelper2D->isHorizontalAxis(), pTickmarkHelper2D->isVerticalAxis() ) )
+ if( isAutoStaggeringOfLabelsAllowed( aAxisLabelProperties, pTickFactory2D->isHorizontalAxis(), pTickFactory2D->isVerticalAxis() ) )
aAxisLabelProperties.eStaggering = STAGGER_EVEN;
aAxisLabelProperties.bOverlapAllowed = true;
aAxisLabelProperties.bLineBreakAllowed = false;
@@ -1392,33 +1457,33 @@ void SAL_CALL VCartesianAxis::createMaximumLabels()
::std::auto_ptr< TickIter > apTickIter = createMaximumLabelTickIterator( nTextLevel );
if(apTickIter.get())
{
- while( !createTextShapes( m_xTextTarget, *apTickIter.get(), aAxisLabelProperties, pTickmarkHelper2D, -1 ) )
+ while( !createTextShapes( m_xTextTarget, *apTickIter.get(), aAxisLabelProperties, pTickFactory2D, -1 ) )
{
};
}
}
- doStaggeringOfLabels( aAxisLabelProperties, pTickmarkHelper2D );
+ doStaggeringOfLabels( aAxisLabelProperties, pTickFactory2D );
}
}
-void SAL_CALL VCartesianAxis::updatePositions()
+void VCartesianAxis::updatePositions()
{
//-----------------------------------------
//update positions of labels
if( m_aAxisProperties.m_bDisplayLabels )
{
- std::auto_ptr< TickmarkHelper_2D > apTickmarkHelper2D( this->createTickmarkHelper2D() );
- TickmarkHelper_2D* pTickmarkHelper2D = apTickmarkHelper2D.get();
- if( !pTickmarkHelper2D )
+ std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() );
+ TickFactory_2D* pTickFactory2D = apTickFactory2D.get();
+ if( !pTickFactory2D )
return;
//-----------------------------------------
//update positions of all existing text shapes
- pTickmarkHelper2D->updateScreenValues( m_aAllTickInfos );
+ pTickFactory2D->updateScreenValues( m_aAllTickInfos );
::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = m_aAllTickInfos.begin();
const ::std::vector< ::std::vector< TickInfo > >::const_iterator aDepthEnd = m_aAllTickInfos.end();
- for( ; aDepthIter != aDepthEnd; aDepthIter++ )
+ for( sal_Int32 nDepth=0; aDepthIter != aDepthEnd; aDepthIter++, nDepth++ )
{
::std::vector< TickInfo >::iterator aTickIter = aDepthIter->begin();
const ::std::vector< TickInfo >::const_iterator aTickEnd = aDepthIter->end();
@@ -1428,15 +1493,19 @@ void SAL_CALL VCartesianAxis::updatePositions()
Reference< drawing::XShape > xShape2DText( rTickInfo.xTextShape );
if( xShape2DText.is() )
{
- B2DVector aTextToTickDistance( pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, true ) );
+ B2DVector aTextToTickDistance( pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties, true ) );
B2DVector aTickScreenPos2D( rTickInfo.aTickScreenPosition );
aTickScreenPos2D += aTextToTickDistance;
awt::Point aAnchorScreenPosition2D(
static_cast<sal_Int32>(aTickScreenPos2D.getX())
,static_cast<sal_Int32>(aTickScreenPos2D.getY()));
+ double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
+ if( nDepth>0 )
+ fRotationAngleDegree = 0.0;
+
// #i78696# use mathematically correct rotation now
- const double fRotationAnglePi(m_aAxisLabelProperties.fRotationAngleDegree * (F_PI / -180.0));
+ const double fRotationAnglePi(fRotationAngleDegree * (F_PI / -180.0));
uno::Any aATransformation = ShapeFactory::makeTransformation(aAnchorScreenPosition2D, fRotationAnglePi);
//set new position
@@ -1455,16 +1524,16 @@ void SAL_CALL VCartesianAxis::updatePositions()
//correctPositionForRotation
LabelPositionHelper::correctPositionForRotation( xShape2DText
- , m_aAxisProperties.m_aLabelAlignment, m_aAxisLabelProperties.fRotationAngleDegree, false );
+ , m_aAxisProperties.m_aLabelAlignment, fRotationAngleDegree, m_aAxisProperties.m_bComplexCategories );
}
}
}
- doStaggeringOfLabels( m_aAxisLabelProperties, pTickmarkHelper2D );
+ doStaggeringOfLabels( m_aAxisLabelProperties, pTickFactory2D );
}
}
-void VCartesianAxis::createTickMarkLineShapes( ::std::vector< TickInfo >& rTickInfos, const TickmarkProperties& rTickmarkProperties, TickmarkHelper_2D& rTickmarkHelper2D, bool bOnlyAtLabels )
+void VCartesianAxis::createTickMarkLineShapes( ::std::vector< TickInfo >& rTickInfos, const TickmarkProperties& rTickmarkProperties, TickFactory_2D& rTickFactory2D, bool bOnlyAtLabels )
{
sal_Int32 nPointCount = rTickInfos.size();
drawing::PointSequenceSequence aPoints(2*nPointCount);
@@ -1483,11 +1552,11 @@ void VCartesianAxis::createTickMarkLineShapes( ::std::vector< TickInfo >& rTickI
fInnerDirectionSign *= -1.0;
bTicksAtLabels = bTicksAtLabels || bOnlyAtLabels;
//add ticks at labels:
- rTickmarkHelper2D.addPointSequenceForTickLine( aPoints, nN++, (*aTickIter).fScaledTickValue
+ rTickFactory2D.addPointSequenceForTickLine( aPoints, nN++, (*aTickIter).fScaledTickValue
, fInnerDirectionSign , rTickmarkProperties, bTicksAtLabels );
//add ticks at axis (without lables):
if( !bOnlyAtLabels && m_aAxisProperties.m_eTickmarkPos == ::com::sun::star::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS )
- rTickmarkHelper2D.addPointSequenceForTickLine( aPoints, nN++, (*aTickIter).fScaledTickValue
+ rTickFactory2D.addPointSequenceForTickLine( aPoints, nN++, (*aTickIter).fScaledTickValue
, m_aAxisProperties.m_fInnerDirectionSign, rTickmarkProperties, !bTicksAtLabels );
}
aPoints.realloc(nN);
@@ -1495,14 +1564,14 @@ void VCartesianAxis::createTickMarkLineShapes( ::std::vector< TickInfo >& rTickI
, &rTickmarkProperties.aLineProperties );
}
-void SAL_CALL VCartesianAxis::createShapes()
+void VCartesianAxis::createShapes()
{
if( !prepareShapeCreation() )
return;
- std::auto_ptr< TickmarkHelper_2D > apTickmarkHelper2D( this->createTickmarkHelper2D() );
- TickmarkHelper_2D* pTickmarkHelper2D = apTickmarkHelper2D.get();
- if( !pTickmarkHelper2D )
+ std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() );
+ TickFactory_2D* pTickFactory2D = apTickFactory2D.get();
+ if( !pTickFactory2D )
return;
//-----------------------------------------
@@ -1511,23 +1580,26 @@ void SAL_CALL VCartesianAxis::createShapes()
{
//-----------------------------------------
//create extra long ticks to separate complex categories (create them only there where the labels are)
- if( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels )
+ if( isComplexCategoryAxis() )
{
::std::vector< ::std::vector< TickInfo > > aComplexTickInfos;
createAllTickInfosFromComplexCategories( aComplexTickInfos, true );
- pTickmarkHelper2D->updateScreenValues( aComplexTickInfos );
+ pTickFactory2D->updateScreenValues( aComplexTickInfos );
hideIdenticalScreenValues( aComplexTickInfos );
::std::vector<TickmarkProperties> aTickmarkPropertiesList;
static bool bIncludeSpaceBetweenTickAndText = false;
- sal_Int32 nOffset = static_cast<sal_Int32>(pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, false, bIncludeSpaceBetweenTickAndText ).getLength());
+ sal_Int32 nOffset = static_cast<sal_Int32>(pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties, false, bIncludeSpaceBetweenTickAndText ).getLength());
sal_Int32 nTextLevelCount = getTextLevelCount();
for( sal_Int32 nTextLevel=0; nTextLevel<nTextLevelCount; nTextLevel++ )
{
::std::auto_ptr< TickIter > apTickIter = createLabelTickIterator( nTextLevel );
if( apTickIter.get() )
{
- B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickmarkHelper2D->getDistanceAxisTickToText( m_aAxisProperties, false ) ) );
+ double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
+ if( nTextLevel>0 )
+ fRotationAngleDegree = 0.0;
+ B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties, false ), fRotationAngleDegree ) );
sal_Int32 nCurrentLength = static_cast<sal_Int32>(aLabelsDistance.getLength());
aTickmarkPropertiesList.push_back( m_aAxisProperties.makeTickmarkPropertiesForComplexCategories( nOffset + nCurrentLength, 0, nTextLevel ) );
nOffset += nCurrentLength;
@@ -1541,20 +1613,20 @@ void SAL_CALL VCartesianAxis::createShapes()
{
if(nDepth==0 && !m_aAxisProperties.m_nMajorTickmarks)
continue;
- createTickMarkLineShapes( *aDepthIter, aTickmarkPropertiesList[nDepth], *pTickmarkHelper2D, true /*bOnlyAtLabels*/ );
+ createTickMarkLineShapes( *aDepthIter, aTickmarkPropertiesList[nDepth], *pTickFactory2D, true /*bOnlyAtLabels*/ );
}
}
//-----------------------------------------
//create normal ticks for major and minor intervals
{
- ::std::vector< ::std::vector< TickInfo > > aAllShiftedTickInfos;
- if( m_aIncrement.ShiftedPosition || ( m_aAxisProperties.m_bComplexCategories && m_bUseTextLabels ) )
+ ::std::vector< ::std::vector< TickInfo > > aUnshiftedTickInfos;
+ if( m_aScale.ShiftedCategoryPosition )// if ShiftedCategoryPosition==true the tickmarks in m_aAllTickInfos are shifted
{
- pTickmarkHelper2D->getAllTicksShifted( aAllShiftedTickInfos );
- pTickmarkHelper2D->updateScreenValues( aAllShiftedTickInfos );
- hideIdenticalScreenValues( aAllShiftedTickInfos );
+ pTickFactory2D->getAllTicks( aUnshiftedTickInfos );
+ pTickFactory2D->updateScreenValues( aUnshiftedTickInfos );
+ hideIdenticalScreenValues( aUnshiftedTickInfos );
}
- ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos = m_aIncrement.ShiftedPosition ? aAllShiftedTickInfos : m_aAllTickInfos;
+ ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos = m_aScale.ShiftedCategoryPosition ? aUnshiftedTickInfos : m_aAllTickInfos;
::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = rAllTickInfos.begin();
const ::std::vector< ::std::vector< TickInfo > >::const_iterator aDepthEnd = rAllTickInfos.end();
@@ -1563,14 +1635,14 @@ void SAL_CALL VCartesianAxis::createShapes()
sal_Int32 nTickmarkPropertiesCount = m_aAxisProperties.m_aTickmarkPropertiesList.size();
for( sal_Int32 nDepth=0; aDepthIter != aDepthEnd && nDepth < nTickmarkPropertiesCount; aDepthIter++, nDepth++ )
- createTickMarkLineShapes( *aDepthIter, m_aAxisProperties.m_aTickmarkPropertiesList[nDepth], *pTickmarkHelper2D, false /*bOnlyAtLabels*/ );
+ createTickMarkLineShapes( *aDepthIter, m_aAxisProperties.m_aTickmarkPropertiesList[nDepth], *pTickFactory2D, false /*bOnlyAtLabels*/ );
}
//-----------------------------------------
//create axis main lines
//it serves also as the handle shape for the axis selection
{
drawing::PointSequenceSequence aPoints(1);
- apTickmarkHelper2D->createPointSequenceForAxisMainLine( aPoints );
+ apTickFactory2D->createPointSequenceForAxisMainLine( aPoints );
Reference< drawing::XShape > xShape = m_pShapeFactory->createLine2D(
m_xGroupShape_Shapes, aPoints
, &m_aAxisProperties.m_aLineProperties );
diff --git a/chart2/source/view/axes/VCartesianAxis.hxx b/chart2/source/view/axes/VCartesianAxis.hxx
index 9786a56ff95c..68c93bb2e101 100644
--- a/chart2/source/view/axes/VCartesianAxis.hxx
+++ b/chart2/source/view/axes/VCartesianAxis.hxx
@@ -56,20 +56,11 @@ public:
virtual ~VCartesianAxis();
- //-------------------------------------------------------------------------
- // partly chart2::XPlotter
- //-------------------------------------------------------------------------
-
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
-
- virtual void SAL_CALL createMaximumLabels();
- virtual void SAL_CALL createLabels();
- virtual void SAL_CALL updatePositions();
+ virtual void createMaximumLabels();
+ virtual void createLabels();
+ virtual void updatePositions();
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
virtual sal_Int32 estimateMaximumAutoMainIncrementCount();
virtual void createAllTickInfos( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos );
@@ -80,7 +71,7 @@ public:
sal_Int32 getTextLevelCount() const;
//-------------------------------------------------------------------------
- virtual TickmarkHelper* createTickmarkHelper();
+ virtual TickFactory* createTickFactory();
//-------------------------------------------------------------------------
double getLogicValueWhereMainLineCrossesOtherAxis() const;
@@ -123,16 +114,16 @@ protected: //methods
::com::sun::star::drawing::XShapes >& xTarget
, TickIter& rTickIter
, AxisLabelProperties& rAxisLabelProperties
- , TickmarkHelper_2D* pTickmarkHelper
+ , TickFactory_2D* pTickFactory
, sal_Int32 nScreenDistanceBetweenTicks );
- void createTickMarkLineShapes( ::std::vector< TickInfo >& rTickInfos, const TickmarkProperties& rTickmarkProperties, TickmarkHelper_2D& rTickmarkHelper2D, bool bOnlyAtLabels );
+ void createTickMarkLineShapes( ::std::vector< TickInfo >& rTickInfos, const TickmarkProperties& rTickmarkProperties, TickFactory_2D& rTickFactory2D, bool bOnlyAtLabels );
- TickmarkHelper_2D* createTickmarkHelper2D();
+ TickFactory_2D* createTickFactory2D();
void hideIdenticalScreenValues( ::std::vector< ::std::vector< TickInfo > >& rTickInfos ) const;
void doStaggeringOfLabels( const AxisLabelProperties& rAxisLabelProperties
- , TickmarkHelper_2D* pTickmarkHelper2D );
+ , TickFactory_2D* pTickFactory2D );
bool isAutoStaggeringOfLabelsAllowed( const AxisLabelProperties& rAxisLabelProperties
, bool bIsHorizontalAxis, bool bIsVerticalAxis );
bool isBreakOfLabelsAllowed( const AxisLabelProperties& rAxisLabelProperties, bool bIsHorizontalAxis );
diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
index 49b87ee0d46a..53c0da1c12fe 100644
--- a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
@@ -149,11 +149,7 @@ void VCartesianCoordinateSystem::createVAxisList(
aAxisProperties.m_bCrossingAxisHasReverseDirection = (AxisOrientation_REVERSE==aCrossingScale.Orientation);
if( aCrossingScale.AxisType == AxisType::CATEGORY )
- {
aAxisProperties.m_bCrossingAxisIsCategoryAxes = true;
- aAxisProperties.m_bAxisBetweenCategories = ChartTypeHelper::shiftTicksAtXAxisPerDefault( AxisHelper::getChartTypeByIndex( m_xCooSysModel, 0 ) )
- || ( aAxisProperties.m_pExplicitCategoriesProvider && aAxisProperties.m_pExplicitCategoriesProvider->hasComplexCategories() );
- }
}
if( nDimensionIndex == 2 )
@@ -168,17 +164,11 @@ void VCartesianCoordinateSystem::createVAxisList(
if(aAxisProperties.m_bDisplayLabels)
aAxisProperties.m_nNumberFormatKey = this->getNumberFormatKeyForAxis( xAxis, xNumberFormatsSupplier );
- if( nDimensionIndex == 0 && aAxisProperties.m_nAxisType == AxisType::CATEGORY
- && aAxisProperties.m_pExplicitCategoriesProvider )
- {
- if( aAxisProperties.m_pExplicitCategoriesProvider->hasComplexCategories() )
- aAxisProperties.m_bComplexCategories = true;
- }
-
::boost::shared_ptr< VAxisBase > apVAxis( new VCartesianAxis(aAxisProperties,xNumberFormatsSupplier,nDimensionIndex,nDimensionCount) );
tFullAxisIndex aFullAxisIndex( nDimensionIndex, nAxisIndex );
m_aAxisMap[aFullAxisIndex] = apVAxis;
apVAxis->set3DWallPositions( m_eLeftWallPos, m_eBackWallPos, m_eBottomPos );
+
apVAxis->initAxisLabelProperties(rFontReferenceSize,rMaximumSpaceForLabels);
}
}
diff --git a/chart2/source/view/axes/VCartesianGrid.cxx b/chart2/source/view/axes/VCartesianGrid.cxx
index 5e42ba7eed79..e0aca77d9ba9 100644
--- a/chart2/source/view/axes/VCartesianGrid.cxx
+++ b/chart2/source/view/axes/VCartesianGrid.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
#include "VCartesianGrid.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include "PlottingPositionHelper.hxx"
#include "ShapeFactory.hxx"
#include "ObjectIdentifier.hxx"
@@ -211,7 +211,7 @@ void VCartesianGrid::fillLinePropertiesFromGridModel( ::std::vector<VLinePropert
}
};
-void SAL_CALL VCartesianGrid::createShapes()
+void VCartesianGrid::createShapes()
{
if(!m_aGridPropertiesList.getLength())
return;
@@ -231,13 +231,10 @@ void SAL_CALL VCartesianGrid::createShapes()
//-----------------------------------------
//create all scaled tickmark values
- std::auto_ptr< TickmarkHelper > apTickmarkHelper( this->createTickmarkHelper() );
- TickmarkHelper& aTickmarkHelper = *apTickmarkHelper.get();
+ std::auto_ptr< TickFactory > apTickFactory( this->createTickFactory() );
+ TickFactory& aTickFactory = *apTickFactory.get();
::std::vector< ::std::vector< TickInfo > > aAllTickInfos;
- if( m_aIncrement.ShiftedPosition )
- aTickmarkHelper.getAllTicksShifted( aAllTickInfos );
- else
- aTickmarkHelper.getAllTicks( aAllTickInfos );
+ aTickFactory.getAllTicks( aAllTickInfos );
//-----------------------------------------
//create tick mark line shapes
diff --git a/chart2/source/view/axes/VCartesianGrid.hxx b/chart2/source/view/axes/VCartesianGrid.hxx
index 851008a503d4..a2d7e1d1ddac 100644
--- a/chart2/source/view/axes/VCartesianGrid.hxx
+++ b/chart2/source/view/axes/VCartesianGrid.hxx
@@ -53,7 +53,7 @@ public:
);
virtual ~VCartesianGrid();
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
static void fillLinePropertiesFromGridModel( ::std::vector<VLineProperties>& rLinePropertiesList
, const ::com::sun::star::uno::Sequence<
diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx
index 8d136ee2b325..dc273328e45a 100644
--- a/chart2/source/view/axes/VCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCoordinateSystem.cxx
@@ -98,8 +98,8 @@ VCoordinateSystem::VCoordinateSystem( const Reference< XCoordinateSystem >& xCoo
{
if( !m_xCooSysModel.is() || m_xCooSysModel->getDimension()<3 )
{
- m_aExplicitScales[2].Minimum = -0.5;
- m_aExplicitScales[2].Maximum = 0.5;
+ m_aExplicitScales[2].Minimum = 1.0;
+ m_aExplicitScales[2].Maximum = 2.0;
m_aExplicitScales[2].Orientation = AxisOrientation_MATHEMATICAL;
}
}
@@ -107,7 +107,7 @@ VCoordinateSystem::~VCoordinateSystem()
{
}
-void SAL_CALL VCoordinateSystem::initPlottingTargets( const Reference< drawing::XShapes >& xLogicTarget
+void VCoordinateSystem::initPlottingTargets( const Reference< drawing::XShapes >& xLogicTarget
, const Reference< drawing::XShapes >& xFinalTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory
, Reference< drawing::XShapes >& xLogicTargetForSeriesBehindAxis )
@@ -271,9 +271,9 @@ ExplicitCategoriesProvider* VCoordinateSystem::getExplicitCategoriesProvider()
return m_apExplicitCategoriesProvider.get();
}
-Sequence< ExplicitScaleData > VCoordinateSystem::getExplicitScales( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
+std::vector< ExplicitScaleData > VCoordinateSystem::getExplicitScales( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
{
- Sequence< ExplicitScaleData > aRet(m_aExplicitScales);
+ std::vector< ExplicitScaleData > aRet(m_aExplicitScales);
impl_adjustDimensionAndIndex( nDimensionIndex, nAxisIndex );
aRet[nDimensionIndex]=this->getExplicitScale( nDimensionIndex, nAxisIndex );
@@ -281,9 +281,9 @@ Sequence< ExplicitScaleData > VCoordinateSystem::getExplicitScales( sal_Int32 nD
return aRet;
}
-Sequence< ExplicitIncrementData > VCoordinateSystem::getExplicitIncrements( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
+std::vector< ExplicitIncrementData > VCoordinateSystem::getExplicitIncrements( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const
{
- Sequence< ExplicitIncrementData > aRet(m_aExplicitIncrements);
+ std::vector< ExplicitIncrementData > aRet(m_aExplicitIncrements);
impl_adjustDimensionAndIndex( nDimensionIndex, nAxisIndex );
aRet[nDimensionIndex]=this->getExplicitIncrement( nDimensionIndex, nAxisIndex );
@@ -382,6 +382,17 @@ void VCoordinateSystem::updateScalesAndIncrementsOnAxes()
void VCoordinateSystem::prepareScaleAutomatismForDimensionAndIndex( ScaleAutomatism& rScaleAutomatism, sal_Int32 nDimIndex, sal_Int32 nAxisIndex )
{
+ if( rScaleAutomatism.getScale().AxisType==AxisType::DATE && nDimIndex==0 )
+ {
+ sal_Int32 nTimeResolution = ::com::sun::star::chart::TimeUnit::MONTH;
+ if( !(rScaleAutomatism.getScale().TimeIncrement.TimeResolution >>= nTimeResolution) )
+ {
+ nTimeResolution = m_aMergedMinimumAndMaximumSupplier.calculateTimeResolutionOnXAxis();
+ rScaleAutomatism.setAutomaticTimeResolution( nTimeResolution );
+ }
+ m_aMergedMinimumAndMaximumSupplier.setTimeResolutionOnXAxis( nTimeResolution, rScaleAutomatism.getNullDate() );
+ }
+
double fMin = 0.0;
double fMax = 0.0;
::rtl::math::setInf(&fMin, false);
@@ -403,11 +414,6 @@ void VCoordinateSystem::prepareScaleAutomatismForDimensionAndIndex( ScaleAutomat
fMax = m_aMergedMinimumAndMaximumSupplier.getMaximumZ();
}
- this->prepareScaleAutomatism( rScaleAutomatism, fMin, fMax, nDimIndex, nAxisIndex );
-}
-
-void VCoordinateSystem::prepareScaleAutomatism( ScaleAutomatism& rScaleAutomatism, double fMin, double fMax, sal_Int32 nDimIndex, sal_Int32 nAxisIndex )
-{
//merge our values with those already contained in rScaleAutomatism
rScaleAutomatism.expandValueRange( fMin, fMax );
diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx b/chart2/source/view/axes/VPolarAngleAxis.cxx
index a45cf6977f11..f5469c366358 100644
--- a/chart2/source/view/axes/VPolarAngleAxis.cxx
+++ b/chart2/source/view/axes/VPolarAngleAxis.cxx
@@ -34,7 +34,7 @@
#include "VPolarGrid.hxx"
#include "ShapeFactory.hxx"
#include "macros.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "PolarLabelPositionHelper.hxx"
#include <tools/color.hxx>
@@ -121,17 +121,17 @@ bool VPolarAngleAxis::createTextShapes_ForAngleAxis(
rtl::OUString aLabel;
if(pLabels)
{
- sal_Int32 nIndex = static_cast< sal_Int32 >(pTickInfo->fUnscaledTickValue) - 1; //first category (index 0) matches with real number 1.0
+ sal_Int32 nIndex = static_cast< sal_Int32 >(pTickInfo->getUnscaledTickValue()) - 1; //first category (index 0) matches with real number 1.0
if( nIndex>=0 && nIndex<pLabels->getLength() )
aLabel = (*pLabels)[nIndex];
}
else
- aLabel = aFixedNumberFormatter.getFormattedString( pTickInfo->fUnscaledTickValue, nExtraColor, bHasExtraColor );
+ aLabel = aFixedNumberFormatter.getFormattedString( pTickInfo->getUnscaledTickValue(), nExtraColor, bHasExtraColor );
if(pColorAny)
*pColorAny = uno::makeAny(bHasExtraColor?nExtraColor:nColor);
- double fLogicAngle = pTickInfo->fUnscaledTickValue;
+ double fLogicAngle = pTickInfo->getUnscaledTickValue();
LabelAlignment eLabelAlignment(LABEL_ALIGN_CENTER);
PolarLabelPositionHelper aPolarLabelPositionHelper(m_pPosHelper,nDimensionCount,xTarget,&aShapeFactory);
@@ -155,7 +155,7 @@ bool VPolarAngleAxis::createTextShapes_ForAngleAxis(
return true;
}
-void SAL_CALL VPolarAngleAxis::createMaximumLabels()
+void VPolarAngleAxis::createMaximumLabels()
{
if( !prepareShapeCreation() )
return;
@@ -163,7 +163,7 @@ void SAL_CALL VPolarAngleAxis::createMaximumLabels()
createLabels();
}
-void SAL_CALL VPolarAngleAxis::updatePositions()
+void VPolarAngleAxis::updatePositions()
{
//todo: really only update the positions
@@ -173,18 +173,19 @@ void SAL_CALL VPolarAngleAxis::updatePositions()
createLabels();
}
-void SAL_CALL VPolarAngleAxis::createLabels()
+void VPolarAngleAxis::createLabels()
{
if( !prepareShapeCreation() )
return;
double fLogicRadius = m_pPosHelper->getOuterLogicRadius();
+ double fLogicZ = 1.0;//as defined
if( m_aAxisProperties.m_bDisplayLabels )
{
//-----------------------------------------
//get the transformed screen values for all tickmarks in aAllTickInfos
- std::auto_ptr< TickmarkHelper > apTickmarkHelper( this->createTickmarkHelper() );
+ std::auto_ptr< TickFactory > apTickFactory( this->createTickFactory() );
//create tick mark text shapes
//@todo: iterate through all tick depth wich should be labeled
@@ -208,13 +209,13 @@ void SAL_CALL VPolarAngleAxis::createLabels()
}
}
-void SAL_CALL VPolarAngleAxis::createShapes()
+void VPolarAngleAxis::createShapes()
{
if( !prepareShapeCreation() )
return;
double fLogicRadius = m_pPosHelper->getOuterLogicRadius();
- double fLogicZ = -0.5;//as defined
+ double fLogicZ = 1.0;//as defined
//-----------------------------------------
//create axis main lines
diff --git a/chart2/source/view/axes/VPolarAngleAxis.hxx b/chart2/source/view/axes/VPolarAngleAxis.hxx
index 034cb36e690c..97cb7bf7463b 100644
--- a/chart2/source/view/axes/VPolarAngleAxis.hxx
+++ b/chart2/source/view/axes/VPolarAngleAxis.hxx
@@ -29,6 +29,7 @@
#define _CHART2_VPOLARANGLEAXIS_HXX
#include "VPolarAxis.hxx"
+#include "Tickmarks_Equidistant.hxx"
//.............................................................................
namespace chart
@@ -47,11 +48,11 @@ public:
, sal_Int32 nDimensionCount );
virtual ~VPolarAngleAxis();
- virtual void SAL_CALL createMaximumLabels();
- virtual void SAL_CALL createLabels();
- virtual void SAL_CALL updatePositions();
+ virtual void createMaximumLabels();
+ virtual void createLabels();
+ virtual void updatePositions();
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
private: //methods
bool createTextShapes_ForAngleAxis(
diff --git a/chart2/source/view/axes/VPolarAxis.cxx b/chart2/source/view/axes/VPolarAxis.cxx
index 5caee2fff67a..687ac8fe8780 100644
--- a/chart2/source/view/axes/VPolarAxis.cxx
+++ b/chart2/source/view/axes/VPolarAxis.cxx
@@ -32,7 +32,7 @@
#include "VPolarAngleAxis.hxx"
#include "VPolarRadiusAxis.hxx"
#include "macros.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include "ShapeFactory.hxx"
#include <memory>
@@ -69,12 +69,12 @@ VPolarAxis::~VPolarAxis()
m_pPosHelper = NULL;
}
-void VPolarAxis::setIncrements( const uno::Sequence< ExplicitIncrementData >& rIncrements )
+void VPolarAxis::setIncrements( const std::vector< ExplicitIncrementData >& rIncrements )
{
m_aIncrements = rIncrements;
}
-sal_Bool SAL_CALL VPolarAxis::isAnythingToDraw()
+sal_Bool VPolarAxis::isAnythingToDraw()
{
return ( 2==m_nDimension && VAxisBase::isAnythingToDraw() );
}
diff --git a/chart2/source/view/axes/VPolarAxis.hxx b/chart2/source/view/axes/VPolarAxis.hxx
index 20d8b2805ea6..5d4d667297e9 100644
--- a/chart2/source/view/axes/VPolarAxis.hxx
+++ b/chart2/source/view/axes/VPolarAxis.hxx
@@ -48,10 +48,9 @@ public:
, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier
, sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount );
- void setIncrements( const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitIncrementData >& rIncrements );
+ void setIncrements( const std::vector< ExplicitIncrementData >& rIncrements );
- virtual sal_Bool SAL_CALL isAnythingToDraw();
+ virtual sal_Bool isAnythingToDraw();
virtual ~VPolarAxis();
@@ -62,8 +61,7 @@ protected:
protected: //member
PolarPlottingPositionHelper* m_pPosHelper;
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitIncrementData > m_aIncrements;
+ ::std::vector< ExplicitIncrementData > m_aIncrements;
};
//.............................................................................
diff --git a/chart2/source/view/axes/VPolarCoordinateSystem.cxx b/chart2/source/view/axes/VPolarCoordinateSystem.cxx
index 278a99f6fcdd..7e13c26477cd 100644
--- a/chart2/source/view/axes/VPolarCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VPolarCoordinateSystem.cxx
@@ -101,6 +101,7 @@ void VPolarCoordinateSystem::createVAxisList(
::boost::shared_ptr< VAxisBase > apVAxis( VPolarAxis::createAxis( aAxisProperties,xNumberFormatsSupplier,nDimensionIndex,nDimensionCount) );
tFullAxisIndex aFullAxisIndex( nDimensionIndex, nAxisIndex );
m_aAxisMap[aFullAxisIndex] = apVAxis;
+
apVAxis->initAxisLabelProperties(rFontReferenceSize,rMaximumSpaceForLabels);
}
}
diff --git a/chart2/source/view/axes/VPolarGrid.cxx b/chart2/source/view/axes/VPolarGrid.cxx
index f9ae00f779a1..7c8a26d75857 100644
--- a/chart2/source/view/axes/VPolarGrid.cxx
+++ b/chart2/source/view/axes/VPolarGrid.cxx
@@ -30,12 +30,13 @@
#include "precompiled_chart2.hxx"
#include "VPolarGrid.hxx"
#include "VCartesianGrid.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include "PlottingPositionHelper.hxx"
#include "ShapeFactory.hxx"
#include "ObjectIdentifier.hxx"
#include "macros.hxx"
#include "CommonConverters.hxx"
+#include "Tickmarks_Equidistant.hxx"
#include <com/sun/star/drawing/LineStyle.hpp>
#include <vector>
@@ -65,16 +66,16 @@ VPolarGrid::~VPolarGrid()
m_pPosHelper = NULL;
}
-void VPolarGrid::setIncrements( const uno::Sequence< ExplicitIncrementData >& rIncrements )
+void VPolarGrid::setIncrements( const std::vector< ExplicitIncrementData >& rIncrements )
{
m_aIncrements = rIncrements;
}
void VPolarGrid::getAllTickInfos( sal_Int32 nDimensionIndex, ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const
{
- TickmarkHelper aTickmarkHelper(
+ TickFactory aTickFactory(
m_pPosHelper->getScales()[nDimensionIndex], m_aIncrements[nDimensionIndex] );
- aTickmarkHelper.getAllTicks( rAllTickInfos );
+ aTickFactory.getAllTicks( rAllTickInfos );
}
void VPolarGrid::createLinePointSequence_ForAngleAxis(
@@ -98,8 +99,8 @@ void VPolarGrid::createLinePointSequence_ForAngleAxis(
if(nTick>=rPoints[0].getLength())
rPoints[0].realloc(rPoints[0].getLength()+30);
- pTickInfo->updateUnscaledValue( xInverseScaling );
- double fLogicAngle = pTickInfo->fUnscaledTickValue;
+ //xxxxx pTickInfo->updateUnscaledValue( xInverseScaling );
+ double fLogicAngle = pTickInfo->getUnscaledTickValue();
drawing::Position3D aScenePosition3D( pPosHelper->transformAngleRadiusToScene( fLogicAngle, fLogicRadius, fLogicZ ) );
rPoints[0][nTick].X = static_cast<sal_Int32>(aScenePosition3D.PositionX);
@@ -114,6 +115,66 @@ void VPolarGrid::createLinePointSequence_ForAngleAxis(
else
rPoints[0].realloc(0);
}
+#ifdef NOTYET
+void VPolarGrid::create2DAngleGrid( const Reference< drawing::XShapes >& xLogicTarget
+ , ::std::vector< ::std::vector< TickInfo > >& /* rRadiusTickInfos */
+ , ::std::vector< ::std::vector< TickInfo > >& rAngleTickInfos
+ , const ::std::vector<VLineProperties>& rLinePropertiesList )
+{
+ Reference< drawing::XShapes > xMainTarget(
+ this->createGroupShape( xLogicTarget, m_aCID ) );
+
+ const ExplicitScaleData& rAngleScale = m_pPosHelper->getScales()[0];
+ Reference< XScaling > xInverseScaling( NULL );
+ if( rAngleScale.Scaling.is() )
+ xInverseScaling = rAngleScale.Scaling->getInverseScaling();
+
+ double fLogicInnerRadius = m_pPosHelper->getInnerLogicRadius();
+ double fLogicOuterRadius = m_pPosHelper->getOuterLogicRadius();
+ double fLogicZ = 1.0;//as defined
+
+ sal_Int32 nLinePropertiesCount = rLinePropertiesList.size();
+ ::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = rAngleTickInfos.begin();
+ sal_Int32 nDepth=0;
+ /*
+ //no subgrids so far for polar angle grid (need different radii)
+ const ::std::vector< ::std::vector< TickInfo > >::const_iterator aDepthEnd = rAngleTickInfos.end();
+ for( ; aDepthIter != aDepthEnd && nDepth < nLinePropertiesCount
+ ; aDepthIter++, nDepth++ )
+ */
+ if(nLinePropertiesCount)
+ {
+ //create axis main lines
+ drawing::PointSequenceSequence aAllPoints;
+ ::std::vector< TickInfo >::iterator aTickIter = (*aDepthIter).begin();
+ const ::std::vector< TickInfo >::const_iterator aTickEnd = (*aDepthIter).end();
+ for( ; aTickIter != aTickEnd; aTickIter++ )
+ {
+ TickInfo& rTickInfo = *aTickIter;
+ if( !rTickInfo.bPaintIt )
+ continue;
+
+ //xxxxx rTickInfo.updateUnscaledValue( xInverseScaling );
+ double fLogicAngle = rTickInfo.getUnscaledTickValue();
+
+ drawing::PointSequenceSequence aPoints(1);
+ aPoints[0].realloc(2);
+ drawing::Position3D aScenePositionStart( m_pPosHelper->transformAngleRadiusToScene( fLogicAngle, fLogicInnerRadius, fLogicZ ) );
+ drawing::Position3D aScenePositionEnd( m_pPosHelper->transformAngleRadiusToScene( fLogicAngle, fLogicOuterRadius, fLogicZ ) );
+ aPoints[0][0].X = static_cast<sal_Int32>(aScenePositionStart.PositionX);
+ aPoints[0][0].Y = static_cast<sal_Int32>(aScenePositionStart.PositionY);
+ aPoints[0][1].X = static_cast<sal_Int32>(aScenePositionEnd.PositionX);
+ aPoints[0][1].Y = static_cast<sal_Int32>(aScenePositionEnd.PositionY);
+ appendPointSequence( aAllPoints, aPoints );
+ }
+
+ Reference< drawing::XShape > xShape = m_pShapeFactory->createLine2D(
+ xMainTarget, aAllPoints, &rLinePropertiesList[nDepth] );
+ //because of this name this line will be used for marking
+ m_pShapeFactory->setShapeName( xShape, C2U("MarkHandles") );
+ }
+}
+#endif
void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogicTarget
, ::std::vector< ::std::vector< TickInfo > >& rRadiusTickInfos
@@ -160,9 +221,9 @@ void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogic
if( !rTickInfo.bPaintIt )
continue;
- rTickInfo.updateUnscaledValue( xInverseRadiusScaling );
- double fLogicRadius = rTickInfo.fUnscaledTickValue;
- double fLogicZ = -0.5;//as defined
+ //xxxxx rTickInfo.updateUnscaledValue( xInverseRadiusScaling );
+ double fLogicRadius = rTickInfo.getUnscaledTickValue();
+ double fLogicZ = 1.0;//as defined
drawing::PointSequenceSequence aPoints(1);
VPolarGrid::createLinePointSequence_ForAngleAxis( aPoints, rAngleTickInfos
@@ -178,7 +239,7 @@ void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogic
}
}
-void SAL_CALL VPolarGrid::createShapes()
+void VPolarGrid::createShapes()
{
DBG_ASSERT(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is(),"Axis is not proper initialized");
if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is()))
diff --git a/chart2/source/view/axes/VPolarGrid.hxx b/chart2/source/view/axes/VPolarGrid.hxx
index 79050ed7da8f..29882792cabf 100644
--- a/chart2/source/view/axes/VPolarGrid.hxx
+++ b/chart2/source/view/axes/VPolarGrid.hxx
@@ -29,7 +29,7 @@
#define _CHART2_VPOLARGRID_HXX
#include "VAxisOrGridBase.hxx"
-#include "TickmarkHelper.hxx"
+#include "Tickmarks.hxx"
#include "VLineProperties.hxx"
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
@@ -56,16 +56,15 @@ public:
);
virtual ~VPolarGrid();
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
- void setIncrements( const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitIncrementData >& rIncrements );
+ void setIncrements( const std::vector< ExplicitIncrementData >& rIncrements );
static void createLinePointSequence_ForAngleAxis(
::com::sun::star::drawing::PointSequenceSequence& rPoints
, ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement
- , const ::com::sun::star::chart2::ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement
+ , const ExplicitScaleData& rScale
, PolarPlottingPositionHelper* pPosHelper
, double fLogicRadius, double fLogicZ );
@@ -74,8 +73,7 @@ private: //member
::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > > m_aGridPropertiesList;//main grid, subgrid, subsubgrid etc
PolarPlottingPositionHelper* m_pPosHelper;
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitIncrementData > m_aIncrements;
+ ::std::vector< ExplicitIncrementData > m_aIncrements;
void getAllTickInfos( sal_Int32 nDimensionIndex, ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const;
diff --git a/chart2/source/view/axes/VPolarRadiusAxis.cxx b/chart2/source/view/axes/VPolarRadiusAxis.cxx
index b7792a783138..92abb0af8bbe 100644
--- a/chart2/source/view/axes/VPolarRadiusAxis.cxx
+++ b/chart2/source/view/axes/VPolarRadiusAxis.cxx
@@ -33,6 +33,7 @@
#include "VCartesianAxis.hxx"
#include "PlottingPositionHelper.hxx"
#include "CommonConverters.hxx"
+#include "Tickmarks_Equidistant.hxx"
#include <rtl/math.hxx>
//.............................................................................
@@ -71,7 +72,7 @@ void VPolarRadiusAxis::setTransformationSceneToScreen( const drawing::HomogenMat
m_apAxisWithLabels->setTransformationSceneToScreen( rMatrix );
}
-void SAL_CALL VPolarRadiusAxis::setExplicitScaleAndIncrement(
+void VPolarRadiusAxis::setExplicitScaleAndIncrement(
const ExplicitScaleData& rScale
, const ExplicitIncrementData& rIncrement )
throw (uno::RuntimeException)
@@ -80,7 +81,7 @@ void SAL_CALL VPolarRadiusAxis::setExplicitScaleAndIncrement(
m_apAxisWithLabels->setExplicitScaleAndIncrement( rScale, rIncrement );
}
-void SAL_CALL VPolarRadiusAxis::initPlotter( const uno::Reference< drawing::XShapes >& xLogicTarget
+void VPolarRadiusAxis::initPlotter( const uno::Reference< drawing::XShapes >& xLogicTarget
, const uno::Reference< drawing::XShapes >& xFinalTarget
, const uno::Reference< lang::XMultiServiceFactory >& xShapeFactory
, const rtl::OUString& rCID )
@@ -90,15 +91,13 @@ void SAL_CALL VPolarRadiusAxis::initPlotter( const uno::Reference< drawing::XSh
m_apAxisWithLabels->initPlotter( xLogicTarget, xFinalTarget, xShapeFactory, rCID );
}
-void SAL_CALL VPolarRadiusAxis::setScales( const uno::Sequence< ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis )
- throw (uno::RuntimeException)
+void VPolarRadiusAxis::setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis )
{
VPolarAxis::setScales( rScales, bSwapXAndYAxis );
m_apAxisWithLabels->setScales( rScales, bSwapXAndYAxis );
}
-void SAL_CALL VPolarRadiusAxis::initAxisLabelProperties( const ::com::sun::star::awt::Size& rFontReferenceSize
+void VPolarRadiusAxis::initAxisLabelProperties( const ::com::sun::star::awt::Size& rFontReferenceSize
, const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels )
{
VPolarAxis::initAxisLabelProperties( rFontReferenceSize, rMaximumSpaceForLabels );
@@ -122,22 +121,22 @@ bool VPolarRadiusAxis::prepareShapeCreation()
return true;
}
-void SAL_CALL VPolarRadiusAxis::createMaximumLabels()
+void VPolarRadiusAxis::createMaximumLabels()
{
m_apAxisWithLabels->createMaximumLabels();
}
-void SAL_CALL VPolarRadiusAxis::updatePositions()
+void VPolarRadiusAxis::updatePositions()
{
m_apAxisWithLabels->updatePositions();
}
-void SAL_CALL VPolarRadiusAxis::createLabels()
+void VPolarRadiusAxis::createLabels()
{
m_apAxisWithLabels->createLabels();
}
-void SAL_CALL VPolarRadiusAxis::createShapes()
+void VPolarRadiusAxis::createShapes()
{
if( !prepareShapeCreation() )
return;
@@ -146,8 +145,8 @@ void SAL_CALL VPolarRadiusAxis::createShapes()
const ExplicitIncrementData& rAngleIncrement = m_aIncrements[0];
::std::vector< ::std::vector< TickInfo > > aAngleTickInfos;
- TickmarkHelper aAngleTickmarkHelper( rAngleScale, rAngleIncrement );
- aAngleTickmarkHelper.getAllTicks( aAngleTickInfos );
+ TickFactory aAngleTickFactory( rAngleScale, rAngleIncrement );
+ aAngleTickFactory.getAllTicks( aAngleTickInfos );
uno::Reference< XScaling > xInverseScaling( NULL );
if( rAngleScale.Scaling.is() )
@@ -166,8 +165,8 @@ void SAL_CALL VPolarRadiusAxis::createShapes()
continue;
}
- pTickInfo->updateUnscaledValue( xInverseScaling );
- aAxisProperties.m_pfMainLinePositionAtOtherAxis = new double( pTickInfo->fUnscaledTickValue );
+ //xxxxx pTickInfo->updateUnscaledValue( xInverseScaling );
+ aAxisProperties.m_pfMainLinePositionAtOtherAxis = new double( pTickInfo->getUnscaledTickValue() );
aAxisProperties.m_bDisplayLabels=false;
//-------------------
diff --git a/chart2/source/view/axes/VPolarRadiusAxis.hxx b/chart2/source/view/axes/VPolarRadiusAxis.hxx
index 91f9a40b83ee..70482b403283 100644
--- a/chart2/source/view/axes/VPolarRadiusAxis.hxx
+++ b/chart2/source/view/axes/VPolarRadiusAxis.hxx
@@ -51,7 +51,7 @@ public:
, sal_Int32 nDimensionCount );
virtual ~VPolarRadiusAxis();
- virtual void SAL_CALL initPlotter(
+ virtual void initPlotter(
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xLogicTarget
, const ::com::sun::star::uno::Reference<
@@ -63,28 +63,24 @@ public:
virtual void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix );
- virtual void SAL_CALL setScales(
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis )
- throw (::com::sun::star::uno::RuntimeException);
+ virtual void setScales( const ::std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
- virtual void SAL_CALL setExplicitScaleAndIncrement(
- const ::com::sun::star::chart2::ExplicitScaleData& rScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rIncrement )
+ virtual void setExplicitScaleAndIncrement(
+ const ExplicitScaleData& rScale
+ , const ExplicitIncrementData& rIncrement )
throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL initAxisLabelProperties(
+ virtual void initAxisLabelProperties(
const ::com::sun::star::awt::Size& rFontReferenceSize
, const ::com::sun::star::awt::Rectangle& rMaximumSpaceForLabels );
virtual sal_Int32 estimateMaximumAutoMainIncrementCount();
- virtual void SAL_CALL createMaximumLabels();
- virtual void SAL_CALL createLabels();
- virtual void SAL_CALL updatePositions();
+ virtual void createMaximumLabels();
+ virtual void createLabels();
+ virtual void updatePositions();
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
protected: //methods
virtual bool prepareShapeCreation();
diff --git a/chart2/source/view/axes/makefile.mk b/chart2/source/view/axes/makefile.mk
index 9e1d6ca38f7d..9704dc0b14bc 100644
--- a/chart2/source/view/axes/makefile.mk
+++ b/chart2/source/view/axes/makefile.mk
@@ -43,7 +43,11 @@ ENABLE_EXCEPTIONS= TRUE
SLOFILES = \
$(SLO)$/VAxisOrGridBase.obj \
$(SLO)$/VAxisBase.obj \
- $(SLO)$/TickmarkHelper.obj \
+ $(SLO)$/DateHelper.obj \
+ $(SLO)$/DateScaling.obj \
+ $(SLO)$/Tickmarks.obj \
+ $(SLO)$/Tickmarks_Equidistant.obj \
+ $(SLO)$/Tickmarks_Dates.obj \
$(SLO)$/MinimumAndMaximumSupplier.obj \
$(SLO)$/ScaleAutomatism.obj \
$(SLO)$/VAxisProperties.obj \
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index 7a35c3926e37..9aaa6a242ab0 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -43,13 +43,16 @@
#include "Clipping.hxx"
#include "Stripe.hxx"
#include "PolarLabelPositionHelper.hxx"
+#include "DateHelper.hxx"
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
+
#include <tools/debug.hxx>
#include <editeng/unoprnms.hxx>
#include <rtl/math.hxx>
+
#include <com/sun/star/drawing/DoubleSequence.hpp>
#include <com/sun/star/drawing/NormalsKind.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
@@ -96,6 +99,11 @@ AreaChart::AreaChart( const uno::Reference<XChartType>& xChartTypeModel
{
if( !m_pMainPosHelper )
m_pMainPosHelper = new PlottingPositionHelper();
+ if( m_pMainPosHelper )
+ {
+ m_pMainPosHelper->AllowShiftXAxisPos(true);
+ m_pMainPosHelper->AllowShiftZAxisPos(true);
+ }
PlotterBase::m_pPosHelper = m_pMainPosHelper;
VSeriesPlotter::m_pMainPosHelper = m_pMainPosHelper;
@@ -121,18 +129,12 @@ AreaChart::~AreaChart()
delete m_pMainPosHelper;
}
-double AreaChart::getMinimumX()
-{
- if( m_bCategoryXAxis && m_bIsPolarCooSys )//the angle axis in net charts needs a different autoscaling
- return 1.0;//first category (index 0) matches with real number 1.0
- return VSeriesPlotter::getMinimumX();
-}
-
double AreaChart::getMaximumX()
{
+ double fMax = VSeriesPlotter::getMaximumX();
if( m_bCategoryXAxis && m_bIsPolarCooSys )//the angle axis in net charts needs a different autoscaling
- return getPointCount()+1;
- return VSeriesPlotter::getMaximumX();
+ fMax += 1.0;
+ return fMax;
}
bool AreaChart::isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex )
@@ -152,8 +154,8 @@ bool AreaChart::isSeperateStackingForDifferentSigns( sal_Int32 /*nDimensionIndex
LegendSymbolStyle AreaChart::getLegendSymbolStyle()
{
if( m_bArea || m_nDimension == 3 )
- return chart2::LegendSymbolStyle_BOX;
- return chart2::LegendSymbolStyle_LINE_WITH_SYMBOL;
+ return LegendSymbolStyle_BOX;
+ return LegendSymbolStyle_LINE;
}
uno::Any AreaChart::getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex )
@@ -169,6 +171,20 @@ uno::Any AreaChart::getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPo
return aRet;
}
+//-----------------------------------------------------------------
+// lang::XServiceInfo
+//-----------------------------------------------------------------
+/*
+APPHELPER_XSERVICEINFO_IMPL(AreaChart,CHART2_VIEW_AREACHART_SERVICE_IMPLEMENTATION_NAME)
+
+ uno::Sequence< rtl::OUString > AreaChart
+::getSupportedServiceNames_Static()
+{
+ uno::Sequence< rtl::OUString > aSNS( 1 );
+ aSNS.getArray()[ 0 ] = CHART2_VIEW_AREACHART_SERVICE_NAME;
+ return aSNS;
+}
+*/
drawing::Direction3D AreaChart::getPreferredDiagramAspectRatio() const
{
if( m_nKeepAspectRatio == 1 )
@@ -602,7 +618,7 @@ void AreaChart::createShapes()
//check necessary here that different Y axis can not be stacked in the same group? ... hm?
//update/create information for current group
- double fLogicZ = 0.5;//as defined
+ double fLogicZ = 1.0;//as defined
sal_Int32 nStartIndex = 0; // inclusive ;..todo get somehow from x scale
sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
@@ -703,6 +719,8 @@ void AreaChart::createShapes()
//collect data point information (logic coordinates, style ):
double fLogicX = (*aSeriesIter)->getXValue(nIndex);
+ if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() )
+ fLogicX = DateHelper::RasterizeDateValue( fLogicX, m_aNullDate, m_nTimeResolution );
double fLogicY = (*aSeriesIter)->getYValue(nIndex);
if( m_bIsPolarCooSys && m_bArea &&
diff --git a/chart2/source/view/charttypes/AreaChart.hxx b/chart2/source/view/charttypes/AreaChart.hxx
index c3bd1ed3fbb4..abd887319bc1 100644
--- a/chart2/source/view/charttypes/AreaChart.hxx
+++ b/chart2/source/view/charttypes/AreaChart.hxx
@@ -56,17 +56,7 @@ public:
);
virtual ~AreaChart();
- //-------------------------------------------------------------------------
- // chart2::XPlotter
- //-------------------------------------------------------------------------
-
- virtual void SAL_CALL createShapes();
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
-
+ virtual void createShapes();
virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
//-------------------
@@ -76,14 +66,13 @@ public:
//-------------------------------------------------------------------------
// MinimumAndMaximumSupplier
//-------------------------------------------------------------------------
- virtual double getMinimumX();
virtual double getMaximumX();
virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex );
virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
//-------------------------------------------------------------------------
- virtual ::com::sun::star::chart2::LegendSymbolStyle getLegendSymbolStyle();
+ virtual LegendSymbolStyle getLegendSymbolStyle();
virtual ::com::sun::star::uno::Any getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex=-1/*-1 for series symbol*/ );
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index 036136384237..ad717a74b03c 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -39,6 +39,7 @@
#include "macros.hxx"
#include "AxisIndexDefines.hxx"
#include "Clipping.hxx"
+#include "DateHelper.hxx"
#include <com/sun/star/chart/DataLabelPlacement.hpp>
@@ -86,7 +87,6 @@ BarChart::~BarChart()
PlottingPositionHelper& BarChart::getPlottingPositionHelper( sal_Int32 nAxisIndex ) const
{
PlottingPositionHelper& rPosHelper = VSeriesPlotter::getPlottingPositionHelper( nAxisIndex );
-
BarPositionHelper* pBarPosHelper = dynamic_cast<BarPositionHelper*>(&rPosHelper);
if( pBarPosHelper && nAxisIndex >= 0 )
{
@@ -95,7 +95,6 @@ PlottingPositionHelper& BarChart::getPlottingPositionHelper( sal_Int32 nAxisInde
if( nAxisIndex < m_aGapwidthSequence.getLength() )
pBarPosHelper->setOuterDistance( m_aGapwidthSequence[nAxisIndex]/100.0 );
}
-
return rPosHelper;
}
@@ -113,7 +112,7 @@ drawing::Direction3D BarChart::getPreferredDiagramAspectRatio() const
if(!m_aZSlots.empty())
fXSlotCount = m_aZSlots.begin()->size();
- aRet.DirectionZ = aScale.DirectionZ/(aScale.DirectionX + aScale.DirectionX*(fXSlotCount-1.0)*pPosHelper->getSlotWidth());
+ aRet.DirectionZ = aScale.DirectionZ/(aScale.DirectionX + aScale.DirectionX*(fXSlotCount-1.0)*pPosHelper->getScaledSlotWidth());
}
else
return VSeriesPlotter::getPreferredDiagramAspectRatio();
@@ -141,27 +140,6 @@ bool BarChart::keepAspectRatio() const
return true;
}
-//-------------------------------------------------------------------------
-// MinimumAndMaximumSupplier
-//-------------------------------------------------------------------------
-
-double BarChart::getMinimumX()
-{
- if( m_bCategoryXAxis )
- return 0.5;//first category (index 0) matches with real number 1.0
- return VSeriesPlotter::getMinimumX();
-}
-double BarChart::getMaximumX()
-{
- if( m_bCategoryXAxis )
- {
- //return category count
- sal_Int32 nPointCount = getPointCount();
- return nPointCount+0.5;//first category (index 0) matches with real number 1.0
- }
- return VSeriesPlotter::getMaximumX();
-}
-
awt::Point BarChart::getLabelScreenPositionAndAlignment(
LabelAlignment& rAlignment, sal_Int32 nLabelPlacement
, double fScaledX, double fScaledLowerYValue, double fScaledUpperYValue, double fScaledZ
@@ -467,7 +445,7 @@ void BarChart::createShapes()
m_pShapeFactory->createGroup2D( m_xFinalTarget,rtl::OUString() ));
//check necessary here that different Y axis can not be stacked in the same group? ... hm?
- double fLogicZ = 0.0;//as defined
+ double fLogicZ = 1.0;//as defined
bool bDrawConnectionLines = false;
bool bDrawConnectionLinesInited = false;
@@ -482,12 +460,11 @@ void BarChart::createShapes()
sal_Int32 nCreatedPoints = 0;
//
- //(@todo maybe different iteration for breaks in axis ?)
- sal_Int32 nStartCategoryIndex = m_pMainPosHelper->getStartCategoryIndex(); // inclusive
- sal_Int32 nEndCategoryIndex = m_pMainPosHelper->getEndCategoryIndex(); //inclusive
+ sal_Int32 nStartIndex = 0;
+ sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
//=============================================================================
- //iterate through all shown categories
- for( sal_Int32 nCatIndex = nStartCategoryIndex; nCatIndex < nEndCategoryIndex; nCatIndex++ )
+ //iterate through all x values per indices
+ for( sal_Int32 nPointIndex = nStartIndex; nPointIndex < nEndIndex; nPointIndex++ )
{
::std::vector< ::std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
const ::std::vector< ::std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
@@ -506,7 +483,7 @@ void BarChart::createShapes()
aLogicYSumMap[nAttachedAxisIndex]=0.0;
double fMinimumY = 0.0, fMaximumY = 0.0;
- aXSlotIter->calculateYMinAndMaxForCategory( nCatIndex
+ aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex
, isSeperateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex );
if( !::rtl::math::isNan( fMaximumY ) && fMaximumY > 0)
@@ -542,14 +519,14 @@ void BarChart::createShapes()
//update/create information for current group
pPosHelper->updateSeriesCount( aZSlotIter->size() );
- double fLogicBaseWidth = pPosHelper->getSlotWidth();
+ double fLogicBaseWidth = pPosHelper->getScaledSlotWidth();
::std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
// get distance from base value to maximum and minimum
double fMinimumY = 0.0, fMaximumY = 0.0;
- aXSlotIter->calculateYMinAndMaxForCategory( nCatIndex
+ aXSlotIter->calculateYMinAndMaxForCategory( nPointIndex
, isSeperateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex );
double fLogicPositiveYSum = 0.0;
@@ -601,7 +578,7 @@ void BarChart::createShapes()
bOnlyConnectionLinesForThisPoint = false;
- if(nCatIndex==nStartCategoryIndex)//do not create a regression line for each point
+ if(nPointIndex==nStartIndex)//do not create a regression line for each point
createRegressionCurvesShapes( **aSeriesIter, xRegressionCurveTarget, xRegressionCurveEquationTarget,
m_pPosHelper->maySkipPointsInRegressionCalculation());
@@ -626,8 +603,17 @@ void BarChart::createShapes()
getSeriesGroupShape(*aSeriesIter, xSeriesTarget) );
//collect data point information (logic coordinates, style ):
- double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getXValue( nCatIndex ), fSlotX );
- double fLogicBarHeight = (*aSeriesIter)->getYValue( nCatIndex );
+ double fUnscaledLogicX = (*aSeriesIter)->getXValue( nPointIndex );
+ fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
+ if(fUnscaledLogicX<pPosHelper->getLogicMinX())
+ continue;//point not visible
+ if(fUnscaledLogicX>pPosHelper->getLogicMaxX())
+ continue;//point not visible
+ if(pPosHelper->isStrongLowerRequested(0) && fUnscaledLogicX==pPosHelper->getLogicMaxX())
+ continue;//point not visible
+ double fLogicX = pPosHelper->getScaledSlotPos( fUnscaledLogicX, fSlotX );
+
+ double fLogicBarHeight = (*aSeriesIter)->getYValue( nPointIndex );
if( ::rtl::math::isNan( fLogicBarHeight )) //no value at this category
continue;
@@ -652,9 +638,9 @@ void BarChart::createShapes()
fNegativeLogicYForNextSeries += fLogicBarHeight;
if(m_nDimension==3)
- fLogicZ = nZ;
+ fLogicZ = nZ+0.5;
- drawing::Position3D aUnscaledLogicPosition( fLogicX, fUpperYValue, fLogicZ );
+ drawing::Position3D aUnscaledLogicPosition( fUnscaledLogicX, fUpperYValue, fLogicZ );
//@todo ... start an iteration over the different breaks of the axis
//each subsystem may add an additional shape to form the whole point
@@ -664,7 +650,7 @@ void BarChart::createShapes()
// uno::Reference<drawing::XShape>( xPointGroupShape_Shapes, uno::UNO_QUERY );
//as long as we do not iterate we do not need to create an additional group for each point
uno::Reference< drawing::XShapes > xPointGroupShape_Shapes = xSeriesGroupShape_Shapes;
- uno::Reference< beans::XPropertySet > xDataPointProperties( (*aSeriesIter)->getPropertiesOfPoint( nCatIndex ) );
+ uno::Reference< beans::XPropertySet > xDataPointProperties( (*aSeriesIter)->getPropertiesOfPoint( nPointIndex ) );
sal_Int32 nGeometry3D = DataPointGeometry3D::CUBOID;
if(m_nDimension==3) try
{
@@ -731,7 +717,7 @@ void BarChart::createShapes()
//better performance for big data
FormerBarPoint aFormerPoint( aSeriesFormerPointMap[pSeries] );
pPosHelper->setCoordinateSystemResolution( m_aCoordinateSystemResolution );
- if( !pSeries->isAttributedDataPoint(nCatIndex)
+ if( !pSeries->isAttributedDataPoint(nPointIndex)
&&
pPosHelper->isSameForGivenResolution( aFormerPoint.m_fX, aFormerPoint.m_fUpperY, aFormerPoint.m_fZ
, fLogicX, fUpperYValue, fLogicZ )
@@ -830,20 +816,20 @@ void BarChart::createShapes()
//set name/classified ObjectID (CID)
ShapeFactory::setShapeName(xShape
, ObjectIdentifier::createPointCID(
- (*aSeriesIter)->getPointCID_Stub(),nCatIndex) );
+ (*aSeriesIter)->getPointCID_Stub(),nPointIndex) );
}
//create error bar
- createErrorBar_Y( aUnscaledLogicPosition, **aSeriesIter, nCatIndex, m_xLogicTarget );
+ createErrorBar_Y( aUnscaledLogicPosition, **aSeriesIter, nPointIndex, m_xLogicTarget, &fLogicX );
//------------
//create data point label
- if( (**aSeriesIter).getDataPointLabelIfLabel(nCatIndex) )
+ if( (**aSeriesIter).getDataPointLabelIfLabel(nPointIndex) )
{
double fLogicSum = aLogicYSumMap[nAttachedAxisIndex];
LabelAlignment eAlignment(LABEL_ALIGN_CENTER);
- sal_Int32 nLabelPlacement = pSeries->getLabelPlacement( nCatIndex, m_xChartTypeModel, m_nDimension, pPosHelper->isSwapXAndY() );
+ sal_Int32 nLabelPlacement = pSeries->getLabelPlacement( nPointIndex, m_xChartTypeModel, m_nDimension, pPosHelper->isSwapXAndY() );
double fLowerBarDepth = fLogicBarDepth;
double fUpperBarDepth = fLogicBarDepth;
@@ -868,7 +854,7 @@ void BarChart::createShapes()
if( m_nDimension == 3 )
nOffset = 260;
}
- this->createDataLabel( xTextTarget, **aSeriesIter, nCatIndex
+ this->createDataLabel( xTextTarget, **aSeriesIter, nPointIndex
, fLogicValueForLabeDisplay, fLogicSum, aScreenPosition2D, eAlignment, nOffset );
}
diff --git a/chart2/source/view/charttypes/BarChart.hxx b/chart2/source/view/charttypes/BarChart.hxx
index cfd3c0e618ce..93816beb33ae 100644
--- a/chart2/source/view/charttypes/BarChart.hxx
+++ b/chart2/source/view/charttypes/BarChart.hxx
@@ -48,17 +48,7 @@ public:
, sal_Int32 nDimensionCount );
virtual ~BarChart();
- //-------------------------------------------------------------------------
- // chart2::XPlotter
- //-------------------------------------------------------------------------
-
- virtual void SAL_CALL createShapes();
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
-
+ virtual void createShapes();
virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
//-------------------
@@ -66,12 +56,6 @@ public:
virtual bool keepAspectRatio() const;
//-------------------------------------------------------------------------
- // MinimumAndMaximumSupplier
- //-------------------------------------------------------------------------
- virtual double getMinimumX();
- virtual double getMaximumX();
-
- //-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/charttypes/BarPositionHelper.cxx b/chart2/source/view/charttypes/BarPositionHelper.cxx
index 271e0c5dd636..2cf585ba0097 100644
--- a/chart2/source/view/charttypes/BarPositionHelper.cxx
+++ b/chart2/source/view/charttypes/BarPositionHelper.cxx
@@ -33,6 +33,8 @@
#include "Linear3DTransformation.hxx"
#include "ViewDefines.hxx"
#include "CommonConverters.hxx"
+#include "DateHelper.hxx"
+#include <com/sun/star/chart/TimeUnit.hpp>
//.............................................................................
namespace chart
@@ -44,6 +46,8 @@ using namespace ::com::sun::star::chart2;
BarPositionHelper::BarPositionHelper( bool /* bSwapXAndY */ )
: CategoryPositionHelper( 1 )
{
+ AllowShiftXAxisPos(true);
+ AllowShiftZAxisPos(true);
}
BarPositionHelper::BarPositionHelper( const BarPositionHelper& rSource )
@@ -67,73 +71,22 @@ void BarPositionHelper::updateSeriesCount( double fSeriesCount )
m_fSeriesCount = fSeriesCount;
}
-uno::Reference< XTransformation > BarPositionHelper::getTransformationScaledLogicToScene() const
+double BarPositionHelper::getScaledSlotPos( double fUnscaledLogicX, double fSeriesNumber ) const
{
- //transformation from 2) to 4) //@todo 2) and 4) need a link to a document
+ if( m_bDateAxis )
+ fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
+ double fScaledLogicX(fUnscaledLogicX);
+ doLogicScaling(&fScaledLogicX,NULL,NULL);
+ fScaledLogicX = CategoryPositionHelper::getScaledSlotPos( fScaledLogicX, fSeriesNumber );
+ return fScaledLogicX;
- //we need to apply this transformation to each geometric object because of a bug/problem
- //of the old drawing layer (the UNO_NAME_3D_EXTRUDE_DEPTH is an integer value instead of an double )
-
- if( !m_xTransformationLogicToScene.is() )
- {
- ::basegfx::B3DHomMatrix aMatrix;
-
- double MinX = getLogicMinX();
- double MinY = getLogicMinY();
- double MinZ = getLogicMinZ();
- double MaxX = getLogicMaxX();
- double MaxY = getLogicMaxY();
- double MaxZ = getLogicMaxZ();
-
- AxisOrientation nXAxisOrientation = m_aScales[0].Orientation;
- AxisOrientation nYAxisOrientation = m_aScales[1].Orientation;
- AxisOrientation nZAxisOrientation = m_aScales[2].Orientation;
-
- //apply scaling
- //scaling of x axis is refused/ignored
- doLogicScaling( NULL, &MinY, &MinZ );
- doLogicScaling( NULL, &MaxY, &MaxZ);
-
- if(m_bSwapXAndY)
- {
- std::swap(MinX,MinY);
- std::swap(MaxX,MaxY);
- std::swap(nXAxisOrientation,nYAxisOrientation);
- }
-
- if( AxisOrientation_MATHEMATICAL==nXAxisOrientation )
- aMatrix.translate(-MinX,0.0,0.0);
- else
- aMatrix.translate(-MaxX,0.0,0.0);
- if( AxisOrientation_MATHEMATICAL==nYAxisOrientation )
- aMatrix.translate(0.0,-MinY,0.0);
- else
- aMatrix.translate(0.0,-MaxY,0.0);
- if( AxisOrientation_MATHEMATICAL==nZAxisOrientation )
- aMatrix.translate(0.0,0.0,-MaxZ);//z direction in draw is reverse mathematical direction
- else
- aMatrix.translate(0.0,0.0,-MinZ);
-
- double fWidthX = MaxX - MinX;
- double fWidthY = MaxY - MinY;
- double fWidthZ = MaxZ - MinZ;
-
- double fScaleDirectionX = AxisOrientation_MATHEMATICAL==nXAxisOrientation ? 1.0 : -1.0;
- double fScaleDirectionY = AxisOrientation_MATHEMATICAL==nYAxisOrientation ? 1.0 : -1.0;
- double fScaleDirectionZ = AxisOrientation_MATHEMATICAL==nZAxisOrientation ? -1.0 : 1.0;
-
- aMatrix.scale(fScaleDirectionX*FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthX
- , fScaleDirectionY*FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthY
- , fScaleDirectionZ*FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthZ);
-
- //if(nDim==2)
- aMatrix = m_aMatrixScreenToScene*aMatrix;
-
- m_xTransformationLogicToScene = new Linear3DTransformation(B3DHomMatrixToHomogenMatrix( aMatrix ),m_bSwapXAndY);
- }
- return m_xTransformationLogicToScene;
}
+void BarPositionHelper::setScaledCategoryWidth( double fScaledCategoryWidth )
+{
+ m_fScaledCategoryWidth = fScaledCategoryWidth;
+ CategoryPositionHelper::setCategoryWidth( m_fScaledCategoryWidth );
+}
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/view/charttypes/BarPositionHelper.hxx b/chart2/source/view/charttypes/BarPositionHelper.hxx
index 293a277cd332..515421957b31 100644
--- a/chart2/source/view/charttypes/BarPositionHelper.hxx
+++ b/chart2/source/view/charttypes/BarPositionHelper.hxx
@@ -50,25 +50,10 @@ public:
virtual PlottingPositionHelper* clone() const;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >
- getTransformationScaledLogicToScene() const;
-
void updateSeriesCount( double fSeriesCount ); /*only enter the size of x stacked series*/
- sal_Int32 getStartCategoryIndex() const {
- //first category (index 0) matches with real number 1.0
- sal_Int32 nStart = static_cast<sal_Int32>(getLogicMinX() - 0.5);
- if( nStart < 0 )
- nStart = 0;
- return nStart;
- }
- sal_Int32 getEndCategoryIndex() const {
- //first category (index 0) matches with real number 1.0
- sal_Int32 nEnd = static_cast<sal_Int32>(getLogicMaxX() - 0.5);
- if( nEnd < 0 )
- nEnd = 0;
- return nEnd;
- }
+ virtual double getScaledSlotPos( double fCategoryX, double fSeriesNumber ) const;
+ virtual void setScaledCategoryWidth( double fScaledCategoryWidth );
};
//.............................................................................
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index 4c35fc1dd870..0d6b3778740e 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -122,7 +122,7 @@ void BubbleChart::calculateMaximumLogicBubbleSize()
void BubbleChart::calculateBubbleSizeScalingFactor()
{
- double fLogicZ=0.5;
+ double fLogicZ=1.0;
drawing::Position3D aSceneMinPos( m_pMainPosHelper->transformLogicToScene( m_pMainPosHelper->getLogicMinX(),m_pMainPosHelper->getLogicMinY(),fLogicZ, false ) );
drawing::Position3D aSceneMaxPos( m_pMainPosHelper->transformLogicToScene( m_pMainPosHelper->getLogicMaxX(),m_pMainPosHelper->getLogicMaxY(),fLogicZ, false ) );
@@ -176,7 +176,7 @@ bool BubbleChart::isSeperateStackingForDifferentSigns( sal_Int32 /*nDimensionInd
LegendSymbolStyle BubbleChart::getLegendSymbolStyle()
{
- return chart2::LegendSymbolStyle_CIRCLE;
+ return LegendSymbolStyle_CIRCLE;
}
drawing::Direction3D BubbleChart::getPreferredDiagramAspectRatio() const
@@ -224,7 +224,7 @@ void BubbleChart::createShapes()
m_pShapeFactory->createGroup2D( m_xFinalTarget,rtl::OUString() ));
//update/create information for current group
- double fLogicZ = 0.5;//as defined
+ double fLogicZ = 1.0;//as defined
sal_Int32 nStartIndex = 0; // inclusive ;..todo get somehow from x scale
sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
diff --git a/chart2/source/view/charttypes/BubbleChart.hxx b/chart2/source/view/charttypes/BubbleChart.hxx
index 2216d6499f7a..2698501182c2 100644
--- a/chart2/source/view/charttypes/BubbleChart.hxx
+++ b/chart2/source/view/charttypes/BubbleChart.hxx
@@ -47,11 +47,7 @@ public:
, sal_Int32 nDimensionCount );
virtual ~BubbleChart();
- //-------------------------------------------------------------------------
- // chart2::XPlotter
- //-------------------------------------------------------------------------
-
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
@@ -66,7 +62,7 @@ public:
//-------------------------------------------------------------------------
- virtual ::com::sun::star::chart2::LegendSymbolStyle getLegendSymbolStyle();
+ virtual LegendSymbolStyle getLegendSymbolStyle();
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx
index 971545c98415..32553a134f5d 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -39,6 +39,7 @@
#include "VLegendSymbolFactory.hxx"
#include "FormattedStringHelper.hxx"
#include "DataSeriesHelper.hxx"
+#include "DateHelper.hxx"
#include <tools/debug.hxx>
#include <rtl/math.hxx>
#include <editeng/unoprnms.hxx>
@@ -75,22 +76,6 @@ CandleStickChart::~CandleStickChart()
// MinimumAndMaximumSupplier
//-------------------------------------------------------------------------
-double CandleStickChart::getMinimumX()
-{
- if( m_bCategoryXAxis )
- return 0.5;//first category (index 0) matches with real number 1.0
- return VSeriesPlotter::getMinimumX();
-}
-double CandleStickChart::getMaximumX()
-{
- if( m_bCategoryXAxis )
- {
- //return category count
- sal_Int32 nPointCount = getPointCount();
- return nPointCount+0.5;//first category (index 0) matches with real number 1.0
- }
- return VSeriesPlotter::getMaximumX();
-}
bool CandleStickChart::isSeperateStackingForDifferentSigns( sal_Int32 /* nDimensionIndex */ )
{
return false;
@@ -102,8 +87,23 @@ bool CandleStickChart::isSeperateStackingForDifferentSigns( sal_Int32 /* nDimens
LegendSymbolStyle CandleStickChart::getLegendSymbolStyle()
{
- return chart2::LegendSymbolStyle_VERTICAL_LINE;
+ return LegendSymbolStyle_LINE;
+}
+
+//-----------------------------------------------------------------
+// lang::XServiceInfo
+//-----------------------------------------------------------------
+/*
+APPHELPER_XSERVICEINFO_IMPL(CandleStickChart,CHART2_VIEW_CANDLESTICKCHART_SERVICE_IMPLEMENTATION_NAME)
+
+ uno::Sequence< rtl::OUString > CandleStickChart
+::getSupportedServiceNames_Static()
+{
+ uno::Sequence< rtl::OUString > aSNS( 1 );
+ aSNS.getArray()[ 0 ] = CHART2_VIEW_CANDLESTICKCHART_SERVICE_NAME;
+ return aSNS;
}
+*/
drawing::Direction3D CandleStickChart::getPreferredDiagramAspectRatio() const
{
@@ -177,11 +177,12 @@ void CandleStickChart::createShapes()
}
//(@todo maybe different iteration for breaks in axis ?)
- sal_Int32 nStartCategoryIndex = m_pMainPosHelper->getStartCategoryIndex(); // inclusive
- sal_Int32 nEndCategoryIndex = m_pMainPosHelper->getEndCategoryIndex(); //inclusive
+ sal_Int32 nStartIndex = 0;
+ sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
+ double fLogicZ = 1.5;//as defined
//=============================================================================
- //iterate through all shown categories
- for( sal_Int32 nIndex = nStartCategoryIndex; nIndex < nEndCategoryIndex; nIndex++ )
+ //iterate through all x values per indices
+ for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
{
::std::vector< ::std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
const ::std::vector< ::std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
@@ -219,28 +220,48 @@ void CandleStickChart::createShapes()
for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ )
{
//collect data point information (logic coordinates, style ):
- double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getXValue( nIndex ), fSlotX );
- double fY_First = (*aSeriesIter)->getY_First( nIndex );
- double fY_Last = (*aSeriesIter)->getY_Last( nIndex );
- double fY_Min = (*aSeriesIter)->getY_Min( nIndex );
- double fY_Max = (*aSeriesIter)->getY_Max( nIndex );
+ double fUnscaledX = (*aSeriesIter)->getXValue( nIndex );
+ if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() )
+ fUnscaledX = DateHelper::RasterizeDateValue( fUnscaledX, m_aNullDate, m_nTimeResolution );
+ if(fUnscaledX<pPosHelper->getLogicMinX() || fUnscaledX>pPosHelper->getLogicMaxX())
+ continue;//point not visible
+ double fScaledX = pPosHelper->getScaledSlotPos( fUnscaledX, fSlotX );
+
+ double fUnscaledY_First = (*aSeriesIter)->getY_First( nIndex );
+ double fUnscaledY_Last = (*aSeriesIter)->getY_Last( nIndex );
+ double fUnscaledY_Min = (*aSeriesIter)->getY_Min( nIndex );
+ double fUnscaledY_Max = (*aSeriesIter)->getY_Max( nIndex );
bool bBlack=false;
- if(fY_Last<=fY_First)
+ if(fUnscaledY_Last<=fUnscaledY_First)
{
- std::swap(fY_First,fY_Last);
+ std::swap(fUnscaledY_First,fUnscaledY_Last);
bBlack=true;
}
- if(fY_Max<fY_Min)
- std::swap(fY_Min,fY_Max);
+ if(fUnscaledY_Max<fUnscaledY_Min)
+ std::swap(fUnscaledY_Min,fUnscaledY_Max);
//transformation 3) -> 4)
- double fHalfWidth = pPosHelper->getSlotWidth()/2.0;
- drawing::Position3D aPosLeftFirst( pPosHelper->transformLogicToScene( fLogicX-fHalfWidth, fY_First ,0 ,true ) );
- drawing::Position3D aPosRightLast( pPosHelper->transformLogicToScene( fLogicX+fHalfWidth, fY_Last ,0 ,true ) );
- drawing::Position3D aPosMiddleFirst( pPosHelper->transformLogicToScene( fLogicX, fY_First ,0 ,true ) );
- drawing::Position3D aPosMiddleLast( pPosHelper->transformLogicToScene( fLogicX, fY_Last ,0 ,true ) );
- drawing::Position3D aPosMiddleMinimum( pPosHelper->transformLogicToScene( fLogicX, fY_Min ,0 ,true ) );
- drawing::Position3D aPosMiddleMaximum( pPosHelper->transformLogicToScene( fLogicX, fY_Max ,0 ,true ) );
+ double fHalfScaledWidth = pPosHelper->getScaledSlotWidth()/2.0;
+
+ double fScaledY_First(fUnscaledY_First);
+ double fScaledY_Last(fUnscaledY_Last);
+ double fScaledY_Min(fUnscaledY_Min);
+ double fScaledY_Max(fUnscaledY_Max);
+ pPosHelper->clipLogicValues( 0,&fScaledY_First,0 );
+ pPosHelper->clipLogicValues( 0,&fScaledY_Last,0 );
+ pPosHelper->clipLogicValues( 0,&fScaledY_Min,0 );
+ pPosHelper->clipLogicValues( 0,&fScaledY_Max,0 );
+ pPosHelper->doLogicScaling( 0,&fScaledY_First,0 );
+ pPosHelper->doLogicScaling( 0,&fScaledY_Last,0 );
+ pPosHelper->doLogicScaling( 0,&fScaledY_Min,0 );
+ pPosHelper->doLogicScaling( 0,&fScaledY_Max,0 );
+
+ drawing::Position3D aPosLeftFirst( pPosHelper->transformScaledLogicToScene( fScaledX-fHalfScaledWidth, fScaledY_First ,0 ,true ) );
+ drawing::Position3D aPosRightLast( pPosHelper->transformScaledLogicToScene( fScaledX+fHalfScaledWidth, fScaledY_Last ,0 ,true ) );
+ drawing::Position3D aPosMiddleFirst( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_First ,0 ,true ) );
+ drawing::Position3D aPosMiddleLast( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Last ,0 ,true ) );
+ drawing::Position3D aPosMiddleMinimum( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Min ,0 ,true ) );
+ drawing::Position3D aPosMiddleMaximum( pPosHelper->transformScaledLogicToScene( fScaledX, fScaledY_Max ,0 ,true ) );
uno::Reference< drawing::XShapes > xLossGainTarget( xGainTarget );
if(bBlack)
@@ -301,13 +322,13 @@ void CandleStickChart::createShapes()
drawing::PolyPolygonShape3D aPoly;
sal_Int32 nLineIndex = 0;
- if( bShowFirst && pPosHelper->isLogicVisible( fLogicX, fY_First ,0 )
+ if( bShowFirst && pPosHelper->isLogicVisible( fUnscaledX, fUnscaledY_First ,fLogicZ )
&& isValidPosition(aPosLeftFirst) && isValidPosition(aPosMiddleFirst) )
{
AddPointToPoly( aPoly, aPosLeftFirst, nLineIndex );
AddPointToPoly( aPoly, aPosMiddleFirst, nLineIndex++ );
}
- if( pPosHelper->isLogicVisible( fLogicX, fY_Last ,0 )
+ if( pPosHelper->isLogicVisible( fUnscaledX, fUnscaledY_Last ,fLogicZ )
&& isValidPosition(aPosMiddleLast) && isValidPosition(aPosRightLast) )
{
AddPointToPoly( aPoly, aPosMiddleLast, nLineIndex );
@@ -333,16 +354,16 @@ void CandleStickChart::createShapes()
{
if(isValidPosition(aPosMiddleFirst))
this->createDataLabel( xTextTarget, **aSeriesIter, nIndex
- , fY_First, 1.0, Position3DToAWTPoint(aPosMiddleFirst), LABEL_ALIGN_LEFT_BOTTOM );
+ , fUnscaledY_First, 1.0, Position3DToAWTPoint(aPosMiddleFirst), LABEL_ALIGN_LEFT_BOTTOM );
if(isValidPosition(aPosMiddleLast))
this->createDataLabel( xTextTarget, **aSeriesIter, nIndex
- , fY_Last, 1.0, Position3DToAWTPoint(aPosMiddleLast), LABEL_ALIGN_RIGHT_TOP );
+ , fUnscaledY_Last, 1.0, Position3DToAWTPoint(aPosMiddleLast), LABEL_ALIGN_RIGHT_TOP );
if(isValidPosition(aPosMiddleMinimum))
this->createDataLabel( xTextTarget, **aSeriesIter, nIndex
- , fY_Min, 1.0, Position3DToAWTPoint(aPosMiddleMinimum), LABEL_ALIGN_BOTTOM );
+ , fUnscaledY_Min, 1.0, Position3DToAWTPoint(aPosMiddleMinimum), LABEL_ALIGN_BOTTOM );
if(isValidPosition(aPosMiddleMaximum))
this->createDataLabel( xTextTarget, **aSeriesIter, nIndex
- , fY_Max, 1.0, Position3DToAWTPoint(aPosMiddleMaximum), LABEL_ALIGN_TOP );
+ , fUnscaledY_Max, 1.0, Position3DToAWTPoint(aPosMiddleMaximum), LABEL_ALIGN_TOP );
}
}//next series in x slot (next y slot)
}//next x slot
diff --git a/chart2/source/view/charttypes/CandleStickChart.hxx b/chart2/source/view/charttypes/CandleStickChart.hxx
index cd33e54af5e9..c8ef4b9a8db0 100644
--- a/chart2/source/view/charttypes/CandleStickChart.hxx
+++ b/chart2/source/view/charttypes/CandleStickChart.hxx
@@ -48,16 +48,7 @@ public:
, sal_Int32 nDimensionCount );
virtual ~CandleStickChart();
- //-------------------------------------------------------------------------
- // chart2::XPlotter
- //-------------------------------------------------------------------------
-
- virtual void SAL_CALL createShapes();
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
+ virtual void createShapes();
virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
virtual ::com::sun::star::drawing::Direction3D getPreferredDiagramAspectRatio() const;
@@ -65,13 +56,11 @@ public:
//-------------------------------------------------------------------------
// MinimumAndMaximumSupplier
//-------------------------------------------------------------------------
- virtual double getMinimumX();
- virtual double getMaximumX();
virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
//-------------------------------------------------------------------------
- virtual ::com::sun::star::chart2::LegendSymbolStyle getLegendSymbolStyle();
+ virtual LegendSymbolStyle getLegendSymbolStyle();
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/charttypes/CategoryPositionHelper.cxx b/chart2/source/view/charttypes/CategoryPositionHelper.cxx
index c4df135927eb..cc4f917d0515 100644
--- a/chart2/source/view/charttypes/CategoryPositionHelper.cxx
+++ b/chart2/source/view/charttypes/CategoryPositionHelper.cxx
@@ -56,7 +56,7 @@ CategoryPositionHelper::~CategoryPositionHelper()
{
}
-double CategoryPositionHelper::getSlotWidth() const
+double CategoryPositionHelper::getScaledSlotWidth() const
{
double fWidth = m_fCategoryWidth /
( m_fSeriesCount
@@ -65,14 +65,14 @@ double CategoryPositionHelper::getSlotWidth() const
return fWidth;
}
-double CategoryPositionHelper::getSlotPos( double fCategoryX, double fSeriesNumber ) const
+double CategoryPositionHelper::getScaledSlotPos( double fScaledXPos, double fSeriesNumber ) const
{
//the returned position is in the middle of the rect
//fSeriesNumber 0...n-1
- double fPos = fCategoryX - (m_fCategoryWidth/2.0)
- + (m_fOuterDistance/2.0 + fSeriesNumber*(1.0+m_fInnerDistance)) * getSlotWidth()
- + getSlotWidth()/2.0;
-
+ double fPos = fScaledXPos
+ - (m_fCategoryWidth/2.0)
+ + (m_fOuterDistance/2.0 + fSeriesNumber*(1.0+m_fInnerDistance)) * getScaledSlotWidth()
+ + getScaledSlotWidth()/2.0;
return fPos;
}
@@ -94,6 +94,11 @@ void CategoryPositionHelper::setOuterDistance( double fOuterDistance )
m_fOuterDistance = fOuterDistance;
}
+void CategoryPositionHelper::setCategoryWidth( double fCategoryWidth )
+{
+ m_fCategoryWidth = fCategoryWidth;
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/view/charttypes/CategoryPositionHelper.hxx b/chart2/source/view/charttypes/CategoryPositionHelper.hxx
index c48fbf98b150..63b3e6c56812 100644
--- a/chart2/source/view/charttypes/CategoryPositionHelper.hxx
+++ b/chart2/source/view/charttypes/CategoryPositionHelper.hxx
@@ -45,8 +45,9 @@ public:
CategoryPositionHelper( const CategoryPositionHelper& rSource );
virtual ~CategoryPositionHelper();
- double getSlotWidth() const;
- double getSlotPos( double fCategoryX, double fSeriesNumber ) const;
+ double getScaledSlotWidth() const;
+ virtual double getScaledSlotPos( double fCategoryX, double fSeriesNumber ) const;
+ virtual void setCategoryWidth( double fCategoryWidth );
//Distance between two neighboring bars in same category, seen relative to width of the bar
void setInnerDistance( double fInnerDistance );
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index 8a618cdfeeb7..611a6714fe4d 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -158,11 +158,9 @@ PieChart::~PieChart()
//-----------------------------------------------------------------
-void SAL_CALL PieChart::setScales( const uno::Sequence< ExplicitScaleData >& rScales
- , sal_Bool /* bSwapXAndYAxis */ )
- throw (uno::RuntimeException)
+void PieChart::setScales( const std::vector< ExplicitScaleData >& rScales, bool /* bSwapXAndYAxis */ )
{
- DBG_ASSERT(m_nDimension<=rScales.getLength(),"Dimension of Plotter does not fit two dimension of given scale sequence");
+ DBG_ASSERT(m_nDimension<=static_cast<sal_Int32>(rScales.size()),"Dimension of Plotter does not fit two dimension of given scale sequence");
m_pPosHelper->setScales( rScales, true );
}
@@ -395,6 +393,7 @@ void PieChart::createShapes()
if( !bIsVisible )
continue;
+ double fLogicZ = -1.0;//as defined
double fDepth = this->getTransformedDepth();
uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(pSeries, xSeriesTarget);
@@ -478,11 +477,11 @@ void PieChart::createShapes()
awt::Point aScreenPosition2D(
aPolarPosHelper.getLabelScreenPositionAndAlignmentForUnitCircleValues(eAlignment, nLabelPlacement
, fUnitCircleStartAngleDegree, fUnitCircleWidthAngleDegree
- , fUnitCircleInnerRadius, fUnitCircleOuterRadius, 0.0, 0 ));
+ , fUnitCircleInnerRadius, fUnitCircleOuterRadius, fLogicZ+0.5, 0 ));
PieLabelInfo aPieLabelInfo;
aPieLabelInfo.aFirstPosition = basegfx::B2IVector( aScreenPosition2D.X, aScreenPosition2D.Y );
- awt::Point aOrigin( aPolarPosHelper.transformSceneToScreenPosition( m_pPosHelper->transformUnitCircleToScene( 0.0, 0.0, 0.5 ) ) );
+ awt::Point aOrigin( aPolarPosHelper.transformSceneToScreenPosition( m_pPosHelper->transformUnitCircleToScene( 0.0, 0.0, fLogicZ+1.0 ) ) );
aPieLabelInfo.aOrigin = basegfx::B2IVector( aOrigin.X, aOrigin.Y );
//add a scaling independent Offset if requested
diff --git a/chart2/source/view/charttypes/PieChart.hxx b/chart2/source/view/charttypes/PieChart.hxx
index 3f2443732899..ae08136b4031 100644
--- a/chart2/source/view/charttypes/PieChart.hxx
+++ b/chart2/source/view/charttypes/PieChart.hxx
@@ -50,24 +50,10 @@ public:
, sal_Int32 nDimensionCount, bool bExcludingPositioning );
virtual ~PieChart();
- //-------------------------------------------------------------------------
- // chart2::XPlotter
- //-------------------------------------------------------------------------
-
- virtual void SAL_CALL createShapes();
+ virtual void createShapes();
virtual void rearrangeLabelToAvoidOverlapIfRequested( const ::com::sun::star::awt::Size& rPageSize );
- virtual void SAL_CALL setScales(
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis )
- throw (::com::sun::star::uno::RuntimeException);
- /*
- virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
- */
-
+ virtual void setScales( const ::std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
//-------------------
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 715ed716099e..7b34399f1c94 100644..100755
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -44,7 +44,7 @@
#include "ChartTypeHelper.hxx"
#include "Clipping.hxx"
#include "servicenames_charttypes.hxx"
-#include "chartview/NumberFormatterWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "ContainerHelper.hxx"
#include "DataSeriesHelper.hxx"
#include "RegressionCurveHelper.hxx"
@@ -53,6 +53,8 @@
#include "ResId.hxx"
#include "Strings.hrc"
#include "RelativePositionHelper.hxx"
+#include "DateHelper.hxx"
+#include "DiagramHelper.hxx"
//only for creation: @todo remove if all plotter are uno components and instanciated via servicefactory
#include "BarChart.hxx"
@@ -63,6 +65,7 @@
//
#include <com/sun/star/chart/ErrorBarStyle.hpp>
+#include <com/sun/star/chart/TimeUnit.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
@@ -73,6 +76,7 @@
#include <rtl/math.hxx>
#include <tools/debug.hxx>
#include <basegfx/vector/b2dvector.hxx>
+#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <svx/unoshape.hxx>
@@ -103,7 +107,6 @@ VDataSeriesGroup::VDataSeriesGroup()
, m_bMaxPointCountDirty(true)
, m_nMaxPointCount(0)
, m_aListOfCachedYValues()
-
{
}
@@ -152,6 +155,8 @@ VSeriesPlotter::VSeriesPlotter( const uno::Reference<XChartType>& xChartTypeMode
, m_xChartTypeModelProps( uno::Reference< beans::XPropertySet >::query( xChartTypeModel ))
, m_aZSlots()
, m_bCategoryXAxis(bCategoryXAxis)
+ , m_nTimeResolution(::com::sun::star::chart::TimeUnit::DAY)
+ , m_aNullDate(30,12,1899)
, m_xColorScheme()
, m_pExplicitCategoriesProvider(0)
, m_bPointsWereSkipped(false)
@@ -198,7 +203,17 @@ void VSeriesPlotter::addSeries( VDataSeries* pSeries, sal_Int32 zSlot, sal_Int32
return;
if(m_bCategoryXAxis)
- pSeries->setCategoryXAxis();
+ {
+ if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() )
+ pSeries->setXValues( m_pExplicitCategoriesProvider->getOriginalCategories() );
+ else
+ pSeries->setCategoryXAxis();
+ }
+ else
+ {
+ if( m_pExplicitCategoriesProvider )
+ pSeries->setXValuesIfNone( m_pExplicitCategoriesProvider->getOriginalCategories() );
+ }
if(zSlot<0 || zSlot>=static_cast<sal_Int32>(m_aZSlots.size()))
{
@@ -378,7 +393,7 @@ OUString VSeriesPlotter::getLabelTextForValue( VDataSeries& rDataSeries
nNumberFormatKey = rDataSeries.getExplicitNumberFormat(nPointIndex,bAsPercentage);
else if( bAsPercentage )
{
- sal_Int32 nPercentFormat = ExplicitValueProvider::getPercentNumberFormat( m_apNumberFormatterWrapper->getNumberFormatsSupplier() );
+ sal_Int32 nPercentFormat = DiagramHelper::getPercentNumberFormat( m_apNumberFormatterWrapper->getNumberFormatsSupplier() );
if( nPercentFormat != -1 )
nNumberFormatKey = nPercentFormat;
}
@@ -443,13 +458,30 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
//------------------------------------------------
//prepare legend symbol
+ float fViewFontSize( 10.0 );
+ {
+ uno::Reference< beans::XPropertySet > xProps( rDataSeries.getPropertiesOfPoint( nPointIndex ) );
+ if( xProps.is() )
+ xProps->getPropertyValue( C2U( "CharHeight" )) >>= fViewFontSize;
+ // pt -> 1/100th mm
+ fViewFontSize *= (2540.0 / 72.0);
+ }
Reference< drawing::XShape > xSymbol;
if(pLabel->ShowLegendSymbol)
{
+ sal_Int32 nSymbolHeigth = static_cast< sal_Int32 >( fViewFontSize * 0.6 );
+ awt::Size aCurrentRatio = this->getPreferredLegendKeyAspectRatio();
+ sal_Int32 nSymbolWidth = aCurrentRatio.Width;
+ if( aCurrentRatio.Height > 0 )
+ {
+ nSymbolWidth = nSymbolHeigth* aCurrentRatio.Width/aCurrentRatio.Height;
+ }
+ awt::Size aMaxSymbolExtent( nSymbolWidth, nSymbolHeigth );
+
if( rDataSeries.isVaryColorsByPoint() )
- xSymbol.set( VSeriesPlotter::createLegendSymbolForPoint( rDataSeries, nPointIndex, xTarget_, m_xShapeFactory ) );
+ xSymbol.set( VSeriesPlotter::createLegendSymbolForPoint( aMaxSymbolExtent, rDataSeries, nPointIndex, xTarget_, m_xShapeFactory ) );
else
- xSymbol.set( VSeriesPlotter::createLegendSymbolForSeries( rDataSeries, xTarget_, m_xShapeFactory ) );
+ xSymbol.set( VSeriesPlotter::createLegendSymbolForSeries( aMaxSymbolExtent, rDataSeries, xTarget_, m_xShapeFactory ) );
}
//prepare text
@@ -549,25 +581,14 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
const awt::Point aOldTextPos( xTextShape->getPosition() );
awt::Point aNewTextPos( aOldTextPos );
+ awt::Point aSymbolPosition( aUnrotatedTextPos );
awt::Size aSymbolSize( xSymbol->getSize() );
awt::Size aTextSize( xTextShape->getSize() );
+ sal_Int32 nXDiff = aSymbolSize.Width + static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.22 ) );//minimum 1mm
if( !bMultiLineLabel || nLineCountForSymbolsize <= 0 )
nLineCountForSymbolsize = 1;
- sal_Int32 nYDiff = aTextSize.Height/nLineCountForSymbolsize;
- sal_Int32 nXDiff = aSymbolSize.Width * nYDiff/aSymbolSize.Height;
-
- // #i109336# Improve auto positioning in chart
- nXDiff = nXDiff * 80 / 100;
- nYDiff = nYDiff * 80 / 100;
-
- aSymbolSize.Width = nXDiff * 75/100;
- aSymbolSize.Height = nYDiff * 75/100;
-
- awt::Point aSymbolPosition( aUnrotatedTextPos );
-
- // #i109336# Improve auto positioning in chart
- aSymbolPosition.Y += ( nYDiff / 4 );
+ aSymbolPosition.Y += ((aTextSize.Height/nLineCountForSymbolsize)/4);
if(LABEL_ALIGN_LEFT==eAlignment
|| LABEL_ALIGN_LEFT_TOP==eAlignment
@@ -589,10 +610,7 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
aNewTextPos.X += nXDiff/2;
}
- xSymbol->setSize( aSymbolSize );
xSymbol->setPosition( aSymbolPosition );
-
- //set position
xTextShape->setPosition( aNewTextPos );
}
}
@@ -755,6 +773,17 @@ void lcl_AddErrorBottomLine( const drawing::Position3D& rPosition, ::basegfx::B2
return aMainDirection;
}
+drawing::Position3D lcl_transformMixedToScene( PlottingPositionHelper* pPosHelper
+ , double fX /*scaled*/, double fY /*unscaled*/, double fZ /*unscaled*/, bool bClip )
+{
+ if(!pPosHelper)
+ return drawing::Position3D(0,0,0);
+ pPosHelper->doLogicScaling( 0,&fY,&fZ );
+ if(bClip)
+ pPosHelper->clipScaledLogicValues( &fX,&fY,&fZ );
+ return pPosHelper->transformScaledLogicToScene( fX, fY, fZ, false );
+}
+
} // anonymous namespace
void VSeriesPlotter::createErrorBar(
@@ -764,6 +793,7 @@ void VSeriesPlotter::createErrorBar(
, const VDataSeries& rVDataSeries
, sal_Int32 nIndex
, bool bYError /* = true */
+ , double* pfScaledLogicX
)
{
if( !ChartTypeHelper::isSupportingStatisticProperties( m_xChartTypeModel, m_nDimension ) )
@@ -798,7 +828,13 @@ void VSeriesPlotter::createErrorBar(
const double fX = aUnscaledLogicPosition.PositionX;
const double fY = aUnscaledLogicPosition.PositionY;
const double fZ = aUnscaledLogicPosition.PositionZ;
- aMiddle = m_pPosHelper->transformLogicToScene( fX, fY, fZ, true );
+ double fScaledX = fX;
+ if( pfScaledLogicX )
+ fScaledX = *pfScaledLogicX;
+ else
+ m_pPosHelper->doLogicScaling( &fScaledX, 0, 0 );
+
+ aMiddle = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fY, fZ, true );
drawing::Position3D aNegative(aMiddle);
drawing::Position3D aPositive(aMiddle);
@@ -813,11 +849,16 @@ void VSeriesPlotter::createErrorBar(
double fLocalX = fX;
double fLocalY = fY;
if( bYError )
+ {
fLocalY+=fLength;
+ aPositive = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fLocalY, fZ, true );
+ }
else
+ {
fLocalX+=fLength;
+ aPositive = m_pPosHelper->transformLogicToScene( fLocalX, fLocalY, fZ, true );
+ }
bCreatePositiveBorder = m_pPosHelper->isLogicVisible(fLocalX, fLocalY, fZ);
- aPositive = m_pPosHelper->transformLogicToScene( fLocalX, fLocalY, fZ, true );
}
else
bShowPositive = false;
@@ -831,12 +872,16 @@ void VSeriesPlotter::createErrorBar(
double fLocalX = fX;
double fLocalY = fY;
if( bYError )
+ {
fLocalY-=fLength;
+ aNegative = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fLocalY, fZ, true );
+ }
else
+ {
fLocalX-=fLength;
-
+ aNegative = m_pPosHelper->transformLogicToScene( fLocalX, fLocalY, fZ, true );
+ }
bCreateNegativeBorder = m_pPosHelper->isLogicVisible( fLocalX, fLocalY, fZ);
- aNegative = m_pPosHelper->transformLogicToScene( fLocalX, fLocalY, fZ, true );
}
else
bShowNegative = false;
@@ -879,7 +924,8 @@ void VSeriesPlotter::createErrorBar(
void VSeriesPlotter::createErrorBar_Y( const drawing::Position3D& rUnscaledLogicPosition
, VDataSeries& rVDataSeries, sal_Int32 nPointIndex
- , const uno::Reference< drawing::XShapes >& xTarget )
+ , const uno::Reference< drawing::XShapes >& xTarget
+ , double* pfScaledLogicX )
{
if(m_nDimension!=2)
return;
@@ -893,7 +939,8 @@ void VSeriesPlotter::createErrorBar_Y( const drawing::Position3D& rUnscaledLogic
createErrorBar( xErrorBarsGroup_Shapes
, rUnscaledLogicPosition, xErrorBarProp
, rVDataSeries, nPointIndex
- , true /* bYError */ );
+ , true /* bYError */
+ , pfScaledLogicX );
}
}
@@ -931,13 +978,13 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries
aRegressionPoly.SequenceZ[0].realloc(nRegressionPointCount);
sal_Int32 nRealPointCount=0;
- uno::Sequence< chart2::ExplicitScaleData > aScaleDataSeq( m_pPosHelper->getScales());
+ std::vector< ExplicitScaleData > aScales( m_pPosHelper->getScales());
uno::Reference< chart2::XScaling > xScalingX;
uno::Reference< chart2::XScaling > xScalingY;
- if( aScaleDataSeq.getLength() >= 2 )
+ if( aScales.size() >= 2 )
{
- xScalingX.set( aScaleDataSeq[0].Scaling );
- xScalingY.set( aScaleDataSeq[1].Scaling );
+ xScalingX.set( aScales[0].Scaling );
+ xScalingY.set( aScales[1].Scaling );
}
uno::Sequence< geometry::RealPoint2D > aCalculatedPoints(
@@ -1111,35 +1158,58 @@ void VSeriesPlotter::setMappedProperties(
PropertyMapper::setMappedProperties(xTargetProp,xSource,rMap,pOverwriteMap);
}
+void VSeriesPlotter::setTimeResolutionOnXAxis( long TimeResolution, const Date& rNullDate )
+{
+ m_nTimeResolution = TimeResolution;
+ m_aNullDate = rNullDate;
+}
+
//-------------------------------------------------------------------------
// MinimumAndMaximumSupplier
//-------------------------------------------------------------------------
-
-double VSeriesPlotter::getMinimumX()
+long VSeriesPlotter::calculateTimeResolutionOnXAxis()
{
- if( m_bCategoryXAxis )
+ long nRet = ::com::sun::star::chart::TimeUnit::YEAR;
+ if( m_pExplicitCategoriesProvider )
{
- double fRet = 1.0;//first category (index 0) matches with real number 1.0
- if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->hasComplexCategories() )
- fRet -= 0.5;
- return fRet;
+ const std::vector< DatePlusIndex >& rDateCategories = m_pExplicitCategoriesProvider->getDateCategories();
+ std::vector< DatePlusIndex >::const_iterator aIt = rDateCategories.begin(), aEnd = rDateCategories.end();
+ Date aNullDate(30,12,1899);
+ if( m_apNumberFormatterWrapper.get() )
+ aNullDate = m_apNumberFormatterWrapper->getNullDate();
+ if( aIt!=aEnd )
+ {
+ Date aPrevious(aNullDate); aPrevious+=rtl::math::approxFloor(aIt->fValue);
+ ++aIt;
+ for(;aIt!=aEnd;++aIt)
+ {
+ Date aCurrent(aNullDate); aCurrent+=rtl::math::approxFloor(aIt->fValue);
+ if( ::com::sun::star::chart::TimeUnit::YEAR == nRet )
+ {
+ if( DateHelper::IsInSameYear( aPrevious, aCurrent ) )
+ nRet = ::com::sun::star::chart::TimeUnit::MONTH;
+ }
+ if( ::com::sun::star::chart::TimeUnit::MONTH == nRet )
+ {
+ if( DateHelper::IsInSameMonth( aPrevious, aCurrent ) )
+ nRet = ::com::sun::star::chart::TimeUnit::DAY;
+ }
+ if( ::com::sun::star::chart::TimeUnit::DAY == nRet )
+ break;
+ aPrevious=aCurrent;
+ }
+ }
}
-
+ return nRet;
+}
+double VSeriesPlotter::getMinimumX()
+{
double fMinimum, fMaximum;
this->getMinimumAndMaximiumX( fMinimum, fMaximum );
return fMinimum;
}
double VSeriesPlotter::getMaximumX()
{
- if( m_bCategoryXAxis )
- {
- //return category count
- double fRet = getPointCount();//first category (index 0) matches with real number 1.0
- if( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->hasComplexCategories() )
- fRet += 0.5;
- return fRet;
- }
-
double fMinimum, fMaximum;
this->getMinimumAndMaximiumX( fMinimum, fMaximum );
return fMaximum;
@@ -1147,7 +1217,7 @@ double VSeriesPlotter::getMaximumX()
double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
{
- if( !m_bCategoryXAxis )
+ if( !m_bCategoryXAxis || ( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() ) )
{
double fMinY, fMaxY;
this->getMinimumAndMaximiumYInContinuousXRange( fMinY, fMaxY, fMinimumX, fMaximumX, nAxisIndex );
@@ -1181,7 +1251,7 @@ double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, s
double VSeriesPlotter::getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex )
{
- if( !m_bCategoryXAxis )
+ if( !m_bCategoryXAxis || ( m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->isDateAxis() ) )
{
double fMinY, fMaxY;
this->getMinimumAndMaximiumYInContinuousXRange( fMinY, fMaxY, fMinimumX, fMaximumX, nAxisIndex );
@@ -1216,13 +1286,13 @@ double VSeriesPlotter::getMaximumYInRange( double fMinimumX, double fMaximumX, s
double VSeriesPlotter::getMinimumZ()
{
//this is the default for all charts without a meaningfull z axis
- return 0.5;
+ return 1.0;
}
double VSeriesPlotter::getMaximumZ()
{
- if( 3!=m_nDimension )
- return 0.5;
- return m_aZSlots.size()+0.5;
+ if( 3!=m_nDimension || !m_aZSlots.size() )
+ return getMinimumZ()+1;
+ return m_aZSlots.size();
}
namespace
@@ -1588,7 +1658,7 @@ double VSeriesPlotter::getTransformedDepth() const
return FIXED_SIZE_FOR_3D_CHART_VOLUME/(MaxZ-MinZ);
}
-void SAL_CALL VSeriesPlotter::addSecondaryValueScale( const ExplicitScaleData& rScale, sal_Int32 nAxisIndex )
+void VSeriesPlotter::addSecondaryValueScale( const ExplicitScaleData& rScale, sal_Int32 nAxisIndex )
throw (uno::RuntimeException)
{
if( nAxisIndex<1 )
@@ -1618,9 +1688,9 @@ PlottingPositionHelper& VSeriesPlotter::getPlottingPositionHelper( sal_Int32 nAx
}
}
if( !pRet )
- {
pRet = m_pMainPosHelper;
- }
+ if(pRet)
+ pRet->setTimeResolution( m_nTimeResolution, m_aNullDate );
return *pRet;
}
@@ -1736,13 +1806,14 @@ bool VSeriesPlotter::shouldSnapRectToUsedArea()
return true;
}
-Sequence< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntries(
- LegendExpansion eLegendExpansion
+std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntries(
+ const awt::Size& rEntryKeyAspectRatio
+ , ::com::sun::star::chart::ChartLegendExpansion eLegendExpansion
, const Reference< beans::XPropertySet >& xTextProperties
, const Reference< drawing::XShapes >& xTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory
, const Reference< uno::XComponentContext >& xContext
- ) throw (uno::RuntimeException)
+ )
{
std::vector< ViewLegendEntry > aResult;
@@ -1769,7 +1840,7 @@ Sequence< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntries(
if(!pSeries)
continue;
- std::vector< ViewLegendEntry > aSeriesEntries( this->createLegendEntriesForSeries(
+ std::vector< ViewLegendEntry > aSeriesEntries( this->createLegendEntriesForSeries( rEntryKeyAspectRatio,
*pSeries, xTextProperties, xTarget, xShapeFactory, xContext ) );
//add series entries to the result now
@@ -1783,7 +1854,7 @@ Sequence< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntries(
// If the legend is wide and we have a stacked bar-chart the normal order
// is the correct one
bool bReverse = false;
- if( eLegendExpansion != LegendExpansion_WIDE )
+ if( eLegendExpansion != ::com::sun::star::chart::ChartLegendExpansion_WIDE )
{
StackingDirection eStackingDirection( pSeries->getStackingDirection() );
bReverse = ( eStackingDirection == StackingDirection_Y_STACKING );
@@ -1798,24 +1869,119 @@ Sequence< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntries(
}
}
}
+ }
+
+ return aResult;
+}
- //add charttype specific entries if any
+::std::vector< VDataSeries* > VSeriesPlotter::getAllSeries()
+{
+ ::std::vector< VDataSeries* > aAllSeries;
+ ::std::vector< ::std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
+ const ::std::vector< ::std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
+ for( ; aZSlotIter != aZSlotEnd; aZSlotIter++ )
+ {
+ ::std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
+ const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
+ for( ; aXSlotIter != aXSlotEnd; aXSlotIter++ )
{
- std::vector< ViewLegendEntry > aChartTypeEntries( this->createLegendEntriesForChartType(
- xTextProperties, xTarget, xShapeFactory, xContext ) );
- aResult.insert( aResult.end(), aChartTypeEntries.begin(), aChartTypeEntries.end() );
+ ::std::vector< VDataSeries* > aSeriesList = aXSlotIter->m_aSeriesVector;
+ aAllSeries.insert( aAllSeries.end(), aSeriesList.begin(), aSeriesList.end() );
}
}
-
- return ::chart::ContainerHelper::ContainerToSequence( aResult );
+ return aAllSeries;
}
+namespace
+{
+bool lcl_HasVisibleLine( const uno::Reference< beans::XPropertySet >& xProps, bool& rbHasDashedLine )
+{
+ bool bHasVisibleLine = false;
+ rbHasDashedLine = false;
+ drawing::LineStyle aLineStyle = drawing::LineStyle_NONE;
+ if( xProps.is() && ( xProps->getPropertyValue( C2U("LineStyle")) >>= aLineStyle ) )
+ {
+ if( aLineStyle != drawing::LineStyle_NONE )
+ bHasVisibleLine = true;
+ if( aLineStyle == drawing::LineStyle_DASH )
+ rbHasDashedLine = true;
+ }
+ return bHasVisibleLine;
+}
+bool lcl_HasRegressionCurves( const VDataSeries& rSeries, bool& rbHasDashedLine )
+{
+ bool bHasRegressionCurves = false;
+ Reference< XRegressionCurveContainer > xRegrCont( rSeries.getModel(), uno::UNO_QUERY );
+ if( xRegrCont.is())
+ {
+ 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 );
+ }
+ }
+ }
+ return bHasRegressionCurves;
+}
+}
LegendSymbolStyle VSeriesPlotter::getLegendSymbolStyle()
{
- return chart2::LegendSymbolStyle_BOX;
+ return LegendSymbolStyle_BOX;
}
+awt::Size VSeriesPlotter::getPreferredLegendKeyAspectRatio()
+{
+ awt::Size aRet(1000,1000);
+ if( m_nDimension==3 )
+ return aRet;
+
+ bool bSeriesAllowsLines = (getLegendSymbolStyle() == LegendSymbolStyle_LINE);
+ bool bHasLines = false;
+ bool bHasDashedLines = false;
+ ::std::vector< VDataSeries* > aAllSeries( getAllSeries() );
+ ::std::vector< VDataSeries* >::const_iterator aSeriesIter = aAllSeries.begin();
+ const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd = aAllSeries.end();
+ //iterate through all series
+ for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ )
+ {
+ if( bSeriesAllowsLines )
+ {
+ bool bCurrentDashed = false;
+ if( lcl_HasVisibleLine( (*aSeriesIter)->getPropertiesOfSeries(), bCurrentDashed ) )
+ {
+ bHasLines = true;
+ if( bCurrentDashed )
+ {
+ bHasDashedLines = true;
+ break;
+ }
+ }
+ }
+ bool bRegressionHasDashedLines=false;
+ if( lcl_HasRegressionCurves( **aSeriesIter, bRegressionHasDashedLines ) )
+ {
+ bHasLines = true;
+ if( bRegressionHasDashedLines )
+ {
+ bHasDashedLines = true;
+ break;
+ }
+ }
+ }
+ if( bHasLines )
+ {
+ if( bHasDashedLines )
+ aRet = awt::Size(1600,-1);
+ else
+ aRet = awt::Size(800,-1);
+ }
+ return aRet;
+}
uno::Any VSeriesPlotter::getExplicitSymbol( const VDataSeries& /*rSeries*/, sal_Int32 /*nPointIndex*/ )
{
@@ -1823,7 +1989,8 @@ uno::Any VSeriesPlotter::getExplicitSymbol( const VDataSeries& /*rSeries*/, sal_
}
Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForSeries(
- const VDataSeries& rSeries
+ const awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
, const Reference< drawing::XShapes >& xTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory )
{
@@ -1838,17 +2005,13 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForSeries(
// legend-symbol type
switch( eLegendSymbolStyle )
{
- case LegendSymbolStyle_HORIZONTAL_LINE:
- case LegendSymbolStyle_VERTICAL_LINE:
- case LegendSymbolStyle_DIAGONAL_LINE:
- case LegendSymbolStyle_LINE_WITH_BOX:
- case LegendSymbolStyle_LINE_WITH_SYMBOL:
+ case LegendSymbolStyle_LINE:
ePropType = VLegendSymbolFactory::PROP_TYPE_LINE_SERIES;
break;
default:
break;
};
- Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol(
+ Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
xTarget, eLegendSymbolStyle, xShapeFactory
, rSeries.getPropertiesOfSeries(), ePropType, aExplicitSymbol ));
@@ -1856,7 +2019,8 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForSeries(
}
Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForPoint(
- const VDataSeries& rSeries
+ const awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
, sal_Int32 nPointIndex
, const Reference< drawing::XShapes >& xTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory )
@@ -1872,11 +2036,7 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForPoint(
// legend-symbol type
switch( eLegendSymbolStyle )
{
- case LegendSymbolStyle_HORIZONTAL_LINE:
- case LegendSymbolStyle_VERTICAL_LINE:
- case LegendSymbolStyle_DIAGONAL_LINE:
- case LegendSymbolStyle_LINE_WITH_BOX:
- case LegendSymbolStyle_LINE_WITH_SYMBOL:
+ case LegendSymbolStyle_LINE:
ePropType = VLegendSymbolFactory::PROP_TYPE_LINE_SERIES;
break;
default:
@@ -1907,14 +2067,15 @@ Reference< drawing::XShape > VSeriesPlotter::createLegendSymbolForPoint(
}
}
- Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol(
+ Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
xTarget, eLegendSymbolStyle, xShapeFactory, xPointSet, ePropType, aExplicitSymbol ));
return xShape;
}
-std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSeries(
- const VDataSeries& rSeries
+std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntriesForSeries(
+ const awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
, const Reference< beans::XPropertySet >& xTextProperties
, const Reference< drawing::XShapes >& xTarget
, const Reference< lang::XMultiServiceFactory >& xShapeFactory
@@ -1943,7 +2104,7 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
uno::Reference< drawing::XShapes > xSymbolGroup( ShapeFactory(xShapeFactory).createGroup2D( xTarget ));
// create the symbol
- Reference< drawing::XShape > xShape( this->createLegendSymbolForPoint(
+ Reference< drawing::XShape > xShape( this->createLegendSymbolForPoint( rEntryKeyAspectRatio,
rSeries, nIdx, xSymbolGroup, xShapeFactory ) );
// set CID to symbol for selection
@@ -1973,7 +2134,7 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
// create the symbol
Reference< drawing::XShape > xShape( this->createLegendSymbolForSeries(
- rSeries, xSymbolGroup, xShapeFactory ) );
+ rEntryKeyAspectRatio, rSeries, xSymbolGroup, xShapeFactory ) );
// set CID to symbol for selection
if( xShape.is())
@@ -2003,11 +2164,10 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
sal_Int32 i = 0, nCount = aCurves.getLength();
for( i=0; i<nCount; ++i )
{
- if( aCurves[i].is() && !RegressionCurveHelper::isMeanValueLine( aCurves[i] ) )
+ if( aCurves[i].is() )
{
//label
- OUString aResStr( SchResId::getResString( STR_STATISTICS_IN_LEGEND ));
- replaceParamterInString( aResStr, C2U("%REGRESSIONCURVE"), RegressionCurveHelper::getUINameForRegressionCurve( aCurves[i] ));
+ OUString aResStr( RegressionCurveHelper::getUINameForRegressionCurve( aCurves[i] ) );
replaceParamterInString( aResStr, C2U("%SERIESNAME"), aLabelText );
aEntry.aLabel = FormattedStringHelper::createFormattedStringSequence( xContext, aResStr, xTextProperties );
@@ -2015,8 +2175,8 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
uno::Reference< drawing::XShapes > xSymbolGroup( ShapeFactory(xShapeFactory).createGroup2D( xTarget ));
// create the symbol
- Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol(
- xSymbolGroup, chart2::LegendSymbolStyle_DIAGONAL_LINE, xShapeFactory,
+ Reference< drawing::XShape > xShape( VLegendSymbolFactory::createSymbol( rEntryKeyAspectRatio,
+ xSymbolGroup, LegendSymbolStyle_LINE, xShapeFactory,
Reference< beans::XPropertySet >( aCurves[i], uno::UNO_QUERY ),
VLegendSymbolFactory::PROP_TYPE_LINE, uno::Any() ));
@@ -2025,7 +2185,7 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
{
aEntry.aSymbol = uno::Reference< drawing::XShape >( xSymbolGroup, uno::UNO_QUERY );
- bool bAverageLine = false;//@todo find out wether this is an average line or a regression curve
+ 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 ) );
@@ -2045,16 +2205,6 @@ std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForSe
return aResult;
}
-std::vector< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntriesForChartType(
- const Reference< beans::XPropertySet >& /* xTextProperties */,
- const Reference< drawing::XShapes >& /* xTarget */,
- const Reference< lang::XMultiServiceFactory >& /* xShapeFactory */,
- const Reference< uno::XComponentContext >& /* xContext */
- )
-{
- return std::vector< ViewLegendEntry >();
-}
-
VSeriesPlotter* VSeriesPlotter::createSeriesPlotter(
const uno::Reference<XChartType>& xChartTypeModel
, sal_Int32 nDimensionCount
diff --git a/chart2/source/view/chartview.component b/chart2/source/view/chartview.component
new file mode 100644
index 000000000000..773666150651
--- /dev/null
+++ b/chart2/source/view/chartview.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.chart2.ChartView">
+ <service name="com.sun.star.chart2.ChartView"/>
+ </implementation>
+</component>
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx
index fc2b41108ef1..c008ea2d5837 100644
--- a/chart2/source/view/diagram/VDiagram.cxx
+++ b/chart2/source/view/diagram/VDiagram.cxx
@@ -50,11 +50,8 @@
#include <com/sun/star/lang/XTypeProvider.hpp>
// header for class SvxShape
#include <svx/unoshape.hxx>
-// header for GetSdrObjectFromXShape
-#include <svx/unoapi.hxx>
// header for class E3dScene
#include <svx/scene3d.hxx>
-#include <rtl/math.hxx>
#include <svx/e3dsceneupdater.hxx>
//.............................................................................
@@ -108,7 +105,7 @@ VDiagram::~VDiagram()
delete m_pShapeFactory;
}
-void SAL_CALL VDiagram::init(
+void VDiagram::init(
const uno::Reference< drawing::XShapes >& xLogicTarget
, const uno::Reference< drawing::XShapes >& xFinalTarget
, const uno::Reference< lang::XMultiServiceFactory >& xFactory )
diff --git a/chart2/source/view/inc/DateHelper.hxx b/chart2/source/view/inc/DateHelper.hxx
new file mode 100644
index 000000000000..7891035fc338
--- /dev/null
+++ b/chart2/source/view/inc/DateHelper.hxx
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CHART2_DATEHELPER_HXX
+#define _CHART2_DATEHELPER_HXX
+
+#include <com/sun/star/chart2/XScaling.hpp>
+#include <tools/date.hxx>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+//-----------------------------------------------------------------------------
+/**
+*/
+
+class DateHelper
+{
+public:
+ static bool IsInSameYear( const Date& rD1, const Date& rD2 );
+ static bool IsInSameMonth( const Date& rD1, const Date& rD2 );
+
+ static long GetMonthsBetweenDates( Date aD1, Date aD2 );
+ static Date GetDateSomeMonthsAway( const Date& rD, long nMonthDistance );
+ static Date GetDateSomeYearsAway( const Date& rD, long nYearDistance );
+ static bool IsLessThanOneMonthAway( const Date& rD1, const Date& rD2 );
+ static bool IsLessThanOneYearAway( const Date& rD1, const Date& rD2 );
+
+ static double RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution );
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/inc/LegendEntryProvider.hxx b/chart2/source/view/inc/LegendEntryProvider.hxx
index 74088a61e6b5..fd2c41c338c2 100644
--- a/chart2/source/view/inc/LegendEntryProvider.hxx
+++ b/chart2/source/view/inc/LegendEntryProvider.hxx
@@ -28,20 +28,58 @@
#ifndef CHART2_VIEW_LEGENDENTRYPROVIDER_HXX
#define CHART2_VIEW_LEGENDENTRYPROVIDER_HXX
-#include <com/sun/star/chart2/LegendExpansion.hpp>
-
-#include <com/sun/star/chart2/ViewLegendEntry.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
+#include <com/sun/star/chart2/XFormattedString.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <vector>
+
namespace chart
{
+enum LegendSymbolStyle
+{
+ /** A square box with border.
+ */
+ LegendSymbolStyle_BOX,
+
+ /** A line like with a symbol.
+ */
+ LegendSymbolStyle_LINE,
+
+ /** A bordered circle which has the same bounding-box as the
+ <member>BOX</member>.
+ */
+ LegendSymbolStyle_CIRCLE
+};
+
+struct ViewLegendEntry
+{
+ /** The legend symbol that represents a data series or other
+ information contained in the legend
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShape > aSymbol;
+
+ /** The descriptive text for a legend entry.
+ */
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XFormattedString > > aLabel;
+};
+
class LegendEntryProvider
{
public:
- virtual ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ViewLegendEntry > SAL_CALL createLegendEntries(
- ::com::sun::star::chart2::LegendExpansion eLegendExpansion,
+ virtual ::com::sun::star::awt::Size getPreferredLegendKeyAspectRatio()=0;
+
+ virtual std::vector< ViewLegendEntry > createLegendEntries(
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio,
+ ::com::sun::star::chart::ChartLegendExpansion eLegendExpansion,
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xTextProperties,
const ::com::sun::star::uno::Reference<
@@ -50,10 +88,7 @@ public:
::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory,
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& xContext
- )
- throw (::com::sun::star::uno::RuntimeException) = 0;
-
-private:
+ ) = 0;
};
} // namespace chart
diff --git a/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx b/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
index d1d344b7e590..b84fba786baf 100644
--- a/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
+++ b/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
@@ -30,7 +30,7 @@
#define _CHART2_MINIMUMANDMAXIMUMSUPPLIER_HXX
#include <sal/types.h>
-
+#include <tools/date.hxx>
#include <set>
//.............................................................................
@@ -61,6 +61,10 @@ public:
virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex ) = 0;
virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) = 0;
virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) = 0;
+
+ //return a constant out of ::com::sun::star::chart::TimeUnit that allows to display the smallest distance between occuring dates
+ virtual long calculateTimeResolutionOnXAxis() = 0;
+ virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ) = 0;
};
class MergedMinimumAndMaximumSupplier : public MinimumAndMaximumSupplier
@@ -87,6 +91,9 @@ public:
virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex );
virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
+ virtual long calculateTimeResolutionOnXAxis();
+ virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate );
+
private:
typedef ::std::set< MinimumAndMaximumSupplier* > MinimumAndMaximumSupplierSet;
MinimumAndMaximumSupplierSet m_aMinimumAndMaximumSupplierList;
diff --git a/chart2/source/view/inc/PlotterBase.hxx b/chart2/source/view/inc/PlotterBase.hxx
index 605c9254a3a2..b4e7e87b1610 100644
--- a/chart2/source/view/inc/PlotterBase.hxx
+++ b/chart2/source/view/inc/PlotterBase.hxx
@@ -28,22 +28,18 @@
#ifndef _CHART2_PLOTTERBASE_HXX
#define _CHART2_PLOTTERBASE_HXX
+#include "chartview/ExplicitScaleValues.hxx"
+
#include <com/sun/star/drawing/HomogenMatrix.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-
-//----
-#include <vector>
-
-//---- chart2
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
#include <com/sun/star/chart2/XTransformation.hpp>
-//----
#include <cppuhelper/implbase1.hxx>
+#include <vector>
//.............................................................................
namespace chart
@@ -59,8 +55,7 @@ public:
PlotterBase( sal_Int32 nDimension );
virtual ~PlotterBase();
- // ___chart2::XPlotter___
- virtual void SAL_CALL initPlotter(
+ virtual void initPlotter(
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xLogicTarget
, const ::com::sun::star::uno::Reference<
@@ -70,15 +65,11 @@ public:
, const rtl::OUString& rCID
) throw (::com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL setScales(
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis )
- throw (::com::sun::star::uno::RuntimeException);
+ virtual void setScales( const ::std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
virtual void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix );
- virtual void SAL_CALL createShapes() = 0;
+ virtual void createShapes() = 0;
static bool isValidPosition( const ::com::sun::star::drawing::Position3D& rPos );
diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx b/chart2/source/view/inc/PlottingPositionHelper.hxx
index 5357917a8d5d..a54365e88cf3 100644
--- a/chart2/source/view/inc/PlottingPositionHelper.hxx
+++ b/chart2/source/view/inc/PlottingPositionHelper.hxx
@@ -29,9 +29,10 @@
#define _CHART2_PLOTTINGPOSITIONHELPER_HXX
#include "LabelAlignment.hxx"
+#include "chartview/ExplicitScaleValues.hxx"
+
#include <basegfx/range/b2drectangle.hxx>
#include <rtl/math.hxx>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
#include <com/sun/star/chart2/XTransformation.hpp>
#include <com/sun/star/drawing/Direction3D.hpp>
#include <com/sun/star/drawing/HomogenMatrix.hpp>
@@ -63,23 +64,22 @@ public:
virtual ~PlottingPositionHelper();
virtual PlottingPositionHelper* clone() const;
- virtual PlottingPositionHelper* createSecondaryPosHelper( const ::com::sun::star::chart2::ExplicitScaleData& rSecondaryScale );
+ virtual PlottingPositionHelper* createSecondaryPosHelper( const ExplicitScaleData& rSecondaryScale );
virtual void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix);
- virtual void setScales( const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis );
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& getScales() const;
+ virtual void setScales( const ::std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
+ const ::std::vector< ExplicitScaleData >& getScales() const;
//better performance for big data
inline void setCoordinateSystemResolution( const ::com::sun::star::uno::Sequence< sal_Int32 >& rCoordinateSystemResolution );
inline bool isSameForGivenResolution( double fX, double fY, double fZ
, double fX2, double fY2, double fZ2 );
+ inline bool isStrongLowerRequested( sal_Int32 nDimensionIndex ) const;
inline bool isLogicVisible( double fX, double fY, double fZ ) const;
inline void doLogicScaling( double* pX, double* pY, double* pZ, bool bClip=false ) const;
+ inline void doUnshiftedLogicScaling( double* pX, double* pY, double* pZ, bool bClip=false ) const;
inline void clipLogicValues( double* pX, double* pY, double* pZ ) const;
void clipScaledLogicValues( double* pX, double* pY, double* pZ ) const;
inline bool clipYRange( double& rMin, double& rMax ) const;
@@ -124,10 +124,14 @@ public:
inline bool maySkipPointsInRegressionCalculation() const;
+ void setTimeResolution( long nTimeResolution, const Date& rNullDate );
+ virtual void setScaledCategoryWidth( double fScaledCategoryWidth );
+ void AllowShiftXAxisPos( bool bAllowShift );
+ void AllowShiftZAxisPos( bool bAllowShift );
+
protected: //member
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData > m_aScales;
- ::basegfx::B3DHomMatrix m_aMatrixScreenToScene;
+ ::std::vector< ExplicitScaleData > m_aScales;
+ ::basegfx::B3DHomMatrix m_aMatrixScreenToScene;
//this is calculated based on m_aScales and m_aMatrixScreenToScene
mutable ::com::sun::star::uno::Reference<
@@ -140,6 +144,14 @@ protected: //member
sal_Int32 m_nZResolution;
bool m_bMaySkipPointsInRegressionCalculation;
+
+ bool m_bDateAxis;
+ long m_nTimeResolution;
+ Date m_aNullDate;
+
+ double m_fScaledCategoryWidth;
+ bool m_bAllowShiftXAxisPos;
+ bool m_bAllowShiftZAxisPos;
};
//describes wich axis of the drawinglayer scene or sreen axis are the normal axis
@@ -160,9 +172,7 @@ public:
virtual PlottingPositionHelper* clone() const;
virtual void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix);
- virtual void setScales( const ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis );
+ virtual void setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis );
::basegfx::B3DHomMatrix getUnitCartesianToScene() const;
@@ -206,14 +216,14 @@ private:
bool PolarPlottingPositionHelper::isMathematicalOrientationAngle() const
{
- const ::com::sun::star::chart2::ExplicitScaleData& rScale = m_bSwapXAndY ? m_aScales[1] : m_aScales[2];
+ const ExplicitScaleData& rScale = m_bSwapXAndY ? m_aScales[1] : m_aScales[2];
if( ::com::sun::star::chart2::AxisOrientation_MATHEMATICAL==rScale.Orientation )
return true;
return false;
}
bool PolarPlottingPositionHelper::isMathematicalOrientationRadius() const
{
- const ::com::sun::star::chart2::ExplicitScaleData& rScale = m_bSwapXAndY ? m_aScales[0] : m_aScales[1];
+ const ExplicitScaleData& rScale = m_bSwapXAndY ? m_aScales[0] : m_aScales[1];
if( ::com::sun::star::chart2::AxisOrientation_MATHEMATICAL==rScale.Orientation )
return true;
return false;
@@ -262,12 +272,23 @@ bool PlottingPositionHelper::isSameForGivenResolution( double fX, double fY, dou
return (bSameX && bSameY && bSameZ);
}
+bool PlottingPositionHelper::isStrongLowerRequested( sal_Int32 nDimensionIndex ) const
+{
+ if( m_aScales.empty() )
+ return false;
+ if( 0==nDimensionIndex )
+ return m_bAllowShiftXAxisPos && m_aScales[nDimensionIndex].ShiftedCategoryPosition;
+ else if( 2==nDimensionIndex )
+ return m_bAllowShiftZAxisPos && m_aScales[nDimensionIndex].ShiftedCategoryPosition;
+ return false;
+}
+
bool PlottingPositionHelper::isLogicVisible(
double fX, double fY, double fZ ) const
{
- return fX >= m_aScales[0].Minimum && fX <= m_aScales[0].Maximum
+ return fX >= m_aScales[0].Minimum && ( isStrongLowerRequested(0) ? fX < m_aScales[0].Maximum : fX <= m_aScales[0].Maximum )
&& fY >= m_aScales[1].Minimum && fY <= m_aScales[1].Maximum
- && fZ >= m_aScales[2].Minimum && fZ <= m_aScales[2].Maximum;
+ && fZ >= m_aScales[2].Minimum && ( isStrongLowerRequested(2) ? fZ < m_aScales[2].Maximum : fZ <= m_aScales[2].Maximum );
}
void PlottingPositionHelper::doLogicScaling( double* pX, double* pY, double* pZ, bool bClip ) const
@@ -275,6 +296,29 @@ void PlottingPositionHelper::doLogicScaling( double* pX, double* pY, double* pZ,
if(bClip)
this->clipLogicValues( pX,pY,pZ );
+ if(pX)
+ {
+ if( m_aScales[0].Scaling.is())
+ *pX = m_aScales[0].Scaling->doScaling(*pX);
+ if( m_bAllowShiftXAxisPos && m_aScales[0].ShiftedCategoryPosition )
+ (*pX) += m_fScaledCategoryWidth/2.0;
+ }
+ if(pY && m_aScales[1].Scaling.is())
+ *pY = m_aScales[1].Scaling->doScaling(*pY);
+ if(pZ)
+ {
+ if( m_aScales[2].Scaling.is())
+ *pZ = m_aScales[2].Scaling->doScaling(*pZ);
+ if( m_bAllowShiftZAxisPos && m_aScales[2].ShiftedCategoryPosition)
+ (*pZ) += 0.5;
+ }
+}
+
+void PlottingPositionHelper::doUnshiftedLogicScaling( double* pX, double* pY, double* pZ, bool bClip ) const
+{
+ if(bClip)
+ this->clipLogicValues( pX,pY,pZ );
+
if(pX && m_aScales[0].Scaling.is())
*pX = m_aScales[0].Scaling->doScaling(*pX);
if(pY && m_aScales[1].Scaling.is())
diff --git a/chart2/source/view/inc/ScaleAutomatism.hxx b/chart2/source/view/inc/ScaleAutomatism.hxx
index 83cd0a9e15da..2ebe000c932c 100644
--- a/chart2/source/view/inc/ScaleAutomatism.hxx
+++ b/chart2/source/view/inc/ScaleAutomatism.hxx
@@ -28,10 +28,11 @@
#ifndef _CHART2_SCALEAUTOMATISM_HXX
#define _CHART2_SCALEAUTOMATISM_HXX
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
+#include "chartview/ExplicitScaleValues.hxx"
#include <com/sun/star/chart2/ScaleData.hpp>
+#include <tools/date.hxx>
+
//.............................................................................
namespace chart
{
@@ -45,7 +46,7 @@ class ScaleAutomatism
{
public:
explicit ScaleAutomatism(
- const ::com::sun::star::chart2::ScaleData& rSourceScale );
+ const ::com::sun::star::chart2::ScaleData& rSourceScale, const Date& rNullDate );
virtual ~ScaleAutomatism();
/** Expands own value range with the passed minimum and maximum. */
@@ -76,30 +77,41 @@ public:
of the axis and the font size of the axis caption text. */
void setMaximumAutoMainIncrementCount( sal_Int32 nMaximumAutoMainIncrementCount );
+ /** Sets the time resolution to be used in case it is not set explicitly within the scale
+ */
+ void setAutomaticTimeResolution( sal_Int32 nTimeResolution );
+
/** Fills the passed scale data and increment data according to the own settings. */
void calculateExplicitScaleAndIncrement(
- ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale,
- ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement ) const;
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement ) const;
::com::sun::star::chart2::ScaleData getScale() const;
+ Date getNullDate() const;
private:
/** Fills the passed scale data and increment data for category scaling. */
void calculateExplicitIncrementAndScaleForCategory(
- ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale,
- ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement,
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement,
bool bAutoMinimum, bool bAutoMaximum ) const;
/** Fills the passed scale data and increment data for logarithmic scaling. */
void calculateExplicitIncrementAndScaleForLogarithmic(
- ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale,
- ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement,
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement,
bool bAutoMinimum, bool bAutoMaximum ) const;
/** Fills the passed scale data and increment data for linear scaling. */
void calculateExplicitIncrementAndScaleForLinear(
- ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale,
- ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement,
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement,
+ bool bAutoMinimum, bool bAutoMaximum ) const;
+
+ /** Fills the passed scale data and increment data for date-time axis. */
+ void calculateExplicitIncrementAndScaleForDateTimeAxis(
+ ExplicitScaleData& rExplicitScale,
+ ExplicitIncrementData& rExplicitIncrement,
bool bAutoMinimum, bool bAutoMaximum ) const;
private:
@@ -112,6 +124,9 @@ private:
bool m_bExpandIfValuesCloseToBorder; /// true = Expand if values are too close to the borders.
bool m_bExpandWideValuesToZero; /// true = Expand wide spread values to zero.
bool m_bExpandNarrowValuesTowardZero; /// true = Expand narrow range toward zero (add half of range).
+ sal_Int32 m_nTimeResolution;// a constant out of ::com::sun::star::chart::TimeUnit
+
+ Date m_aNullDate;
};
//.............................................................................
diff --git a/chart2/source/view/inc/VCoordinateSystem.hxx b/chart2/source/view/inc/VCoordinateSystem.hxx
index a90119dad9ef..f4b5e380d8b0 100644
--- a/chart2/source/view/inc/VCoordinateSystem.hxx
+++ b/chart2/source/view/inc/VCoordinateSystem.hxx
@@ -32,9 +32,8 @@
#include "ScaleAutomatism.hxx"
#include "ThreeDHelper.hxx"
#include "ExplicitCategoriesProvider.hxx"
+#include "chartview/ExplicitScaleValues.hxx"
-#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
-#include <com/sun/star/chart2/ExplicitScaleData.hpp>
#include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include "comphelper/implementationreference.hxx"
#include <com/sun/star/awt/Rectangle.hpp>
@@ -64,7 +63,7 @@ public:
static VCoordinateSystem* createCoordinateSystem( const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel );
- virtual void SAL_CALL initPlottingTargets(
+ virtual void initPlottingTargets(
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xLogicTarget
, const ::com::sun::star::uno::Reference<
@@ -84,16 +83,16 @@ public:
virtual ::com::sun::star::uno::Sequence< sal_Int32 > getCoordinateSystemResolution( const ::com::sun::star::awt::Size& rPageSize
, const ::com::sun::star::awt::Size& rPageResolution );
- ::com::sun::star::chart2::ExplicitScaleData getExplicitScale( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
- ::com::sun::star::chart2::ExplicitIncrementData getExplicitIncrement( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
+ 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 coplete 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
- ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData > getExplicitScales( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
+ ::std::vector< ExplicitScaleData > getExplicitScales( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
// returns a coplete 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
- ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitIncrementData > getExplicitIncrements( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
+ ::std::vector< ExplicitIncrementData > getExplicitIncrements( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
void addMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
bool hasMinimumAndMaximumSupplier( MinimumAndMaximumSupplier* pMinimumAndMaximumSupplier );
@@ -102,8 +101,8 @@ public:
void prepareScaleAutomatismForDimensionAndIndex( ScaleAutomatism& rScaleAutomatism, sal_Int32 nDimIndex, sal_Int32 nAxisIndex );
void setExplicitScaleAndIncrement( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex
- , const ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale
- , const ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement );
+ , const ExplicitScaleData& rExplicitScale
+ , const ExplicitIncrementData& rExplicitIncrement );
void set3DWallPositions( CuboidPlanePosition eLeftWallPos, CuboidPlanePosition eBackWallPos, CuboidPlanePosition eBottomPos );
@@ -144,8 +143,6 @@ protected: //methods
VAxisBase* getVAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
- void prepareScaleAutomatism( ScaleAutomatism& rScaleAutomatism, double fMin, double fMax, sal_Int32 nDimIndex, sal_Int32 nAxisIndex );
-
rtl::OUString createCIDForAxis( const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XAxis >& xAxis
, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
@@ -195,11 +192,11 @@ protected: //member
tVAxisMap m_aAxisMap;
private:
- ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData > m_aExplicitScales;
- ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitIncrementData > m_aExplicitIncrements;
+ std::vector< ExplicitScaleData > m_aExplicitScales;
+ std::vector< ExplicitIncrementData > m_aExplicitIncrements;
- typedef std::map< tFullAxisIndex, ::com::sun::star::chart2::ExplicitScaleData > tFullExplicitScaleMap;
- typedef std::map< tFullAxisIndex, ::com::sun::star::chart2::ExplicitIncrementData > tFullExplicitIncrementMap;
+ typedef std::map< tFullAxisIndex, ExplicitScaleData > tFullExplicitScaleMap;
+ typedef std::map< tFullAxisIndex, ExplicitIncrementData > tFullExplicitIncrementMap;
tFullExplicitScaleMap m_aSecondaryExplicitScales;
tFullExplicitIncrementMap m_aSecondaryExplicitIncrements;
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index 389668757bc6..4f811a6d8667 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -77,6 +77,10 @@ public:
getModel() const;
void setCategoryXAxis();
+ void setXValues( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XDataSequence >& xValues );
+ void setXValuesIfNone( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XDataSequence >& xValues );
void setParticle( const rtl::OUString& rSeriesParticle );
void setGlobalSeriesIndex( sal_Int32 nGlobalSeriesIndex );
void setPageReferenceSize( const ::com::sun::star::awt::Size & rPageRefSize );
diff --git a/chart2/source/view/inc/VDiagram.hxx b/chart2/source/view/inc/VDiagram.hxx
index b7d0e6fba64d..1a7dc6f7fa7c 100644
--- a/chart2/source/view/inc/VDiagram.hxx
+++ b/chart2/source/view/inc/VDiagram.hxx
@@ -57,7 +57,7 @@ public: //methods
, sal_Int32 nDimension=3, sal_Bool bPolar=sal_False );
virtual ~VDiagram();
- void SAL_CALL init( const ::com::sun::star::uno::Reference<
+ void init( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xLogicTarget
, const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xFinalTarget
diff --git a/chart2/source/view/inc/VLegendSymbolFactory.hxx b/chart2/source/view/inc/VLegendSymbolFactory.hxx
index 017e91472dc7..4b6deb816699 100644
--- a/chart2/source/view/inc/VLegendSymbolFactory.hxx
+++ b/chart2/source/view/inc/VLegendSymbolFactory.hxx
@@ -28,7 +28,7 @@
#ifndef CHART2_VLEGENDSYMBOLFACTORY_HXX
#define CHART2_VLEGENDSYMBOLFACTORY_HXX
-#include <com/sun/star/chart2/LegendSymbolStyle.hpp>
+#include "LegendEntryProvider.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
@@ -51,9 +51,10 @@ public:
static ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShape >
createSymbol(
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio,
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes > xSymbolContainer,
- ::com::sun::star::chart2::LegendSymbolStyle eStyle,
+ LegendSymbolStyle eStyle,
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory > & xShapeFactory,
const ::com::sun::star::uno::Reference<
@@ -61,13 +62,6 @@ public:
tPropertyType ePropertyType,
const ::com::sun::star::uno::Any& rExplicitSymbol /*should contain a ::com::sun::star::chart2::Symbol without automatic symbol if the charttype does support symbols else empty*/);
- enum tStockLineType
- {
- STOCK_LINE_TYPE_VERT,
- STOCK_LINE_TYPE_OPEN,
- STOCK_LINE_TYPE_CLOSE
- };
-
private:
VLegendSymbolFactory();
};
diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx
index 0885ee8ef680..53cabce9ecc4 100644
--- a/chart2/source/view/inc/VSeriesPlotter.hxx
+++ b/chart2/source/view/inc/VSeriesPlotter.hxx
@@ -34,7 +34,6 @@
#include "MinimumAndMaximumSupplier.hxx"
#include "LegendEntryProvider.hxx"
#include "ExplicitCategoriesProvider.hxx"
-#include <com/sun/star/chart2/LegendSymbolStyle.hpp>
#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/drawing/Direction3D.hpp>
@@ -175,8 +174,7 @@ public:
)
*/
- virtual void SAL_CALL addSecondaryValueScale( const
- ::com::sun::star::chart2::ExplicitScaleData& rScale, sal_Int32 nAxisIndex )
+ virtual void addSecondaryValueScale( const ExplicitScaleData& rScale, sal_Int32 nAxisIndex )
throw (::com::sun::star::uno::RuntimeException);
//-------------------------------------------------------------------------
@@ -198,6 +196,9 @@ public:
virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex );
virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
+ virtual long calculateTimeResolutionOnXAxis();
+ virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate );
+
//------
void getMinimumAndMaximiumX( double& rfMinimum, double& rfMaximum ) const;
@@ -206,9 +207,9 @@ public:
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
- virtual ::com::sun::star::uno::Sequence<
- ::com::sun::star::chart2::ViewLegendEntry > SAL_CALL createLegendEntries(
- ::com::sun::star::chart2::LegendExpansion eLegendExpansion,
+ virtual std::vector< ViewLegendEntry > createLegendEntries(
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio,
+ ::com::sun::star::chart::ChartLegendExpansion eLegendExpansion,
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xTextProperties,
const ::com::sun::star::uno::Reference<
@@ -217,26 +218,29 @@ public:
::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory,
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& xContext
- )
- throw (::com::sun::star::uno::RuntimeException);
+ );
- virtual ::com::sun::star::chart2::LegendSymbolStyle getLegendSymbolStyle();
+ virtual LegendSymbolStyle getLegendSymbolStyle();
+ virtual com::sun::star::awt::Size getPreferredLegendKeyAspectRatio();
+
virtual ::com::sun::star::uno::Any getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex=-1/*-1 for series symbol*/ );
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createLegendSymbolForSeries(
- const VDataSeries& rSeries
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory );
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createLegendSymbolForPoint(
- const VDataSeries& rSeries
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
, sal_Int32 nPointIndex
, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory );
- virtual std::vector<
- ::com::sun::star::chart2::ViewLegendEntry > SAL_CALL createLegendEntriesForSeries(
+ virtual std::vector< ViewLegendEntry > createLegendEntriesForSeries(
+ const ::com::sun::star::awt::Size& rEntryKeyAspectRatio,
const VDataSeries& rSeries,
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xTextProperties,
@@ -248,17 +252,7 @@ public:
::com::sun::star::uno::XComponentContext >& xContext
);
- virtual std::vector<
- ::com::sun::star::chart2::ViewLegendEntry > SAL_CALL createLegendEntriesForChartType(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >& xTextProperties,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShapes >& xTarget,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XComponentContext >& xContext
- );
+ ::std::vector< VDataSeries* > getAllSeries();
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
@@ -380,12 +374,14 @@ protected: //methods
, const VDataSeries& rVDataSeries
, sal_Int32 nIndex
, bool bVertical
+ , double* pfScaledLogicX
);
virtual void createErrorBar_Y( const ::com::sun::star::drawing::Position3D& rUnscaledLogicPosition
, VDataSeries& rVDataSeries, sal_Int32 nPointIndex
, const ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShapes >& xTarget );
+ ::com::sun::star::drawing::XShapes >& xTarget
+ , double* pfScaledLogicX=0 );
virtual void createRegressionCurvesShapes( VDataSeries& rVDataSeries
, const ::com::sun::star::uno::Reference<
@@ -426,6 +422,8 @@ protected: //member
::std::vector< ::std::vector< VDataSeriesGroup > > m_aZSlots;
bool m_bCategoryXAxis;//true->xvalues are indices (this would not be necessary if series for category chart wouldn't have x-values)
+ long m_nTimeResolution;
+ Date m_aNullDate;
::std::auto_ptr< NumberFormatterWrapper > m_apNumberFormatterWrapper;
AxesNumberFormats m_aAxesNumberFormats;//direct numberformats on axes, if empty ask the data series instead
@@ -440,7 +438,7 @@ protected: //member
bool m_bPointsWereSkipped;
private: //member
- typedef std::map< sal_Int32 , ::com::sun::star::chart2::ExplicitScaleData > tSecondaryValueScales;
+ typedef std::map< sal_Int32 , ExplicitScaleData > tSecondaryValueScales;
tSecondaryValueScales m_aSecondaryValueScales;
typedef std::map< sal_Int32 , PlottingPositionHelper* > tSecondaryPosHelperMap;
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 042fc78b0486..c467634aff6d 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -44,6 +44,8 @@
#include <editeng/editids.hrc>
#include <svx/svxids.hrc>
+#include <com/sun/star/chart2/LegendPosition.hpp>
+
namespace chart
{
@@ -64,51 +66,18 @@ ChartItemPool::ChartItemPool():
SvULongs aTmp;
ppPoolDefaults[SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS,aTmp);
ppPoolDefaults[SCHATTR_DATADESCR_NO_PERCENTVALUE - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_NO_PERCENTVALUE);
-
- ppPoolDefaults[SCHATTR_LEGEND_POS - SCHATTR_START] = new SvxChartLegendPosItem( CHLEGEND_RIGHT, SCHATTR_LEGEND_POS );
- ppPoolDefaults[SCHATTR_TEXT_STACKED - SCHATTR_START] = new SfxBoolItem(SCHATTR_TEXT_STACKED,FALSE);
- ppPoolDefaults[SCHATTR_TEXT_ORDER - SCHATTR_START] = new SvxChartTextOrderItem(CHTXTORDER_SIDEBYSIDE, SCHATTR_TEXT_ORDER);
-
- ppPoolDefaults[SCHATTR_Y_AXIS_AUTO_MIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_AUTO_MIN);
- ppPoolDefaults[SCHATTR_Y_AXIS_MIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Y_AXIS_MIN);
- ppPoolDefaults[SCHATTR_Y_AXIS_AUTO_MAX - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_AUTO_MAX);
- ppPoolDefaults[SCHATTR_Y_AXIS_MAX - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Y_AXIS_MAX);
- ppPoolDefaults[SCHATTR_Y_AXIS_AUTO_STEP_MAIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_AUTO_STEP_MAIN);
- ppPoolDefaults[SCHATTR_Y_AXIS_STEP_MAIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Y_AXIS_STEP_MAIN);
- ppPoolDefaults[SCHATTR_Y_AXIS_AUTO_STEP_HELP - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_AUTO_STEP_HELP);
- ppPoolDefaults[SCHATTR_Y_AXIS_STEP_HELP - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Y_AXIS_STEP_HELP);
- ppPoolDefaults[SCHATTR_Y_AXIS_LOGARITHM - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_LOGARITHM);
- ppPoolDefaults[SCHATTR_Y_AXIS_AUTO_ORIGIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Y_AXIS_AUTO_ORIGIN);
- ppPoolDefaults[SCHATTR_Y_AXIS_ORIGIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Y_AXIS_ORIGIN);
-
- ppPoolDefaults[SCHATTR_X_AXIS_AUTO_MIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_AUTO_MIN);
- ppPoolDefaults[SCHATTR_X_AXIS_MIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_X_AXIS_MIN);
- ppPoolDefaults[SCHATTR_X_AXIS_AUTO_MAX - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_AUTO_MAX);
- ppPoolDefaults[SCHATTR_X_AXIS_MAX - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_X_AXIS_MAX);
- ppPoolDefaults[SCHATTR_X_AXIS_AUTO_STEP_MAIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_AUTO_STEP_MAIN);
- ppPoolDefaults[SCHATTR_X_AXIS_STEP_MAIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_X_AXIS_STEP_MAIN);
- ppPoolDefaults[SCHATTR_X_AXIS_AUTO_STEP_HELP - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_AUTO_STEP_HELP);
- ppPoolDefaults[SCHATTR_X_AXIS_STEP_HELP - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_X_AXIS_STEP_HELP);
- ppPoolDefaults[SCHATTR_X_AXIS_LOGARITHM - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_LOGARITHM);
- ppPoolDefaults[SCHATTR_X_AXIS_AUTO_ORIGIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_X_AXIS_AUTO_ORIGIN);
- ppPoolDefaults[SCHATTR_X_AXIS_ORIGIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_X_AXIS_ORIGIN);
-
- ppPoolDefaults[SCHATTR_Z_AXIS_AUTO_MIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_AUTO_MIN);
- ppPoolDefaults[SCHATTR_Z_AXIS_MIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_MIN);
- ppPoolDefaults[SCHATTR_Z_AXIS_AUTO_MAX - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_AUTO_MAX);
- ppPoolDefaults[SCHATTR_Z_AXIS_MAX - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_MAX);
- ppPoolDefaults[SCHATTR_Z_AXIS_AUTO_STEP_MAIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_AUTO_STEP_MAIN);
- ppPoolDefaults[SCHATTR_Z_AXIS_STEP_MAIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_STEP_MAIN);
- ppPoolDefaults[SCHATTR_Z_AXIS_AUTO_STEP_HELP - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_AUTO_STEP_HELP);
- ppPoolDefaults[SCHATTR_Z_AXIS_STEP_HELP - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_STEP_HELP);
- ppPoolDefaults[SCHATTR_Z_AXIS_LOGARITHM - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_LOGARITHM);
- ppPoolDefaults[SCHATTR_Z_AXIS_AUTO_ORIGIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_Z_AXIS_AUTO_ORIGIN);
- ppPoolDefaults[SCHATTR_Z_AXIS_ORIGIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_Z_AXIS_ORIGIN);
-
- ppPoolDefaults[SCHATTR_AXISTYPE - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXISTYPE, CHART_AXIS_X);
- ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_VALUE - SCHATTR_START] = new SfxInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE, 0);
+ ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_VALUE - SCHATTR_START] = new SfxUInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE, 0);
ppPoolDefaults[SCHATTR_PERCENT_NUMBERFORMAT_SOURCE - SCHATTR_START] = new SfxBoolItem(SCHATTR_PERCENT_NUMBERFORMAT_SOURCE);
+ //legend
+ ppPoolDefaults[SCHATTR_LEGEND_POS - SCHATTR_START] = new SfxInt32Item(SCHATTR_LEGEND_POS, ::com::sun::star::chart2::LegendPosition_LINE_END );
+ ppPoolDefaults[SCHATTR_LEGEND_SHOW - SCHATTR_START] = new SfxBoolItem(SCHATTR_LEGEND_SHOW, sal_True);
+
+ //text
+ ppPoolDefaults[SCHATTR_TEXT_DEGREES - SCHATTR_START] = new SfxInt32Item(SCHATTR_TEXT_DEGREES, 0);
+ ppPoolDefaults[SCHATTR_TEXT_STACKED - SCHATTR_START] = new SfxBoolItem(SCHATTR_TEXT_STACKED,sal_False);
+
+ //statistic
ppPoolDefaults[SCHATTR_STAT_AVERAGE - SCHATTR_START] = new SfxBoolItem (SCHATTR_STAT_AVERAGE);
ppPoolDefaults[SCHATTR_STAT_KIND_ERROR - SCHATTR_START] = new SvxChartKindErrorItem (CHERROR_NONE, SCHATTR_STAT_KIND_ERROR);
ppPoolDefaults[SCHATTR_STAT_PERCENT - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_PERCENT);
@@ -119,9 +88,6 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_STAT_RANGE_POS - SCHATTR_START] = new SfxStringItem (SCHATTR_STAT_RANGE_POS, String());
ppPoolDefaults[SCHATTR_STAT_RANGE_NEG - SCHATTR_START] = new SfxStringItem (SCHATTR_STAT_RANGE_NEG, String());
- ppPoolDefaults[SCHATTR_TEXT_DEGREES - SCHATTR_START] = new SfxInt32Item(SCHATTR_TEXT_DEGREES, 0);
- ppPoolDefaults[SCHATTR_TEXT_OVERLAP - SCHATTR_START] = new SfxBoolItem(SCHATTR_TEXT_OVERLAP,FALSE);
-
ppPoolDefaults[SCHATTR_STYLE_DEEP - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_DEEP, 0);
ppPoolDefaults[SCHATTR_STYLE_3D - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_3D, 0);
ppPoolDefaults[SCHATTR_STYLE_VERTICAL - SCHATTR_START] = new SfxBoolItem (SCHATTR_STYLE_VERTICAL, 0);
@@ -135,36 +101,44 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_AXIS - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS,2); //2 = Y-Axis!!!
+ //axis scale
+ ppPoolDefaults[SCHATTR_AXISTYPE - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXISTYPE, CHART_AXIS_REALNUMBER);
+ ppPoolDefaults[SCHATTR_AXIS_REVERSE - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_REVERSE,0);
ppPoolDefaults[SCHATTR_AXIS_AUTO_MIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_MIN);
ppPoolDefaults[SCHATTR_AXIS_MIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_MIN);
ppPoolDefaults[SCHATTR_AXIS_AUTO_MAX - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_MAX);
ppPoolDefaults[SCHATTR_AXIS_MAX - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_MAX);
ppPoolDefaults[SCHATTR_AXIS_AUTO_STEP_MAIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN);
ppPoolDefaults[SCHATTR_AXIS_STEP_MAIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_STEP_MAIN);
+ ppPoolDefaults[SCHATTR_AXIS_MAIN_TIME_UNIT - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_MAIN_TIME_UNIT,2);
ppPoolDefaults[SCHATTR_AXIS_AUTO_STEP_HELP - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP);
// type changed from double to sal_Int32
ppPoolDefaults[SCHATTR_AXIS_STEP_HELP - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_STEP_HELP,0);
+ ppPoolDefaults[SCHATTR_AXIS_HELP_TIME_UNIT - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_HELP_TIME_UNIT,2);
+ ppPoolDefaults[SCHATTR_AXIS_AUTO_TIME_RESOLUTION - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_TIME_RESOLUTION);
+ ppPoolDefaults[SCHATTR_AXIS_TIME_RESOLUTION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_TIME_RESOLUTION,2);
ppPoolDefaults[SCHATTR_AXIS_LOGARITHM - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LOGARITHM);
+ ppPoolDefaults[SCHATTR_AXIS_AUTO_DATEAXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_DATEAXIS);
+ ppPoolDefaults[SCHATTR_AXIS_ALLOW_DATEAXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_ALLOW_DATEAXIS);
ppPoolDefaults[SCHATTR_AXIS_AUTO_ORIGIN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN);
ppPoolDefaults[SCHATTR_AXIS_ORIGIN - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_ORIGIN);
+ //axis position
ppPoolDefaults[SCHATTR_AXIS_TICKS - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_TICKS,CHAXIS_MARK_OUTER);
- ppPoolDefaults[SCHATTR_AXIS_NUMFMT - SCHATTR_START] = new SfxUInt32Item(SCHATTR_AXIS_NUMFMT,0);
- ppPoolDefaults[SCHATTR_AXIS_NUMFMTPERCENT - SCHATTR_START] = new SfxUInt32Item(SCHATTR_AXIS_NUMFMTPERCENT,11);
- ppPoolDefaults[SCHATTR_AXIS_SHOWAXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWAXIS,0);
- ppPoolDefaults[SCHATTR_AXIS_SHOWDESCR - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWDESCR,0);
- ppPoolDefaults[SCHATTR_AXIS_SHOWMAINGRID - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWMAINGRID,0);
- ppPoolDefaults[SCHATTR_AXIS_SHOWHELPGRID - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWHELPGRID,0);
- ppPoolDefaults[SCHATTR_AXIS_TOPDOWN - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_TOPDOWN,0);
ppPoolDefaults[SCHATTR_AXIS_HELPTICKS - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_HELPTICKS,0);
- ppPoolDefaults[SCHATTR_AXIS_REVERSE - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_REVERSE,0);
-
ppPoolDefaults[SCHATTR_AXIS_POSITION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_POSITION,0);
ppPoolDefaults[SCHATTR_AXIS_POSITION_VALUE - SCHATTR_START] = new SvxDoubleItem(0.0, SCHATTR_AXIS_POSITION_VALUE);
ppPoolDefaults[SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT - SCHATTR_START] = new SfxUInt32Item(SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT,0);
ppPoolDefaults[SCHATTR_AXIS_LABEL_POSITION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_LABEL_POSITION,0);
ppPoolDefaults[SCHATTR_AXIS_MARK_POSITION - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_MARK_POSITION,0);
+ //axis label
+ ppPoolDefaults[SCHATTR_AXIS_SHOWDESCR - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWDESCR,0);
+ ppPoolDefaults[SCHATTR_AXIS_LABEL_ORDER - SCHATTR_START] = new SvxChartTextOrderItem(CHTXTORDER_SIDEBYSIDE, SCHATTR_AXIS_LABEL_ORDER);
+ ppPoolDefaults[SCHATTR_AXIS_LABEL_OVERLAP - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LABEL_OVERLAP,sal_False);
+ ppPoolDefaults[SCHATTR_AXIS_LABEL_BREAK - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LABEL_BREAK, sal_False );
+
+ //--
ppPoolDefaults[SCHATTR_SYMBOL_BRUSH - SCHATTR_START] = new SvxBrushItem(SCHATTR_SYMBOL_BRUSH);
ppPoolDefaults[SCHATTR_STOCK_VOLUME - SCHATTR_START] = new SfxBoolItem(SCHATTR_STOCK_VOLUME,0);
ppPoolDefaults[SCHATTR_STOCK_UPDOWN - SCHATTR_START] = new SfxBoolItem(SCHATTR_STOCK_UPDOWN,0);
@@ -173,21 +147,21 @@ ChartItemPool::ChartItemPool():
// new for New Chart
ppPoolDefaults[SCHATTR_BAR_OVERLAP - SCHATTR_START] = new SfxInt32Item(SCHATTR_BAR_OVERLAP,0);
ppPoolDefaults[SCHATTR_BAR_GAPWIDTH - SCHATTR_START] = new SfxInt32Item(SCHATTR_BAR_GAPWIDTH,0);
- ppPoolDefaults[SCHATTR_BAR_CONNECT - SCHATTR_START] = new SfxBoolItem(SCHATTR_BAR_CONNECT, FALSE);
+ ppPoolDefaults[SCHATTR_BAR_CONNECT - SCHATTR_START] = new SfxBoolItem(SCHATTR_BAR_CONNECT, sal_False);
ppPoolDefaults[SCHATTR_NUM_OF_LINES_FOR_BAR - SCHATTR_START] = new SfxInt32Item( SCHATTR_NUM_OF_LINES_FOR_BAR, 0 );
ppPoolDefaults[SCHATTR_SPLINE_ORDER - SCHATTR_START] = new SfxInt32Item( SCHATTR_SPLINE_ORDER, 3 );
ppPoolDefaults[SCHATTR_SPLINE_RESOLUTION - SCHATTR_START] = new SfxInt32Item( SCHATTR_SPLINE_RESOLUTION, 20 );
ppPoolDefaults[SCHATTR_DIAGRAM_STYLE - SCHATTR_START] = new SvxChartStyleItem( CHSTYLE_2D_COLUMN, SCHATTR_DIAGRAM_STYLE );
- ppPoolDefaults[SCHATTR_TEXTBREAK - SCHATTR_START] = new SfxBoolItem( SCHATTR_TEXTBREAK, FALSE );
- ppPoolDefaults[SCHATTR_GROUP_BARS_PER_AXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_GROUP_BARS_PER_AXIS, FALSE);
- ppPoolDefaults[SCHATTR_INCLUDE_HIDDEN_CELLS - SCHATTR_START] = new SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, TRUE);
+ ppPoolDefaults[SCHATTR_GROUP_BARS_PER_AXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_GROUP_BARS_PER_AXIS, sal_False);
ppPoolDefaults[SCHATTR_STARTING_ANGLE - SCHATTR_START] = new SfxInt32Item( SCHATTR_STARTING_ANGLE, 90 );
- ppPoolDefaults[SCHATTR_CLOCKWISE - SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, FALSE );
+ ppPoolDefaults[SCHATTR_CLOCKWISE - SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, sal_False );
ppPoolDefaults[SCHATTR_MISSING_VALUE_TREATMENT - SCHATTR_START] = new SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT, 0);
ppPoolDefaults[SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,aTmp);
+ ppPoolDefaults[SCHATTR_INCLUDE_HIDDEN_CELLS - SCHATTR_START] = new SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, sal_True);
ppPoolDefaults[SCHATTR_AXIS_FOR_ALL_SERIES - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_FOR_ALL_SERIES, 0);
+
ppPoolDefaults[SCHATTR_REGRESSION_TYPE - SCHATTR_START] = new SvxChartRegressItem (CHREGRESS_NONE, SCHATTR_REGRESSION_TYPE);
ppPoolDefaults[SCHATTR_REGRESSION_SHOW_EQUATION - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SHOW_EQUATION, 0);
ppPoolDefaults[SCHATTR_REGRESSION_SHOW_COEFF - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SHOW_COEFF, 0);
@@ -197,8 +171,8 @@ ChartItemPool::ChartItemPool():
**************************************************************************/
pItemInfos = new SfxItemInfo[SCHATTR_END - SCHATTR_START + 1];
- const USHORT nMax = SCHATTR_END - SCHATTR_START + 1;
- for( USHORT i = 0; i < nMax; i++ )
+ sal_uInt16 i;
+ for( i = SCHATTR_START; i <= SCHATTR_END; i++ )
{
pItemInfos[i]._nSID = 0;
pItemInfos[i]._nFlags = SFX_ITEM_POOLABLE;
@@ -224,8 +198,8 @@ ChartItemPool::~ChartItemPool()
delete[] pItemInfos;
- const USHORT nMax = SCHATTR_END - SCHATTR_START + 1;
- for( USHORT i = 0; i < nMax; i++ )
+ const sal_uInt16 nMax = SCHATTR_END - SCHATTR_START + 1;
+ for( sal_uInt16 i=0; i<nMax; ++i )
{
SetRefCount(*ppPoolDefaults[i], 0);
delete ppPoolDefaults[i];
@@ -239,7 +213,7 @@ SfxItemPool* ChartItemPool::Clone() const
return new ChartItemPool(*this);
}
-SfxMapUnit ChartItemPool::GetMetric(USHORT /* nWhich */) const
+SfxMapUnit ChartItemPool::GetMetric(sal_uInt16 /* nWhich */) const
{
return SFX_MAPUNIT_100TH_MM;
}
diff --git a/chart2/source/view/main/ChartItemPool.hxx b/chart2/source/view/main/ChartItemPool.hxx
index 269bbfbff6be..cb13e29fe52a 100644
--- a/chart2/source/view/main/ChartItemPool.hxx
+++ b/chart2/source/view/main/ChartItemPool.hxx
@@ -47,7 +47,7 @@ protected:
public:
virtual SfxItemPool* Clone() const;
- SfxMapUnit GetMetric( USHORT nWhich ) const;
+ SfxMapUnit GetMetric( sal_uInt16 nWhich ) const;
/// creates a pure chart item pool
static SfxItemPool* CreateChartItemPool();
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 826210b9875a..ad7f4dfb7739 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -32,6 +32,7 @@
#include "ChartView.hxx"
#include "chartview/DrawModelWrapper.hxx"
+#include "NumberFormatterWrapper.hxx"
#include "ViewDefines.hxx"
#include "VDiagram.hxx"
#include "VTitle.hxx"
@@ -57,6 +58,7 @@
#include "ControllerLockGuard.hxx"
#include "BaseGFXHelper.hxx"
#include "DataSeriesHelper.hxx"
+#include "DateHelper.hxx"
#include <comphelper/scopeguard.hxx>
#include <boost/bind.hpp>
@@ -79,7 +81,6 @@
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
-#include <com/sun/star/chart2/ExplicitSubIncrement.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -201,7 +202,7 @@ void SAL_CALL ChartView::initialize( const uno::Sequence< uno::Any >& aArguments
m_pDrawModelWrapper = ::boost::shared_ptr< DrawModelWrapper >( new DrawModelWrapper( m_xCC ) );
m_xShapeFactory = m_pDrawModelWrapper->getShapeFactory();
m_xDrawPage = m_pDrawModelWrapper->getMainDrawPage();
- StartListening( m_pDrawModelWrapper->getSdrModel(), FALSE /*bPreventDups*/ );
+ StartListening( m_pDrawModelWrapper->getSdrModel(), false /*bPreventDups*/ );
}
}
@@ -209,7 +210,7 @@ ChartView::~ChartView()
{
if( m_pDrawModelWrapper.get() )
{
- EndListening( m_pDrawModelWrapper->getSdrModel(), FALSE /*bAllDups*/ );
+ EndListening( m_pDrawModelWrapper->getSdrModel(), false /*bAllDups*/ );
SolarMutexGuard aSolarGuard;
m_pDrawModelWrapper.reset();
}
@@ -470,7 +471,7 @@ private:
};
AxisUsage::AxisUsage()
- : aScaleAutomatism(AxisHelper::createDefaultScale())
+ : aScaleAutomatism(AxisHelper::createDefaultScale(),Date())
{
}
@@ -548,7 +549,7 @@ public:
~SeriesPlotterContainer();
void initializeCooSysAndSeriesPlotter( const uno::Reference< frame::XModel >& xChartModel );
- void initAxisUsageList();
+ void initAxisUsageList(const Date& rNullDate);
void doAutoScaling( const uno::Reference< frame::XModel >& xChartModel );
void updateScalesAndIncrementsOnAxes();
void setScalesFromCooSysToPlotter();
@@ -566,13 +567,15 @@ private:
std::vector< VCoordinateSystem* >& m_rVCooSysList;
::std::map< uno::Reference< XAxis >, AxisUsage > m_aAxisUsageList;
sal_Int32 m_nMaxAxisIndex;
- bool m_bChartTypeUsesShiftedXAxisTicksPerDefault;
+ bool m_bChartTypeUsesShiftedCategoryPositionPerDefault;
+ sal_Int32 m_nDefaultDateNumberFormat;
};
SeriesPlotterContainer::SeriesPlotterContainer( std::vector< VCoordinateSystem* >& rVCooSysList )
: m_rVCooSysList( rVCooSysList )
, m_nMaxAxisIndex(0)
- , m_bChartTypeUsesShiftedXAxisTicksPerDefault(false)
+ , m_bChartTypeUsesShiftedCategoryPositionPerDefault(false)
+ , m_nDefaultDateNumberFormat(0)
{
}
@@ -610,6 +613,10 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
return;
uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartModel, uno::UNO_QUERY );
+ uno::Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
+ if( xChartDoc.is() && xChartDoc->hasInternalDataProvider()
+ && DiagramHelper::isSupportingDateAxis( xDiagram ) )
+ m_nDefaultDateNumberFormat=DiagramHelper::getDateNumberFormat( xNumberFormatsSupplier );
sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
if(!nDimensionCount)
@@ -667,7 +674,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
uno::Reference< XChartType > xChartType( aChartTypeList[nT] );
if(nT==0)
- m_bChartTypeUsesShiftedXAxisTicksPerDefault = ChartTypeHelper::shiftTicksAtXAxisPerDefault( xChartType );
+ m_bChartTypeUsesShiftedCategoryPositionPerDefault = ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault( xChartType );
bool bExcludingPositioning = DiagramPositioningMode_EXCLUDING == DiagramHelper::getDiagramPositioningMode( xDiagram );
VSeriesPlotter* pPlotter = VSeriesPlotter::createSeriesPlotter( xChartType, nDimensionCount, bExcludingPositioning );
@@ -779,7 +786,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
}
}
-void SeriesPlotterContainer::initAxisUsageList()
+void SeriesPlotterContainer::initAxisUsageList(const Date& rNullDate)
{
m_aAxisUsageList.clear();
size_t nC;
@@ -789,8 +796,10 @@ void SeriesPlotterContainer::initAxisUsageList()
for(sal_Int32 nDimensionIndex=0; nDimensionIndex<3; nDimensionIndex++)
{
uno::Reference< XCoordinateSystem > xCooSys = pVCooSys->getModel();
- if( nDimensionIndex >= xCooSys->getDimension() )
+ sal_Int32 nDimensionCount = xCooSys->getDimension();
+ if( nDimensionIndex >= nDimensionCount )
continue;
+ bool bChartTypeAllowsDateAxis = ChartTypeHelper::isSupportingDateAxis( AxisHelper::getChartTypeByIndex( xCooSys, 0 ), nDimensionCount, nDimensionIndex );
const sal_Int32 nMaximumAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex);
for(sal_Int32 nAxisIndex=0; nAxisIndex<=nMaximumAxisIndex; ++nAxisIndex)
{
@@ -799,7 +808,20 @@ void SeriesPlotterContainer::initAxisUsageList()
if( xAxis.is())
{
if(m_aAxisUsageList.find(xAxis)==m_aAxisUsageList.end())
- m_aAxisUsageList[xAxis].aScaleAutomatism = ScaleAutomatism(xAxis->getScaleData());
+ {
+ chart2::ScaleData aSourceScale = xAxis->getScaleData();
+ ExplicitCategoriesProvider* pExplicitCategoriesProvider = pVCooSys->getExplicitCategoriesProvider();
+ if( nDimensionIndex==0 )
+ AxisHelper::checkDateAxis( aSourceScale, pExplicitCategoriesProvider, bChartTypeAllowsDateAxis );
+ if( (aSourceScale.AxisType == AxisType::CATEGORY && m_bChartTypeUsesShiftedCategoryPositionPerDefault)
+ || (aSourceScale.AxisType==AxisType::CATEGORY && pExplicitCategoriesProvider && pExplicitCategoriesProvider->hasComplexCategories() )
+ || aSourceScale.AxisType == AxisType::DATE
+ || aSourceScale.AxisType == AxisType::SERIES )
+ aSourceScale.ShiftedCategoryPosition = true;
+ else
+ aSourceScale.ShiftedCategoryPosition = false;
+ m_aAxisUsageList[xAxis].aScaleAutomatism = ScaleAutomatism(aSourceScale,rNullDate);
+ }
AxisUsage& rAxisUsage = m_aAxisUsageList[xAxis];
rAxisUsage.addCoordinateSystem(pVCooSys,nDimensionIndex,nAxisIndex);
}
@@ -872,6 +894,11 @@ void SeriesPlotterContainer::setNumberFormatsFromAxes()
{
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( lang::IndexOutOfBoundsException& e )
@@ -922,13 +949,7 @@ void SeriesPlotterContainer::doAutoScaling( const uno::Reference< frame::XModel
rAxisUsage.aScaleAutomatism.calculateExplicitScaleAndIncrement( aExplicitScale, aExplicitIncrement );
for( nC=0; nC < aVCooSysList_X.size(); nC++)
- {
- ExplicitCategoriesProvider* pExplicitCategoriesProvider = aVCooSysList_X[nC]->getExplicitCategoriesProvider();
-
- if( m_bChartTypeUsesShiftedXAxisTicksPerDefault || (aExplicitScale.AxisType==AxisType::CATEGORY && pExplicitCategoriesProvider && pExplicitCategoriesProvider->hasComplexCategories() ) )
- aExplicitIncrement.ShiftedPosition = true;
aVCooSysList_X[nC]->setExplicitScaleAndIncrement( 0, nAxisIndex, aExplicitScale, aExplicitIncrement );
- }
for( nC=0; nC < aVCooSysList_Z.size(); nC++)
aVCooSysList_Z[nC]->setExplicitScaleAndIncrement( 2, nAxisIndex, aExplicitScale, aExplicitIncrement );
}
@@ -1013,7 +1034,6 @@ void SeriesPlotterContainer::AdaptScaleOfYAxisWithoutAttachedSeries( const uno::
aExplicitScaleDest.Orientation = aExplicitScaleSource.Orientation;
aExplicitScaleDest.Scaling = aExplicitScaleSource.Scaling;
- aExplicitScaleDest.Breaks = aExplicitScaleSource.Breaks;
aExplicitScaleDest.AxisType = aExplicitScaleSource.AxisType;
aExplicitIncrementDest.BaseValue = aExplicitIncrementSource.BaseValue;
@@ -1051,7 +1071,7 @@ void SeriesPlotterContainer::AdaptScaleOfYAxisWithoutAttachedSeries( const uno::
bAutoMinorInterval = !( aScale.IncrementData.SubIncrements[0].IntervalCount.hasValue() );
if( bAutoMinorInterval )
{
- if( aExplicitIncrementDest.SubIncrements.getLength() && aExplicitIncrementSource.SubIncrements.getLength() )
+ if( !aExplicitIncrementDest.SubIncrements.empty() && !aExplicitIncrementSource.SubIncrements.empty() )
aExplicitIncrementDest.SubIncrements[0].IntervalCount =
aExplicitIncrementSource.SubIncrements[0].IntervalCount;
}
@@ -1366,7 +1386,8 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( SeriesPlotterContainer&
// - prepare list of all axis and how they are used
- rSeriesPlotterContainer.initAxisUsageList();
+ Date aNullDate = NumberFormatterWrapper( uno::Reference< util::XNumberFormatsSupplier >( m_xChartModel, uno::UNO_QUERY ) ).getNullDate();
+ rSeriesPlotterContainer.initAxisUsageList(aNullDate);
rSeriesPlotterContainer.doAutoScaling( m_xChartModel );
rSeriesPlotterContainer.setScalesFromCooSysToPlotter();
rSeriesPlotterContainer.setNumberFormatsFromAxes();
@@ -1629,6 +1650,31 @@ sal_Bool ChartView::getExplicitValuesForAxis(
{
rExplicitScale = pVCooSys->getExplicitScale(nDimensionIndex,nAxisIndex);
rExplicitIncrement = pVCooSys->getExplicitIncrement(nDimensionIndex,nAxisIndex);
+ if( rExplicitScale.ShiftedCategoryPosition )
+ {
+ //remove 'one' from max
+ if( rExplicitScale.AxisType == ::com::sun::star::chart2::AxisType::DATE )
+ {
+ Date aMaxDate(rExplicitScale.NullDate); aMaxDate += static_cast<long>(::rtl::math::approxFloor(rExplicitScale.Maximum));
+ //for explicit scales with shifted categories we need one interval more
+ switch( rExplicitScale.TimeResolution )
+ {
+ case ::com::sun::star::chart::TimeUnit::DAY:
+ aMaxDate--;break;
+ case ::com::sun::star::chart::TimeUnit::MONTH:
+ aMaxDate = DateHelper::GetDateSomeMonthsAway(aMaxDate,-1);
+ break;
+ case ::com::sun::star::chart::TimeUnit::YEAR:
+ aMaxDate = DateHelper::GetDateSomeYearsAway(aMaxDate,-1);
+ break;
+ }
+ rExplicitScale.Maximum = aMaxDate - rExplicitScale.NullDate;
+ }
+ else if( rExplicitScale.AxisType == ::com::sun::star::chart2::AxisType::CATEGORY )
+ rExplicitScale.Maximum -= 1.0;
+ else if( rExplicitScale.AxisType == ::com::sun::star::chart2::AxisType::SERIES )
+ rExplicitScale.Maximum -= 1.0;
+ }
return sal_True;
}
return sal_False;
@@ -1757,166 +1803,15 @@ bool lcl_getPropertySwapXAndYAxis( const uno::Reference< XDiagram >& xDiagram )
}
-sal_Int32 lcl_getExplicitNumberFormatKeyForAxis(
- const Reference< chart2::XAxis >& xAxis
- , const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
- , const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
- , bool bSearchForParallelAxisIfNothingIsFound )
-{
- sal_Int32 nNumberFormatKey(0);
- Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
- if( xProp.is() && !( xProp->getPropertyValue( C2U( "NumberFormat" ) ) >>= nNumberFormatKey ) )
- {
- bool bPercentFormatSet = false;
- //check wether we have a percent scale -> use percent format
- if( xNumberFormatsSupplier.is() )
- {
- ScaleData aData = xAxis->getScaleData();
- if( aData.AxisType==AxisType::PERCENT )
- {
- sal_Int32 nPercentFormat = ExplicitValueProvider::getPercentNumberFormat( xNumberFormatsSupplier );
- if( nPercentFormat != -1 )
- {
- nNumberFormatKey = nPercentFormat;
- bPercentFormatSet = true;
- }
- }
- }
-
- if( !bPercentFormatSet )
- {
- typedef ::std::map< sal_Int32, sal_Int32 > tNumberformatFrequency;
- tNumberformatFrequency aKeyMap;
-
- bool bNumberFormatKeyFoundViaAttachedData = false;
- sal_Int32 nAxisIndex = 0;
- sal_Int32 nDimensionIndex = 1;
-
- try
- {
- Reference< XChartTypeContainer > xCTCnt( xCorrespondingCoordinateSystem, uno::UNO_QUERY_THROW );
- if( xCTCnt.is() )
- {
- AxisHelper::getIndicesForAxis( xAxis, xCorrespondingCoordinateSystem, nDimensionIndex, nAxisIndex );
- ::rtl::OUString aRoleToMatch;
- if( nDimensionIndex == 0 )
- aRoleToMatch = C2U("values-x");
- Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes());
- for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
- {
- if( nDimensionIndex != 0 )
- aRoleToMatch = ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( aChartTypes[nCTIdx] );
- Reference< XDataSeriesContainer > xDSCnt( aChartTypes[nCTIdx], uno::UNO_QUERY_THROW );
- Sequence< Reference< XDataSeries > > aDataSeriesSeq( xDSCnt->getDataSeries());
- for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aDataSeriesSeq.getLength(); ++nSeriesIdx )
- {
- Reference< chart2::XDataSeries > xDataSeries(aDataSeriesSeq[nSeriesIdx]);
- 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);
- if( nAttachedAxisIndex != nAxisIndex )
- continue;
- }
-
- Sequence< Reference< data::XLabeledDataSequence > > aLabeledSeq( xSource->getDataSequences());
- for( sal_Int32 nLSeqIdx=0; nLSeqIdx<aLabeledSeq.getLength(); ++nLSeqIdx )
- {
- if(!aLabeledSeq[nLSeqIdx].is())
- continue;
- Reference< data::XDataSequence > xSeq( aLabeledSeq[nLSeqIdx]->getValues());
- if(!xSeq.is())
- continue;
- Reference< beans::XPropertySet > xSeqProp( xSeq, uno::UNO_QUERY );
- ::rtl::OUString aRole;
- bool bTakeIntoAccount =
- ( xSeqProp.is() && (aRoleToMatch.getLength() > 0) &&
- (xSeqProp->getPropertyValue(C2U("Role")) >>= aRole ) &&
- aRole.equals( aRoleToMatch ));
-
- if( bTakeIntoAccount )
- {
- sal_Int32 nKey = xSeq->getNumberFormatKeyByIndex( -1 );
- // initialize the value
- if( aKeyMap.find( nKey ) == aKeyMap.end())
- aKeyMap[ nKey ] = 0;
- // increase frequency
- aKeyMap[ nKey ] = (aKeyMap[ nKey ] + 1);
- }
- }
- }
- }
- }
- }
- catch( const uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
-
- if( ! aKeyMap.empty())
- {
- sal_Int32 nMaxFreq = 0;
- // find most frequent key
- for( tNumberformatFrequency::const_iterator aIt = aKeyMap.begin();
- aIt != aKeyMap.end(); ++aIt )
- {
- OSL_TRACE( "NumberFormatKey %d appears %d times", (*aIt).first, (*aIt).second );
- // all values must at least be 1
- if( (*aIt).second > nMaxFreq )
- {
- nNumberFormatKey = (*aIt).first;
- bNumberFormatKeyFoundViaAttachedData = true;
- nMaxFreq = (*aIt).second;
- }
- }
- }
-
- if( bSearchForParallelAxisIfNothingIsFound )
- {
- //no format is set to this axis and no data is set to this axis
- //--> try to obtain the format from the parallel y-axis
- if( !bNumberFormatKeyFoundViaAttachedData && nDimensionIndex == 1 )
- {
- sal_Int32 nParallelAxisIndex = (nAxisIndex==1) ?0 :1;
- Reference< XAxis > xParallelAxis( AxisHelper::getAxis( 1, nParallelAxisIndex, xCorrespondingCoordinateSystem ) );
- nNumberFormatKey = lcl_getExplicitNumberFormatKeyForAxis( xParallelAxis, xCorrespondingCoordinateSystem, xNumberFormatsSupplier, false );
- }
- }
- }
- }
- return nNumberFormatKey;
-}
-
sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
const Reference< chart2::XAxis >& xAxis
, const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
, const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
{
- return lcl_getExplicitNumberFormatKeyForAxis( xAxis, xCorrespondingCoordinateSystem, xNumberFormatsSupplier
+ return AxisHelper::getExplicitNumberFormatKeyForAxis( xAxis, xCorrespondingCoordinateSystem, xNumberFormatsSupplier
, true /*bSearchForParallelAxisIfNothingIsFound*/ );
}
-sal_Int32 ExplicitValueProvider::getPercentNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
-{
- sal_Int32 nRet=-1;
- Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
- if( xNumberFormats.is() )
- {
- sal_Bool bCreate = sal_True;
- const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
- Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::PERCENT,
- rLocaleDataWrapper.getLocale(), bCreate );
- if( aKeySeq.getLength() )
- {
- nRet = aKeySeq[0];
- }
- }
- return nRet;
-}
-
-
sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
const uno::Reference< beans::XPropertySet >& xSeriesOrPointProp,
const uno::Reference< XDataSeries >& xSeries,
@@ -1969,7 +1864,7 @@ sal_Int32 ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabe
return nFormat;
if( !(xSeriesOrPointProp->getPropertyValue(C2U( "PercentageNumberFormat" )) >>= nFormat) )
{
- nFormat = ExplicitValueProvider::getPercentNumberFormat( xNumberFormatsSupplier );
+ nFormat = DiagramHelper::getPercentNumberFormat( xNumberFormatsSupplier );
}
if(nFormat<0)
nFormat=0;
@@ -2544,7 +2439,7 @@ void ChartView::createShapes()
{
SolarMutexGuard aSolarGuard;
// #i12587# support for shapes in chart
- m_pDrawModelWrapper->getSdrModel().EnableUndo( FALSE );
+ m_pDrawModelWrapper->getSdrModel().EnableUndo( sal_False );
m_pDrawModelWrapper->clearMainDrawPage();
}
@@ -2707,7 +2602,7 @@ void ChartView::createShapes()
if ( m_pDrawModelWrapper )
{
SolarMutexGuard aSolarGuard;
- m_pDrawModelWrapper->getSdrModel().EnableUndo( TRUE );
+ m_pDrawModelWrapper->getSdrModel().EnableUndo( true );
}
#if OSL_DEBUG_LEVEL > 0
diff --git a/chart2/source/view/main/ChartView.hxx b/chart2/source/view/main/ChartView.hxx
index 94f65dc2d526..a7aec605e89b 100644
--- a/chart2/source/view/main/ChartView.hxx
+++ b/chart2/source/view/main/ChartView.hxx
@@ -104,8 +104,8 @@ public:
// ___ExplicitValueProvider___
virtual sal_Bool getExplicitValuesForAxis(
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis > xAxis
- , ::com::sun::star::chart2::ExplicitScaleData& rExplicitScale
- , ::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement );
+ , ExplicitScaleData& rExplicitScale
+ , ExplicitIncrementData& rExplicitIncrement );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
getShapeForCID( const rtl::OUString& rObjectCID );
diff --git a/chart2/source/view/main/Clipping.cxx b/chart2/source/view/main/Clipping.cxx
index d13a6fd13faf..c44bea326173 100644
--- a/chart2/source/view/main/Clipping.cxx
+++ b/chart2/source/view/main/Clipping.cxx
@@ -87,7 +87,7 @@ bool lcl_CLIPt(double fDenom,double fNum, double & fTE, double & fTL)
}
/** @descr The line given by it's two endpoints rP0 and rP1 is clipped at the rectangle
- rRectangle. If there is at least a part of it visible then TRUE is returned and
+ rRectangle. If there is at least a part of it visible then sal_True is returned and
the endpoints of that part are stored in rP0 and rP1. The points rP0 and rP1
may have the same coordinates.
@param rP0 Start point of the line to clip. Modified to contain a start point inside
@@ -96,7 +96,7 @@ bool lcl_CLIPt(double fDenom,double fNum, double & fTE, double & fTL)
the clipping area if possible.
@param rRectangle Clipping area.
@return If the line lies completely or partly inside the clipping area then TRUE
- is returned. If the line lies completely outside then FALSE is returned and rP0 and
+ is returned. If the line lies completely outside then sal_False is returned and rP0 and
rP1 are left unmodified.
*/
bool lcl_clip2d(B2DTuple& rPoint0, B2DTuple& rPoint1, const B2DRectangle& rRectangle)
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index 745996dc85e5..938ba9ea9758 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -136,7 +136,7 @@ DrawModelWrapper::DrawModelWrapper(
SfxItemPool* pMasterPool = &GetItemPool();
pMasterPool->SetDefaultMetric(SFX_MAPUNIT_100TH_MM);
- pMasterPool->SetPoolDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE, TRUE) );
+ pMasterPool->SetPoolDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE, sal_True) );
pMasterPool->SetPoolDefaultItem(Svx3DPercentDiagonalItem (5));
SfxItemPool* pPool = pMasterPool;
@@ -375,8 +375,8 @@ SdrObject* DrawModelWrapper::getNamedSdrObject( const String& rObjectCID, SdrObj
{
if(!pSearchList || rObjectCID.Len()==0)
return 0;
- ULONG nCount = pSearchList->GetObjCount();
- for( ULONG nN=0; nN<nCount; nN++ )
+ sal_uLong nCount = pSearchList->GetObjCount();
+ for( sal_uLong nN=0; nN<nCount; nN++ )
{
SdrObject* pObj = pSearchList->GetObj(nN);
if(!pObj)
diff --git a/chart2/source/view/main/PlotterBase.cxx b/chart2/source/view/main/PlotterBase.cxx
index 3dab3c42c4be..9973c50d3bed 100644
--- a/chart2/source/view/main/PlotterBase.cxx
+++ b/chart2/source/view/main/PlotterBase.cxx
@@ -57,8 +57,7 @@ PlotterBase::PlotterBase( sal_Int32 nDimensionCount )
{
}
- void SAL_CALL PlotterBase
-::initPlotter( const uno::Reference< drawing::XShapes >& xLogicTarget
+void PlotterBase::initPlotter( const uno::Reference< drawing::XShapes >& xLogicTarget
, const uno::Reference< drawing::XShapes >& xFinalTarget
, const uno::Reference< lang::XMultiServiceFactory >& xShapeFactory
, const rtl::OUString& rCID )
@@ -78,11 +77,9 @@ PlotterBase::~PlotterBase()
delete m_pShapeFactory;
}
-void SAL_CALL PlotterBase::setScales( const uno::Sequence< ExplicitScaleData >& rScales
- , sal_Bool bSwapXAndYAxis )
- throw (uno::RuntimeException)
+void PlotterBase::setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis )
{
- DBG_ASSERT(m_nDimension<=rScales.getLength(),"Dimension of Plotter does not fit two dimension of given scale sequence");
+ DBG_ASSERT(m_nDimension<=static_cast<sal_Int32>(rScales.size()),"Dimension of Plotter does not fit two dimension of given scale sequence");
m_pPosHelper->setScales( rScales, bSwapXAndYAxis );
}
diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx
index 31749a0d9824..7a9dede36f09 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -33,12 +33,14 @@
#include "ViewDefines.hxx"
#include "Linear3DTransformation.hxx"
#include "VPolarTransformation.hxx"
-
#include "ShapeFactory.hxx"
#include "PropertyMapper.hxx"
+#include "DateHelper.hxx"
+
+#include <com/sun/star/chart/TimeUnit.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/drawing/DoubleSequence.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
-#include <com/sun/star/chart2/AxisType.hpp>
#include <rtl/math.hxx>
@@ -58,6 +60,12 @@ PlottingPositionHelper::PlottingPositionHelper()
, m_nYResolution( 1000 )
, m_nZResolution( 1000 )
, m_bMaySkipPointsInRegressionCalculation( true )
+ , m_bDateAxis(false)
+ , m_nTimeResolution( ::com::sun::star::chart::TimeUnit::DAY )
+ , m_aNullDate(30,12,1899)
+ , m_fScaledCategoryWidth(1.0)
+ , m_bAllowShiftXAxisPos(false)
+ , m_bAllowShiftZAxisPos(false)
{
}
PlottingPositionHelper::PlottingPositionHelper( const PlottingPositionHelper& rSource )
@@ -69,6 +77,12 @@ PlottingPositionHelper::PlottingPositionHelper( const PlottingPositionHelper& rS
, m_nYResolution( rSource.m_nYResolution )
, m_nZResolution( rSource.m_nZResolution )
, m_bMaySkipPointsInRegressionCalculation( rSource.m_bMaySkipPointsInRegressionCalculation )
+ , m_bDateAxis( rSource.m_bDateAxis )
+ , m_nTimeResolution( rSource.m_nTimeResolution )
+ , m_aNullDate( rSource.m_aNullDate )
+ , m_fScaledCategoryWidth( rSource.m_fScaledCategoryWidth )
+ , m_bAllowShiftXAxisPos( rSource.m_bAllowShiftXAxisPos )
+ , m_bAllowShiftZAxisPos( rSource.m_bAllowShiftZAxisPos )
{
}
@@ -96,13 +110,13 @@ void PlottingPositionHelper::setTransformationSceneToScreen( const drawing::Homo
m_xTransformationLogicToScene = NULL;
}
-void PlottingPositionHelper::setScales( const uno::Sequence< ExplicitScaleData >& rScales, sal_Bool bSwapXAndYAxis )
+void PlottingPositionHelper::setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis )
{
m_aScales = rScales;
m_bSwapXAndY = bSwapXAndYAxis;
m_xTransformationLogicToScene = NULL;
}
-const uno::Sequence< ExplicitScaleData >& PlottingPositionHelper::getScales() const
+const std::vector< ExplicitScaleData >& PlottingPositionHelper::getScales() const
{
return m_aScales;
}
@@ -130,8 +144,8 @@ uno::Reference< XTransformation > PlottingPositionHelper::getTransformationScale
AxisOrientation nZAxisOrientation = m_aScales[2].Orientation;
//apply scaling
- doLogicScaling( &MinX, &MinY, &MinZ );
- doLogicScaling( &MaxX, &MaxY, &MaxZ);
+ doUnshiftedLogicScaling( &MinX, &MinY, &MinZ );
+ doUnshiftedLogicScaling( &MaxX, &MaxY, &MaxZ);
if(m_bSwapXAndY)
{
@@ -177,9 +191,9 @@ uno::Reference< XTransformation > PlottingPositionHelper::getTransformationScale
drawing::Position3D PlottingPositionHelper::transformLogicToScene(
double fX, double fY, double fZ, bool bClip ) const
{
- if(bClip)
- this->clipLogicValues( &fX,&fY,&fZ );
this->doLogicScaling( &fX,&fY,&fZ );
+ if(bClip)
+ this->clipScaledLogicValues( &fX,&fY,&fZ );
return this->transformScaledLogicToScene( fX, fY, fZ, false );
}
@@ -255,8 +269,8 @@ void PlottingPositionHelper::clipScaledLogicValues( double* pX, double* pY, doub
double MaxZ = getLogicMaxZ();
//apply scaling
- doLogicScaling( &MinX, &MinY, &MinZ );
- doLogicScaling( &MaxX, &MaxY, &MaxZ);
+ doUnshiftedLogicScaling( &MinX, &MinY, &MinZ );
+ doUnshiftedLogicScaling( &MaxX, &MaxY, &MaxZ);
if(pX)
{
@@ -292,8 +306,8 @@ basegfx::B2DRectangle PlottingPositionHelper::getScaledLogicClipDoubleRect() con
double MaxZ = getLogicMaxZ();
//apply scaling
- doLogicScaling( &MinX, &MinY, &MinZ );
- doLogicScaling( &MaxX, &MaxY, &MaxZ);
+ doUnshiftedLogicScaling( &MinX, &MinY, &MinZ );
+ doUnshiftedLogicScaling( &MaxX, &MaxY, &MaxZ);
basegfx::B2DRectangle aRet( MinX, MaxY, MaxX, MinY );
return aRet;
@@ -356,7 +370,7 @@ void PolarPlottingPositionHelper::setTransformationSceneToScreen( const drawing:
PlottingPositionHelper::setTransformationSceneToScreen( rMatrix);
m_aUnitCartesianToScene =impl_calculateMatrixUnitCartesianToScene( m_aMatrixScreenToScene );
}
-void PolarPlottingPositionHelper::setScales( const uno::Sequence< ExplicitScaleData >& rScales, sal_Bool bSwapXAndYAxis )
+void PolarPlottingPositionHelper::setScales( const std::vector< ExplicitScaleData >& rScales, bool bSwapXAndYAxis )
{
PlottingPositionHelper::setScales( rScales, bSwapXAndYAxis );
m_aUnitCartesianToScene =impl_calculateMatrixUnitCartesianToScene( m_aMatrixScreenToScene );
@@ -366,7 +380,7 @@ void PolarPlottingPositionHelper::setScales( const uno::Sequence< ExplicitScaleD
{
::basegfx::B3DHomMatrix aRet;
- if( !m_aScales.getLength() )
+ if( m_aScales.empty() )
return aRet;
double fTranslate =1.0;
@@ -630,8 +644,41 @@ double PlottingPositionHelper::getBaseValueY() const
return m_aScales[1].Origin;
}
-//.............................................................................
-} //namespace chart
-//.............................................................................
+void PlottingPositionHelper::setTimeResolution( long nTimeResolution, const Date& rNullDate )
+{
+ m_nTimeResolution = nTimeResolution;
+ m_aNullDate = rNullDate;
+
+ //adapt category width
+ double fCategoryWidth = 1.0;
+ if( !m_aScales.empty() )
+ {
+ if( m_aScales[0].AxisType == ::com::sun::star::chart2::AxisType::DATE )
+ {
+ m_bDateAxis = true;
+ if( nTimeResolution == ::com::sun::star::chart::TimeUnit::YEAR )
+ {
+ const double fMonthCount = 12.0;//todo: this depends on the DateScaling and must be adjusted in case we use more generic calendars in future
+ fCategoryWidth = fMonthCount;
+ }
+ }
+ }
+ setScaledCategoryWidth(fCategoryWidth);
+}
+
+void PlottingPositionHelper::setScaledCategoryWidth( double fScaledCategoryWidth )
+{
+ m_fScaledCategoryWidth = fScaledCategoryWidth;
+}
+void PlottingPositionHelper::AllowShiftXAxisPos( bool bAllowShift )
+{
+ m_bAllowShiftXAxisPos = bAllowShift;
+}
+void PlottingPositionHelper::AllowShiftZAxisPos( bool bAllowShift )
+{
+ m_bAllowShiftZAxisPos = bAllowShift;
+}
+
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index eea8c813b360..e0002ae641fa 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -352,6 +352,22 @@ void VDataSeries::setCategoryXAxis()
m_bAllowPercentValueInDataLabel = true;
}
+void VDataSeries::setXValues( const Reference< chart2::data::XDataSequence >& xValues )
+{
+ m_aValues_X.clear();
+ m_aValues_X.init( xValues );
+ m_bAllowPercentValueInDataLabel = true;
+}
+
+void VDataSeries::setXValuesIfNone( const Reference< chart2::data::XDataSequence >& xValues )
+{
+ if( m_aValues_X.is() )
+ return;
+
+ m_aValues_X.init( xValues );
+ lcl_clearIfNoValuesButTextIsContained( m_aValues_X, xValues );
+}
+
void VDataSeries::setGlobalSeriesIndex( sal_Int32 nGlobalSeriesIndex )
{
m_nGlobalSeriesIndex = nGlobalSeriesIndex;
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index 48397464676f..2e9370cc91a7 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -37,13 +37,14 @@
#include "ShapeFactory.hxx"
#include "RelativeSizeHelper.hxx"
#include "LegendEntryProvider.hxx"
+#include "chartview/DrawModelWrapper.hxx"
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/drawing/LineJoint.hpp>
-#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart/ChartLegendExpansion.hpp>
#include <com/sun/star/chart2/LegendPosition.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <rtl/ustrbuf.hxx>
@@ -105,7 +106,6 @@ void lcl_getProperties(
const Reference< beans::XPropertySet > & xLegendProp,
tPropertyValues & rOutLineFillProperties,
tPropertyValues & rOutTextProperties,
- sal_Int32 nMaxLabelWidth,
const awt::Size & rReferenceSize )
{
// Get Line- and FillProperties from model legend
@@ -128,7 +128,7 @@ void lcl_getProperties(
aTextValueMap[ C2U("TextAutoGrowHeight") ] = uno::makeAny( sal_True );
aTextValueMap[ C2U("TextAutoGrowWidth") ] = uno::makeAny( sal_True );
aTextValueMap[ C2U("TextHorizontalAdjust") ] = uno::makeAny( eHorizAdjust );
- aTextValueMap[ C2U("TextMaximumFrameWidth") ] = uno::makeAny( nMaxLabelWidth );
+ aTextValueMap[ C2U("TextMaximumFrameWidth") ] = uno::makeAny( rReferenceSize.Width ); //needs to be overwritten by actual available space in the legend
// recalculate font size
awt::Size aPropRefSize;
@@ -175,16 +175,10 @@ awt::Size lcl_createTextShapes(
try
{
// create label shape
- Reference< drawing::XShape > xGroupShapeForSingleEntry(
- xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.GroupShape" )), uno::UNO_QUERY_THROW );
- Reference< drawing::XShape >xEntry(
+ Reference< drawing::XShape > xEntry(
xShapeFactory->createInstance(
C2U( "com.sun.star.drawing.TextShape" )), uno::UNO_QUERY_THROW );
- xTarget->add( xGroupShapeForSingleEntry );
-
- Reference< drawing::XShapes > xGroup( xGroupShapeForSingleEntry, uno::UNO_QUERY_THROW );
- xGroup->add( xEntry );
+ xTarget->add( xEntry );
// set label text
Sequence< Reference< XFormattedString > > aLabelSeq = (*aIt).aLabel;
@@ -212,7 +206,7 @@ awt::Size lcl_createTextShapes(
aResult.Height = ::std::max( aResult.Height, aCurrSize.Height );
}
- rOutTextShapes.push_back( xGroupShapeForSingleEntry );
+ rOutTextShapes.push_back( xEntry );
}
catch( uno::Exception & ex )
{
@@ -223,57 +217,272 @@ awt::Size lcl_createTextShapes(
return aResult;
}
+void lcl_collectColumnWidths( std::vector< sal_Int32 >& rColumnWidths, const sal_Int32 nNumberOfRows, const sal_Int32 nNumberOfColumns
+ , const ::std::vector< Reference< drawing::XShape > > aTextShapes, sal_Int32 nSymbolPlusDistanceWidth )
+{
+ rColumnWidths.clear();
+ sal_Int32 nRow = 0;
+ sal_Int32 nColumn = 0;
+ sal_Int32 nNumberOfEntries = aTextShapes.size();
+ for( ; nRow < nNumberOfRows; ++nRow )
+ {
+ for( nColumn = 0; nColumn < nNumberOfColumns; ++nColumn )
+ {
+ sal_Int32 nEntry = (nColumn + nRow * nNumberOfColumns);
+ if( nEntry < nNumberOfEntries )
+ {
+ awt::Size aTextSize( aTextShapes[ nEntry ]->getSize() );
+ sal_Int32 nWidth = nSymbolPlusDistanceWidth + aTextSize.Width;
+ if( nRow==0 )
+ rColumnWidths.push_back( nWidth );
+ else
+ rColumnWidths[nColumn] = ::std::max( nWidth, rColumnWidths[nColumn] );
+ }
+ }
+ }
+}
-void lcl_placeLegendEntries(
- const tViewLegendEntryContainer & rEntries,
- LegendExpansion eExpansion,
+void lcl_collectRowHeighs( std::vector< sal_Int32 >& rRowHeights, const sal_Int32 nNumberOfRows, const sal_Int32 nNumberOfColumns
+ , const ::std::vector< Reference< drawing::XShape > > aTextShapes )
+{
+ // calculate maximum height for each row
+ // and collect column widths
+ rRowHeights.clear();
+ sal_Int32 nRow = 0;
+ sal_Int32 nColumn = 0;
+ sal_Int32 nNumberOfEntries = aTextShapes.size();
+ for( ; nRow < nNumberOfRows; ++nRow )
+ {
+ sal_Int32 nCurrentRowHeight = 0;
+ for( nColumn = 0; nColumn < nNumberOfColumns; ++nColumn )
+ {
+ sal_Int32 nEntry = (nColumn + nRow * nNumberOfColumns);
+ if( nEntry < nNumberOfEntries )
+ {
+ awt::Size aTextSize( aTextShapes[ nEntry ]->getSize() );
+ nCurrentRowHeight = ::std::max( nCurrentRowHeight, aTextSize.Height );
+ }
+ }
+ rRowHeights.push_back( nCurrentRowHeight );
+ }
+}
+
+sal_Int32 lcl_getTextLineHeight( const std::vector< sal_Int32 >& aRowHeights, const sal_Int32 nNumberOfRows, double fViewFontSize )
+{
+ const sal_Int32 nFontHeight = static_cast< sal_Int32 >( fViewFontSize );
+ sal_Int32 nTextLineHeight = nFontHeight;
+ for( sal_Int32 nR=0; nR<nNumberOfRows; nR++ )
+ {
+ sal_Int32 nFullTextHeight = aRowHeights[ nR ];
+ if( ( nFullTextHeight / nFontHeight ) <= 1 )
+ {
+ nTextLineHeight = nFullTextHeight;//found an entry with one line-> have real text height
+ break;
+ }
+ }
+ return nTextLineHeight;
+}
+
+//returns resulting legend size
+awt::Size lcl_placeLegendEntries(
+ tViewLegendEntryContainer & rEntries,
+ ::com::sun::star::chart::ChartLegendExpansion eExpansion,
bool bSymbolsLeftSide,
- const Reference< beans::XPropertySet > & xProperties,
+ double fViewFontSize,
+ const awt::Size& rMaxSymbolExtent,
tPropertyValues & rTextProperties,
const Reference< drawing::XShapes > & xTarget,
const Reference< lang::XMultiServiceFactory > & xShapeFactory,
- const Reference< uno::XComponentContext > & /* xContext */,
- const awt::Size & rAvailableSpace,
- const awt::Size & rPageSize,
- awt::Size & rOutLegendSize )
+ const awt::Size & rAvailableSpace )
{
- double fViewFontSize = lcl_CalcViewFontSize( xProperties, rPageSize );
+ bool bIsCustomSize = (eExpansion == ::com::sun::star::chart::ChartLegendExpansion_CUSTOM);
+ awt::Size aResultingLegendSize(0,0);
+ if( bIsCustomSize )
+ aResultingLegendSize = rAvailableSpace;
- // padding as percentage of the font height
// #i109336# Improve auto positioning in chart
- double fXPadding = 0.1;
- double fYPadding = 0.2;
- double fXOffset = 0.15;
- double fYOffset = 0.15;
-
- const sal_Int32 nXPadding = static_cast< sal_Int32 >( fViewFontSize * fXPadding );
- const sal_Int32 nYPadding = static_cast< sal_Int32 >( fViewFontSize * fYPadding );
- const sal_Int32 nXOffset = static_cast< sal_Int32 >( fViewFontSize * fXOffset );
- const sal_Int32 nYOffset = static_cast< sal_Int32 >( fViewFontSize * fYOffset );
+ sal_Int32 nXPadding = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.33 ) );
+ //sal_Int32 nXPadding = static_cast< sal_Int32 >( std::max( 200.0, fViewFontSize * 0.33 ) );
+ sal_Int32 nXOffset = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.66 ) );
+ sal_Int32 nYPadding = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.2 ) );
+ sal_Int32 nYOffset = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.2 ) );
+ //sal_Int32 nYOffset = static_cast< sal_Int32 >( std::max( 230.0, fViewFontSize * 0.45 ) );
+
+ const sal_Int32 nSymbolToTextDistance = static_cast< sal_Int32 >( std::max( 100.0, fViewFontSize * 0.22 ) );//minimum 1mm
+ const sal_Int32 nSymbolPlusDistanceWidth = rMaxSymbolExtent.Width + nSymbolToTextDistance;
+ sal_Int32 nMaxTextWidth = rAvailableSpace.Width - (2 * nXPadding) - nSymbolPlusDistanceWidth;
+ rtl::OUString aPropNameTextMaximumFrameWidth( C2U("TextMaximumFrameWidth") );
+ uno::Any* pFrameWidthAny = PropertyMapper::getValuePointer( rTextProperties.second, rTextProperties.first, aPropNameTextMaximumFrameWidth);
+ if(pFrameWidthAny)
+ {
+ if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_HIGH )
+ {
+ // limit the width of texts to 30% of the total available width
+ // #i109336# Improve auto positioning in chart
+ nMaxTextWidth = rAvailableSpace.Width * 3 / 10;
+ }
+ *pFrameWidthAny = uno::makeAny(nMaxTextWidth);
+ }
::std::vector< Reference< drawing::XShape > > aTextShapes;
- awt::Size aMaxEntryExtent = lcl_createTextShapes(
- rEntries, xShapeFactory, xTarget, aTextShapes, rTextProperties );
+ awt::Size aMaxEntryExtent = lcl_createTextShapes( rEntries, xShapeFactory, xTarget, aTextShapes, rTextProperties );
OSL_ASSERT( aTextShapes.size() == rEntries.size());
- // #i109336# Improve auto positioning in chart
- double fSymbolSizeFraction = 0.8;
- awt::Size aMaxSymbolExtent( static_cast< sal_Int32 >( fViewFontSize * fSymbolSizeFraction * 3.0 / 2.0 ),
- static_cast< sal_Int32 >( fViewFontSize * fSymbolSizeFraction ) );
-
- sal_Int32 nCurrentXPos = nXPadding;
- sal_Int32 nCurrentYPos = nYPadding;
- sal_Int32 nMaxEntryWidth = 2 * nXOffset + aMaxSymbolExtent.Width + aMaxEntryExtent.Width;
+ sal_Int32 nMaxEntryWidth = nXOffset + nSymbolPlusDistanceWidth + aMaxEntryExtent.Width;
sal_Int32 nMaxEntryHeight = nYOffset + aMaxEntryExtent.Height;
sal_Int32 nNumberOfEntries = rEntries.size();
- if( !bSymbolsLeftSide )
- nCurrentXPos = -nXPadding;
-
sal_Int32 nNumberOfColumns = 0, nNumberOfRows = 0;
+ std::vector< sal_Int32 > aColumnWidths;
+ std::vector< sal_Int32 > aRowHeights;
+
+ sal_Int32 nTextLineHeight = static_cast< sal_Int32 >( fViewFontSize );
// determine layout depending on LegendExpansion
- if( eExpansion == LegendExpansion_HIGH )
+ if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_CUSTOM )
+ {
+ sal_Int32 nCurrentRow=0;
+ sal_Int32 nCurrentColumn=-1;
+ sal_Int32 nColumnCount=0;
+ sal_Int32 nMaxColumnCount=-1;
+ for( sal_Int32 nN=0; nN<static_cast<sal_Int32>(aTextShapes.size()); nN++ )
+ {
+ Reference< drawing::XShape > xShape( aTextShapes[nN] );
+ if( !xShape.is() )
+ continue;
+ awt::Size aSize( xShape->getSize() );
+ sal_Int32 nNewWidth = aSize.Width + nSymbolPlusDistanceWidth;
+ sal_Int32 nCurrentColumnCount = aColumnWidths.size();
+
+ //are we allowed to add a new column?
+ if( nMaxColumnCount==-1 || (nCurrentColumn+1) < nMaxColumnCount )
+ {
+ //try add a new column
+ nCurrentColumn++;
+ if( nCurrentColumn < nCurrentColumnCount )
+ {
+ //check wether the current column width is sufficient for the new entry
+ if( aColumnWidths[nCurrentColumn]>=nNewWidth )
+ {
+ //all good proceed with next entry
+ continue;
+ }
+ }
+ if( nCurrentColumn < nCurrentColumnCount )
+ aColumnWidths[nCurrentColumn] = std::max( nNewWidth, aColumnWidths[nCurrentColumn] );
+ else
+ aColumnWidths.push_back(nNewWidth);
+
+ //do the columns still fit into the given size?
+ nCurrentColumnCount = aColumnWidths.size();//update count
+ sal_Int32 nSumWidth = 0;
+ for( sal_Int32 nC=0; nC<nCurrentColumnCount; nC++ )
+ nSumWidth += aColumnWidths[nC];
+
+ if( nSumWidth <= rAvailableSpace.Width || nCurrentColumnCount==1 )
+ {
+ //all good proceed with next entry
+ continue;
+ }
+ else
+ {
+ //not enough space for the current amount of columns
+ //try again with less columns
+ nMaxColumnCount = nCurrentColumnCount-1;
+ nN=-1;
+ nCurrentRow=0;
+ nCurrentColumn=-1;
+ nColumnCount=0;
+ aColumnWidths.clear();
+ }
+ }
+ else
+ {
+ //add a new row and try the same entry again
+ nCurrentRow++;
+ nCurrentColumn=-1;
+ nN--;
+ }
+ }
+ nNumberOfColumns = aColumnWidths.size();
+ nNumberOfRows = nCurrentRow+1;
+
+ //check if there is not enough space so that some entries must be removed
+ lcl_collectRowHeighs( aRowHeights, nNumberOfRows, nNumberOfColumns, aTextShapes );
+ nTextLineHeight = lcl_getTextLineHeight( aRowHeights, nNumberOfRows, fViewFontSize );
+ sal_Int32 nSumHeight = 0;
+ for( sal_Int32 nR=0; nR<nNumberOfRows; nR++ )
+ nSumHeight += aRowHeights[nR];
+ sal_Int32 nRemainingSpace = rAvailableSpace.Height - nSumHeight;
+
+ if( nRemainingSpace<0 )
+ {
+ //remove entries that are too big
+ for( sal_Int32 nR=nNumberOfRows; nR--; )
+ {
+ for( sal_Int32 nC=nNumberOfColumns; nC--; )
+ {
+ sal_Int32 nEntry = (nC + nR * nNumberOfColumns);
+ if( nEntry < static_cast<sal_Int32>(aTextShapes.size()) )
+ {
+ DrawModelWrapper::removeShape( aTextShapes[nEntry] );
+ aTextShapes.pop_back();
+ }
+ if( nEntry < nNumberOfEntries )
+ {
+ DrawModelWrapper::removeShape( rEntries[ nEntry ].aSymbol );
+ rEntries.pop_back();
+ nNumberOfEntries--;
+ }
+ }
+ nSumHeight -= aRowHeights[nR];
+ aRowHeights.pop_back();
+ nRemainingSpace = rAvailableSpace.Height - nSumHeight;
+ if( nRemainingSpace>=0 )
+ break;
+ }
+ nNumberOfRows = static_cast<sal_Int32>(aRowHeights.size());
+ }
+ if( nRemainingSpace > 0 )
+ {
+ sal_Int32 nNormalSpacingHeight = 2*nYPadding+(nNumberOfRows-1)*nYOffset;
+ if( nRemainingSpace < nNormalSpacingHeight )
+ {
+ //reduce spacing between the entries
+ nYPadding = nYOffset = nRemainingSpace/(nNumberOfRows+1);
+ }
+ else
+ {
+ //we have some space left that should be spread equally between all rows
+ sal_Int32 nRemainingSingleSpace = (nRemainingSpace-nNormalSpacingHeight)/(nNumberOfRows+1);
+ nYPadding += nRemainingSingleSpace;
+ nYOffset += nRemainingSingleSpace;
+ }
+ }
+
+ //check spacing between columns
+ sal_Int32 nSumWidth = 0;
+ for( sal_Int32 nC=0; nC<nNumberOfColumns; nC++ )
+ nSumWidth += aColumnWidths[nC];
+ nRemainingSpace = rAvailableSpace.Width - nSumWidth;
+ if( nRemainingSpace>=0 )
+ {
+ sal_Int32 nNormalSpacingWidth = 2*nXPadding+(nNumberOfColumns-1)*nXOffset;
+ if( nRemainingSpace < nNormalSpacingWidth )
+ {
+ //reduce spacing between the entries
+ nXPadding = nXOffset = nRemainingSpace/(nNumberOfColumns+1);
+ }
+ else
+ {
+ //we have some space left that should be spread equally between all columns
+ sal_Int32 nRemainingSingleSpace = (nRemainingSpace-nNormalSpacingWidth)/(nNumberOfColumns+1);
+ nXPadding += nRemainingSingleSpace;
+ nXOffset += nRemainingSingleSpace;
+ }
+ }
+ }
+ else if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_HIGH )
{
sal_Int32 nMaxNumberOfRows = nMaxEntryHeight
? (rAvailableSpace.Height - 2*nYPadding ) / nMaxEntryHeight
@@ -290,7 +499,7 @@ void lcl_placeLegendEntries(
static_cast< double >( nNumberOfColumns ) ))
: 0;
}
- else if( eExpansion == LegendExpansion_WIDE )
+ else if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_WIDE )
{
sal_Int32 nMaxNumberOfColumns = nMaxEntryWidth
? (rAvailableSpace.Width - 2*nXPadding ) / nMaxEntryWidth
@@ -307,7 +516,7 @@ void lcl_placeLegendEntries(
static_cast< double >( nNumberOfRows ) ))
: 0;
}
- else // LegendExpansion_BALANCED
+ else // ::com::sun::star::chart::ChartLegendExpansion_BALANCED
{
double fAspect = nMaxEntryHeight
? static_cast< double >( nMaxEntryWidth ) / static_cast< double >( nMaxEntryHeight )
@@ -323,93 +532,90 @@ void lcl_placeLegendEntries(
}
if(nNumberOfRows<=0)
- return;
+ return aResultingLegendSize;
- // calculate maximum height for current row
- std::vector< sal_Int32 > nMaxHeights( nNumberOfRows );
- sal_Int32 nRow = 0;
- sal_Int32 nColumn = 0;
- for( ; nRow < nNumberOfRows; ++nRow )
+ if( eExpansion != ::com::sun::star::chart::ChartLegendExpansion_CUSTOM )
{
- sal_Int32 nMaxHeight = 0;
- for( nColumn = 0; nColumn < nNumberOfColumns; ++nColumn )
- {
- sal_Int32 nEntry = ( eExpansion == LegendExpansion_WIDE )
- ? (nColumn + nRow * nNumberOfColumns)
- // HIGH or BALANCED
- : (nRow + nColumn * nNumberOfRows);
- if( nEntry < nNumberOfEntries )
- nMaxHeight = ::std::max(
- nMaxHeight, nYOffset + aTextShapes[ nEntry ]->getSize().Height );
- }
- nMaxHeights[ nRow ] = nMaxHeight;
+ lcl_collectColumnWidths( aColumnWidths, nNumberOfRows, nNumberOfColumns, aTextShapes, nSymbolPlusDistanceWidth );
+ lcl_collectRowHeighs( aRowHeights, nNumberOfRows, nNumberOfColumns, aTextShapes );
+ nTextLineHeight = lcl_getTextLineHeight( aRowHeights, nNumberOfRows, fViewFontSize );
}
- // place entries ordered in optimal-width columns
+ sal_Int32 nCurrentXPos = nXPadding;
+ sal_Int32 nCurrentYPos = nYPadding;
+ if( !bSymbolsLeftSide )
+ nCurrentXPos = -nXPadding;
+
+ // place entries into column and rows
sal_Int32 nMaxYPos = 0;
+ sal_Int32 nRow = 0;
+ sal_Int32 nColumn = 0;
for( nColumn = 0; nColumn < nNumberOfColumns; ++nColumn )
{
- sal_Int32 nMaxWidth = 0;
nCurrentYPos = nYPadding;
-
for( nRow = 0; nRow < nNumberOfRows; ++nRow )
{
- sal_Int32 nEntry = ( eExpansion == LegendExpansion_WIDE )
- ? (nColumn + nRow * nNumberOfColumns)
- // HIGH or BALANCED
- : (nRow + nColumn * nNumberOfRows);
-
+ sal_Int32 nEntry = (nColumn + nRow * nNumberOfColumns);
if( nEntry >= nNumberOfEntries )
break;
+ // text shape
+ Reference< drawing::XShape > xTextShape( aTextShapes[nEntry] );
+ if( xTextShape.is() )
+ {
+ awt::Size aTextSize( xTextShape->getSize() );
+ sal_Int32 nTextXPos = nCurrentXPos + nSymbolPlusDistanceWidth;
+ if( !bSymbolsLeftSide )
+ nTextXPos = nCurrentXPos - nSymbolPlusDistanceWidth - aTextSize.Width;
+ xTextShape->setPosition( awt::Point( nTextXPos, nCurrentYPos ));
+ }
+
// symbol
Reference< drawing::XShape > xSymbol( rEntries[ nEntry ].aSymbol );
-
if( xSymbol.is() )
{
- // Note: aspect ratio should always be 3:2
-
- // set symbol size to 75% of maximum space
- awt::Size aSymbolSize(
- aMaxSymbolExtent.Width * 75 / 100,
- aMaxSymbolExtent.Height * 75 / 100 );
- xSymbol->setSize( aSymbolSize );
- sal_Int32 nSymbolXPos = nCurrentXPos + ((aMaxSymbolExtent.Width - aSymbolSize.Width) / 2);
+ awt::Size aSymbolSize( rMaxSymbolExtent );
+ sal_Int32 nSymbolXPos = nCurrentXPos;
if( !bSymbolsLeftSide )
- nSymbolXPos = nSymbolXPos - aMaxSymbolExtent.Width;
-
- // #i109336# Improve auto positioning in chart
- sal_Int32 nTextHeight = nMaxHeights[ nRow ] - nYOffset;
- sal_Int32 nFontSize = static_cast< sal_Int32 >( fViewFontSize );
- sal_Int32 nMaxRowHeight = ( ( ( nTextHeight / nFontSize ) <= 1 ) ? nTextHeight : nFontSize );
- sal_Int32 nSymbolYPos = nCurrentYPos + ( ( nMaxRowHeight - aSymbolSize.Height ) / 2 );
+ nSymbolXPos = nCurrentXPos - rMaxSymbolExtent.Width;
+ sal_Int32 nSymbolYPos = nCurrentYPos + ( ( nTextLineHeight - aSymbolSize.Height ) / 2 );
xSymbol->setPosition( awt::Point( nSymbolXPos, nSymbolYPos ) );
}
- // position text shape
- awt::Size aTextSize( aTextShapes[ nEntry ]->getSize());
- nMaxWidth = ::std::max( nMaxWidth, 2 * nXOffset + aMaxSymbolExtent.Width + aTextSize.Width );
- sal_Int32 nTextXPos = nCurrentXPos + aMaxSymbolExtent.Width;
- if( !bSymbolsLeftSide )
- nTextXPos = nCurrentXPos - aMaxSymbolExtent.Width - aTextSize.Width;
- aTextShapes[ nEntry ]->setPosition( awt::Point( nTextXPos, nCurrentYPos ));
-
- nCurrentYPos += nMaxHeights[ nRow ];
+ nCurrentYPos += aRowHeights[ nRow ];
+ if( nRow+1 < nNumberOfRows )
+ nCurrentYPos += nYOffset;
nMaxYPos = ::std::max( nMaxYPos, nCurrentYPos );
}
if( bSymbolsLeftSide )
- nCurrentXPos += nMaxWidth;
+ {
+ nCurrentXPos += aColumnWidths[nColumn];
+ if( nColumn+1 < nNumberOfColumns )
+ nCurrentXPos += nXOffset;
+ }
else
- nCurrentXPos -= nMaxWidth;
+ {
+ nCurrentXPos -= aColumnWidths[nColumn];
+ if( nColumn+1 < nNumberOfColumns )
+ nCurrentXPos -= nXOffset;
+ }
}
- if( bSymbolsLeftSide )
- rOutLegendSize.Width = nCurrentXPos + nXPadding;
- else
+ if( !bIsCustomSize )
{
- sal_Int32 nLegendWidth = -(nCurrentXPos-nXPadding);
- rOutLegendSize.Width = nLegendWidth;
+ if( bSymbolsLeftSide )
+ aResultingLegendSize.Width = nCurrentXPos + nXPadding;
+ else
+ {
+ sal_Int32 nLegendWidth = -(nCurrentXPos-nXPadding);
+ aResultingLegendSize.Width = nLegendWidth;
+ }
+ aResultingLegendSize.Height = nMaxYPos + nYPadding;
+ }
+ if( !bSymbolsLeftSide )
+ {
+ sal_Int32 nLegendWidth = aResultingLegendSize.Width;
awt::Point aPos(0,0);
for( sal_Int32 nEntry=0; nEntry<nNumberOfEntries; nEntry++ )
{
@@ -423,7 +629,8 @@ void lcl_placeLegendEntries(
xText->setPosition( aPos );
}
}
- rOutLegendSize.Height = nMaxYPos + nYPadding;
+
+ return aResultingLegendSize;
}
// #i109336# Improve auto positioning in chart
@@ -565,14 +772,6 @@ awt::Point lcl_calculatePositionAndRemainingSpace(
return aResult;
}
-template< class T >
-void lcl_appendSeqToVector( const Sequence< T > & rSource, ::std::vector< T > & rDest )
-{
- const sal_Int32 nCount = rSource.getLength();
- for( sal_Int32 i = 0; i < nCount; ++i )
- rDest.push_back( rSource[ i ] );
-}
-
bool lcl_shouldSymbolsBePlacedOnTheLeftSide( const Reference< beans::XPropertySet >& xLegendProp, sal_Int16 nDefaultWritingMode )
{
bool bSymbolsLeftSide = true;
@@ -614,7 +813,7 @@ VLegend::VLegend(
// ----------------------------------------
-void SAL_CALL VLegend::init(
+void VLegend::init(
const Reference< drawing::XShapes >& xTargetPage,
const Reference< lang::XMultiServiceFactory >& xFactory,
const Reference< frame::XModel >& xModel )
@@ -688,23 +887,26 @@ void VLegend::createShapes(
tPropertyValues aLineFillProperties;
tPropertyValues aTextProperties;
- // limit the width of texts to 30% of the total available width
- // #i109336# Improve auto positioning in chart
- sal_Int32 nMaxLabelWidth = rAvailableSpace.Width * 3 / 10;
Reference< beans::XPropertySet > xLegendProp( m_xLegend, uno::UNO_QUERY );
- LegendExpansion eExpansion = LegendExpansion_HIGH;
+ ::com::sun::star::chart::ChartLegendExpansion eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
+ awt::Size aLegendSize( rAvailableSpace );
+
if( xLegendProp.is())
{
// get Expansion property
xLegendProp->getPropertyValue( C2U( "Expansion" )) >>= eExpansion;
- if( eExpansion == LegendExpansion_WIDE )
+ if( eExpansion == ::com::sun::star::chart::ChartLegendExpansion_CUSTOM )
{
- //#i80377#
- nMaxLabelWidth = (rAvailableSpace.Width * 5) / 6;//completely correct would be available width minus symbol size minus distances to page ...
+ RelativeSize aRelativeSize;
+ if ((xLegendProp->getPropertyValue( C2U( "RelativeSize" )) >>= aRelativeSize))
+ {
+ aLegendSize.Width = aRelativeSize.Primary * rPageSize.Width;
+ aLegendSize.Height = aRelativeSize.Secondary * rPageSize.Height;
+ }
+ else
+ eExpansion = ::com::sun::star::chart::ChartLegendExpansion_HIGH;
}
-
- lcl_getProperties( xLegendProp, aLineFillProperties, aTextProperties, nMaxLabelWidth,
- rPageSize );
+ lcl_getProperties( xLegendProp, aLineFillProperties, aTextProperties, rPageSize );
}
if( xBorder.is())
@@ -721,32 +923,47 @@ void VLegend::createShapes(
}
// create entries
- tViewLegendEntryContainer aViewEntries;
+ double fViewFontSize = lcl_CalcViewFontSize( xLegendProp, rPageSize );//todo
+ // #i109336# Improve auto positioning in chart
+ sal_Int32 nSymbolHeigth = static_cast< sal_Int32 >( fViewFontSize * 0.6 );
+ sal_Int32 nSymbolWidth = static_cast< sal_Int32 >( nSymbolHeigth );
+
+ ::std::vector< LegendEntryProvider* >::const_iterator aIter = m_aLegendEntryProviderList.begin();
+ const ::std::vector< LegendEntryProvider* >::const_iterator aEnd = m_aLegendEntryProviderList.end();
+ for( aIter = m_aLegendEntryProviderList.begin(); aIter != aEnd; aIter++ )
{
- ::std::vector< LegendEntryProvider* >::const_iterator aIter = m_aLegendEntryProviderList.begin();
- const ::std::vector< LegendEntryProvider* >::const_iterator aEnd = m_aLegendEntryProviderList.end();
- for( ; aIter != aEnd; aIter++ )
+ LegendEntryProvider* pLegendEntryProvider( *aIter );
+ if( pLegendEntryProvider )
{
- LegendEntryProvider* pLegendEntryProvider( *aIter );
- if( pLegendEntryProvider )
+ awt::Size aCurrentRatio = pLegendEntryProvider->getPreferredLegendKeyAspectRatio();
+ sal_Int32 nCurrentWidth = aCurrentRatio.Width;
+ if( aCurrentRatio.Height > 0 )
{
- lcl_appendSeqToVector< ViewLegendEntry >(
- pLegendEntryProvider->createLegendEntries( eExpansion, xLegendProp, xLegendContainer, m_xShapeFactory, m_xContext )
- , aViewEntries );
+ nCurrentWidth = nSymbolHeigth* aCurrentRatio.Width/aCurrentRatio.Height;
}
+ nSymbolWidth = std::max( nSymbolWidth, nCurrentWidth );
+ }
+ }
+ awt::Size aMaxSymbolExtent( nSymbolWidth, nSymbolHeigth );
+
+ tViewLegendEntryContainer aViewEntries;
+ for( aIter = m_aLegendEntryProviderList.begin(); aIter != aEnd; aIter++ )
+ {
+ LegendEntryProvider* pLegendEntryProvider( *aIter );
+ if( pLegendEntryProvider )
+ {
+ std::vector< ViewLegendEntry > aNewEntries = pLegendEntryProvider->createLegendEntries( aMaxSymbolExtent, eExpansion, xLegendProp, xLegendContainer, m_xShapeFactory, m_xContext );
+ aViewEntries.insert( aViewEntries.end(), aNewEntries.begin(), aNewEntries.end() );
}
}
bool bSymbolsLeftSide = lcl_shouldSymbolsBePlacedOnTheLeftSide( xLegendProp, m_nDefaultWritingMode );
// place entries
- awt::Size aLegendSize;
- lcl_placeLegendEntries( aViewEntries, eExpansion, bSymbolsLeftSide
- , xLegendProp, aTextProperties
- , xLegendContainer, m_xShapeFactory, m_xContext
- , rAvailableSpace, rPageSize, aLegendSize );
+ aLegendSize = lcl_placeLegendEntries( aViewEntries, eExpansion, bSymbolsLeftSide, fViewFontSize, aMaxSymbolExtent
+ , aTextProperties, xLegendContainer, m_xShapeFactory, aLegendSize );
- if( xBorder.is())
+ if( xBorder.is() )
xBorder->setSize( aLegendSize );
}
}
diff --git a/chart2/source/view/main/VLegend.hxx b/chart2/source/view/main/VLegend.hxx
index 74f49a08e1b9..9770730697be 100644
--- a/chart2/source/view/main/VLegend.hxx
+++ b/chart2/source/view/main/VLegend.hxx
@@ -57,7 +57,7 @@ public:
::com::sun::star::uno::XComponentContext > & xContext,
const std::vector< LegendEntryProvider* >& rLegendEntryProviderList );
- void SAL_CALL init( const ::com::sun::star::uno::Reference<
+ void init( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xTargetPage,
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory >& xFactory,
diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx
index ffe47937eb56..373f482c438e 100644
--- a/chart2/source/view/main/VLegendSymbolFactory.cxx
+++ b/chart2/source/view/main/VLegendSymbolFactory.cxx
@@ -39,9 +39,6 @@
// header for define DBG_ASSERT
#include <tools/debug.hxx>
-// uncomment to disable line dashes at the border of boxes
-// #define DISABLE_DASHES_AT_BORDER
-
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -106,16 +103,16 @@ namespace chart
{
Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
+ const awt::Size& rEntryKeyAspectRatio,
const Reference< drawing::XShapes > xSymbolContainer,
- chart2::LegendSymbolStyle eStyle,
+ LegendSymbolStyle eStyle,
const Reference< lang::XMultiServiceFactory > & xShapeFactory,
const Reference< beans::XPropertySet > & xLegendEntryProperties,
tPropertyType ePropertyType, const uno::Any& rExplicitSymbol )
{
Reference< drawing::XShape > xResult;
- if( ! (xSymbolContainer.is() &&
- xShapeFactory.is()))
+ if( ! (xSymbolContainer.is() && xShapeFactory.is()))
return xResult;
xResult.set( xShapeFactory->createInstance(
@@ -125,247 +122,92 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
if( ! xResultGroup.is())
return xResult;
- // aspect ratio of symbols is always 3:2
- awt::Size aBoundSize( 3000, 2000 );
- bool bUseBox = false;
-
// add an invisible square box to maintain aspect ratio
- switch( eStyle )
- {
- case chart2::LegendSymbolStyle_BOX:
- case chart2::LegendSymbolStyle_HORIZONTAL_LINE:
- case chart2::LegendSymbolStyle_VERTICAL_LINE:
- case chart2::LegendSymbolStyle_DIAGONAL_LINE:
- case chart2::LegendSymbolStyle_LINE_WITH_BOX:
- case chart2::LegendSymbolStyle_LINE_WITH_SYMBOL:
- case chart2::LegendSymbolStyle_CIRCLE:
- {
- Reference< drawing::XShape > xBound( ShapeFactory(xShapeFactory).createInvisibleRectangle(
- xResultGroup, aBoundSize ));
- break;
- }
-
- case chart2::LegendSymbolStyle_BAR:
- case chart2::LegendSymbolStyle_RECTANGLE:
- case chart2::LegendSymbolStyle_STRETCHED_RECTANGLE:
- case chart2::LegendSymbolStyle_USER_DEFINED:
- default:
- break;
- }
+ Reference< drawing::XShape > xBound( ShapeFactory(xShapeFactory).createInvisibleRectangle(
+ xResultGroup, rEntryKeyAspectRatio ));
// create symbol
- switch( eStyle )
+ try
{
- case chart2::LegendSymbolStyle_BOX:
- case chart2::LegendSymbolStyle_BAR:
- case chart2::LegendSymbolStyle_RECTANGLE:
- case chart2::LegendSymbolStyle_STRETCHED_RECTANGLE:
- case chart2::LegendSymbolStyle_CIRCLE:
+ if( eStyle == LegendSymbolStyle_LINE )
{
- try
+ Reference< drawing::XShape > xLine( xShapeFactory->createInstance(
+ C2U( "com.sun.star.drawing.LineShape" )), uno::UNO_QUERY );
+ if( xLine.is())
{
- Reference< drawing::XShape > xShape;
+ xResultGroup->add( xLine );
+ xLine->setSize( awt::Size( rEntryKeyAspectRatio.Width, 0 ));
+ xLine->setPosition( awt::Point( 0, rEntryKeyAspectRatio.Height/2 ));
- if( eStyle == chart2::LegendSymbolStyle_CIRCLE )
- xShape.set( xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.EllipseShape" )), uno::UNO_QUERY );
- else
- xShape.set( xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.RectangleShape" )), uno::UNO_QUERY );
+ lcl_setPropetiesToShape( xLegendEntryProperties, xLine, ePropertyType );
+ }
- if( xShape.is())
+ Reference< drawing::XShape > xSymbol;
+ const sal_Int32 nSize = std::min(rEntryKeyAspectRatio.Width,rEntryKeyAspectRatio.Height);
+ chart2::Symbol aSymbol;
+ if( rExplicitSymbol >>= aSymbol )
+ {
+ drawing::Direction3D aSymbolSize( nSize, nSize, 0 );
+ drawing::Position3D aPos( rEntryKeyAspectRatio.Width/2, rEntryKeyAspectRatio.Height/2, 0 );
+ ShapeFactory aFactory( xShapeFactory );
+ if( aSymbol.Style == chart2::SymbolStyle_STANDARD )
{
- xResultGroup->add( xShape );
- if( eStyle == chart2::LegendSymbolStyle_BOX ||
- eStyle == chart2::LegendSymbolStyle_CIRCLE )
- {
- xShape->setSize( awt::Size( 2000, 2000 ));
- xShape->setPosition( awt::Point( 500, 0 ));
- }
- else
- {
- xShape->setSize( aBoundSize );
- }
+ // take series color as fill color
+ xLegendEntryProperties->getPropertyValue( C2U("Color")) >>= aSymbol.FillColor;
+ // border of symbols always same as fill color
+ aSymbol.BorderColor = aSymbol.FillColor;
+
+ xSymbol.set( aFactory.createSymbol2D(
+ xResultGroup,
+ aPos,
+ aSymbolSize,
+ aSymbol.StandardSymbol,
+ aSymbol.BorderColor,
+ aSymbol.FillColor ));
}
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xShape, ePropertyType ); // PROP_TYPE_FILLED_SERIES );
-
-#ifdef DISABLE_DASHES_AT_BORDER
- // don't allow dashed border style
- Reference< beans::XPropertySet > xShapeProp( xShape, uno::UNO_QUERY );
- if( xShapeProp.is())
+ else if( aSymbol.Style == chart2::SymbolStyle_GRAPHIC )
{
- drawing::LineStyle aLineStyle;
- if( ( xShapeProp->getPropertyValue( C2U("LineStyle")) >>= aLineStyle ) &&
- aLineStyle == drawing::LineStyle_DASH )
- {
- aLineStyle = drawing::LineStyle_SOLID;
- xShapeProp->setPropertyValue( C2U("LineStyle"), uno::makeAny( aLineStyle ));
- }
+ xSymbol.set( aFactory.createGraphic2D(
+ xResultGroup,
+ aPos,
+ aSymbolSize,
+ aSymbol.Graphic ));
}
-#endif
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
- break;
- }
-
- case chart2::LegendSymbolStyle_HORIZONTAL_LINE:
- {
- try
- {
- Reference< drawing::XShape > xLine(
- xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.LineShape" )), uno::UNO_QUERY );
- if( xLine.is())
+ else if( aSymbol.Style == chart2::SymbolStyle_AUTO )
{
- xResultGroup->add( xLine );
- xLine->setSize( awt::Size( 3000, 0 ));
- xLine->setPosition( awt::Point( 0, 1000 ));
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xLine, ePropertyType ); // PROP_TYPE_LINE_SERIES );
+ DBG_ERROR("the given parameter is not allowed to contain an automatic symbol style");
}
}
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
- break;
}
-
- case chart2::LegendSymbolStyle_VERTICAL_LINE:
+ else if( eStyle == LegendSymbolStyle_CIRCLE )
{
- try
+ Reference< drawing::XShape > xShape( xShapeFactory->createInstance(
+ C2U( "com.sun.star.drawing.EllipseShape" )), uno::UNO_QUERY );
+ if( xShape.is() )
{
- Reference< drawing::XShape > xLine(
- xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.LineShape" )), uno::UNO_QUERY );
- if( xLine.is())
- {
- xResultGroup->add( xLine );
- xLine->setSize( awt::Size( 0, 2000 ));
- xLine->setPosition( awt::Point( 1500, 0 ));
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xLine, ePropertyType ); // PROP_TYPE_LINE_SERIES );
- }
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
+ xResultGroup->add( xShape );
+ sal_Int32 nSize = std::min( rEntryKeyAspectRatio.Width, rEntryKeyAspectRatio.Height );
+ xShape->setSize( awt::Size( nSize, nSize ) );
+ xShape->setPosition( awt::Point( rEntryKeyAspectRatio.Width/2-nSize/2, rEntryKeyAspectRatio.Height/2-nSize/2 ) );
+ lcl_setPropetiesToShape( xLegendEntryProperties, xShape, ePropertyType ); // PROP_TYPE_FILLED_SERIES );
}
- break;
}
-
- case chart2::LegendSymbolStyle_DIAGONAL_LINE:
+ else // eStyle == LegendSymbolStyle_BOX
{
- try
+ Reference< drawing::XShape > xShape( xShapeFactory->createInstance(
+ C2U( "com.sun.star.drawing.RectangleShape" )), uno::UNO_QUERY );
+ if( xShape.is() )
{
- Reference< drawing::XShape > xLine(
- xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.LineShape" )), uno::UNO_QUERY );
- if( xLine.is())
- {
- xResultGroup->add( xLine );
- xLine->setSize( awt::Size( 2000, 2000 ));
- xLine->setPosition( awt::Point( 500, 0 ));
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xLine, ePropertyType ); // PROP_TYPE_LINE_SERIES );
- }
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
+ xResultGroup->add( xShape );
+ xShape->setSize( rEntryKeyAspectRatio );
+ xShape->setPosition( awt::Point( 0, 0 ) );
+ lcl_setPropetiesToShape( xLegendEntryProperties, xShape, ePropertyType ); // PROP_TYPE_FILLED_SERIES );
}
- break;
}
-
- case chart2::LegendSymbolStyle_LINE_WITH_BOX:
- bUseBox = true;
- // fall-through intended
- case chart2::LegendSymbolStyle_LINE_WITH_SYMBOL:
- try
- {
- Reference< drawing::XShape > xLine(
- xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.LineShape" )), uno::UNO_QUERY );
- if( xLine.is())
- {
- xResultGroup->add( xLine );
- xLine->setSize( awt::Size( 3000, 0 ));
- xLine->setPosition( awt::Point( 0, 1000 ));
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xLine, ePropertyType );
- }
-
- Reference< drawing::XShape > xSymbol;
- const sal_Int32 nSize = 1500;
- if( bUseBox )
- {
- xSymbol.set( xShapeFactory->createInstance(
- C2U( "com.sun.star.drawing.RectangleShape" )), uno::UNO_QUERY );
- xResultGroup->add( xSymbol );
-
- if( xSymbol.is())
- {
- xSymbol->setSize( awt::Size( nSize, nSize ));
- xSymbol->setPosition( awt::Point( 1500 - nSize/2, 1000 - nSize/2 ));
-
- lcl_setPropetiesToShape( xLegendEntryProperties, xSymbol, ePropertyType );
- }
- }
- else
- {
- chart2::Symbol aSymbol;
-
- if( rExplicitSymbol >>= aSymbol )
- {
- drawing::Direction3D aSymbolSize( nSize, nSize, 0 );
- drawing::Position3D aPos( 1500, 1000, 0 );
- ShapeFactory aFactory( xShapeFactory );
- if( aSymbol.Style == chart2::SymbolStyle_STANDARD )
- {
- // take series color as fill color
- xLegendEntryProperties->getPropertyValue( C2U("Color")) >>= aSymbol.FillColor;
- // border of symbols always same as fill color
- aSymbol.BorderColor = aSymbol.FillColor;
-
- xSymbol.set( aFactory.createSymbol2D(
- xResultGroup,
- aPos,
- aSymbolSize,
- aSymbol.StandardSymbol,
- aSymbol.BorderColor,
- aSymbol.FillColor ));
- }
- else if( aSymbol.Style == chart2::SymbolStyle_GRAPHIC )
- {
- xSymbol.set( aFactory.createGraphic2D(
- xResultGroup,
- aPos,
- aSymbolSize,
- aSymbol.Graphic ));
- }
- else if( aSymbol.Style == chart2::SymbolStyle_AUTO )
- {
- OSL_FAIL("the given parameter is not allowed to contain an automatic symbol style");
- }
- }
- }
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
- break;
-
- case chart2::LegendSymbolStyle_USER_DEFINED:
- break;
-
- default:
- // just to remove warning (there is an auto-generated extra label)
- break;
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
}
return xResult;
diff --git a/chart2/source/view/main/VTitle.cxx b/chart2/source/view/main/VTitle.cxx
index b9b1d18b3c5b..6af228d02c11 100644
--- a/chart2/source/view/main/VTitle.cxx
+++ b/chart2/source/view/main/VTitle.cxx
@@ -66,7 +66,7 @@ VTitle::~VTitle()
{
}
-void SAL_CALL VTitle::init(
+void VTitle::init(
const uno::Reference< drawing::XShapes >& xTargetPage
, const uno::Reference< lang::XMultiServiceFactory >& xFactory
, const rtl::OUString& rCID )
diff --git a/chart2/source/view/main/VTitle.hxx b/chart2/source/view/main/VTitle.hxx
index a4db30a439e7..61b7cadafccd 100644
--- a/chart2/source/view/main/VTitle.hxx
+++ b/chart2/source/view/main/VTitle.hxx
@@ -48,7 +48,7 @@ public:
::com::sun::star::chart2::XTitle > & xTitle );
virtual ~VTitle();
- void SAL_CALL init( const ::com::sun::star::uno::Reference<
+ void init( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xTargetPage
, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory
, const rtl::OUString& rCID );
diff --git a/chart2/source/view/main/_serviceregistration_view.cxx b/chart2/source/view/main/_serviceregistration_view.cxx
index 8e6059afce6a..828564bec31c 100644
--- a/chart2/source/view/main/_serviceregistration_view.cxx
+++ b/chart2/source/view/main/_serviceregistration_view.cxx
@@ -55,13 +55,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, g_entries_chart2_view );
-}
-//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
diff --git a/chart2/source/view/main/makefile.mk b/chart2/source/view/main/makefile.mk
index ec9c99f2a898..8675930aa107 100644
--- a/chart2/source/view/main/makefile.mk
+++ b/chart2/source/view/main/makefile.mk
@@ -43,7 +43,6 @@ ENABLE_EXCEPTIONS= TRUE
SLOFILES = \
$(SLO)$/ChartItemPool.obj \
$(SLO)$/DrawModelWrapper.obj \
- $(SLO)$/NumberFormatterWrapper.obj \
$(SLO)$/PropertyMapper.obj \
$(SLO)$/Stripe.obj \
$(SLO)$/VLineProperties.obj \
diff --git a/chart2/source/view/makefile.mk b/chart2/source/view/makefile.mk
index 721ae1aac74f..ebaa0d0ed941 100644
--- a/chart2/source/view/makefile.mk
+++ b/chart2/source/view/makefile.mk
@@ -115,3 +115,11 @@ DEF1DES= Viewable Component Chart View
$(MISC)$/$(SHL1TARGET).flt: makefile.mk \
exports.flt
$(TYPE) exports.flt > $@
+
+ALLTAR : $(MISC)/chartview.component
+
+$(MISC)/chartview.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ chartview.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt chartview.component