summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/chartapiwrapper/AxisWrapper.cxx1
-rw-r--r--chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx11
-rw-r--r--chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx4
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx4
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx39
-rw-r--r--chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx26
-rw-r--r--chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx61
-rw-r--r--chart2/source/controller/chartapiwrapper/GridWrapper.cxx1
-rw-r--r--chart2/source/controller/chartapiwrapper/TitleWrapper.cxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx1
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx11
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx3
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx557
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedSceneProperty.hxx234
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx2
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx14
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.hxx7
-rw-r--r--chart2/source/controller/dialogs/Bitmaps.hrc32
-rw-r--r--chart2/source/controller/dialogs/Bitmaps.src22
-rw-r--r--chart2/source/controller/dialogs/Bitmaps_HC.hrc30
-rw-r--r--chart2/source/controller/dialogs/Bitmaps_HC.src22
-rw-r--r--chart2/source/controller/dialogs/ChartTypeDialogController.cxx47
-rw-r--r--chart2/source/controller/dialogs/ChartTypeDialogController.hxx13
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx48
-rw-r--r--chart2/source/controller/dialogs/DataBrowserModel.cxx46
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx59
-rw-r--r--chart2/source/controller/dialogs/DialogModel.hxx8
-rw-r--r--chart2/source/controller/dialogs/ObjectNameProvider.cxx185
-rw-r--r--chart2/source/controller/dialogs/Strings.src43
-rw-r--r--chart2/source/controller/dialogs/Strings_ChartTypes.src13
-rw-r--r--chart2/source/controller/dialogs/Strings_Statistic.src4
-rw-r--r--chart2/source/controller/dialogs/TabPages.hrc16
-rw-r--r--chart2/source/controller/dialogs/dlg_DataSource.cxx13
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx5
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertDataLabel.src4
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx4
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertTrendline.cxx3
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx86
-rw-r--r--chart2/source/controller/dialogs/hidother.src2
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.cxx100
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.hxx9
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel_IDs.hrc4
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc54
-rw-r--r--chart2/source/controller/dialogs/res_TextSeparator.cxx7
-rw-r--r--chart2/source/controller/dialogs/res_TextSeparator.hxx1
-rw-r--r--chart2/source/controller/dialogs/res_Trendline_tmpl.hrc2
-rw-r--r--chart2/source/controller/dialogs/tp_ChartType.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.src2
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.cxx31
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.hxx7
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.cxx18
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.hrc4
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.hxx3
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.src18
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.cxx23
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.hxx6
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.cxx69
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.hrc48
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.hxx5
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.src27
-rw-r--r--chart2/source/controller/drawinglayer/DrawViewWrapper.cxx2
-rw-r--r--chart2/source/controller/inc/ChartRenderer.hxx2
-rw-r--r--chart2/source/controller/inc/ConfigurationAccess.hxx17
-rw-r--r--chart2/source/controller/inc/DataPointItemConverter.hxx1
-rw-r--r--chart2/source/controller/inc/HelpIds.hrc4
-rw-r--r--chart2/source/controller/inc/ItemConverter.hxx2
-rw-r--r--chart2/source/controller/inc/ObjectHierarchy.hxx3
-rw-r--r--chart2/source/controller/inc/ObjectNameProvider.hxx9
-rw-r--r--chart2/source/controller/inc/SeriesOptionsItemConverter.hxx3
-rw-r--r--chart2/source/controller/inc/dlg_DataSource.hxx3
-rw-r--r--chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx76
-rw-r--r--chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx7
-rw-r--r--chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx41
-rw-r--r--chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx5
-rw-r--r--chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx10
-rw-r--r--chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx35
-rw-r--r--chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx2
-rw-r--r--chart2/source/controller/main/ChartController.cxx153
-rw-r--r--chart2/source/controller/main/ChartController.hxx58
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx422
-rw-r--r--chart2/source/controller/main/ChartController_Properties.cxx284
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx362
-rw-r--r--chart2/source/controller/main/ChartRenderer.cxx5
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx28
-rw-r--r--chart2/source/controller/main/ChartWindow.hxx6
-rw-r--r--chart2/source/controller/main/ConfigurationAccess.cxx39
-rw-r--r--chart2/source/controller/main/ControllerCommandDispatch.cxx174
-rw-r--r--chart2/source/controller/main/ElementSelector.cxx328
-rw-r--r--chart2/source/controller/main/ElementSelector.hxx125
-rw-r--r--chart2/source/controller/main/ObjectHierarchy.cxx272
-rw-r--r--chart2/source/controller/main/_serviceregistration_controller.cxx9
-rw-r--r--chart2/source/controller/main/makefile.mk1
-rw-r--r--chart2/source/controller/makefile.mk1
-rw-r--r--chart2/source/inc/AxisHelper.hxx7
-rw-r--r--chart2/source/inc/BaseGFXHelper.hxx7
-rw-r--r--chart2/source/inc/CachedDataSequence.hxx20
-rw-r--r--chart2/source/inc/CharacterProperties.hxx1
-rw-r--r--chart2/source/inc/ChartModelHelper.hxx27
-rw-r--r--chart2/source/inc/ChartTypeHelper.hxx23
-rw-r--r--chart2/source/inc/ColorPerPointHelper.hxx2
-rw-r--r--chart2/source/inc/CommonConverters.hxx45
-rw-r--r--chart2/source/inc/CommonFunctors.hxx5
-rw-r--r--chart2/source/inc/ConfigColorScheme.hxx15
-rw-r--r--chart2/source/inc/ControllerLockGuard.hxx4
-rw-r--r--chart2/source/inc/DataSeriesHelper.hxx31
-rw-r--r--chart2/source/inc/DataSource.hxx3
-rw-r--r--chart2/source/inc/DataSourceHelper.hxx36
-rw-r--r--chart2/source/inc/DiagramHelper.hxx8
-rw-r--r--chart2/source/inc/ErrorBar.hxx6
-rw-r--r--chart2/source/inc/ExplicitCategoriesProvider.hxx4
-rw-r--r--chart2/source/inc/ExponentialRegressionCurveCalculator.hxx3
-rw-r--r--chart2/source/inc/InternalDataProvider.hxx3
-rw-r--r--chart2/source/inc/LabeledDataSequence.hxx3
-rw-r--r--chart2/source/inc/LegendHelper.hxx10
-rw-r--r--chart2/source/inc/LifeTime.hxx28
-rw-r--r--chart2/source/inc/LineProperties.hxx4
-rw-r--r--chart2/source/inc/LinearRegressionCurveCalculator.hxx3
-rw-r--r--chart2/source/inc/LogarithmicRegressionCurveCalculator.hxx3
-rw-r--r--chart2/source/inc/MeanValueRegressionCurveCalculator.hxx3
-rw-r--r--chart2/source/inc/MediaDescriptorHelper.hxx2
-rw-r--r--chart2/source/inc/ModifyListenerCallBack.hxx6
-rw-r--r--chart2/source/inc/ModifyListenerHelper.hxx6
-rw-r--r--chart2/source/inc/NameContainer.hxx5
-rw-r--r--chart2/source/inc/OPropertySet.hxx3
-rw-r--r--chart2/source/inc/ObjectIdentifier.hxx10
-rw-r--r--chart2/source/inc/PotentialRegressionCurveCalculator.hxx2
-rw-r--r--chart2/source/inc/RangeHighlighter.hxx4
-rw-r--r--chart2/source/inc/ReferenceSizeProvider.hxx36
-rw-r--r--chart2/source/inc/RegressionCurveCalculator.hxx3
-rw-r--r--chart2/source/inc/RegressionCurveHelper.hxx14
-rw-r--r--chart2/source/inc/RelativePositionHelper.hxx2
-rw-r--r--chart2/source/inc/RessourceManager.hxx2
-rw-r--r--chart2/source/inc/Scaling.hxx23
-rw-r--r--chart2/source/inc/Strings.hrc21
-rw-r--r--chart2/source/inc/ThreeDHelper.hxx6
-rw-r--r--chart2/source/inc/UncachedDataSequence.hxx4
-rw-r--r--chart2/source/inc/UndoGuard.hxx4
-rw-r--r--chart2/source/inc/UndoManager.hxx3
-rw-r--r--chart2/source/inc/WeakListenerAdapter.hxx5
-rw-r--r--chart2/source/inc/WrappedIgnoreProperty.hxx10
-rw-r--r--chart2/source/inc/WrappedPropertySet.hxx4
-rw-r--r--chart2/source/inc/XMLRangeHelper.hxx2
-rw-r--r--chart2/source/inc/chartview/ChartSfxItemIds.hxx6
-rw-r--r--chart2/source/inc/chartview/DrawModelWrapper.hxx20
-rw-r--r--chart2/source/inc/chartview/ExplicitValueProvider.hxx9
-rw-r--r--chart2/source/inc/chartview/NumberFormatterWrapper.hxx3
-rw-r--r--chart2/source/inc/servicenames_charttypes.hxx2
-rw-r--r--chart2/source/model/inc/BaseCoordinateSystem.hxx1
-rw-r--r--chart2/source/model/inc/DataSeries.hxx4
-rw-r--r--chart2/source/model/inc/Diagram.hxx1
-rw-r--r--chart2/source/model/inc/StockBar.hxx1
-rw-r--r--chart2/source/model/main/Axis.cxx4
-rw-r--r--chart2/source/model/main/BaseCoordinateSystem.cxx4
-rw-r--r--chart2/source/model/main/ChartData.cxx29
-rw-r--r--chart2/source/model/main/ChartData.hxx13
-rw-r--r--chart2/source/model/main/ChartModel.cxx19
-rw-r--r--chart2/source/model/main/ChartModel_Persistence.cxx2
-rw-r--r--chart2/source/model/main/DataPoint.cxx10
-rw-r--r--chart2/source/model/main/DataPointProperties.cxx9
-rw-r--r--chart2/source/model/main/DataPointProperties.hxx1
-rw-r--r--chart2/source/model/main/DataSeries.cxx29
-rw-r--r--chart2/source/model/main/Diagram.cxx15
-rw-r--r--chart2/source/model/main/FormattedString.cxx4
-rw-r--r--chart2/source/model/main/GridProperties.cxx6
-rw-r--r--chart2/source/model/main/ImplChartModel.cxx18
-rw-r--r--chart2/source/model/main/Legend.cxx4
-rw-r--r--chart2/source/model/main/PageBackground.cxx4
-rw-r--r--chart2/source/model/main/RectangularDataSource.cxx297
-rw-r--r--chart2/source/model/main/StockBar.cxx5
-rw-r--r--chart2/source/model/main/Title.cxx4
-rw-r--r--chart2/source/model/main/Wall.cxx4
-rw-r--r--chart2/source/model/template/BubbleChartType.cxx245
-rw-r--r--chart2/source/model/template/BubbleChartType.hxx89
-rw-r--r--chart2/source/model/template/BubbleChartTypeTemplate.cxx322
-rw-r--r--chart2/source/model/template/BubbleChartTypeTemplate.hxx106
-rw-r--r--chart2/source/model/template/BubbleDataInterpreter.cxx317
-rw-r--r--chart2/source/model/template/BubbleDataInterpreter.hxx64
-rw-r--r--chart2/source/model/template/ChartType.cxx8
-rw-r--r--chart2/source/model/template/ChartTypeManager.cxx27
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx25
-rw-r--r--chart2/source/model/template/DataInterpreter.cxx4
-rw-r--r--chart2/source/model/template/FilledNetChartType.cxx97
-rw-r--r--chart2/source/model/template/FilledNetChartType.hxx66
-rw-r--r--chart2/source/model/template/NetChartType.cxx125
-rw-r--r--chart2/source/model/template/NetChartType.hxx40
-rw-r--r--chart2/source/model/template/NetChartTypeTemplate.cxx29
-rw-r--r--chart2/source/model/template/NetChartTypeTemplate.hxx4
-rw-r--r--chart2/source/model/template/PieChartType.cxx4
-rw-r--r--chart2/source/model/template/PieChartTypeTemplate.cxx1
-rw-r--r--chart2/source/model/template/ScatterChartType.cxx4
-rw-r--r--chart2/source/model/template/ScatterChartTypeTemplate.cxx1
-rw-r--r--chart2/source/model/template/StockChartTypeTemplate.cxx1
-rw-r--r--chart2/source/model/template/_serviceregistration_charttypes.cxx18
-rw-r--r--chart2/source/model/template/makefile.mk4
-rw-r--r--chart2/source/tools/AxisHelper.cxx12
-rw-r--r--chart2/source/tools/CachedDataSequence.cxx62
-rw-r--r--chart2/source/tools/CharacterProperties.cxx23
-rw-r--r--chart2/source/tools/ChartModelHelper.cxx129
-rw-r--r--chart2/source/tools/ChartTypeHelper.cxx86
-rw-r--r--chart2/source/tools/CommonConverters.cxx209
-rw-r--r--chart2/source/tools/ConfigColorScheme.cxx6
-rw-r--r--chart2/source/tools/DataSeriesHelper.cxx273
-rw-r--r--chart2/source/tools/DataSourceHelper.cxx37
-rw-r--r--chart2/source/tools/DiagramHelper.cxx20
-rw-r--r--chart2/source/tools/ErrorBar.cxx9
-rw-r--r--chart2/source/tools/ImplUndoManager.cxx4
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx65
-rw-r--r--chart2/source/tools/LabeledDataSequence.cxx6
-rw-r--r--chart2/source/tools/LegendHelper.cxx48
-rw-r--r--chart2/source/tools/ModifyListenerHelper.cxx10
-rw-r--r--chart2/source/tools/NameContainer.cxx6
-rw-r--r--chart2/source/tools/OPropertySet.cxx26
-rw-r--r--chart2/source/tools/ObjectIdentifier.cxx8
-rw-r--r--chart2/source/tools/RangeHighlighter.cxx10
-rw-r--r--chart2/source/tools/ReferenceSizeProvider.cxx20
-rw-r--r--chart2/source/tools/RegressionCurveHelper.cxx51
-rw-r--r--chart2/source/tools/RegressionCurveModel.cxx4
-rw-r--r--chart2/source/tools/StatisticsHelper.cxx2
-rw-r--r--chart2/source/tools/TitleHelper.cxx42
-rw-r--r--chart2/source/tools/UncachedDataSequence.cxx28
-rw-r--r--chart2/source/view/axes/ScaleAutomatism.cxx54
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx197
-rw-r--r--chart2/source/view/axes/VCoordinateSystem.cxx5
-rw-r--r--chart2/source/view/charttypes/AreaChart.cxx114
-rw-r--r--chart2/source/view/charttypes/AreaChart.hxx12
-rw-r--r--chart2/source/view/charttypes/BarChart.cxx12
-rw-r--r--chart2/source/view/charttypes/BubbleChart.cxx420
-rw-r--r--chart2/source/view/charttypes/BubbleChart.hxx97
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.cxx2
-rw-r--r--chart2/source/view/charttypes/PieChart.cxx4
-rw-r--r--chart2/source/view/charttypes/Splines.cxx350
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx70
-rw-r--r--chart2/source/view/charttypes/makefile.mk3
-rw-r--r--chart2/source/view/diagram/VDiagram.cxx10
-rw-r--r--chart2/source/view/inc/LabelPositionHelper.hxx3
-rw-r--r--chart2/source/view/inc/PlottingPositionHelper.hxx2
-rw-r--r--chart2/source/view/inc/ShapeFactory.hxx7
-rw-r--r--chart2/source/view/inc/Stripe.hxx2
-rw-r--r--chart2/source/view/inc/VCoordinateSystem.hxx4
-rw-r--r--chart2/source/view/inc/VDataSeries.hxx19
-rw-r--r--chart2/source/view/inc/VSeriesPlotter.hxx3
-rw-r--r--chart2/source/view/main/ChartItemPool.cxx2
-rw-r--r--chart2/source/view/main/ChartView.cxx88
-rw-r--r--chart2/source/view/main/LabelPositionHelper.cxx355
-rw-r--r--chart2/source/view/main/NumberFormatterWrapper.cxx24
-rw-r--r--chart2/source/view/main/PlottingPositionHelper.cxx36
-rw-r--r--chart2/source/view/main/PropertyMapper.cxx1
-rw-r--r--chart2/source/view/main/ShapeFactory.cxx52
-rw-r--r--chart2/source/view/main/Stripe.cxx47
-rw-r--r--chart2/source/view/main/VDataSeries.cxx299
-rw-r--r--chart2/source/view/makefile.mk2
253 files changed, 7423 insertions, 3297 deletions
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 9a024cf309fc..7fd921e761dc 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -32,7 +32,6 @@
#include "precompiled_chart2.hxx"
#include "AxisWrapper.hxx"
#include "AxisHelper.hxx"
-#include "Scaling.hxx"
#include "Chart2ModelContact.hxx"
#include "ContainerHelper.hxx"
#include "macros.hxx"
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
index 4b44b2e0593d..3d930f72f0af 100644
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
@@ -177,6 +177,17 @@ sal_Int32 Chart2ModelContact::getExplicitNumberFormatKeyForAxis(
, Reference< util::XNumberFormatsSupplier >( m_xChartModel.get(), uno::UNO_QUERY ) );
}
+sal_Int32 Chart2ModelContact::getExplicitNumberFormatKeyForSeries(
+ const Reference< chart2::XDataSeries >& xSeries )
+{
+ return ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
+ uno::Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ),
+ xSeries,
+ -1 /*-1 for whole series*/,
+ ChartModelHelper::findDiagram( m_xChartModel )
+ );
+}
+
//-----------------------------------------------------------------------------
awt::Size Chart2ModelContact::GetPageSize() const
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
index b8ce668dff28..0cc8a16bafff 100644
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
@@ -34,6 +34,7 @@
#include <com/sun/star/chart2/ExplicitIncrementData.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XTitle.hpp>
#include <cppuhelper/weakref.hxx>
@@ -87,6 +88,9 @@ public:
sal_Int32 getExplicitNumberFormatKeyForAxis(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis );
+ sal_Int32 getExplicitNumberFormatKeyForSeries(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries );
+
/** Returns the size of the page in logic coordinates. This value is used
for setting an appropriate "ReferencePageSize" for FontHeights.
*/
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
index ee7069338872..8cbb0c5af80c 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
@@ -37,7 +37,7 @@
#include "servicenames_charttypes.hxx"
#include "ContainerHelper.hxx"
#include "CommonFunctors.hxx"
-#include "InternalDataProvider.hxx"
+#include "ChartModelHelper.hxx"
#include "DataSeriesHelper.hxx"
#include "ControllerLockGuard.hxx"
#include "Chart2ModelContact.hxx"
@@ -580,7 +580,7 @@ void ChartDataWrapper::applyData( bool bSetValues, bool bSetRowDescriptions, boo
// create a data provider containing the new data
uno::Reference< chart2::data::XDataProvider > xTempDataProvider(
- new InternalDataProvider());
+ ChartModelHelper::createInternalDataProvider() );
if( ! xTempDataProvider.is())
throw uno::RuntimeException( C2U("Couldn't create temporary data provider"),
static_cast< ::cppu::OWeakObject * >( this ));
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index 5869a1e4bdb0..397527f3ea9d 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -43,7 +43,6 @@
#include "chartview/ExplicitValueProvider.hxx"
#include "chartview/DrawModelWrapper.hxx"
#include "Chart2ModelContact.hxx"
-#include "InternalDataProvider.hxx"
#include "DiagramHelper.hxx"
#include "DataSourceHelper.hxx"
@@ -56,6 +55,7 @@
#include "LegendWrapper.hxx"
#include "AreaWrapper.hxx"
#include "WrappedAddInProperty.hxx"
+#include "WrappedIgnoreProperty.hxx"
#include "ChartRenderer.hxx"
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
@@ -70,6 +70,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/util/DateTime.hpp>
#include <vector>
#include <algorithm>
@@ -94,9 +95,11 @@ enum eServiceType
SERVICE_NAME_DONUT_DIAGRAM,
SERVICE_NAME_LINE_DIAGRAM,
SERVICE_NAME_NET_DIAGRAM,
+ SERVICE_NAME_FILLED_NET_DIAGRAM,
SERVICE_NAME_PIE_DIAGRAM,
SERVICE_NAME_STOCK_DIAGRAM,
SERVICE_NAME_XY_DIAGRAM,
+ SERVICE_NAME_BUBBLE_DIAGRAM,
SERVICE_NAME_DASH_TABLE,
SERVICE_NAME_GARDIENT_TABLE,
@@ -122,9 +125,11 @@ tServiceNameMap & lcl_getStaticServiceNameMap()
( C2U( "com.sun.star.chart.DonutDiagram" ), SERVICE_NAME_DONUT_DIAGRAM )
( C2U( "com.sun.star.chart.LineDiagram" ), SERVICE_NAME_LINE_DIAGRAM )
( C2U( "com.sun.star.chart.NetDiagram" ), SERVICE_NAME_NET_DIAGRAM )
+ ( C2U( "com.sun.star.chart.FilledNetDiagram" ), SERVICE_NAME_FILLED_NET_DIAGRAM )
( C2U( "com.sun.star.chart.PieDiagram" ), SERVICE_NAME_PIE_DIAGRAM )
( C2U( "com.sun.star.chart.StockDiagram" ), SERVICE_NAME_STOCK_DIAGRAM )
( C2U( "com.sun.star.chart.XYDiagram" ), SERVICE_NAME_XY_DIAGRAM )
+ ( C2U( "com.sun.star.chart.BubbleDiagram" ), SERVICE_NAME_BUBBLE_DIAGRAM )
( C2U( "com.sun.star.drawing.DashTable" ), SERVICE_NAME_DASH_TABLE )
( C2U( "com.sun.star.drawing.GradientTable" ), SERVICE_NAME_GARDIENT_TABLE )
@@ -151,7 +156,8 @@ enum
PROP_DOCUMENT_ADDIN,
PROP_DOCUMENT_BASEDIAGRAM,
PROP_DOCUMENT_ADDITIONAL_SHAPES,
- PROP_DOCUMENT_UPDATE_ADDIN
+ PROP_DOCUMENT_UPDATE_ADDIN,
+ PROP_DOCUMENT_NULL_DATE
};
void lcl_AddPropertiesToVector(
@@ -215,6 +221,13 @@ void lcl_AddPropertiesToVector(
PROP_DOCUMENT_UPDATE_ADDIN,
::getBooleanCppuType(),
beans::PropertyAttribute::BOUND ));
+
+ // table:null-date // i99104
+ rOutProperties.push_back(
+ Property( C2U( "NullDate" ),
+ PROP_DOCUMENT_NULL_DATE,
+ ::getCppuType( static_cast< const ::com::sun::star::util::DateTime * >(0)),
+ beans::PropertyAttribute::MAYBEVOID ));
}
const uno::Sequence< Property > & lcl_GetPropertySequence()
@@ -696,7 +709,6 @@ Any WrappedHasSubTitleProperty::getPropertyDefault( const Reference< beans::XPro
//-----------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------
-
ChartDocumentWrapper::ChartDocumentWrapper(
const Reference< uno::XComponentContext > & xContext ) :
m_spChart2ModelContact( new Chart2ModelContact( xContext ) ),
@@ -899,7 +911,7 @@ void SAL_CALL ChartDocumentWrapper::attachData( const Reference< XChartData >& x
// create a data provider containing the new data
Reference< chart2::data::XDataProvider > xTempDataProvider(
- new InternalDataProvider( xDataArray ));
+ ChartModelHelper::createInternalDataProvider( xDataArray ));
if( ! xTempDataProvider.is())
throw uno::RuntimeException( C2U("Couldn't create temporary data provider"),
@@ -1331,6 +1343,14 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
bCreateDiagram = true;
}
break;
+ case SERVICE_NAME_FILLED_NET_DIAGRAM:
+ if( xManagerFact.is())
+ {
+ xTemplate.set(
+ xManagerFact->createInstance(
+ C2U( "com.sun.star.chart2.template.FilledNet" )), uno::UNO_QUERY );
+ bCreateDiagram = true;
+ }
case SERVICE_NAME_PIE_DIAGRAM:
if( xManagerFact.is())
{
@@ -1359,6 +1379,16 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
}
break;
+ case SERVICE_NAME_BUBBLE_DIAGRAM:
+ if( xManagerFact.is())
+ {
+ xTemplate.set(
+ xManagerFact->createInstance(
+ C2U( "com.sun.star.chart2.template.Bubble" )), uno::UNO_QUERY );
+ bCreateDiagram = true;
+ }
+ break;
+
case SERVICE_NAME_DASH_TABLE:
case SERVICE_NAME_GARDIENT_TABLE:
case SERVICE_NAME_HATCH_TABLE:
@@ -1632,6 +1662,7 @@ const std::vector< WrappedProperty* > ChartDocumentWrapper::createWrappedPropert
aWrappedProperties.push_back( new WrappedBaseDiagramProperty( *this ) );
aWrappedProperties.push_back( new WrappedAdditionalShapesProperty( *this ) );
aWrappedProperties.push_back( new WrappedRefreshAddInAllowedProperty( *this ) );
+ aWrappedProperties.push_back( new WrappedIgnoreProperty( C2U("NullDate"),Any() ) ); // i99104
return aWrappedProperties;
}
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index fc62b3b77223..ce417155dc4f 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -50,6 +50,8 @@
#include "WrappedDataCaptionProperties.hxx"
#include "WrappedSeriesAreaOrLineProperty.hxx"
#include "WrappedScaleTextProperties.hxx"
+#include "WrappedNumberFormatProperty.hxx"
+#include "WrappedTextRotationProperty.hxx"
#include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx>
// header for define DBG_ASSERT
@@ -87,10 +89,12 @@ enum
PROP_SERIES_DATAPOINT_PERCENT_DIAGONAL,
PROP_SERIES_DATAPOINT_LABEL_SEPARATOR,
PROP_SERIES_NUMBERFORMAT,
+ PROP_SERIES_LINK_NUMBERFORMAT_TO_SOURCE,
PROP_SERIES_PERCENTAGE_NUMBERFORMAT,
PROP_SERIES_DATAPOINT_LABEL_PLACEMENT,
//other series properties
- PROP_SERIES_ATTACHED_AXIS
+ PROP_SERIES_ATTACHED_AXIS,
+ PROP_SERIES_DATAPOINT_TEXT_ROTATION
};
void lcl_AddPropertiesToVector_PointProperties(
@@ -145,6 +149,13 @@ void lcl_AddPropertiesToVector_PointProperties(
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
+
+ rOutProperties.push_back(
+ Property( C2U( "TextRotation" ),
+ PROP_SERIES_DATAPOINT_TEXT_ROTATION,
+ ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
}
void lcl_AddPropertiesToVector_SeriesOnly(
@@ -156,6 +167,13 @@ void lcl_AddPropertiesToVector_SeriesOnly(
::getCppuType( reinterpret_cast< sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( C2U( "LinkNumberFormatToSource" ),
+ PROP_SERIES_LINK_NUMBERFORMAT_TO_SOURCE,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
}
const uno::Sequence< Property > & lcl_GetPropertySequence( DataSeriesPointWrapper::eType _eType )
@@ -704,6 +722,10 @@ const std::vector< WrappedProperty* > DataSeriesPointWrapper::createWrappedPrope
{
WrappedStatisticProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
aWrappedProperties.push_back( new WrappedAttachedAxisProperty( m_spChart2ModelContact ) );
+
+ WrappedNumberFormatProperty* pWrappedNumberFormatProperty = new WrappedNumberFormatProperty( m_spChart2ModelContact );
+ aWrappedProperties.push_back( pWrappedNumberFormatProperty );
+ aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(pWrappedNumberFormatProperty) );
}
WrappedSymbolProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
@@ -750,6 +772,8 @@ const std::vector< WrappedProperty* > DataSeriesPointWrapper::createWrappedPrope
aWrappedProperties.push_back( new WrappedSegmentOffsetProperty() );
aWrappedProperties.push_back( new WrappedProperty( C2U( "D3DPercentDiagonal" ), C2U( "PercentDiagonal" ) ) );
+ aWrappedProperties.push_back( new WrappedTextRotationProperty() );
+
return aWrappedProperties;
}
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index c8220254d94e..4a02d9aa99e5 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -112,6 +112,7 @@ enum
PROP_DIAGRAM_DATAROW_SOURCE,
PROP_DIAGRAM_GROUP_BARS_PER_AXIS,
+ PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
PROP_DIAGRAM_SORT_BY_X_VALUES,
@@ -233,6 +234,13 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
+ rOutProperties.push_back(
+ Property( C2U( "IncludeHiddenCells" ),
+ PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
//new for XY charts
rOutProperties.push_back(
Property( C2U( "SortByXValues" ),
@@ -530,6 +538,10 @@ OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
if( aName.indexOf( C2U("Scatter") ) != -1 )
return C2U( "com.sun.star.chart.XYDiagram" );
+ // "FilledNet" "StackedFilledNet" "PercentStackedFilledNet"
+ if( aName.indexOf( C2U("FilledNet") ) != -1 )
+ return C2U( "com.sun.star.chart.FilledNetDiagram" );
+
// "Net" "NetSymbol" "NetLine" "StackedNet" "StackedNetSymbol"
// "StackedNetLine" "PercentStackedNet" "PercentStackedNetSymbol"
// "PercentStackedNetLine"
@@ -541,6 +553,9 @@ OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
if( aName.indexOf( C2U("Stock") ) != -1 )
return C2U( "com.sun.star.chart.StockDiagram" );
+ if( aName.indexOf( C2U("Bubble") ) != -1 )
+ return C2U( "com.sun.star.chart.BubbleDiagram" );
+
// Note: this must be checked after Bar, Net and Scatter
// "Symbol" "StackedSymbol" "PercentStackedSymbol" "Line" "StackedLine"
@@ -580,12 +595,18 @@ const tMakeStringStringMap& lcl_getChartTypeNameMap()
( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.ScatterChartType" )
, ::rtl::OUString::createFromAscii( "com.sun.star.chart.XYDiagram" ) )
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.FilledNetChartType" )
+ , ::rtl::OUString::createFromAscii( "com.sun.star.chart.FilledNetDiagram" ) )
+
( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.NetChartType" )
, ::rtl::OUString::createFromAscii( "com.sun.star.chart.NetDiagram" ) )
( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.CandleStickChartType" )
, ::rtl::OUString::createFromAscii( "com.sun.star.chart.StockDiagram" ) )
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.BubbleChartType" )
+ , ::rtl::OUString::createFromAscii( "com.sun.star.chart.BubbleDiagram" ) )
+
;
return g_aChartTypeNameMap;
}
@@ -1970,6 +1991,44 @@ Any WrappedAutomaticSizeProperty::getPropertyDefault( const Reference< beans::XP
//-----------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------
+//PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS
+class WrappedIncludeHiddenCellsProperty : public WrappedProperty
+{
+public:
+ WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
+ virtual ~WrappedIncludeHiddenCellsProperty();
+
+ virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
+ throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+private: //member
+ ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
+};
+
+WrappedIncludeHiddenCellsProperty::WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
+ : WrappedProperty(C2U("IncludeHiddenCells"),C2U("IncludeHiddenCells"))
+ , m_spChart2ModelContact( spChart2ModelContact )
+{
+}
+
+WrappedIncludeHiddenCellsProperty::~WrappedIncludeHiddenCellsProperty()
+{
+}
+
+void WrappedIncludeHiddenCellsProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
+ throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ sal_Bool bNewValue = false;
+ if( ! (rOuterValue >>= bNewValue) )
+ throw lang::IllegalArgumentException( C2U("Property Dim3D requires boolean value"), 0, 0 );
+
+ ChartModelHelper::setIncludeHiddenCells( bNewValue, m_spChart2ModelContact->getChartModel() );
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------------------------------------------
+
// ____ XDiagramProvider ____
Reference< chart2::XDiagram > SAL_CALL DiagramWrapper::getDiagram()
throw (uno::RuntimeException)
@@ -2025,6 +2084,8 @@ const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()
aWrappedProperties.push_back( new WrappedProperty( C2U( "StackedBarsConnected" ), C2U( "ConnectBars" ) ) );
aWrappedProperties.push_back( new WrappedSolidTypeProperty( m_spChart2ModelContact ) );
aWrappedProperties.push_back( new WrappedAutomaticSizeProperty() );
+ aWrappedProperties.push_back( new WrappedIncludeHiddenCellsProperty( m_spChart2ModelContact ) );
+
return aWrappedProperties;
}
diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
index 11cf4cbb3102..7aebd872f870 100644
--- a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
@@ -34,7 +34,6 @@
#include "GridWrapper.hxx"
#include "macros.hxx"
#include "AxisHelper.hxx"
-#include "Scaling.hxx"
#include "Chart2ModelContact.hxx"
#include "ContainerHelper.hxx"
#include "AxisIndexDefines.hxx"
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index e0e9511cf71d..a84dbc0cfc4d 100644
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -505,7 +505,7 @@ const std::vector< WrappedProperty* > TitleWrapper::createWrappedProperties()
::std::vector< ::chart::WrappedProperty* > aWrappedProperties;
aWrappedProperties.push_back( new WrappedTitleStringProperty( m_spChart2ModelContact->m_xContext ) );
- aWrappedProperties.push_back( new WrappedTextRotationProperty() );
+ aWrappedProperties.push_back( new WrappedTextRotationProperty( m_eTitleType==TitleHelper::Y_AXIS_TITLE || m_eTitleType==TitleHelper::X_AXIS_TITLE ) );
aWrappedProperties.push_back( new WrappedStackedTextProperty() );
WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this );
WrappedAutomaticPositionProperties::addWrappedProperties( aWrappedProperties );
diff --git a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
index 7e9aa4c6aeb9..efda626e5fd6 100644
--- a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
@@ -33,7 +33,6 @@
#include "WallFloorWrapper.hxx"
#include "macros.hxx"
-#include "Scaling.hxx"
#include "Chart2ModelContact.hxx"
#include "ContainerHelper.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
index 4110a6ef3b54..00101ef10f34 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
@@ -98,8 +98,15 @@ Any WrappedNumberFormatProperty::getPropertyValue( const Reference< beans::XProp
Any aRet( xInnerPropertySet->getPropertyValue( m_aInnerName ));
if( !aRet.hasValue() )
{
- Reference< chart2::XAxis > xAxis( xInnerPropertySet, uno::UNO_QUERY );
- sal_Int32 nKey = m_spChart2ModelContact->getExplicitNumberFormatKeyForAxis( xAxis );
+ sal_Int32 nKey = 0;
+ Reference< chart2::XDataSeries > xSeries( xInnerPropertySet, uno::UNO_QUERY );
+ if( xSeries.is() )
+ nKey = m_spChart2ModelContact->getExplicitNumberFormatKeyForSeries( xSeries );
+ else
+ {
+ Reference< chart2::XAxis > xAxis( xInnerPropertySet, uno::UNO_QUERY );
+ nKey = m_spChart2ModelContact->getExplicitNumberFormatKeyForAxis( xAxis );
+ }
aRet <<= nKey;
}
return aRet;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
index 9c3330932fc1..ffbaac3a5eb0 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx
@@ -33,7 +33,6 @@
#include "WrappedScaleProperty.hxx"
#include "macros.hxx"
-#include "Scaling.hxx"
#include "CommonConverters.hxx"
#include "AxisHelper.hxx"
#include <com/sun/star/chart2/XAxis.hpp>
@@ -280,7 +279,7 @@ void WrappedScaleProperty::setPropertyValue( tScaleProperty eScaleProperty, cons
if( (!bBool) != (!bWasLogarithm) )
{
if( bBool )
- aScaleData.Scaling = new LogarithmicScaling( 10.0 );
+ aScaleData.Scaling = AxisHelper::createLogarithmicScaling( 10.0 );
else
aScaleData.Scaling = 0;
bSetScaleData = true;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
index 96067e01c510..e5f45408217e 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx
@@ -54,23 +54,6 @@ void WrappedSceneProperty::addWrappedProperties( std::vector< WrappedProperty* >
, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
{
rList.push_back( new WrappedD3DTransformMatrixProperty( spChart2ModelContact ) );
- /*
- rList.push_back( new WrappedD3DSceneShadeModeProperty() );
- rList.push_back( new WrappedD3DScenePerspectiveProperty() );
- rList.push_back( new WrappedD3DSceneAmbientColorProperty() );
- for( sal_Int32 nN=1; nN<=8; nN++ )
- {
- rList.push_back( new WrappedD3DSceneLightColorProperty(nN) );
- rList.push_back( new WrappedD3DSceneLightDirectionProperty(nN) );
- rList.push_back( new WrappedD3DSceneLightOnProperty(nN) );
- }
-
- rList.push_back( new WrappedD3DSceneDistanceProperty() );
- rList.push_back( new WrappedD3DSceneFocalLengthProperty() );
- rList.push_back( new WrappedD3DSceneShadowSlantProperty() );
- rList.push_back( new WrappedD3DSceneTwoSidedLightingProperty() );
- rList.push_back( new WrappedD3DCameraGeometryProperty() );
- */
}
//----------------------------------------------------------------------------------------------------------------------
@@ -146,546 +129,6 @@ Any WrappedD3DTransformMatrixProperty::getPropertyDefault( const Reference< bean
return WrappedProperty::getPropertyDefault( xInnerPropertyState );
}
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-/*
-WrappedD3DSceneShadeModeProperty::WrappedD3DSceneShadeModeProperty()
- : WrappedProperty(C2U("D3DSceneShadeMode"),OUString())
-{
-}
-
-WrappedD3DSceneShadeModeProperty::~WrappedD3DSceneShadeModeProperty()
-{
-}
-
-void WrappedD3DSceneShadeModeProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- drawing::ShadeMode aNewValue;
- if( !(rOuterValue >>= aNewValue) )
- throw lang::IllegalArgumentException( C2U("Property D3DSceneShadeMode requires value of type drawing::ShadeMode"), 0, 0 );
-
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DSceneShadeMode" );
- return;
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
-
- if( aSceneDescriptor.aShadeMode != aNewValue )
- {
- aSceneDescriptor.aShadeMode = aNewValue;
- xInnerPropertySet->setPropertyValue( C2U( "SceneProperties" ), uno::makeAny( aSceneDescriptor ) );
- }
-}
-
-Any WrappedD3DSceneShadeModeProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DTransformMatrix" );
- return Any();
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
- return uno::makeAny( aSceneDescriptor.aShadeMode );
-}
-
-Any WrappedD3DSceneShadeModeProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return uno::makeAny( drawing::ShadeMode_SMOOTH );
-}
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-WrappedD3DScenePerspectiveProperty::WrappedD3DScenePerspectiveProperty()
- : WrappedProperty(C2U("D3DScenePerspective"),OUString())
-{
-}
-
-WrappedD3DScenePerspectiveProperty::~WrappedD3DScenePerspectiveProperty()
-{
-}
-
-void WrappedD3DScenePerspectiveProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- drawing::ProjectionMode aNewValue;
- if( !(rOuterValue >>= aNewValue) )
- throw lang::IllegalArgumentException( C2U("Property D3DScenePerspective requires value of type drawing::ProjectionMode"), 0, 0 );
-
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DScenePerspective" );
- return;
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
-
- if( aSceneDescriptor.aProjectionMode != aNewValue )
- {
- aSceneDescriptor.aProjectionMode = aNewValue;
- xInnerPropertySet->setPropertyValue( C2U( "SceneProperties" ), uno::makeAny( aSceneDescriptor ) );
- }
-}
-
-Any WrappedD3DScenePerspectiveProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DTransformMatrix" );
- return Any();
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
- return uno::makeAny( aSceneDescriptor.aProjectionMode );
-}
-
-Any WrappedD3DScenePerspectiveProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return uno::makeAny( drawing::ProjectionMode_PERSPECTIVE );
-}
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-WrappedD3DSceneAmbientColorProperty::WrappedD3DSceneAmbientColorProperty()
- : WrappedProperty(C2U("D3DSceneAmbientColor"),OUString())
-{
-}
-
-WrappedD3DSceneAmbientColorProperty::~WrappedD3DSceneAmbientColorProperty()
-{
-}
-
-void WrappedD3DSceneAmbientColorProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- sal_Int32 nNewColor;
- if( !(rOuterValue >>= nNewColor) )
- throw lang::IllegalArgumentException( C2U("Property D3DSceneAmbientColor requires value of type sal_Int32"), 0, 0 );
-
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DSceneAmbientColor" );
- return;
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
-
- if( aSceneDescriptor.nAmbientLightColor != nNewColor )
- {
- aSceneDescriptor.nAmbientLightColor = nNewColor;
- xInnerPropertySet->setPropertyValue( C2U( "SceneProperties" ), uno::makeAny( aSceneDescriptor ) );
- }
-}
-
-Any WrappedD3DSceneAmbientColorProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DSceneAmbientColor" );
- return Any();
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
- return uno::makeAny( aSceneDescriptor.nAmbientLightColor );
-}
-
-Any WrappedD3DSceneAmbientColorProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return uno::makeAny( sal_Int32(0x666666) ); // grey40
-}
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-WrappedD3DSceneLightColorProperty::WrappedD3DSceneLightColorProperty( sal_Int32 nLightNumber )
- : WrappedProperty(C2U("D3DSceneLightColor"),OUString())
- , m_nLightIndex( nLightNumber-1 )
-{
- if( m_nLightIndex < 0 )
- m_nLightIndex = 0;
-
- m_aOuterName += OUString::valueOf( nLightNumber );
-}
-
-WrappedD3DSceneLightColorProperty::~WrappedD3DSceneLightColorProperty()
-{
-}
-
-void WrappedD3DSceneLightColorProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- sal_Int32 nNewColor;
- if( !(rOuterValue >>= nNewColor) )
- throw lang::IllegalArgumentException( C2U("Property D3DSceneAmbientColor requires value of type sal_Int32"), 0, 0 );
-
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DSceneAmbientColor" );
- return;
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
-
- if( aSceneDescriptor.aLightSources.getLength() <= m_nLightIndex )
- aSceneDescriptor.aLightSources.realloc(m_nLightIndex+1);
-
- if( aSceneDescriptor.aLightSources[m_nLightIndex].nDiffuseColor != nNewColor )
- {
- aSceneDescriptor.aLightSources[m_nLightIndex].nDiffuseColor = nNewColor;
- xInnerPropertySet->setPropertyValue( C2U( "SceneProperties" ), uno::makeAny( aSceneDescriptor ) );
- }
-}
-
-Any WrappedD3DSceneLightColorProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DSceneAmbientColor" );
- return Any();
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
- if( aSceneDescriptor.aLightSources.getLength() <= m_nLightIndex )
- return getPropertyDefault( 0 );
-
- return uno::makeAny( aSceneDescriptor.aLightSources[m_nLightIndex].nDiffuseColor );
-}
-
-Any WrappedD3DSceneLightColorProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if(m_nLightIndex==1)
- return uno::makeAny( sal_Int32(0xcccccc) ); // grey80
- return uno::makeAny( sal_Int32(0xffffff) ); // white
-}
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-WrappedD3DSceneLightDirectionProperty::WrappedD3DSceneLightDirectionProperty( sal_Int32 nLightNumber )
- : WrappedProperty(C2U("D3DSceneLightDirection"),OUString())
- , m_nLightIndex( nLightNumber-1 )
-{
- if( m_nLightIndex < 0 )
- m_nLightIndex = 0;
-
- m_aOuterName += OUString::valueOf( nLightNumber );
-}
-
-WrappedD3DSceneLightDirectionProperty::~WrappedD3DSceneLightDirectionProperty()
-{
-}
-
-void WrappedD3DSceneLightDirectionProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- drawing::Direction3D aNewValue;
- if( !(rOuterValue >>= aNewValue) )
- throw lang::IllegalArgumentException( C2U("Property D3DSceneLightDirection requires value of type drawing::Direction3D"), 0, 0 );
-
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DSceneLightDirection" );
- return;
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
-
- if( aSceneDescriptor.aLightSources.getLength() <= m_nLightIndex )
- aSceneDescriptor.aLightSources.realloc(m_nLightIndex+1);
-
- if( Direction3DToB3DPoint( aSceneDescriptor.aLightSources[m_nLightIndex].aDirection ) != Direction3DToB3DPoint( aNewValue ) )
- {
- aSceneDescriptor.aLightSources[m_nLightIndex].aDirection = aNewValue;
- xInnerPropertySet->setPropertyValue( C2U( "SceneProperties" ), uno::makeAny( aSceneDescriptor ) );
- }
-}
-
-Any WrappedD3DSceneLightDirectionProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DSceneLightDirection" );
- return Any();
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
- if( aSceneDescriptor.aLightSources.getLength() <= m_nLightIndex )
- return getPropertyDefault( 0 );
-
- return uno::makeAny( aSceneDescriptor.aLightSources[m_nLightIndex].aDirection );
-}
-
-Any WrappedD3DSceneLightDirectionProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return uno::makeAny( drawing::Direction3D( 1, 1, 1 ) );
-}
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-WrappedD3DSceneLightOnProperty::WrappedD3DSceneLightOnProperty( sal_Int32 nLightNumber )
- : WrappedProperty(C2U("D3DSceneLightOn"),OUString())
- , m_nLightIndex( nLightNumber-1 )
-{
- if( m_nLightIndex < 0 )
- m_nLightIndex = 0;
-
- m_aOuterName += OUString::valueOf( nLightNumber );
-}
-
-WrappedD3DSceneLightOnProperty::~WrappedD3DSceneLightOnProperty()
-{
-}
-
-void WrappedD3DSceneLightOnProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- sal_Bool bNewValue;
- if( !(rOuterValue >>= bNewValue) )
- throw lang::IllegalArgumentException( C2U("Property D3DSceneLightOn requires value of type sal_Bool"), 0, 0 );
-
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DSceneLightOn" );
- return;
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
-
- if( aSceneDescriptor.aLightSources.getLength() <= m_nLightIndex )
- aSceneDescriptor.aLightSources.realloc(m_nLightIndex+1);
-
- if( aSceneDescriptor.aLightSources[m_nLightIndex].bIsEnabled != bNewValue )
- {
- aSceneDescriptor.aLightSources[m_nLightIndex].bIsEnabled = bNewValue;
- xInnerPropertySet->setPropertyValue( C2U( "SceneProperties" ), uno::makeAny( aSceneDescriptor ) );
- }
-}
-
-Any WrappedD3DSceneLightOnProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if( !xInnerPropertySet.is() )
- {
- DBG_ERROR( "need xInnerPropertySet to wrap property D3DSceneLightOn" );
- return Any();
- }
-
- chart2::SceneDescriptor aSceneDescriptor;
- xInnerPropertySet->getPropertyValue( C2U( "SceneProperties" ) )>>=aSceneDescriptor;
- if( aSceneDescriptor.aLightSources.getLength() <= m_nLightIndex )
- return getPropertyDefault( 0 );
-
- return uno::makeAny( aSceneDescriptor.aLightSources[m_nLightIndex].bIsEnabled );
-}
-
-Any WrappedD3DSceneLightOnProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if(m_nLightIndex==1)
- return uno::makeAny( sal_Bool(sal_True) );
- return uno::makeAny( sal_Bool(sal_False) );
-}
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-WrappedD3DSceneDistanceProperty::WrappedD3DSceneDistanceProperty()
- : WrappedProperty(C2U("D3DSceneDistance"),OUString())
-{
-}
-
-WrappedD3DSceneDistanceProperty::~WrappedD3DSceneDistanceProperty()
-{
-}
-
-void WrappedD3DSceneDistanceProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return; //this property is not supported anymore
-}
-
-Any WrappedD3DSceneDistanceProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return getPropertyDefault(0);//this property is not supported anymore
-}
-
-Any WrappedD3DSceneDistanceProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- Any aRet;
- aRet <<= sal_Int32(419);
- return aRet;
-}
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-WrappedD3DSceneFocalLengthProperty::WrappedD3DSceneFocalLengthProperty()
- : WrappedProperty(C2U("D3DSceneFocalLength"),OUString())
-{
-}
-
-WrappedD3DSceneFocalLengthProperty::~WrappedD3DSceneFocalLengthProperty()
-{
-}
-
-void WrappedD3DSceneFocalLengthProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return; //this property is not supported anymore
-}
-
-Any WrappedD3DSceneFocalLengthProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return getPropertyDefault(0);//this property is not supported anymore
-}
-
-Any WrappedD3DSceneFocalLengthProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- Any aRet;
- aRet <<= sal_Int32(800);
- return aRet;
-}
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-WrappedD3DSceneShadowSlantProperty::WrappedD3DSceneShadowSlantProperty()
- : WrappedProperty(C2U("D3DSceneShadowSlant"),OUString())
-{
-}
-
-WrappedD3DSceneShadowSlantProperty::~WrappedD3DSceneShadowSlantProperty()
-{
-}
-
-void WrappedD3DSceneShadowSlantProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return; //this property is not supported anymore
-}
-
-Any WrappedD3DSceneShadowSlantProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return getPropertyDefault(0);//this property is not supported anymore
-}
-
-Any WrappedD3DSceneShadowSlantProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- Any aRet;
- aRet <<= sal_Int32(0);
- return aRet;
-}
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-WrappedD3DSceneTwoSidedLightingProperty::WrappedD3DSceneTwoSidedLightingProperty()
- : WrappedProperty(C2U("D3DSceneTwoSidedLighting"),OUString())
-{
-}
-
-WrappedD3DSceneTwoSidedLightingProperty::~WrappedD3DSceneTwoSidedLightingProperty()
-{
-}
-
-void WrappedD3DSceneTwoSidedLightingProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return; //this property is not supported anymore
-}
-
-Any WrappedD3DSceneTwoSidedLightingProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return getPropertyDefault(0);//this property is not supported anymore
-}
-
-Any WrappedD3DSceneTwoSidedLightingProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- Any aRet;
- aRet <<= sal_Bool(sal_False);
- return aRet;
-}
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-WrappedD3DCameraGeometryProperty::WrappedD3DCameraGeometryProperty()
- : WrappedProperty(C2U("D3DCameraGeometry"),OUString())
-{
-}
-
-WrappedD3DCameraGeometryProperty::~WrappedD3DCameraGeometryProperty()
-{
-}
-
-void WrappedD3DCameraGeometryProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return; //this property is not supported anymore
-}
-
-Any WrappedD3DCameraGeometryProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return getPropertyDefault(0);//this property is not supported anymore
-}
-
-Any WrappedD3DCameraGeometryProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return Any();
-}
-*/
-
} //namespace wrapper
} //namespace chart
//.............................................................................
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.hxx
index f587954968bb..520524e7c4d3 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.hxx
@@ -77,240 +77,6 @@ private:
::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
};
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-/*
-class WrappedD3DSceneShadeModeProperty : public WrappedProperty
-{
-public:
- WrappedD3DSceneShadeModeProperty();
- virtual ~WrappedD3DSceneShadeModeProperty();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-};
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-class WrappedD3DScenePerspectiveProperty : public WrappedProperty
-{
-public:
- WrappedD3DScenePerspectiveProperty();
- virtual ~WrappedD3DScenePerspectiveProperty();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-};
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-class WrappedD3DSceneAmbientColorProperty : public WrappedProperty
-{
-public:
- WrappedD3DSceneAmbientColorProperty();
- virtual ~WrappedD3DSceneAmbientColorProperty();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-};
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-class WrappedD3DSceneLightColorProperty : public WrappedProperty
-{
-public:
- WrappedD3DSceneLightColorProperty( sal_Int32 nLightNumber );
- virtual ~WrappedD3DSceneLightColorProperty();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
-private:
- sal_Int32 m_nLightIndex;
-};
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-class WrappedD3DSceneLightDirectionProperty : public WrappedProperty
-{
-public:
- WrappedD3DSceneLightDirectionProperty( sal_Int32 nLightNumber );
- virtual ~WrappedD3DSceneLightDirectionProperty();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
-private:
- sal_Int32 m_nLightIndex;
-};
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-class WrappedD3DSceneLightOnProperty : public WrappedProperty
-{
-public:
- WrappedD3DSceneLightOnProperty( sal_Int32 nLightNumber );
- virtual ~WrappedD3DSceneLightOnProperty();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
-private:
- sal_Int32 m_nLightIndex;
-};
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-class WrappedD3DSceneDistanceProperty : public WrappedProperty
-{
-public:
- WrappedD3DSceneDistanceProperty();
- virtual ~WrappedD3DSceneDistanceProperty();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-};
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-class WrappedD3DSceneShadowSlantProperty : public WrappedProperty
-{
-public:
- WrappedD3DSceneShadowSlantProperty();
- virtual ~WrappedD3DSceneShadowSlantProperty();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-};
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-class WrappedD3DSceneFocalLengthProperty : public WrappedProperty
-{
-public:
- WrappedD3DSceneFocalLengthProperty();
- virtual ~WrappedD3DSceneFocalLengthProperty();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-};
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-class WrappedD3DSceneTwoSidedLightingProperty : public WrappedProperty
-{
-public:
- WrappedD3DSceneTwoSidedLightingProperty();
- virtual ~WrappedD3DSceneTwoSidedLightingProperty();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-};
-
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-//----------------------------------------------------------------------------------------------------------------------
-
-class WrappedD3DCameraGeometryProperty : public WrappedProperty
-{
-public:
- WrappedD3DCameraGeometryProperty ();
- virtual ~WrappedD3DCameraGeometryProperty ();
-
- virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-};
-*/
-
-
} //namespace wrapper
} //namespace chart
//.............................................................................
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
index a090e670bc8b..226bfd14bf4d 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
@@ -208,7 +208,7 @@ protected:
if( !xErrorBarProperties.is() )
{
// todo: use a valid context
- xErrorBarProperties = new ::chart::ErrorBar( uno::Reference< uno::XComponentContext >() );
+ xErrorBarProperties = ::chart::createErrorBar( uno::Reference< uno::XComponentContext >() );
//default in new and old api are different
xErrorBarProperties->setPropertyValue( C2U( "ShowPositiveError" ), uno::makeAny(sal_Bool(sal_False)) );
xErrorBarProperties->setPropertyValue( C2U( "ShowNegativeError" ), uno::makeAny(sal_Bool(sal_False)) );
diff --git a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx
index bd505d6edac5..07532a4ecf22 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx
@@ -33,7 +33,9 @@
#include "WrappedTextRotationProperty.hxx"
#include "macros.hxx"
+#include <com/sun/star/beans/XPropertyState.hpp>
+using namespace ::com::sun::star;
using ::com::sun::star::uno::Any;
using ::rtl::OUString;
@@ -43,13 +45,23 @@ namespace chart
{
//.............................................................................
-WrappedTextRotationProperty::WrappedTextRotationProperty()
+WrappedTextRotationProperty::WrappedTextRotationProperty( bool bDirectState )
: ::chart::WrappedProperty( C2U( "TextRotation" ), C2U( "TextRotation" ) )
+ , m_bDirectState( bDirectState )
{
}
WrappedTextRotationProperty::~WrappedTextRotationProperty()
{
}
+
+beans::PropertyState WrappedTextRotationProperty::getPropertyState( const uno::Reference< beans::XPropertyState >& xInnerPropertyState ) const
+ throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ if( m_bDirectState )
+ return beans::PropertyState_DIRECT_VALUE;
+ return WrappedProperty::getPropertyState( xInnerPropertyState );
+}
+
Any WrappedTextRotationProperty::convertInnerToOuterValue( const Any& rInnerValue ) const
{
Any aRet;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.hxx
index 38a516bbc1b9..54fbf38e53d7 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.hxx
@@ -40,12 +40,17 @@ namespace chart
class WrappedTextRotationProperty : public WrappedProperty
{
public:
- WrappedTextRotationProperty();
+ WrappedTextRotationProperty( bool bDirectState=false );
virtual ~WrappedTextRotationProperty();
+ virtual ::com::sun::star::beans::PropertyState getPropertyState( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
+ throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+
protected:
virtual ::com::sun::star::uno::Any convertInnerToOuterValue( const ::com::sun::star::uno::Any& rInnerValue ) const;
virtual ::com::sun::star::uno::Any convertOuterToInnerValue( const ::com::sun::star::uno::Any& rOuterValue ) const;
+
+ bool m_bDirectState;
};
//.............................................................................
diff --git a/chart2/source/controller/dialogs/Bitmaps.hrc b/chart2/source/controller/dialogs/Bitmaps.hrc
index 58b1d540cc1a..8823b582a28e 100644
--- a/chart2/source/controller/dialogs/Bitmaps.hrc
+++ b/chart2/source/controller/dialogs/Bitmaps.hrc
@@ -34,23 +34,28 @@
#include <svtools/solar.hrc>
#endif
-// next free: 100
-
#ifndef STD_MASKCOLOR
#define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }
#endif
//-----------------------------------------------------------------------------
// chart types
+// Images:
#define IMG_TYPE_COLUMN (RID_APP_START + 1)
#define IMG_TYPE_BAR (RID_APP_START + 2)
#define IMG_TYPE_PIE (RID_APP_START + 3)
-#define IMG_TYPE_LINE (RID_APP_START + 4)
-#define IMG_TYPE_AREA (RID_APP_START + 5)
-#define IMG_TYPE_NET (RID_APP_START + 6)
-#define IMG_TYPE_STOCK (RID_APP_START + 7)
-#define IMG_TYPE_COLUMN_LINE (RID_APP_START + 8)
+#define IMG_TYPE_AREA (RID_APP_START + 4)
+#define IMG_TYPE_LINE (RID_APP_START + 5)
+#define IMG_TYPE_XY (RID_APP_START + 6)
+#define IMG_TYPE_BUBBLE (RID_APP_START + 7)
+#define IMG_TYPE_NET (RID_APP_START + 8)
+#define IMG_TYPE_STOCK (RID_APP_START + 9)
+#define IMG_TYPE_COLUMN_LINE (RID_APP_START + 10)
+
+//-----------------------------------------------------------------------------
+//Chart Subtypes
+// Bitmaps:
//----------------------
// Column Chart Subtypes
@@ -168,8 +173,8 @@
#define BMP_NET_SYMB_STACK (RID_APP_START + 77)
#define BMP_NET_LINESYMB (RID_APP_START + 78)
#define BMP_NET_LINESYMB_STACK (RID_APP_START + 79)
-#define BMP_NET_FILLED (RID_APP_START + 80)
-#define BMP_NET_FILLED_STACKED (RID_APP_START + 81)
+#define BMP_NET_FILL (RID_APP_START + 80)
+#define BMP_NET_FILL_STACK (RID_APP_START + 81)
//----------------------
// Stock Chart Subtypes
@@ -185,7 +190,13 @@
#define BMP_COLUMN_LINE (RID_APP_START + 86)
#define BMP_COLUMN_LINE_STACKED (RID_APP_START + 87)
+//----------------------
+// Bubble Chart Subtypes
+#define BMP_BUBBLE_1 (RID_APP_START + 88)
+
//-----------------------------------------------------------------------------
+//further Images:
+
//SchStatisticTabPage and SchDataStatisticsDlg part 1
#define BMP_INDICATE_BOTH_VERTI (RID_APP_START + 89)
#define BMP_INDICATE_UP (RID_APP_START + 90)
@@ -201,9 +212,8 @@
#define BMP_REGRESSION_EXP (RID_APP_START + 95)
#define BMP_REGRESSION_POWER (RID_APP_START + 96)
-//-----------------------------------------------------------------------------
// hide-button for range-choosing
-#define IMG_SELECTRANGE (RID_APP_START + 9)
+#define IMG_SELECTRANGE (RID_APP_START + 100)
// CHART_BITMAPS_HRC
#endif
diff --git a/chart2/source/controller/dialogs/Bitmaps.src b/chart2/source/controller/dialogs/Bitmaps.src
index 2af607b6963c..67d8588897d8 100644
--- a/chart2/source/controller/dialogs/Bitmaps.src
+++ b/chart2/source/controller/dialogs/Bitmaps.src
@@ -49,6 +49,11 @@ Image IMG_TYPE_LINE
ImageBitmap = Bitmap { File = "typepointline_16.png" ; };
MaskColor = STD_MASKCOLOR;
};
+Image IMG_TYPE_XY
+{
+ ImageBitmap = Bitmap { File = "typexy_16.png" ; };
+ MaskColor = STD_MASKCOLOR;
+};
Image IMG_TYPE_AREA
{
ImageBitmap = Bitmap { File = "typearea_16.png" ; };
@@ -69,6 +74,15 @@ Image IMG_TYPE_COLUMN_LINE
ImageBitmap = Bitmap { File = "typecolumnline_16.png" ; };
MaskColor = STD_MASKCOLOR;
};
+Image IMG_TYPE_BUBBLE
+{
+ ImageBitmap = Bitmap { File = "typebubble_16.png" ; };
+ MaskColor = STD_MASKCOLOR;
+};
+Bitmap BMP_BUBBLE_1
+{
+ File = "bubble_52x60.png" ;
+};
Bitmap BMP_AREAS_2D
{
File = "areas_52x60.png" ;
@@ -345,13 +359,13 @@ Bitmap BMP_NET_LINESYMB_STACK
{
File = "netlinepointstack_52x60.png" ;
};
-Bitmap BMP_NET_FILLED
+Bitmap BMP_NET_FILL
{
- File = "net_52x60.png" ;
+ File = "netfill_52x60.png" ;
};
-Bitmap BMP_NET_FILLED_STACKED
+Bitmap BMP_NET_FILL_STACK
{
- File = "netstack_52x60.png" ;
+ File = "netstackfill_52x60.png" ;
};
//---------------------
Bitmap BMP_PYRAMIDQ_3D_1
diff --git a/chart2/source/controller/dialogs/Bitmaps_HC.hrc b/chart2/source/controller/dialogs/Bitmaps_HC.hrc
index 0b65579973c5..8dd4acaffd15 100644
--- a/chart2/source/controller/dialogs/Bitmaps_HC.hrc
+++ b/chart2/source/controller/dialogs/Bitmaps_HC.hrc
@@ -41,15 +41,22 @@
//-----------------------------------------------------------------------------
// chart types
+// Images:
#define IMG_TYPE_COLUMN_HC (RID_SCH_START + 1)
#define IMG_TYPE_BAR_HC (RID_SCH_START + 2)
#define IMG_TYPE_PIE_HC (RID_SCH_START + 3)
-#define IMG_TYPE_LINE_HC (RID_SCH_START + 4)
-#define IMG_TYPE_AREA_HC (RID_SCH_START + 5)
-#define IMG_TYPE_NET_HC (RID_SCH_START + 6)
-#define IMG_TYPE_STOCK_HC (RID_SCH_START + 7)
-#define IMG_TYPE_COLUMN_LINE_HC (RID_SCH_START + 8)
+#define IMG_TYPE_AREA_HC (RID_SCH_START + 4)
+#define IMG_TYPE_LINE_HC (RID_SCH_START + 5)
+#define IMG_TYPE_XY_HC (RID_SCH_START + 6)
+#define IMG_TYPE_BUBBLE_HC (RID_SCH_START + 7)
+#define IMG_TYPE_NET_HC (RID_SCH_START + 8)
+#define IMG_TYPE_STOCK_HC (RID_SCH_START + 9)
+#define IMG_TYPE_COLUMN_LINE_HC (RID_SCH_START + 10)
+
+//-----------------------------------------------------------------------------
+//Chart Subtypes
+// Bitmaps:
//----------------------
// Column Chart Subtypes
@@ -166,8 +173,8 @@
#define BMP_NET_SYMB_STACK_HC (RID_SCH_START + 77)
#define BMP_NET_LINESYMB_HC (RID_SCH_START + 78)
#define BMP_NET_LINESYMB_STACK_HC (RID_SCH_START + 79)
-#define BMP_NET_FILLED_HC (RID_SCH_START + 80)
-#define BMP_NET_FILLED_STACKED_HC (RID_SCH_START + 81)
+#define BMP_NET_FILL_HC (RID_SCH_START + 80)
+#define BMP_NET_FILL_STACK_HC (RID_SCH_START + 81)
//----------------------
// Stock Chart Subtypes
@@ -183,7 +190,13 @@
#define BMP_COLUMN_LINE_HC (RID_SCH_START + 86)
#define BMP_COLUMN_LINE_STACKED_HC (RID_SCH_START + 87)
+//----------------------
+// Bubble Chart Subtypes
+#define BMP_BUBBLE_1_HC (RID_SCH_START + 88)
+
//-----------------------------------------------------------------------------
+//further Images:
+
//SchStatisticTabPage and SchDataStatisticsDlg part 1
#define BMP_INDICATE_BOTH_VERTI_HC (RID_SCH_START + 89)
#define BMP_INDICATE_UP_HC (RID_SCH_START + 90)
@@ -199,6 +212,5 @@
#define BMP_REGRESSION_EXP_HC (RID_SCH_START + 95)
#define BMP_REGRESSION_POWER_HC (RID_SCH_START + 96)
-//-----------------------------------------------------------------------------
// hide-button for range-choosing
-#define IMG_SELECTRANGE_HC (RID_SCH_START + 9)
+#define IMG_SELECTRANGE_HC (RID_SCH_START + 100)
diff --git a/chart2/source/controller/dialogs/Bitmaps_HC.src b/chart2/source/controller/dialogs/Bitmaps_HC.src
index 1e2fe5f4ba14..a82893273ae2 100644
--- a/chart2/source/controller/dialogs/Bitmaps_HC.src
+++ b/chart2/source/controller/dialogs/Bitmaps_HC.src
@@ -49,6 +49,11 @@ Image IMG_TYPE_LINE_HC
ImageBitmap = Bitmap { File = "typepointline_16.png" ; };
MaskColor = SC_HC_MASKCOLOR;
};
+Image IMG_TYPE_XY_HC
+{
+ ImageBitmap = Bitmap { File = "typexy_16.png" ; };
+ MaskColor = SC_HC_MASKCOLOR;
+};
Image IMG_TYPE_AREA_HC
{
ImageBitmap = Bitmap { File = "typearea_16.png" ; };
@@ -69,6 +74,15 @@ Image IMG_TYPE_COLUMN_LINE_HC
ImageBitmap = Bitmap { File = "typecolumnline_16.png" ; };
MaskColor = SC_HC_MASKCOLOR;
};
+Image IMG_TYPE_BUBBLE_HC
+{
+ ImageBitmap = Bitmap { File = "typebubble_16.png" ; };
+ MaskColor = SC_HC_MASKCOLOR;
+};
+Bitmap BMP_BUBBLE_1_HC
+{
+ File = "bubble_52x60_h.png" ;
+};
Bitmap BMP_AREAS_2D_HC
{
File = "areas_52x60_h.png" ;
@@ -345,13 +359,13 @@ Bitmap BMP_NET_LINESYMB_STACK_HC
{
File = "netlinepointstack_52x60_h.png" ;
};
-Bitmap BMP_NET_FILLED_HC
+Bitmap BMP_NET_FILL_HC
{
- File = "net_52x60_h.png" ;
+ File = "netfill_52x60_h.png" ;
};
-Bitmap BMP_NET_FILLED_STACKED_HC
+Bitmap BMP_NET_FILL_STACK_HC
{
- File = "netstack_52x60_h.png" ;
+ File = "netstackfill_52x60_h.png" ;
};
//---------------------
Bitmap BMP_PYRAMIDQ_3D_1_HC
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index 79efe0b04919..fa51d17a03d8 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -808,7 +808,7 @@ String XYChartDialogController::getName()
}
Image XYChartDialogController::getImage( bool bIsHighContrast )
{
- return SELECT_IMAGE( IMG_TYPE_LINE );
+ return SELECT_IMAGE( IMG_TYPE_XY );
}
const tTemplateServiceChartTypeParameterMap& XYChartDialogController::getTemplateMap() const
{
@@ -1000,6 +1000,10 @@ const tTemplateServiceChartTypeParameterMap& NetChartDialogController::getTempla
( C2U( "com.sun.star.chart2.template.NetLine" ), ChartTypeParameter(3,false,false,GlobalStackMode_NONE,false,true) )
( C2U( "com.sun.star.chart2.template.StackedNetLine" ), ChartTypeParameter(3,false,false,GlobalStackMode_STACK_Y,false,true) )
( C2U( "com.sun.star.chart2.template.PercentStackedNetLine" ), ChartTypeParameter(3,false,false,GlobalStackMode_STACK_Y_PERCENT,false,true) )
+
+ ( C2U( "com.sun.star.chart2.template.FilledNet" ), ChartTypeParameter(4,false,false,GlobalStackMode_NONE,false,false) )
+ ( C2U( "com.sun.star.chart2.template.StackedFilledNet" ), ChartTypeParameter(4,false,false,GlobalStackMode_STACK_Y,false,false) )
+ ( C2U( "com.sun.star.chart2.template.PercentStackedFilledNet" ),ChartTypeParameter(4,false,false,GlobalStackMode_STACK_Y_PERCENT,false,false) )
;
return m_aTemplateMap;
}
@@ -1012,17 +1016,20 @@ void NetChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, bool bIs
rSubTypeList.InsertItem( 1, SELECT_BITMAP( BMP_NET_SYMB ) );
rSubTypeList.InsertItem( 2, SELECT_BITMAP( BMP_NET_LINESYMB ) );
rSubTypeList.InsertItem( 3, SELECT_BITMAP( BMP_NET ) );
+ rSubTypeList.InsertItem( 4, SELECT_BITMAP( BMP_NET_FILL ) );
}
else
{
rSubTypeList.InsertItem( 1, SELECT_BITMAP( BMP_NET_SYMB_STACK ) );
rSubTypeList.InsertItem( 2, SELECT_BITMAP( BMP_NET_LINESYMB_STACK ) );
rSubTypeList.InsertItem( 3, SELECT_BITMAP( BMP_NET_STACK ) );
+ rSubTypeList.InsertItem( 4, SELECT_BITMAP( BMP_NET_FILL_STACK ) );
}
rSubTypeList.SetItemText( 1, String( SchResId( STR_POINTS_ONLY )) );
rSubTypeList.SetItemText( 2, String( SchResId( STR_POINTS_AND_LINES )) );
rSubTypeList.SetItemText( 3, String( SchResId( STR_LINES_ONLY )) );
+ rSubTypeList.SetItemText( 4, String( SchResId( STR_FILLED )) );
}
void NetChartDialogController::adjustParameterToSubType( ChartTypeParameter& rParameter )
{
@@ -1040,6 +1047,10 @@ void NetChartDialogController::adjustParameterToSubType( ChartTypeParameter& rPa
rParameter.bSymbols = false;
rParameter.bLines = true;
break;
+ case 4:
+ rParameter.bSymbols = false;
+ rParameter.bLines = false;
+ break;
default:
rParameter.bSymbols = true;
rParameter.bLines = false;
@@ -1238,6 +1249,40 @@ void CombiColumnLineChartDialogController::adjustParameterToSubType( ChartTypePa
break;
}
}
+//--------------------------------------------------------------------------
+BubbleChartDialogController::BubbleChartDialogController()
+{
+}
+BubbleChartDialogController::~BubbleChartDialogController()
+{
+}
+String BubbleChartDialogController::getName()
+{
+ return String( SchResId( STR_TYPE_BUBBLE ));
+}
+Image BubbleChartDialogController::getImage( bool bIsHighContrast )
+{
+ return SELECT_IMAGE( IMG_TYPE_BUBBLE );
+}
+const tTemplateServiceChartTypeParameterMap& BubbleChartDialogController::getTemplateMap() const
+{
+ static tTemplateServiceChartTypeParameterMap m_aTemplateMap =
+ tTemplateServiceChartTypeParameterMap
+ ( C2U( "com.sun.star.chart2.template.Bubble" ), ChartTypeParameter(1,true) ) ;
+ return m_aTemplateMap;
+}
+void BubbleChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, bool bIsHighContrast, const ChartTypeParameter& /*rParameter*/ )
+{
+ rSubTypeList.Clear();
+ rSubTypeList.InsertItem( 1, SELECT_BITMAP( BMP_BUBBLE_1 ) );
+
+ rSubTypeList.SetItemText( 1, String( SchResId( STR_BUBBLE_1 )) );
+}
+void BubbleChartDialogController::adjustParameterToSubType( ChartTypeParameter& rParameter )
+{
+ rParameter.b3DLook = false;
+ rParameter.eStackMode = GlobalStackMode_NONE;
+}
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
index 0f6c7a8ae2c0..cdbda807813f 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
@@ -301,6 +301,19 @@ private:
MetricField* m_pMF_NumberOfLines;
};
+class BubbleChartDialogController : public ChartTypeDialogController
+{
+public:
+ BubbleChartDialogController();
+ virtual ~BubbleChartDialogController();
+
+ virtual String getName();
+ virtual Image getImage( bool bIsHighContrast );
+ virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const;
+ virtual void fillSubTypeList( ValueSet& rSubTypeList, bool bIsHighContrast, const ChartTypeParameter& rParameter );
+ virtual void adjustParameterToSubType( ChartTypeParameter& rParameter );
+};
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 6dbce3afac61..56ef98b159ba 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -101,33 +101,6 @@ using namespace ::svt;
namespace
{
-void lcl_setNumberFormat(
- SvNumberFormatter * pNumFormatter, long nFmt,
- double fData, String & rOutString )
-{
- short eType = pNumFormatter->GetType( nFmt );
-
- // change nFmt to an editable format (without loss of information)
- if( eType == NUMBERFORMAT_CURRENCY ) // for currencies just display decimals
- {
- nFmt = pNumFormatter->GetStandardIndex();
- }
- else
- {
- const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt );
- if( pFormat )
- {
- LanguageType eLanguage = pFormat->GetLanguage();
- nFmt = pNumFormatter->GetStandardFormat( nFmt, eType, eLanguage );
- }
- // else: format is 'standard'
- }
-
- // format string to an editable format (without loss of information)
- Color* pDummy = NULL;
- pNumFormatter->GetOutputString( fData, nFmt, rOutString, &pDummy );
-}
-
sal_Int32 lcl_getRowInData( long nRow )
{
return static_cast< sal_Int32 >( nRow );
@@ -218,7 +191,6 @@ public:
sal_Int32 GetEndColumn() const;
void Show();
- void Hide();
/** call this before destroying the class. This notifies the listeners to
changes of the edit field for the series name.
@@ -380,13 +352,6 @@ void SeriesHeader::Show()
m_spColorBar->Show();
}
-void SeriesHeader::Hide()
-{
- m_spSymbol->Hide();
- m_spSeriesName->Hide();
- m_spColorBar->Hide();
-}
-
void SeriesHeader::SetEditChangedHdl( const Link & rLink )
{
m_aChangeLink = rLink;
@@ -442,14 +407,14 @@ Image SeriesHeader::GetChartTypeImage(
}
else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_SCATTER ))
{
- // @todo: correct image for scatter chart type
- aResult = SELECT_IMAGE( IMG_TYPE_LINE, bHC );
+ aResult = SELECT_IMAGE( IMG_TYPE_XY, bHC );
}
else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_PIE ))
{
aResult = SELECT_IMAGE( IMG_TYPE_PIE, bHC );
}
- else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_NET ))
+ else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_NET )
+ || aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET ) )
{
aResult = SELECT_IMAGE( IMG_TYPE_NET, bHC );
}
@@ -458,6 +423,10 @@ Image SeriesHeader::GetChartTypeImage(
// @todo: correct image for candle-stick type
aResult = SELECT_IMAGE( IMG_TYPE_STOCK, bHC );
}
+ else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ))
+ {
+ aResult = SELECT_IMAGE( IMG_TYPE_BUBBLE, bHC );
+ }
return aResult;
}
@@ -1103,6 +1072,7 @@ sal_Bool DataBrowser::IsTabAllowed( sal_Bool bForward ) const
if( CellContainsNumbers( nRow, nCol ))
{
+ m_aNumberEditField.UseInputStringForFormatting();
m_aNumberEditField.SetFormatKey( GetNumberFormatKey( nRow, nCol ));
return m_rNumberEditController;
}
@@ -1313,12 +1283,10 @@ void DataBrowser::ImplAdjustHeaderControls()
{
(*aIt)->SetPixelPosX( nStartPos + 2 );
(*aIt)->SetPixelWidth( nCurrentPos - nStartPos - 3 );
-// (*aIt)->Show();
}
else
// do not hide, to get focus events. Move outside the dialog for "hiding"
(*aIt)->SetPixelPosX( nMaxPos + 42 );
-// (*aIt)->Hide();
++aIt;
}
}
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index f89171d4d55e..1db67c6721af 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -41,6 +41,8 @@
#include "macros.hxx"
#include "StatisticsHelper.hxx"
#include "ContainerHelper.hxx"
+#include "ChartTypeHelper.hxx"
+#include "chartview/ExplicitValueProvider.hxx"
#include <com/sun/star/container/XIndexReplace.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
@@ -103,7 +105,7 @@ OUString lcl_getUIRoleName(
{
OUString aResult( lcl_getRole( xLSeq ));
if( aResult.getLength())
- aResult = chart::DialogModel::ConvertRoleFromInternalToUI( aResult );
+ aResult = ::chart::DialogModel::ConvertRoleFromInternalToUI( aResult );
return aResult;
}
@@ -279,8 +281,8 @@ struct DataBrowserModel::implColumnLess : public ::std::binary_function<
{
if( rLeft.m_xLabeledDataSequence.is() && rRight.m_xLabeledDataSequence.is())
{
- return chart::DialogModel::GetRoleIndexForSorting( lcl_getRole( rLeft.m_xLabeledDataSequence )) <
- chart::DialogModel::GetRoleIndexForSorting( lcl_getRole( rRight.m_xLabeledDataSequence ));
+ return DialogModel::GetRoleIndexForSorting( lcl_getRole( rLeft.m_xLabeledDataSequence )) <
+ DialogModel::GetRoleIndexForSorting( lcl_getRole( rRight.m_xLabeledDataSequence ));
}
return true;
}
@@ -329,6 +331,8 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
Reference< chart2::XDataSeries > xSeries;
if( static_cast< tDataColumnVector::size_type >( nAfterColumnIndex ) <= m_aColumns.size())
xSeries.set( m_aColumns[nAfterColumnIndex].m_xDataSeries );
+
+ sal_Int32 nSeriesNumberFormat = 0;
if( xSeries.is())
{
xChartType.set( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ));
@@ -337,6 +341,10 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
lcl_DataSeriesOfHeaderMatches( xSeries )));
if( aIt != m_aHeaders.end())
nStartCol = aIt->m_nEndColumn;
+
+ Reference< beans::XPropertySet > xSeriesProps( xSeries, uno::UNO_QUERY );
+ if( xSeriesProps.is() )
+ xSeriesProps->getPropertyValue( C2U( "NumberFormat" )) >>= nSeriesNumberFormat;
}
else
{
@@ -404,6 +412,14 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
}
}
}
+ if( nSeriesNumberFormat != 0 )
+ {
+ //give the new series the same number format as the former series especially for bubble charts thus the bubble size values can be edited with same format immidiately
+ Reference< beans::XPropertySet > xNewSeriesProps( xNewSeries, uno::UNO_QUERY );
+ if( xNewSeriesProps.is() )
+ xNewSeriesProps->setPropertyValue( C2U( "NumberFormat" ), uno::makeAny( nSeriesNumberFormat ) );
+ }
+
updateFromModel();
}
}
@@ -708,7 +724,7 @@ void DataBrowserModel::updateFromModel()
tDataColumn aCategories;
aCategories.m_xLabeledDataSequence.set( xCategories );
if( lcl_ShowCategoriesAsDataLabel( xDiagram ))
- aCategories.m_aUIRoleName = chart::DialogModel::GetRoleDataLabel();
+ aCategories.m_aUIRoleName = DialogModel::GetRoleDataLabel();
else
aCategories.m_aUIRoleName = lcl_getUIRoleName( xCategories );
aCategories.m_eCellType = TEXT;
@@ -724,11 +740,15 @@ void DataBrowserModel::updateFromModel()
{
Reference< chart2::XChartTypeContainer > xCTCnt( aCooSysSeq[nCooSysIdx], uno::UNO_QUERY_THROW );
Sequence< Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes());
+ sal_Int32 nXAxisNumberFormat = DataSeriesHelper::getNumberFormatKeyFromAxis( 0, aCooSysSeq[nCooSysIdx], 0, 0 );
+
for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
{
Reference< chart2::XDataSeriesContainer > xSeriesCnt( aChartTypes[nCTIdx], uno::UNO_QUERY );
if( xSeriesCnt.is())
{
+ rtl::OUString aRoleForDataLabelNumberFormat = ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( aChartTypes[nCTIdx] );
+
Sequence< Reference< chart2::XDataSeries > > aSeries( xSeriesCnt->getDataSeries());
lcl_tSharedSeqVec aSharedSequences( lcl_getSharedSequences( aSeries ));
for( lcl_tSharedSeqVec::const_iterator aIt( aSharedSequences.begin());
@@ -741,16 +761,15 @@ void DataBrowserModel::updateFromModel()
// as the sequences are shared it should be ok to take the first series
// @todo: dimension index 0 for x-values used here. This is just a guess.
// Also, the axis index is 0, as there is usually only one x-axis
- aSharedSequence.m_nNumberFormatKey =
- DataSeriesHelper::getNumberFormatKeyFromAxis(
- aSeries[0], aCooSysSeq[nCooSysIdx], 0, 0 );
+ aSharedSequence.m_nNumberFormatKey = nXAxisNumberFormat;
m_aColumns.push_back( aSharedSequence );
++nHeaderStart;
}
for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aSeries.getLength(); ++nSeriesIdx )
{
tDataColumnVector::size_type nStartColIndex = m_aColumns.size();
- Reference< chart2::data::XDataSource > xSource( aSeries[nSeriesIdx], uno::UNO_QUERY );
+ Reference< chart2::XDataSeries > xSeries( aSeries[nSeriesIdx] );
+ Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY );
if( xSource.is())
{
Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSeqs( xSource->getDataSequences());
@@ -768,9 +787,14 @@ void DataBrowserModel::updateFromModel()
{
sal_Int32 nSequenceNumberFormatKey = nYAxisNumberFormatKey;
OUString aRole = lcl_getRole( aLSeqs[nSeqIdx] );
- if( aRole.equals( C2U( "values-x" ) ) )
- nSequenceNumberFormatKey = DataSeriesHelper::getNumberFormatKeyFromAxis(
- aSeries[nSeriesIdx], aCooSysSeq[nCooSysIdx], 0, 0 );
+
+ if( aRole.equals( aRoleForDataLabelNumberFormat ) )
+ {
+ nSequenceNumberFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
+ Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ), xSeries, -1, xDiagram );
+ }
+ else if( aRole.equals( C2U( "values-x" ) ) )
+ nSequenceNumberFormatKey = nXAxisNumberFormat;
if( ::std::find_if( aSharedSequences.begin(), aSharedSequences.end(),
lcl_RepresentationsOfLSeqMatch( aLSeqs[nSeqIdx] )) == aSharedSequences.end())
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index 28d9f6420419..69e693911c22 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -40,8 +40,6 @@
#include "macros.hxx"
#include "Strings.hrc"
#include "ResId.hxx"
-#include "LabeledDataSequence.hxx"
-#include "CachedDataSequence.hxx"
#include "ContainerHelper.hxx"
#include "CommonFunctors.hxx"
#include "ControllerLockGuard.hxx"
@@ -110,6 +108,7 @@ OUString lcl_ConvertRole( const OUString & rRoleString, bool bFromInternalToUI )
aTranslationMap[ C2U( "values-min" ) ] = OUString( String( ::chart::SchResId( STR_DATA_ROLE_MIN )));
aTranslationMap[ C2U( "values-x" ) ] = OUString( String( ::chart::SchResId( STR_DATA_ROLE_X )));
aTranslationMap[ C2U( "values-y" ) ] = OUString( String( ::chart::SchResId( STR_DATA_ROLE_Y )));
+ aTranslationMap[ C2U( "values-size" ) ] = OUString( String( ::chart::SchResId( STR_DATA_ROLE_SIZE )));
}
if( bFromInternalToUI )
@@ -157,6 +156,7 @@ void lcl_createRoleIndexMap( lcl_tRoleIndexMap & rOutMap )
rOutMap[ C2U( "values-min" ) ] = ++nIndex;
rOutMap[ C2U( "values-max" ) ] = ++nIndex;
rOutMap[ C2U( "values-last" ) ] = ++nIndex;
+ rOutMap[ C2U( "values-size" ) ] = ++nIndex;
}
struct lcl_DataSeriesContainerAppend : public
@@ -328,26 +328,26 @@ Reference< XDataSeries > lcl_CreateNewSeries(
{
if( aRoles[nI].equals( lcl_aLabelRole ))
continue;
- Reference< data::XDataSequence > xSeq( new ::chart::CachedDataSequence());
+ Reference< data::XDataSequence > xSeq( ::chart::DataSourceHelper::createCachedDataSequence() );
lcl_SetSequenceRole( xSeq, aRoles[nI] );
// assert that aRoleOfSeqForSeriesLabel is part of the mandatory roles
if( aRoles[nI].equals( aRoleOfSeqForSeriesLabel ))
{
- Reference< data::XDataSequence > xLabel( new ::chart::CachedDataSequence( aLabel ));
+ Reference< data::XDataSequence > xLabel( ::chart::DataSourceHelper::createCachedDataSequence( aLabel ));
lcl_SetSequenceRole( xLabel, lcl_aLabelRole );
- aNewSequences.push_back( new ::chart::LabeledDataSequence( xSeq, xLabel ));
+ aNewSequences.push_back( ::chart::DataSourceHelper::createLabeledDataSequence( xSeq, xLabel ));
}
else
- aNewSequences.push_back( new ::chart::LabeledDataSequence( xSeq ));
+ aNewSequences.push_back( ::chart::DataSourceHelper::createLabeledDataSequence( xSeq ));
}
for(nI=0; nI<aOptRoles.getLength(); ++nI)
{
if( aOptRoles[nI].equals( lcl_aLabelRole ))
continue;
- Reference< data::XDataSequence > xSeq( new ::chart::CachedDataSequence());
+ Reference< data::XDataSequence > xSeq( ::chart::DataSourceHelper::createCachedDataSequence());
lcl_SetSequenceRole( xSeq, aOptRoles[nI] );
- aNewSequences.push_back( new ::chart::LabeledDataSequence( xSeq ));
+ aNewSequences.push_back( ::chart::DataSourceHelper::createLabeledDataSequence( xSeq ));
}
xSink->setData( ContainerToSequence( aNewSequences ));
@@ -723,12 +723,6 @@ OUString DialogModel::ConvertRoleFromInternalToUI( const OUString & rRoleString
}
// static
-OUString DialogModel::ConvertRoleFromUIToInternal( const OUString & rRoleString )
-{
- return lcl_ConvertRole( rRoleString, false );
-}
-
-// static
OUString DialogModel::GetRoleDataLabel()
{
return OUString( String( ::chart::SchResId( STR_OBJECT_DATALABELS )));
@@ -750,43 +744,6 @@ sal_Int32 DialogModel::GetRoleIndexForSorting( const ::rtl::OUString & rInternal
return 0;
}
-// static
-bool DialogModel::isSeriesValid(
- const Reference< chart2::XDataSeries > & xSeries,
- const OUString & aRoleOfSequenceForLabel,
- const Reference< chart2::XChartType > & xChartType )
-{
- if( ! (xSeries.is() && xChartType.is()))
- return false;
-
- try
- {
- sal_Int32 nFoundRoles = 0;
- DialogModel::tRolesWithRanges aRolesWithRanges;
- Reference< data::XDataSource > xSource( xSeries, uno::UNO_QUERY_THROW );
- const Sequence< Reference< data::XLabeledDataSequence > > aSeq( xSource->getDataSequences());
- ::std::copy( aSeq.getConstArray(), aSeq.getConstArray() + aSeq.getLength(),
- lcl_RolesWithRangeAppend( aRolesWithRanges, aRoleOfSequenceForLabel ));
- const Sequence< OUString > aRoles( xChartType->getSupportedMandatoryRoles());
- for( sal_Int32 nI = 0; nI < aRoles.getLength(); ++nI )
- if( !aRoles[nI].equals( lcl_aLabelRole ) && aRolesWithRanges.find( aRoles[nI] ) != aRolesWithRanges.end() )
- ++nFoundRoles;
- // strong condition: all mandatory roles exist (except the label)
-// if( !aRoles[nI].equals( lcl_aLabelRole ) && aRolesWithRanges.find( aRoles[nI] ) == aRolesWithRanges.end() )
-// return false;
- // weak condition: one mandatory role exists
- if( aRoles.getLength() > 0 && nFoundRoles == 0 )
- return false;
- }
- catch( uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- return false;
- }
-
- return true;
-}
-
// private methods
void DialogModel::createBackup()
diff --git a/chart2/source/controller/dialogs/DialogModel.hxx b/chart2/source/controller/dialogs/DialogModel.hxx
index 65579ab652be..744262cbbd1f 100644
--- a/chart2/source/controller/dialogs/DialogModel.hxx
+++ b/chart2/source/controller/dialogs/DialogModel.hxx
@@ -154,20 +154,12 @@ public:
void startControllerLockTimer();
static ::rtl::OUString ConvertRoleFromInternalToUI( const ::rtl::OUString & rRoleString );
- static ::rtl::OUString ConvertRoleFromUIToInternal( const ::rtl::OUString & rRoleString );
static ::rtl::OUString GetRoleDataLabel();
// pass a role string (not translated) and get an index that serves for
// relative ordering, to get e.g. x-values and y-values in the right order
static sal_Int32 GetRoleIndexForSorting( const ::rtl::OUString & rInternalRoleString );
- static bool isSeriesValid(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XDataSeries > & xSeries,
- const ::rtl::OUString & aRoleOfSequenceForLabel,
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XChartType > & xChartType );
-
private:
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument >
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 7ee4ae67761d..24b717adba7f 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -87,6 +87,16 @@ OUString lcl_getDataSeriesName( const rtl::OUString& rObjectCID, const Reference
return aRet;
}
+OUString lcl_getFullSeriesName( const rtl::OUString& rObjectCID, const Reference< frame::XModel >& xChartModel )
+{
+ OUString aRet = String(SchResId(STR_TIP_DATASERIES));
+ OUString aWildcard( C2U("%SERIESNAME") );
+ sal_Int32 nIndex = aRet.indexOf( aWildcard );
+ if( nIndex != -1 )
+ aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), lcl_getDataSeriesName( rObjectCID, xChartModel ) );
+ return aRet;
+}
+
void lcl_addText( OUString& rOut, const OUString& rSeparator, const OUString& rNext )
{
if( rOut.getLength() && rNext.getLength() )
@@ -109,7 +119,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
Sequence< Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
- rtl::OUString aX, aY, aY_Min, aY_Max, aY_First, aY_Last;
+ rtl::OUString aX, aY, aY_Min, aY_Max, aY_First, aY_Last, a_Size;
double fValue = 0;
uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartModel, uno::UNO_QUERY );
@@ -170,6 +180,12 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
sal_Int32 nNumberFormatKey = xDataSequence->getNumberFormatKeyByIndex( nPointIndex );
aY_Last = aNumberFormatterWrapper.getFormattedString( nNumberFormatKey, fValue, nLabelColor, bColorChanged );
}
+ else if( aRole.equals(C2U("values-size")) )
+ {
+ aData[nPointIndex]>>= fValue;
+ sal_Int32 nNumberFormatKey = xDataSequence->getNumberFormatKeyByIndex( nPointIndex );
+ a_Size = aNumberFormatterWrapper.getFormattedString( nNumberFormatKey, fValue, nLabelColor, bColorChanged );
+ }
}
catch( uno::Exception& e )
{
@@ -201,6 +217,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
lcl_addText( aRet, aSeparator, aY_Min );
lcl_addText( aRet, aSeparator, aY_Max );
lcl_addText( aRet, aSeparator, aY_Last );
+ lcl_addText( aRet, aSeparator, a_Size );
return aRet;
}
@@ -281,22 +298,27 @@ rtl::OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural
aRet=String(SchResId(STR_OBJECT_LABEL));
break;
case OBJECTTYPE_DATA_ERRORS:
- aRet=String(SchResId(STR_OBJECT_ERROR_INDICATOR));//@todo? maybe distinguish plural singular
+ aRet=String(SchResId(STR_OBJECT_ERROR_BARS));//@todo? maybe distinguish plural singular
break;
case OBJECTTYPE_DATA_ERRORS_X:
- aRet=String(SchResId(STR_OBJECT_ERROR_INDICATOR));//@todo? maybe specialize in future
+ aRet=String(SchResId(STR_OBJECT_ERROR_BARS));//@todo? maybe specialize in future
break;
case OBJECTTYPE_DATA_ERRORS_Y:
- aRet=String(SchResId(STR_OBJECT_ERROR_INDICATOR));//@todo? maybe specialize in future
+ aRet=String(SchResId(STR_OBJECT_ERROR_BARS));//@todo? maybe specialize in future
break;
case OBJECTTYPE_DATA_ERRORS_Z:
- aRet=String(SchResId(STR_OBJECT_ERROR_INDICATOR));//@todo? maybe specialize in future
+ aRet=String(SchResId(STR_OBJECT_ERROR_BARS));//@todo? maybe specialize in future
break;
case OBJECTTYPE_DATA_AVERAGE_LINE:
aRet=String(SchResId(STR_OBJECT_AVERAGE_LINE));
break;
case OBJECTTYPE_DATA_CURVE:
- aRet=String(SchResId(STR_OBJECT_CURVE));
+ {
+ if(bPlural)
+ aRet=String(SchResId(STR_OBJECT_CURVES));
+ else
+ aRet=String(SchResId(STR_OBJECT_CURVE));
+ }
break;
case OBJECTTYPE_DATA_STOCK_RANGE:
//aRet=String(SchResId());
@@ -326,15 +348,24 @@ rtl::OUString ObjectNameProvider::getAxisName( const rtl::OUString& rObjectCID
Reference< XAxis > xAxis(
ObjectIdentifier::getObjectPropertySet( rObjectCID , xChartModel ), uno::UNO_QUERY );
- sal_Int32 nDimensionIndex = AxisHelper::getDimensionIndexOfAxis( xAxis, ChartModelHelper::findDiagram( xChartModel ) );
+ sal_Int32 nCooSysIndex = 0;
+ sal_Int32 nDimensionIndex = 0;
+ sal_Int32 nAxisIndex = 0;
+ AxisHelper::getIndicesForAxis( xAxis, ChartModelHelper::findDiagram( xChartModel ), nCooSysIndex, nDimensionIndex, nAxisIndex );
switch(nDimensionIndex)
{
case 0://x-axis
- aRet=String(SchResId(STR_OBJECT_AXIS_X));
+ if( nAxisIndex == 0 )
+ aRet=String(SchResId(STR_OBJECT_AXIS_X));
+ else
+ aRet=String(SchResId(STR_OBJECT_SECONDARY_X_AXIS));
break;
case 1://y-axis
- aRet=String(SchResId(STR_OBJECT_AXIS_Y));
+ if( nAxisIndex == 0 )
+ aRet=String(SchResId(STR_OBJECT_AXIS_Y));
+ else
+ aRet=String(SchResId(STR_OBJECT_SECONDARY_Y_AXIS));
break;
case 2://z-axis
aRet=String(SchResId(STR_OBJECT_AXIS_Z));
@@ -348,6 +379,45 @@ rtl::OUString ObjectNameProvider::getAxisName( const rtl::OUString& rObjectCID
}
//static
+OUString ObjectNameProvider::getTitleNameByType( TitleHelper::eTitleType eType )
+{
+ OUString aRet;
+
+ switch(eType)
+ {
+ case TitleHelper::MAIN_TITLE:
+ aRet=String(SchResId(STR_OBJECT_TITLE_MAIN));
+ break;
+ case TitleHelper::SUB_TITLE:
+ aRet=String(SchResId(STR_OBJECT_TITLE_SUB));
+ break;
+ case TitleHelper::X_AXIS_TITLE:
+ aRet=String(SchResId(STR_OBJECT_TITLE_X_AXIS));
+ break;
+ case TitleHelper::Y_AXIS_TITLE:
+ aRet=String(SchResId(STR_OBJECT_TITLE_Y_AXIS));
+ break;
+ case TitleHelper::Z_AXIS_TITLE:
+ aRet=String(SchResId(STR_OBJECT_TITLE_Z_AXIS));
+ break;
+ case TitleHelper::SECONDARY_X_AXIS_TITLE:
+ aRet=String(SchResId(STR_OBJECT_TITLE_SECONDARY_X_AXIS));
+ break;
+ case TitleHelper::SECONDARY_Y_AXIS_TITLE:
+ aRet=String(SchResId(STR_OBJECT_TITLE_SECONDARY_Y_AXIS));
+ break;
+ default:
+ DBG_ERROR("unknown title type");
+ break;
+ }
+
+ if( !aRet.getLength() )
+ aRet=String(SchResId(STR_OBJECT_TITLE));
+
+ return aRet;
+}
+
+//static
OUString ObjectNameProvider::getTitleName( const OUString& rObjectCID
, const Reference< frame::XModel >& xChartModel )
{
@@ -359,35 +429,7 @@ OUString ObjectNameProvider::getTitleName( const OUString& rObjectCID
{
TitleHelper::eTitleType eType;
if( TitleHelper::getTitleType( eType, xTitle, xChartModel ) )
- {
- switch(eType)
- {
- case TitleHelper::MAIN_TITLE:
- aRet=String(SchResId(STR_OBJECT_TITLE_MAIN));
- break;
- case TitleHelper::SUB_TITLE:
- aRet=String(SchResId(STR_OBJECT_TITLE_SUB));
- break;
- case TitleHelper::X_AXIS_TITLE:
- aRet=String(SchResId(STR_OBJECT_TITLE_X_AXIS));
- break;
- case TitleHelper::Y_AXIS_TITLE:
- aRet=String(SchResId(STR_OBJECT_TITLE_Y_AXIS));
- break;
- case TitleHelper::Z_AXIS_TITLE:
- aRet=String(SchResId(STR_OBJECT_TITLE_Z_AXIS));
- break;
- case TitleHelper::SECONDARY_X_AXIS_TITLE:
- aRet=String(SchResId(STR_OBJECT_TITLE_SECONDARY_X_AXIS));
- break;
- case TitleHelper::SECONDARY_Y_AXIS_TITLE:
- aRet=String(SchResId(STR_OBJECT_TITLE_SECONDARY_Y_AXIS));
- break;
- default:
- DBG_ERROR("unknown title type");
- break;
- }
- }
+ aRet = ObjectNameProvider::getTitleNameByType( eType );
}
if( !aRet.getLength() )
aRet=String(SchResId(STR_OBJECT_TITLE));
@@ -474,12 +516,7 @@ rtl::OUString ObjectNameProvider::getHelpText( const rtl::OUString& rObjectCID,
}
else if( OBJECTTYPE_DATA_SERIES == eObjectType )
{
- aRet=String(SchResId(STR_TIP_DATASERIES));
-
- OUString aWildcard( C2U("%SERIESNAME") );
- sal_Int32 nIndex = aRet.indexOf( aWildcard );
- if( nIndex != -1 )
- aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), lcl_getDataSeriesName( rObjectCID, xChartModel ) );
+ aRet = lcl_getFullSeriesName( rObjectCID, xChartModel );
}
else if( OBJECTTYPE_DATA_POINT == eObjectType )
{
@@ -746,7 +783,41 @@ rtl::OUString ObjectNameProvider::getNameForCID(
case OBJECTTYPE_TITLE:
return getTitleName( rObjectCID, xModel );
case OBJECTTYPE_GRID:
+ case OBJECTTYPE_SUBGRID:
return getGridName( rObjectCID, xModel );
+ case OBJECTTYPE_DATA_SERIES:
+ return lcl_getFullSeriesName( rObjectCID, xModel );
+ //case OBJECTTYPE_LEGEND_ENTRY:
+ case OBJECTTYPE_DATA_POINT:
+ case OBJECTTYPE_DATA_LABELS:
+ case OBJECTTYPE_DATA_LABEL:
+ case OBJECTTYPE_DATA_ERRORS:
+ case OBJECTTYPE_DATA_ERRORS_X:
+ case OBJECTTYPE_DATA_ERRORS_Y:
+ case OBJECTTYPE_DATA_ERRORS_Z:
+ case OBJECTTYPE_DATA_CURVE:
+ case OBJECTTYPE_DATA_AVERAGE_LINE:
+ case OBJECTTYPE_DATA_CURVE_EQUATION:
+ {
+ rtl::OUString aRet = lcl_getFullSeriesName( rObjectCID, xModel );
+ aRet += C2U(" ");
+ if( eType == OBJECTTYPE_DATA_POINT || eType == OBJECTTYPE_DATA_LABEL )
+ {
+ aRet += getName( OBJECTTYPE_DATA_POINT );
+ sal_Int32 nPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( rObjectCID );
+ aRet += C2U(" ");
+ aRet += OUString::valueOf(nPointIndex+1);
+
+ if( eType == OBJECTTYPE_DATA_LABEL )
+ {
+ aRet += C2U(" ");
+ aRet += getName( OBJECTTYPE_DATA_LABEL );
+ }
+ }
+ else
+ aRet += getName( eType );
+ return aRet;
+ }
default:
break;
}
@@ -754,6 +825,32 @@ rtl::OUString ObjectNameProvider::getNameForCID(
return getName( eType );
}
+//static
+rtl::OUString ObjectNameProvider::getName_ObjectForSeries(
+ ObjectType eObjectType,
+ const rtl::OUString& rSeriesCID,
+ const uno::Reference< chart2::XChartDocument >& xChartDocument )
+{
+ uno::Reference< frame::XModel> xChartModel( xChartDocument, uno::UNO_QUERY );
+ Reference< XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( rSeriesCID , xChartModel ), uno::UNO_QUERY );
+ if( xSeries.is() )
+ {
+ OUString aRet = String(SchResId(STR_OBJECT_FOR_SERIES));
+ replaceParamterInString( aRet, C2U("%OBJECTNAME"), getName( eObjectType, false /*bPlural*/ ) );
+ replaceParamterInString( aRet, C2U("%SERIESNAME"), lcl_getDataSeriesName( rSeriesCID, xChartModel ) );
+ return aRet;
+ }
+ else
+ return ObjectNameProvider::getName_ObjectForAllSeries( eObjectType );
+}
+
+//static
+rtl::OUString ObjectNameProvider::getName_ObjectForAllSeries( ObjectType eObjectType )
+{
+ OUString aRet = String(SchResId(STR_OBJECT_FOR_ALL_SERIES));
+ replaceParamterInString( aRet, C2U("%OBJECTNAME"), getName( eObjectType, true /*bPlural*/ ) );
+ return aRet;
+}
//.............................................................................
} //namespace chart
diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src
index 8da8700a4406..b7ef643e3ff3 100644
--- a/chart2/source/controller/dialogs/Strings.src
+++ b/chart2/source/controller/dialogs/Strings.src
@@ -84,9 +84,9 @@ String STR_PAGE_TRANSPARENCY
Text [ en-US ] = "Transparency";
};
-String STR_PAGE_CHARACTERS
+String STR_PAGE_FONT
{
- Text [ en-US ] = "Characters" ;
+ Text [ en-US ] = "Font" ;
};
String STR_PAGE_FONT_EFFECTS
@@ -156,6 +156,12 @@ String STR_PAGE_ILLUMINATION
{
Text [ en-US ] = "Illumination" ;
};
+
+String STR_PAGE_ASIAN
+{
+ Text [ en-US ] = "Asian Typography" ;
+};
+
String STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS
{
Text [ en-US ] = "Mean value line with value %AVERAGE_VALUE and standard deviation %STD_DEVIATION";
@@ -177,6 +183,14 @@ String STR_OBJECT_AXIS_Z
{
Text [ en-US ] = "Z Axis" ;
};
+String STR_OBJECT_SECONDARY_X_AXIS
+{
+ Text [ en-US ] = "Secondary X Axis" ;
+};
+String STR_OBJECT_SECONDARY_Y_AXIS
+{
+ Text [ en-US ] = "Secondary Y Axis" ;
+};
String STR_OBJECT_AXES
{
@@ -306,18 +320,18 @@ String STR_OBJECT_CURVE_EQUATION
Text[ en-US ] = "Equation";
};
-String STR_OBJECT_ERROR_INDICATOR
+String STR_OBJECT_ERROR_BARS
{
- Text [ en-US ] = "Error Indicator";
+ Text [ en-US ] = "Error Bars";
};
String STR_OBJECT_STOCK_LOSS
{
- Text [ en-US ] = "Negative Deviation";
+ Text [ en-US ] = "Stock Loss";
};
String STR_OBJECT_STOCK_GAIN
{
- Text [ en-US ] = "Positive Deviation";
+ Text [ en-US ] = "Stock Gain";
};
String STR_OBJECT_PAGE
@@ -399,6 +413,18 @@ String STR_STATUS_PIE_SEGMENT_EXPLODED
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+String STR_OBJECT_FOR_SERIES
+{
+ Text [ en-US ] = "%OBJECTNAME for Data Series '%SERIESNAME'" ;
+};
+
+String STR_OBJECT_FOR_ALL_SERIES
+{
+ Text [ en-US ] = "%OBJECTNAME for all Data Series" ;
+};
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
String STR_ACTION_EDIT_CHARTTYPE
{
Text [ en-US ] = "Edit chart type" ;
@@ -465,6 +491,11 @@ String STR_DATA_ROLE_Y
Text [ en-US ] = "Y-Values" ;
};
+String STR_DATA_ROLE_SIZE
+{
+ Text [ en-US ] = "Bubble Sizes" ;
+};
+
String STR_DATA_ROLE_X_ERROR
{
Text [ en-US ] = "X-Error-Bars" ;
diff --git a/chart2/source/controller/dialogs/Strings_ChartTypes.src b/chart2/source/controller/dialogs/Strings_ChartTypes.src
index 1e18f0e8724f..f2731b2971c2 100644
--- a/chart2/source/controller/dialogs/Strings_ChartTypes.src
+++ b/chart2/source/controller/dialogs/Strings_ChartTypes.src
@@ -139,5 +139,18 @@ String STR_DEEP
{
Text [ en-US ] = "Deep" ;
};
+String STR_FILLED
+{
+ Text [ en-US ] = "Filled" ;
+};
+//-----------------------------------------------------------------------------
+String STR_TYPE_BUBBLE
+{
+ Text [ en-US ] = "Bubble" ;
+};
+String STR_BUBBLE_1
+{
+ Text [ en-US ] = "Bubble Chart" ;
+};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
diff --git a/chart2/source/controller/dialogs/Strings_Statistic.src b/chart2/source/controller/dialogs/Strings_Statistic.src
index a0f1a1811cd3..9f6572c6ae82 100644
--- a/chart2/source/controller/dialogs/Strings_Statistic.src
+++ b/chart2/source/controller/dialogs/Strings_Statistic.src
@@ -52,10 +52,6 @@ String STR_CONTROLTEXT_ERROR_BARS_FROM_DATA
//------------------------------------------------------------------------
//------------------------------------------------------------------------
-String STR_REGRESSION_NONE
-{
- Text [ en-US ] = "No Regression" ;
-};
String STR_REGRESSION_LINEAR
{
Text [ en-US ] = "Linear Regression" ;
diff --git a/chart2/source/controller/dialogs/TabPages.hrc b/chart2/source/controller/dialogs/TabPages.hrc
index d56534257500..8c92c062ad14 100644
--- a/chart2/source/controller/dialogs/TabPages.hrc
+++ b/chart2/source/controller/dialogs/TabPages.hrc
@@ -83,22 +83,6 @@
#define CTL_BITMAP_PREVIEW 6
*/
-//#define TP_OPTIONS 908
-#define GRP_OPT_AXIS 1
-#define RBT_OPT_AXIS_1 2
-#define RBT_OPT_AXIS_2 3
-#define MT_GAP 4
-#define MT_OVERLAP 5
-#define FT_GAP 6
-#define FT_OVERLAP 7
-#define GB_BAR 8
-#define CB_CONNECTOR 9
-#define CB_BARS_SIDE_BY_SIDE 10
-#define FL_PLOT_MISSING_VALUES 11
-#define RB_DONT_PAINT 12
-#define RB_ASSUME_ZERO 13
-#define RB_CONTINUE_LINE 14
-
//------------
//from old chart tplabel.hrc
diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx
index 1d76a106d72b..1aa7db1f0f17 100644
--- a/chart2/source/controller/dialogs/dlg_DataSource.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx
@@ -202,6 +202,19 @@ DataSourceDialog::~DataSourceDialog()
delete m_pTabControl;
}
+short DataSourceDialog::Execute()
+{
+ short nResult = TabDialog::Execute();
+ if( nResult == RET_OK )
+ {
+ if( m_pRangeChooserTabePage )
+ m_pRangeChooserTabePage->commitPage();
+ if( m_pDataSourceTabPage )
+ m_pDataSourceTabPage->commitPage();
+ }
+ return nResult;
+}
+
void DataSourceDialog::setInvalidPage( TabPage * pTabPage )
{
if( pTabPage == m_pRangeChooserTabePage )
diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
index 79f4bf52d05b..d7eb3357e6e8 100644
--- a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
@@ -47,11 +47,12 @@ DataLabelsDialog::DataLabelsDialog(Window* pWindow, const SfxItemSet& rInAttrs,
m_aBtnOK(this, SchResId(BTN_OK)),
m_aBtnCancel(this, SchResId(BTN_CANCEL)),
m_aBtnHelp(this, SchResId(BTN_HELP)),
- m_apDataLabelResources( new DataLabelResources(this,rInAttrs,false) ),
+ m_apDataLabelResources( new DataLabelResources(this,rInAttrs) ),
m_rInAttrs(rInAttrs)
{
FreeResource();
- SetText( ObjectNameProvider::getName(OBJECTTYPE_DATA_LABELS) );
+ this->SetText( ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_LABELS ) );
+
m_apDataLabelResources->SetNumberFormatter( pFormatter );
Reset();
}
diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.src b/chart2/source/controller/dialogs/dlg_InsertDataLabel.src
index b11b2102ecef..091628a2c73e 100644
--- a/chart2/source/controller/dialogs/dlg_InsertDataLabel.src
+++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.src
@@ -38,8 +38,8 @@ ModalDialog DLG_DATA_DESCR
HelpID = SID_INSERT_DESCRIPTION ;
OutputSize = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT ( 200 , 136 ) ;
+ Size = MAP_APPFONT ( 316 , 185 ) ;
Moveable = TRUE ;
- BUTTONS_OK_CANCEL_HELP_STACKED(144)
+ BUTTONS_OK_CANCEL_HELP_STACKED(260)
RESOURCE_DATALABEL( 6, 7 )
};
diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
index e6b74c8e660a..535b07a7df38 100644
--- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
@@ -42,6 +42,7 @@
#include "ObjectIdentifier.hxx"
#include "DiagramHelper.hxx"
#include "AxisHelper.hxx"
+#include "ObjectNameProvider.hxx"
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
@@ -70,7 +71,8 @@ InsertErrorBarsDialog::InsertErrorBarsDialog(
/* bNoneAvailable = */ true, eType ))
{
FreeResource();
- this->SetText( String( SchResId( STR_PAGE_YERROR_BARS )));
+ this->SetText( ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_ERRORS ) );
+
m_apErrorBarResources->SetChartDocumentForRangeChoosing( xChartDocument );
}
diff --git a/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx b/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx
index 95c9754f3b7e..042baa292f65 100644
--- a/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx
@@ -42,6 +42,7 @@
#include "ObjectIdentifier.hxx"
#include "DiagramHelper.hxx"
#include "AxisHelper.hxx"
+#include "ObjectNameProvider.hxx"
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
@@ -74,7 +75,7 @@ InsertTrendlineDialog::InsertTrendlineDialog( Window* pParent, const SfxItemSet&
m_apTrendlineResources( new TrendlineResources( this, rInAttrs, true ))
{
FreeResource();
- this->SetText( String( SchResId( STR_OBJECT_CURVES )));
+ this->SetText( ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_CURVE ) );
}
InsertTrendlineDialog::~InsertTrendlineDialog()
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 2087df6deb9e..097c6c1d0107 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -82,6 +82,8 @@
#include <svx/flagsdef.hxx>
#include <svx/numinf.hxx>
+#include <svtools/cjkoptions.hxx>
+
//.............................................................................
namespace chart
{
@@ -141,7 +143,7 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel
uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries );
sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
- bool bHasSeriesProperties = (OBJECTTYPE_DATA_SERIES==m_eObjectType || OBJECTTYPE_DATA_LABELS==m_eObjectType);
+ bool bHasSeriesProperties = (OBJECTTYPE_DATA_SERIES==m_eObjectType);
bool bHasDataPointproperties = (OBJECTTYPE_DATA_POINT==m_eObjectType);
if( bHasSeriesProperties || bHasDataPointproperties )
@@ -220,14 +222,37 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel
{
m_aLocalizedName = ObjectNameProvider::getAxisName( m_aObjectCID, xChartModel );
}
+ else if( !m_bAffectsMultipleObjects && ( OBJECTTYPE_GRID == m_eObjectType || OBJECTTYPE_SUBGRID == m_eObjectType ) )
+ {
+ m_aLocalizedName = ObjectNameProvider::getGridName( m_aObjectCID, xChartModel );
+ }
+ else if( !m_bAffectsMultipleObjects && OBJECTTYPE_TITLE == m_eObjectType )
+ {
+ m_aLocalizedName = ObjectNameProvider::getTitleName( m_aObjectCID, xChartModel );
+ }
else
{
- ObjectType eType = m_eObjectType;
- if( OBJECTTYPE_DATA_LABEL == eType )
- eType = OBJECTTYPE_DATA_POINT;
- else if( OBJECTTYPE_DATA_LABELS == eType )
- eType = OBJECTTYPE_DATA_SERIES;
- m_aLocalizedName = ObjectNameProvider::getName(eType,m_bAffectsMultipleObjects);
+ switch( m_eObjectType )
+ {
+ case OBJECTTYPE_DATA_POINT:
+ case OBJECTTYPE_DATA_LABEL:
+ case OBJECTTYPE_DATA_LABELS:
+ case OBJECTTYPE_DATA_ERRORS:
+ case OBJECTTYPE_DATA_ERRORS_X:
+ case OBJECTTYPE_DATA_ERRORS_Y:
+ case OBJECTTYPE_DATA_ERRORS_Z:
+ case OBJECTTYPE_DATA_AVERAGE_LINE:
+ case OBJECTTYPE_DATA_CURVE:
+ case OBJECTTYPE_DATA_CURVE_EQUATION:
+ if( m_bAffectsMultipleObjects )
+ m_aLocalizedName = ObjectNameProvider::getName_ObjectForAllSeries( m_eObjectType );
+ else
+ m_aLocalizedName = ObjectNameProvider::getName_ObjectForSeries( m_eObjectType, m_aObjectCID, m_xChartDocument );
+ break;
+ default:
+ m_aLocalizedName = ObjectNameProvider::getName(m_eObjectType,m_bAffectsMultipleObjects);
+ break;
+ }
}
}
}
@@ -345,47 +370,58 @@ SchAttribTabDlg::SchAttribTabDlg(Window* pParent,
this->SetText( pDialogParameter->getLocalizedName() );
+ SvtCJKOptions aCJKOptions;
+
switch (eObjectType)
{
case OBJECTTYPE_TITLE:
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_BORDER)));
AddTabPage(RID_SVXPAGE_AREA, String(SchResId(STR_PAGE_AREA)));
AddTabPage(RID_SVXPAGE_TRANSPARENCE, String(SchResId(STR_PAGE_TRANSPARENCY)));
- AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)));
+ AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_FONT)));
AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
AddTabPage(TP_ALIGNMENT, String(SchResId(STR_PAGE_ALIGNMENT)), SchAlignmentTabPage::Create, NULL);
+ if( aCJKOptions.IsAsianTypographyEnabled() )
+ AddTabPage(RID_SVXPAGE_PARA_ASIAN, String(SchResId(STR_PAGE_ASIAN)));
break;
case OBJECTTYPE_LEGEND:
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_BORDER)));
AddTabPage(RID_SVXPAGE_AREA, String(SchResId(STR_PAGE_AREA)));
AddTabPage(RID_SVXPAGE_TRANSPARENCE, String(SchResId(STR_PAGE_TRANSPARENCY)));
- AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)));
+ AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_FONT)));
AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
AddTabPage(TP_LEGEND_POS, String(SchResId(STR_PAGE_POSITION)), SchLegendPosTabPage::Create, NULL);
+ if( aCJKOptions.IsAsianTypographyEnabled() )
+ AddTabPage(RID_SVXPAGE_PARA_ASIAN, String(SchResId(STR_PAGE_ASIAN)));
break;
case OBJECTTYPE_DATA_SERIES:
case OBJECTTYPE_DATA_POINT:
- case OBJECTTYPE_DATA_LABEL:
- case OBJECTTYPE_DATA_LABELS:
- AddTabPage(RID_SVXPAGE_LINE, String(SchResId( m_pParameter->HasAreaProperties() ? STR_PAGE_BORDER : STR_PAGE_LINE )));
+ if( m_pParameter->ProvidesSecondaryYAxis() || m_pParameter->ProvidesOverlapAndGapWidth() || m_pParameter->ProvidesMissingValueTreatments() )
+ AddTabPage(TP_OPTIONS, String(SchResId(STR_PAGE_OPTIONS)),SchOptionTabPage::Create, NULL);
+ if( m_pParameter->ProvidesStartingAngle())
+ AddTabPage(TP_POLAROPTIONS, String(SchResId(STR_PAGE_OPTIONS)),PolarOptionsTabPage::Create, NULL);
+
+ if( m_pParameter->HasGeometryProperties() )
+ AddTabPage(TP_LAYOUT, String(SchResId(STR_PAGE_LAYOUT)),SchLayoutTabPage::Create, NULL);
+
if(m_pParameter->HasAreaProperties())
{
AddTabPage(RID_SVXPAGE_AREA, String(SchResId(STR_PAGE_AREA)));
AddTabPage(RID_SVXPAGE_TRANSPARENCE, String(SchResId(STR_PAGE_TRANSPARENCY)));
}
- AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)));
- AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
+ AddTabPage(RID_SVXPAGE_LINE, String(SchResId( m_pParameter->HasAreaProperties() ? STR_PAGE_BORDER : STR_PAGE_LINE )));
+ break;
+
+ case OBJECTTYPE_DATA_LABEL:
+ case OBJECTTYPE_DATA_LABELS:
AddTabPage(TP_DATA_DESCR, String(SchResId(STR_OBJECT_DATALABELS)), DataLabelsTabPage::Create, NULL);
-// if( m_pParameter->HasStatisticProperties() )
-// AddTabPage(TP_YERRORBAR, String(SchResId(STR_PAGE_YERROR_BARS)), ErrorBarsTabPage::Create, NULL);
- if( m_pParameter->HasGeometryProperties() )
- AddTabPage(TP_LAYOUT, String(SchResId(STR_PAGE_LAYOUT)),SchLayoutTabPage::Create, NULL);
- if( m_pParameter->ProvidesSecondaryYAxis() || m_pParameter->ProvidesOverlapAndGapWidth() || m_pParameter->ProvidesMissingValueTreatments() )
- AddTabPage(TP_OPTIONS, String(SchResId(STR_PAGE_OPTIONS)),SchOptionTabPage::Create, NULL);
- if( m_pParameter->ProvidesStartingAngle())
- AddTabPage(TP_POLAROPTIONS, String(SchResId(STR_PAGE_OPTIONS)),PolarOptionsTabPage::Create, NULL);
+ AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_FONT)));
+ AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
+ if( aCJKOptions.IsAsianTypographyEnabled() )
+ AddTabPage(RID_SVXPAGE_PARA_ASIAN, String(SchResId(STR_PAGE_ASIAN)));
+
break;
case OBJECTTYPE_AXIS:
@@ -399,8 +435,10 @@ SchAttribTabDlg::SchAttribTabDlg(Window* pParent,
AddTabPage(TP_AXIS_LABEL, String(SchResId(STR_OBJECT_LABEL)), SchAxisLabelTabPage::Create, NULL);
if( m_pParameter->HasNumberProperties() )
AddTabPage(RID_SVXPAGE_NUMBERFORMAT, String(SchResId(STR_PAGE_NUMBERS)));
- AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)));
+ AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_FONT)));
AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
+ if( aCJKOptions.IsAsianTypographyEnabled() )
+ AddTabPage(RID_SVXPAGE_PARA_ASIAN, String(SchResId(STR_PAGE_ASIAN)));
break;
}
@@ -444,7 +482,7 @@ SchAttribTabDlg::SchAttribTabDlg(Window* pParent,
AddTabPage(RID_SVXPAGE_LINE, String(SchResId(STR_PAGE_BORDER)));
AddTabPage(RID_SVXPAGE_AREA, String(SchResId(STR_PAGE_AREA)));
AddTabPage(RID_SVXPAGE_TRANSPARENCE, String(SchResId(STR_PAGE_TRANSPARENCY)));
- AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS)));
+ AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_FONT)));
AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS)));
AddTabPage(RID_SVXPAGE_NUMBERFORMAT, String(SchResId(STR_PAGE_NUMBERS)));
if( SvtLanguageOptions().IsCTLFontEnabled() )
diff --git a/chart2/source/controller/dialogs/hidother.src b/chart2/source/controller/dialogs/hidother.src
index 8707088c4337..4f409d14094b 100644
--- a/chart2/source/controller/dialogs/hidother.src
+++ b/chart2/source/controller/dialogs/hidother.src
@@ -91,6 +91,8 @@ hidspecial HID_SCH_DATALABEL_PLACEMENT {HelpId= HID_SCH_DATALABEL_PLACEMENT; };
hidspecial HID_SCH_TEXTDIRECTION {HelpId= HID_SCH_TEXTDIRECTION; };
hidspecial HID_SCH_TEXTDIRECTION_TITLE {HelpId= HID_SCH_TEXTDIRECTION_TITLE; };
hidspecial HID_SCH_TEXTDIRECTION_EQUATION {HelpId= HID_SCH_TEXTDIRECTION_EQUATION; };
+hidspecial HID_SCH_DATALABEL_ROTATION_KNOB {HelpId= HID_SCH_DATALABEL_ROTATION_KNOB; };
+hidspecial HID_SCH_DATALABEL_ROTATION_EDIT {HelpId= HID_SCH_DATALABEL_ROTATION_EDIT; };
hidspecial HID_SCH_TITLE_MAIN {HelpId= HID_SCH_TITLE_MAIN; };
hidspecial HID_SCH_TITLE_SUB {HelpId= HID_SCH_TITLE_SUB; };
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index ff92fe45f385..c6129629a51a 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -112,7 +112,7 @@ void lcl_setBoolItemToCheckBox( const SfxItemSet& rInAttrs, USHORT nWhichId, Che
}//end anonymous namespace
-DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAttrs, bool bShowTextDirectionListBox )
+DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAttrs )
: m_aCBNumber(pWindow, SchResId(CB_VALUE_AS_NUMBER)),
m_aPB_NumberFormatForValue(pWindow, SchResId(PB_NUMBERFORMAT)),
m_aCBPercent(pWindow, SchResId(CB_VALUE_AS_PERCENTAGE)),
@@ -122,6 +122,10 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt
m_aSeparatorResources(pWindow),
m_aFT_LabelPlacement(pWindow, SchResId(FT_LABEL_PLACEMENT)),
m_aLB_LabelPlacement(pWindow, SchResId(LB_LABEL_PLACEMENT)),
+ m_aFL_Rotate(pWindow, SchResId(FL_LABEL_ROTATE)),
+ m_aDC_Dial(pWindow, SchResId(CT_LABEL_DIAL)),
+ m_aFT_Degrees(pWindow, SchResId(FT_LABEL_DEGREES)),
+ m_aNF_Degrees(pWindow, SchResId(NF_LABEL_DEGREES)),
m_aFT_TextDirection(pWindow, SchResId(FT_LABEL_TEXTDIR)),
m_aLB_TextDirection(pWindow, SchResId(LB_LABEL_TEXTDIR), &m_aFT_TextDirection),
m_pNumberFormatter(0),
@@ -136,6 +140,7 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt
m_pWindow(pWindow),
m_pPool(rInAttrs.GetPool())
{
+ //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));
@@ -146,7 +151,6 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt
aAvailabelPlacementList =((const SfxIntegerListItem*)pPoolItem)->GetConstSequence();
m_aLB_LabelPlacement.Clear();
-
for( sal_Int32 nN=0; nN<aAvailabelPlacementList.getLength(); ++nN )
{
USHORT nListBoxPos = static_cast<USHORT>( nN );
@@ -155,55 +159,52 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt
m_aListBoxToPlacementMap[nListBoxPos]=nPlacement;
m_aLB_LabelPlacement.InsertEntry( aPlacementToStringMap[nPlacement] );
}
-
m_aLB_LabelPlacement.SetDropDownLineCount(m_aLB_LabelPlacement.GetEntryCount());
- Size aPBSize( m_aPB_NumberFormatForPercent.GetSizePixel() );
- long nMinWidth = ::std::max( m_aPB_NumberFormatForPercent.CalcMinimumSize().getWidth(), m_aPB_NumberFormatForValue.CalcMinimumSize().getWidth() );
- aPBSize.setWidth( nMinWidth+20 );//the min with is to small to fit, hm... so add alittle
+ //replace&resize push buttons and resize checkboxes
+ Size aControlDistance( pWindow->LogicToPixel( Size(RSC_SP_CTRL_DESC_X,RSC_SP_CTRL_GROUP_Y), MapMode(MAP_APPFONT) ) );
+ long nPBWidth = ::std::max( m_aPB_NumberFormatForPercent.CalcMinimumSize().getWidth(), m_aPB_NumberFormatForValue.CalcMinimumSize().getWidth() )
+ + 20; //the min with is to small to fit, hm... so add alittle
+ long nCBXWidth = ::std::max( m_aCBNumber.CalcMinimumSize().getWidth(), m_aCBPercent.CalcMinimumSize().getWidth() );
+ long nNewPBXPos = m_aCBNumber.GetPosPixel().X() + nCBXWidth + aControlDistance.Width();
+ long nPageWidth = pWindow->LogicToPixel( Size(260,185), MapMode(MAP_APPFONT) ).getWidth();
+ if( nNewPBXPos + nPBWidth > nPageWidth )
+ {
+ if( nPBWidth > nPageWidth/2 )
+ nPBWidth = nPageWidth/2;
+ nNewPBXPos = nPageWidth-nPBWidth;
+ nCBXWidth = nPageWidth-m_aCBNumber.GetPosPixel().X()-nPBWidth-aControlDistance.Width();
+ }
+ m_aPB_NumberFormatForValue.SetPosPixel( Point( nNewPBXPos, m_aPB_NumberFormatForValue.GetPosPixel().Y() ) );
+ m_aPB_NumberFormatForPercent.SetPosPixel( Point( nNewPBXPos, m_aPB_NumberFormatForPercent.GetPosPixel().Y() ) );
+ Size aPBSize( m_aPB_NumberFormatForPercent.GetSizePixel() );
+ aPBSize.setWidth( nPBWidth );
m_aPB_NumberFormatForValue.SetSizePixel( aPBSize );
m_aPB_NumberFormatForPercent.SetSizePixel( aPBSize );
- long nWantedMinRightBorder = m_aPB_NumberFormatForPercent.GetPosPixel().X() + m_aPB_NumberFormatForPercent.GetSizePixel().Width() - 1;
+ Size aCBSize( m_aCBNumber.GetSizePixel() );
+ aCBSize.setWidth(nCBXWidth);
+ m_aCBNumber.SetSizePixel( aCBSize );
+ m_aCBPercent.SetSizePixel( aCBSize );
+ //place and align separator and label placement listboxes
Size aSize( m_aFT_LabelPlacement.GetSizePixel() );
aSize.setWidth( m_aFT_LabelPlacement.CalcMinimumSize().getWidth() );
m_aFT_LabelPlacement.SetSizePixel(aSize);
- Size aControlDistance( pWindow->LogicToPixel( Size(RSC_SP_CTRL_DESC_X,RSC_SP_CTRL_GROUP_Y), MapMode(MAP_APPFONT) ) );
- long nWantedMinLeftBorder = m_aFT_LabelPlacement.GetPosPixel().X() + aSize.getWidth () + aControlDistance.Width();;
+ long nWantedMinLeftBorder = m_aFT_LabelPlacement.GetPosPixel().X() + aSize.getWidth () + aControlDistance.Width();
m_aSeparatorResources.PositionBelowControl(m_aCBSymbol);
- m_aSeparatorResources.AlignListBoxWidthAndXPos( nWantedMinLeftBorder, nWantedMinRightBorder, m_aLB_LabelPlacement.CalcMinimumSize().getWidth() );
+ m_aSeparatorResources.AlignListBoxWidthAndXPos( nWantedMinLeftBorder, -1, m_aLB_LabelPlacement.CalcMinimumSize().getWidth() );
m_aSeparatorResources.Show(true);
aSize = m_aLB_LabelPlacement.GetSizePixel();
aSize.setWidth( m_aSeparatorResources.GetCurrentListBoxSize().getWidth() );
m_aLB_LabelPlacement.SetSizePixel(aSize);
+ m_aLB_LabelPlacement.SetPosPixel( Point( m_aSeparatorResources.GetCurrentListBoxPosition().X(), m_aLB_LabelPlacement.GetPosPixel().Y() ) );
- long nYDiff = m_aFT_LabelPlacement.GetPosPixel().Y() - m_aLB_LabelPlacement.GetPosPixel().Y();
- Point aPos( m_aSeparatorResources.GetCurrentListBoxPosition() );
- aPos.Y() = m_aSeparatorResources.GetBottom();
- aPos.Y() += aControlDistance.Height();
- m_aLB_LabelPlacement.SetPosPixel(aPos);
-
- aPos.X() = m_aFT_LabelPlacement.GetPosPixel().X();
- aPos.Y() += nYDiff;
- m_aFT_LabelPlacement.SetPosPixel(aPos);
-
- // hide "text direction" listbox is specified by caller
- if( !bShowTextDirectionListBox )
- {
- m_aFT_TextDirection.Hide();
- m_aLB_TextDirection.Hide();
- }
- // move "text direction" listbox down below "label placement" listbox
- long nNewY = m_aLB_LabelPlacement.GetPosPixel().Y() + m_aLB_LabelPlacement.GetSizePixel().Height() + aControlDistance.Height();
- nYDiff = nNewY - m_aLB_TextDirection.GetPosPixel().Y();
- m_aFT_TextDirection.SetPosPixel( m_aFT_TextDirection.GetPosPixel() + Point( 0, nYDiff ) );
- m_aLB_TextDirection.SetPosPixel( m_aLB_TextDirection.GetPosPixel() + Point( 0, nYDiff ) );
-
+ //some click handler
m_aPB_NumberFormatForValue.SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) );
m_aPB_NumberFormatForPercent.SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) );
m_aCBNumber.SetClickHdl( LINK( this, DataLabelResources, CheckHdl ));
@@ -213,6 +214,15 @@ 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 )
+ {
+ bool bForbidPercentValue = (static_cast< const SfxBoolItem & >( rInAttrs.Get( SCHATTR_DATADESCR_NO_PERCENTVALUE )).GetValue() );
+ if( bForbidPercentValue )
+ m_aCBPercent.Enable(false);
+ }
+
+ m_aDC_Dial.SetLinkedField( &m_aNF_Degrees );
}
DataLabelResources::~DataLabelResources()
@@ -283,14 +293,14 @@ IMPL_LINK( DataLabelResources, CheckHdl, CheckBox*, pBox )
void DataLabelResources::EnableControls()
{
- m_aCBSymbol.Enable( m_aCBNumber.IsChecked() || m_aCBPercent.IsChecked() || m_aCBCategory.IsChecked() );
+ m_aCBSymbol.Enable( m_aCBNumber.IsChecked() || (m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled()) || m_aCBCategory.IsChecked() );
//enable separator
{
long nNumberOfCheckedLabelParts = 0;
if( m_aCBNumber.IsChecked() )
++nNumberOfCheckedLabelParts;
- if( m_aCBPercent.IsChecked() )
+ if( m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled() )
++nNumberOfCheckedLabelParts;
if( m_aCBCategory.IsChecked() )
++nNumberOfCheckedLabelParts;
@@ -304,7 +314,13 @@ void DataLabelResources::EnableControls()
}
m_aPB_NumberFormatForValue.Enable( m_pNumberFormatter && m_aCBNumber.IsChecked() );
- m_aPB_NumberFormatForPercent.Enable( m_pNumberFormatter && m_aCBPercent.IsChecked() );
+ m_aPB_NumberFormatForPercent.Enable( m_pNumberFormatter && m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled() );
+
+ bool bEnableRotation = ( m_aCBNumber.IsChecked() || m_aCBPercent.IsChecked() || m_aCBCategory.IsChecked() );
+ m_aFL_Rotate.Enable( bEnableRotation );
+ m_aDC_Dial.Enable( bEnableRotation );
+ m_aFT_Degrees.Enable( bEnableRotation );
+ m_aNF_Degrees.Enable( bEnableRotation );
}
BOOL DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
@@ -344,6 +360,12 @@ BOOL DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const
if( m_aLB_TextDirection.GetSelectEntryCount() > 0 )
rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_aLB_TextDirection.GetSelectEntryValue() ) );
+ if( m_aDC_Dial.IsVisible() )
+ {
+ sal_Int32 nDegrees = m_aDC_Dial.GetRotation();
+ rOutAttrs.Put(SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) );
+ }
+
return TRUE;
}
@@ -384,6 +406,14 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, 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 )
+ {
+ sal_Int32 nDegrees = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue();
+ m_aDC_Dial.SetRotation( nDegrees );
+ }
+ else
+ m_aDC_Dial.SetRotation( 0 );
+
EnableControls();
}
diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx
index cadbf1230c45..e560eed9f573 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.hxx
@@ -37,6 +37,8 @@
#include <svtools/itemset.hxx>
#include "TextDirectionListBox.hxx"
+#include <svx/dialcontrol.hxx>
+
class SvNumberFormatter;
//.............................................................................
@@ -47,7 +49,7 @@ namespace chart
class DataLabelResources
{
public:
- DataLabelResources( Window* pParent, const SfxItemSet& rInAttrs, bool bShowTextDirectionListBox );
+ DataLabelResources( Window* pParent, const SfxItemSet& rInAttrs );
virtual ~DataLabelResources();
BOOL FillItemSet(SfxItemSet& rOutAttrs) const;
@@ -68,6 +70,11 @@ private:
FixedText m_aFT_LabelPlacement;
ListBox m_aLB_LabelPlacement;
+ FixedLine m_aFL_Rotate;
+ svx::DialControl m_aDC_Dial;
+ FixedText m_aFT_Degrees;
+ NumericField m_aNF_Degrees;
+
FixedText m_aFT_TextDirection;
TextDirectionListBox m_aLB_TextDirection;
diff --git a/chart2/source/controller/dialogs/res_DataLabel_IDs.hrc b/chart2/source/controller/dialogs/res_DataLabel_IDs.hrc
index 536b355980d0..31112bdc3340 100644
--- a/chart2/source/controller/dialogs/res_DataLabel_IDs.hrc
+++ b/chart2/source/controller/dialogs/res_DataLabel_IDs.hrc
@@ -42,3 +42,7 @@
#define FT_LABEL_TEXTDIR 31
#define LB_LABEL_TEXTDIR 32
+#define FL_LABEL_ROTATE 40
+#define CT_LABEL_DIAL 40
+#define FT_LABEL_DEGREES 40
+#define NF_LABEL_DEGREES 40
diff --git a/chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc b/chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc
index 70d03376b51f..bc21882dd841 100644
--- a/chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc
+++ b/chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc
@@ -65,14 +65,14 @@ PushButton PB_NUMBERFORMAT \
{ \
HelpID = HID_SCH_PB_NUMBERFORMAT; \
TabStop = TRUE ; \
- Pos = MAP_APPFONT ( xpos+8 , ypos+12 ) ; \
+ Pos = MAP_APPFONT ( xpos+100 , ypos-3 ) ; \
Size = MAP_APPFONT ( 100 , 14 ) ; \
Text [ en-US ] = "Number ~format..." ; \
}; \
CheckBox CB_VALUE_AS_PERCENTAGE \
{ \
HelpID = HID_SCH_DATALABEL_PERCENT; \
- Pos = MAP_APPFONT ( xpos , ypos+30 ) ; \
+ Pos = MAP_APPFONT ( xpos , ypos+17 ) ; \
Size = MAP_APPFONT ( 136 , 10 ) ; \
TabStop = TRUE ; \
Text [ en-US ] = "Show value as ~percentage" ; \
@@ -81,29 +81,29 @@ PushButton PB_PERCENT_NUMBERFORMAT \
{ \
HelpID = HID_SCH_PB_PERCENT_NUMBERFORMAT; \
TabStop = TRUE ; \
- Pos = MAP_APPFONT ( xpos+8 , ypos+42 ) ; \
+ Pos = MAP_APPFONT ( xpos+100 , ypos+17-3 ) ; \
Size = MAP_APPFONT ( 100 , 14 ) ; \
Text [ en-US ] = "Percentage f~ormat..." ; \
}; \
CheckBox CB_CATEGORY \
{ \
HelpID = HID_SCH_DATALABEL_TEXT; \
- Pos = MAP_APPFONT ( xpos , ypos+62 ); \
- Size = MAP_APPFONT ( 182 , 10 ); \
+ Pos = MAP_APPFONT ( xpos , ypos+33 ); \
+ Size = MAP_APPFONT ( 254 , 10 ); \
TabStop = TRUE; \
Text [ en-US ] = "Show ~category"; \
}; \
CheckBox CB_SYMBOL \
{ \
HelpID = HID_SCH_DATALABEL_SYMBOL; \
- Pos = MAP_APPFONT ( xpos , ypos+76 ) ; \
- Size = MAP_APPFONT ( 182 , 10 ) ; \
+ Pos = MAP_APPFONT ( xpos , ypos+49 ) ; \
+ Size = MAP_APPFONT ( 254 , 10 ) ; \
TabStop = TRUE ; \
Text [ en-US ] = "Show ~legend key" ; \
}; \
FixedText FT_LABEL_PLACEMENT \
{ \
- Pos = MAP_APPFONT ( xpos , ypos+104 ) ; \
+ Pos = MAP_APPFONT ( xpos , ypos+84 ) ; \
Size = MAP_APPFONT ( 182 , 10 ) ; \
TabStop = FALSE ; \
Text [ en-US ] = "Place~ment"; \
@@ -113,7 +113,7 @@ ListBox LB_LABEL_PLACEMENT \
HelpID = HID_SCH_DATALABEL_PLACEMENT; \
Border = TRUE ; \
AutoHScroll = TRUE ; \
- Pos = MAP_APPFONT ( xpos+100 , ypos+102 ) ; \
+ Pos = MAP_APPFONT ( xpos+100 , ypos+82 ) ; \
Size = MAP_APPFONT ( 89 , 12 ) ; \
TabStop = TRUE ; \
Group = TRUE ; \
@@ -121,16 +121,48 @@ ListBox LB_LABEL_PLACEMENT \
DDExtraWidth = TRUE ; \
WORKAROUND \
}; \
+FixedLine FL_LABEL_ROTATE \
+{ \
+ Pos = MAP_APPFONT ( xpos, ypos+103 ) ; \
+ Size = MAP_APPFONT ( 248, 8 ) ; \
+ Text [ en-US ] = "Rotate Text" ; \
+}; \
+Control CT_LABEL_DIAL \
+{ \
+ HelpId = HID_SCH_DATALABEL_ROTATION_KNOB ; \
+ Pos = MAP_APPFONT ( xpos+6 , ypos+116 ) ; \
+ Size = MAP_APPFONT ( 43 , 43 ) ; \
+ Text = "ABCD" ; \
+}; \
+FixedText FT_LABEL_DEGREES \
+{ \
+ Pos = MAP_APPFONT ( xpos+87 , ypos+133 ) ; \
+ Size = MAP_APPFONT ( 46, 8 ) ; \
+ Text [ en-US ] = "~Degrees" ; \
+}; \
+NumericField NF_LABEL_DEGREES \
+{ \
+ HelpId = HID_SCH_DATALABEL_ROTATION_EDIT ; \
+ Pos = MAP_APPFONT ( xpos+55 , ypos+131 ) ; \
+ Size = MAP_APPFONT ( 28 , 12 ) ; \
+ Border = TRUE ; \
+ TabStop = TRUE ; \
+ Repeat = TRUE ; \
+ Spin = TRUE ; \
+ Minimum = 0 ; \
+ Maximum = 359 ; \
+ SpinSize = 5 ; \
+}; \
FixedText FT_LABEL_TEXTDIR \
{ \
- Pos = MAP_APPFONT ( xpos , ypos+120 ) ; \
+ Pos = MAP_APPFONT ( xpos , ypos+162 ) ; \
Size = MAP_APPFONT ( 64 , 8 ) ; \
Text [ en-US ] = "Te~xt direction" ; \
}; \
ListBox LB_LABEL_TEXTDIR \
{ \
HelpID = HID_SCH_TEXTDIRECTION; \
- Pos = MAP_APPFONT ( xpos+66 , ypos+118 ) ; \
+ Pos = MAP_APPFONT ( xpos+66 , ypos+160 ) ; \
Size = MAP_APPFONT ( 170 , 100 ) ; \
Border = TRUE; \
TabStop = TRUE; \
diff --git a/chart2/source/controller/dialogs/res_TextSeparator.cxx b/chart2/source/controller/dialogs/res_TextSeparator.cxx
index c01bf374f2b7..298499ed39d9 100644
--- a/chart2/source/controller/dialogs/res_TextSeparator.cxx
+++ b/chart2/source/controller/dialogs/res_TextSeparator.cxx
@@ -91,13 +91,6 @@ void TextSeparatorResources::PositionBelowControl( const Window& rWindow )
m_aLB_Separator.SetPosPixel( Point( aPoint.X()+m_aFT_Separator.GetSizePixel().Width()+aDistanceSize.Width(), aPoint.Y()-aDistanceSize.Height()-1) );
}
-long TextSeparatorResources::GetBottom() const
-{
- Point aPoint( m_aLB_Separator.GetPosPixel() );
- aPoint.Y() += m_aLB_Separator.GetSizePixel().Height();
- return aPoint.Y();
-}
-
void TextSeparatorResources::AlignListBoxWidthAndXPos( long nWantedLeftBorder /*use -1 to indicate that this can be automatic*/
, long nWantedRightBorder /*use -1 to indicate that this can be automatic*/
, long nMinimumListBoxWidth /*use -1 to indicate that this can be automatic*/ )
diff --git a/chart2/source/controller/dialogs/res_TextSeparator.hxx b/chart2/source/controller/dialogs/res_TextSeparator.hxx
index a93cab0f95fe..fb8365206fb5 100644
--- a/chart2/source/controller/dialogs/res_TextSeparator.hxx
+++ b/chart2/source/controller/dialogs/res_TextSeparator.hxx
@@ -57,7 +57,6 @@ public:
, long nMinimumListBoxWidth /*use -1 to indicate that this can be automatic*/ );
Point GetCurrentListBoxPosition() const;
Size GetCurrentListBoxSize() const;
- long GetBottom() const;
::rtl::OUString GetValue() const;
void SetValue( const ::rtl::OUString& rSeparator );
diff --git a/chart2/source/controller/dialogs/res_Trendline_tmpl.hrc b/chart2/source/controller/dialogs/res_Trendline_tmpl.hrc
index 4bd41b4047d6..45fc55435594 100644
--- a/chart2/source/controller/dialogs/res_Trendline_tmpl.hrc
+++ b/chart2/source/controller/dialogs/res_Trendline_tmpl.hrc
@@ -120,7 +120,7 @@ CheckBox CB_SHOW_CORRELATION_COEFF \
Pos = MAP_APPFONT( 10, 134 + yoffset ); \
Size = MAP_APPFONT( availablewidth - 20, 10 ); \
TabStop = TRUE; \
- Text[ en-US ] = "Show ~correlation coefficient (R²)"; \
+ Text[ en-US ] = "Show ~coefficient of determination (R²)"; \
};
#endif
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index f60637af4c44..c35f11546d36 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -862,6 +862,7 @@ ChartTypeTabPage::ChartTypeTabPage( Window* pParent
m_aChartTypeDialogControllerList.push_back(new AreaChartDialogController() );
m_aChartTypeDialogControllerList.push_back(new LineChartDialogController() );
m_aChartTypeDialogControllerList.push_back(new XYChartDialogController() );
+ m_aChartTypeDialogControllerList.push_back(new BubbleChartDialogController() );
m_aChartTypeDialogControllerList.push_back(new NetChartDialogController() );
m_aChartTypeDialogControllerList.push_back(new StockChartDialogController() );
m_aChartTypeDialogControllerList.push_back(new CombiColumnLineChartDialogController() );
@@ -994,7 +995,8 @@ IMPL_LINK( ChartTypeTabPage, SelectMainTypeHdl, void *, EMPTYARG )
aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel );
this->fillAllControls( aParameter );
- m_pCurrentMainType->fillExtraControls(aParameter,m_xChartModel);
+ uno::Reference< beans::XPropertySet > xTemplateProps( this->getCurrentTemplate(), uno::UNO_QUERY );
+ m_pCurrentMainType->fillExtraControls(aParameter,m_xChartModel,xTemplateProps);
}
return 0;
}
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx
index 35712ebcc566..2da9778a4db8 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx
@@ -42,7 +42,7 @@ namespace chart
DataLabelsTabPage::DataLabelsTabPage(Window* pWindow, const SfxItemSet& rInAttrs) :
SfxTabPage(pWindow, SchResId(TP_DATA_DESCR), rInAttrs),
- m_aDataLabelResources(this, rInAttrs, true)
+ m_aDataLabelResources(this, rInAttrs)
{
FreeResource();
}
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.src b/chart2/source/controller/dialogs/tp_DataLabel.src
index de4434759812..32f5835295f7 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.src
+++ b/chart2/source/controller/dialogs/tp_DataLabel.src
@@ -41,5 +41,5 @@ TabPage TP_DATA_DESCR
HelpID = HID_SCH_DATA_DESCR ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 260 , 185 ) ;
- RESOURCE_DATALABEL( 12, 8 )
+ RESOURCE_DATALABEL( 6, 8 )
};
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index 77c861d529e9..ff858c5bfdf5 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -42,7 +42,7 @@
#include "DataSeriesHelper.hxx"
#include "tp_DataSourceControls.hxx"
#include "ControllerLockGuard.hxx"
-#include "LabeledDataSequence.hxx"
+#include "DataSourceHelper.hxx"
#include <com/sun/star/sheet/XRangeSelection.hpp>
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/chart2/XChartType.hpp>
@@ -377,6 +377,29 @@ void DataSourceTabPage::initializePage()
{
}
+void DataSourceTabPage::DeactivatePage()
+{
+ commitPage();
+ svt::OWizardPage::DeactivatePage();
+}
+
+void DataSourceTabPage::commitPage()
+{
+ commitPage(eFinish);
+}
+
+sal_Bool DataSourceTabPage::commitPage( CommitPageReason /*eReason*/ )
+{
+ //ranges may have been edited in the meanwhile (dirty is true in that case here)
+ if( isValid() )
+ {
+ updateModelFromControl( 0 /*update all*/ );
+ return sal_True;//return false if this page should not be left
+ }
+ else
+ return sal_False;
+}
+
bool DataSourceTabPage::isRangeFieldContentValid( Edit & rEdit )
{
OUString aRange( rEdit.GetText());
@@ -890,7 +913,7 @@ bool DataSourceTabPage::updateModelFromControl( Edit * pField )
// create or change categories
if( !xLabeledSeq.is())
{
- xLabeledSeq.set( new ::chart::LabeledDataSequence( Reference< uno::XComponentContext >(0)));
+ xLabeledSeq.set( DataSourceHelper::createLabeledDataSequence( Reference< uno::XComponentContext >(0)));
m_rDialogModel.setCategories( xLabeledSeq );
}
try
@@ -945,7 +968,7 @@ bool DataSourceTabPage::updateModelFromControl( Edit * pField )
if( ! xLabeledSeq.is())
{
// no corresponding labeled data sequence for label found
- xLabeledSeq.set( new ::chart::LabeledDataSequence( Reference< uno::XComponentContext >(0)));
+ xLabeledSeq.set( DataSourceHelper::createLabeledDataSequence( Reference< uno::XComponentContext >(0)));
lcl_addLSequenceToDataSource( xLabeledSeq, xSource );
}
}
@@ -1009,7 +1032,7 @@ bool DataSourceTabPage::updateModelFromControl( Edit * pField )
xLabeledSeq.set( lcl_findLSequenceWithOnlyLabel( xSource ));
if( ! xLabeledSeq.is())
{
- xLabeledSeq.set( new ::chart::LabeledDataSequence( Reference< uno::XComponentContext >(0)));
+ xLabeledSeq.set( DataSourceHelper::createLabeledDataSequence( Reference< uno::XComponentContext >(0)));
lcl_addLSequenceToDataSource( xLabeledSeq, xSource );
}
}
diff --git a/chart2/source/controller/dialogs/tp_DataSource.hxx b/chart2/source/controller/dialogs/tp_DataSource.hxx
index 2703836d5d1d..6c42f1cb98e2 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.hxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.hxx
@@ -87,8 +87,15 @@ public:
bool bHideDescription = false );
virtual ~DataSourceTabPage();
+ void commitPage();
+
+protected:
// OWizardPage
virtual void ActivatePage();
+ virtual sal_Bool commitPage( CommitPageReason eReason );
+
+ //TabPage
+ virtual void DeactivatePage();
virtual void initializePage();
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index 4c626d1dfb37..38d36d032921 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -32,7 +32,6 @@
#include "tp_PolarOptions.hxx"
#include "tp_PolarOptions.hrc"
#include "ResId.hxx"
-#include "TabPages.hrc"
#include "chartview/ChartSfxItemIds.hxx"
#include "NoWarningThisInCTOR.hxx"
@@ -51,7 +50,9 @@ PolarOptionsTabPage::PolarOptionsTabPage( Window* pWindow,const SfxItemSet& rInA
m_aFL_StartingAngle( this, SchResId( FL_STARTING_ANGLE ) ),
m_aAngleDial( this, SchResId( CT_ANGLE_DIAL ) ),
m_aFT_Degrees( this, SchResId( FT_ROTATION_DEGREES ) ),
- m_aNF_StartingAngle( this, SchResId( NF_STARTING_ANGLE ) )
+ m_aNF_StartingAngle( this, SchResId( NF_STARTING_ANGLE ) ),
+ m_aFL_PlotOptions( this, SchResId( FL_PLOT_OPTIONS_POLAR ) ),
+ m_aCB_IncludeHiddenCells( this, SchResId( CB_INCLUDE_HIDDEN_CELLS_POLAR ) )
{
FreeResource();
@@ -78,6 +79,9 @@ BOOL PolarOptionsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
if( m_aCB_Clockwise.IsVisible() )
rOutAttrs.Put(SfxBoolItem(SCHATTR_CLOCKWISE,m_aCB_Clockwise.IsChecked()));
+ if (m_aCB_IncludeHiddenCells.IsVisible())
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_aCB_IncludeHiddenCells.IsChecked()));
+
return TRUE;
}
@@ -108,6 +112,16 @@ void PolarOptionsTabPage::Reset(const SfxItemSet& rInAttrs)
{
m_aCB_Clockwise.Show(FALSE);
}
+ if (rInAttrs.GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, 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);
+ }
}
//.............................................................................
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hrc b/chart2/source/controller/dialogs/tp_PolarOptions.hrc
index a618616e1cfe..680c9d126211 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hrc
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hrc
@@ -28,9 +28,13 @@
*
************************************************************************/
+#include "ResourceIds.hrc"
+
#define CB_CLOCKWISE 1
+#define CB_INCLUDE_HIDDEN_CELLS_POLAR 2
#define FL_STARTING_ANGLE 1
+#define FL_PLOT_OPTIONS_POLAR 2
#define CT_ANGLE_DIAL 1
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hxx b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
index 5a816ab87385..02a5ec5ba25b 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
@@ -58,6 +58,9 @@ private:
svx::DialControl m_aAngleDial;
FixedText m_aFT_Degrees;
NumericField m_aNF_StartingAngle;
+
+ FixedLine m_aFL_PlotOptions;
+ CheckBox m_aCB_IncludeHiddenCells;
};
//.............................................................................
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.src b/chart2/source/controller/dialogs/tp_PolarOptions.src
index 7c442c3ef12e..273c5f59dd5d 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.src
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.src
@@ -28,7 +28,6 @@
*
************************************************************************/
-#include "TabPages.hrc"
#include "tp_PolarOptions.hrc"
#include "HelpIds.hrc"
@@ -47,8 +46,8 @@ TabPage TP_POLAROPTIONS
};
FixedLine FL_STARTING_ANGLE
{
- Pos = MAP_APPFONT ( 12 , 21 ) ;
- Size = MAP_APPFONT ( 242 , 12 ) ;
+ Pos = MAP_APPFONT ( 6 , 21 ) ;
+ Size = MAP_APPFONT ( 248 , 12 ) ;
Text [ en-US ] = "Starting angle" ;
};
Control CT_ANGLE_DIAL
@@ -75,4 +74,17 @@ TabPage TP_POLAROPTIONS
Maximum = 359 ;
SpinSize = 5 ;
};
+ FixedLine FL_PLOT_OPTIONS_POLAR
+ {
+ Pos = MAP_APPFONT ( 6 , 90 ) ;
+ Size = MAP_APPFONT ( 248 , 8 ) ;
+ Text [ en-US ] = "Plot options";
+ };
+ CheckBox CB_INCLUDE_HIDDEN_CELLS_POLAR
+ {
+ Pos = MAP_APPFONT ( 12 , 104 ) ;
+ Size = MAP_APPFONT ( 200 , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Include ~values from hidden cells";
+ };
};
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
index 2c2bc3fc6892..8ba4d61a8057 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
@@ -216,6 +216,29 @@ void RangeChooserTabPage::initControlsFromModel()
m_nChangingControlCalls--;
}
+void RangeChooserTabPage::DeactivatePage()
+{
+ commitPage();
+ svt::OWizardPage::DeactivatePage();
+}
+
+void RangeChooserTabPage::commitPage()
+{
+ commitPage(eFinish);
+}
+
+sal_Bool RangeChooserTabPage::commitPage( CommitPageReason /*eReason*/ )
+{
+ //ranges may have been edited in the meanwhile (dirty is true in that case here)
+ if( isValid() )
+ {
+ changeDialogModelAccordingToControls();
+ return sal_True;//return false if this page should not be left
+ }
+ else
+ return sal_False;
+}
+
void RangeChooserTabPage::changeDialogModelAccordingToControls()
{
if(m_nChangingControlCalls>0)
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.hxx b/chart2/source/controller/dialogs/tp_RangeChooser.hxx
index 01062ba4c0f1..bb508da8d9a1 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.hxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.hxx
@@ -70,10 +70,16 @@ virtual ~RangeChooserTabPage();
virtual void listeningFinished( const ::rtl::OUString & rNewRange );
virtual void disposingRangeSelection();
+ void commitPage();
+
protected: //methods
//OWizardPage
virtual void ActivatePage();
+ virtual sal_Bool commitPage( CommitPageReason eReason );
+
+ //TabPage
+ virtual void DeactivatePage();
void initControlsFromModel();
void changeDialogModelAccordingToControls();
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
index 855665f4fd02..cc8ac2139639 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
@@ -31,9 +31,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
#include "tp_SeriesToAxis.hxx"
+#include "tp_SeriesToAxis.hrc"
#include "ResId.hxx"
-#include "TabPages.hrc"
#include "chartview/ChartSfxItemIds.hxx"
#include "NoWarningThisInCTOR.hxx"
@@ -43,6 +43,8 @@
#include <svtools/intitem.hxx>
//SfxIntegerListItem
#include <svtools/ilstitem.hxx>
+#include <svtools/controldims.hrc>
+
#include <com/sun/star/chart/MissingValueTreatment.hpp>
//.............................................................................
@@ -63,10 +65,12 @@ SchOptionTabPage::SchOptionTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
aMTOverlap(this,SchResId(MT_OVERLAP)),
aCBConnect(this,SchResId(CB_CONNECTOR)),
aCBAxisSideBySide(this,SchResId(CB_BARS_SIDE_BY_SIDE)),
- m_aFL_EmptyCells(this,SchResId(FL_PLOT_MISSING_VALUES)),
+ m_aFL_PlotOptions(this,SchResId(FL_PLOT_OPTIONS)),
+ m_aFT_MissingValues(this,SchResId(FT_MISSING_VALUES)),
m_aRB_DontPaint(this,SchResId(RB_DONT_PAINT)),
m_aRB_AssumeZero(this,SchResId(RB_ASSUME_ZERO)),
m_aRB_ContinueLine(this,SchResId(RB_CONTINUE_LINE)),
+ m_aCBIncludeHiddenCells(this,SchResId(CB_INCLUDE_HIDDEN_CELLS)),
m_bProvidesSecondaryYAxis(true),
m_bProvidesOverlapAndGapWidth(false)
{
@@ -123,6 +127,9 @@ BOOL SchOptionTabPage::FillItemSet(SfxItemSet& rOutAttrs)
else if(m_aRB_ContinueLine.IsChecked())
rOutAttrs.Put(SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT,::com::sun::star::chart::MissingValueTreatment::CONTINUE));
+ if (m_aCBIncludeHiddenCells.IsVisible())
+ rOutAttrs.Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_aCBIncludeHiddenCells.IsChecked()));
+
return TRUE;
}
@@ -212,13 +219,26 @@ void SchOptionTabPage::Reset(const SfxItemSet& rInAttrs)
}
else
{
+ m_aFT_MissingValues.Show(FALSE);
m_aRB_DontPaint.Show(FALSE);
m_aRB_AssumeZero.Show(FALSE);
m_aRB_ContinueLine.Show(FALSE);
- m_aFL_EmptyCells.Show(FALSE);
}
}
+ // Include hidden cells
+ if (rInAttrs.GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, TRUE, &pPoolItem) == SFX_ITEM_SET)
+ {
+ bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+ m_aCBIncludeHiddenCells.Check(bVal);
+ }
+ else
+ {
+ m_aCBIncludeHiddenCells.Show(FALSE);
+ if(!m_aFT_MissingValues.IsVisible())
+ m_aFL_PlotOptions.Show(FALSE);
+ }
+
AdaptControlPositionsAndVisibility();
}
@@ -231,6 +251,17 @@ void SchOptionTabPage::Init( bool bProvidesSecondaryYAxis, bool bProvidesOverlap
AdaptControlPositionsAndVisibility();
}
+void lcl_offsetControl(Control& rCtrl, long nXOffset, long nYOffset )
+{
+ Point aPos = rCtrl.GetPosPixel();
+ rCtrl.SetPosPixel( Point(aPos.getX() + nXOffset, aPos.getY() + nYOffset) );
+}
+
+void lcl_optimzeRadioButtonSize( RadioButton& rCtrl )
+{
+ rCtrl.SetSizePixel( rCtrl.CalcMinimumSize() );
+}
+
void SchOptionTabPage::AdaptControlPositionsAndVisibility()
{
aRbtAxis1.Show(m_bProvidesSecondaryYAxis);
@@ -254,20 +285,30 @@ void SchOptionTabPage::AdaptControlPositionsAndVisibility()
else
aPos = aGrpBar.GetPosPixel();
- long nDiffX = aRbtAxis1.GetPosPixel().getX() - aGrpAxis.GetPosPixel().getX();
- long nDiffY = aRbtAxis1.GetPosPixel().getY() - aGrpAxis.GetPosPixel().getY();
- long nDiffY1 = aRbtAxis2.GetPosPixel().getY() - aRbtAxis1.GetPosPixel().getY();
-
- m_aFL_EmptyCells.SetPosPixel( aPos );
- m_aRB_DontPaint.SetPosPixel( Point( aPos.getX() + nDiffX, aPos.getY() + nDiffY ) );
- m_aRB_AssumeZero.SetPosPixel( Point( aPos.getX() + nDiffX, aPos.getY() + nDiffY + nDiffY1 ) );
- m_aRB_ContinueLine.SetPosPixel( Point( aPos.getX() + nDiffX, aPos.getY() + nDiffY + nDiffY1 * 2 ) );
+ long nYOffset = aPos.getY() - m_aFL_PlotOptions.GetPosPixel().getY();
+ lcl_offsetControl(m_aFL_PlotOptions, 0, nYOffset);
+ lcl_offsetControl(m_aFT_MissingValues, 0, nYOffset);
+ lcl_offsetControl(m_aRB_DontPaint, 0, nYOffset);
+ lcl_offsetControl(m_aRB_AssumeZero, 0, nYOffset);
+ lcl_offsetControl(m_aRB_ContinueLine, 0, nYOffset);
+ lcl_offsetControl(m_aCBIncludeHiddenCells, 0, nYOffset);
}
- if( !m_aRB_DontPaint.IsVisible() )
+ m_aFT_MissingValues.SetSizePixel( m_aFT_MissingValues.CalcMinimumSize() );
+ lcl_optimzeRadioButtonSize( m_aRB_DontPaint );
+ lcl_optimzeRadioButtonSize( m_aRB_AssumeZero );
+ lcl_optimzeRadioButtonSize( m_aRB_ContinueLine );
+
+ Size aControlDistance( m_aFT_MissingValues.LogicToPixel( Size(RSC_SP_CTRL_DESC_X,RSC_SP_CTRL_GROUP_Y), MapMode(MAP_APPFONT) ) );
+ long nXOffset = m_aFT_MissingValues.GetPosPixel().getX() + m_aFT_MissingValues.GetSizePixel().getWidth() + aControlDistance.getWidth() - m_aRB_DontPaint.GetPosPixel().getX();
+ lcl_offsetControl(m_aRB_DontPaint, nXOffset, 0);
+ lcl_offsetControl(m_aRB_AssumeZero, nXOffset, 0);
+ lcl_offsetControl(m_aRB_ContinueLine, nXOffset, 0);
+
+ if( !m_aFT_MissingValues.IsVisible() )
{
- m_aRB_ContinueLine.SetPosPixel( m_aRB_AssumeZero.GetPosPixel() );
- m_aRB_AssumeZero.SetPosPixel( m_aRB_DontPaint.GetPosPixel() );
+ //for example for stock charts
+ m_aCBIncludeHiddenCells.SetPosPixel( m_aFT_MissingValues.GetPosPixel() );
}
}
//.............................................................................
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.hrc b/chart2/source/controller/dialogs/tp_SeriesToAxis.hrc
new file mode 100644
index 000000000000..2a39c313ca3c
--- /dev/null
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.hrc
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ,v $
+ * $Revision: $
+ *
+ * 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 GRP_OPT_AXIS 1
+#define RBT_OPT_AXIS_1 2
+#define RBT_OPT_AXIS_2 3
+#define MT_GAP 4
+#define MT_OVERLAP 5
+#define FT_GAP 6
+#define FT_OVERLAP 7
+#define GB_BAR 8
+#define CB_CONNECTOR 9
+#define CB_BARS_SIDE_BY_SIDE 10
+#define FL_PLOT_OPTIONS 11
+#define FT_MISSING_VALUES 12
+#define RB_DONT_PAINT 13
+#define RB_ASSUME_ZERO 14
+#define RB_CONTINUE_LINE 15
+#define CB_INCLUDE_HIDDEN_CELLS 16
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
index c066e637fb2e..10fcae66c1e3 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
@@ -74,11 +74,14 @@ private: //member
CheckBox aCBConnect;
CheckBox aCBAxisSideBySide;
- FixedLine m_aFL_EmptyCells;
+ FixedLine m_aFL_PlotOptions;
+ FixedText m_aFT_MissingValues;
RadioButton m_aRB_DontPaint;
RadioButton m_aRB_AssumeZero;
RadioButton m_aRB_ContinueLine;
+ CheckBox m_aCBIncludeHiddenCells;
+
DECL_LINK(EnableHdl, RadioButton * );
sal_Int32 m_nAllSeriesAxisIndex;
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.src b/chart2/source/controller/dialogs/tp_SeriesToAxis.src
index f79028488230..0686e45f25b3 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.src
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.src
@@ -28,7 +28,7 @@
*
************************************************************************/
#include "HelpIds.hrc"
-#include "TabPages.hrc"
+#include "tp_SeriesToAxis.hrc"
TabPage TP_OPTIONS
{
@@ -120,7 +120,7 @@ TabPage TP_OPTIONS
Pos = MAP_APPFONT ( 12 , 97 ) ;
Size = MAP_APPFONT ( 200 , 10 ) ;
TabStop = TRUE ;
- Text [ en-US ] = "Connection Lines";
+ Text [ en-US ] = "Connection lines";
};
CheckBox CB_BARS_SIDE_BY_SIDE
@@ -131,16 +131,23 @@ TabPage TP_OPTIONS
Text [ en-US ] = "Show ~bars side by side";
};
- FixedLine FL_PLOT_MISSING_VALUES
+ FixedLine FL_PLOT_OPTIONS
{
Pos = MAP_APPFONT ( 6 , 113 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
+ Text [ en-US ] = "Plot options";
+ };
+
+ FixedText FT_MISSING_VALUES
+ {
+ Pos = MAP_APPFONT ( 12 , 127 ) ;
+ Size = MAP_APPFONT ( 80 , 8 ) ;
Text [ en-US ] = "Plot missing values";
};
RadioButton RB_DONT_PAINT
{
- Pos = MAP_APPFONT ( 12 , 127 ) ;
+ Pos = MAP_APPFONT ( 82 , 127 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Leave gap";
@@ -148,7 +155,7 @@ TabPage TP_OPTIONS
RadioButton RB_ASSUME_ZERO
{
- Pos = MAP_APPFONT ( 12 , 141 ) ;
+ Pos = MAP_APPFONT ( 82 , 141 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Assume zero";
@@ -156,9 +163,17 @@ TabPage TP_OPTIONS
RadioButton RB_CONTINUE_LINE
{
- Pos = MAP_APPFONT ( 12 , 155 ) ;
+ Pos = MAP_APPFONT ( 82 , 155 ) ;
Size = MAP_APPFONT ( 80 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~Continue line";
};
+
+ CheckBox CB_INCLUDE_HIDDEN_CELLS
+ {
+ Pos = MAP_APPFONT ( 12 , 172 ) ;
+ Size = MAP_APPFONT ( 200 , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "Include ~values from hidden cells";
+ };
};
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index 7ed9a93073bd..fa285f98d991 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -321,7 +321,7 @@ SfxItemSet DrawViewWrapper::getPositionAndSizeItemSetFromMarkedObject() const
0);
SfxItemSet aGeoSet( E3dView::GetGeoAttrFromMarked() );
aFullSet.Put( aGeoSet );
- aFullSet.Put( SfxUInt16Item(SID_ATTR_METRIC,static_cast< sal_uInt16 >( ConfigurationAccess::getConfigurationAccess()->getFieldUnit())));
+ aFullSet.Put( SfxUInt16Item(SID_ATTR_METRIC,static_cast< sal_uInt16 >( ConfigurationAccess::getFieldUnit())));
return aFullSet;
}
diff --git a/chart2/source/controller/inc/ChartRenderer.hxx b/chart2/source/controller/inc/ChartRenderer.hxx
index 3b2c3b90b35d..0a2ec2cde87c 100644
--- a/chart2/source/controller/inc/ChartRenderer.hxx
+++ b/chart2/source/controller/inc/ChartRenderer.hxx
@@ -53,12 +53,10 @@ class ChartRenderer : public ::cppu::WeakImplHelper2<
{
public:
ChartRenderer( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
- ChartRenderer( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext);
virtual ~ChartRenderer();
// ___lang::XServiceInfo___
APPHELPER_XSERVICEINFO_DECL()
- APPHELPER_SERVICE_FACTORY_HELPER(ChartRenderer)
// ____ XUnoTunnel ___
virtual ::sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aIdentifier )
diff --git a/chart2/source/controller/inc/ConfigurationAccess.hxx b/chart2/source/controller/inc/ConfigurationAccess.hxx
index 3866d00feb65..02bdb7da8082 100644
--- a/chart2/source/controller/inc/ConfigurationAccess.hxx
+++ b/chart2/source/controller/inc/ConfigurationAccess.hxx
@@ -43,15 +43,8 @@ namespace chart
/**
*/
-class CalcConfigItem;
-class ConfigurationAccess
+namespace ConfigurationAccess
{
-public:
- // use this to get the singleton ConfigurationAccess (CTOR is private)
- static ConfigurationAccess * getConfigurationAccess();
-
- ~ConfigurationAccess();
-
/** @descr Retrieve the FieldUnit to be used for the UI. This unit is retrieved
from the registry settings of the Calc application.
@@ -61,13 +54,7 @@ public:
@return the FieldUnit enum. See <vcl/fldunit.hxx> for definition
*/
FieldUnit getFieldUnit();
-
-private:
- ConfigurationAccess();
-
- static ConfigurationAccess * m_pThis;
- CalcConfigItem* m_pCalcConfigItem;
-};
+}
//.............................................................................
} //namespace chart
diff --git a/chart2/source/controller/inc/DataPointItemConverter.hxx b/chart2/source/controller/inc/DataPointItemConverter.hxx
index a59170f4d699..4eec81bd20b5 100644
--- a/chart2/source/controller/inc/DataPointItemConverter.hxx
+++ b/chart2/source/controller/inc/DataPointItemConverter.hxx
@@ -103,6 +103,7 @@ private:
sal_Int32 m_nNumberFormat;
sal_Int32 m_nPercentNumberFormat;
::com::sun::star::uno::Sequence< sal_Int32 > m_aAvailableLabelPlacements;
+ bool m_bForbidPercentValue;
};
} // namespace wrapper
diff --git a/chart2/source/controller/inc/HelpIds.hrc b/chart2/source/controller/inc/HelpIds.hrc
index 68edcdc54dd5..ccff9e913f97 100644
--- a/chart2/source/controller/inc/HelpIds.hrc
+++ b/chart2/source/controller/inc/HelpIds.hrc
@@ -31,7 +31,7 @@
#define CHART_HELPIDS_HRC
#include <svtools/solar.hrc>
-//next is 118
+//next is 120
//see old chart: schhids.h
@@ -142,6 +142,8 @@
#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)
diff --git a/chart2/source/controller/inc/ItemConverter.hxx b/chart2/source/controller/inc/ItemConverter.hxx
index 9f21d00dd0a1..e55456519cd1 100644
--- a/chart2/source/controller/inc/ItemConverter.hxx
+++ b/chart2/source/controller/inc/ItemConverter.hxx
@@ -38,8 +38,6 @@
// for pair
#include <utility>
-struct SfxItemPropertyMap;
-
namespace comphelper
{
diff --git a/chart2/source/controller/inc/ObjectHierarchy.hxx b/chart2/source/controller/inc/ObjectHierarchy.hxx
index f0614f7a6d86..3281181c5be7 100644
--- a/chart2/source/controller/inc/ObjectHierarchy.hxx
+++ b/chart2/source/controller/inc/ObjectHierarchy.hxx
@@ -62,7 +62,8 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDocument,
ExplicitValueProvider * pExplicitValueProvider = 0,
- bool bFlattenDiagram = false );
+ bool bFlattenDiagram = false,
+ bool bOrderingForElementSelector = false );
~ObjectHierarchy();
static tCID getRootNodeCID();
diff --git a/chart2/source/controller/inc/ObjectNameProvider.hxx b/chart2/source/controller/inc/ObjectNameProvider.hxx
index 2892c769c7a0..529f253fc20a 100644
--- a/chart2/source/controller/inc/ObjectNameProvider.hxx
+++ b/chart2/source/controller/inc/ObjectNameProvider.hxx
@@ -32,6 +32,7 @@
#define _CHART2_OBJECTNAME_PROVIDER_HXX
#include "ObjectIdentifier.hxx"
+#include "TitleHelper.hxx"
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -57,12 +58,20 @@ public:
static rtl::OUString getTitleName( const rtl::OUString& rObjectCID
, const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xChartModel );
+ static rtl::OUString getTitleNameByType( TitleHelper::eTitleType eType );
static rtl::OUString getNameForCID(
const rtl::OUString& rObjectCID,
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument >& xChartDocument );
+ static rtl::OUString getName_ObjectForSeries(
+ ObjectType eObjectType,
+ const rtl::OUString& rSeriesCID,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartDocument >& xChartDocument );
+ static rtl::OUString getName_ObjectForAllSeries( ObjectType eObjectType );
+
/** Provides help texts for the various chart elements.
The parameter rObjectCID has to be a ClassifiedIdentifier - see class ObjectIdentifier.
*/
diff --git a/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx b/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
index 1702673a6462..0f4a9869fcc9 100644
--- a/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
+++ b/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
@@ -93,6 +93,9 @@ private:
::com::sun::star::uno::Sequence< sal_Int32 > m_aSupportedMissingValueTreatments;
sal_Int32 m_nMissingValueTreatment;
+
+ bool m_bSupportingPlottingOfHiddenCells;
+ bool m_bIncludeHiddenCells;
};
} // namespace wrapper
diff --git a/chart2/source/controller/inc/dlg_DataSource.hxx b/chart2/source/controller/inc/dlg_DataSource.hxx
index cfbe7aa561e8..331136607e75 100644
--- a/chart2/source/controller/inc/dlg_DataSource.hxx
+++ b/chart2/source/controller/inc/dlg_DataSource.hxx
@@ -68,6 +68,9 @@ public:
::com::sun::star::uno::XComponentContext > & xContext );
virtual ~DataSourceDialog();
+ // from Dialog (base of TabDialog)
+ virtual short Execute();
+
// TabPageNotifiable
virtual void setInvalidPage( TabPage * pTabPage );
virtual void setValidPage( TabPage * pTabPage );
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index f1bc4ce4097c..0c7ff467a91b 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -38,7 +38,6 @@
#include "chartview/ExplicitValueProvider.hxx"
#include "SchWhichPairs.hxx"
#include "macros.hxx"
-#include "Scaling.hxx"
#include "ChartModelHelper.hxx"
#include "AxisHelper.hxx"
#include "CommonConverters.hxx"
@@ -180,45 +179,42 @@ void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemS
{
case SCHATTR_AXIS_AUTO_MAX:
// if the any has no value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, ( ! aScale.Maximum.hasValue())));
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aScale.Maximum) ) );
break;
case SCHATTR_AXIS_MAX:
- if( aScale.Maximum.hasValue())
{
- OSL_ASSERT( aScale.Maximum.getValueTypeClass() == uno::TypeClass_DOUBLE );
- rOutItemSet.Put(
- SvxDoubleItem(
- *reinterpret_cast< const double * >( aScale.Maximum.getValue()), nWhichId ));
- }
- else
- {
- double fExplicitMax = 10.0;
- if( m_pExplicitScale )
- fExplicitMax = m_pExplicitScale->Maximum;
-
- rOutItemSet.Put(
- SvxDoubleItem( fExplicitMax, nWhichId ));
+ double fMax = 10.0;
+ if( aScale.Maximum >>= fMax )
+ {
+ rOutItemSet.Put( SvxDoubleItem( fMax, nWhichId ) );
+ }
+ else
+ {
+ if( m_pExplicitScale )
+ fMax = m_pExplicitScale->Maximum;
+ rOutItemSet.Put( SvxDoubleItem( fMax, nWhichId ) );
+ }
}
break;
case SCHATTR_AXIS_AUTO_MIN:
// if the any has no value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, ( ! aScale.Minimum.hasValue())));
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aScale.Minimum) ) );
break;
case SCHATTR_AXIS_MIN:
- if( aScale.Minimum.hasValue())
- {
- OSL_ASSERT( aScale.Minimum.getValueTypeClass() == uno::TypeClass_DOUBLE );
- rOutItemSet.Put(
- SvxDoubleItem(
- *reinterpret_cast< const double * >( aScale.Minimum.getValue()), nWhichId ));
- }
- else
{
- if( m_pExplicitScale )
- rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId ));
+ double fMin = 0.0;
+ if( aScale.Minimum >>= fMin )
+ {
+ rOutItemSet.Put( SvxDoubleItem( fMin, nWhichId ) );
+ }
+ else
+ {
+ if( m_pExplicitScale )
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId ));
+ }
}
break;
@@ -236,21 +232,21 @@ void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemS
// Increment
case SCHATTR_AXIS_AUTO_STEP_MAIN:
// if the any has no value => auto is on
- rOutItemSet.Put( SfxBoolItem( nWhichId, ( ! aInc.Distance.hasValue())));
+ rOutItemSet.Put( SfxBoolItem( nWhichId, !hasDoubleValue(aInc.Distance) ) );
break;
case SCHATTR_AXIS_STEP_MAIN:
- if( aInc.Distance.hasValue())
- {
- OSL_ASSERT( aInc.Distance.getValueTypeClass() == uno::TypeClass_DOUBLE );
- rOutItemSet.Put(
- SvxDoubleItem(
- *reinterpret_cast< const double * >( aInc.Distance.getValue()), nWhichId ));
- }
- else
{
- if( m_pExplicitIncrement )
- rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId ));
+ double fDistance = 1.0;
+ if( aInc.Distance >>= fDistance )
+ {
+ rOutItemSet.Put( SvxDoubleItem(fDistance, nWhichId ));
+ }
+ else
+ {
+ if( m_pExplicitIncrement )
+ rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId ));
+ }
}
break;
@@ -478,7 +474,7 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI
// logarithm is true
if( ! bWasLogarithm )
{
- aScale.Scaling = new LogarithmicScaling( 10.0 );
+ aScale.Scaling = AxisHelper::createLogarithmicScaling( 10.0 );
bSetScale = true;
}
}
@@ -487,7 +483,7 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI
// logarithm is false => linear scaling
if( bWasLogarithm )
{
- aScale.Scaling = new LinearScaling( 1.0, 0.0 );
+ aScale.Scaling = AxisHelper::createLinearScaling();
bSetScale = true;
}
}
diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
index a6f20f53fcf3..ad2aab714757 100644
--- a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx
@@ -78,7 +78,7 @@ namespace
// IPM_MAP_ENTRY( EE_CHAR_WEIGHT_CTL, "CharWeightComplex", 0 )
// IPM_MAP_ENTRY( EE_CHAR_ITALIC_CJK, "CharPostureAsian", 0 )
// IPM_MAP_ENTRY( EE_CHAR_ITALIC_CTL, "CharPostureComplex", 0 )
-
+ IPM_MAP_ENTRY( EE_PARA_ASIANCJKSPACING, "ParaIsCharacterDistance", 0 )
);
return aCharacterPropertyMap;
@@ -290,6 +290,11 @@ void CharacterPropertyItemConverter::FillSpecialItem(
rOutItemSet.Put( SfxStringItem( nWhichId, C2U( "" ) ) );
}
break;
+
+ case EE_PARA_FORBIDDENRULES:
+ case EE_PARA_HANGINGPUNCTUATION:
+ rOutItemSet.DisableItem( nWhichId );
+ break;
}
}
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 4593230d65cc..af062cf3b93c 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -239,7 +239,8 @@ DataPointItemConverter::DataPointItemConverter(
m_nSpecialFillColor(nSpecialFillColor),
m_nNumberFormat(nNumberFormat),
m_nPercentNumberFormat(nPercentNumberFormat),
- m_aAvailableLabelPlacements()
+ m_aAvailableLabelPlacements(),
+ m_bForbidPercentValue(true)
{
m_aConverters.push_back( new GraphicPropertyItemConverter(
rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory, eMapTo ));
@@ -257,6 +258,8 @@ DataPointItemConverter::DataPointItemConverter(
bool bAmbiguous = false;
sal_Bool bSwapXAndY = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
m_aAvailableLabelPlacements = ChartTypeHelper::getSupportedLabelPlacements( xChartType, DiagramHelper::getDimension( xDiagram ), bSwapXAndY, xSeries );
+
+ m_bForbidPercentValue = AxisType::CATEGORY != ChartTypeHelper::getAxisType( xChartType, 0 );
}
DataPointItemConverter::~DataPointItemConverter()
@@ -521,6 +524,24 @@ bool DataPointItemConverter::ApplySpecialItem(
}
}
break;
+
+ case SCHATTR_TEXT_DEGREES:
+ {
+ double fValue = static_cast< double >(
+ static_cast< const SfxInt32Item & >(
+ rItemSet.Get( nWhichId )).GetValue()) / 100.0;
+ double fOldValue = 0.0;
+ bool bPropExisted =
+ ( GetPropertySet()->getPropertyValue( C2U( "TextRotation" )) >>= fOldValue );
+
+ if( ! bPropExisted ||
+ ( bPropExisted && fOldValue != fValue ))
+ {
+ GetPropertySet()->setPropertyValue( C2U( "TextRotation" ), uno::makeAny( fValue ));
+ bChanged = true;
+ }
+ }
+ break;
}
return bChanged;
@@ -630,6 +651,12 @@ void DataPointItemConverter::FillSpecialItem(
}
break;
+ case SCHATTR_DATADESCR_NO_PERCENTVALUE:
+ {
+ rOutItemSet.Put( SfxBoolItem( nWhichId, m_bForbidPercentValue ));
+ }
+ break;
+
case SCHATTR_STYLE_SYMBOL:
{
chart2::Symbol aSymbol;
@@ -657,6 +684,18 @@ void DataPointItemConverter::FillSpecialItem(
}
}
break;
+
+ case SCHATTR_TEXT_DEGREES:
+ {
+ double fValue = 0;
+
+ if( GetPropertySet()->getPropertyValue( C2U( "TextRotation" )) >>= fValue )
+ {
+ rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast< sal_Int32 >(
+ ::rtl::math::round( fValue * 100.0 ) ) ));
+ }
+ }
+ break;
}
}
diff --git a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
index 9f300e8febc1..4b626e1be839 100644
--- a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
+++ b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
@@ -141,9 +141,8 @@ AllDataLabelItemConverter::AllDataLabelItemConverter(
uno::Reference< beans::XPropertySet > xObjectProperties( *aIt, uno::UNO_QUERY);
uno::Reference< uno::XComponentContext> xContext(0);//do not need Context for label properties
- sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForLabel( xObjectProperties, *aIt, -1/*nPointIndex*/,
- uno::Reference< beans::XPropertySet >( DiagramHelper::getAttachedAxis( *aIt, ChartModelHelper::findDiagram( xChartModel ) ), uno::UNO_QUERY ) );
- sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForLabel(
+ sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties, *aIt, -1/*nPointIndex*/, ChartModelHelper::findDiagram( xChartModel ) );
+ sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
xObjectProperties,uno::Reference< util::XNumberFormatsSupplier >(xChartModel, uno::UNO_QUERY));
m_aConverters.push_back( new ::chart::wrapper::DataPointItemConverter(
diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
index 00a535fe5eaf..dbefb0e7f025 100644
--- a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
+++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
@@ -128,8 +128,8 @@ const USHORT nDataLabelWhichPairs[] =
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_DATADESCR_PLACEMENT, SCHATTR_DATADESCR_PLACEMENT,
- SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS,
+ SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES,
+ EE_PARA_WRITINGDIR,EE_PARA_WRITINGDIR,
0
};
@@ -143,8 +143,7 @@ const USHORT nDataLabelWhichPairs[] =
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_DATADESCR_PLACEMENT, SCHATTR_DATADESCR_PLACEMENT, \
- SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, \
+ 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*/ \
@@ -163,7 +162,8 @@ const USHORT nDataPointWhichPairs[] =
SCHATTR_STARTING_ANGLE,SCHATTR_STARTING_ANGLE, \
SCHATTR_CLOCKWISE,SCHATTR_CLOCKWISE, \
SCHATTR_MISSING_VALUE_TREATMENT,SCHATTR_MISSING_VALUE_TREATMENT, \
- SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS
+ SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, \
+ SCHATTR_INCLUDE_HIDDEN_CELLS,SCHATTR_INCLUDE_HIDDEN_CELLS
const USHORT nSeriesOptionsWhichPairs[] =
{
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index de4fe9f2d745..f30bb4aeda57 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -93,6 +93,8 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
, m_bClockwise(false)
, m_aSupportedMissingValueTreatments()
, m_nMissingValueTreatment(0)
+ , m_bSupportingPlottingOfHiddenCells(false)
+ , m_bIncludeHiddenCells(true)
{
try
{
@@ -159,6 +161,23 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
m_aSupportedMissingValueTreatments = ChartTypeHelper::getSupportedMissingValueTreatments( xChartType );
m_nMissingValueTreatment = DiagramHelper::getCorrectedMissingValueTreatment(
ChartModelHelper::findDiagram(m_xChartModel), xChartType );
+
+ uno::Reference< XChartDocument > xChartDoc( m_xChartModel, uno::UNO_QUERY );
+ uno::Reference< beans::XPropertySet > xProp( xChartDoc->getDataProvider(), uno::UNO_QUERY );
+ if( xProp.is() )
+ {
+ try
+ {
+ //test whether the data provider offers this property
+ xProp->getPropertyValue(C2U("IncludeHiddenCells"));
+ //if not exception is thrown the property is offered
+ m_bSupportingPlottingOfHiddenCells = true;
+ xDiagramProperties->getPropertyValue( C2U("IncludeHiddenCells") ) >>= m_bIncludeHiddenCells;
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ }
+ }
}
catch( uno::Exception ex )
{
@@ -341,6 +360,16 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte
}
}
break;
+ case SCHATTR_INCLUDE_HIDDEN_CELLS:
+ {
+ if( m_bSupportingPlottingOfHiddenCells )
+ {
+ bool bIncludeHiddenCells = static_cast<const SfxBoolItem &>(rItemSet.Get(nWhichId)).GetValue();
+ if (bIncludeHiddenCells != m_bIncludeHiddenCells)
+ bChanged = ChartModelHelper::setIncludeHiddenCells( bIncludeHiddenCells, m_xChartModel );
+ }
+ }
+ break;
}
return bChanged;
}
@@ -412,6 +441,12 @@ void SeriesOptionsItemConverter::FillSpecialItem(
rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
break;
}
+ case SCHATTR_INCLUDE_HIDDEN_CELLS:
+ {
+ if( m_bSupportingPlottingOfHiddenCells )
+ rOutItemSet.Put( SfxBoolItem(nWhichId, m_bIncludeHiddenCells) );
+ break;
+ }
default:
break;
}
diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
index 4ee0ca2f1f51..eed9235aff9b 100644
--- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
@@ -108,7 +108,7 @@ uno::Reference< beans::XPropertySet > lcl_GetDefaultErrorBar()
{
// todo: use a valid context
return uno::Reference< beans::XPropertySet >(
- new ::chart::ErrorBar( uno::Reference< uno::XComponentContext >()));
+ ::chart::createErrorBar( uno::Reference< uno::XComponentContext >()));
}
void lcl_getErrorValues( const uno::Reference< beans::XPropertySet > & xErrorBarProp,
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 8368e76baa82..bda0108c8ce8 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -468,7 +468,7 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
{
//the view has become dirty, we should repaint it if we have a window
if( m_pChartWindow )
- m_pChartWindow->Invalidate();
+ m_pChartWindow->ForceInvalidate();
}
else if( rEvent.NewMode.equals(C2U("invalid")) )
{
@@ -478,8 +478,11 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
if( m_pDrawViewWrapper && m_pDrawViewWrapper->IsTextEdit() )
this->EndTextEdit();
if( m_pDrawViewWrapper )
+ {
m_pDrawViewWrapper->UnmarkAll();
//m_pDrawViewWrapper->hideMarkHandles(); todo??
+ m_pDrawViewWrapper->HideSdrPage();
+ }
}
else
{
@@ -573,6 +576,9 @@ void SAL_CALL ChartController::modeChanged( const util::ModeChangeEvent& rEvent
xMBroadcaster->addModifyListener( this );
#endif
+ //select chart area per default:
+ select( uno::makeAny( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, rtl::OUString() ) ) );
+
uno::Reference< lang::XMultiServiceFactory > xFact( m_aModel->getModel(), uno::UNO_QUERY );
if( xFact.is())
{
@@ -971,7 +977,7 @@ namespace
{
bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
{
- if( aCommand.equals("MainTitle")
+ if( aCommand.equals("MainTitle")
|| aCommand.equals("SubTitle")
|| aCommand.equals("XTitle")
|| aCommand.equals("YTitle")
@@ -979,7 +985,6 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
|| aCommand.equals("SecondaryXTitle")
|| aCommand.equals("SecondaryYTitle")
|| aCommand.equals("AllTitles")
- || aCommand.equals("Legend")
|| aCommand.equals("DiagramAxisX")
|| aCommand.equals("DiagramAxisY")
|| aCommand.equals("DiagramAxisZ")
@@ -993,9 +998,31 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
|| aCommand.equals("DiagramGridYHelp")
|| aCommand.equals("DiagramGridZHelp")
|| aCommand.equals("DiagramGridAll")
+
|| aCommand.equals("DiagramWall")
|| aCommand.equals("DiagramFloor")
|| aCommand.equals("DiagramArea")
+ || aCommand.equals("Legend")
+
+ || aCommand.equals("FormatWall")
+ || aCommand.equals("FormatFloor")
+ || aCommand.equals("FormatChartArea")
+ || aCommand.equals("FormatLegend")
+
+ || aCommand.equals("FormatTitle")
+ || aCommand.equals("FormatAxis")
+ || aCommand.equals("FormatDataSeries")
+ || aCommand.equals("FormatDataPoint")
+ || aCommand.equals("FormatDataLabels")
+ || aCommand.equals("FormatDataLabel")
+ || aCommand.equals("FormatYErrorBars")
+ || aCommand.equals("FormatMeanValue")
+ || aCommand.equals("FormatTrendline")
+ || aCommand.equals("FormatTrendlineEquation")
+ || aCommand.equals("FormatStockLoss")
+ || aCommand.equals("FormatStockGain")
+ || aCommand.equals("FormatMajorGrid")
+ || aCommand.equals("FormatMinorGrid")
)
return true;
@@ -1061,24 +1088,28 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
else if(aCommand.equals("DiagramData"))
this->executeDispatch_EditData();
//insert objects
- else if( aCommand.equals("InsertTitle"))
- this->executeDispatch_InsertTitle();
- else if( aCommand.equals("InsertLegend"))
+ else if( aCommand.equals("InsertTitles")
+ || aCommand.equals("InsertMenuTitles") )
+ this->executeDispatch_InsertTitles();
+ else if( aCommand.equals("InsertMenuLegend") )
+ this->executeDispatch_OpenLegendDialog();
+ else if( aCommand.equals("InsertLegend") )
this->executeDispatch_InsertLegend();
- else if( aCommand.equals("InsertDescription"))
- this->executeDispatch_InsertDataLabel();
- else if( aCommand.equals("InsertAxis"))
- this->executeDispatch_InsertAxis();
- else if( aCommand.equals("InsertGrids"))
+ else if( aCommand.equals("DeleteLegend") )
+ this->executeDispatch_DeleteLegend();
+ else if( aCommand.equals("InsertMenuDataLabels"))
+ this->executeDispatch_InsertMenu_DataLabels();
+ else if( aCommand.equals("InsertMenuAxes")
+ || aCommand.equals("InsertRemoveAxes") )
+ this->executeDispatch_InsertAxes();
+ else if( aCommand.equals("InsertMenuGrids"))
this->executeDispatch_InsertGrid();
-// else if( aCommand.equals("InsertStatistics"))
-// this->executeDispatch_InsertStatistic();
- else if( aCommand.equals("InsertTrendlines"))
- this->executeDispatch_InsertTrendlines();
- else if( aCommand.equals("InsertMeanValues"))
- this->executeDispatch_InsertMeanValues();
- else if( aCommand.equals("InsertYErrorbars"))
- this->executeDispatch_InsertYErrorbars();
+ else if( aCommand.equals("InsertMenuTrendlines"))
+ this->executeDispatch_InsertMenu_Trendlines();
+ else if( aCommand.equals("InsertMenuMeanValues"))
+ this->executeDispatch_InsertMenu_MeanValues();
+ else if( aCommand.equals("InsertMenuYErrorBars"))
+ this->executeDispatch_InsertMenu_YErrorBars();
else if( aCommand.equals("InsertSymbol"))
this->executeDispatch_InsertSpecialCharacter();
else if( aCommand.equals("InsertTrendline"))
@@ -1089,14 +1120,48 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand )
this->executeDispatch_InsertMeanValue();
else if( aCommand.equals("DeleteMeanValue"))
this->executeDispatch_DeleteMeanValue();
- else if( aCommand.equals("InsertYErrorbar"))
- this->executeDispatch_InsertYErrorbar();
- else if( aCommand.equals("DeleteYErrorbar"))
- this->executeDispatch_DeleteYErrorbar();
+ else if( aCommand.equals("InsertYErrorBars"))
+ this->executeDispatch_InsertYErrorBars();
+ else if( aCommand.equals("DeleteYErrorBars"))
+ this->executeDispatch_DeleteYErrorBars();
else if( aCommand.equals("InsertTrendlineEquation"))
this->executeDispatch_InsertTrendlineEquation();
+ else if( aCommand.equals("DeleteTrendlineEquation"))
+ this->executeDispatch_DeleteTrendlineEquation();
+ else if( aCommand.equals("InsertTrendlineEquationAndR2"))
+ this->executeDispatch_InsertTrendlineEquation( true );
+ else if( aCommand.equals("InsertR2Value"))
+ this->executeDispatch_InsertR2Value();
+ else if( aCommand.equals("DeleteR2Value"))
+ this->executeDispatch_DeleteR2Value();
+ else if( aCommand.equals("InsertDataLabels") )
+ this->executeDispatch_InsertDataLabels();
+ else if( aCommand.equals("InsertDataLabel") )
+ this->executeDispatch_InsertDataLabel();
+ else if( aCommand.equals("DeleteDataLabels") )
+ this->executeDispatch_DeleteDataLabels();
+ else if( aCommand.equals("DeleteDataLabel") )
+ this->executeDispatch_DeleteDataLabel();
+ else if( aCommand.equals("ResetAllDataPoints") )
+ this->executeDispatch_ResetAllDataPoints();
+ else if( aCommand.equals("ResetDataPoint") )
+ this->executeDispatch_ResetDataPoint();
+ else if( aCommand.equals("InsertAxis") )
+ this->executeDispatch_InsertAxis();
+ else if( aCommand.equals("InsertMajorGrid") )
+ this->executeDispatch_InsertMajorGrid();
+ else if( aCommand.equals("InsertMinorGrid") )
+ this->executeDispatch_InsertMinorGrid();
+ else if( aCommand.equals("InsertAxisTitle") )
+ this->executeDispatch_InsertAxisTitle();
+ else if( aCommand.equals("DeleteAxis") )
+ this->executeDispatch_DeleteAxis();
+ else if( aCommand.equals("DeleteMajorGrid") )
+ this->executeDispatch_DeleteMajorGrid();
+ else if( aCommand.equals("DeleteMinorGrid") )
+ this->executeDispatch_DeleteMinorGrid();
//format objects
- else if( aCommand.equals("DiagramObjects"))
+ else if( aCommand.equals("FormatSelection") )
this->executeDispatch_ObjectProperties();
else if( aCommand.equals("TransformDialog"))
this->executeDispatch_PositionAndSize();
@@ -1402,15 +1467,23 @@ void ChartController::impl_initializeAccessible( const uno::Reference< lang::XIn
( C2U("Cut") ) ( C2U("Copy") ) ( C2U("Paste") )
( C2U("DataRanges") ) ( C2U("DiagramData") )
// insert objects
- ( C2U("InsertTitle") ) ( C2U("InsertLegend") ) ( C2U("InsertDescription") )
- ( C2U("InsertAxis") ) ( C2U("InsertGrids") ) ( C2U("InsertStatistics") )
- ( C2U("InsertSymbol") ) ( C2U("InsertTrendline") ) ( C2U("InsertTrendlineEquation") )
- ( C2U("InsertTrendlines") ) ( C2U("InsertMeanValue") ) ( C2U("InsertMeanValues") )
- ( C2U("InsertYErrorbars") ) ( C2U("InsertYErrorbar") )
- ( C2U("DeleteTrendline") ) ( C2U("DeleteMeanValue") ) ( C2U("DeleteYErrorbar") )
+ ( C2U("InsertMenuTitles") ) ( C2U("InsertTitles") )
+ ( C2U("InsertMenuLegend") ) ( C2U("InsertLegend") ) ( C2U("DeleteLegend") )
+ ( C2U("InsertMenuDataLabels") )
+ ( C2U("InsertMenuAxes") ) ( C2U("InsertRemoveAxes") ) ( C2U("InsertMenuGrids") )
+ ( C2U("InsertSymbol") )
+ ( C2U("InsertTrendlineEquation") ) ( C2U("InsertTrendlineEquationAndR2") )
+ ( C2U("InsertR2Value") ) ( C2U("DeleteR2Value") )
+ ( C2U("InsertMenuTrendlines") ) ( C2U("InsertTrendline") )
+ ( C2U("InsertMenuMeanValues") ) ( C2U("InsertMeanValue") )
+ ( C2U("InsertMenuYErrorBars") ) ( C2U("InsertYErrorBars") )
+ ( C2U("InsertDataLabels") ) ( C2U("InsertDataLabel") )
+ ( C2U("DeleteTrendline") ) ( C2U("DeleteMeanValue") ) ( C2U("DeleteTrendlineEquation") )
+ ( C2U("DeleteYErrorBars") )
+ ( C2U("DeleteDataLabels") ) ( C2U("DeleteDataLabel") )
//format objects
//MENUCHANGE ( C2U("SelectSourceRanges") )
- ( C2U("DiagramObjects") ) ( C2U("TransformDialog") )
+ ( C2U("FormatSelection") ) ( C2U("TransformDialog") )
( C2U("DiagramType") ) ( C2U("View3D") )
( C2U("Forward") ) ( C2U("Backward") )
( C2U("MainTitle") ) ( C2U("SubTitle") )
@@ -1423,12 +1496,30 @@ void ChartController::impl_initializeAccessible( const uno::Reference< lang::XIn
( C2U("DiagramGridXHelp") ) ( C2U("DiagramGridYHelp") ) ( C2U("DiagramGridZHelp") )
( C2U("DiagramGridAll") )
( C2U("DiagramWall") ) ( C2U("DiagramFloor") ) ( C2U("DiagramArea") )
+
+ //context menu - format objects entries
+ ( C2U("FormatWall") ) ( C2U("FormatFloor") ) ( C2U("FormatChartArea") )
+ ( C2U("FormatLegend") )
+
+ ( C2U("FormatAxis") ) ( C2U("FormatTitle") )
+ ( C2U("FormatDataSeries") ) ( C2U("FormatDataPoint") )
+ ( C2U("ResetAllDataPoints") ) ( C2U("ResetDataPoint") )
+ ( C2U("FormatDataLabels") ) ( C2U("FormatDataLabel") )
+ ( C2U("FormatMeanValue") ) ( C2U("FormatTrendline") ) ( C2U("FormatTrendlineEquation") )
+ ( C2U("FormatYErrorBars") )
+ ( C2U("FormatStockLoss") ) ( C2U("FormatStockGain") )
+
+ ( C2U("FormatMajorGrid") ) ( C2U("InsertMajorGrid") ) ( C2U("DeleteMajorGrid") )
+ ( C2U("FormatMinorGrid") ) ( C2U("InsertMinorGrid") ) ( C2U("DeleteMinorGrid") )
+ ( C2U("InsertAxis") ) ( C2U("DeleteAxis") ) ( C2U("InsertAxisTitle") )
+
// toolbar commands
( C2U("ToggleGridHorizontal"))( C2U("ToggleLegend") ) ( C2U("ScaleText") )
( C2U("NewArrangement") ) ( C2U("Update") )
( C2U("DefaultColors") ) ( C2U("BarWidth") ) ( C2U("NumberOfLines") )
( C2U("ArrangeRow") )
( C2U("StatusBarVisible") )
+ ( C2U("ChartElementSelector") )
;
}
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index 0b81df0a2367..edf94fb7aae8 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -594,26 +594,50 @@ private:
void SAL_CALL executeDispatch_ObjectProperties();
void SAL_CALL executeDispatch_FormatObject( const ::rtl::OUString& rDispatchCommand );
void SAL_CALL executeDlg_ObjectProperties( const ::rtl::OUString& rObjectCID );
+ bool executeDlg_ObjectProperties_withoutUndoGuard( const ::rtl::OUString& rObjectCID, bool bOkClickOnUnchangedDialogSouldBeRatedAsSuccessAlso );
void SAL_CALL executeDispatch_ChartType();
- void SAL_CALL executeDispatch_InsertTitle();
- void SAL_CALL executeDispatch_InsertLegend();
- void SAL_CALL executeDispatch_InsertDataLabel();
- void SAL_CALL executeDispatch_InsertAxis();
- void SAL_CALL executeDispatch_InsertGrid();
-// void SAL_CALL executeDispatch_InsertStatistic();
- void SAL_CALL executeDispatch_InsertYErrorbars();
- void SAL_CALL executeDispatch_InsertTrendlines();
- void SAL_CALL executeDispatch_InsertMeanValue();
- void SAL_CALL executeDispatch_InsertMeanValues();
- void SAL_CALL executeDispatch_InsertTrendline();
- void SAL_CALL executeDispatch_InsertTrendlineEquation();
- void SAL_CALL executeDispatch_InsertYErrorbar();
-
- void SAL_CALL executeDispatch_DeleteMeanValue();
- void SAL_CALL executeDispatch_DeleteTrendline();
- void SAL_CALL executeDispatch_DeleteYErrorbar();
+ void executeDispatch_InsertTitles();
+ void executeDispatch_InsertLegend();
+ void executeDispatch_DeleteLegend();
+ void executeDispatch_OpenLegendDialog();
+ void executeDispatch_InsertAxes();
+ void executeDispatch_InsertGrid();
+
+ void executeDispatch_InsertMenu_DataLabels();
+ void executeDispatch_InsertMenu_YErrorBars();
+ void executeDispatch_InsertMenu_Trendlines();
+ void executeDispatch_InsertMenu_MeanValues();
+
+ void executeDispatch_InsertMeanValue();
+ void executeDispatch_InsertTrendline();
+ void executeDispatch_InsertTrendlineEquation( bool bInsertR2=false );
+ void executeDispatch_InsertYErrorBars();
+
+ void executeDispatch_InsertR2Value();
+ void executeDispatch_DeleteR2Value();
+
+ void executeDispatch_DeleteMeanValue();
+ void executeDispatch_DeleteTrendline();
+ void executeDispatch_DeleteTrendlineEquation();
+ void executeDispatch_DeleteYErrorBars();
+
+ void executeDispatch_InsertDataLabels();
+ void executeDispatch_InsertDataLabel();
+ void executeDispatch_DeleteDataLabels();
+ void executeDispatch_DeleteDataLabel();
+
+ void executeDispatch_ResetAllDataPoints();
+ void executeDispatch_ResetDataPoint();
+
+ void executeDispatch_InsertAxis();
+ void executeDispatch_InsertAxisTitle();
+ void executeDispatch_InsertMajorGrid();
+ void executeDispatch_InsertMinorGrid();
+ void executeDispatch_DeleteAxis();
+ void executeDispatch_DeleteMajorGrid();
+ void executeDispatch_DeleteMinorGrid();
void SAL_CALL executeDispatch_InsertSpecialCharacter();
void SAL_CALL executeDispatch_EditText();
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index d847965b6022..45213a4473dc 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -61,6 +61,9 @@
#include "StatisticsHelper.hxx"
#include "ErrorBarItemConverter.hxx"
#include "MultipleItemConverter.hxx"
+#include "DataSeriesHelper.hxx"
+#include "ObjectNameProvider.hxx"
+#include "LegendHelper.hxx"
#include <com/sun/star/chart2/XRegressionCurve.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
@@ -80,6 +83,9 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::rtl::OUString;
//.............................................................................
@@ -114,7 +120,7 @@ namespace chart
{
//.............................................................................
-void SAL_CALL ChartController::executeDispatch_InsertAxis()
+void ChartController::executeDispatch_InsertAxes()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
@@ -152,7 +158,7 @@ void SAL_CALL ChartController::executeDispatch_InsertAxis()
}
}
-void SAL_CALL ChartController::executeDispatch_InsertGrid()
+void ChartController::executeDispatch_InsertGrid()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
@@ -189,7 +195,7 @@ void SAL_CALL ChartController::executeDispatch_InsertGrid()
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void SAL_CALL ChartController::executeDispatch_InsertTitle()
+void ChartController::executeDispatch_InsertTitles()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
@@ -220,7 +226,29 @@ void SAL_CALL ChartController::executeDispatch_InsertTitle()
}
}
-void SAL_CALL ChartController::executeDispatch_InsertLegend()
+void ChartController::executeDispatch_DeleteLegend()
+{
+ UndoGuard aUndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
+ m_xUndoManager, m_aModel->getModel() );
+
+ LegendHelper::hideLegend( m_aModel->getModel() );
+ aUndoGuard.commitAction();
+}
+
+void ChartController::executeDispatch_InsertLegend()
+{
+ UndoGuard aUndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
+ m_xUndoManager, m_aModel->getModel() );
+
+ Reference< chart2::XLegend > xLegend = LegendHelper::showLegend( m_aModel->getModel(), m_xCC );
+ aUndoGuard.commitAction();
+}
+
+void ChartController::executeDispatch_OpenLegendDialog()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
@@ -251,13 +279,32 @@ void SAL_CALL ChartController::executeDispatch_InsertLegend()
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void SAL_CALL ChartController::executeDispatch_InsertDataLabel()
+void ChartController::executeDispatch_InsertMenu_DataLabels()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_DATALABELS )))),
m_xUndoManager, m_aModel->getModel() );
+ //if a series is selected insert labels for that series only:
+ uno::Reference< chart2::XDataSeries > xSeries(
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xSeries.is() )
+ {
+ // add labels
+ DataSeriesHelper::insertDataLabelsToSeriesAndAllPoints( xSeries );
+
+ rtl::OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) );
+ aChildParticle+=(C2U("="));
+ rtl::OUString aObjectCID = ObjectIdentifier::createClassifiedIdentifierForParticles(
+ ObjectIdentifier::getSeriesParticleFromCID(m_aSelection.getSelectedCID()), aChildParticle );
+
+ bool bSuccess = ChartController::executeDlg_ObjectProperties_withoutUndoGuard( aObjectCID, true );
+ if( bSuccess )
+ aUndoGuard.commitAction();
+ return;
+ }
+
try
{
wrapper::AllDataLabelItemConverter aItemConverter(
@@ -295,11 +342,21 @@ void SAL_CALL ChartController::executeDispatch_InsertDataLabel()
}
}
-void SAL_CALL ChartController::executeDispatch_InsertYErrorbars()
+void ChartController::executeDispatch_InsertMenu_YErrorBars()
{
+ //if a series is selected insert error bars for that series only:
+ uno::Reference< chart2::XDataSeries > xSeries(
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xSeries.is())
+ {
+ executeDispatch_InsertYErrorBars();
+ return;
+ }
+
+ //if no series is selected insert error bars for all series
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_PAGE_YERROR_BARS )))),
+ ActionDescriptionProvider::INSERT, ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_ERRORS ) ),
m_xUndoManager, m_aModel->getModel() );
try
@@ -335,7 +392,7 @@ void SAL_CALL ChartController::executeDispatch_InsertYErrorbars()
}
}
-void SAL_CALL ChartController::executeDispatch_InsertMeanValue()
+void ChartController::executeDispatch_InsertMeanValue()
{
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
@@ -346,23 +403,43 @@ void SAL_CALL ChartController::executeDispatch_InsertMeanValue()
aUndoGuard.commitAction();
}
-void SAL_CALL ChartController::executeDispatch_InsertMeanValues()
+void ChartController::executeDispatch_InsertMenu_MeanValues()
{
- ::std::vector< uno::Reference< chart2::XDataSeries > > aSeries(
- DiagramHelper::getDataSeriesFromDiagram( ChartModelHelper::findDiagram( m_aModel->getModel())));
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
m_xUndoManager, m_aModel->getModel() );
- ::std::for_each( aSeries.begin(), aSeries.end(), lcl_InsertMeanValueLine( m_xCC ));
+
+ uno::Reference< chart2::XDataSeries > xSeries(
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xSeries.is() )
+ {
+ //if a series is selected insert mean value only for that series:
+ lcl_InsertMeanValueLine( m_xCC ).operator()(xSeries);
+ }
+ else
+ {
+ ::std::vector< uno::Reference< chart2::XDataSeries > > aSeries(
+ DiagramHelper::getDataSeriesFromDiagram( ChartModelHelper::findDiagram( m_aModel->getModel())));
+ ::std::for_each( aSeries.begin(), aSeries.end(), lcl_InsertMeanValueLine( m_xCC ));
+ }
aUndoGuard.commitAction();
}
-void SAL_CALL ChartController::executeDispatch_InsertTrendlines()
+void ChartController::executeDispatch_InsertMenu_Trendlines()
{
+ //if a series is selected insert only for that series:
+ uno::Reference< chart2::XDataSeries > xSeries(
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xSeries.is())
+ {
+ executeDispatch_InsertTrendline();
+ return;
+ }
+
UndoGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVES )))),
+ ActionDescriptionProvider::INSERT, ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_CURVE ) ),
m_xUndoManager, m_aModel->getModel() );
try
@@ -395,7 +472,7 @@ void SAL_CALL ChartController::executeDispatch_InsertTrendlines()
}
}
-void SAL_CALL ChartController::executeDispatch_InsertTrendline()
+void ChartController::executeDispatch_InsertTrendline()
{
uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
@@ -449,7 +526,7 @@ void SAL_CALL ChartController::executeDispatch_InsertTrendline()
}
}
-void SAL_CALL ChartController::executeDispatch_InsertYErrorbar()
+void ChartController::executeDispatch_InsertYErrorBars()
{
uno::Reference< chart2::XDataSeries > xSeries(
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
@@ -457,7 +534,7 @@ void SAL_CALL ChartController::executeDispatch_InsertYErrorbar()
{
UndoLiveUpdateGuard aUndoGuard(
ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_ERROR_INDICATOR )))),
+ ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_ERROR_BARS )))),
m_xUndoManager, m_aModel->getModel() );
// add error bars with standard deviation
@@ -499,10 +576,16 @@ void SAL_CALL ChartController::executeDispatch_InsertYErrorbar()
}
}
-void SAL_CALL ChartController::executeDispatch_InsertTrendlineEquation()
+void ChartController::executeDispatch_InsertTrendlineEquation( bool bInsertR2 )
{
uno::Reference< chart2::XRegressionCurve > xRegCurve(
ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( !xRegCurve.is() )
+ {
+ uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ xRegCurve.set( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) );
+ }
if( xRegCurve.is())
{
uno::Reference< beans::XPropertySet > xEqProp( xRegCurve->getEquationProperties());
@@ -514,13 +597,43 @@ void SAL_CALL ChartController::executeDispatch_InsertTrendlineEquation()
ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
m_xUndoManager, m_aModel->getModel() );
xEqProp->setPropertyValue( C2U("ShowEquation"), uno::makeAny( true ));
- xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( false ));
+ xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( bInsertR2 ));
aUndoGuard.commitAction();
}
}
}
-void SAL_CALL ChartController::executeDispatch_DeleteMeanValue()
+void ChartController::executeDispatch_InsertR2Value()
+{
+ uno::Reference< beans::XPropertySet > xEqProp(
+ ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xEqProp.is())
+ {
+ UndoGuard aUndoGuard = UndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
+ m_xUndoManager, m_aModel->getModel() );
+ xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( true ));
+ aUndoGuard.commitAction();
+ }
+}
+
+void ChartController::executeDispatch_DeleteR2Value()
+{
+ uno::Reference< beans::XPropertySet > xEqProp(
+ ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xEqProp.is())
+ {
+ UndoGuard aUndoGuard = UndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
+ m_xUndoManager, m_aModel->getModel() );
+ xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( false ));
+ aUndoGuard.commitAction();
+ }
+}
+
+void ChartController::executeDispatch_DeleteMeanValue()
{
uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
@@ -535,7 +648,7 @@ void SAL_CALL ChartController::executeDispatch_DeleteMeanValue()
}
}
-void SAL_CALL ChartController::executeDispatch_DeleteTrendline()
+void ChartController::executeDispatch_DeleteTrendline()
{
uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
@@ -550,7 +663,22 @@ void SAL_CALL ChartController::executeDispatch_DeleteTrendline()
}
}
-void SAL_CALL ChartController::executeDispatch_DeleteYErrorbar()
+void ChartController::executeDispatch_DeleteTrendlineEquation()
+{
+ uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xRegCurveCnt.is())
+ {
+ UndoGuard aUndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
+ m_xUndoManager, m_aModel->getModel());
+ RegressionCurveHelper::removeEquations( xRegCurveCnt );
+ aUndoGuard.commitAction();
+ }
+}
+
+void ChartController::executeDispatch_DeleteYErrorBars()
{
uno::Reference< chart2::XDataSeries > xDataSeries(
ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()));
@@ -565,6 +693,256 @@ void SAL_CALL ChartController::executeDispatch_DeleteYErrorbar()
}
}
+void ChartController::executeDispatch_InsertDataLabels()
+{
+ uno::Reference< chart2::XDataSeries > xSeries(
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xSeries.is() )
+ {
+ UndoGuard aUndoGuard = UndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::INSERT,
+ ::rtl::OUString( String( SchResId( STR_OBJECT_DATALABELS )))),
+ m_xUndoManager, m_aModel->getModel() );
+ DataSeriesHelper::insertDataLabelsToSeriesAndAllPoints( xSeries );
+ aUndoGuard.commitAction();
+ }
+}
+
+void ChartController::executeDispatch_InsertDataLabel()
+{
+ UndoGuard aUndoGuard = UndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::INSERT,
+ ::rtl::OUString( String( SchResId( STR_OBJECT_LABEL )))),
+ m_xUndoManager, m_aModel->getModel() );
+ DataSeriesHelper::insertDataLabelToPoint( ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), m_aModel->getModel() ) );
+ aUndoGuard.commitAction();
+}
+
+void ChartController::executeDispatch_DeleteDataLabels()
+{
+ uno::Reference< chart2::XDataSeries > xSeries(
+ ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xSeries.is() )
+ {
+ UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::DELETE,
+ ::rtl::OUString( String( SchResId( STR_OBJECT_DATALABELS )))),
+ m_xUndoManager, m_aModel->getModel());
+ DataSeriesHelper::deleteDataLabelsFromSeriesAndAllPoints( xSeries );
+ aUndoGuard.commitAction();
+ }
+}
+
+void ChartController::executeDispatch_DeleteDataLabel()
+{
+ UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::DELETE,
+ ::rtl::OUString( String( SchResId( STR_OBJECT_LABEL )))),
+ m_xUndoManager, m_aModel->getModel());
+ DataSeriesHelper::deleteDataLabelsFromPoint( ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), m_aModel->getModel() ) );
+ aUndoGuard.commitAction();
+}
+
+void ChartController::executeDispatch_ResetAllDataPoints()
+{
+ UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::FORMAT,
+ ::rtl::OUString( String( SchResId( STR_OBJECT_DATAPOINTS )))),
+ m_xUndoManager, m_aModel->getModel());
+ uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xSeries.is() )
+ xSeries->resetAllDataPoints();
+ aUndoGuard.commitAction();
+}
+void ChartController::executeDispatch_ResetDataPoint()
+{
+ UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::FORMAT,
+ ::rtl::OUString( String( SchResId( STR_OBJECT_DATAPOINT )))),
+ m_xUndoManager, m_aModel->getModel());
+ uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
+ if( xSeries.is() )
+ {
+ sal_Int32 nPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( m_aSelection.getSelectedCID() );
+ xSeries->resetDataPoint( nPointIndex );
+ }
+ aUndoGuard.commitAction();
+}
+
+void ChartController::executeDispatch_InsertAxisTitle()
+{
+ try
+ {
+ uno::Reference< XTitle > xTitle;
+ {
+ UndoGuard aUndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_TITLE )))),
+ m_xUndoManager, m_aModel->getModel() );
+
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ sal_Int32 nDimensionIndex = -1;
+ sal_Int32 nCooSysIndex = -1;
+ sal_Int32 nAxisIndex = -1;
+ AxisHelper::getIndicesForAxis( xAxis, ChartModelHelper::findDiagram(m_aModel->getModel()), nCooSysIndex, nDimensionIndex, nAxisIndex );
+
+ TitleHelper::eTitleType eTitleType = TitleHelper::X_AXIS_TITLE;
+ if( nDimensionIndex==0 )
+ eTitleType = nAxisIndex==0 ? TitleHelper::X_AXIS_TITLE : TitleHelper::SECONDARY_X_AXIS_TITLE;
+ else if( nDimensionIndex==1 )
+ eTitleType = nAxisIndex==0 ? TitleHelper::Y_AXIS_TITLE : TitleHelper::SECONDARY_Y_AXIS_TITLE;
+ else
+ eTitleType = TitleHelper::Z_AXIS_TITLE;
+
+ ::std::auto_ptr< ReferenceSizeProvider > apRefSizeProvider( impl_createReferenceSizeProvider());
+ xTitle = TitleHelper::createTitle( eTitleType, ObjectNameProvider::getTitleNameByType(eTitleType), m_aModel->getModel(), m_xCC, apRefSizeProvider.get() );
+ aUndoGuard.commitAction();
+ }
+
+ /*
+ if( xTitle.is() )
+ {
+ OUString aTitleCID = ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, m_aModel->getModel() );
+ select( uno::makeAny(aTitleCID) );
+ executeDispatch_EditText();
+ }
+ */
+ }
+ catch( uno::RuntimeException& e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+}
+
+void ChartController::executeDispatch_InsertAxis()
+{
+ UndoGuard aUndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AXIS )))),
+ m_xUndoManager, m_aModel->getModel() );
+
+ try
+ {
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ if( xAxis.is() )
+ {
+ AxisHelper::makeAxisVisible( xAxis );
+ aUndoGuard.commitAction();
+ }
+ }
+ catch( uno::RuntimeException& e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+}
+
+void ChartController::executeDispatch_DeleteAxis()
+{
+ UndoGuard aUndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_AXIS )))),
+ m_xUndoManager, m_aModel->getModel() );
+
+ try
+ {
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ if( xAxis.is() )
+ {
+ AxisHelper::makeAxisInvisible( xAxis );
+ aUndoGuard.commitAction();
+ }
+ }
+ catch( uno::RuntimeException& e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+}
+
+void ChartController::executeDispatch_InsertMajorGrid()
+{
+ UndoGuard aUndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
+ m_xUndoManager, m_aModel->getModel() );
+
+ try
+ {
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ if( xAxis.is() )
+ {
+ AxisHelper::makeGridVisible( xAxis->getGridProperties() );
+ aUndoGuard.commitAction();
+ }
+ }
+ catch( uno::RuntimeException& e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+}
+
+void ChartController::executeDispatch_DeleteMajorGrid()
+{
+ UndoGuard aUndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
+ m_xUndoManager, m_aModel->getModel() );
+
+ try
+ {
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ if( xAxis.is() )
+ {
+ AxisHelper::makeGridInvisible( xAxis->getGridProperties() );
+ aUndoGuard.commitAction();
+ }
+ }
+ catch( uno::RuntimeException& e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+}
+
+void ChartController::executeDispatch_InsertMinorGrid()
+{
+ UndoGuard aUndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
+ m_xUndoManager, m_aModel->getModel() );
+
+ try
+ {
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ if( xAxis.is() )
+ {
+ Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
+ for( sal_Int32 nN=0; nN<aSubGrids.getLength(); nN++)
+ AxisHelper::makeGridVisible( aSubGrids[nN] );
+ aUndoGuard.commitAction();
+ }
+ }
+ catch( uno::RuntimeException& e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+}
+
+void ChartController::executeDispatch_DeleteMinorGrid()
+{
+ UndoGuard aUndoGuard(
+ ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_GRID )))),
+ m_xUndoManager, m_aModel->getModel() );
+
+ try
+ {
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ if( xAxis.is() )
+ {
+ Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
+ for( sal_Int32 nN=0; nN<aSubGrids.getLength(); nN++)
+ AxisHelper::makeGridInvisible( aSubGrids[nN] );
+ aUndoGuard.commitAction();
+ }
+ }
+ catch( uno::RuntimeException& e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+}
//.............................................................................
} //namespace chart
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index 3b5b3d6fa7ba..754e66ec7d17 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -62,6 +62,7 @@
#include "ResId.hxx"
#include "Strings.hrc"
#include "ReferenceSizeProvider.hxx"
+#include "RegressionCurveHelper.hxx"
#include <com/sun/star/chart2/XChartDocument.hpp>
//for auto_ptr
@@ -80,6 +81,8 @@ namespace chart
//.............................................................................
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using ::com::sun::star::uno::Reference;
+using ::rtl::OUString;
namespace
{
@@ -240,9 +243,8 @@ namespace
}
}
}
- sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForLabel( xObjectProperties, xSeries, nPointIndex,
- uno::Reference< beans::XPropertySet >( DiagramHelper::getAttachedAxis( xSeries, xDiagram ), uno::UNO_QUERY ) );
- sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForLabel(
+ sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties, xSeries, nPointIndex, xDiagram );
+ sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
xObjectProperties,uno::Reference< util::XNumberFormatsSupplier >(xChartModel, uno::UNO_QUERY));
pItemConverter = new wrapper::DataPointItemConverter( xChartModel, xContext,
@@ -438,34 +440,37 @@ rtl::OUString lcl_getGridCIDForCommand( const ::rtl::OString& rDispatchCommand,
rtl::OUString aCID( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, nSubGridIndex ) );
return aCID;
}
-rtl::OUString lcl_getObjectCIDForCommand( const ::rtl::OString& rDispatchCommand, const uno::Reference< XChartDocument > & xChartDocument )
+rtl::OUString lcl_getObjectCIDForCommand( const ::rtl::OString& rDispatchCommand, const uno::Reference< XChartDocument > & xChartDocument, const rtl::OUString& rSelectedCID )
{
ObjectType eObjectType = OBJECTTYPE_UNKNOWN;
rtl::OUString aParticleID;
uno::Reference< frame::XModel > xChartModel( xChartDocument, uno::UNO_QUERY );
+ const ObjectType eSelectedType = ObjectIdentifier::getObjectType( rSelectedCID );
+ uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rSelectedCID, xChartModel );
+ uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt( xSeries, uno::UNO_QUERY );
//-------------------------------------------------------------------------
//legend
- if( rDispatchCommand.equals("Legend"))
+ if( rDispatchCommand.equals("Legend") || rDispatchCommand.equals("FormatLegend") )
{
eObjectType = OBJECTTYPE_LEGEND;
//@todo set particular aParticleID if we have more than one legend
}
//-------------------------------------------------------------------------
//wall floor area
- else if( rDispatchCommand.equals("DiagramWall"))
+ else if( rDispatchCommand.equals("DiagramWall") || rDispatchCommand.equals("FormatWall") )
{
//OBJECTTYPE_DIAGRAM;
eObjectType = OBJECTTYPE_DIAGRAM_WALL;
//@todo set particular aParticleID if we have more than one diagram
}
- else if( rDispatchCommand.equals("DiagramFloor"))
+ else if( rDispatchCommand.equals("DiagramFloor") || rDispatchCommand.equals("FormatFloor") )
{
eObjectType = OBJECTTYPE_DIAGRAM_FLOOR;
//@todo set particular aParticleID if we have more than one diagram
}
- else if( rDispatchCommand.equals("DiagramArea"))
+ else if( rDispatchCommand.equals("DiagramArea") || rDispatchCommand.equals("FormatChartArea") )
{
eObjectType = OBJECTTYPE_PAGE;
}
@@ -508,6 +513,163 @@ rtl::OUString lcl_getObjectCIDForCommand( const ::rtl::OString& rDispatchCommand
{
return lcl_getGridCIDForCommand( rDispatchCommand, xChartModel );
}
+ //-------------------------------------------------------------------------
+ //data series
+ else if( rDispatchCommand.equals("FormatDataSeries") )
+ {
+ if( eSelectedType == OBJECTTYPE_DATA_SERIES )
+ return rSelectedCID;
+ else
+ return ObjectIdentifier::createClassifiedIdentifier(
+ OBJECTTYPE_DATA_SERIES, ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ) );
+ }
+ //-------------------------------------------------------------------------
+ //data point
+ else if( rDispatchCommand.equals("FormatDataPoint") )
+ {
+ return rSelectedCID;
+ }
+ //-------------------------------------------------------------------------
+ //data labels
+ else if( rDispatchCommand.equals("FormatDataLabels") )
+ {
+ if( eSelectedType == OBJECTTYPE_DATA_LABELS )
+ return rSelectedCID;
+ else
+ return ObjectIdentifier::createClassifiedIdentifierWithParent(
+ OBJECTTYPE_DATA_LABELS, ::rtl::OUString(), rSelectedCID );
+ }
+ //-------------------------------------------------------------------------
+ //data labels
+ else if( rDispatchCommand.equals("FormatDataLabel") )
+ {
+ if( eSelectedType == OBJECTTYPE_DATA_LABEL )
+ return rSelectedCID;
+ else
+ {
+ sal_Int32 nPointIndex = ObjectIdentifier::getParticleID( rSelectedCID ).toInt32();
+ if( nPointIndex>=0 )
+ {
+ OUString aSeriesParticle = ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID );
+ OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) );
+ aChildParticle+=(C2U("="));
+ OUString aLabelsCID = ObjectIdentifier::createClassifiedIdentifierForParticles( aSeriesParticle, aChildParticle );
+ OUString aLabelCID_Stub = ObjectIdentifier::createClassifiedIdentifierWithParent(
+ OBJECTTYPE_DATA_LABEL, ::rtl::OUString(), aLabelsCID );
+
+ return ObjectIdentifier::createPointCID( aLabelCID_Stub, nPointIndex );
+ }
+ }
+ }
+ //-------------------------------------------------------------------------
+ //mean value line
+ else if( rDispatchCommand.equals("FormatMeanValue") )
+ {
+ if( eSelectedType == OBJECTTYPE_DATA_AVERAGE_LINE )
+ return rSelectedCID;
+ else
+ return ObjectIdentifier::createDataCurveCID(
+ ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ),
+ RegressionCurveHelper::getRegressionCurveIndex( xRegCurveCnt,
+ RegressionCurveHelper::getMeanValueLine( xRegCurveCnt ) ), true );
+ }
+ //-------------------------------------------------------------------------
+ //trend line
+ else if( rDispatchCommand.equals("FormatTrendline") )
+ {
+ if( eSelectedType == OBJECTTYPE_DATA_CURVE )
+ return rSelectedCID;
+ else
+ return ObjectIdentifier::createDataCurveCID(
+ ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ),
+ RegressionCurveHelper::getRegressionCurveIndex( xRegCurveCnt,
+ RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) ), false );
+ }
+ //-------------------------------------------------------------------------
+ //trend line equation
+ else if( rDispatchCommand.equals("FormatTrendlineEquation") )
+ {
+ if( eSelectedType == OBJECTTYPE_DATA_CURVE_EQUATION )
+ return rSelectedCID;
+ else
+ return ObjectIdentifier::createDataCurveEquationCID(
+ ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ),
+ RegressionCurveHelper::getRegressionCurveIndex( xRegCurveCnt,
+ RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) ) );
+ }
+ //-------------------------------------------------------------------------
+ // y error bars
+ else if( rDispatchCommand.equals("FormatYErrorBars") )
+ {
+ if( eSelectedType == OBJECTTYPE_DATA_ERRORS )
+ return rSelectedCID;
+ else
+ return ObjectIdentifier::createClassifiedIdentifierWithParent(
+ OBJECTTYPE_DATA_ERRORS, ::rtl::OUString(), rSelectedCID );
+ }
+ //-------------------------------------------------------------------------
+ // axis
+ else if( rDispatchCommand.equals("FormatAxis") )
+ {
+ if( eSelectedType == OBJECTTYPE_AXIS )
+ return rSelectedCID;
+ else
+ {
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartModel );
+ return ObjectIdentifier::createClassifiedIdentifierForObject( xAxis , xChartModel );
+ }
+ }
+ //-------------------------------------------------------------------------
+ // major grid
+ else if( rDispatchCommand.equals("FormatMajorGrid") )
+ {
+ if( eSelectedType == OBJECTTYPE_GRID )
+ return rSelectedCID;
+ else
+ {
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartModel );
+ return ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel );
+ }
+
+ }
+ //-------------------------------------------------------------------------
+ // minor grid
+ else if( rDispatchCommand.equals("FormatMinorGrid") )
+ {
+ if( eSelectedType == OBJECTTYPE_SUBGRID )
+ return rSelectedCID;
+ else
+ {
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartModel );
+ return ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, 0 /*sub grid index*/ );
+ }
+ }
+ //-------------------------------------------------------------------------
+ // title
+ else if( rDispatchCommand.equals("FormatTitle") )
+ {
+ if( eSelectedType == OBJECTTYPE_TITLE )
+ return rSelectedCID;
+ }
+ //-------------------------------------------------------------------------
+ // stock loss
+ else if( rDispatchCommand.equals("FormatStockLoss") )
+ {
+ if( eSelectedType == OBJECTTYPE_DATA_STOCK_LOSS )
+ return rSelectedCID;
+ else
+ return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DATA_STOCK_LOSS, rtl::OUString());
+ }
+ //-------------------------------------------------------------------------
+ // stock gain
+ else if( rDispatchCommand.equals("FormatStockGain") )
+ {
+ if( eSelectedType == OBJECTTYPE_DATA_STOCK_GAIN )
+ return rSelectedCID;
+ else
+ return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DATA_STOCK_GAIN, rtl::OUString() );
+ }
+
return ObjectIdentifier::createClassifiedIdentifier(
eObjectType, aParticleID );
}
@@ -519,7 +681,7 @@ void SAL_CALL ChartController::executeDispatch_FormatObject(const ::rtl::OUStrin
{
uno::Reference< XChartDocument > xChartDocument( m_aModel->getModel(), uno::UNO_QUERY );
rtl::OString aCommand( rtl::OUStringToOString( rDispatchCommand, RTL_TEXTENCODING_ASCII_US ) );
- rtl::OUString rObjectCID = lcl_getObjectCIDForCommand( aCommand, xChartDocument );
+ rtl::OUString rObjectCID = lcl_getObjectCIDForCommand( aCommand, xChartDocument, m_aSelection.getSelectedCID() );
executeDlg_ObjectProperties( rObjectCID );
}
@@ -528,56 +690,74 @@ void SAL_CALL ChartController::executeDispatch_ObjectProperties()
executeDlg_ObjectProperties( m_aSelection.getSelectedCID() );
}
-void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUString& rObjectCID )
+namespace
+{
+
+rtl::OUString lcl_getFormatCIDforSelectedCID( const ::rtl::OUString& rSelectedCID )
+{
+ ::rtl::OUString aFormatCID(rSelectedCID);
+
+ //get type of selected object
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( aFormatCID );
+
+ // some legend entries are handled as if they were data series
+ if( OBJECTTYPE_LEGEND_ENTRY==eObjectType )
+ {
+ rtl::OUString aParentParticle( ObjectIdentifier::getFullParentParticle( rSelectedCID ) );
+ aFormatCID = ObjectIdentifier::createClassifiedIdentifierForParticle( aParentParticle );
+ }
+
+ // treat diagram as wall
+ if( OBJECTTYPE_DIAGRAM==eObjectType )
+ aFormatCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString() );
+
+ return aFormatCID;
+}
+
+}//end anonymous namespace
+
+void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUString& rSelectedObjectCID )
+{
+ rtl::OUString aObjectCID = lcl_getFormatCIDforSelectedCID( rSelectedObjectCID );
+
+ UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
+ ActionDescriptionProvider::FORMAT,
+ ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aObjectCID ))),
+ m_xUndoManager, m_aModel->getModel() );
+
+ bool bSuccess = ChartController::executeDlg_ObjectProperties_withoutUndoGuard( aObjectCID, false );
+ if( bSuccess )
+ aUndoGuard.commitAction();
+}
+
+bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( const ::rtl::OUString& rObjectCID, bool bOkClickOnUnchangedDialogSouldBeRatedAsSuccessAlso )
{
+ //return true if the properties were changed successfully
+ bool bRet = false;
if( !rObjectCID.getLength() )
{
//DBG_ERROR("empty ObjectID");
- return;
+ return bRet;
}
try
{
- ::rtl::OUString aObjectCID(rObjectCID);
NumberFormatterWrapper aNumberFormatterWrapper( uno::Reference< util::XNumberFormatsSupplier >(m_aModel->getModel(), uno::UNO_QUERY) );
//-------------------------------------------------------------
- //get type of selected object
- ObjectType eObjectType = ObjectIdentifier::getObjectType( aObjectCID );
+ //get type of object
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( rObjectCID );
if( OBJECTTYPE_UNKNOWN==eObjectType )
{
//DBG_ERROR("unknown ObjectType");
- return;
- }
-
- // some legend entries are handled as if they were data series
- if( OBJECTTYPE_LEGEND_ENTRY==eObjectType )
- {
- rtl::OUString aParentParticle( ObjectIdentifier::getFullParentParticle( aObjectCID ) );
- eObjectType = ObjectIdentifier::getObjectType( aParentParticle );
- aObjectCID = ObjectIdentifier::createClassifiedIdentifierForParticle( aParentParticle );
+ return bRet;
}
-
- // treat diagram as wall
- if( OBJECTTYPE_DIAGRAM==eObjectType )
- {
- aObjectCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString() );
- eObjectType = OBJECTTYPE_DIAGRAM_WALL;
- }
-
if( OBJECTTYPE_DIAGRAM_WALL==eObjectType || OBJECTTYPE_DIAGRAM_FLOOR==eObjectType )
{
if( !DiagramHelper::isSupportingFloorAndWall( ChartModelHelper::findDiagram( m_aModel->getModel() ) ) )
- return;
+ return bRet;
}
//-------------------------------------------------------------
- UndoGuard aUndoGuard(
- ActionDescriptionProvider::createDescription(
- ActionDescriptionProvider::FORMAT,
- ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aObjectCID ))),
- m_xUndoManager, m_aModel->getModel() );
-
- //-------------------------------------------------------------
//convert properties to ItemSet
awt::Size aPageSize( ChartModelHelper::getPageSize(m_aModel->getModel()) );
@@ -585,20 +765,20 @@ void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUStrin
::std::auto_ptr< ReferenceSizeProvider > pRefSizeProv(
impl_createReferenceSizeProvider());
::std::auto_ptr< ::comphelper::ItemConverter > apItemConverter(
- createItemConverter( aObjectCID, m_aModel->getModel(), m_xCC,
+ createItemConverter( rObjectCID, m_aModel->getModel(), m_xCC,
m_pDrawModelWrapper->getSdrModel(),
&aNumberFormatterWrapper,
ExplicitValueProvider::getExplicitValueProvider(m_xChartView),
pRefSizeProv ));
if(!apItemConverter.get())
- return;
+ return bRet;
SfxItemSet aItemSet = apItemConverter->CreateEmptyItemSet();
apItemConverter->FillItemSet( aItemSet );
//-------------------------------------------------------------
//prepare dialog
- ObjectPropertiesDialogParameter aDialogParameter = ObjectPropertiesDialogParameter( aObjectCID );
+ ObjectPropertiesDialogParameter aDialogParameter = ObjectPropertiesDialogParameter( rObjectCID );
aDialogParameter.init( m_aModel->getModel() );
ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get() );
@@ -610,9 +790,9 @@ void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUStrin
{
SfxItemSet* pSymbolShapeProperties=NULL;
uno::Reference< beans::XPropertySet > xObjectProperties =
- ObjectIdentifier::getObjectPropertySet( aObjectCID, m_aModel->getModel() );
+ ObjectIdentifier::getObjectPropertySet( rObjectCID, m_aModel->getModel() );
wrapper::DataPointItemConverter aSymbolItemConverter( m_aModel->getModel(), m_xCC
- , xObjectProperties, ObjectIdentifier::getDataSeriesForCID( aObjectCID, m_aModel->getModel() )
+ , xObjectProperties, ObjectIdentifier::getDataSeriesForCID( rObjectCID, m_aModel->getModel() )
, m_pDrawModelWrapper->getSdrModel().GetItemPool()
, m_pDrawModelWrapper->getSdrModel()
, &aNumberFormatterWrapper
@@ -630,24 +810,19 @@ void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUStrin
if( aDialogParameter.HasStatisticProperties() )
{
aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
- InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( m_aModel->getModel(), m_xChartView, aObjectCID ) );
+ InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( m_aModel->getModel(), m_xChartView, rObjectCID ) );
}
//-------------------------------------------------------------
//open the dialog
- if( aDlg.Execute() == RET_OK )
+ if( aDlg.Execute() == RET_OK || (bOkClickOnUnchangedDialogSouldBeRatedAsSuccessAlso && aDlg.DialogWasClosedWithOK()) )
{
const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
if(pOutItemSet)
{
- bool bChanged = false;
- {
- ControllerLockGuard aCLGuard( m_aModel->getModel());
- bChanged = apItemConverter->ApplyItemSet( *pOutItemSet );//model should be changed now
- }
-
- if( bChanged )
- aUndoGuard.commitAction();
+ ControllerLockGuard aCLGuard( m_aModel->getModel());
+ apItemConverter->ApplyItemSet( *pOutItemSet );//model should be changed now
+ bRet = true;
}
}
}
@@ -657,6 +832,7 @@ void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUStrin
catch( uno::RuntimeException& )
{
}
+ return bRet;
}
void SAL_CALL ChartController::executeDispatch_View3D()
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index fdbda4589abd..8dca62d93ee1 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -656,7 +656,7 @@ 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_INDICATOR )))),
+ ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_ERROR_BARS )))),
m_xUndoManager, xModel );
{
ControllerLockGuard aCtlLockGuard( xModel );
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 2288bb602296..951bb127f117 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -51,9 +51,17 @@
#include "chartview/ExplicitValueProvider.hxx"
#include "RelativePositionHelper.hxx"
#include "chartview/DrawModelWrapper.hxx"
+#include "RegressionCurveHelper.hxx"
+#include "StatisticsHelper.hxx"
+#include "DataSeriesHelper.hxx"
+#include "ContainerHelper.hxx"
+#include "AxisHelper.hxx"
+#include "LegendHelper.hxx"
+#include "servicenames_charttypes.hxx"
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
+#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/frame/XDispatchHelper.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
@@ -85,6 +93,13 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using ::com::sun::star::uno::Reference;
+using ::rtl::OUString;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
namespace
{
@@ -138,13 +153,86 @@ void lcl_insertMenuCommand(
xMenuEx->setCommand( nId, rCommand );
}
-} // anonymous namespace
+OUString lcl_getFormatCommandForObjectCID( const OUString& rCID )
+{
+ OUString aDispatchCommand( C2U(".uno:FormatSelection") );
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( rCID );
-//.............................................................................
-namespace chart
-{
-//.............................................................................
+ switch(eObjectType)
+ {
+ case OBJECTTYPE_DIAGRAM:
+ case OBJECTTYPE_DIAGRAM_WALL:
+ aDispatchCommand = C2U(".uno:FormatWall");
+ break;
+ case OBJECTTYPE_DIAGRAM_FLOOR:
+ aDispatchCommand = C2U(".uno:FormatFloor");
+ break;
+ case OBJECTTYPE_PAGE:
+ aDispatchCommand = C2U(".uno:FormatChartArea");
+ break;
+ case OBJECTTYPE_LEGEND:
+ aDispatchCommand = C2U(".uno:FormatLegend");
+ break;
+ case OBJECTTYPE_TITLE:
+ aDispatchCommand = C2U(".uno:FormatTitle");
+ break;
+ case OBJECTTYPE_LEGEND_ENTRY:
+ aDispatchCommand = C2U(".uno:FormatDataSeries");
+ break;
+ case OBJECTTYPE_AXIS:
+ case OBJECTTYPE_AXIS_UNITLABEL:
+ aDispatchCommand = C2U(".uno:FormatAxis");
+ break;
+ case OBJECTTYPE_GRID:
+ aDispatchCommand = C2U(".uno:FormatMajorGrid");
+ break;
+ case OBJECTTYPE_SUBGRID:
+ aDispatchCommand = C2U(".uno:FormatMinorGrid");
+ break;
+ case OBJECTTYPE_DATA_LABELS:
+ aDispatchCommand = C2U(".uno:FormatDataLabels");
+ break;
+ case OBJECTTYPE_DATA_SERIES:
+ aDispatchCommand = C2U(".uno:FormatDataSeries");
+ break;
+ case OBJECTTYPE_DATA_LABEL:
+ aDispatchCommand = C2U(".uno:FormatDataLabel");
+ break;
+ case OBJECTTYPE_DATA_POINT:
+ aDispatchCommand = C2U(".uno:FormatDataPoint");
+ break;
+ case OBJECTTYPE_DATA_AVERAGE_LINE:
+ aDispatchCommand = C2U(".uno:FormatMeanValue");
+ break;
+ case OBJECTTYPE_DATA_ERRORS:
+ case OBJECTTYPE_DATA_ERRORS_X:
+ case OBJECTTYPE_DATA_ERRORS_Y:
+ case OBJECTTYPE_DATA_ERRORS_Z:
+ aDispatchCommand = C2U(".uno:FormatYErrorBars");
+ break;
+ case OBJECTTYPE_DATA_CURVE:
+ aDispatchCommand = C2U(".uno:FormatTrendline");
+ break;
+ case OBJECTTYPE_DATA_CURVE_EQUATION:
+ aDispatchCommand = C2U(".uno:FormatTrendlineEquation");
+ break;
+ case OBJECTTYPE_DATA_STOCK_RANGE:
+ aDispatchCommand = C2U(".uno:FormatSelection");
+ break;
+ case OBJECTTYPE_DATA_STOCK_LOSS:
+ aDispatchCommand = C2U(".uno:FormatStockLoss");
+ break;
+ case OBJECTTYPE_DATA_STOCK_GAIN:
+ aDispatchCommand = C2U(".uno:FormatStockGain");
+ break;
+ default: //OBJECTTYPE_UNKNOWN
+ break;
+ }
+ return aDispatchCommand;
+}
+
+} // anonymous namespace
const short HITPIX=2; //hit-tolerance in pixel
@@ -830,36 +918,254 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
if( xPopupMenu.is() && xMenuEx.is())
{
sal_Int16 nUniqueId = 1;
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DiagramObjects"));
+ ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() );
+ Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram( m_aModel->getModel() );
+
+ OUString aFormatCommand( lcl_getFormatCommandForObjectCID( m_aSelection.getSelectedCID() ) );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, aFormatCommand );
+
+ //some commands for dataseries and points:
+ //-----
+ if( OBJECTTYPE_DATA_SERIES == eObjectType || OBJECTTYPE_DATA_POINT == eObjectType )
+ {
+ bool bIsPoint = ( OBJECTTYPE_DATA_POINT == eObjectType );
+ uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ uno::Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY );
+ Reference< chart2::XRegressionCurve > xTrendline( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xCurveCnt ) );
+ bool bHasEquation = RegressionCurveHelper::hasEquation( xTrendline );
+ Reference< chart2::XRegressionCurve > xMeanValue( RegressionCurveHelper::getMeanValueLine( xCurveCnt ) );
+ bool bHasYErrorBars = StatisticsHelper::hasErrorBars( xSeries, true );
+ bool bHasDataLabelsAtSeries = DataSeriesHelper::hasDataLabelsAtSeries( xSeries );
+ bool bHasDataLabelsAtPoints = DataSeriesHelper::hasDataLabelsAtPoints( xSeries );
+ bool bHasDataLabelAtPoint = false;
+ sal_Int32 nPointIndex = -1;
+ if( bIsPoint )
+ {
+ nPointIndex = ObjectIdentifier::getIndexFromParticleOrCID( m_aSelection.getSelectedCID() );
+ bHasDataLabelAtPoint = DataSeriesHelper::hasDataLabelAtPoint( xSeries, nPointIndex );
+ }
+ bool bSelectedPointIsFormatted = false;
+ bool bHasFormattedDataPointsOtherThanSelected = false;
+
+ Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
+ if( xSeriesProperties.is() )
+ {
+ uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
+ if( xSeriesProperties->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= aAttributedDataPointIndexList )
+ {
+ if( aAttributedDataPointIndexList.hasElements() )
+ {
+ if( bIsPoint )
+ {
+ ::std::vector< sal_Int32 > aIndices( ContainerHelper::SequenceToVector( aAttributedDataPointIndexList ) );
+ ::std::vector< sal_Int32 >::iterator aIt = ::std::find( aIndices.begin(), aIndices.end(), nPointIndex );
+ if( aIt != aIndices.end())
+ bSelectedPointIsFormatted = true;
+ else
+ bHasFormattedDataPointsOtherThanSelected = true;
+ }
+ else
+ bHasFormattedDataPointsOtherThanSelected = true;
+ }
+ }
+ }
+
+ //const sal_Int32 nIdBeforeFormat = nUniqueId;
+ if( bIsPoint )
+ {
+ if( bHasDataLabelAtPoint )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatDataLabel") );
+ if( !bHasDataLabelAtPoint )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertDataLabel") );
+ else
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteDataLabel") );
+ if( bSelectedPointIsFormatted )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:ResetDataPoint"));
+
+ xPopupMenu->insertSeparator( -1 );
+
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatDataSeries") );
+ }
+
+ Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) );
+ if( xChartType->getChartType().equals(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
+ {
+ try
+ {
+ Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY );
+ if( xChartTypeProp.is() )
+ {
+ bool bJapaneseStyle = false;
+ xChartTypeProp->getPropertyValue( C2U( "Japanese" ) ) >>= bJapaneseStyle;
+
+ if( bJapaneseStyle )
+ {
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockLoss") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockGain") );
+ }
+ }
+ }
+ catch( const uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+ }
+
+ if( bHasDataLabelsAtSeries )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatDataLabels") );
+ if( xTrendline.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatTrendline") );
+ if( bHasEquation )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatTrendlineEquation") );
+ if( xMeanValue.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatMeanValue") );
+ if( bHasYErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatYErrorBars") );
+
+ //if( nIdBeforeFormat != nUniqueId )
+ xPopupMenu->insertSeparator( -1 );
+
+ //const sal_Int32 nIdBeforeInsert = nUniqueId;
+
+ if( !bHasDataLabelsAtSeries )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertDataLabels") );
+ if( !xTrendline.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendline") );
+ else if( !bHasEquation )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendlineEquation") );
+ if( !xMeanValue.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertMeanValue") );
+ if( !bHasYErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertYErrorBars") );
+
+ //if( nIdBeforeInsert != nUniqueId )
+ // xPopupMenu->insertSeparator( -1 );
+
+ //const sal_Int32 nIdBeforeDelete = nUniqueId;
+
+ if( bHasDataLabelsAtSeries || ( bHasDataLabelsAtPoints && bHasFormattedDataPointsOtherThanSelected ) )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteDataLabels") );
+ if( xTrendline.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteTrendline") );
+ if( bHasEquation )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteTrendlineEquation") );
+ if( xMeanValue.is() )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteMeanValue") );
+ if( bHasYErrorBars )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteYErrorBars") );
+
+ if( bHasFormattedDataPointsOtherThanSelected )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:ResetAllDataPoints"));
+
+ //if( nIdBeforeDelete != nUniqueId )
+ xPopupMenu->insertSeparator( -1 );
+
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId, C2U(".uno:ArrangeRow"));
+ uno::Reference< awt::XPopupMenu > xArrangePopupMenu(
+ m_xCC->getServiceManager()->createInstanceWithContext(
+ C2U("com.sun.star.awt.PopupMenu"), m_xCC ), uno::UNO_QUERY );
+ uno::Reference< awt::XMenuExtended > xArrangeMenuEx( xArrangePopupMenu, uno::UNO_QUERY );
+ if( xArrangePopupMenu.is() && xArrangeMenuEx.is())
+ {
+ sal_Int16 nSubId = nUniqueId + 1;
+ lcl_insertMenuCommand( xArrangePopupMenu, xArrangeMenuEx, nSubId++, C2U(".uno:Forward") );
+ lcl_insertMenuCommand( xArrangePopupMenu, xArrangeMenuEx, nSubId, C2U(".uno:Backward") );
+ xPopupMenu->setPopupMenu( nUniqueId, xArrangePopupMenu );
+ nUniqueId = nSubId;
+ }
+ ++nUniqueId;
+ }
+ else if( OBJECTTYPE_DATA_CURVE == eObjectType )
+ {
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatTrendlineEquation") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendlineEquation") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendlineEquationAndR2") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertR2Value") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteTrendlineEquation") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteR2Value") );
+ }
+ else if( OBJECTTYPE_DATA_CURVE_EQUATION == eObjectType )
+ {
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertR2Value") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteR2Value") );
+ }
+
+ //some commands for axes: and grids
+ //-----
+ else if( OBJECTTYPE_AXIS == eObjectType || OBJECTTYPE_GRID == eObjectType || OBJECTTYPE_SUBGRID == eObjectType )
+ {
+ Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), m_aModel->getModel() );
+ if( xAxis.is() && xDiagram.is() )
+ {
+ sal_Int32 nDimensionIndex = -1;
+ sal_Int32 nCooSysIndex = -1;
+ sal_Int32 nAxisIndex = -1;
+ AxisHelper::getIndicesForAxis( xAxis, xDiagram, nCooSysIndex, nDimensionIndex, nAxisIndex );
+ bool bIsSecondaryAxis = nAxisIndex!=0;
+ bool bIsAxisVisible = AxisHelper::isAxisVisible( xAxis );
+ bool bIsMajorGridVisible = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, true /*bMainGrid*/, xDiagram );
+ bool bIsMinorGridVisible = AxisHelper::isGridShown( nDimensionIndex, nCooSysIndex, false /*bMainGrid*/, xDiagram );
+ bool bHasTitle = false;
+ uno::Reference< XTitled > xTitled( xAxis, uno::UNO_QUERY );
+ if( xTitled.is())
+ bHasTitle = TitleHelper::getCompleteString( xTitled->getTitleObject() ).getLength()>0;
+
+ if( OBJECTTYPE_AXIS != eObjectType && bIsAxisVisible )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatAxis") );
+ if( OBJECTTYPE_GRID != eObjectType && bIsMajorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatMajorGrid") );
+ if( OBJECTTYPE_SUBGRID != eObjectType && bIsMinorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatMinorGrid") );
+
+ xPopupMenu->insertSeparator( -1 );
+
+ if( OBJECTTYPE_AXIS != eObjectType && !bIsAxisVisible )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertAxis") );
+ if( OBJECTTYPE_GRID != eObjectType && !bIsMajorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertMajorGrid") );
+ if( OBJECTTYPE_SUBGRID != eObjectType && !bIsMinorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertMinorGrid") );
+ if( !bHasTitle )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertAxisTitle") );
+
+ if( bIsAxisVisible )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteAxis") );
+ if( bIsMajorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteMajorGrid") );
+ if( bIsMinorGridVisible && !bIsSecondaryAxis )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteMinorGrid") );
+ }
+ }
+
+ if( OBJECTTYPE_DATA_STOCK_LOSS == eObjectType )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockGain") );
+ else if( OBJECTTYPE_DATA_STOCK_GAIN == eObjectType )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:FormatStockLoss") );
+
lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:TransformDialog"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId, C2U(".uno:ArrangeRow"));
- uno::Reference< awt::XPopupMenu > xArrangePopupMenu(
- m_xCC->getServiceManager()->createInstanceWithContext(
- C2U("com.sun.star.awt.PopupMenu"), m_xCC ), uno::UNO_QUERY );
- uno::Reference< awt::XMenuExtended > xArrangeMenuEx( xArrangePopupMenu, uno::UNO_QUERY );
- if( xArrangePopupMenu.is() && xArrangeMenuEx.is())
+
+ if( OBJECTTYPE_PAGE == eObjectType || OBJECTTYPE_DIAGRAM == eObjectType
+ || OBJECTTYPE_DIAGRAM_WALL == eObjectType
+ || OBJECTTYPE_DIAGRAM_FLOOR == eObjectType
+ || OBJECTTYPE_UNKNOWN == eObjectType )
{
- sal_Int16 nSubId = nUniqueId + 1;
- lcl_insertMenuCommand( xArrangePopupMenu, xArrangeMenuEx, nSubId++, C2U(".uno:Forward"));
- lcl_insertMenuCommand( xArrangePopupMenu, xArrangeMenuEx, nSubId, C2U(".uno:Backward"));
- xPopupMenu->setPopupMenu( nUniqueId, xArrangePopupMenu );
- nUniqueId = nSubId;
+ if( OBJECTTYPE_UNKNOWN != eObjectType )
+ xPopupMenu->insertSeparator( -1 );
+ bool bHasLegend = LegendHelper::hasLegend( xDiagram );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTitles") );
+ if( !bHasLegend )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertLegend") );
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertRemoveAxes") );
+ if( bHasLegend )
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteLegend") );
}
- ++nUniqueId;
+ //-----
+
xPopupMenu->insertSeparator( -1 );
lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DiagramType"));
lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DataRanges"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:View3D"));
- xPopupMenu->insertSeparator( -1 );
lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DiagramData"));
- xPopupMenu->insertSeparator( -1 );
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertYErrorbar"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteYErrorbar"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertMeanValue"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteMeanValue"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendline"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:DeleteTrendline"));
- lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:InsertTrendlineEquation"));
+ lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:View3D"));
xPopupMenu->insertSeparator( -1 );
lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:Cut"));
lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, C2U(".uno:Copy"));
diff --git a/chart2/source/controller/main/ChartRenderer.cxx b/chart2/source/controller/main/ChartRenderer.cxx
index 00e69082db00..60d13981c00f 100644
--- a/chart2/source/controller/main/ChartRenderer.cxx
+++ b/chart2/source/controller/main/ChartRenderer.cxx
@@ -59,11 +59,6 @@ ChartRenderer::ChartRenderer( const Reference< frame::XModel >& xChartModel )
{
}
-ChartRenderer::ChartRenderer( const Reference< uno::XComponentContext >& /*xContext*/)
- : m_xChartModel()
-{
-}
-
ChartRenderer::~ChartRenderer()
{
}
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 5c9e201aebd8..10b999df8f43 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -60,6 +60,7 @@ namespace chart
ChartWindow::ChartWindow( WindowController* pWindowController, Window* pParent, WinBits nStyle )
: Window(pParent, nStyle)
, m_pWindowController( pWindowController )
+ , m_bInPaint(false)
{
this->SetSmartHelpId( SmartId( HID_SCH_WIN_DOCUMENT ) );
this->SetMapMode( MapMode(MAP_100TH_MM) );
@@ -67,7 +68,7 @@ ChartWindow::ChartWindow( WindowController* pWindowController, Window* pParent,
// chart does not depend on exact pixel painting => enable antialiased drawing
SetAntialiasing( ANTIALIASING_ENABLE_B2DDRAW | GetAntialiasing() );
EnableRTL( FALSE );
- if( pParent )
+ if( pParent )
pParent->EnableRTL( FALSE );// #i96215# necessary for a correct position of the context menu in rtl mode
}
@@ -92,10 +93,12 @@ void ChartWindow::PrePaint()
void ChartWindow::Paint( const Rectangle& rRect )
{
+ m_bInPaint = true;
if( m_pWindowController )
m_pWindowController->execute_Paint( rRect );
else
Window::Paint( rRect );
+ m_bInPaint = false;
}
void ChartWindow::MouseButtonDown(const MouseEvent& rMEvt)
@@ -243,6 +246,29 @@ void ChartWindow::adjustHighContrastMode()
SetDrawMode( bUseContrast ? nContrastMode : DRAWMODE_DEFAULT );
}
+void ChartWindow::ForceInvalidate()
+{
+ ::Window::Invalidate();
+}
+void ChartWindow::Invalidate( USHORT 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 )
+{
+ 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 )
+{
+ if( m_bInPaint ) // #i101928# superfluous paint calls while entering and editing charts"
+ return;
+ ::Window::Invalidate( rRegion, nFlags );
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/controller/main/ChartWindow.hxx b/chart2/source/controller/main/ChartWindow.hxx
index 41cc7b514a07..543c0b13ffdc 100644
--- a/chart2/source/controller/main/ChartWindow.hxx
+++ b/chart2/source/controller/main/ChartWindow.hxx
@@ -70,10 +70,16 @@ public:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
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 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
private:
WindowController* m_pWindowController;
+ bool m_bInPaint;
void adjustHighContrastMode();
};
diff --git a/chart2/source/controller/main/ConfigurationAccess.cxx b/chart2/source/controller/main/ConfigurationAccess.cxx
index f3de96cfc844..f71d26b7b3c2 100644
--- a/chart2/source/controller/main/ConfigurationAccess.cxx
+++ b/chart2/source/controller/main/ConfigurationAccess.cxx
@@ -38,6 +38,8 @@
#include <svtools/syslocale.hxx>
// header for class ConfigItem
#include <unotools/configitem.hxx>
+// header for rtl::Static
+#include <rtl/instance.hxx>
//.............................................................................
@@ -96,37 +98,20 @@ FieldUnit CalcConfigItem::getFieldUnit()
return eResult;
}
-// ----------------------------------------
-
-ConfigurationAccess * ConfigurationAccess::m_pThis = 0;
-
-// private, use static getConfigurationAccess method
-ConfigurationAccess::ConfigurationAccess()
- : m_pCalcConfigItem(0)
-{
- m_pCalcConfigItem = new CalcConfigItem();
-}
-
-// static
-ConfigurationAccess * ConfigurationAccess::getConfigurationAccess()
-{
- // note: not threadsafe
- if( !m_pThis )
- m_pThis = new ConfigurationAccess();
- return m_pThis;
-}
-
-ConfigurationAccess::~ConfigurationAccess()
+namespace
{
- delete m_pCalcConfigItem;
+ //a CalcConfigItem Singleton
+ struct theCalcConfigItem : public rtl::Static< CalcConfigItem, theCalcConfigItem > {};
}
-FieldUnit ConfigurationAccess::getFieldUnit()
+namespace ConfigurationAccess
{
- OSL_ASSERT( m_pCalcConfigItem );
- FieldUnit aUnit( m_pCalcConfigItem->getFieldUnit() );
- return aUnit;
-}
+ FieldUnit getFieldUnit()
+ {
+ FieldUnit aUnit( theCalcConfigItem::get().getFieldUnit() );
+ return aUnit;
+ }
+} //namespace ConfigurationAccess
//.............................................................................
} //namespace chart
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index d572ec2b2f42..d7e0514dee08 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -52,6 +52,7 @@
#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart2/XRegressionCurve.hpp>
+#include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
// only needed until #i68864# is fixed
#include <com/sun/star/frame/XLayoutManager.hpp>
@@ -119,7 +120,7 @@ struct ControllerState
// -- State variables -------
bool bHasSelectedObject;
- bool bIsDraggableObject;
+ bool bIsPositionableObject;
bool bIsTextObject;
bool bIsDeleteableObjectSelected;
bool bIsFormateableObjectSelected;
@@ -132,18 +133,26 @@ struct ControllerState
// trendlines
bool bMayAddTrendline;
bool bMayAddTrendlineEquation;
+ bool bMayAddR2Value;
bool bMayAddMeanValue;
bool bMayAddYErrorBars;
bool bMayDeleteTrendline;
+ bool bMayDeleteTrendlineEquation;
+ bool bMayDeleteR2Value;
bool bMayDeleteMeanValue;
bool bMayDeleteYErrorBars;
+
+ bool bMayFormatTrendline;
+ bool bMayFormatTrendlineEquation;
+ bool bMayFormatMeanValue;
+ bool bMayFormatYErrorBars;
};
ControllerState::ControllerState() :
bHasSelectedObject( false ),
- bIsDraggableObject( false ),
+ bIsPositionableObject( false ),
bIsTextObject(false),
bIsDeleteableObjectSelected(false),
bIsFormateableObjectSelected(false),
@@ -151,11 +160,18 @@ ControllerState::ControllerState() :
bMayMoveSeriesBackward( false ),
bMayAddTrendline( false ),
bMayAddTrendlineEquation( false ),
+ bMayAddR2Value( false ),
bMayAddMeanValue( false ),
bMayAddYErrorBars( false ),
bMayDeleteTrendline( false ),
+ bMayDeleteTrendlineEquation( false ),
+ bMayDeleteR2Value( false ),
bMayDeleteMeanValue( false ),
- bMayDeleteYErrorBars( false )
+ bMayDeleteYErrorBars( false ),
+ bMayFormatTrendline( false ),
+ bMayFormatTrendlineEquation( false ),
+ bMayFormatMeanValue( false ),
+ bMayFormatYErrorBars( false )
{}
void ControllerState::update(
@@ -174,9 +190,9 @@ void ControllerState::update(
bHasSelectedObject = ((aSelObj >>= aSelObjCID) && aSelObjCID.getLength() > 0);
- bIsDraggableObject = ObjectIdentifier::isDragableObject( aSelObjCID );
-
ObjectType aObjectType(ObjectIdentifier::getObjectType( aSelObjCID ));
+
+ bIsPositionableObject = (OBJECTTYPE_DATA_POINT != aObjectType) && ObjectIdentifier::isDragableObject( aSelObjCID );
bIsTextObject = OBJECTTYPE_TITLE == aObjectType;
uno::Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( xModel ));
@@ -190,23 +206,30 @@ void ControllerState::update(
bIsDeleteableObjectSelected = ChartController::isObjectDeleteable( aSelObj );
- bMayMoveSeriesForward = DiagramHelper::isSeriesMoveable(
+ bMayMoveSeriesForward = (OBJECTTYPE_DATA_POINT!=aObjectType) && DiagramHelper::isSeriesMoveable(
ChartModelHelper::findDiagram( xModel ),
xGivenDataSeries,
MOVE_SERIES_FORWARD );
- bMayMoveSeriesBackward = DiagramHelper::isSeriesMoveable(
+ bMayMoveSeriesBackward = (OBJECTTYPE_DATA_POINT!=aObjectType) && DiagramHelper::isSeriesMoveable(
ChartModelHelper::findDiagram( xModel ),
xGivenDataSeries,
MOVE_SERIES_BACKWARD );
bMayAddTrendline = false;
bMayAddTrendlineEquation = false;
+ bMayAddR2Value = false;
bMayAddMeanValue = false;
bMayAddYErrorBars = false;
bMayDeleteTrendline = false;
+ bMayDeleteTrendlineEquation = false;
+ bMayDeleteR2Value = false;
bMayDeleteMeanValue = false;
bMayDeleteYErrorBars = false;
+ bMayFormatTrendline = false;
+ bMayFormatTrendlineEquation = false;
+ bMayFormatMeanValue = false;
+ bMayFormatYErrorBars = false;
if( bHasSelectedObject )
{
if( xGivenDataSeries.is())
@@ -216,46 +239,63 @@ void ControllerState::update(
DataSeriesHelper::getChartTypeOfSeries( xGivenDataSeries, xDiagram ));
// trend lines/mean value line
- if( ChartTypeHelper::isSupportingRegressionProperties(
- xFirstChartType, nDimensionCount ))
+ if( (OBJECTTYPE_DATA_SERIES == aObjectType || OBJECTTYPE_DATA_POINT == aObjectType)
+ && ChartTypeHelper::isSupportingRegressionProperties( xFirstChartType, nDimensionCount ))
{
uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
xGivenDataSeries, uno::UNO_QUERY );
if( xRegCurveCnt.is())
{
- bMayDeleteTrendline = RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ).is();
- bMayDeleteMeanValue = RegressionCurveHelper::hasMeanValueLine( xRegCurveCnt );
+ uno::Reference< chart2::XRegressionCurve > xRegCurve( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) );
+ bMayFormatTrendline = bMayDeleteTrendline = xRegCurve.is();
+ bMayFormatMeanValue = bMayDeleteMeanValue = RegressionCurveHelper::hasMeanValueLine( xRegCurveCnt );
bMayAddTrendline = ! bMayDeleteTrendline;
bMayAddMeanValue = ! bMayDeleteMeanValue;
+ bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve );
+ bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation;
}
}
// error bars
- if( ChartTypeHelper::isSupportingStatisticProperties(
- xFirstChartType, nDimensionCount ))
+ if( (OBJECTTYPE_DATA_SERIES == aObjectType || OBJECTTYPE_DATA_POINT == aObjectType)
+ && ChartTypeHelper::isSupportingStatisticProperties( xFirstChartType, nDimensionCount ))
{
- bMayDeleteYErrorBars = StatisticsHelper::hasErrorBars( xGivenDataSeries );
+ bMayFormatYErrorBars = bMayDeleteYErrorBars = StatisticsHelper::hasErrorBars( xGivenDataSeries );
bMayAddYErrorBars = ! bMayDeleteYErrorBars;
}
}
+ if( aObjectType == OBJECTTYPE_DATA_AVERAGE_LINE )
+ bMayFormatMeanValue = true;
+
+ if( aObjectType == OBJECTTYPE_DATA_ERRORS_Y || aObjectType == OBJECTTYPE_DATA_ERRORS )
+ bMayFormatYErrorBars = true;
+
if( aObjectType == OBJECTTYPE_DATA_CURVE )
{
+ bMayFormatTrendline = true;
uno::Reference< chart2::XRegressionCurve > xRegCurve(
ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY );
- if( xRegCurve.is())
+ bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve );
+ bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation;
+ }
+ else if( aObjectType == OBJECTTYPE_DATA_CURVE_EQUATION )
+ {
+ bMayFormatTrendlineEquation = true;
+ bool bHasR2Value = false;
+ try
{
- uno::Reference< beans::XPropertySet > xEqProp( xRegCurve->getEquationProperties());
- bool bShowEq = false;
- bool bShowCorr = false;
+ uno::Reference< beans::XPropertySet > xEqProp(
+ ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY );
if( xEqProp.is())
- {
- xEqProp->getPropertyValue( C2U("ShowEquation")) >>= bShowEq;
- xEqProp->getPropertyValue( C2U("ShowCorrelationCoefficient")) >>= bShowCorr;
-
- bMayAddTrendlineEquation = ! (bShowEq || bShowCorr);
- }
+ xEqProp->getPropertyValue( C2U("ShowCorrelationCoefficient") ) >>= bHasR2Value;
}
+ catch( uno::RuntimeException& e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ bMayAddR2Value = !bHasR2Value;
+ bMayDeleteR2Value = bHasR2Value;
}
}
}
@@ -503,32 +543,52 @@ void ControllerCommandDispatch::updateCommandAvailability()
m_aCommandAvailability[ C2U(".uno:DefaultColors")] = bIsWritable;
m_aCommandAvailability[ C2U(".uno:BarWidth")] = bIsWritable;
m_aCommandAvailability[ C2U(".uno:NumberOfLines")] = bIsWritable;
- m_aCommandAvailability[ C2U(".uno:ArrangeRow")] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:ArrangeRow")] = m_apControllerState->bMayMoveSeriesForward || m_apControllerState->bMayMoveSeriesBackward;
// insert objects
- m_aCommandAvailability[ C2U(".uno:InsertTitle")] = bIsWritable;
- m_aCommandAvailability[ C2U(".uno:InsertLegend")] = bIsWritable;
- m_aCommandAvailability[ C2U(".uno:InsertDescription")] = bIsWritable;
- m_aCommandAvailability[ C2U(".uno:InsertAxis")] = bIsWritable && m_apModelState->bSupportsAxes;
- m_aCommandAvailability[ C2U(".uno:InsertGrids")] = bIsWritable && m_apModelState->bSupportsAxes;
-// m_aCommandAvailability[ C2U(".uno:InsertStatistics")] = bIsWritable && m_apModelState->bSupportsStatistics;
- m_aCommandAvailability[ C2U(".uno:InsertTrendlines")] = bIsWritable && m_apModelState->bSupportsStatistics;
- m_aCommandAvailability[ C2U(".uno:InsertMeanValues")] = bIsWritable && m_apModelState->bSupportsStatistics;
- m_aCommandAvailability[ C2U(".uno:InsertYErrorbars")] = bIsWritable && m_apModelState->bSupportsStatistics;
+ m_aCommandAvailability[ C2U(".uno:InsertTitles")] = m_aCommandAvailability[ C2U(".uno:InsertMenuTitles")] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:InsertLegend")] = m_aCommandAvailability[ C2U(".uno:InsertMenuLegend")] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:DeleteLegend")] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:InsertMenuDataLabels")] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:InsertRemoveAxes")] = m_aCommandAvailability[ C2U(".uno:InsertMenuAxes")] = bIsWritable && m_apModelState->bSupportsAxes;
+ m_aCommandAvailability[ C2U(".uno:InsertMenuGrids")] = bIsWritable && m_apModelState->bSupportsAxes;
+ m_aCommandAvailability[ C2U(".uno:InsertMenuTrendlines")] = bIsWritable && m_apModelState->bSupportsStatistics;
+ m_aCommandAvailability[ C2U(".uno:InsertMenuMeanValues")] = bIsWritable && m_apModelState->bSupportsStatistics;
+ m_aCommandAvailability[ C2U(".uno:InsertMenuYErrorBars")] = bIsWritable && m_apModelState->bSupportsStatistics;
m_aCommandAvailability[ C2U(".uno:InsertSymbol")] = bIsWritable && m_apControllerState->bIsTextObject;
// format objects
- m_aCommandAvailability[ C2U(".uno:DiagramObjects")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsFormateableObjectSelected;
+ bool bFormatObjectAvailable = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsFormateableObjectSelected;
+ m_aCommandAvailability[ C2U(".uno:FormatSelection")] = bFormatObjectAvailable;
+ m_aCommandAvailability[ C2U(".uno:FormatAxis")] = bFormatObjectAvailable;
+ m_aCommandAvailability[ C2U(".uno:FormatTitle")] = bFormatObjectAvailable;
+ m_aCommandAvailability[ C2U(".uno:FormatDataSeries")] = bFormatObjectAvailable;
+ m_aCommandAvailability[ C2U(".uno:FormatDataPoint")] = bFormatObjectAvailable;
+ m_aCommandAvailability[ C2U(".uno:FormatDataLabels")] = bFormatObjectAvailable;
+ m_aCommandAvailability[ C2U(".uno:FormatDataLabel")] = bFormatObjectAvailable;
+ m_aCommandAvailability[ C2U(".uno:FormatYErrorBars")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatYErrorBars;
+ m_aCommandAvailability[ C2U(".uno:FormatMeanValue")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatMeanValue;
+ m_aCommandAvailability[ C2U(".uno:FormatTrendline")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayFormatTrendline;
+ m_aCommandAvailability[ C2U(".uno:FormatTrendlineEquation")] = bFormatObjectAvailable && bControllerStateIsValid && m_apControllerState->bMayFormatTrendlineEquation;
+ m_aCommandAvailability[ C2U(".uno:FormatStockLoss")] = bFormatObjectAvailable;
+ m_aCommandAvailability[ C2U(".uno:FormatStockGain")] = bFormatObjectAvailable;
+
m_aCommandAvailability[ C2U(".uno:DiagramType")] = bIsWritable;
m_aCommandAvailability[ C2U(".uno:Legend")] = bIsWritable && m_apModelState->bHasLegend;
m_aCommandAvailability[ C2U(".uno:DiagramWall")] = bIsWritable && bModelStateIsValid && m_apModelState->bHasWall;
m_aCommandAvailability[ C2U(".uno:DiagramArea")] = bIsWritable;
- m_aCommandAvailability[ C2U(".uno:TransformDialog")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bHasSelectedObject && m_apControllerState->bIsDraggableObject;
+ m_aCommandAvailability[ C2U(".uno:TransformDialog")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bHasSelectedObject && m_apControllerState->bIsPositionableObject;
// 3d commands
m_aCommandAvailability[ C2U(".uno:View3D")] = bIsWritable && bModelStateIsValid && m_apModelState->bIsThreeD;
m_aCommandAvailability[ C2U(".uno:DiagramFloor")] = bIsWritable && bModelStateIsValid && m_apModelState->bHasFloor;
+ //some mor format commands with different ui text
+ m_aCommandAvailability[ C2U(".uno:FormatWall")] = m_aCommandAvailability[ C2U(".uno:DiagramWall")];
+ m_aCommandAvailability[ C2U(".uno:FormatFloor")] = m_aCommandAvailability[ C2U(".uno:DiagramFloor")];
+ m_aCommandAvailability[ C2U(".uno:FormatChartArea")] = m_aCommandAvailability[ C2U(".uno:DiagramArea")];
+ m_aCommandAvailability[ C2U(".uno:FormatLegend")] = m_aCommandAvailability[ C2U(".uno:Legend")];
+
// depending on own data
m_aCommandAvailability[ C2U(".uno:DataRanges")] = bIsWritable && bModelStateIsValid && (! m_apModelState->bHasOwnData);
m_aCommandAvailability[ C2U(".uno:DiagramData")] = bIsWritable && bModelStateIsValid && m_apModelState->bHasOwnData;
@@ -569,14 +629,36 @@ void ControllerCommandDispatch::updateCommandAvailability()
m_aCommandAvailability[ C2U(".uno:Forward")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesForward;
m_aCommandAvailability[ C2U(".uno:Backward")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesBackward;
+ m_aCommandAvailability[ C2U(".uno:InsertDataLabels")] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:InsertDataLabel")] = bIsWritable;
m_aCommandAvailability[ C2U(".uno:InsertMeanValue")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddMeanValue;
m_aCommandAvailability[ C2U(".uno:InsertTrendline")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddTrendline;
m_aCommandAvailability[ C2U(".uno:InsertTrendlineEquation")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddTrendlineEquation;
- m_aCommandAvailability[ C2U(".uno:InsertYErrorbar")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddYErrorBars;
-
- m_aCommandAvailability[ C2U(".uno:DeleteTrendline")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteTrendline;
- m_aCommandAvailability[ C2U(".uno:DeleteMeanValue")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteMeanValue;
- m_aCommandAvailability[ C2U(".uno:DeleteYErrorbar")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteYErrorBars;
+ m_aCommandAvailability[ C2U(".uno:InsertTrendlineEquationAndR2")] = m_aCommandAvailability[ C2U(".uno:InsertTrendlineEquation")];
+ m_aCommandAvailability[ C2U(".uno:InsertR2Value")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddR2Value;
+ m_aCommandAvailability[ C2U(".uno:DeleteR2Value")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteR2Value;
+
+ m_aCommandAvailability[ C2U(".uno:InsertYErrorBars")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayAddYErrorBars;
+
+ m_aCommandAvailability[ C2U(".uno:DeleteDataLabels")] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:DeleteDataLabel") ] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:DeleteTrendline") ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteTrendline;
+ m_aCommandAvailability[ C2U(".uno:DeleteTrendlineEquation") ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteTrendlineEquation;
+ m_aCommandAvailability[ C2U(".uno:DeleteMeanValue") ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteMeanValue;
+ m_aCommandAvailability[ C2U(".uno:DeleteYErrorBars") ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bMayDeleteYErrorBars;
+
+ m_aCommandAvailability[ C2U(".uno:ResetDataPoint") ] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:ResetAllDataPoints") ] = bIsWritable;
+
+ m_aCommandAvailability[ C2U(".uno:InsertAxis") ] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:DeleteAxis") ] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:InsertAxisTitle") ] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:FormatMajorGrid") ] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:InsertMajorGrid") ] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:DeleteMajorGrid") ] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:FormatMinorGrid") ] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:InsertMinorGrid") ] = bIsWritable;
+ m_aCommandAvailability[ C2U(".uno:DeleteMinorGrid") ] = bIsWritable;
}
bool ControllerCommandDispatch::commandAvailable( const OUString & rCommand )
@@ -592,11 +674,19 @@ void ControllerCommandDispatch::fireStatusEvent(
const OUString & rURL,
const Reference< frame::XStatusListener > & xSingleListener /* = 0 */ )
{
+ bool bIsChartSelectorURL = rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:ChartElementSelector") );
+ if( rURL.getLength() == 0 || bIsChartSelectorURL )
+ {
+ uno::Any aArg;
+ aArg <<= m_xController;
+ fireStatusEventForURL( C2U(".uno:ChartElementSelector"), aArg, true, xSingleListener );
+ }
+
if( rURL.getLength() == 0 )
for( ::std::map< OUString, bool >::const_iterator aIt( m_aCommandAvailability.begin());
aIt != m_aCommandAvailability.end(); ++aIt )
fireStatusEventForURLImpl( aIt->first, xSingleListener );
- else
+ else if( !bIsChartSelectorURL )
fireStatusEventForURLImpl( rURL, xSingleListener );
// statusbar. Should be handled by base implementation
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
new file mode 100644
index 000000000000..a79a256e3e4f
--- /dev/null
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -0,0 +1,328 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ElementSelector.cxx,v $
+ * $Revision: 1.1 $
+ *
+ * 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 "ElementSelector.hxx"
+#include "macros.hxx"
+#include "ObjectNameProvider.hxx"
+#include "ObjectHierarchy.hxx"
+#include "servicenames.hxx"
+#include <chartview/ExplicitValueProvider.hxx>
+
+#include <toolkit/helper/vclunohelper.hxx>
+#include <vos/mutex.hxx>
+#include <vcl/svapp.hxx>
+
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/frame/XControlNotificationListener.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+
+namespace chart
+{
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+
+namespace
+{
+static const ::rtl::OUString lcl_aServiceName(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.ElementSelectorToolbarController" ));
+}
+
+//------------------------------------------------------------------------------
+
+SelectorListBox::SelectorListBox( Window* pParent, WinBits nStyle )
+ : ListBox( pParent, nStyle )
+ , m_bReleaseFocus( true )
+{
+}
+
+SelectorListBox::~SelectorListBox()
+{
+}
+
+void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectHierarchy::tCID & rParent, std::vector< ListBoxEntryData >& rEntries
+ , const sal_Int32 nHierarchyDepth, const Reference< chart2::XChartDocument >& xChartDoc )
+{
+ ObjectHierarchy::tChildContainer aChildren( rHierarchy.getChildren(rParent) );
+ ObjectHierarchy::tChildContainer::const_iterator aIt( aChildren.begin());
+ while( aIt != aChildren.end() )
+ {
+ ::rtl::OUString aCID = *aIt;
+ ListBoxEntryData aEntry;
+ aEntry.CID = aCID;
+ aEntry.UIName += ObjectNameProvider::getNameForCID( aCID, xChartDoc );
+ aEntry.nHierarchyDepth = nHierarchyDepth;
+ rEntries.push_back(aEntry);
+ lcl_addObjectsToList( rHierarchy, aCID, rEntries, nHierarchyDepth+1, xChartDoc );
+ ++aIt;
+ }
+}
+
+void SelectorListBox::SetChartController( const Reference< frame::XController >& xChartController )
+{
+ m_xChartController = xChartController;
+}
+
+void SelectorListBox::UpdateChartElementsListAndSelection()
+{
+ Clear();
+ m_aEntries.clear();
+
+ Reference< frame::XController > xChartController( m_xChartController );
+ if( xChartController.is() )
+ {
+ Reference< view::XSelectionSupplier > xSelectionSupplier( xChartController, uno::UNO_QUERY);
+ rtl::OUString aSelectedCID;
+ if( xSelectionSupplier.is() )
+ xSelectionSupplier->getSelection() >>= aSelectedCID;
+
+ Reference< chart2::XChartDocument > xChartDoc( xChartController->getModel(), uno::UNO_QUERY );
+ ObjectType eType( ObjectIdentifier::getObjectType( aSelectedCID ));
+ bool bAddSelectionToList = false;
+ if( eType == OBJECTTYPE_DATA_POINT || eType == OBJECTTYPE_DATA_LABEL )
+ bAddSelectionToList = true;
+
+ Reference< uno::XInterface > xChartView;
+ Reference< lang::XMultiServiceFactory > xFact( xChartController->getModel(), uno::UNO_QUERY );
+ if( xFact.is() )
+ xChartView = xFact->createInstance( CHART_VIEW_SERVICE_NAME );
+ ExplicitValueProvider* pExplicitValueProvider = 0;//ExplicitValueProvider::getExplicitValueProvider(xChartView); dies erzeugt alle sichtbaren datenpinkte, das ist zu viel
+ ObjectHierarchy aHierarchy( xChartDoc, pExplicitValueProvider, true /*bFlattenDiagram*/, true /*bOrderingForElementSelector*/ );
+ lcl_addObjectsToList( aHierarchy, aHierarchy.getRootNodeCID(), m_aEntries, 0, xChartDoc );
+
+ std::vector< ListBoxEntryData >::iterator aIt( m_aEntries.begin() );
+ if( bAddSelectionToList )
+ {
+ rtl::OUString aSeriesCID = ObjectIdentifier::createClassifiedIdentifierForParticle( ObjectIdentifier::getSeriesParticleFromCID( aSelectedCID ) );
+ for( aIt = m_aEntries.begin(); aIt != m_aEntries.end(); ++aIt )
+ {
+ if( aIt->CID.match( aSeriesCID ) )
+ {
+ ListBoxEntryData aEntry;
+ aEntry.UIName = ObjectNameProvider::getNameForCID( aSelectedCID, xChartDoc );
+ aEntry.CID = aSelectedCID;
+ ++aIt;
+ if( aIt != m_aEntries.end() )
+ m_aEntries.insert(aIt, aEntry);
+ else
+ m_aEntries.push_back( aEntry );
+ break;
+ }
+ }
+ }
+
+ USHORT nEntryPosToSelect = 0; bool bSelectionFound = false;
+ aIt = m_aEntries.begin();
+ for( USHORT nN=0; aIt != m_aEntries.end(); ++aIt, ++nN )
+ {
+ InsertEntry( aIt->UIName );
+ if( !bSelectionFound && aSelectedCID.equals( aIt->CID ) )
+ {
+ nEntryPosToSelect = nN;
+ bSelectionFound = true;
+ }
+ }
+
+ if( bSelectionFound )
+ SelectEntryPos(nEntryPosToSelect);
+
+ USHORT nEntryCount = GetEntryCount();
+ if( nEntryCount > 100 )
+ nEntryCount = 100;
+ SetDropDownLineCount( nEntryCount );
+ }
+ SaveValue();//remind current selection pos
+}
+
+void SelectorListBox::ReleaseFocus_Impl()
+{
+ if ( !m_bReleaseFocus )
+ {
+ m_bReleaseFocus = true;
+ return;
+ }
+
+ Reference< frame::XController > xController( m_xChartController );
+ Reference< frame::XFrame > xFrame( xController->getFrame() );
+ if ( xFrame.is() && xFrame->getContainerWindow().is() )
+ xFrame->getContainerWindow()->setFocus();
+}
+
+void SelectorListBox::Select()
+{
+ ListBox::Select();
+
+ if ( !IsTravelSelect() )
+ {
+ USHORT nPos = GetSelectEntryPos();
+ if( nPos < m_aEntries.size() )
+ {
+ rtl::OUString aCID = m_aEntries[nPos].CID;
+ uno::Any aASelection( uno::makeAny(aCID) );
+ Reference< view::XSelectionSupplier > xSelectionSupplier( m_xChartController.get(), uno::UNO_QUERY );
+ if( xSelectionSupplier.is() )
+ xSelectionSupplier->select(aASelection);
+ }
+ ReleaseFocus_Impl();
+ }
+}
+
+long SelectorListBox::Notify( NotifyEvent& rNEvt )
+{
+ long nHandled = 0;
+
+ if ( rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ USHORT nCode = rNEvt.GetKeyEvent()->GetKeyCode().GetCode();
+
+ switch ( nCode )
+ {
+ case KEY_RETURN:
+ case KEY_TAB:
+ {
+ if ( KEY_TAB == nCode )
+ m_bReleaseFocus = false;
+ else
+ nHandled = 1;
+ Select();
+ break;
+ }
+
+ case KEY_ESCAPE:
+ SelectEntryPos( GetSavedValue() ); //restore saved selection
+ ReleaseFocus_Impl();
+ break;
+ }
+ }
+ else if ( EVENT_LOSEFOCUS == rNEvt.GetType() )
+ {
+ if ( !HasFocus() )
+ SelectEntryPos( GetSavedValue() );
+ }
+
+ return nHandled ? nHandled : ListBox::Notify( rNEvt );
+}
+
+Reference< ::com::sun::star::accessibility::XAccessible > SelectorListBox::CreateAccessible()
+{
+ UpdateChartElementsListAndSelection();
+ return ListBox::CreateAccessible();
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+APPHELPER_XSERVICEINFO_IMPL( ElementSelectorToolbarController, lcl_aServiceName );
+
+//------------------------------------------------------------------------------
+Sequence< ::rtl::OUString > ElementSelectorToolbarController::getSupportedServiceNames_Static()
+{
+ Sequence< ::rtl::OUString > aServices(1);
+ aServices[ 0 ] = C2U( "com.sun.star.frame.ToolbarController" );
+ return aServices;
+}
+// -----------------------------------------------------------------------------
+ElementSelectorToolbarController::ElementSelectorToolbarController( const uno::Reference< uno::XComponentContext > & xContext )
+ : m_xCC( xContext )
+{
+}
+// -----------------------------------------------------------------------------
+ElementSelectorToolbarController::~ElementSelectorToolbarController()
+{
+}
+// -----------------------------------------------------------------------------
+// XInterface
+Any SAL_CALL ElementSelectorToolbarController::queryInterface( const Type& _rType ) throw (RuntimeException)
+{
+ Any aReturn = ToolboxController::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = ElementSelectorToolbarController_BASE::queryInterface(_rType);
+ return aReturn;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL ElementSelectorToolbarController::acquire() throw ()
+{
+ ToolboxController::acquire();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL ElementSelectorToolbarController::release() throw ()
+{
+ ToolboxController::release();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL ElementSelectorToolbarController::initialize( const Sequence< Any >& rArguments ) throw (Exception, RuntimeException)
+{
+ ToolboxController::initialize(rArguments);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL ElementSelectorToolbarController::statusChanged( const frame::FeatureStateEvent& rEvent ) throw ( RuntimeException )
+{
+ if( m_apSelectorListBox.get() )
+ {
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ if( rEvent.FeatureURL.Path.equalsAscii( "ChartElementSelector" ) )
+ {
+ Reference< frame::XController > xChartController;
+ rEvent.State >>= xChartController;
+ m_apSelectorListBox->SetChartController( xChartController );
+ m_apSelectorListBox->UpdateChartElementsListAndSelection();
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference< awt::XWindow > SAL_CALL ElementSelectorToolbarController::createItemWindow( const uno::Reference< awt::XWindow >& xParent )
+ throw (uno::RuntimeException)
+{
+ uno::Reference< awt::XWindow > xItemWindow;
+ if( !m_apSelectorListBox.get() )
+ {
+ Window* pParent = VCLUnoHelper::GetWindow( xParent );
+ if( pParent )
+ {
+ m_apSelectorListBox = ::std::auto_ptr< SelectorListBox >( new SelectorListBox( pParent, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER ) );
+ ::Size aLogicalSize( 95, 160 );
+ ::Size aPixelSize = m_apSelectorListBox->LogicToPixel( aLogicalSize, MAP_APPFONT );
+ m_apSelectorListBox->SetSizePixel( aPixelSize );
+ m_apSelectorListBox->SetDropDownLineCount( 5 );
+ }
+ }
+ if( m_apSelectorListBox.get() )
+ xItemWindow = VCLUnoHelper::GetInterface( m_apSelectorListBox.get() );
+ return xItemWindow;
+}
+
+//..........................................................................
+} // chart2
+//..........................................................................
diff --git a/chart2/source/controller/main/ElementSelector.hxx b/chart2/source/controller/main/ElementSelector.hxx
new file mode 100644
index 000000000000..3992745c9f02
--- /dev/null
+++ b/chart2/source/controller/main/ElementSelector.hxx
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ElementSelector.hxx,v $
+ * $Revision: 1.1 $
+ *
+ * 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 _CHART_ELEMENTSELECTOR_HXX
+#define _CHART_ELEMENTSELECTOR_HXX
+
+#include "ServiceMacros.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <svtools/toolboxcontroller.hxx>
+
+#include <vcl/lstbox.hxx>
+#include <cppuhelper/weakref.hxx>
+
+#include <memory>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+struct ListBoxEntryData
+{
+ rtl::OUString UIName;
+ rtl::OUString CID;
+ sal_Int32 nHierarchyDepth;
+
+ ListBoxEntryData() : nHierarchyDepth(0)
+ {
+ }
+};
+
+class SelectorListBox : public ListBox
+{
+ public:
+ SelectorListBox( Window* pParent, WinBits nStyle );
+ virtual ~SelectorListBox();
+
+ virtual void Select();
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
+
+ void ReleaseFocus_Impl();
+
+ void SetChartController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xChartController );
+ void UpdateChartElementsListAndSelection();
+
+ private:
+ ::com::sun::star::uno::WeakReference<
+ ::com::sun::star::frame::XController > m_xChartController;
+
+ ::std::vector< ListBoxEntryData > m_aEntries;
+
+ bool m_bReleaseFocus;
+};
+
+// ------------------------------------------------------------------
+// ------------------------------------------------------------------
+
+typedef ::cppu::ImplHelper1 < ::com::sun::star::lang::XServiceInfo> ElementSelectorToolbarController_BASE;
+
+class ElementSelectorToolbarController : public ::svt::ToolboxController
+ , ElementSelectorToolbarController_BASE
+{
+public:
+ ElementSelectorToolbarController( ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & xContext );
+ virtual ~ElementSelectorToolbarController();
+
+ // XServiceInfo
+ APPHELPER_XSERVICEINFO_DECL()
+ APPHELPER_SERVICE_FACTORY_HELPER(ElementSelectorToolbarController)
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+
+ // 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);
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+ // XToolbarController
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
+
+private:
+ //no default constructor
+ ElementSelectorToolbarController(){}
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xCC;
+ ::std::auto_ptr< SelectorListBox > m_apSelectorListBox;
+};
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
+
+#endif
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index 67297197cacc..5912847e4bfe 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -41,6 +41,8 @@
#include "macros.hxx"
#include "LineProperties.hxx"
#include "ChartTypeHelper.hxx"
+#include "DataSeriesHelper.hxx"
+#include "LegendHelper.hxx"
#include <map>
#include <algorithm>
@@ -109,6 +111,18 @@ void lcl_getChildCIDs(
}
}
+void lcl_addAxisTitle( const Reference< XAxis >& xAxis, ::chart::ObjectHierarchy::tChildContainer& rContainer, const Reference< frame::XModel >& xChartModel )
+{
+ Reference< XTitled > xAxisTitled( xAxis, uno::UNO_QUERY );
+ if( xAxisTitled.is())
+ {
+ Reference< XTitle > xAxisTitle( xAxisTitled->getTitleObject());
+ if( xAxisTitle.is())
+ rContainer.push_back(
+ ::chart::ObjectIdentifier::createClassifiedIdentifierForObject( xAxisTitle, xChartModel ));
+ }
+}
+
} // anonymous namespace
@@ -123,7 +137,7 @@ public:
explicit ImplObjectHierarchy(
const Reference< XChartDocument > & xChartDocument,
ExplicitValueProvider * pExplicitValueProvider,
- bool bFlattenDiagram );
+ bool bFlattenDiagram, bool bOrderingForElementSelector );
bool hasChildren( const OUString & rParent );
ObjectHierarchy::tChildContainer getChildren( const OUString & rParent );
@@ -133,13 +147,25 @@ public:
private:
void createTree( const Reference< XChartDocument > & xChartDocument );
+ void createAxesTree(
+ ObjectHierarchy::tChildContainer & rContainer,
+ const Reference< XChartDocument > & xChartDoc,
+ const Reference< XDiagram > & xDiagram );
void createDiagramTree(
ObjectHierarchy::tChildContainer & rContainer,
const Reference< XChartDocument > & xChartDoc,
const Reference< XDiagram > & xDiagram );
void createDataSeriesTree(
ObjectHierarchy::tChildContainer & rOutDiagramSubContainer,
- const Reference< XCoordinateSystemContainer > & xCooSysCnt );
+ const Reference< XDiagram > & xDiagram );
+ void createWallAndFloor(
+ ObjectHierarchy::tChildContainer & rContainer,
+ const Reference< XDiagram > & xDiagram );
+ void createLegendTree(
+ ObjectHierarchy::tChildContainer & rContainer,
+ const Reference< XChartDocument > & xChartDoc,
+ const Reference< XDiagram > & xDiagram );
+
ObjectHierarchy::tCID getParentImpl(
const ObjectHierarchy::tCID & rParentCID,
const ObjectHierarchy::tCID & rCID );
@@ -149,14 +175,17 @@ private:
tChildMap m_aChildMap;
ExplicitValueProvider * m_pExplicitValueProvider;
bool m_bFlattenDiagram;
+ bool m_bOrderingForElementSelector;
};
ImplObjectHierarchy::ImplObjectHierarchy(
const Reference< XChartDocument > & xChartDocument,
ExplicitValueProvider * pExplicitValueProvider,
- bool bFlattenDiagram ) :
+ bool bFlattenDiagram,
+ bool bOrderingForElementSelector ) :
m_pExplicitValueProvider( pExplicitValueProvider ),
- m_bFlattenDiagram( bFlattenDiagram )
+ m_bFlattenDiagram( bFlattenDiagram ),
+ m_bOrderingForElementSelector( bOrderingForElementSelector )
{
createTree( xChartDocument );
// don't remember this helper to avoid access after lifetime
@@ -170,10 +199,21 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument > & xChart
//@todo: change ObjectIdentifier to take an XChartDocument rather than XModel
Reference< frame::XModel > xModel( xChartDocument, uno::UNO_QUERY );
+ Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartDocument ) );
+ OUString aDiaCID( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram, xModel ));
ObjectHierarchy::tChildContainer aTopLevelContainer;
// First Level
+ // Chart Area
+ if( m_bOrderingForElementSelector )
+ {
+ aTopLevelContainer.push_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) );
+ aTopLevelContainer.push_back( aDiaCID );
+ createWallAndFloor( aTopLevelContainer, xDiagram );
+ createLegendTree( aTopLevelContainer, xChartDocument, xDiagram );
+ }
+
// Main Title
Reference< XTitled > xDocTitled( xChartDocument, uno::UNO_QUERY );
if( xDocTitled.is())
@@ -184,7 +224,6 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument > & xChart
ObjectIdentifier::createClassifiedIdentifierForObject( xMainTitle, xModel ));
}
- Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartDocument ));
if( xDiagram.is())
{
// Sub Title. Note: This is interpreted of being top level
@@ -197,24 +236,17 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument > & xChart
ObjectIdentifier::createClassifiedIdentifierForObject( xSubTitle, xModel ));
}
- // Axis Titles. Note: These are interpreted of being top level
- Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
- for( sal_Int32 i=0; i<aAxes.getLength(); ++i )
+ if( !m_bOrderingForElementSelector )
{
- Reference< XTitled > xAxisTitled( aAxes[i], uno::UNO_QUERY );
- if( xAxisTitled.is())
- {
- Reference< XTitle > xAxisTitle( xAxisTitled->getTitleObject());
- if( xAxisTitle.is())
- aTopLevelContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifierForObject( xAxisTitle, xModel ));
- }
+ // Axis Titles. Note: These are interpreted of being top level
+ Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
+ for( sal_Int32 i=0; i<aAxes.getLength(); ++i )
+ lcl_addAxisTitle( aAxes[i], aTopLevelContainer, xModel );
+
+ // Diagram
+ aTopLevelContainer.push_back( aDiaCID );
}
- // Diagram
- OUString aDiaCID( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram, xModel ));
- OSL_ASSERT( aDiaCID.getLength());
- aTopLevelContainer.push_back( aDiaCID );
if( m_bFlattenDiagram )
createDiagramTree( aTopLevelContainer, xChartDocument, xDiagram );
else
@@ -225,61 +257,56 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument > & xChart
m_aChildMap[ aDiaCID ] = aSubContainer;
}
-
- // Legend. Note: This is interpreted of being top level
- Reference< XLegend > xLegend( xDiagram->getLegend());
- if( xLegend.is())
- {
- Reference< beans::XPropertySet > xLegendProp( xLegend, uno::UNO_QUERY );
- bool bShow = false;
- if( xLegendProp.is() &&
- (xLegendProp->getPropertyValue( C2U("Show")) >>= bShow) &&
- bShow )
- {
- OUString aLegendCID( ObjectIdentifier::createClassifiedIdentifierForObject( xLegend, xModel ));
- aTopLevelContainer.push_back( aLegendCID );
-
- // iterate over child shapes of legend and search for matching CIDs
- if( m_pExplicitValueProvider )
- {
- Reference< container::XIndexAccess > xLegendShapeContainer(
- m_pExplicitValueProvider->getShapeForCID( aLegendCID ), uno::UNO_QUERY );
- ObjectHierarchy::tChildContainer aLegendEntryCIDs;
- lcl_getChildCIDs( aLegendEntryCIDs, xLegendShapeContainer );
-
- m_aChildMap[ aLegendCID ] = aLegendEntryCIDs;
- }
- }
- }
+ if( !m_bOrderingForElementSelector )
+ createLegendTree( aTopLevelContainer, xChartDocument, xDiagram );
}
// Chart Area
- aTopLevelContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) );
+ if( !m_bOrderingForElementSelector )
+ aTopLevelContainer.push_back(
+ ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) );
if( ! aTopLevelContainer.empty())
m_aChildMap[ ObjectHierarchy::getRootNodeCID() ] = aTopLevelContainer;
}
-void ImplObjectHierarchy::createDiagramTree(
+void ImplObjectHierarchy::createLegendTree(
ObjectHierarchy::tChildContainer & rContainer,
const Reference< XChartDocument > & xChartDoc,
- const Reference< XDiagram > & xDiagram )
+ const Reference< XDiagram > & xDiagram )
{
- // Data Series
- Reference< XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
- createDataSeriesTree( rContainer, xCooSysCnt );
+ if( xDiagram.is() && LegendHelper::hasLegend( xDiagram ) )
+ {
+ OUString aLegendCID( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram->getLegend(), Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ) ));
+ rContainer.push_back( aLegendCID );
+
+ // iterate over child shapes of legend and search for matching CIDs
+ if( m_pExplicitValueProvider )
+ {
+ Reference< container::XIndexAccess > xLegendShapeContainer(
+ m_pExplicitValueProvider->getShapeForCID( aLegendCID ), uno::UNO_QUERY );
+ ObjectHierarchy::tChildContainer aLegendEntryCIDs;
+ lcl_getChildCIDs( aLegendEntryCIDs, xLegendShapeContainer );
- // Axes
+ m_aChildMap[ aLegendCID ] = aLegendEntryCIDs;
+ }
+ }
+}
+
+void ImplObjectHierarchy::createAxesTree(
+ ObjectHierarchy::tChildContainer & rContainer,
+ const Reference< XChartDocument > & xChartDoc,
+ const Reference< XDiagram > & xDiagram )
+{
+ Reference< XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
uno::Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
bool bSupportsAxesGrids = ChartTypeHelper::isSupportingMainAxis( xChartType, nDimensionCount, 0 );
- bool bIsThreeD = ( nDimensionCount == 3 );
- bool bHasWall = DiagramHelper::isSupportingFloorAndWall( xDiagram );
if( bSupportsAxesGrids )
{
Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram, /* bOnlyVisible = */ true ) );
- ::std::transform( aAxes.getConstArray(), aAxes.getConstArray() + aAxes.getLength(),
+ if( !m_bOrderingForElementSelector )
+ ::std::transform( aAxes.getConstArray(), aAxes.getConstArray() + aAxes.getLength(),
::std::back_inserter( rContainer ),
lcl_ObjectToCID( xChartDoc ));
@@ -293,6 +320,24 @@ void ImplObjectHierarchy::createDiagramTree(
if(!xAxis.is())
continue;
+ sal_Int32 nCooSysIndex = 0;
+ sal_Int32 nDimensionIndex = 0;
+ sal_Int32 nAxisIndex = 0;
+ AxisHelper::getIndicesForAxis( xAxis, xDiagram, nCooSysIndex, nDimensionIndex, nAxisIndex );
+ if( nAxisIndex>0 && !ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimensionCount, nDimensionIndex ) )
+ continue;
+
+ if( m_bOrderingForElementSelector )
+ {
+ // axis
+ if( AxisHelper::isAxisVisible( xAxis ) )
+ rContainer.push_back(
+ ObjectIdentifier::createClassifiedIdentifierForObject( xAxis, xChartModel ) );
+
+ // axis title
+ lcl_addAxisTitle( aAxes[nA], rContainer, xChartModel );
+ }
+
Reference< beans::XPropertySet > xGridProperties( xAxis->getGridProperties() );
if( AxisHelper::isGridVisible( xGridProperties ) )
{
@@ -315,31 +360,56 @@ void ImplObjectHierarchy::createDiagramTree(
}
}
}
+}
- // Wall
- if( bHasWall )
+void ImplObjectHierarchy::createWallAndFloor(
+ ObjectHierarchy::tChildContainer & rContainer,
+ const Reference< XDiagram > & xDiagram )
+{
+ sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
+ bool bIsThreeD = ( nDimensionCount == 3 );
+ bool bHasWall = DiagramHelper::isSupportingFloorAndWall( xDiagram );
+ if( bHasWall && bIsThreeD )
{
rContainer.push_back(
ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString()));
- }
- // Floor
- if( bHasWall && bIsThreeD )
- {
Reference< beans::XPropertySet > xFloor( xDiagram->getFloor());
if( xFloor.is())
rContainer.push_back(
ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_FLOOR, rtl::OUString()));
}
+
+}
+
+void ImplObjectHierarchy::createDiagramTree(
+ ObjectHierarchy::tChildContainer & rContainer,
+ const Reference< XChartDocument > & xChartDoc,
+ const Reference< XDiagram > & xDiagram )
+{
+ if( !m_bOrderingForElementSelector )
+ {
+ createDataSeriesTree( rContainer, xDiagram );
+ createAxesTree( rContainer, xChartDoc, xDiagram );
+ createWallAndFloor( rContainer, xDiagram );
+ }
+ else
+ {
+ createAxesTree( rContainer, xChartDoc, xDiagram );
+ createDataSeriesTree( rContainer, xDiagram );
+ }
}
void ImplObjectHierarchy::createDataSeriesTree(
ObjectHierarchy::tChildContainer & rOutDiagramSubContainer,
- const Reference< XCoordinateSystemContainer > & xCooSysCnt )
+ const Reference< XDiagram > & xDiagram )
{
+ Reference< XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
+
try
{
sal_Int32 nDiagramIndex = 0;
+ sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
xCooSysCnt->getCoordinateSystems());
for( sal_Int32 nCooSysIdx=0; nCooSysIdx<aCooSysSeq.getLength(); ++nCooSysIdx )
@@ -348,10 +418,11 @@ void ImplObjectHierarchy::createDataSeriesTree(
Sequence< Reference< XChartType > > aChartTypeSeq( xCTCnt->getChartTypes());
for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypeSeq.getLength(); ++nCTIdx )
{
- Reference< XDataSeriesContainer > xDSCnt( aChartTypeSeq[nCTIdx], uno::UNO_QUERY_THROW );
+ Reference< XChartType > xChartType( aChartTypeSeq[nCTIdx] );
+ Reference< XDataSeriesContainer > xDSCnt( xChartType, uno::UNO_QUERY_THROW );
Sequence< Reference< XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries() );
const sal_Int32 nNumberOfSeries =
- ChartTypeHelper::getNumberOfDisplayedSeries( aChartTypeSeq[nCTIdx], aSeriesSeq.getLength());
+ ChartTypeHelper::getNumberOfDisplayedSeries( xChartType, aSeriesSeq.getLength());
for( sal_Int32 nSeriesIdx=0; nSeriesIdx<nNumberOfSeries; ++nSeriesIdx )
{
@@ -364,41 +435,49 @@ void ImplObjectHierarchy::createDataSeriesTree(
ObjectHierarchy::tChildContainer aSeriesSubContainer;
+ Reference< chart2::XDataSeries > xSeries( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY );
+
+ // data lablels
+ if( DataSeriesHelper::hasDataLabelsAtSeries( xSeries ) )
+ {
+ rtl::OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) );
+ aChildParticle+=(C2U("="));
+ aSeriesSubContainer.push_back(
+ ObjectIdentifier::createClassifiedIdentifierForParticles( aSeriesParticle, aChildParticle ));
+ }
+
// Statistics
- Reference< chart2::XRegressionCurveContainer > xCurveCnt( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY );
- if( xCurveCnt.is())
+ if( ChartTypeHelper::isSupportingStatisticProperties( xChartType, nDimensionCount ) )
{
- Sequence< Reference< chart2::XRegressionCurve > > aCurves( xCurveCnt->getRegressionCurves());
- for( sal_Int32 nCurveIdx=0; nCurveIdx<aCurves.getLength(); ++nCurveIdx )
+ Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY );
+ if( xCurveCnt.is())
{
- bool bIsAverageLine = RegressionCurveHelper::isMeanValueLine( aCurves[nCurveIdx] );
- aSeriesSubContainer.push_back(
- ObjectIdentifier::createDataCurveCID( aSeriesParticle, nCurveIdx, bIsAverageLine ));
- Reference< beans::XPropertySet > xEqProp( aCurves[nCurveIdx]->getEquationProperties());
- bool bShowEq = false;
- bool bShowCoeff = false;
- if( xEqProp.is() &&
- ( (xEqProp->getPropertyValue( C2U("ShowEquation")) >>= bShowEq) ||
- (xEqProp->getPropertyValue( C2U("ShowCorrelationCoefficient")) >>= bShowCoeff) ) &&
- ( bShowEq || bShowCoeff ) )
+ Sequence< Reference< chart2::XRegressionCurve > > aCurves( xCurveCnt->getRegressionCurves());
+ for( sal_Int32 nCurveIdx=0; nCurveIdx<aCurves.getLength(); ++nCurveIdx )
{
+ bool bIsAverageLine = RegressionCurveHelper::isMeanValueLine( aCurves[nCurveIdx] );
aSeriesSubContainer.push_back(
- ObjectIdentifier::createDataCurveEquationCID( aSeriesParticle, nCurveIdx ));
+ ObjectIdentifier::createDataCurveCID( aSeriesParticle, nCurveIdx, bIsAverageLine ));
+ if( RegressionCurveHelper::hasEquation( aCurves[nCurveIdx] ) )
+ {
+ aSeriesSubContainer.push_back(
+ ObjectIdentifier::createDataCurveEquationCID( aSeriesParticle, nCurveIdx ));
+ }
}
- }
- Reference< beans::XPropertySet > xSeriesProp( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY );
- Reference< beans::XPropertySet > xErrorBarProp;
- if( xSeriesProp.is() &&
- (xSeriesProp->getPropertyValue( C2U("ErrorBarY")) >>= xErrorBarProp) &&
- xErrorBarProp.is())
- {
- sal_Int32 nStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
- if( ( xErrorBarProp->getPropertyValue( C2U("ErrorBarStyle")) >>= nStyle ) &&
- ( nStyle != ::com::sun::star::chart::ErrorBarStyle::NONE ) )
+ Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xErrorBarProp;
+ if( xSeriesProp.is() &&
+ (xSeriesProp->getPropertyValue( C2U("ErrorBarY")) >>= xErrorBarProp) &&
+ xErrorBarProp.is())
{
- aSeriesSubContainer.push_back(
- ObjectIdentifier::createClassifiedIdentifierWithParent(
- OBJECTTYPE_DATA_ERRORS, OUString(), aSeriesParticle ));
+ sal_Int32 nStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
+ if( ( xErrorBarProp->getPropertyValue( C2U("ErrorBarStyle")) >>= nStyle ) &&
+ ( nStyle != ::com::sun::star::chart::ErrorBarStyle::NONE ) )
+ {
+ aSeriesSubContainer.push_back(
+ ObjectIdentifier::createClassifiedIdentifierWithParent(
+ OBJECTTYPE_DATA_ERRORS, OUString(), aSeriesParticle ));
+ }
}
}
}
@@ -500,8 +579,9 @@ ObjectHierarchy::tCID ImplObjectHierarchy::getParent(
ObjectHierarchy::ObjectHierarchy(
const Reference< XChartDocument > & xChartDocument,
ExplicitValueProvider * pExplicitValueProvider /* = 0 */,
- bool bFlattenDiagram /* = false */ ) :
- m_apImpl( new impl::ImplObjectHierarchy( xChartDocument, pExplicitValueProvider, bFlattenDiagram ))
+ bool bFlattenDiagram /* = false */,
+ bool bOrderingForElementSelector /* = false */) :
+ m_apImpl( new impl::ImplObjectHierarchy( xChartDocument, pExplicitValueProvider, bFlattenDiagram, bOrderingForElementSelector ))
{}
ObjectHierarchy::~ObjectHierarchy()
diff --git a/chart2/source/controller/main/_serviceregistration_controller.cxx b/chart2/source/controller/main/_serviceregistration_controller.cxx
index 7507aa9dd0cf..7de2e8fa8588 100644
--- a/chart2/source/controller/main/_serviceregistration_controller.cxx
+++ b/chart2/source/controller/main/_serviceregistration_controller.cxx
@@ -36,6 +36,7 @@
#include "dlg_ChartType_UNO.hxx"
#include "ChartDocumentWrapper.hxx"
#include "AccessibleChartView.hxx"
+#include "ElementSelector.hxx"
#include <cppuhelper/implementationentry.hxx>
static struct ::cppu::ImplementationEntry g_entries_chart2_controller[] =
@@ -88,6 +89,14 @@ static struct ::cppu::ImplementationEntry g_entries_chart2_controller[] =
, 0
, 0
}
+ ,{
+ ::chart::ElementSelectorToolbarController::create
+ , ::chart::ElementSelectorToolbarController::getImplementationName_Static
+ , ::chart::ElementSelectorToolbarController::getSupportedServiceNames_Static
+ , ::cppu::createSingleComponentFactory
+ , 0
+ , 0
+ }
,{ 0, 0, 0, 0, 0, 0 }
};
diff --git a/chart2/source/controller/main/makefile.mk b/chart2/source/controller/main/makefile.mk
index 6ee09d8c7c72..5d0ecadc0ae0 100644
--- a/chart2/source/controller/main/makefile.mk
+++ b/chart2/source/controller/main/makefile.mk
@@ -46,6 +46,7 @@ VISIBILITY_HIDDEN=TRUE
#object files to build and link together to lib $(SLB)$/$(TARGET).lib
SLOFILES = \
$(SLO)$/ConfigurationAccess.obj \
+ $(SLO)$/ElementSelector.obj \
$(SLO)$/SelectionHelper.obj \
$(SLO)$/PositionAndSizeHelper.obj \
$(SLO)$/ChartWindow.obj \
diff --git a/chart2/source/controller/makefile.mk b/chart2/source/controller/makefile.mk
index d2d399d22cff..45060a60d297 100644
--- a/chart2/source/controller/makefile.mk
+++ b/chart2/source/controller/makefile.mk
@@ -90,6 +90,7 @@ SHL1STDLIBS= $(CHARTTOOLS) \
$(SALLIB) \
$(SVLLIB) \
$(SVTOOLLIB) \
+ $(SVXCORELIB) \
$(SVXLIB) \
$(TKLIB) \
$(TOOLSLIB) \
diff --git a/chart2/source/inc/AxisHelper.hxx b/chart2/source/inc/AxisHelper.hxx
index a6b91481af8a..15d5e9cb4ae5 100644
--- a/chart2/source/inc/AxisHelper.hxx
+++ b/chart2/source/inc/AxisHelper.hxx
@@ -51,6 +51,9 @@ namespace chart
class OOO_DLLPUBLIC_CHARTTOOLS AxisHelper
{
public:
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling > createLinearScaling();
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling > createLogarithmicScaling( double fBase = 10.0 );
+
static ::com::sun::star::chart2::ScaleData createDefaultScale();
static void removeExplicitScaling( ::com::sun::star::chart2::ScaleData& rScaleData );
@@ -101,7 +104,7 @@ public:
static void makeAxisInvisible( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis );
static void makeGridInvisible( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xGridProperties );
- static sal_Bool areAxisLabelsVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xAxisProperties );
+ SAL_DLLPRIVATE static sal_Bool areAxisLabelsVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xAxisProperties );
static sal_Bool isAxisVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis );
static sal_Bool isGridVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xGridProperties );
@@ -187,7 +190,7 @@ public:
/** @param bOnlyVisible if </TRUE>, only axes with property "Show" set to
</TRUE> are returned
*/
- static std::vector<
+ SAL_DLLPRIVATE static std::vector<
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XAxis > >
getAllAxesOfCoordinateSystem( const ::com::sun::star::uno::Reference<
diff --git a/chart2/source/inc/BaseGFXHelper.hxx b/chart2/source/inc/BaseGFXHelper.hxx
index 3544f5678462..675b2ff5acd5 100644
--- a/chart2/source/inc/BaseGFXHelper.hxx
+++ b/chart2/source/inc/BaseGFXHelper.hxx
@@ -68,17 +68,15 @@ OOO_DLLPUBLIC_CHARTTOOLS
com::sun::star::awt::Rectangle B2IRectangleToAWTRectangle(
const ::basegfx::B2IRectangle& rB2IRectangle );
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DVector Direction3DToB3DVector(
+::basegfx::B3DVector Direction3DToB3DVector(
const com::sun::star::drawing::Direction3D& rDirection );
-OOO_DLLPUBLIC_CHARTTOOLS
com::sun::star::drawing::Direction3D B3DVectorToDirection3D(
const ::basegfx::B3DVector& rB3DVector );
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DVector Position3DToB3DVector(
+::basegfx::B3DVector Position3DToB3DVector(
const com::sun::star::drawing::Position3D& rPosition );
-OOO_DLLPUBLIC_CHARTTOOLS
com::sun::star::drawing::Position3D B3DVectorToPosition3D(
const ::basegfx::B3DVector& rB3DVector );
@@ -95,7 +93,6 @@ OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DTuple GetRotationFromMatrix(
OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DTuple GetScaleFromMatrix(
const ::basegfx::B3DHomMatrix & rB3DMatrix );
-OOO_DLLPUBLIC_CHARTTOOLS
void ReduceToRotationMatrix( ::basegfx::B3DHomMatrix & rB3DMatrix );
OOO_DLLPUBLIC_CHARTTOOLS double Deg2Rad( double fDegrees );
diff --git a/chart2/source/inc/CachedDataSequence.hxx b/chart2/source/inc/CachedDataSequence.hxx
index c13c8883baf9..22b2c9311085 100644
--- a/chart2/source/inc/CachedDataSequence.hxx
+++ b/chart2/source/inc/CachedDataSequence.hxx
@@ -37,7 +37,6 @@
#include <comphelper/propertycontainer.hxx>
#include <comphelper/proparrhlp.hxx>
#include "ServiceMacros.hxx"
-#include "charttoolsdllapi.hxx"
// interfaces and types
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -69,7 +68,7 @@ typedef ::cppu::WeakComponentImplHelper7<
CachedDataSequence_Base;
}
-class OOO_DLLPUBLIC_CHARTTOOLS CachedDataSequence :
+class CachedDataSequence :
public ::comphelper::OMutexAndBroadcastHelper,
public ::comphelper::OPropertyContainer,
public ::comphelper::OPropertyArrayUsageHelper< CachedDataSequence >,
@@ -84,25 +83,11 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > & xContext );
- /** creates a sequence and initializes it with the given vector of floating
- point numbers
- */
- explicit CachedDataSequence( const ::std::vector< double > & rVector );
-
- /** creates a sequence and initializes it with the given vector of strings
- */
- explicit CachedDataSequence( const ::std::vector< ::rtl::OUString > & rVector );
-
/** creates a sequence and initializes it with the given string. This is
especially useful for labels, which only have one element.
*/
explicit CachedDataSequence( const ::rtl::OUString & rSingleText );
- /** creates a sequence and initializes it with the given vector of arbitrary
- content
- */
- explicit CachedDataSequence( const ::std::vector< ::com::sun::star::uno::Any > & rVector );
-
/// Copy CTOR
explicit CachedDataSequence( const CachedDataSequence & rSource );
@@ -167,8 +152,6 @@ protected:
// <properties>
sal_Int32 m_nNumberFormatKey;
::rtl::OUString m_sRole;
- sal_Bool m_bIsHidden;
- ::com::sun::star::uno::Sequence< sal_Int32 > m_aHiddenValues;
// </properties>
enum DataType
@@ -183,6 +166,7 @@ protected:
*/
void registerProperties();
+private:
/** is used by interface method getNumericalData().
*/
::com::sun::star::uno::Sequence< double > Impl_getNumericalData() const;
diff --git a/chart2/source/inc/CharacterProperties.hxx b/chart2/source/inc/CharacterProperties.hxx
index 092f614846b7..ae32f29ba20f 100644
--- a/chart2/source/inc/CharacterProperties.hxx
+++ b/chart2/source/inc/CharacterProperties.hxx
@@ -121,6 +121,7 @@ public:
PROP_CHAR_COMPLEX_WEIGHT,
PROP_CHAR_COMPLEX_POSTURE,
PROP_CHAR_COMPLEX_LOCALE,
+ PROP_PARA_IS_CHARACTER_DISTANCE,
PROP_WRITING_MODE,
diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx
index c6ff89d59c12..fa80d00413f7 100644
--- a/chart2/source/inc/ChartModelHelper.hxx
+++ b/chart2/source/inc/ChartModelHelper.hxx
@@ -34,6 +34,12 @@
#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/chart/XChartDataArray.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include "charttoolsdllapi.hxx"
@@ -52,6 +58,19 @@ namespace chart
class OOO_DLLPUBLIC_CHARTTOOLS ChartModelHelper
{
public:
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XUndoManager > createUndoManager();
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XRangeHighlighter > createRangeHighlighter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionSupplier >& xSelectionSupplier );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > createInternalDataProvider();
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > createInternalDataProvider(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataArray >& xDataToCopy );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > createInternalDataProvider(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc );
+
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDiagram >
findDiagram( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
@@ -60,7 +79,7 @@ public:
::com::sun::star::chart2::XDiagram >
findDiagram( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc );
- static ::std::vector< ::com::sun::star::uno::Reference<
+ SAL_DLLPRIVATE static ::std::vector< ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries > > getDataSeries(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDoc );
@@ -87,6 +106,12 @@ public:
static void triggerRangeHighlighting( const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xModel );
+
+ static bool isIncludeHiddenCells( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel >& xChartModel );
+
+ static bool setIncludeHiddenCells( bool bIncludeHiddenCells, const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel >& xChartModel );
};
//.............................................................................
diff --git a/chart2/source/inc/ChartTypeHelper.hxx b/chart2/source/inc/ChartTypeHelper.hxx
index f99d39f63bcb..9c5cdafe49f2 100644
--- a/chart2/source/inc/ChartTypeHelper.hxx
+++ b/chart2/source/inc/ChartTypeHelper.hxx
@@ -76,16 +76,29 @@ public:
static ::com::sun::star::uno::Sequence < sal_Int32 > getSupportedMissingValueTreatments(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
- static ::com::sun::star::drawing::Direction3D getDefaultSimpleLightDirection( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
- static ::com::sun::star::drawing::Direction3D getDefaultRealisticLightDirection( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
- static sal_Int32 getDefaultDirectLightColor( bool bSimple, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
- static sal_Int32 getDefaultAmbientLightColor( bool bSimple, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
+ SAL_DLLPRIVATE static ::com::sun::star::drawing::Direction3D getDefaultSimpleLightDirection( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
+ SAL_DLLPRIVATE static ::com::sun::star::drawing::Direction3D getDefaultRealisticLightDirection( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
+ SAL_DLLPRIVATE static sal_Int32 getDefaultDirectLightColor( bool bSimple, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
+ SAL_DLLPRIVATE static sal_Int32 getDefaultAmbientLightColor( bool bSimple, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
static sal_Int32 getNumberOfDisplayedSeries( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType, sal_Int32 nNumberOfSeries );
- static bool noBordersForSimpleScheme( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
+ SAL_DLLPRIVATE static bool noBordersForSimpleScheme( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
+
+ static bool isSeriesInFrontOfAxisLine( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
static sal_Int32 //one of ::com::sun::star::chart2::AxisType
getAxisType( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType
, sal_Int32 nDimensionIndex );
+
+ static rtl::OUString getRoleOfSequenceForYAxisNumberFormatDetection( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartType >& xChartType );
+
+ static rtl::OUString getRoleOfSequenceForDataLabelNumberFormatDetection( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartType >& xChartType );
+
+ static bool shouldLabelNumberFormatKeyBeDetectedFromYAxis( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartType >& xChartType );
+
+ static bool isSupportingOnlyDeepStackingFor3D( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
};
//.............................................................................
diff --git a/chart2/source/inc/ColorPerPointHelper.hxx b/chart2/source/inc/ColorPerPointHelper.hxx
index a18757f4f8b7..c1391d9837cd 100644
--- a/chart2/source/inc/ColorPerPointHelper.hxx
+++ b/chart2/source/inc/ColorPerPointHelper.hxx
@@ -56,7 +56,7 @@ public:
// returns true if AttributedDataPoints contains nPointIndex and the
// property Color is DEFAULT
- static bool hasPointOwnProperties(
+ SAL_DLLPRIVATE static bool hasPointOwnProperties(
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xSeriesProperties
, sal_Int32 nPointIndex );
diff --git a/chart2/source/inc/CommonConverters.hxx b/chart2/source/inc/CommonConverters.hxx
index f27bad5a719c..493c4d2096e2 100644
--- a/chart2/source/inc/CommonConverters.hxx
+++ b/chart2/source/inc/CommonConverters.hxx
@@ -101,23 +101,11 @@ OOO_DLLPUBLIC_CHARTTOOLS com::sun::star::drawing::Direction3D B3DVectorToDirecti
OOO_DLLPUBLIC_CHARTTOOLS com::sun::star::drawing::Position3D B3DPointToPosition3D( const ::basegfx::B3DPoint& rPoint);
//-----------------------------------------------------------------------------
-/** Direction3D -> B3DPoint
-*/
-OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DPoint Direction3DToB3DPoint( const com::sun::star::drawing::Direction3D& rDirection);
-
-//-----------------------------------------------------------------------------
/** Direction3D -> B3DVector
*/
OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DVector Direction3DToB3DVector( const com::sun::star::drawing::Direction3D& rDirection);
//-----------------------------------------------------------------------------
-/** two drawing::Position3D -> PolyPolygonShape3D
-*/
-OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::drawing::PolyPolygonShape3D
- MakeLine3D( const ::com::sun::star::drawing::Position3D & rStart,
- const ::com::sun::star::drawing::Position3D & rEnd );
-
-//-----------------------------------------------------------------------------
/** PolyPolygonShape3D + drawing::Position3D -> PolyPolygonShape3D
*/
OOO_DLLPUBLIC_CHARTTOOLS
@@ -133,6 +121,10 @@ OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::drawing::Position3D getPointFromPoly(
, sal_Int32 nPointIndex, sal_Int32 nPolyIndex=0 );
//-----------------------------------------------------------------------------
+OOO_DLLPUBLIC_CHARTTOOLS
+void addPolygon( com::sun::star::drawing::PolyPolygonShape3D& rRet
+ , const com::sun::star::drawing::PolyPolygonShape3D& rAdd );
+//-----------------------------------------------------------------------------
/** PolyPolygonShape3D + PolyPolygonShape3D -> PolyPolygonShape3D
*/
OOO_DLLPUBLIC_CHARTTOOLS
@@ -168,21 +160,6 @@ OOO_DLLPUBLIC_CHARTTOOLS com::sun::star::drawing::Position3D
, const com::sun::star::drawing::Direction3D& rDirection);
//-----------------------------------------------------------------------------
-/** Direction3D + Direction3D == Direction3D
-*/
-OOO_DLLPUBLIC_CHARTTOOLS com::sun::star::drawing::Direction3D
- operator+( const com::sun::star::drawing::Direction3D& rDirection
- , const com::sun::star::drawing::Direction3D& rDirectionAdd);
-
-//-----------------------------------------------------------------------------
-/** Position3D - Direction3D == Position3D
-*/
-OOO_DLLPUBLIC_CHARTTOOLS com::sun::star::drawing::Position3D
- operator-( const com::sun::star::drawing::Position3D& rPos
- , const com::sun::star::drawing::Direction3D& rDirection);
-
-
-//-----------------------------------------------------------------------------
/** Position3D - Position3D == Direction3D
*/
OOO_DLLPUBLIC_CHARTTOOLS com::sun::star::drawing::Direction3D
@@ -190,13 +167,6 @@ OOO_DLLPUBLIC_CHARTTOOLS com::sun::star::drawing::Direction3D
, const com::sun::star::drawing::Position3D& rPos2);
//-----------------------------------------------------------------------------
-/** Direction3D * double == Direction3D
-*/
-OOO_DLLPUBLIC_CHARTTOOLS com::sun::star::drawing::Direction3D
- operator*( const com::sun::star::drawing::Direction3D& rDirection
- , double fFraction);
-
-//-----------------------------------------------------------------------------
/** Position3D == Position3D ?
*/
OOO_DLLPUBLIC_CHARTTOOLS
@@ -242,13 +212,6 @@ OOO_DLLPUBLIC_CHARTTOOLS com::sun::star::uno::Sequence< double >
Position3DToSequence( const com::sun::star::drawing::Position3D& rPosition );
//-----------------------------------------------------------------------------
-/** drawing::Direction3D / double
-*/
-
-OOO_DLLPUBLIC_CHARTTOOLS com::sun::star::drawing::Direction3D
- operator/( const com::sun::star::drawing::Direction3D& rDirection, double f );
-
-//-----------------------------------------------------------------------------
/** chart2::XDataSequence -> uno::Sequence< double >
*/
diff --git a/chart2/source/inc/CommonFunctors.hxx b/chart2/source/inc/CommonFunctors.hxx
index 1c4a76efd229..2ec4efa41b8c 100644
--- a/chart2/source/inc/CommonFunctors.hxx
+++ b/chart2/source/inc/CommonFunctors.hxx
@@ -100,8 +100,11 @@ struct OOO_DLLPUBLIC_CHARTTOOLS AnyToString : public ::std::unary_function< ::co
::com::sun::star::uno::TypeClass eClass( rAny.getValueType().getTypeClass() );
if( eClass == ::com::sun::star::uno::TypeClass_DOUBLE )
{
+ const double* pDouble = reinterpret_cast< const double * >( rAny.getValue() );
+ if( ::rtl::math::isNan(*pDouble) )
+ return ::rtl::OUString();
return ::rtl::math::doubleToUString(
- * reinterpret_cast< const double * >( rAny.getValue() ),
+ * pDouble,
rtl_math_StringFormat_Automatic,
-1, // use maximum decimal places available
sal_Char( '.' ), // decimal separator
diff --git a/chart2/source/inc/ConfigColorScheme.hxx b/chart2/source/inc/ConfigColorScheme.hxx
index 7a27f93f338c..3fe9355fd8cb 100644
--- a/chart2/source/inc/ConfigColorScheme.hxx
+++ b/chart2/source/inc/ConfigColorScheme.hxx
@@ -44,12 +44,17 @@
namespace chart
{
+
+OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme > createConfigColorScheme(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > & xContext );
+
namespace impl
{
class ChartConfigItem;
}
-class OOO_DLLPUBLIC_CHARTTOOLS ConfigColorScheme :
+class ConfigColorScheme :
public ConfigItemListener,
public ::cppu::WeakImplHelper2<
::com::sun::star::chart2::XColorScheme,
@@ -59,7 +64,7 @@ public:
explicit ConfigColorScheme(
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > & xContext );
- virtual ~ConfigColorScheme();
+ SAL_DLLPRIVATE virtual ~ConfigColorScheme();
/// establish methods for factory instatiation
APPHELPER_SERVICE_FACTORY_HELPER( ConfigColorScheme )
@@ -68,14 +73,14 @@ public:
protected:
// ____ XColorScheme ____
- virtual ::sal_Int32 SAL_CALL getColorByIndex( ::sal_Int32 nIndex )
+ SAL_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getColorByIndex( ::sal_Int32 nIndex )
throw (::com::sun::star::uno::RuntimeException);
// ____ ConfigItemListener ____
- virtual void notify( const ::rtl::OUString & rPropertyName );
+ SAL_DLLPRIVATE virtual void notify( const ::rtl::OUString & rPropertyName );
private:
- void retrieveConfigColors();
+ SAL_DLLPRIVATE void retrieveConfigColors();
// member variables
::com::sun::star::uno::Reference<
diff --git a/chart2/source/inc/ControllerLockGuard.hxx b/chart2/source/inc/ControllerLockGuard.hxx
index b7bf17def1cb..0440018d2c72 100644
--- a/chart2/source/inc/ControllerLockGuard.hxx
+++ b/chart2/source/inc/ControllerLockGuard.hxx
@@ -67,8 +67,8 @@ public:
::com::sun::star::frame::XModel > & xModel );
~ControllerLockHelper();
- void lockControllers();
- void unlockControllers();
+ SAL_DLLPRIVATE void lockControllers();
+ SAL_DLLPRIVATE void unlockControllers();
private:
::com::sun::star::uno::Reference<
diff --git a/chart2/source/inc/DataSeriesHelper.hxx b/chart2/source/inc/DataSeriesHelper.hxx
index 8e6173fa2ab9..317c92849fb7 100644
--- a/chart2/source/inc/DataSeriesHelper.hxx
+++ b/chart2/source/inc/DataSeriesHelper.hxx
@@ -42,6 +42,7 @@
#include <vector>
#include <functional>
+#include <hash_set>
namespace chart
{
@@ -49,7 +50,7 @@ namespace chart
namespace DataSeriesHelper
{
-OOO_DLLPUBLIC_CHARTTOOLS ::rtl::OUString GetRole(
+::rtl::OUString GetRole(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence >& xLabeledDataSequence );
@@ -180,6 +181,34 @@ OOO_DLLPUBLIC_CHARTTOOLS bool areAllSeriesAttachedToSameAxis(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType,
sal_Int32 & rOutAxisIndex );
+OOO_DLLPUBLIC_CHARTTOOLS bool hasUnhiddenData( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >& xSeries );
+
+OOO_DLLPUBLIC_CHARTTOOLS
+sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nClippedIndex, const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XDataSequence >& xDataSequence, bool bTranslate );
+
+OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelsAtSeries( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >& xSeries );
+
+OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelsAtPoints( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >& xSeries );
+
+OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelAtPoint( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >& xSeries, sal_Int32 nPointIndex );
+
+OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelsToSeriesAndAllPoints( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >& xSeries );
+
+OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelToPoint( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& xPointPropertySet );
+
+OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromSeriesAndAllPoints( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries >& xSeries );
+
+OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromPoint( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& xPointPropertySet );
+
} // namespace DataSeriesHelper
} // namespace chart
diff --git a/chart2/source/inc/DataSource.hxx b/chart2/source/inc/DataSource.hxx
index 286e6b6116e1..555bbad847c4 100644
--- a/chart2/source/inc/DataSource.hxx
+++ b/chart2/source/inc/DataSource.hxx
@@ -37,12 +37,11 @@
#include <cppuhelper/implbase3.hxx>
#include <comphelper/uno3.hxx>
#include "ServiceMacros.hxx"
-#include "charttoolsdllapi.hxx"
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS DataSource : public
+class DataSource : public
::cppu::WeakImplHelper3<
::com::sun::star::lang::XServiceInfo,
::com::sun::star::chart2::data::XDataSource,
diff --git a/chart2/source/inc/DataSourceHelper.hxx b/chart2/source/inc/DataSourceHelper.hxx
index 40b03034fcf7..c2f29e42c6ba 100644
--- a/chart2/source/inc/DataSourceHelper.hxx
+++ b/chart2/source/inc/DataSourceHelper.hxx
@@ -34,11 +34,11 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
-#ifndef _COM_SUN_STAR_CHART2_XLABELEDDATASEQUENCE_HPP_
#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
-#endif
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
#include "charttoolsdllapi.hxx"
#include <vector>
@@ -55,6 +55,30 @@ namespace chart
class OOO_DLLPUBLIC_CHARTTOOLS DataSourceHelper
{
public:
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >
+ createDataSource( const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XLabeledDataSequence > > & rSequences );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >
+ createCachedDataSequence();
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >
+ createCachedDataSequence( const ::rtl::OUString & rSingleText );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence >
+ createLabeledDataSequence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xValues ,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xLabels );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence >
+ createLabeledDataSequence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xValues );
+
+ static ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence >
+ createLabeledDataSequence(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
+
static ::com::sun::star::uno::Sequence<
::com::sun::star::beans::PropertyValue > createArguments(
bool bUseColumns, bool bFirstCellAsLabel, bool bHasCategories );
@@ -65,7 +89,7 @@ public:
const ::com::sun::star::uno::Sequence< sal_Int32 >& rSequenceMapping,
bool bUseColumns, bool bFirstCellAsLabel, bool bHasCategories );
- static void readArguments( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArguments
+ SAL_DLLPRIVATE static void readArguments( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArguments
, ::rtl::OUString & rRangeRepresentation, ::com::sun::star::uno::Sequence< sal_Int32 >& rSequenceMapping
, bool& bUseColumns, bool& bFirstCellAsLabel, bool& bHasCategories );
@@ -79,7 +103,7 @@ public:
::com::sun::star::chart2::data::XLabeledDataSequence >& xLabeledDataSequence
, ::std::vector< ::rtl::OUString >& rOutRangeRepresentations );
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getUsedDataRanges(
+ SAL_DLLPRIVATE static ::com::sun::star::uno::Sequence< ::rtl::OUString > getUsedDataRanges(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDiagram > & xDiagram );
@@ -127,11 +151,11 @@ public:
static bool allArgumentsForRectRangeDetected(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDocument );
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getRangesFromLabeledDataSequence(
+ SAL_DLLPRIVATE static ::com::sun::star::uno::Sequence< ::rtl::OUString > getRangesFromLabeledDataSequence(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence > & xLSeq );
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getRangesFromDataSource(
+ SAL_DLLPRIVATE static ::com::sun::star::uno::Sequence< ::rtl::OUString > getRangesFromDataSource(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XDataSource > & xSource );
};
diff --git a/chart2/source/inc/DiagramHelper.hxx b/chart2/source/inc/DiagramHelper.hxx
index ae650e0a4898..119d206a2937 100644
--- a/chart2/source/inc/DiagramHelper.hxx
+++ b/chart2/source/inc/DiagramHelper.hxx
@@ -157,7 +157,7 @@ public:
/** Replaces all occurences of xCooSysToReplace in the tree with
xReplacement in the diagram's tree
*/
- static void replaceCoordinateSystem(
+ SAL_DLLPRIVATE static void replaceCoordinateSystem(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDiagram > & xDiagram,
const ::com::sun::star::uno::Reference<
@@ -230,12 +230,12 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDoc );
- static ::com::sun::star::uno::Sequence< rtl::OUString >
+ SAL_DLLPRIVATE static ::com::sun::star::uno::Sequence< rtl::OUString >
generateAutomaticCategories(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XCoordinateSystem > & xCooSys );
- static void generateAutomaticCategoriesFromChartType(
+ SAL_DLLPRIVATE static void generateAutomaticCategoriesFromChartType(
::com::sun::star::uno::Sequence< rtl::OUString >& rRet,
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType );
@@ -251,7 +251,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDiagram > & xDiagram );
- static bool areChartTypesCompatible( const ::com::sun::star::uno::Reference<
+ SAL_DLLPRIVATE static bool areChartTypesCompatible( const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartType >& xFirstType,
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartType >& xSecondType );
diff --git a/chart2/source/inc/ErrorBar.hxx b/chart2/source/inc/ErrorBar.hxx
index 041e4aa6a5ab..4b586aefc8a9 100644
--- a/chart2/source/inc/ErrorBar.hxx
+++ b/chart2/source/inc/ErrorBar.hxx
@@ -50,6 +50,10 @@
namespace chart
{
+OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createErrorBar(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > & xContext );
+
namespace impl
{
typedef ::cppu::WeakImplHelper6<
@@ -62,7 +66,7 @@ typedef ::cppu::WeakImplHelper6<
ErrorBar_Base;
}
-class OOO_DLLPUBLIC_CHARTTOOLS ErrorBar :
+class ErrorBar :
public MutexContainer,
public impl::ErrorBar_Base,
public ::property::OPropertySet
diff --git a/chart2/source/inc/ExplicitCategoriesProvider.hxx b/chart2/source/inc/ExplicitCategoriesProvider.hxx
index 12a98e4fca47..a6d8926d36ac 100644
--- a/chart2/source/inc/ExplicitCategoriesProvider.hxx
+++ b/chart2/source/inc/ExplicitCategoriesProvider.hxx
@@ -49,10 +49,10 @@ class OOO_DLLPUBLIC_CHARTTOOLS ExplicitCategoriesProvider :
public:
ExplicitCategoriesProvider( const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel );
- virtual ~ExplicitCategoriesProvider();
+ SAL_DLLPRIVATE virtual ~ExplicitCategoriesProvider();
//XTextualDataSequence
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getTextualData()
+ SAL_DLLPRIVATE virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getTextualData()
throw (::com::sun::star::uno::RuntimeException);
static ::rtl::OUString getCategoryByIndex(
diff --git a/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx b/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx
index 20c58c31b458..fe7734730a45 100644
--- a/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx
+++ b/chart2/source/inc/ExponentialRegressionCurveCalculator.hxx
@@ -31,12 +31,11 @@
#define CHART2_EXPONENTIALREGRESSIONCURVECALCULATOR_HXX
#include "RegressionCurveCalculator.hxx"
-#include "charttoolsdllapi.hxx"
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS ExponentialRegressionCurveCalculator :
+class ExponentialRegressionCurveCalculator :
public RegressionCurveCalculator
{
public:
diff --git a/chart2/source/inc/InternalDataProvider.hxx b/chart2/source/inc/InternalDataProvider.hxx
index 5a7afc62c5fe..9bf598441b3a 100644
--- a/chart2/source/inc/InternalDataProvider.hxx
+++ b/chart2/source/inc/InternalDataProvider.hxx
@@ -41,7 +41,6 @@
#include <com/sun/star/util/XCloneable.hpp>
#include <cppuhelper/implbase6.hxx>
#include "ServiceMacros.hxx"
-#include "charttoolsdllapi.hxx"
#include "CachedDataSequence.hxx"
@@ -75,7 +74,7 @@ typedef ::cppu::WeakImplHelper6<
<p>The format for a complete range is "all". (Do we need more than
that?)</p>
*/
-class OOO_DLLPUBLIC_CHARTTOOLS InternalDataProvider :
+class InternalDataProvider :
public impl::InternalDataProvider_Base
{
public:
diff --git a/chart2/source/inc/LabeledDataSequence.hxx b/chart2/source/inc/LabeledDataSequence.hxx
index 23cfb7bb2743..3eba45bd2df9 100644
--- a/chart2/source/inc/LabeledDataSequence.hxx
+++ b/chart2/source/inc/LabeledDataSequence.hxx
@@ -31,7 +31,6 @@
#define CHART2_LABELEDDATASEQUENCE_HXX
#include "ServiceMacros.hxx"
#include "MutexContainer.hxx"
-#include "charttoolsdllapi.hxx"
#include <comphelper/uno3.hxx>
#include <cppuhelper/implbase4.hxx>
@@ -56,7 +55,7 @@ typedef cppu::WeakImplHelper4<
LabeledDataSequence_Base;
}
-class OOO_DLLPUBLIC_CHARTTOOLS LabeledDataSequence :
+class LabeledDataSequence :
public MutexContainer,
public impl::LabeledDataSequence_Base
{
diff --git a/chart2/source/inc/LegendHelper.hxx b/chart2/source/inc/LegendHelper.hxx
index f6c792ab48f1..f88e2cba0aae 100644
--- a/chart2/source/inc/LegendHelper.hxx
+++ b/chart2/source/inc/LegendHelper.hxx
@@ -52,6 +52,16 @@ class OOO_DLLPUBLIC_CHARTTOOLS LegendHelper
public:
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XLegend >
+ showLegend( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel >& xModel
+ , const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& xContext );
+
+ static void hideLegend( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::frame::XModel >& xModel );
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XLegend >
getLegend( const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xModel
, const ::com::sun::star::uno::Reference<
diff --git a/chart2/source/inc/LifeTime.hxx b/chart2/source/inc/LifeTime.hxx
index 6b08c33b89da..26b9f09f7880 100644
--- a/chart2/source/inc/LifeTime.hxx
+++ b/chart2/source/inc/LifeTime.hxx
@@ -46,17 +46,17 @@ namespace apphelper
{
class LifeTimeGuard;
-class OOO_DLLPUBLIC_CHARTTOOLS LifeTimeManager
+class LifeTimeManager
{
friend class LifeTimeGuard;
protected:
mutable ::osl::Mutex m_aAccessMutex;
public:
- LifeTimeManager( ::com::sun::star::lang::XComponent* pComponent, sal_Bool bLongLastingCallsCancelable = sal_False );
- virtual ~LifeTimeManager();
+OOO_DLLPUBLIC_CHARTTOOLS LifeTimeManager( ::com::sun::star::lang::XComponent* pComponent, sal_Bool bLongLastingCallsCancelable = sal_False );
+OOO_DLLPUBLIC_CHARTTOOLS virtual ~LifeTimeManager();
- sal_Bool impl_isDisposed();
- sal_Bool dispose() throw(::com::sun::star::uno::RuntimeException);
+OOO_DLLPUBLIC_CHARTTOOLS sal_Bool impl_isDisposed();
+OOO_DLLPUBLIC_CHARTTOOLS sal_Bool dispose() throw(::com::sun::star::uno::RuntimeException);
public:
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer;
@@ -85,7 +85,7 @@ protected:
sal_Int32 volatile m_nLongLastingCallCount;
};
-class OOO_DLLPUBLIC_CHARTTOOLS CloseableLifeTimeManager : public LifeTimeManager
+class CloseableLifeTimeManager : public LifeTimeManager
{
protected:
::com::sun::star::util::XCloseable* m_pCloseable;
@@ -103,19 +103,19 @@ protected:
sal_Bool volatile m_bOwnershipIsWellKnown;
public:
- CloseableLifeTimeManager( ::com::sun::star::util::XCloseable* pCloseable
+OOO_DLLPUBLIC_CHARTTOOLS CloseableLifeTimeManager( ::com::sun::star::util::XCloseable* pCloseable
, ::com::sun::star::lang::XComponent* pComponent
, sal_Bool bLongLastingCallsCancelable = sal_False );
- virtual ~CloseableLifeTimeManager();
+OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager();
- sal_Bool impl_isDisposedOrClosed();
- sal_Bool g_close_startTryClose(sal_Bool bDeliverOwnership)
+OOO_DLLPUBLIC_CHARTTOOLS sal_Bool impl_isDisposedOrClosed();
+OOO_DLLPUBLIC_CHARTTOOLS sal_Bool g_close_startTryClose(sal_Bool bDeliverOwnership)
throw ( ::com::sun::star::uno::Exception );
- sal_Bool g_close_isNeedToCancelLongLastingCalls( sal_Bool bDeliverOwnership, ::com::sun::star::util::CloseVetoException& ex )
+OOO_DLLPUBLIC_CHARTTOOLS sal_Bool g_close_isNeedToCancelLongLastingCalls( sal_Bool bDeliverOwnership, ::com::sun::star::util::CloseVetoException& ex )
throw ( ::com::sun::star::util::CloseVetoException );
- void g_close_endTryClose(sal_Bool bDeliverOwnership, sal_Bool bMyVeto );
- void g_close_endTryClose_doClose();
- sal_Bool g_addCloseListener( const ::com::sun::star::uno::Reference<
+OOO_DLLPUBLIC_CHARTTOOLS void g_close_endTryClose(sal_Bool bDeliverOwnership, sal_Bool bMyVeto );
+OOO_DLLPUBLIC_CHARTTOOLS void g_close_endTryClose_doClose();
+OOO_DLLPUBLIC_CHARTTOOLS sal_Bool g_addCloseListener( const ::com::sun::star::uno::Reference<
::com::sun::star::util::XCloseListener > & xListener )
throw(::com::sun::star::uno::RuntimeException);
diff --git a/chart2/source/inc/LineProperties.hxx b/chart2/source/inc/LineProperties.hxx
index 9a4a978c09ce..3cc60c5f3aa7 100644
--- a/chart2/source/inc/LineProperties.hxx
+++ b/chart2/source/inc/LineProperties.hxx
@@ -62,9 +62,9 @@ public:
static void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
- static bool IsLineVisible( const ::com::sun::star::uno::Reference<
+ SAL_DLLPRIVATE static bool IsLineVisible( const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xLineProperties );
- static void SetLineVisible( const ::com::sun::star::uno::Reference<
+ SAL_DLLPRIVATE static void SetLineVisible( const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xLineProperties );
static void SetLineInvisible( const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xLineProperties );
diff --git a/chart2/source/inc/LinearRegressionCurveCalculator.hxx b/chart2/source/inc/LinearRegressionCurveCalculator.hxx
index 55147aa5874d..ad79a887c019 100644
--- a/chart2/source/inc/LinearRegressionCurveCalculator.hxx
+++ b/chart2/source/inc/LinearRegressionCurveCalculator.hxx
@@ -31,12 +31,11 @@
#define CHART2_LINEARREGRESSIONCURVECALCULATOR_HXX
#include "RegressionCurveCalculator.hxx"
-#include "charttoolsdllapi.hxx"
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS LinearRegressionCurveCalculator :
+class LinearRegressionCurveCalculator :
public RegressionCurveCalculator
{
public:
diff --git a/chart2/source/inc/LogarithmicRegressionCurveCalculator.hxx b/chart2/source/inc/LogarithmicRegressionCurveCalculator.hxx
index 2913d9401b98..b0274600d543 100644
--- a/chart2/source/inc/LogarithmicRegressionCurveCalculator.hxx
+++ b/chart2/source/inc/LogarithmicRegressionCurveCalculator.hxx
@@ -31,12 +31,11 @@
#define CHART2_LOGARITHMICREGRESSIONCURVECALCULATOR_HXX
#include "RegressionCurveCalculator.hxx"
-#include "charttoolsdllapi.hxx"
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS LogarithmicRegressionCurveCalculator :
+class LogarithmicRegressionCurveCalculator :
public RegressionCurveCalculator
{
public:
diff --git a/chart2/source/inc/MeanValueRegressionCurveCalculator.hxx b/chart2/source/inc/MeanValueRegressionCurveCalculator.hxx
index ea02d6a4fef5..8febb3d6078c 100644
--- a/chart2/source/inc/MeanValueRegressionCurveCalculator.hxx
+++ b/chart2/source/inc/MeanValueRegressionCurveCalculator.hxx
@@ -31,12 +31,11 @@
#define CHART2_MEANVALUEREGRESSIONCURVECALCULATOR_HXX
#include "RegressionCurveCalculator.hxx"
-#include "charttoolsdllapi.hxx"
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS MeanValueRegressionCurveCalculator :
+class MeanValueRegressionCurveCalculator :
public RegressionCurveCalculator
{
public:
diff --git a/chart2/source/inc/MediaDescriptorHelper.hxx b/chart2/source/inc/MediaDescriptorHelper.hxx
index 403c842fa45b..35cc90d30ca7 100644
--- a/chart2/source/inc/MediaDescriptorHelper.hxx
+++ b/chart2/source/inc/MediaDescriptorHelper.hxx
@@ -202,7 +202,7 @@ public:
sal_Bool ISSET_SetEmbedded;
protected:
- void impl_init();
+SAL_DLLPRIVATE void impl_init();
};
}
diff --git a/chart2/source/inc/ModifyListenerCallBack.hxx b/chart2/source/inc/ModifyListenerCallBack.hxx
index a664816930f8..92e7a778348c 100644
--- a/chart2/source/inc/ModifyListenerCallBack.hxx
+++ b/chart2/source/inc/ModifyListenerCallBack.hxx
@@ -53,11 +53,11 @@ public:
virtual ~ModifyListenerCallBack();
void startListening( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyBroadcaster >& xBroadcaster );
- void stopListening();
+ SAL_DLLPRIVATE void stopListening();
private: //methods
- ModifyListenerCallBack();
- ModifyListenerCallBack( const ModifyListenerCallBack& );
+ SAL_DLLPRIVATE ModifyListenerCallBack();
+ SAL_DLLPRIVATE ModifyListenerCallBack( const ModifyListenerCallBack& );
private: //member
ModifyListenerCallBack_impl* pModifyListener_impl;
diff --git a/chart2/source/inc/ModifyListenerHelper.hxx b/chart2/source/inc/ModifyListenerHelper.hxx
index 7c02d0356299..fa2977fd1b44 100644
--- a/chart2/source/inc/ModifyListenerHelper.hxx
+++ b/chart2/source/inc/ModifyListenerHelper.hxx
@@ -58,6 +58,8 @@ namespace chart
namespace ModifyListenerHelper
{
+OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > createModifyEventForwarder();
+
// ================================================================================
/** This helper class serves as forwarder of modify events. It can be used
@@ -68,7 +70,7 @@ namespace ModifyListenerHelper
life time of the listeners is independent of the broadcaster's lifetime in
this case.</p>
*/
-class OOO_DLLPUBLIC_CHARTTOOLS ModifyEventForwarder :
+class ModifyEventForwarder :
public MutexContainer,
public ::cppu::WeakComponentImplHelper2<
::com::sun::star::util::XModifyBroadcaster,
@@ -77,8 +79,6 @@ class OOO_DLLPUBLIC_CHARTTOOLS ModifyEventForwarder :
public:
ModifyEventForwarder();
- void FireEvent( const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XWeak > & xSource );
void FireEvent( const ::com::sun::star::lang::EventObject & rEvent );
void AddListener(
diff --git a/chart2/source/inc/NameContainer.hxx b/chart2/source/inc/NameContainer.hxx
index 104fd941f217..9a55884d9535 100644
--- a/chart2/source/inc/NameContainer.hxx
+++ b/chart2/source/inc/NameContainer.hxx
@@ -45,6 +45,9 @@ namespace chart
{
//.............................................................................
+OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > createNameContainer(
+ const ::com::sun::star::uno::Type& rType, const rtl::OUString& rServicename, const rtl::OUString& rImplementationName );
+
namespace impl
{
typedef ::cppu::WeakImplHelper3<
@@ -54,7 +57,7 @@ typedef ::cppu::WeakImplHelper3<
NameContainer_Base;
}
-class OOO_DLLPUBLIC_CHARTTOOLS NameContainer : public impl::NameContainer_Base
+class NameContainer : public impl::NameContainer_Base
{
public:
NameContainer( const ::com::sun::star::uno::Type& rType, const rtl::OUString& rServicename, const rtl::OUString& rImplementationName );
diff --git a/chart2/source/inc/OPropertySet.hxx b/chart2/source/inc/OPropertySet.hxx
index c2e54d41da5f..00517f87c61a 100644
--- a/chart2/source/inc/OPropertySet.hxx
+++ b/chart2/source/inc/OPropertySet.hxx
@@ -80,6 +80,8 @@ public:
protected:
explicit OPropertySet( const OPropertySet & rOther, ::osl::Mutex & rMutex );
+ void SetNewValuesExplicitlyEvenIfTheyEqualDefault();
+
/** implement this method to provide default values for all properties
supporting defaults. If a property does not have a default value, you
may throw an UnknownPropertyException.
@@ -311,6 +313,7 @@ private:
/// pImpl idiom implementation
::std::auto_ptr< impl::ImplOPropertySet > m_pImplProperties;
+ bool m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault;
};
} // namespace property
diff --git a/chart2/source/inc/ObjectIdentifier.hxx b/chart2/source/inc/ObjectIdentifier.hxx
index 973e896f846a..7793cd57d21e 100644
--- a/chart2/source/inc/ObjectIdentifier.hxx
+++ b/chart2/source/inc/ObjectIdentifier.hxx
@@ -124,13 +124,7 @@ public:
::com::sun::star::frame::XModel >& xChartModel
, sal_Int32 nSubIndex = -1 );//-1: main grid, 0: first subgrid etc
- static rtl::OUString createClassifiedIdentifierForAxis(
- 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 rtl::OUString createParticleForDiagram(
+ SAL_DLLPRIVATE static rtl::OUString createParticleForDiagram(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDiagram >& xDiagram
, const ::com::sun::star::uno::Reference<
@@ -195,7 +189,7 @@ public:
static rtl::OUString createDataCurveCID( const rtl::OUString& rSeriesParticle, sal_Int32 nCurveIndex, bool bAverageLine );
static rtl::OUString createDataCurveEquationCID( const rtl::OUString& rSeriesParticle, sal_Int32 nCurveIndex );
- static rtl::OUString getObjectID( const rtl::OUString& rCID );
+ SAL_DLLPRIVATE static rtl::OUString getObjectID( const rtl::OUString& rCID );
static rtl::OUString getParticleID( const rtl::OUString& rCID );
static rtl::OUString getFullParentParticle( const rtl::OUString& rCID );
diff --git a/chart2/source/inc/PotentialRegressionCurveCalculator.hxx b/chart2/source/inc/PotentialRegressionCurveCalculator.hxx
index ea3e621bf6e8..f5b8a7c7428f 100644
--- a/chart2/source/inc/PotentialRegressionCurveCalculator.hxx
+++ b/chart2/source/inc/PotentialRegressionCurveCalculator.hxx
@@ -37,7 +37,7 @@ namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS PotentialRegressionCurveCalculator :
+class PotentialRegressionCurveCalculator :
public RegressionCurveCalculator
{
public:
diff --git a/chart2/source/inc/RangeHighlighter.hxx b/chart2/source/inc/RangeHighlighter.hxx
index fa464743ae0c..caa424dc4f05 100644
--- a/chart2/source/inc/RangeHighlighter.hxx
+++ b/chart2/source/inc/RangeHighlighter.hxx
@@ -31,7 +31,6 @@
#define CHART2_RANGEHIGHLIGHTER_HXX
#include "MutexContainer.hxx"
-#include "charttoolsdllapi.hxx"
#include <cppuhelper/compbase2.hxx>
#include <com/sun/star/chart2/data/XRangeHighlighter.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
@@ -56,7 +55,7 @@ typedef ::cppu::WeakComponentImplHelper2<
RangeHighlighter_Base;
}
-class OOO_DLLPUBLIC_CHARTTOOLS RangeHighlighter :
+class RangeHighlighter :
public MutexContainer,
public impl::RangeHighlighter_Base
{
@@ -111,6 +110,7 @@ private:
::com::sun::star::uno::Sequence< ::com::sun::star::chart2::data::HighlightedRange >
m_aSelectedRanges;
sal_Int32 m_nAddedListenerCount;
+ bool m_bIncludeHiddenCells;
};
} // namespace chart
diff --git a/chart2/source/inc/ReferenceSizeProvider.hxx b/chart2/source/inc/ReferenceSizeProvider.hxx
index 6d8612d79f73..c6505c4d3796 100644
--- a/chart2/source/inc/ReferenceSizeProvider.hxx
+++ b/chart2/source/inc/ReferenceSizeProvider.hxx
@@ -64,7 +64,6 @@ public:
::com::sun::star::chart2::XChartDocument > & xChartDoc );
::com::sun::star::awt::Size getPageSize() const;
- bool useAutoScale() const;
/** Retrieves the state auto-resize from all objects that support this
feature. If all objects return the same state, AUTO_RESIZE_YES or
@@ -78,11 +77,6 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDoc );
- /** Retrieves the current auto-resize state from the internally set chart
- document
- */
- AutoResizeState getAutoResizeState() const;
-
/** sets or resets the auto-resize at all objects that support this feature
for text to the opposite of the current setting. If the current state
is ambiguous, it is turned on. If the current state is unknown it stays
@@ -90,16 +84,12 @@ public:
*/
void toggleAutoResizeState();
- /** sets the auto-resize at all objects that support this feature for text.
- eNewState must be either AUTO_RESIZE_YES or AUTO_RESIZE_NO
- */
- void setAutoResizeState( AutoResizeState eNewState );
/** Sets the ReferencePageSize according to the internal settings of this
class at the XPropertySet, and the adapted font sizes if bAdaptFontSizes
is </TRUE>.
*/
- void setValuesAtPropertySet(
+ SAL_DLLPRIVATE void setValuesAtPropertySet(
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > & xProp,
bool bAdaptFontSizes = true );
@@ -108,7 +98,7 @@ public:
class at the XTitle, and the adapted font sizes at the contained
XFormattedStrings
*/
- void setValuesAtTitle(
+ SAL_DLLPRIVATE void setValuesAtTitle(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XTitle > & xTitle );
@@ -118,6 +108,14 @@ public:
*/
void setValuesAtAllDataSeries();
+private:
+ SAL_DLLPRIVATE bool useAutoScale() const;
+
+ /** sets the auto-resize at all objects that support this feature for text.
+ eNewState must be either AUTO_RESIZE_YES or AUTO_RESIZE_NO
+ */
+ SAL_DLLPRIVATE void setAutoResizeState( AutoResizeState eNewState );
+
/** Retrieves the auto-resize state from the given propertyset. The result
will be put into eInOutState. If you initialize eInOutState with
AUTO_RESIZE_UNKNOWN, you will get the actual state. If you pass any
@@ -125,23 +123,15 @@ public:
esp. AUTO_RESIZE_AMBIGUOUS, if the value was NO before, and is YES for
the current property set, or the other way round.
*/
- static void getAutoResizeFromPropSet(
+ SAL_DLLPRIVATE static void getAutoResizeFromPropSet(
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > & xProp,
AutoResizeState & rInOutState );
- /** calls getAutoResizeFromPropSet with the title's property set
- */
- static void getAutoResizeFromTitle(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XTitle > & xTitle,
- AutoResizeState & rInOutState );
-
-private:
- void impl_setValuesAtTitled(
+ SAL_DLLPRIVATE void impl_setValuesAtTitled(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XTitled > & xTitled );
- static void impl_getAutoResizeFromTitled(
+ SAL_DLLPRIVATE static void impl_getAutoResizeFromTitled(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XTitled > & xTitled,
AutoResizeState & rInOutState );
diff --git a/chart2/source/inc/RegressionCurveCalculator.hxx b/chart2/source/inc/RegressionCurveCalculator.hxx
index 8ca8849c6bf0..0168ca2f57ba 100644
--- a/chart2/source/inc/RegressionCurveCalculator.hxx
+++ b/chart2/source/inc/RegressionCurveCalculator.hxx
@@ -34,12 +34,11 @@
#include <com/sun/star/chart2/XRegressionCurveCalculator.hpp>
#include <com/sun/star/util/XNumberFormatter.hpp>
-#include "charttoolsdllapi.hxx"
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS RegressionCurveCalculator : public
+class RegressionCurveCalculator : public
::cppu::WeakImplHelper1< ::com::sun::star::chart2::XRegressionCurveCalculator >
{
public:
diff --git a/chart2/source/inc/RegressionCurveHelper.hxx b/chart2/source/inc/RegressionCurveHelper.hxx
index 8cfe8b6f9ac8..7dbc9e33bf3d 100644
--- a/chart2/source/inc/RegressionCurveHelper.hxx
+++ b/chart2/source/inc/RegressionCurveHelper.hxx
@@ -49,14 +49,14 @@ class OOO_DLLPUBLIC_CHARTTOOLS RegressionCurveHelper
{
public:
/// returns a model mean-value line
- static ::com::sun::star::uno::Reference<
+ SAL_DLLPRIVATE static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XRegressionCurve >
createMeanValueLine(
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > & xContext );
/// returns a model regression curve
- static ::com::sun::star::uno::Reference<
+ SAL_DLLPRIVATE static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XRegressionCurve >
createRegressionCurveByServiceName(
const ::com::sun::star::uno::Reference<
@@ -151,6 +151,10 @@ public:
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XRegressionCurveContainer > & xRegCnt );
+ static void removeEquations(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XRegressionCurveContainer > & xRegCnt );
+
/** adds the given regression curve if there was none before. If there are
regression curves, the first one is replaced by the one given by the
type. All remaining curves are remnoved.
@@ -187,7 +191,7 @@ public:
If false, the sequence (1, 2, 3, ...) will always be used, even if
there is a data-sequence with role "values-x"
*/
- static void initializeCurveCalculator(
+ SAL_DLLPRIVATE static void initializeCurveCalculator(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XRegressionCurveCalculator > & xOutCurveCalculator,
const ::com::sun::star::uno::Reference<
@@ -225,6 +229,10 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XRegressionCurve > & xCurve );
+ static bool hasEquation(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XRegressionCurve > & xCurve );
+
private:
// not implemented
RegressionCurveHelper();
diff --git a/chart2/source/inc/RelativePositionHelper.hxx b/chart2/source/inc/RelativePositionHelper.hxx
index 628fd0fdd017..e8e7dde535b5 100644
--- a/chart2/source/inc/RelativePositionHelper.hxx
+++ b/chart2/source/inc/RelativePositionHelper.hxx
@@ -77,7 +77,7 @@ public:
been changed to the given one. The passed object size is taken into
account for shifting the position.
*/
- static ::com::sun::star::chart2::RelativePosition
+ SAL_DLLPRIVATE static ::com::sun::star::chart2::RelativePosition
getReanchoredPosition(
const ::com::sun::star::chart2::RelativePosition & rPosition,
const ::com::sun::star::chart2::RelativeSize & rObjectSize,
diff --git a/chart2/source/inc/RessourceManager.hxx b/chart2/source/inc/RessourceManager.hxx
index a0d12cf2ed07..6cefa1a23d02 100644
--- a/chart2/source/inc/RessourceManager.hxx
+++ b/chart2/source/inc/RessourceManager.hxx
@@ -38,7 +38,7 @@ class ResMgr;
namespace chart
{
-class OOO_DLLPUBLIC_CHARTTOOLS RessourceManager
+class RessourceManager
{
public:
static ::ResMgr & getRessourceManager();
diff --git a/chart2/source/inc/Scaling.hxx b/chart2/source/inc/Scaling.hxx
index 31b32cac65e9..8f5e83c5254e 100644
--- a/chart2/source/inc/Scaling.hxx
+++ b/chart2/source/inc/Scaling.hxx
@@ -30,7 +30,6 @@
#ifndef _CHART2_SCALING_HXX
#define _CHART2_SCALING_HXX
#include "ServiceMacros.hxx"
-#include "charttoolsdllapi.hxx"
#include <com/sun/star/chart2/XScaling.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
@@ -46,7 +45,7 @@ namespace chart
/**
*/
-class OOO_DLLPUBLIC_CHARTTOOLS LogarithmicScaling :
+class LogarithmicScaling :
public ::cppu::WeakImplHelper3 <
::com::sun::star::chart2::XScaling,
::com::sun::star::lang::XServiceName,
@@ -67,13 +66,12 @@ public:
APPHELPER_XSERVICEINFO_DECL()
// ____ XScaling ____
- virtual double SAL_CALL
- doScaling( double value )
+ virtual double SAL_CALL doScaling( double value )
throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference<
+ virtual ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XScaling > SAL_CALL
- getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
+ getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
// ____ XServiceName ____
virtual ::rtl::OUString SAL_CALL getServiceName()
@@ -88,7 +86,7 @@ private:
// ----------------------------------------
-class OOO_DLLPUBLIC_CHARTTOOLS ExponentialScaling :
+class ExponentialScaling :
public ::cppu::WeakImplHelper3 <
::com::sun::star::chart2::XScaling,
::com::sun::star::lang::XServiceName,
@@ -129,7 +127,7 @@ private:
// ----------------------------------------
-class OOO_DLLPUBLIC_CHARTTOOLS LinearScaling : public ::cppu::WeakImplHelper3 <
+class LinearScaling : public ::cppu::WeakImplHelper3 <
::com::sun::star::chart2::XScaling,
::com::sun::star::lang::XServiceName,
::com::sun::star::lang::XServiceInfo
@@ -150,13 +148,12 @@ public:
APPHELPER_XSERVICEINFO_DECL()
// ____ XScaling ____
- virtual double SAL_CALL
- doScaling( double value )
+ virtual double SAL_CALL doScaling( double value )
throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference<
+ virtual ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XScaling > SAL_CALL
- getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
+ getInverseScaling() throw (::com::sun::star::uno::RuntimeException);
// ____ XServiceName ____
virtual ::rtl::OUString SAL_CALL getServiceName()
@@ -171,7 +168,7 @@ private:
// ----------------------------------------
-class OOO_DLLPUBLIC_CHARTTOOLS PowerScaling : public ::cppu::WeakImplHelper3 <
+class PowerScaling : public ::cppu::WeakImplHelper3 <
::com::sun::star::chart2::XScaling,
::com::sun::star::lang::XServiceName,
::com::sun::star::lang::XServiceInfo
diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc
index 78b53e9807f4..fea8bb867057 100644
--- a/chart2/source/inc/Strings.hrc
+++ b/chart2/source/inc/Strings.hrc
@@ -33,7 +33,8 @@
// this includes no link dependency
#include <svtools/solar.hrc>
-//next is 281
+//next free is 290
+//single free is: 134
//#define RID_APP_START 30000
////#define STR_NULL (RID_APP_START + 1)
@@ -99,6 +100,7 @@
#define STR_STACKED (RID_APP_START + 11)
#define STR_PERCENT (RID_APP_START + 12)
#define STR_DEEP (RID_APP_START + 13)
+#define STR_FILLED (RID_APP_START + 285)
#define STR_DONUT (RID_APP_START + 8)
#define STR_TYPE_PIE (RID_APP_START + 187)
@@ -128,6 +130,9 @@
#define STR_STOCK_3 (RID_APP_START + 145)
#define STR_STOCK_4 (RID_APP_START + 146)
+#define STR_TYPE_BUBBLE (RID_APP_START + 282)
+#define STR_BUBBLE_1 (RID_APP_START + 283)
+
//-----------------------------------------------------------------------------
//additional controls for wizard:
@@ -149,7 +154,7 @@
#define STR_INDICATE_BOTH (RID_APP_START + 131)
#define STR_INDICATE_UP (RID_APP_START + 132)
#define STR_INDICATE_DOWN (RID_APP_START + 133)
-#define STR_REGRESSION_NONE (RID_APP_START + 134)
+
#define STR_REGRESSION_LINEAR (RID_APP_START + 135)
#define STR_REGRESSION_LOG (RID_APP_START + 136)
#define STR_REGRESSION_EXP (RID_APP_START + 137)
@@ -180,6 +185,7 @@
#define STR_DATA_ROLE_MIN (RID_APP_START + 248)
#define STR_DATA_ROLE_MAX (RID_APP_START + 249)
#define STR_DATA_ROLE_CATEGORIES (RID_APP_START + 260)
+#define STR_DATA_ROLE_SIZE (RID_APP_START + 284)
#define STR_DATA_UNNAMED_SERIES (RID_APP_START + 250)
#define STR_DATA_UNNAMED_SERIES_WITH_INDEX (RID_APP_START + 251)
@@ -225,8 +231,11 @@
#define STR_OBJECT_DATASERIES (RID_APP_START + 204)
#define STR_OBJECT_DATASERIES_PLURAL (RID_APP_START + 205)
+#define STR_OBJECT_FOR_SERIES (RID_APP_START + 288)
+#define STR_OBJECT_FOR_ALL_SERIES (RID_APP_START + 289)
+
#define STR_OBJECT_AVERAGE_LINE (RID_APP_START + 174)
-#define STR_OBJECT_ERROR_INDICATOR (RID_APP_START + 175)
+#define STR_OBJECT_ERROR_BARS (RID_APP_START + 175)
#define STR_OBJECT_CURVE (RID_APP_START + 176)
#define STR_OBJECT_CURVES (RID_APP_START + 130)
@@ -239,6 +248,9 @@
#define STR_OBJECT_AXIS_Y (RID_APP_START + 212)
#define STR_OBJECT_AXIS_Z (RID_APP_START + 213)
+#define STR_OBJECT_SECONDARY_X_AXIS (RID_APP_START + 286)
+#define STR_OBJECT_SECONDARY_Y_AXIS (RID_APP_START + 287)
+
#define STR_OBJECT_GRID (RID_APP_START + 214)
#define STR_OBJECT_GRIDS (RID_APP_START + 215)
@@ -262,7 +274,7 @@
#define STR_PAGE_BORDER (RID_APP_START + 217)
#define STR_PAGE_AREA (RID_APP_START + 218)
#define STR_PAGE_TRANSPARENCY (RID_APP_START + 219)
-#define STR_PAGE_CHARACTERS (RID_APP_START + 220)
+#define STR_PAGE_FONT (RID_APP_START + 220)
#define STR_PAGE_FONT_EFFECTS (RID_APP_START + 221)
#define STR_PAGE_LAYOUT (RID_APP_START + 222)
#define STR_PAGE_OPTIONS (RID_APP_START + 223)
@@ -287,6 +299,7 @@
#define STR_DLG_NUMBERFORMAT_FOR_PERCENTAGE_VALUE (RID_APP_START + 266)
#define STR_PAGE_POSITIONING (RID_APP_START + 277)
+#define STR_PAGE_ASIAN (RID_APP_START + 281)
//-----------------------------------------------------------------------------
//strings used as description for actions on toolbar icons, as tip help or for undo
diff --git a/chart2/source/inc/ThreeDHelper.hxx b/chart2/source/inc/ThreeDHelper.hxx
index cb860a193b73..62eaba4ffa77 100644
--- a/chart2/source/inc/ThreeDHelper.hxx
+++ b/chart2/source/inc/ThreeDHelper.hxx
@@ -105,7 +105,7 @@ public:
sal_Int32 nElevationDeg, sal_Int32 nRotationDeg
, double& rfXAngleRad, double& rfYAngleRad, double& rfZAngleRad );
- static void convertXYZAngleRadToElevationRotationDeg(
+ SAL_DLLPRIVATE static void convertXYZAngleRadToElevationRotationDeg(
sal_Int32& rnElevationDeg, sal_Int32& rnRotationDeg
, double fXRad, double fYRad, double fZRad );
@@ -116,8 +116,8 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet >& xSceneProperties
, double fCameraDistance );
- static void ensureCameraDistanceRange( double& rfCameraDistance );
- static void getCameraDistanceRange( double& rfMinimumDistance, double& rfMaximumDistance );
+ SAL_DLLPRIVATE static void ensureCameraDistanceRange( double& rfCameraDistance );
+ SAL_DLLPRIVATE static void getCameraDistanceRange( double& rfMinimumDistance, double& rfMaximumDistance );
static double CameraDistanceToPerspective( double fCameraDistance );
static double PerspectiveToCameraDistance( double fPerspective );
diff --git a/chart2/source/inc/UncachedDataSequence.hxx b/chart2/source/inc/UncachedDataSequence.hxx
index 6fedbdd1ba12..2a5e23602738 100644
--- a/chart2/source/inc/UncachedDataSequence.hxx
+++ b/chart2/source/inc/UncachedDataSequence.hxx
@@ -73,7 +73,7 @@ typedef ::cppu::WeakComponentImplHelper8<
UncachedDataSequence_Base;
}
-class OOO_DLLPUBLIC_CHARTTOOLS UncachedDataSequence :
+class UncachedDataSequence :
public ::comphelper::OMutexAndBroadcastHelper,
public ::comphelper::OPropertyContainer,
public ::comphelper::OPropertyArrayUsageHelper< UncachedDataSequence >,
@@ -186,8 +186,6 @@ protected:
// <properties>
sal_Int32 m_nNumberFormatKey;
::rtl::OUString m_sRole;
- sal_Bool m_bIsHidden;
- ::com::sun::star::uno::Sequence< sal_Int32 > m_aHiddenValues;
::rtl::OUString m_aXMLRange;
// </properties>
diff --git a/chart2/source/inc/UndoGuard.hxx b/chart2/source/inc/UndoGuard.hxx
index 98cffab939af..cdefdcd44c41 100644
--- a/chart2/source/inc/UndoGuard.hxx
+++ b/chart2/source/inc/UndoGuard.hxx
@@ -41,7 +41,7 @@ namespace chart
{
/** Base Class for UndoGuard and UndoLiveUpdateGuard
*/
-class OOO_DLLPUBLIC_CHARTTOOLS UndoGuard_Base
+class UndoGuard_Base
{
public:
explicit UndoGuard_Base( const rtl::OUString & rUndoMessage
@@ -51,7 +51,7 @@ public:
::com::sun::star::frame::XModel > & xModel );
virtual ~UndoGuard_Base();
- void commitAction();
+OOO_DLLPUBLIC_CHARTTOOLS void commitAction();
protected:
::com::sun::star::uno::Reference<
diff --git a/chart2/source/inc/UndoManager.hxx b/chart2/source/inc/UndoManager.hxx
index d8c1690963ff..6c71e668a2b5 100644
--- a/chart2/source/inc/UndoManager.hxx
+++ b/chart2/source/inc/UndoManager.hxx
@@ -32,7 +32,6 @@
#include "ConfigItemListener.hxx"
#include "MutexContainer.hxx"
-#include "charttoolsdllapi.hxx"
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -82,7 +81,7 @@ typedef ::cppu::WeakComponentImplHelper3<
redo-stacks support the css::util::XCloneable interface, which is
implemented such that the entire model is cloned.
*/
-class OOO_DLLPUBLIC_CHARTTOOLS UndoManager :
+class UndoManager :
public MutexContainer,
public ConfigItemListener,
public impl::UndoManager_Base
diff --git a/chart2/source/inc/WeakListenerAdapter.hxx b/chart2/source/inc/WeakListenerAdapter.hxx
index cd5f472c12a0..936e6e4ab4cf 100644
--- a/chart2/source/inc/WeakListenerAdapter.hxx
+++ b/chart2/source/inc/WeakListenerAdapter.hxx
@@ -36,7 +36,6 @@
#include <com/sun/star/view/XSelectionChangeListener.hpp>
#include <cppuhelper/weakref.hxx>
#include <cppuhelper/implbase1.hxx>
-#include "charttoolsdllapi.hxx"
namespace chart
{
@@ -94,7 +93,7 @@ private:
// --------------------------------------------------------------------------------
-class OOO_DLLPUBLIC_CHARTTOOLS WeakModifyListenerAdapter :
+class WeakModifyListenerAdapter :
public WeakListenerAdapter< ::com::sun::star::util::XModifyListener >
{
public:
@@ -110,7 +109,7 @@ protected:
// --------------------------------------------------------------------------------
-class OOO_DLLPUBLIC_CHARTTOOLS WeakSelectionChangeListenerAdapter :
+class WeakSelectionChangeListenerAdapter :
public WeakListenerAdapter< ::com::sun::star::view::XSelectionChangeListener >
{
public:
diff --git a/chart2/source/inc/WrappedIgnoreProperty.hxx b/chart2/source/inc/WrappedIgnoreProperty.hxx
index 168967aa7fbf..db45c5291a9a 100644
--- a/chart2/source/inc/WrappedIgnoreProperty.hxx
+++ b/chart2/source/inc/WrappedIgnoreProperty.hxx
@@ -52,13 +52,13 @@ public:
virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual void setPropertyToDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
+SAL_DLLPRIVATE virtual void setPropertyToDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
+SAL_DLLPRIVATE virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::beans::PropertyState getPropertyState( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
+SAL_DLLPRIVATE virtual ::com::sun::star::beans::PropertyState getPropertyState( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
protected:
@@ -72,8 +72,8 @@ public:
static void addIgnoreLineProperties( std::vector< WrappedProperty* >& rList );
static void addIgnoreFillProperties( std::vector< WrappedProperty* >& rList );
- static void addIgnoreFillProperties_without_BitmapProperties( std::vector< WrappedProperty* >& rList );
- static void addIgnoreFillProperties_only_BitmapProperties( std::vector< WrappedProperty* >& rList );
+ SAL_DLLPRIVATE static void addIgnoreFillProperties_without_BitmapProperties( std::vector< WrappedProperty* >& rList );
+ SAL_DLLPRIVATE static void addIgnoreFillProperties_only_BitmapProperties( std::vector< WrappedProperty* >& rList );
};
//.............................................................................
diff --git a/chart2/source/inc/WrappedPropertySet.hxx b/chart2/source/inc/WrappedPropertySet.hxx
index 99aaadcd3c11..3a6f19b06473 100644
--- a/chart2/source/inc/WrappedPropertySet.hxx
+++ b/chart2/source/inc/WrappedPropertySet.hxx
@@ -116,11 +116,11 @@ protected: //methods
virtual ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > getInnerPropertySet() = 0;
- ::com::sun::star::uno::Reference<
+ SAL_DLLPRIVATE ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertyState > getInnerPropertyState();
::cppu::IPropertyArrayHelper& getInfoHelper();
- tWrappedPropertyMap& getWrappedPropertyMap();
+ SAL_DLLPRIVATE tWrappedPropertyMap& getWrappedPropertyMap();
const WrappedProperty* getWrappedProperty( const ::rtl::OUString& rOuterName );
const WrappedProperty* getWrappedProperty( sal_Int32 nHandle );
diff --git a/chart2/source/inc/XMLRangeHelper.hxx b/chart2/source/inc/XMLRangeHelper.hxx
index 3e948c4567fc..32bb08f4a552 100644
--- a/chart2/source/inc/XMLRangeHelper.hxx
+++ b/chart2/source/inc/XMLRangeHelper.hxx
@@ -65,10 +65,8 @@ struct OOO_DLLPUBLIC_CHARTTOOLS CellRange
::rtl::OUString aTableName;
};
-OOO_DLLPUBLIC_CHARTTOOLS
CellRange getCellRangeFromXMLString( const ::rtl::OUString & rXMLString );
-OOO_DLLPUBLIC_CHARTTOOLS
::rtl::OUString getXMLStringFromCellRange( const CellRange & rRange );
diff --git a/chart2/source/inc/chartview/ChartSfxItemIds.hxx b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
index 3b281f8118dd..e4afc0d9efbd 100644
--- a/chart2/source/inc/chartview/ChartSfxItemIds.hxx
+++ b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
@@ -51,7 +51,8 @@
#define SCHATTR_DATADESCR_SEPARATOR (SCHATTR_DATADESCR_START + 4)
#define SCHATTR_DATADESCR_PLACEMENT (SCHATTR_DATADESCR_START + 5)
#define SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS (SCHATTR_DATADESCR_START + 6)
-#define SCHATTR_DATADESCR_END SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS
+#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_LEGEND_START (SCHATTR_DATADESCR_END + 1)
#define SCHATTR_LEGEND_POS SCHATTR_LEGEND_START
@@ -209,8 +210,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_CHARTTYPE_END SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS
+#define SCHATTR_CHARTTYPE_END SCHATTR_INCLUDE_HIDDEN_CELLS
// items for transporting information to dialogs
#define SCHATTR_MISC_START (SCHATTR_CHARTTYPE_END + 1)
diff --git a/chart2/source/inc/chartview/DrawModelWrapper.hxx b/chart2/source/inc/chartview/DrawModelWrapper.hxx
index 10ddc9657c7b..caec07d58a15 100644
--- a/chart2/source/inc/chartview/DrawModelWrapper.hxx
+++ b/chart2/source/inc/chartview/DrawModelWrapper.hxx
@@ -62,15 +62,15 @@ private:
DrawModelWrapper();
public:
- DrawModelWrapper(::com::sun::star::uno::Reference<
+ SAL_DLLPRIVATE DrawModelWrapper(::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > const & xContext );
- virtual ~DrawModelWrapper();
+ SAL_DLLPRIVATE virtual ~DrawModelWrapper();
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getShapeFactory();
// the main page will contain the normal view objects
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > getMainDrawPage();
- void clearMainDrawPage();
+ SAL_DLLPRIVATE void clearMainDrawPage();
// the extra page is not visible, but contains some extras like the symbols for data points
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > getHiddenDrawPage();
@@ -80,25 +80,25 @@ public:
::com::sun::star::drawing::XDrawPage>& xPage );
- void lockControllers();
- void unlockControllers();
+ SAL_DLLPRIVATE void lockControllers();
+ SAL_DLLPRIVATE void unlockControllers();
/// tries to get an OutputDevice from the XParent of the model to use as reference device
- void attachParentReferenceDevice(
+ SAL_DLLPRIVATE void attachParentReferenceDevice(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xChartModel );
OutputDevice* getReferenceDevice() const;
SfxItemPool& GetItemPool();
- const SfxItemPool& GetItemPool() const;
+ SAL_DLLPRIVATE const SfxItemPool& GetItemPool() const;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ SAL_DLLPRIVATE virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
createUnoModel();
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
+ SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
getUnoModel();
SdrModel& getSdrModel();
- void updateTablesFromChartModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
+ SAL_DLLPRIVATE void updateTablesFromChartModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
XColorTable* GetColorTable() const;
XDashList* GetDashList() const;
diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
index 645e25166594..ab94e7e1c337 100644
--- a/chart2/source/inc/chartview/ExplicitValueProvider.hxx
+++ b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
@@ -36,6 +36,7 @@
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include <com/sun/star/chart2/XDataSeries.hpp>
+#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/drawing/XShape.hpp>
@@ -91,16 +92,16 @@ 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 );
- static sal_Int32 getPercentNumberFormat( const ::com::sun::star::uno::Reference<
+ SAL_DLLPRIVATE static sal_Int32 getPercentNumberFormat( const ::com::sun::star::uno::Reference<
::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
- static sal_Int32 getExplicitNumberFormatKeyForLabel(
+ 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
, sal_Int32 nPointIndex /*-1 for whole series*/
- , const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xAttachedAxisProps );
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& xDiagram );
- static sal_Int32 getExplicitPercentageNumberFormatKeyForLabel(
+ static sal_Int32 getExplicitPercentageNumberFormatKeyForDataLabel(
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesOrPointProp
, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
};
diff --git a/chart2/source/inc/chartview/NumberFormatterWrapper.hxx b/chart2/source/inc/chartview/NumberFormatterWrapper.hxx
index 71a6f20acb0d..5077541abe2c 100644
--- a/chart2/source/inc/chartview/NumberFormatterWrapper.hxx
+++ b/chart2/source/inc/chartview/NumberFormatterWrapper.hxx
@@ -61,10 +61,11 @@ private: //private member
m_xNumberFormatsSupplier;
SvNumberFormatter* m_pNumberFormatter;
+ ::com::sun::star::uno::Any m_aNullDate;
};
-class OOO_DLLPUBLIC_CHARTVIEW FixedNumberFormatter
+class FixedNumberFormatter
{
public:
FixedNumberFormatter( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xSupplier
diff --git a/chart2/source/inc/servicenames_charttypes.hxx b/chart2/source/inc/servicenames_charttypes.hxx
index 461483b46e0d..1e824798fa66 100644
--- a/chart2/source/inc/servicenames_charttypes.hxx
+++ b/chart2/source/inc/servicenames_charttypes.hxx
@@ -42,7 +42,9 @@ namespace chart
#define CHART2_SERVICE_NAME_CHARTTYPE_SCATTER ::rtl::OUString::createFromAscii("com.sun.star.chart2.ScatterChartType")
#define CHART2_SERVICE_NAME_CHARTTYPE_PIE ::rtl::OUString::createFromAscii("com.sun.star.chart2.PieChartType")
#define CHART2_SERVICE_NAME_CHARTTYPE_NET ::rtl::OUString::createFromAscii("com.sun.star.chart2.NetChartType")
+#define CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET ::rtl::OUString::createFromAscii("com.sun.star.chart2.FilledNetChartType")
#define CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK ::rtl::OUString::createFromAscii("com.sun.star.chart2.CandleStickChartType")
+#define CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ::rtl::OUString::createFromAscii("com.sun.star.chart2.BubbleChartType")
//.............................................................................
} //namespace chart
diff --git a/chart2/source/model/inc/BaseCoordinateSystem.hxx b/chart2/source/model/inc/BaseCoordinateSystem.hxx
index afb0c5027f72..4afd4f6ff51f 100644
--- a/chart2/source/model/inc/BaseCoordinateSystem.hxx
+++ b/chart2/source/model/inc/BaseCoordinateSystem.hxx
@@ -33,7 +33,6 @@
#include "ServiceMacros.hxx"
#include "OPropertySet.hxx"
#include "MutexContainer.hxx"
-#include "ModifyListenerHelper.hxx"
#include <cppuhelper/implbase6.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
diff --git a/chart2/source/model/inc/DataSeries.hxx b/chart2/source/model/inc/DataSeries.hxx
index 387d69d1f9ab..e483cc96e5b5 100644
--- a/chart2/source/model/inc/DataSeries.hxx
+++ b/chart2/source/model/inc/DataSeries.hxx
@@ -111,6 +111,10 @@ protected:
SAL_CALL getDataPointByIndex( sal_Int32 nIndex )
throw (::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL resetDataPoint( sal_Int32 nIndex )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL resetAllDataPoints()
+ throw (::com::sun::star::uno::RuntimeException);
// ____ XDataSink ____
// ___________________
diff --git a/chart2/source/model/inc/Diagram.hxx b/chart2/source/model/inc/Diagram.hxx
index 283885866546..69e58bad0128 100644
--- a/chart2/source/model/inc/Diagram.hxx
+++ b/chart2/source/model/inc/Diagram.hxx
@@ -45,7 +45,6 @@
#include <com/sun/star/util/XModifyListener.hpp>
#include "ServiceMacros.hxx"
-#include "ModifyListenerHelper.hxx"
#include <map>
#include <vector>
diff --git a/chart2/source/model/inc/StockBar.hxx b/chart2/source/model/inc/StockBar.hxx
index 9f1b7aac9fc0..6db0c02b8959 100644
--- a/chart2/source/model/inc/StockBar.hxx
+++ b/chart2/source/model/inc/StockBar.hxx
@@ -37,7 +37,6 @@
#include "OPropertySet.hxx"
#include "ServiceMacros.hxx"
-#include "ModifyListenerHelper.hxx"
#include <cppuhelper/implbase3.hxx>
#include <comphelper/uno3.hxx>
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index d4a1cdff49e8..2b119c633537 100644
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -296,7 +296,7 @@ namespace chart
Axis::Axis( Reference< uno::XComponentContext > const & /* xContext */ ) :
::property::OPropertySet( m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()),
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
m_aScaleData( AxisHelper::createDefaultScale() ),
m_xGrid( new GridProperties() ),
m_aSubGridProperties(),
@@ -317,7 +317,7 @@ Axis::Axis( const Axis & rOther ) :
MutexContainer(),
impl::Axis_Base(),
::property::OPropertySet( rOther, m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()),
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
m_aScaleData( rOther.m_aScaleData )
{
m_xGrid.set( CloneHelper::CreateRefClone< Reference< beans::XPropertySet > >()( rOther.m_xGrid ));
diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx
index 6384964e7738..ebbffe2ef1eb 100644
--- a/chart2/source/model/main/BaseCoordinateSystem.cxx
+++ b/chart2/source/model/main/BaseCoordinateSystem.cxx
@@ -113,7 +113,7 @@ BaseCoordinateSystem::BaseCoordinateSystem(
sal_Bool bSwapXAndYAxis /* = sal_False */ ) :
::property::OPropertySet( m_aMutex ),
m_xContext( xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()),
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
m_nDimensionCount( nDimensionCount )
{
m_aAllAxis.resize( m_nDimensionCount );
@@ -154,7 +154,7 @@ BaseCoordinateSystem::BaseCoordinateSystem(
MutexContainer(),
::property::OPropertySet( rSource, m_aMutex ),
m_xContext( rSource.m_xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()),
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
m_nDimensionCount( rSource.m_nDimensionCount ),
m_aOrigin( rSource.m_aOrigin )
{
diff --git a/chart2/source/model/main/ChartData.cxx b/chart2/source/model/main/ChartData.cxx
index b17c0e27bb16..af332f6c3c6e 100644
--- a/chart2/source/model/main/ChartData.cxx
+++ b/chart2/source/model/main/ChartData.cxx
@@ -32,7 +32,10 @@
#include "precompiled_chart2.hxx"
#include "ChartData.hxx"
-#include "InternalDataProvider.hxx"
+#include "ChartModelHelper.hxx"
+
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
using namespace ::com::sun::star;
@@ -45,7 +48,8 @@ namespace chart
ChartData::ChartData( const Reference< uno::XComponentContext > & xContext ) :
m_xContext( xContext ),
- m_pInternalDataProvider( 0 )
+ m_xDataProvider( 0 ),
+ m_xInternalDataProvider( 0 )
{}
ChartData::~ChartData()
@@ -55,7 +59,7 @@ void ChartData::setDataProvider(
const Reference< chart2::data::XDataProvider > & xDataProvider ) throw()
{
m_xDataProvider.set( xDataProvider );
- m_pInternalDataProvider = 0;
+ m_xInternalDataProvider.clear();
}
Reference< chart2::data::XDataProvider > ChartData::getDataProvider() const throw()
@@ -70,25 +74,32 @@ bool ChartData::createInternalData(
return false;
if( bCloneOldData )
- m_pInternalDataProvider = new InternalDataProvider( xChartDoc );
+ m_xInternalDataProvider = ChartModelHelper::createInternalDataProvider( xChartDoc );
else
- m_pInternalDataProvider = new InternalDataProvider();
+ m_xInternalDataProvider = ChartModelHelper::createInternalDataProvider();
- m_xDataProvider.set( m_pInternalDataProvider );
+ m_xDataProvider.set( m_xInternalDataProvider );
return true;
}
bool ChartData::hasInternalData() const
{
- return (m_xDataProvider.is() && m_pInternalDataProvider != 0);
+ return (m_xDataProvider.is() && m_xInternalDataProvider.is());
}
bool ChartData::createDefaultData() throw()
{
if( hasInternalData() )
{
- m_pInternalDataProvider->createDefaultData();
- return true;
+ uno::Reference< lang::XInitialization > xIni(m_xInternalDataProvider,uno::UNO_QUERY);
+ if ( xIni.is() )
+ {
+ uno::Sequence< uno::Any > aArgs(1);
+ beans::NamedValue aParam(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDefaultData")),uno::makeAny(sal_True));
+ aArgs[0] <<= aParam;
+ xIni->initialize(aArgs);
+ return true;
+ }
}
return false;
}
diff --git a/chart2/source/model/main/ChartData.hxx b/chart2/source/model/main/ChartData.hxx
index f13971f67629..308db5ab0f6a 100644
--- a/chart2/source/model/main/ChartData.hxx
+++ b/chart2/source/model/main/ChartData.hxx
@@ -58,8 +58,6 @@ namespace com { namespace sun { namespace star {
namespace chart
{
-class InternalDataProvider;
-
class ChartData
{
public:
@@ -93,15 +91,12 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider >
m_xDataProvider;
+
/** is only valid if m_xDataProvider is set. If m_xDataProvider is set to an
- external data provider this pointer must be set to 0
+ external data provider this reference must be set to 0
*/
- InternalDataProvider * m_pInternalDataProvider;
-
-// ::com::sun::star::uno::Reference<
-// ::com::sun::star::embed::XEmbeddedClient > m_xInternalData;
-// /// is only valid if m_xInternalData exists
-// InternalData * m_pInternalData;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider >
+ m_xInternalDataProvider;
};
} // namespace chart
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 49551bf78c7c..4882ecef72de 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -39,10 +39,12 @@
#include "servicenames.hxx"
#include "DataSourceHelper.hxx"
#include "NoWarningThisInCTOR.hxx"
-#include "RangeHighlighter.hxx"
+#include "ChartModelHelper.hxx"
#include "DisposeHelper.hxx"
#include "ControllerLockGuard.hxx"
#include "ObjectIdentifier.hxx"
+#include "ChartModelHelper.hxx"
+
#include <comphelper/InlineContainer.hxx>
#include <comphelper/processfactory.hxx>
@@ -703,6 +705,19 @@ sal_Bool SAL_CALL ChartModel::hasInternalDataProvider()
{
// /--
MutexGuard aGuard( m_aModelMutex );
+ uno::Reference< beans::XPropertySet > xProp( xProvider, uno::UNO_QUERY );
+ if( xProp.is() )
+ {
+ try
+ {
+ sal_Bool bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( Reference< frame::XModel >(this) );
+ xProp->setPropertyValue(C2U("IncludeHiddenCells"), uno::makeAny(bIncludeHiddenCells));
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ }
+ }
+
m_pImplChartModel->SetDataProvider( xProvider );
// \--
}
@@ -769,7 +784,7 @@ sal_Bool SAL_CALL ChartModel::hasInternalDataProvider()
{
uno::Reference< view::XSelectionSupplier > xSelSupp( this->getCurrentController(), uno::UNO_QUERY );
if( xSelSupp.is() )
- m_xRangeHighlighter.set( new RangeHighlighter( xSelSupp ));
+ m_xRangeHighlighter.set( ChartModelHelper::createRangeHighlighter( xSelSupp ));
}
return m_xRangeHighlighter;
}
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx
index d720443270d2..2e317ba7a0db 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -37,6 +37,7 @@
#include "ChartDebugTrace.hxx"
#include "macros.hxx"
#include "ChartViewHelper.hxx"
+#include "ChartModelHelper.hxx"
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XImporter.hpp>
@@ -407,6 +408,7 @@ void SAL_CALL ChartModel::initNew()
try
{
m_pImplChartModel->CreateDefaultChart();
+ ChartModelHelper::setIncludeHiddenCells( false, this );
}
catch( uno::Exception & ex )
{
diff --git a/chart2/source/model/main/DataPoint.cxx b/chart2/source/model/main/DataPoint.cxx
index 57680c4c15e7..983ba72080c1 100644
--- a/chart2/source/model/main/DataPoint.cxx
+++ b/chart2/source/model/main/DataPoint.cxx
@@ -90,17 +90,21 @@ namespace chart
DataPoint::DataPoint( const uno::Reference< beans::XPropertySet > & rParentProperties ) :
::property::OPropertySet( m_aMutex ),
m_xParentProperties( rParentProperties ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()),
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
m_bNoParentPropAllowed( false )
-{}
+{
+ SetNewValuesExplicitlyEvenIfTheyEqualDefault();
+}
DataPoint::DataPoint( const DataPoint & rOther ) :
MutexContainer(),
impl::DataPoint_Base(),
::property::OPropertySet( rOther, m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()),
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
m_bNoParentPropAllowed( true )
{
+ SetNewValuesExplicitlyEvenIfTheyEqualDefault();
+
// m_xParentProperties has to be set from outside, like in the method
// DataSeries::createClone
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index 8e80bc1e8a47..a748d04d4b64 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -332,6 +332,13 @@ void DataPointProperties::AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
+ rOutProperties.push_back(
+ Property( C2U( "TextRotation" ),
+ PROP_DATAPOINT_TEXT_ROTATION,
+ ::getCppuType( reinterpret_cast< const double * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
// statistics
rOutProperties.push_back(
Property( C2U( "ErrorBarX" ),
@@ -427,6 +434,8 @@ void DataPointProperties::AddDefaultsToMap(
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_ERROR_BAR_X, uno::Reference< beans::XPropertySet >());
PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_ERROR_BAR_Y, uno::Reference< beans::XPropertySet >());
PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_DATAPOINT_PERCENT_DIAGONAL, 0 );
+
+ PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_DATAPOINT_TEXT_ROTATION, 0.0 );
}
} // namespace chart
diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx
index 02d41b734503..6482adaa8679 100644
--- a/chart2/source/model/main/DataPointProperties.hxx
+++ b/chart2/source/model/main/DataPointProperties.hxx
@@ -77,6 +77,7 @@ public:
PROP_DATAPOINT_PERCENTAGE_NUMBER_FORMAT,
PROP_DATAPOINT_LABEL_PLACEMENT,
PROP_DATAPOINT_REFERENCE_DIAGRAM_SIZE,
+ PROP_DATAPOINT_TEXT_ROTATION,
// statistics
PROP_DATAPOINT_ERROR_BAR_X,
diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx
index 5324c1eaae5c..0d76aab40366 100644
--- a/chart2/source/model/main/DataSeries.cxx
+++ b/chart2/source/model/main/DataSeries.cxx
@@ -136,7 +136,7 @@ namespace chart
DataSeries::DataSeries( const uno::Reference< uno::XComponentContext > & xContext ) :
::property::OPropertySet( m_aMutex ),
m_xContext( xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
}
@@ -145,7 +145,7 @@ DataSeries::DataSeries( const DataSeries & rOther ) :
impl::DataSeries_Base(),
::property::OPropertySet( rOther, m_aMutex ),
m_xContext( rOther.m_xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
if( ! rOther.m_aDataSequences.empty())
{
@@ -419,6 +419,31 @@ Reference< beans::XPropertySet >
// \--
}
+void SAL_CALL DataSeries::resetDataPoint( sal_Int32 nIndex )
+ throw (uno::RuntimeException)
+{
+ MutexGuard aGuard( GetMutex() );
+ tDataPointAttributeContainer::iterator aIt( m_aAttributedDataPoints.find( nIndex ));
+ if( aIt != m_aAttributedDataPoints.end())
+ {
+ Reference< beans::XPropertySet > xDataPointProp( (*aIt).second );
+ Reference< util::XModifyBroadcaster > xBroadcaster( xDataPointProp, uno::UNO_QUERY );
+ if( xBroadcaster.is() && m_xModifyEventForwarder.is())
+ xBroadcaster->removeModifyListener( m_xModifyEventForwarder );
+ m_aAttributedDataPoints.erase(aIt);
+ fireModifyEvent();
+ }
+}
+
+void SAL_CALL DataSeries::resetAllDataPoints()
+ throw (uno::RuntimeException)
+{
+ MutexGuard aGuard( GetMutex() );
+ ModifyListenerHelper::removeListenerFromAllMapElements( m_aAttributedDataPoints, m_xModifyEventForwarder );
+ m_aAttributedDataPoints.clear();
+ fireModifyEvent();
+}
+
// ____ XDataSink ____
void SAL_CALL DataSeries::setData( const uno::Sequence< Reference< chart2::data::XLabeledDataSequence > >& aData )
throw (uno::RuntimeException)
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index 1718ddb1646d..3e8c8ea9cd24 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -78,6 +78,7 @@ enum
PROP_DIAGRAM_SORT_BY_X_VALUES,
PROP_DIAGRAM_CONNECT_BARS,
PROP_DIAGRAM_GROUP_BARS_PER_AXIS,
+ PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
PROP_DIAGRAM_STARTING_ANGLE,
PROP_DIAGRAM_RIGHT_ANGLED_AXES,
PROP_DIAGRAM_PERSPECTIVE,
@@ -125,6 +126,13 @@ void lcl_AddPropertiesToVector(
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
+ Property( C2U("IncludeHiddenCells"),
+ PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
Property( C2U( "StartingAngle" ),
PROP_DIAGRAM_STARTING_ANGLE,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0) ),
@@ -170,6 +178,7 @@ void lcl_AddDefaultsToMap(
::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 );
}
@@ -241,7 +250,7 @@ namespace chart
Diagram::Diagram( uno::Reference< uno::XComponentContext > const & xContext ) :
::property::OPropertySet( m_aMutex ),
m_xContext( xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
// Set camera position to a default position (that should be set hard, so
// that it will be exported. The property default is a camera looking
@@ -257,7 +266,7 @@ Diagram::Diagram( const Diagram & rOther ) :
impl::Diagram_Base(),
::property::OPropertySet( rOther, m_aMutex ),
m_xContext( rOther.m_xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
lcl_tCooSysMapping aCooSysMapping =
lcl_CloneCoordinateSystems( rOther.m_aCoordSystems, m_aCoordSystems );
@@ -352,7 +361,7 @@ Reference< chart2::XColorScheme > SAL_CALL Diagram::getDefaultColorScheme()
{
if( ! m_xColorScheme.is())
{
- m_xColorScheme.set( new ConfigColorScheme( m_xContext ));
+ m_xColorScheme.set( createConfigColorScheme( m_xContext ));
}
return m_xColorScheme;
}
diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx
index a2175b68a1da..e0d565bdb187 100644
--- a/chart2/source/model/main/FormattedString.cxx
+++ b/chart2/source/model/main/FormattedString.cxx
@@ -91,7 +91,7 @@ FormattedString::FormattedString(
uno::Reference< uno::XComponentContext > const & /* xContext */ ) :
::property::OPropertySet( m_aMutex ),
m_aString(),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
FormattedString::FormattedString( const FormattedString & rOther ) :
@@ -99,7 +99,7 @@ FormattedString::FormattedString( const FormattedString & rOther ) :
impl::FormattedString_Base(),
::property::OPropertySet( rOther, m_aMutex ),
m_aString( rOther.m_aString ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
FormattedString::~FormattedString()
diff --git a/chart2/source/model/main/GridProperties.cxx b/chart2/source/model/main/GridProperties.cxx
index 590aed34339b..4f48d16886b1 100644
--- a/chart2/source/model/main/GridProperties.cxx
+++ b/chart2/source/model/main/GridProperties.cxx
@@ -128,20 +128,20 @@ namespace chart
GridProperties::GridProperties( Reference< uno::XComponentContext > const & /* xContext */ ) :
::property::OPropertySet( m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
}
GridProperties::GridProperties() :
::property::OPropertySet( m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
GridProperties::GridProperties( const GridProperties & rOther ) :
MutexContainer(),
impl::GridProperties_Base(),
::property::OPropertySet( rOther, m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
}
diff --git a/chart2/source/model/main/ImplChartModel.cxx b/chart2/source/model/main/ImplChartModel.cxx
index bd4ad5630cb2..87383dcf5817 100644
--- a/chart2/source/model/main/ImplChartModel.cxx
+++ b/chart2/source/model/main/ImplChartModel.cxx
@@ -40,7 +40,7 @@
#include "ModifyListenerHelper.hxx"
#include "DataSourceHelper.hxx"
#include "DisposeHelper.hxx"
-#include "UndoManager.hxx"
+#include "ChartModelHelper.hxx"
#include "ThreeDHelper.hxx"
#include "AxisHelper.hxx"
@@ -112,19 +112,19 @@ ImplChartModel::ImplChartModel(
m_spChartData( new ChartData( m_xContext )),
m_bIsDisposed( false ),
m_xPageBackground( new PageBackground( m_xContext )),
- m_xUndoManager( new UndoManager()),
- m_xDashTable( new NameContainer( ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)),
+ m_xUndoManager( ChartModelHelper::createUndoManager() ),
+ m_xDashTable( createNameContainer( ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)),
C2U( "com.sun.star.drawing.DashTable" ), C2U( "com.sun.star.comp.chart.DashTable" ) )),
- m_xGradientTable( new NameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
+ m_xGradientTable( createNameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
C2U( "com.sun.star.drawing.GradientTable" ), C2U( "com.sun.star.comp.chart.GradientTable" ) )),
- m_xHatchTable( new NameContainer( ::getCppuType( reinterpret_cast< const drawing::Hatch * >(0)),
+ m_xHatchTable( createNameContainer( ::getCppuType( reinterpret_cast< const drawing::Hatch * >(0)),
C2U( "com.sun.star.drawing.HatchTable" ), C2U( "com.sun.star.comp.chart.HatchTable" ) )),
- m_xBitmapTable( new NameContainer( ::getCppuType( reinterpret_cast< const OUString * >(0)), // URL
+ m_xBitmapTable( createNameContainer( ::getCppuType( reinterpret_cast< const OUString * >(0)), // URL
C2U( "com.sun.star.drawing.BitmapTable" ), C2U( "com.sun.star.comp.chart.BitmapTable" ) )),
- m_xTransparencyGradientTable( new NameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
+ m_xTransparencyGradientTable( createNameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
C2U( "com.sun.star.drawing.TransparencyGradientTable" ), C2U( "com.sun.star.comp.chart.TransparencyGradientTable" ) )),
- m_xXMLNamespaceMap( new NameContainer( ::getCppuType( (const OUString*) 0 ),
- C2U( "com.sun.star.xml.NamespaceMap" ), C2U( "com.sun.star.comp.chart.XMLNameSpaceMap" ) )),
+ m_xXMLNamespaceMap( createNameContainer( ::getCppuType( (const OUString*) 0 ),
+ C2U( "com.sun.star.xml.NamespaceMap" ), C2U( "com.sun.star.comp.chart.XMLNameSpaceMap" ) ), uno::UNO_QUERY),
m_xModifyListener( xListener )
{
ModifyListenerHelper::addListener( m_xPageBackground, m_xModifyListener );
diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx
index 9f501b41ef63..3f7f66d23950 100644
--- a/chart2/source/model/main/Legend.cxx
+++ b/chart2/source/model/main/Legend.cxx
@@ -166,7 +166,7 @@ namespace chart
Legend::Legend( Reference< uno::XComponentContext > const & /* xContext */ ) :
::property::OPropertySet( m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
}
@@ -174,7 +174,7 @@ Legend::Legend( const Legend & rOther ) :
MutexContainer(),
impl::Legend_Base(),
::property::OPropertySet( rOther, m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
CloneHelper::CloneRefVector< Reference< chart2::XLegendEntry > >( rOther.m_aLegendEntries, m_aLegendEntries );
ModifyListenerHelper::addListenerToAllElements( m_aLegendEntries, m_xModifyEventForwarder );
diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx
index 5a16e30a3733..07def9bf496c 100644
--- a/chart2/source/model/main/PageBackground.cxx
+++ b/chart2/source/model/main/PageBackground.cxx
@@ -108,7 +108,7 @@ namespace chart
PageBackground::PageBackground( const uno::Reference< uno::XComponentContext > & xContext ) :
::property::OPropertySet( m_aMutex ),
m_xContext( xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
PageBackground::PageBackground( const PageBackground & rOther ) :
@@ -116,7 +116,7 @@ PageBackground::PageBackground( const PageBackground & rOther ) :
impl::PageBackground_Base(),
::property::OPropertySet( rOther, m_aMutex ),
m_xContext( rOther.m_xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
PageBackground::~PageBackground()
diff --git a/chart2/source/model/main/RectangularDataSource.cxx b/chart2/source/model/main/RectangularDataSource.cxx
deleted file mode 100644
index edd852927300..000000000000
--- a/chart2/source/model/main/RectangularDataSource.cxx
+++ /dev/null
@@ -1,297 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: RectangularDataSource.cxx,v $
- * $Revision: 1.6 $
- *
- * 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 "RectangularDataSource.hxx"
-#include "CachedDataSequence.hxx"
-#include "StandardNaNHelper.hxx"
-#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
-#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-
-using namespace ::com::sun::star;
-
-using ::rtl::OUString;
-using ::osl::MutexGuard;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::beans::Property;
-using ::com::sun::star::uno::RuntimeException;
-using ::com::sun::star::uno::Any;
-using ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT;
-
-// necessary for MS compiler
-using ::comphelper::OPropertyContainer;
-using ::chart::impl::RectangularDataSource_Base;
-
-// ________________________________________
-
-// Property-Ids
-
-namespace
-{
-enum
-{
- PROP_SOURCE_RANGE,
- PROP_DATA_ROW_SOURCE
-};
-} // anonymous namespace
-
-
-// ________________________________________
-
-namespace chart
-{
-
-#define STANDARD_PROPERTY_ATTRIBUTES ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT
-
-RectangularDataSource::RectangularDataSource( uno::Reference< uno::XComponentContext > const & xContext )
- : OPropertyContainer( GetBroadcastHelper() ),
- RectangularDataSource_Base( GetMutex() ),
- m_aDataRowSource( ::com::sun::star::chart::ChartDataRowSource_COLUMNS )
-{
- registerProperty( C2U( "SourceRange" ),
- PROP_SOURCE_RANGE, // Handle for fast access
- 0, // PropertyAttributes
- & m_aSourceRange, // pointer to corresponding member
- ::getCppuType( & m_aSourceRange ) // Type of property
- );
-
- registerProperty( C2U( "DataRowSource" ),
- PROP_DATA_ROW_SOURCE, // Handle for fast access
- MAYBEDEFAULT, // PropertyAttributes
- & m_aDataRowSource, // pointer to corresponding member
- ::getCppuType( & m_aDataRowSource ) // Type of property
- );
-}
-
-RectangularDataSource::~RectangularDataSource()
-{}
-
-// base for XServiceInfo
-Sequence< OUString > RectangularDataSource::getSupportedServiceNames_Static()
-{
- Sequence< OUString > aServices( 4 );
- aServices[ 0 ] = C2U( "com.sun.star.chart2.RectangularDataSource" );
- aServices[ 1 ] = C2U( "com.sun.star.chart2.data.DataFilter" );
- aServices[ 2 ] = C2U( "com.sun.star.chart2.data.DataSource" );
- aServices[ 3 ] = C2U( "com.sun.star.chart2.data.DataSink" );
- return aServices;
-}
-
-// ____ XDataSink ____
-void SAL_CALL RectangularDataSource::setData( const uno::Sequence< Reference< chart2::data::XDataSequence > >& aData )
- throw (RuntimeException)
-{
- m_aDataSequences = aData;
-}
-
-// ____ XDataSource ____
-uno::Sequence< Reference< chart2::data::XDataSequence > > SAL_CALL RectangularDataSource::getDataSequences()
- throw (RuntimeException)
-{
- return m_aDataSequences;
-}
-
-double SAL_CALL RectangularDataSource::getNotANumber()
- throw (uno::RuntimeException)
-{
- return StandardNaNHelper::getNotANumber();
-}
-
-sal_Bool SAL_CALL RectangularDataSource::isNotANumber( double fNumber )
- throw (uno::RuntimeException)
-{
- return StandardNaNHelper::isNotANumber( fNumber );
-}
-
-// ____ XIndexAccess ____
- sal_Int32 SAL_CALL RectangularDataSource::getCount()
- throw (RuntimeException)
-{
- // /--
- MutexGuard aGuard( GetMutex() );
- return m_aDataSequences.getLength();
- // \--
-}
-
- Any SAL_CALL RectangularDataSource::getByIndex( sal_Int32 Index )
- throw (lang::IndexOutOfBoundsException,
- lang::WrappedTargetException,
- RuntimeException)
-{
- // /--
- MutexGuard aGuard( GetMutex() );
- return uno::makeAny( GetDataByIndex( Index ) );
- // \--
-}
-
-// ____ XElementAccess (base of XIndexAccess) ____
- uno::Type SAL_CALL RectangularDataSource::getElementType()
- throw (RuntimeException)
-{
- return ::getCppuType((const Reference< chart2::data::XDataSequence >*)0);
-}
-
-sal_Bool SAL_CALL RectangularDataSource::hasElements()
- throw (RuntimeException)
-{
- // /--
- MutexGuard aGuard( GetMutex() );
- return static_cast< sal_Bool >( m_aDataSequences.getLength() > 0 );
- // \--
-}
-
-Reference< chart2::data::XDataSequence > RectangularDataSource::GetDataByIndex( sal_Int32 Index ) const
- throw (lang::IndexOutOfBoundsException)
-{
- if( 0 > Index || Index >= m_aDataSequences.getLength() )
- throw lang::IndexOutOfBoundsException();
-
- return m_aDataSequences.getConstArray() [ Index ];
-}
-
-void SAL_CALL RectangularDataSource::setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const Any& rValue )
- throw (uno::Exception)
-{
- // at this point it is clear that rValue contains a different value than the
- // property currently still has, and that it will be overwritten by it in
- // the final base class call
-
- switch( nHandle )
- {
- case PROP_DATA_ROW_SOURCE:
- {
- ::com::sun::star::chart::ChartDataRowSource aRowSource;
- if( rValue >>= aRowSource )
- {
- if( aRowSource != m_aDataRowSource )
- {
- SwapData();
- }
- }
- }
- break;
- }
-
- OPropertyContainer::setFastPropertyValue_NoBroadcast( nHandle, rValue );
-}
-
-// ================================================================================
-
-using impl::RectangularDataSource_Base;
-
-IMPLEMENT_FORWARD_XINTERFACE2( RectangularDataSource, RectangularDataSource_Base, OPropertyContainer )
-IMPLEMENT_FORWARD_XTYPEPROVIDER2( RectangularDataSource, RectangularDataSource_Base, OPropertyContainer )
-
-// ____ XPropertySet ____
-Reference< beans::XPropertySetInfo > SAL_CALL RectangularDataSource::getPropertySetInfo()
- throw(RuntimeException)
-{
- return Reference< beans::XPropertySetInfo >( createPropertySetInfo( getInfoHelper() ) );
-}
-
-// ____ ::comphelper::OPropertySetHelper ____
-// __________________________________________
-::cppu::IPropertyArrayHelper& RectangularDataSource::getInfoHelper()
-{
- return *getArrayHelper();
-}
-
-// ____ ::comphelper::OPropertyArrayHelper ____
-// ____________________________________________
-::cppu::IPropertyArrayHelper* RectangularDataSource::createArrayHelper() const
-{
- Sequence< Property > aProps;
- // describes all properties which have been registered in the ctor
- describeProperties( aProps );
-
- return new ::cppu::OPropertyArrayHelper( aProps );
-}
-
-// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
-APPHELPER_XSERVICEINFO_IMPL( RectangularDataSource,
- C2U( "com.sun.star.comp.chart.RectangularDataSource" ))
-
-void RectangularDataSource::SwapData()
-{
- try
- {
- // assume that there are always text labels
- Reference< chart2::data::XTextualDataSequence > xCategories( GetDataByIndex( 0 ), uno::UNO_QUERY );
-
- // -1: the first sequence contains labels
- sal_Int32 nNewSequenceSize = m_aDataSequences.getLength() - 1;
- if( nNewSequenceSize > 0 )
- {
- // +1: one series more for labels
- sal_Int32 nNewNumOfSequences = GetDataByIndex( 0 )->getData().getLength() + 1;
- Sequence< Reference< chart2::data::XDataSequence > > aResult( nNewNumOfSequences );
- ::std::vector< OUString > aCategoryVector( nNewSequenceSize );
- sal_Int32 nIdx = 0;
-
- // fill new categories consisting of former labels
- for( nIdx = 0; nIdx < nNewSequenceSize; ++nIdx )
- {
- aCategoryVector.push_back( GetDataByIndex( nIdx )->getLabel() );
- }
- aResult[ 0 ] = Reference< chart2::data::XDataSequence >(
- static_cast< chart2::data::XTextualDataSequence * >(
- new ::chart::CachedDataSequence( aCategoryVector )));
-
- // fill new data sequences. The label is set by the former categories
- for( sal_Int32 nSeqIdx = 1; nSeqIdx < nNewNumOfSequences; ++ nSeqIdx )
- {
- ::std::vector< double > aDataVector( nNewSequenceSize );
- for( nIdx = 0; nIdx < nNewSequenceSize; ++nIdx )
- {
- aDataVector.push_back(
- Reference< chart2::data::XNumericalDataSequence >(
- GetDataByIndex( nIdx ),
- uno::UNO_QUERY )->getNumericalData().getConstArray()[ nSeqIdx - 1 ] );
- }
- aResult[ nSeqIdx ] = Reference< chart2::data::XDataSequence >(
- static_cast< chart2::data::XNumericalDataSequence * >(
- new ::chart::CachedDataSequence( aDataVector )));
- }
-
- setData( aResult );
- }
- }
- catch( lang::IndexOutOfBoundsException aEx )
- {
- }
-}
-
-} // namespace chart
diff --git a/chart2/source/model/main/StockBar.cxx b/chart2/source/model/main/StockBar.cxx
index 68f4e8a6d4f0..5edaf6a606d8 100644
--- a/chart2/source/model/main/StockBar.cxx
+++ b/chart2/source/model/main/StockBar.cxx
@@ -38,6 +38,7 @@
#include "PropertyHelper.hxx"
#include "macros.hxx"
#include "ContainerHelper.hxx"
+#include "ModifyListenerHelper.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -110,7 +111,7 @@ namespace chart
StockBar::StockBar( bool bRisingCourse ) :
::property::OPropertySet( m_aMutex ),
m_bRisingCourse( bRisingCourse ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
if( ! m_bRisingCourse )
{
@@ -128,7 +129,7 @@ StockBar::StockBar( const StockBar & rOther ) :
impl::StockBar_Base(),
::property::OPropertySet( rOther, m_aMutex ),
m_bRisingCourse( rOther.m_bRisingCourse ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
StockBar::~StockBar()
diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx
index e2b9db4e6d2a..55fa2df663cd 100644
--- a/chart2/source/model/main/Title.cxx
+++ b/chart2/source/model/main/Title.cxx
@@ -225,14 +225,14 @@ namespace chart
Title::Title( uno::Reference< uno::XComponentContext > const & /* xContext */ ) :
::property::OPropertySet( m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
Title::Title( const Title & rOther ) :
MutexContainer(),
impl::Title_Base(),
::property::OPropertySet( rOther, m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
CloneHelper::CloneRefSequence< uno::Reference< chart2::XFormattedString > >(
rOther.m_aStrings, m_aStrings );
diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx
index 6da6ff9bba3b..bd27e9fd733a 100644
--- a/chart2/source/model/main/Wall.cxx
+++ b/chart2/source/model/main/Wall.cxx
@@ -112,14 +112,14 @@ namespace chart
Wall::Wall() :
::property::OPropertySet( m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
Wall::Wall( const Wall & rOther ) :
MutexContainer(),
impl::Wall_Base(),
::property::OPropertySet( rOther, m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
Wall::~Wall()
diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx
new file mode 100644
index 000000000000..09e629462d48
--- /dev/null
+++ b/chart2/source/model/template/BubbleChartType.cxx
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ,v $
+ * $Revision: $
+ *
+ * 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 "BubbleChartType.hxx"
+#include "PropertyHelper.hxx"
+#include "macros.hxx"
+#include "servicenames_charttypes.hxx"
+#include "ContainerHelper.hxx"
+#include "CartesianCoordinateSystem.hxx"
+#include "AxisHelper.hxx"
+#include "AxisIndexDefines.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/CurveStyle.hpp>
+
+using namespace ::com::sun::star;
+
+using ::rtl::OUString;
+using ::com::sun::star::beans::Property;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Any;
+using ::osl::MutexGuard;
+
+namespace
+{
+
+void lcl_AddPropertiesToVector(
+ ::std::vector< Property > & /*rOutProperties*/ )
+{
+}
+
+void lcl_AddDefaultsToMap(
+ ::chart::tPropertyValueMap & /*rOutMap*/ )
+{
+}
+
+const Sequence< Property > & lcl_GetPropertySequence()
+{
+ static Sequence< Property > aPropSeq;
+
+ // /--
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if( 0 == aPropSeq.getLength() )
+ {
+ // 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 aPropSeq;
+}
+
+} // anonymous namespace
+
+namespace chart
+{
+
+BubbleChartType::BubbleChartType(
+ const uno::Reference< uno::XComponentContext > & xContext )
+ : ChartType( xContext )
+{
+}
+
+BubbleChartType::BubbleChartType( const BubbleChartType & rOther ) :
+ ChartType( rOther )
+{
+}
+
+BubbleChartType::~BubbleChartType()
+{}
+
+// ____ XCloneable ____
+uno::Reference< util::XCloneable > SAL_CALL BubbleChartType::createClone()
+ throw (uno::RuntimeException)
+{
+ return uno::Reference< util::XCloneable >( new BubbleChartType( *this ));
+}
+
+// ____ XChartType ____
+Reference< chart2::XCoordinateSystem > SAL_CALL
+ BubbleChartType::createCoordinateSystem( ::sal_Int32 DimensionCount )
+ throw (lang::IllegalArgumentException,
+ uno::RuntimeException)
+{
+ Reference< chart2::XCoordinateSystem > xResult(
+ new CartesianCoordinateSystem(
+ GetComponentContext(), DimensionCount, /* bSwapXAndYAxis */ sal_False ));
+
+ for( sal_Int32 i=0; i<DimensionCount; ++i )
+ {
+ Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) );
+ if( !xAxis.is() )
+ {
+ OSL_ENSURE(false,"a created coordinate system should have an axis for each dimension");
+ continue;
+ }
+
+ chart2::ScaleData aScaleData = xAxis->getScaleData();
+ aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL;
+ aScaleData.Scaling = AxisHelper::createLinearScaling();
+
+ if( i == 2 )
+ aScaleData.AxisType = chart2::AxisType::SERIES;
+ else
+ aScaleData.AxisType = chart2::AxisType::REALNUMBER;
+
+ xAxis->setScaleData( aScaleData );
+ }
+
+ return xResult;
+}
+
+::rtl::OUString SAL_CALL BubbleChartType::getChartType()
+ throw (uno::RuntimeException)
+{
+ return CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL BubbleChartType::getSupportedMandatoryRoles()
+ throw (uno::RuntimeException)
+{
+ static uno::Sequence< ::rtl::OUString > aMandRolesSeq;
+
+ if( aMandRolesSeq.getLength() == 0 )
+ {
+ aMandRolesSeq.realloc( 4 );
+ aMandRolesSeq[0] = C2U( "label" );
+ aMandRolesSeq[1] = C2U( "values-x" );
+ aMandRolesSeq[2] = C2U( "values-y" );
+ aMandRolesSeq[3] = C2U( "values-size" );
+ }
+
+ return aMandRolesSeq;
+}
+
+OUString SAL_CALL BubbleChartType::getRoleOfSequenceForSeriesLabel()
+ throw (uno::RuntimeException)
+{
+ return C2U( "values-size" );
+}
+
+// ____ OPropertySet ____
+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())
+ return uno::Any();
+
+ return (*aFound).second;
+ // \--
+}
+
+// ____ OPropertySet ____
+::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartType::getInfoHelper()
+{
+ static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
+ /* bSorted = */ sal_True );
+
+ return aArrayHelper;
+}
+
+
+// ____ XPropertySet ____
+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;
+ // \--
+}
+
+uno::Sequence< ::rtl::OUString > BubbleChartType::getSupportedServiceNames_Static()
+{
+ uno::Sequence< ::rtl::OUString > aServices( 3 );
+ aServices[ 0 ] = CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE;
+ aServices[ 1 ] = C2U( "com.sun.star.chart2.ChartType" );
+ aServices[ 2 ] = C2U( "com.sun.star.beans.PropertySet" );
+ return aServices;
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+APPHELPER_XSERVICEINFO_IMPL( BubbleChartType,
+ C2U( "com.sun.star.comp.chart.BubbleChartType" ));
+
+} // namespace chart
diff --git a/chart2/source/model/template/BubbleChartType.hxx b/chart2/source/model/template/BubbleChartType.hxx
new file mode 100644
index 000000000000..3694ac1c955c
--- /dev/null
+++ b/chart2/source/model/template/BubbleChartType.hxx
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ,v $
+ * $Revision: $
+ *
+ * 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 CHART_BUBBLECHARTTYPE_HXX
+#define CHART_BUBBLECHARTTYPE_HXX
+
+#include "ChartType.hxx"
+#include "ServiceMacros.hxx"
+#include <com/sun/star/chart2/CurveStyle.hpp>
+
+namespace chart
+{
+
+class BubbleChartType : public ChartType
+{
+public:
+ BubbleChartType(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & xContext );
+ virtual ~BubbleChartType();
+
+ APPHELPER_XSERVICEINFO_DECL()
+
+ /// establish methods for factory instatiation
+ APPHELPER_SERVICE_FACTORY_HELPER( BubbleChartType )
+
+protected:
+ explicit BubbleChartType( const BubbleChartType & rOther );
+
+ // ____ XChartType ____
+ virtual ::rtl::OUString SAL_CALL getChartType()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
+ getSupportedMandatoryRoles()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > SAL_CALL
+ createCoordinateSystem( ::sal_Int32 DimensionCount )
+ throw (::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getRoleOfSequenceForSeriesLabel()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ OPropertySet ____
+ virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
+ throw(::com::sun::star::beans::UnknownPropertyException);
+
+ // ____ OPropertySet ____
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+
+ // ____ XPropertySet ____
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo()
+ 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);
+};
+
+} // namespace chart
+
+// CHART_BUBBLECHARTTYPE_HXX
+#endif
diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
new file mode 100644
index 000000000000..0853cea6a5cb
--- /dev/null
+++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
@@ -0,0 +1,322 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ,v $
+ * $Revision: $
+ *
+ * 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 "BubbleChartTypeTemplate.hxx"
+#include "macros.hxx"
+#include "BubbleDataInterpreter.hxx"
+#include "CartesianCoordinateSystem.hxx"
+#include "Scaling.hxx"
+#include "DiagramHelper.hxx"
+#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>
+
+#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::beans::Property;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Any;
+using ::osl::MutexGuard;
+
+namespace
+{
+
+static const OUString lcl_aServiceName(
+ RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.BubbleChartTypeTemplate" ));
+
+void lcl_AddPropertiesToVector(
+ ::std::vector< Property > & /*rOutProperties*/ )
+{
+}
+
+void lcl_AddDefaultsToMap(
+ ::chart::tPropertyValueMap & /*rOutMap*/ )
+{
+}
+
+const Sequence< Property > & lcl_GetPropertySequence()
+{
+ static Sequence< Property > aPropSeq;
+
+ // /--
+ MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if( 0 == aPropSeq.getLength() )
+ {
+ // 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 aPropSeq;
+}
+
+::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+{
+ static ::cppu::OPropertyArrayHelper aArrayHelper(
+ lcl_GetPropertySequence(),
+ /* bSorted = */ sal_True );
+
+ return aArrayHelper;
+}
+
+} // anonymous namespace
+
+namespace chart
+{
+
+BubbleChartTypeTemplate::BubbleChartTypeTemplate(
+ Reference<
+ uno::XComponentContext > const & xContext,
+ const OUString & rServiceName ) :
+ ChartTypeTemplate( xContext, rServiceName ),
+ ::property::OPropertySet( m_aMutex )
+{
+}
+
+BubbleChartTypeTemplate::~BubbleChartTypeTemplate()
+{}
+
+// ____ OPropertySet ____
+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())
+ return uno::Any();
+
+ return (*aFound).second;
+ // \--
+}
+
+::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartTypeTemplate::getInfoHelper()
+{
+ return lcl_getInfoHelper();
+}
+
+
+// ____ XPropertySet ____
+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;
+ // \--
+}
+
+sal_Int32 BubbleChartTypeTemplate::getDimension() const
+{
+ return 2;
+}
+
+StackMode BubbleChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */ ) const
+{
+ return StackMode_NONE;
+}
+
+bool BubbleChartTypeTemplate::supportsCategories() const
+{
+ return false;
+}
+
+
+void SAL_CALL BubbleChartTypeTemplate::applyStyle(
+ const Reference< chart2::XDataSeries >& xSeries,
+ ::sal_Int32 nChartTypeIndex,
+ ::sal_Int32 nSeriesIndex,
+ ::sal_Int32 nSeriesCount )
+ throw (uno::RuntimeException)
+{
+ ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+
+ try
+ {
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+}
+
+// ____ XChartTypeTemplate ____
+Sequence< OUString > SAL_CALL BubbleChartTypeTemplate::getAvailableCreationParameterNames()
+ throw (uno::RuntimeException)
+{
+ return Sequence< OUString >();
+}
+
+sal_Bool SAL_CALL BubbleChartTypeTemplate::matchesTemplate(
+ const Reference< chart2::XDiagram >& xDiagram,
+ sal_Bool bAdaptProperties )
+ throw (uno::RuntimeException)
+{
+ sal_Bool bResult = ChartTypeTemplate::matchesTemplate( xDiagram, bAdaptProperties );
+
+ if( bResult )
+ {
+ ::std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
+ DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+
+ for( ::std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
+ aSeriesVec.begin(); aIt != aSeriesVec.end(); ++aIt )
+ {
+ try
+ {
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+ }
+ }
+
+ // adapt curve style, spline order and resolution
+ if( bResult && bAdaptProperties )
+ {
+ try
+ {
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+ }
+
+ return bResult;
+}
+
+Reference< chart2::XChartType > BubbleChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
+{
+ Reference< chart2::XChartType > xResult;
+
+ try
+ {
+ Reference< lang::XMultiServiceFactory > xFact(
+ GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
+ xResult.set( xFact->createInstance(
+ CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ), uno::UNO_QUERY_THROW );
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+
+ return xResult;
+}
+
+Reference< chart2::XChartType > SAL_CALL BubbleChartTypeTemplate::getChartTypeForNewSeries(
+ const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+ throw (uno::RuntimeException)
+{
+ Reference< chart2::XChartType > xResult;
+
+ try
+ {
+ Reference< lang::XMultiServiceFactory > xFact(
+ GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
+ xResult.set( xFact->createInstance(
+ CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ), uno::UNO_QUERY_THROW );
+
+ ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult );
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+
+ return xResult;
+}
+
+Reference< chart2::XDataInterpreter > SAL_CALL BubbleChartTypeTemplate::getDataInterpreter()
+ throw (uno::RuntimeException)
+{
+ if( ! m_xDataInterpreter.is())
+ m_xDataInterpreter.set( new BubbleDataInterpreter( GetComponentContext()) );
+
+ return m_xDataInterpreter;
+}
+
+// ----------------------------------------
+
+Sequence< OUString > BubbleChartTypeTemplate::getSupportedServiceNames_Static()
+{
+ Sequence< OUString > aServices( 2 );
+ aServices[ 0 ] = lcl_aServiceName;
+ aServices[ 1 ] = C2U( "com.sun.star.chart2.ChartTypeTemplate" );
+ return aServices;
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+APPHELPER_XSERVICEINFO_IMPL( BubbleChartTypeTemplate, lcl_aServiceName );
+
+IMPLEMENT_FORWARD_XINTERFACE2( BubbleChartTypeTemplate, ChartTypeTemplate, OPropertySet )
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( BubbleChartTypeTemplate, ChartTypeTemplate, OPropertySet )
+
+} // namespace chart
diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.hxx b/chart2/source/model/template/BubbleChartTypeTemplate.hxx
new file mode 100644
index 000000000000..c094e38e28ac
--- /dev/null
+++ b/chart2/source/model/template/BubbleChartTypeTemplate.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ,v $
+ * $Revision: $
+ *
+ * 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 CHART_BUBBLECHARTTYPETEMPLATE_HXX
+#define CHART_BUBBLECHARTTYPETEMPLATE_HXX
+
+#include "ChartTypeTemplate.hxx"
+#include "OPropertySet.hxx"
+#include "MutexContainer.hxx"
+#include <comphelper/uno3.hxx>
+
+namespace chart
+{
+
+class BubbleChartTypeTemplate :
+ public MutexContainer,
+ public ChartTypeTemplate,
+ public ::property::OPropertySet
+{
+public:
+ explicit BubbleChartTypeTemplate(
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & xContext,
+ const ::rtl::OUString & rServiceName );
+ virtual ~BubbleChartTypeTemplate();
+
+ /// XServiceInfo declarations
+ APPHELPER_XSERVICEINFO_DECL()
+
+ /// merge XInterface implementations
+ DECLARE_XINTERFACE()
+ /// merge XTypeProvider implementations
+ DECLARE_XTYPEPROVIDER()
+
+protected:
+ // ____ OPropertySet ____
+ virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
+ throw(::com::sun::star::beans::UnknownPropertyException);
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+
+ // ____ XPropertySet ____
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ XChartTypeTemplate ____
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableCreationParameterNames()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL matchesTemplate(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDiagram >& xDiagram,
+ sal_Bool bAdaptProperties )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > SAL_CALL
+ getChartTypeForNewSeries( const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartType > >& aFormerlyUsedChartTypes )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataInterpreter > SAL_CALL getDataInterpreter()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL applyStyle(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries,
+ ::sal_Int32 nChartTypeGroupIndex,
+ ::sal_Int32 nSeriesIndex,
+ ::sal_Int32 nSeriesCount )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // ____ ChartTypeTemplate ____
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >
+ getChartTypeForIndex( sal_Int32 nChartTypeIndex );
+ virtual sal_Int32 getDimension() const;
+ virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const;
+
+ virtual bool supportsCategories() const;
+};
+
+} // namespace chart
+
+// CHART_BUBBLECHARTTYPETEMPLATE_HXX
+#endif
diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx
new file mode 100644
index 000000000000..a5ebb6b1ec2f
--- /dev/null
+++ b/chart2/source/model/template/BubbleDataInterpreter.cxx
@@ -0,0 +1,317 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ,v $
+ * $Revision: $
+ *
+ * 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 "BubbleDataInterpreter.hxx"
+#include "DataSeries.hxx"
+#include "macros.hxx"
+#include "DataSeriesHelper.hxx"
+#include "CommonConverters.hxx"
+#include "ContainerHelper.hxx"
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/chart2/data/XDataSink.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+using namespace ::std;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::rtl::OUString;
+
+namespace chart
+{
+
+BubbleDataInterpreter::BubbleDataInterpreter(
+ const uno::Reference< uno::XComponentContext > & xContext ) :
+ DataInterpreter( xContext )
+{
+}
+
+BubbleDataInterpreter::~BubbleDataInterpreter()
+{
+}
+
+// ____ XDataInterpreter ____
+chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
+ const Reference< chart2::data::XDataSource >& xSource,
+ const Sequence< beans::PropertyValue >& aArguments,
+ const Sequence< Reference< XDataSeries > >& aSeriesToReUse )
+ throw (uno::RuntimeException)
+{
+ if( ! xSource.is())
+ return InterpretedData();
+
+ Sequence< Reference< data::XLabeledDataSequence > > aData( xSource->getDataSequences() );
+
+ Reference< data::XLabeledDataSequence > xValuesX;
+ vector< Reference< data::XLabeledDataSequence > > aYValuesVector;
+ vector< Reference< data::XLabeledDataSequence > > aSizeValuesVector;
+
+ Reference< data::XLabeledDataSequence > xCategories;
+ bool bHasCategories = HasCategories( aArguments, aData );
+
+ Sequence< Reference< data::XLabeledDataSequence > > aUnusedData;
+
+ bool bHasXValues = false;
+ sal_Int32 nDataSeqCount = aData.getLength();
+
+ bHasXValues = 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 )
+ {
+ try
+ {
+ if( bHasCategories && !bCategoriesUsed )
+ {
+ xCategories.set( aData[nDataIdx] );
+ if( xCategories.is())
+ SetRole( xCategories->getValues(), C2U("categories"));
+ bCategoriesUsed = true;
+ }
+ else if( !xValuesX.is() && bHasXValues )
+ {
+ xValuesX.set( aData[nDataIdx] );
+ if( xValuesX.is())
+ SetRole( xValuesX->getValues(), C2U("values-x"));
+ }
+ else if( bNextIsYValues )
+ {
+ aYValuesVector.push_back( aData[nDataIdx] );
+ if( aData[nDataIdx].is())
+ SetRole( aData[nDataIdx]->getValues(), C2U("values-y"));
+ bNextIsYValues = false;
+ }
+ else if( !bNextIsYValues )
+ {
+ aSizeValuesVector.push_back( aData[nDataIdx] );
+ if( aData[nDataIdx].is())
+ SetRole( aData[nDataIdx]->getValues(), C2U("values-size"));
+ bNextIsYValues = true;
+ }
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+ }
+
+ // create DataSeries
+ sal_Int32 nSeriesIndex = 0;
+ vector< Reference< XDataSeries > > aSeriesVec;
+ aSeriesVec.reserve( aSizeValuesVector.size());
+
+ Reference< data::XLabeledDataSequence > xClonedXValues = xValuesX;
+ Reference< util::XCloneable > xCloneableX( xValuesX, uno::UNO_QUERY );
+
+ for( size_t nCount = 0; nCount < aSizeValuesVector.size(); ++nCount, ++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;
+ if( xValuesX.is() )
+ {
+ if( nCount > 0 && xCloneableX.is() )
+ xClonedXValues.set( xCloneableX->createClone(), uno::UNO_QUERY );
+ aNewData[nDataIndex++] = xClonedXValues;
+ }
+ if( aYValuesVector.size() > nCount )
+ aNewData[nDataIndex++] = aYValuesVector[nCount];
+ if( aSizeValuesVector.size() > nCount )
+ aNewData[nDataIndex++] = aSizeValuesVector[nCount];
+
+ Reference< XDataSeries > xSeries;
+ if( nSeriesIndex < aSeriesToReUse.getLength())
+ xSeries.set( aSeriesToReUse[nSeriesIndex] );
+ else
+ xSeries.set( new DataSeries( GetComponentContext() ) );
+ OSL_ASSERT( xSeries.is() );
+ Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY );
+ OSL_ASSERT( xSink.is() );
+ xSink->setData( aNewData );
+
+ aSeriesVec.push_back( xSeries );
+ }
+
+ Sequence< Sequence< Reference< XDataSeries > > > aSeries(1);
+ aSeries[0] = ContainerHelper::ContainerToSequence( aSeriesVec );
+ return InterpretedData( aSeries, xCategories, aUnusedData );
+}
+
+chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries(
+ const chart2::InterpretedData& aInterpretedData )
+ throw (uno::RuntimeException)
+{
+ InterpretedData aResult( aInterpretedData );
+ vector< Reference< data::XLabeledDataSequence > > aUnused(
+ ContainerHelper::SequenceToVector( aInterpretedData.UnusedData ));
+
+ sal_Int32 i=0;
+ Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
+ const sal_Int32 nCount = aSeries.getLength();
+ for( ; i<nCount; ++i )
+ {
+ try
+ {
+ Reference< data::XDataSource > xSeriesSource( aSeries[i], uno::UNO_QUERY_THROW );
+ Sequence< Reference< data::XLabeledDataSequence > > aNewSequences;
+
+ Reference< data::XLabeledDataSequence > xValuesSize(
+ DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-size"), false ));
+ Reference< data::XLabeledDataSequence > xValuesY(
+ DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-y"), false ));
+ Reference< data::XLabeledDataSequence > xValuesX(
+ DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-x"), false ));
+
+ if( ! xValuesX.is() ||
+ ! xValuesY.is() ||
+ ! xValuesSize.is() )
+ {
+ vector< Reference< data::XLabeledDataSequence > > aValueSeqVec(
+ DataSeriesHelper::getAllDataSequencesByRole(
+ xSeriesSource->getDataSequences(), C2U("values"), true ));
+ if( xValuesX.is())
+ aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesX ));
+ if( xValuesY.is())
+ aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesY ));
+ if( xValuesSize.is())
+ aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesSize ));
+
+ size_t nIndex = 0;
+
+ if( ! xValuesSize.is() &&
+ aValueSeqVec.size() > nIndex )
+ {
+ xValuesSize.set( aValueSeqVec[nIndex++] );
+ if( xValuesSize.is())
+ SetRole( xValuesSize->getValues(), C2U("values-size"));
+ }
+
+ if( ! xValuesY.is() &&
+ aValueSeqVec.size() > nIndex )
+ {
+ xValuesY.set( aValueSeqVec[nIndex++] );
+ if( xValuesY.is())
+ SetRole( xValuesY->getValues(), C2U("values-y"));
+ }
+
+ if( ! xValuesX.is() &&
+ aValueSeqVec.size() > nIndex )
+ {
+ xValuesX.set( aValueSeqVec[nIndex++] );
+ if( xValuesX.is())
+ SetRole( xValuesY->getValues(), C2U("values-x"));
+ }
+ }
+ if( xValuesSize.is())
+ {
+ if( xValuesY.is() )
+ {
+ if( xValuesX.is() )
+ {
+ aNewSequences.realloc(3);
+ aNewSequences[0] = xValuesX;
+ aNewSequences[1] = xValuesY;
+ aNewSequences[2] = xValuesSize;
+ }
+ else
+ {
+ aNewSequences.realloc(2);
+ aNewSequences[0] = xValuesY;
+ aNewSequences[1] = xValuesSize;
+ }
+ }
+ else
+ {
+ aNewSequences.realloc(1);
+ aNewSequences[0] = xValuesSize;
+ }
+ }
+
+ Sequence< Reference< data::XLabeledDataSequence > > aSeqs( xSeriesSource->getDataSequences());
+ if( aSeqs.getLength() != aNewSequences.getLength() )
+ {
+ sal_Int32 j=0;
+ for( ; j<aSeqs.getLength(); ++j )
+ {
+ if( aSeqs[j] != xValuesY &&
+ aSeqs[j] != xValuesX &&
+ aSeqs[j] != xValuesSize )
+ aUnused.push_back( aSeqs[j] );
+ }
+ Reference< data::XDataSink > xSink( xSeriesSource, uno::UNO_QUERY_THROW );
+ xSink->setData( aNewSequences );
+ aResult.UnusedData = ContainerHelper::ContainerToSequence( aUnused );
+ }
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+ }
+
+ return aResult;
+}
+
+sal_Bool SAL_CALL BubbleDataInterpreter::isDataCompatible(
+ const chart2::InterpretedData& aInterpretedData )
+ throw (uno::RuntimeException)
+{
+ Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
+ for( sal_Int32 i=0; i<aSeries.getLength(); ++i )
+ {
+ try
+ {
+ Reference< data::XDataSource > xSrc( aSeries[i], uno::UNO_QUERY_THROW );
+ Sequence< Reference< data::XLabeledDataSequence > > aSeq( xSrc->getDataSequences());
+ if( aSeq.getLength() != 3 )
+ return sal_False;
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+ }
+
+ return sal_True;
+}
+
+} // namespace chart
diff --git a/chart2/source/model/template/BubbleDataInterpreter.hxx b/chart2/source/model/template/BubbleDataInterpreter.hxx
new file mode 100644
index 000000000000..a173f801812c
--- /dev/null
+++ b/chart2/source/model/template/BubbleDataInterpreter.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ,v $
+ * $Revision: $
+ *
+ * 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 CHART_BUBBLEDATAINTERPRETER_HXX
+#define CHART_BUBBLEDATAINTERPRETER_HXX
+
+#include "DataInterpreter.hxx"
+
+namespace chart
+{
+
+class BubbleDataInterpreter : public DataInterpreter
+{
+public:
+ explicit BubbleDataInterpreter(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > & xContext );
+ virtual ~BubbleDataInterpreter();
+
+protected:
+ // ____ XDataInterpreter ____
+ virtual ::com::sun::star::chart2::InterpretedData SAL_CALL interpretDataSource(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xSource,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > >& aSeriesToReUse )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::chart2::InterpretedData SAL_CALL reinterpretDataSeries(
+ const ::com::sun::star::chart2::InterpretedData& aInterpretedData )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isDataCompatible(
+ const ::com::sun::star::chart2::InterpretedData& aInterpretedData )
+ throw (::com::sun::star::uno::RuntimeException);
+};
+
+} // namespace chart
+
+// CHART_BUBBLEDATAINTERPRETER_HXX
+#endif
diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx
index 35b40f3c3d76..2834d9354f95 100644
--- a/chart2/source/model/template/ChartType.cxx
+++ b/chart2/source/model/template/ChartType.cxx
@@ -35,7 +35,7 @@
#include "CommonFunctors.hxx"
#include "macros.hxx"
#include "CartesianCoordinateSystem.hxx"
-#include "Scaling.hxx"
+#include "AxisHelper.hxx"
#include "CloneHelper.hxx"
#include "AxisIndexDefines.hxx"
#include "ContainerHelper.hxx"
@@ -57,7 +57,7 @@ namespace chart
ChartType::ChartType(
const Reference< uno::XComponentContext > & xContext ) :
::property::OPropertySet( m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()),
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
m_xContext( xContext ),
m_bNotifyChanges( true )
{}
@@ -66,7 +66,7 @@ ChartType::ChartType( const ChartType & rOther ) :
MutexContainer(),
impl::ChartType_Base(),
::property::OPropertySet( rOther, m_aMutex ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()),
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
m_xContext( rOther.m_xContext ),
m_bNotifyChanges( true )
{
@@ -106,7 +106,7 @@ Reference< chart2::XCoordinateSystem > SAL_CALL
chart2::ScaleData aScaleData = xAxis->getScaleData();
aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL;
- aScaleData.Scaling = new LinearScaling( 1.0, 0.0 );
+ aScaleData.Scaling = AxisHelper::createLinearScaling();
switch( i )
{
diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx
index a8eb36d6e5c8..bb419a10f1ac 100644
--- a/chart2/source/model/template/ChartTypeManager.cxx
+++ b/chart2/source/model/template/ChartTypeManager.cxx
@@ -35,7 +35,6 @@
#include "StackMode.hxx"
#include "ContainerHelper.hxx"
-#include "Scaling.hxx"
#include "CartesianCoordinateSystem.hxx"
#include "LineChartTypeTemplate.hxx"
@@ -46,6 +45,7 @@
#include "ScatterChartTypeTemplate.hxx"
#include "StockChartTypeTemplate.hxx"
#include "NetChartTypeTemplate.hxx"
+#include "BubbleChartTypeTemplate.hxx"
#include <cppuhelper/component_context.hxx>
#include <comphelper/InlineContainer.hxx>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
@@ -128,10 +128,14 @@ enum TemplateId
TEMPLATE_PERCENTSTACKEDNET,
TEMPLATE_PERCENTSTACKEDNETSYMBOL,
TEMPLATE_PERCENTSTACKEDNETLINE,
+ TEMPLATE_FILLEDNET,
+ TEMPLATE_STACKEDFILLEDNET,
+ TEMPLATE_PERCENTSTACKEDFILLEDNET,
TEMPLATE_STOCKLOWHIGHCLOSE,
TEMPLATE_STOCKOPENLOWHIGHCLOSE,
TEMPLATE_STOCKVOLUMELOWHIGHCLOSE,
TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE,
+ TEMPLATE_BUBBLE,
// TEMPLATE_SURFACE,
// TEMPLATE_ADDIN,
TEMPLATE_NOT_FOUND = 0xffff
@@ -199,10 +203,14 @@ const tTemplateMapType & lcl_DefaultChartTypeMap()
( C2U( "com.sun.star.chart2.template.PercentStackedNet" ), TEMPLATE_PERCENTSTACKEDNET )
( C2U( "com.sun.star.chart2.template.PercentStackedNetSymbol" ), TEMPLATE_PERCENTSTACKEDNETSYMBOL )
( C2U( "com.sun.star.chart2.template.PercentStackedNetLine" ), TEMPLATE_PERCENTSTACKEDNETLINE )
+ ( C2U( "com.sun.star.chart2.template.FilledNet" ), TEMPLATE_FILLEDNET )
+ ( C2U( "com.sun.star.chart2.template.StackedFilledNet" ), TEMPLATE_STACKEDFILLEDNET )
+ ( C2U( "com.sun.star.chart2.template.PercentStackedFilledNet" ), TEMPLATE_PERCENTSTACKEDFILLEDNET )
( C2U( "com.sun.star.chart2.template.StockLowHighClose" ), TEMPLATE_STOCKLOWHIGHCLOSE )
( C2U( "com.sun.star.chart2.template.StockOpenLowHighClose" ), TEMPLATE_STOCKOPENLOWHIGHCLOSE )
( C2U( "com.sun.star.chart2.template.StockVolumeLowHighClose" ), TEMPLATE_STOCKVOLUMELOWHIGHCLOSE )
( C2U( "com.sun.star.chart2.template.StockVolumeOpenLowHighClose" ), TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE )
+ ( C2U( "com.sun.star.chart2.template.Bubble" ), TEMPLATE_BUBBLE )
// ( C2U( "com.sun.star.chart2.template.Surface" ), TEMPLATE_SURFACE )
// ( C2U( "com.sun.star.chart2.template.Addin" ), TEMPLATE_ADDIN )
);
@@ -501,6 +509,18 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
StackMode_Y_STACKED_PERCENT, false, true ));
break;
+ case TEMPLATE_FILLEDNET:
+ xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
+ StackMode_NONE, false, false, true ));
+ break;
+ case TEMPLATE_STACKEDFILLEDNET:
+ xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
+ StackMode_Y_STACKED, false, false, true ));
+ break;
+ case TEMPLATE_PERCENTSTACKEDFILLEDNET:
+ xTemplate.set( new NetChartTypeTemplate( m_xContext, aServiceSpecifier,
+ StackMode_Y_STACKED_PERCENT, false, false, true ));
+ break;
case TEMPLATE_STOCKLOWHIGHCLOSE:
xTemplate.set( new StockChartTypeTemplate( m_xContext, aServiceSpecifier,
@@ -519,6 +539,11 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
StockChartTypeTemplate::VOL_OPEN_LOW_HI_CLOSE, true ));
break;
+ //BubbleChart
+ case TEMPLATE_BUBBLE:
+ xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier ));
+ break;
+
// case TEMPLATE_SURFACE:
// case TEMPLATE_ADDIN:
// break;
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index d328f3fb6921..1996cc12830e 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -39,7 +39,6 @@
#include "ContainerHelper.hxx"
#include "ChartTypeHelper.hxx"
-#include "Scaling.hxx"
#include "CartesianCoordinateSystem.hxx"
#include "AxisHelper.hxx"
#include "LegendHelper.hxx"
@@ -69,27 +68,6 @@ using ::com::sun::star::uno::Any;
namespace
{
-sal_Int32 lcl_getSeriesLength( const Reference< XDataSeries > & xSeries )
-{
- sal_Int32 nResult = 0;
- try
- {
- Reference< data::XDataSource > xDataSource( xSeries, uno::UNO_QUERY_THROW );
- Sequence< Reference< data::XLabeledDataSequence > > aLabSeq( xDataSource->getDataSequences());
- if( aLabSeq.getLength())
- {
- Reference< data::XDataSequence > xSeq( aLabSeq[0]->getValues());
- if( xSeq.is())
- nResult = xSeq->getData().getLength();
- }
- }
- catch( const uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
- return nResult;
-}
-
void lcl_applyDefaultStyle(
const Reference< XDataSeries > & xSeries,
sal_Int32 nIndex,
@@ -348,12 +326,9 @@ void SAL_CALL ChartTypeTemplate::changeDiagramData(
Sequence< Sequence< Reference< XDataSeries > > > aSeriesSeq( aData.Series );
sal_Int32 i, j, nIndex = 0;
- sal_Int32 nFirstSeriesLength = 0;
for( i=0; i<aSeriesSeq.getLength(); ++i )
for( j=0; j<aSeriesSeq[i].getLength(); ++j, ++nIndex )
{
- if( i==0 && j==0 )
- nFirstSeriesLength = lcl_getSeriesLength( aSeriesSeq[0][0] );
if( nIndex >= nFormerSeriesCount )
{
lcl_applyDefaultStyle( aSeriesSeq[i][j], nIndex, xDiagram );
diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx
index 6bfec80d2fa5..8073b7af04ef 100644
--- a/chart2/source/model/template/DataInterpreter.cxx
+++ b/chart2/source/model/template/DataInterpreter.cxx
@@ -33,7 +33,7 @@
#include "DataInterpreter.hxx"
#include "DataSeries.hxx"
-#include "DataSource.hxx"
+#include "DataSourceHelper.hxx"
#include "DataSeriesHelper.hxx"
#include "macros.hxx"
#include "CommonConverters.hxx"
@@ -355,7 +355,7 @@ Reference< data::XDataSource > SAL_CALL DataInterpreter::mergeInterpretedData(
// add unused data at end
copy( aUnusedDataVec.begin(), aUnusedDataVec.end(), back_inserter( aResultVec ));
- return Reference< data::XDataSource >( new DataSource( ContainerToSequence( aResultVec )));
+ return Reference< data::XDataSource >( DataSourceHelper::createDataSource( ContainerToSequence( aResultVec ) ) );
}
// convenience methods
diff --git a/chart2/source/model/template/FilledNetChartType.cxx b/chart2/source/model/template/FilledNetChartType.cxx
new file mode 100644
index 000000000000..ce96488270a4
--- /dev/null
+++ b/chart2/source/model/template/FilledNetChartType.cxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FilledNetChartType.cxx,v $
+ * $Revision: 1.7 $
+ *
+ * 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 "FilledNetChartType.hxx"
+#include "PropertyHelper.hxx"
+#include "macros.hxx"
+#include "PolarCoordinateSystem.hxx"
+#include "Scaling.hxx"
+#include "servicenames_charttypes.hxx"
+#include "ContainerHelper.hxx"
+#include "AxisIndexDefines.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+
+using ::rtl::OUString;
+using ::com::sun::star::beans::Property;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Any;
+using ::osl::MutexGuard;
+
+namespace chart
+{
+
+FilledNetChartType::FilledNetChartType(
+ const uno::Reference< uno::XComponentContext > & xContext ) :
+ NetChartType_Base( xContext )
+{}
+
+FilledNetChartType::FilledNetChartType( const FilledNetChartType & rOther ) :
+ NetChartType_Base( rOther )
+{
+}
+
+FilledNetChartType::~FilledNetChartType()
+{}
+
+// ____ XCloneable ____
+uno::Reference< util::XCloneable > SAL_CALL FilledNetChartType::createClone()
+ throw (uno::RuntimeException)
+{
+ return uno::Reference< util::XCloneable >( new FilledNetChartType( *this ));
+}
+
+// ____ XChartType ____
+::rtl::OUString SAL_CALL FilledNetChartType::getChartType()
+ throw (uno::RuntimeException)
+{
+ return CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET;
+}
+
+uno::Sequence< ::rtl::OUString > FilledNetChartType::getSupportedServiceNames_Static()
+{
+ uno::Sequence< ::rtl::OUString > aServices( 3 );
+ aServices[ 0 ] = CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET;
+ aServices[ 1 ] = C2U( "com.sun.star.chart2.ChartType" );
+ aServices[ 2 ] = C2U( "com.sun.star.beans.PropertySet" );
+ return aServices;
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+APPHELPER_XSERVICEINFO_IMPL( FilledNetChartType,
+ C2U( "com.sun.star.comp.chart.FilledNetChartType" ));
+
+} // namespace chart
diff --git a/chart2/source/model/template/FilledNetChartType.hxx b/chart2/source/model/template/FilledNetChartType.hxx
new file mode 100644
index 000000000000..3e694c12b0dd
--- /dev/null
+++ b/chart2/source/model/template/FilledNetChartType.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FilledNetChartType.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * 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 CHART_FILLEDNETCHARTTYPE_HXX
+#define CHART_FILLEDNETCHARTTYPE_HXX
+
+#include "NetChartType.hxx"
+#include "ServiceMacros.hxx"
+
+namespace chart
+{
+
+class FilledNetChartType : public NetChartType_Base
+{
+public:
+ FilledNetChartType( ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & xContext );
+ virtual ~FilledNetChartType();
+
+ APPHELPER_XSERVICEINFO_DECL()
+
+ /// establish methods for factory instatiation
+ APPHELPER_SERVICE_FACTORY_HELPER( FilledNetChartType )
+
+protected:
+ explicit FilledNetChartType( const FilledNetChartType & rOther );
+
+ // ____ XChartType ____
+ virtual ::rtl::OUString SAL_CALL getChartType()
+ 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);
+};
+
+} // namespace chart
+
+// CHART_FILLEDNETCHARTTYPE_HXX
+#endif
diff --git a/chart2/source/model/template/NetChartType.cxx b/chart2/source/model/template/NetChartType.cxx
index d36bb4331a46..757d2dc07122 100644
--- a/chart2/source/model/template/NetChartType.cxx
+++ b/chart2/source/model/template/NetChartType.cxx
@@ -34,10 +34,11 @@
#include "PropertyHelper.hxx"
#include "macros.hxx"
#include "PolarCoordinateSystem.hxx"
-#include "Scaling.hxx"
#include "servicenames_charttypes.hxx"
#include "ContainerHelper.hxx"
#include "AxisIndexDefines.hxx"
+#include "AxisHelper.hxx"
+
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
@@ -51,76 +52,24 @@ using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
using ::osl::MutexGuard;
-namespace
-{
-
-void lcl_AddPropertiesToVector(
- ::std::vector< Property > & /* rOutProperties */ )
-{
-}
-
-void lcl_AddDefaultsToMap(
- ::chart::tPropertyValueMap & /* rOutMap */ )
-{
-}
-
-const Sequence< Property > & lcl_GetPropertySequence()
-{
- static Sequence< Property > aPropSeq;
-
- // /--
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if( 0 == aPropSeq.getLength() )
- {
- // 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 aPropSeq;
-}
-
-} // anonymous namespace
-
namespace chart
{
-NetChartType::NetChartType(
+NetChartType_Base::NetChartType_Base(
const uno::Reference< uno::XComponentContext > & xContext ) :
ChartType( xContext )
{}
-NetChartType::NetChartType( const NetChartType & rOther ) :
+NetChartType_Base::NetChartType_Base( const NetChartType_Base & rOther ) :
ChartType( rOther )
{
}
-NetChartType::~NetChartType()
+NetChartType_Base::~NetChartType_Base()
{}
-// ____ XCloneable ____
-uno::Reference< util::XCloneable > SAL_CALL NetChartType::createClone()
- throw (uno::RuntimeException)
-{
- return uno::Reference< util::XCloneable >( new NetChartType( *this ));
-}
-
-// ____ XChartType ____
-::rtl::OUString SAL_CALL NetChartType::getChartType()
- throw (uno::RuntimeException)
-{
- return CHART2_SERVICE_NAME_CHARTTYPE_NET;
-}
-
Reference< XCoordinateSystem > SAL_CALL
- NetChartType::createCoordinateSystem( ::sal_Int32 DimensionCount )
+ NetChartType_Base::createCoordinateSystem( ::sal_Int32 DimensionCount )
throw (lang::IllegalArgumentException,
uno::RuntimeException)
{
@@ -137,7 +86,7 @@ Reference< XCoordinateSystem > SAL_CALL
if( xAxis.is() )
{
ScaleData aScaleData = xAxis->getScaleData();
- aScaleData.Scaling = new LinearScaling( 1.0, 0.0 );
+ aScaleData.Scaling = AxisHelper::createLinearScaling();
aScaleData.AxisType = AxisType::CATEGORY;
aScaleData.Orientation = AxisOrientation_MATHEMATICAL;
xAxis->setScaleData( aScaleData );
@@ -156,42 +105,23 @@ Reference< XCoordinateSystem > SAL_CALL
}
// ____ OPropertySet ____
-uno::Any NetChartType::GetDefaultValue( sal_Int32 nHandle ) const
+uno::Any NetChartType_Base::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())
- return uno::Any();
-
- return (*aFound).second;
- // \--
+ return uno::Any();
}
// ____ OPropertySet ____
-::cppu::IPropertyArrayHelper & SAL_CALL NetChartType::getInfoHelper()
+::cppu::IPropertyArrayHelper & SAL_CALL NetChartType_Base::getInfoHelper()
{
- static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
- /* bSorted = */ sal_True );
-
+ uno::Sequence< beans::Property > aProps;
+ static ::cppu::OPropertyArrayHelper aArrayHelper(aProps);
return aArrayHelper;
}
-
// ____ XPropertySet ____
uno::Reference< beans::XPropertySetInfo > SAL_CALL
- NetChartType::getPropertySetInfo()
+ NetChartType_Base::getPropertySetInfo()
throw (uno::RuntimeException)
{
static uno::Reference< beans::XPropertySetInfo > xInfo;
@@ -208,6 +138,35 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL
// \--
}
+//-----------------------------------------------------------------------------
+
+NetChartType::NetChartType(
+ const uno::Reference< uno::XComponentContext > & xContext ) :
+ NetChartType_Base( xContext )
+{}
+
+NetChartType::NetChartType( const NetChartType & rOther ) :
+ NetChartType_Base( rOther )
+{
+}
+
+NetChartType::~NetChartType()
+{}
+
+// ____ XCloneable ____
+uno::Reference< util::XCloneable > SAL_CALL NetChartType::createClone()
+ throw (uno::RuntimeException)
+{
+ return uno::Reference< util::XCloneable >( new NetChartType( *this ));
+}
+
+// ____ XChartType ____
+::rtl::OUString SAL_CALL NetChartType::getChartType()
+ throw (uno::RuntimeException)
+{
+ return CHART2_SERVICE_NAME_CHARTTYPE_NET;
+}
+
uno::Sequence< ::rtl::OUString > NetChartType::getSupportedServiceNames_Static()
{
uno::Sequence< ::rtl::OUString > aServices( 3 );
diff --git a/chart2/source/model/template/NetChartType.hxx b/chart2/source/model/template/NetChartType.hxx
index f38d110a60ba..97afeeaeea13 100644
--- a/chart2/source/model/template/NetChartType.hxx
+++ b/chart2/source/model/template/NetChartType.hxx
@@ -6,7 +6,7 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: NetChartType.hxx,v $
+ * $RCSfile: NetChartType_Base.hxx,v $
* $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
@@ -36,24 +36,17 @@
namespace chart
{
-class NetChartType : public ChartType
+class NetChartType_Base : public ChartType
{
public:
- NetChartType( ::com::sun::star::uno::Reference<
+ NetChartType_Base( ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > const & xContext );
- virtual ~NetChartType();
-
- APPHELPER_XSERVICEINFO_DECL()
-
- /// establish methods for factory instatiation
- APPHELPER_SERVICE_FACTORY_HELPER( NetChartType )
+ virtual ~NetChartType_Base();
protected:
- explicit NetChartType( const NetChartType & rOther );
+ explicit NetChartType_Base( const NetChartType_Base & rOther );
// ____ XChartType ____
- virtual ::rtl::OUString SAL_CALL getChartType()
- throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > SAL_CALL
createCoordinateSystem( ::sal_Int32 DimensionCount )
throw (::com::sun::star::lang::IllegalArgumentException,
@@ -63,13 +56,34 @@ protected:
virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
throw(::com::sun::star::beans::UnknownPropertyException);
- // ____ OPropertySet ____
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
// ____ XPropertySet ____
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo()
throw (::com::sun::star::uno::RuntimeException);
+};
+
+//-------------------------------------------------------------------------------------
+
+class NetChartType : public NetChartType_Base
+{
+public:
+ NetChartType( ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & xContext );
+ virtual ~NetChartType();
+
+ APPHELPER_XSERVICEINFO_DECL()
+
+ /// establish methods for factory instatiation
+ APPHELPER_SERVICE_FACTORY_HELPER( NetChartType )
+
+protected:
+ explicit NetChartType( const NetChartType & rOther );
+
+ // ____ XChartType ____
+ virtual ::rtl::OUString SAL_CALL getChartType()
+ throw (::com::sun::star::uno::RuntimeException);
// ____ XCloneable ____
virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
diff --git a/chart2/source/model/template/NetChartTypeTemplate.cxx b/chart2/source/model/template/NetChartTypeTemplate.cxx
index ab90f0f7ff42..9b2c089b7298 100644
--- a/chart2/source/model/template/NetChartTypeTemplate.cxx
+++ b/chart2/source/model/template/NetChartTypeTemplate.cxx
@@ -33,7 +33,6 @@
#include "NetChartTypeTemplate.hxx"
#include "macros.hxx"
#include "PolarCoordinateSystem.hxx"
-#include "Scaling.hxx"
#include "DiagramHelper.hxx"
#include "servicenames_charttypes.hxx"
#include "DataSeriesHelper.hxx"
@@ -65,11 +64,13 @@ NetChartTypeTemplate::NetChartTypeTemplate(
const ::rtl::OUString & rServiceName,
StackMode eStackMode,
bool bSymbols,
- bool bHasLines ) :
+ bool bHasLines ,
+ bool bHasFilledArea ) :
ChartTypeTemplate( xContext, rServiceName ),
m_eStackMode( eStackMode ),
m_bHasSymbols( bSymbols ),
- m_bHasLines( bHasLines )
+ m_bHasLines( bHasLines ),
+ m_bHasFilledArea( bHasFilledArea )
{}
NetChartTypeTemplate::~NetChartTypeTemplate()
@@ -111,11 +112,18 @@ sal_Bool SAL_CALL NetChartTypeTemplate::matchesTemplate(
{
sal_Bool bResult = ChartTypeTemplate::matchesTemplate( xDiagram, bAdaptProperties );
- // check symbol-style
- // for a template with symbols it is ok, if there is at least one series
- // with symbols, otherwise an unknown template is too easy to achieve
+ uno::Reference< beans::XPropertySet > xChartTypeProp(
+ DiagramHelper::getChartTypeByIndex( xDiagram, 0 ), uno::UNO_QUERY_THROW );
+
if( bResult )
{
+ //filled net chart?:
+ if( m_bHasFilledArea )
+ return sal_True;
+
+ // check symbol-style
+ // for a template with symbols it is ok, if there is at least one series
+ // with symbols, otherwise an unknown template is too easy to achieve
bool bSymbolFound = false;
bool bLineFound = false;
@@ -183,8 +191,13 @@ Reference< chart2::XChartType > NetChartTypeTemplate::getChartTypeForIndex( sal_
{
Reference< lang::XMultiServiceFactory > xFact(
GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
- xResult.set( xFact->createInstance(
- CHART2_SERVICE_NAME_CHARTTYPE_NET ), uno::UNO_QUERY_THROW );
+
+ if( m_bHasFilledArea )
+ xResult.set( xFact->createInstance(
+ CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET ), uno::UNO_QUERY_THROW );
+ else
+ xResult.set( xFact->createInstance(
+ CHART2_SERVICE_NAME_CHARTTYPE_NET ), uno::UNO_QUERY_THROW );
}
catch( uno::Exception & ex )
{
diff --git a/chart2/source/model/template/NetChartTypeTemplate.hxx b/chart2/source/model/template/NetChartTypeTemplate.hxx
index 0e963b8d4500..9c17e6639497 100644
--- a/chart2/source/model/template/NetChartTypeTemplate.hxx
+++ b/chart2/source/model/template/NetChartTypeTemplate.hxx
@@ -45,7 +45,8 @@ public:
const ::rtl::OUString & rServiceName,
StackMode eStackMode,
bool bSymbols,
- bool bHasLines = true
+ bool bHasLines = true,
+ bool bHasFilledArea = false
);
virtual ~NetChartTypeTemplate();
@@ -80,6 +81,7 @@ private:
StackMode m_eStackMode;
bool m_bHasSymbols;
bool m_bHasLines;
+ bool m_bHasFilledArea;
};
} // namespace chart
diff --git a/chart2/source/model/template/PieChartType.cxx b/chart2/source/model/template/PieChartType.cxx
index 4cccd4bedcde..a4c98413fe7d 100644
--- a/chart2/source/model/template/PieChartType.cxx
+++ b/chart2/source/model/template/PieChartType.cxx
@@ -34,7 +34,7 @@
#include "PropertyHelper.hxx"
#include "macros.hxx"
#include "PolarCoordinateSystem.hxx"
-#include "Scaling.hxx"
+#include "AxisHelper.hxx"
#include "servicenames_charttypes.hxx"
#include "ContainerHelper.hxx"
#include "AxisIndexDefines.hxx"
@@ -156,7 +156,7 @@ Reference< chart2::XCoordinateSystem > SAL_CALL
//hhhh todo make axis invisible
chart2::ScaleData aScaleData = xAxis->getScaleData();
- aScaleData.Scaling = new LinearScaling( 1.0, 0.0 );
+ aScaleData.Scaling = AxisHelper::createLinearScaling();
aScaleData.AxisType = chart2::AxisType::REALNUMBER;
if( i == 0 )
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx
index 774eafed625f..1ece7c5edb93 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -31,7 +31,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_chart2.hxx"
#include "PieChartTypeTemplate.hxx"
-#include "Scaling.hxx"
#include "macros.hxx"
#include "CommonConverters.hxx"
#include "DiagramHelper.hxx"
diff --git a/chart2/source/model/template/ScatterChartType.cxx b/chart2/source/model/template/ScatterChartType.cxx
index 38249e3e72fe..50b1b4f0ac70 100644
--- a/chart2/source/model/template/ScatterChartType.cxx
+++ b/chart2/source/model/template/ScatterChartType.cxx
@@ -36,7 +36,7 @@
#include "servicenames_charttypes.hxx"
#include "ContainerHelper.hxx"
#include "CartesianCoordinateSystem.hxx"
-#include "Scaling.hxx"
+#include "AxisHelper.hxx"
#include "AxisIndexDefines.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
@@ -179,7 +179,7 @@ Reference< chart2::XCoordinateSystem > SAL_CALL
chart2::ScaleData aScaleData = xAxis->getScaleData();
aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL;
- aScaleData.Scaling = new LinearScaling( 1.0, 0.0 );
+ aScaleData.Scaling = AxisHelper::createLinearScaling();
if( i == 2 )
aScaleData.AxisType = chart2::AxisType::SERIES;
diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.cxx b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
index 6e5449d49f49..a87a82c05827 100644
--- a/chart2/source/model/template/ScatterChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
@@ -34,7 +34,6 @@
#include "macros.hxx"
#include "XYDataInterpreter.hxx"
#include "CartesianCoordinateSystem.hxx"
-#include "Scaling.hxx"
#include "DiagramHelper.hxx"
#include "servicenames_charttypes.hxx"
#include "ContainerHelper.hxx"
diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx
index ae48f1cc932e..719decae49a7 100644
--- a/chart2/source/model/template/StockChartTypeTemplate.cxx
+++ b/chart2/source/model/template/StockChartTypeTemplate.cxx
@@ -35,7 +35,6 @@
#include "DataSeriesHelper.hxx"
#include "StockDataInterpreter.hxx"
#include "CartesianCoordinateSystem.hxx"
-#include "Scaling.hxx"
#include "AxisHelper.hxx"
#include "DiagramHelper.hxx"
#include "servicenames_charttypes.hxx"
diff --git a/chart2/source/model/template/_serviceregistration_charttypes.cxx b/chart2/source/model/template/_serviceregistration_charttypes.cxx
index b059eb24957a..7b739ca73830 100644
--- a/chart2/source/model/template/_serviceregistration_charttypes.cxx
+++ b/chart2/source/model/template/_serviceregistration_charttypes.cxx
@@ -39,8 +39,10 @@
#include "ColumnChartType.hxx"
#include "LineChartType.hxx"
#include "NetChartType.hxx"
+#include "FilledNetChartType.hxx"
#include "PieChartType.hxx"
#include "ScatterChartType.hxx"
+#include "BubbleChartType.hxx"
namespace
{
@@ -95,6 +97,14 @@ static struct ::cppu::ImplementationEntry g_entries_chart2_charttypes[] =
, 0
}
,{
+ ::chart::FilledNetChartType::create
+ , ::chart::FilledNetChartType::getImplementationName_Static
+ , ::chart::FilledNetChartType::getSupportedServiceNames_Static
+ , ::cppu::createSingleComponentFactory
+ , 0
+ , 0
+ }
+ ,{
::chart::PieChartType::create
, ::chart::PieChartType::getImplementationName_Static
, ::chart::PieChartType::getSupportedServiceNames_Static
@@ -110,6 +120,14 @@ static struct ::cppu::ImplementationEntry g_entries_chart2_charttypes[] =
, 0
, 0
}
+ ,{
+ ::chart::BubbleChartType::create
+ , ::chart::BubbleChartType::getImplementationName_Static
+ , ::chart::BubbleChartType::getSupportedServiceNames_Static
+ , ::cppu::createSingleComponentFactory
+ , 0
+ , 0
+ }
,{ 0, 0, 0, 0, 0, 0 }
};
diff --git a/chart2/source/model/template/makefile.mk b/chart2/source/model/template/makefile.mk
index 0913c42a89e2..63367014ed6b 100644
--- a/chart2/source/model/template/makefile.mk
+++ b/chart2/source/model/template/makefile.mk
@@ -63,6 +63,7 @@ SLOFILES= \
$(SLO)$/ColumnChartType.obj \
$(SLO)$/ColumnLineChartTypeTemplate.obj \
$(SLO)$/DataInterpreter.obj \
+ $(SLO)$/FilledNetChartType.obj \
$(SLO)$/LineChartType.obj \
$(SLO)$/LineChartTypeTemplate.obj \
$(SLO)$/NetChartType.obj \
@@ -71,6 +72,9 @@ SLOFILES= \
$(SLO)$/PieChartTypeTemplate.obj \
$(SLO)$/ScatterChartType.obj \
$(SLO)$/ScatterChartTypeTemplate.obj \
+ $(SLO)$/BubbleChartType.obj \
+ $(SLO)$/BubbleChartTypeTemplate.obj \
+ $(SLO)$/BubbleDataInterpreter.obj \
$(SLO)$/StockChartTypeTemplate.obj \
$(SLO)$/StockDataInterpreter.obj \
$(SLO)$/XYDataInterpreter.obj \
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index b9778042baed..5e6c0bce8717 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -40,6 +40,7 @@
#include "ContainerHelper.hxx"
#include "servicenames_coosystems.hxx"
#include "DataSeriesHelper.hxx"
+#include "Scaling.hxx"
#include <svtools/saveopt.hxx>
@@ -66,6 +67,17 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
+//static
+Reference< chart2::XScaling > AxisHelper::createLinearScaling()
+{
+ return new LinearScaling( 1.0, 0.0 );
+}
+
+//static
+Reference< chart2::XScaling > AxisHelper::createLogarithmicScaling( double fBase )
+{
+ return new LogarithmicScaling( fBase );
+}
//static
ScaleData AxisHelper::createDefaultScale()
diff --git a/chart2/source/tools/CachedDataSequence.cxx b/chart2/source/tools/CachedDataSequence.cxx
index 68cbcb50caa7..09a814f277c8 100644
--- a/chart2/source/tools/CachedDataSequence.cxx
+++ b/chart2/source/tools/CachedDataSequence.cxx
@@ -68,9 +68,7 @@ enum
{
// PROP_SOURCE_IDENTIFIER,
PROP_NUMBERFORMAT_KEY,
- PROP_PROPOSED_ROLE,
- PROP_HIDDEN,
- PROP_HIDDEN_VALUES
+ PROP_PROPOSED_ROLE
};
} // anonymous namespace
@@ -82,67 +80,31 @@ namespace chart
CachedDataSequence::CachedDataSequence()
: OPropertyContainer( GetBroadcastHelper()),
CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
m_eCurrentDataType( NUMERICAL ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
registerProperties();
}
CachedDataSequence::CachedDataSequence( const Reference< uno::XComponentContext > & /*xContext*/ )
: OPropertyContainer( GetBroadcastHelper()),
CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
m_eCurrentDataType( MIXED ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder( ))
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder( ))
{
registerProperties();
}
-CachedDataSequence::CachedDataSequence( const ::std::vector< double > & rVector )
- : OPropertyContainer( GetBroadcastHelper()),
- CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
- m_eCurrentDataType( NUMERICAL ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
-{
- m_aNumericalSequence = ContainerToSequence( rVector );
- registerProperties();
-}
-
-CachedDataSequence::CachedDataSequence( const ::std::vector< OUString > & rVector )
- : OPropertyContainer( GetBroadcastHelper()),
- CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
- m_eCurrentDataType( TEXTUAL ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
-{
- m_aTextualSequence = ContainerToSequence( rVector );
- registerProperties();
-}
-
CachedDataSequence::CachedDataSequence( const OUString & rSingleText )
: OPropertyContainer( GetBroadcastHelper()),
CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
m_eCurrentDataType( TEXTUAL ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
m_aTextualSequence.realloc(1);
m_aTextualSequence[0] = rSingleText;
registerProperties();
}
-CachedDataSequence::CachedDataSequence( const ::std::vector< Any > & rVector )
- : OPropertyContainer( GetBroadcastHelper()),
- CachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
- m_eCurrentDataType( MIXED ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
-{
- m_aMixedSequence = ContainerToSequence( rVector );
- registerProperties();
-}
-
CachedDataSequence::CachedDataSequence( const CachedDataSequence & rSource )
: OMutexAndBroadcastHelper(),
OPropertyContainer( GetBroadcastHelper()),
@@ -150,10 +112,8 @@ CachedDataSequence::CachedDataSequence( const CachedDataSequence & rSource )
CachedDataSequence_Base( GetMutex()),
m_nNumberFormatKey( rSource.m_nNumberFormatKey ),
m_sRole( rSource.m_sRole ),
- m_bIsHidden( rSource.m_bIsHidden ),
- m_aHiddenValues( rSource.m_aHiddenValues ),
m_eCurrentDataType( rSource.m_eCurrentDataType ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
switch( m_eCurrentDataType )
{
@@ -187,18 +147,6 @@ void CachedDataSequence::registerProperties()
0, // PropertyAttributes
& m_sRole,
::getCppuType( & m_sRole ) );
-
- registerProperty( C2U( "IsHidden" ),
- PROP_HIDDEN,
- 0, // PropertyAttributes
- & m_bIsHidden,
- ::getCppuType( & m_bIsHidden ) );
-
- registerProperty( C2U( "HiddenValues" ),
- PROP_HIDDEN_VALUES,
- 0, // PropertyAttributes
- & m_aHiddenValues,
- ::getCppuType( & m_aHiddenValues ) );
}
Sequence< double > CachedDataSequence::Impl_getNumericalData() const
diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx
index 937aec554215..4f558b35df0a 100644
--- a/chart2/source/tools/CharacterProperties.cxx
+++ b/chart2/source/tools/CharacterProperties.cxx
@@ -51,9 +51,11 @@
#include <com/sun/star/text/RubyAdjust.hpp>
#include <com/sun/star/awt/FontStrikeout.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
#include <comphelper/InlineContainer.hxx>
+
// header for struct SvtLinguConfig
#ifndef _SVTOOLS_LINGUCFG_HXX_
#include <svtools/lingucfg.hxx>
@@ -463,6 +465,13 @@ void CharacterProperties::AddPropertiesToVector(
::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), /*com::sun::star::text::WritingMode2*/
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( C2U( "ParaIsCharacterDistance" ),
+ PROP_PARA_IS_CHARACTER_DISTANCE,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
}
void CharacterProperties::AddDefaultsToMap(
@@ -471,16 +480,21 @@ void CharacterProperties::AddDefaultsToMap(
const float fDefaultFontHeight = 13.0;
SvtLinguConfig aLinguConfig;
- lang::Locale aDefaultLocale( C2U( "en" ), C2U( "US" ), OUString() );
+ lang::Locale aDefaultLocale;
aLinguConfig.GetProperty(C2U("DefaultLocale")) >>= aDefaultLocale;
lang::Locale aDefaultLocale_CJK;
aLinguConfig.GetProperty(C2U("DefaultLocale_CJK")) >>= aDefaultLocale_CJK;
lang::Locale aDefaultLocale_CTL;
aLinguConfig.GetProperty(C2U("DefaultLocale_CTL")) >>= aDefaultLocale_CTL;
- Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, MsLangId::convertLocaleToLanguage( aDefaultLocale ), DEFAULTFONT_FLAGS_ONLYONE, 0 );
- Font aFontCJK = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_SPREADSHEET, MsLangId::convertLocaleToLanguage( aDefaultLocale_CJK ), DEFAULTFONT_FLAGS_ONLYONE, 0 );
- Font aFontCTL = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_SPREADSHEET, MsLangId::convertLocaleToLanguage( aDefaultLocale_CTL ), DEFAULTFONT_FLAGS_ONLYONE, 0 );
+ using namespace ::com::sun::star::i18n::ScriptType;
+ LanguageType nLang;
+ nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aDefaultLocale), LATIN);
+ Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 );
+ nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage( aDefaultLocale_CJK), ASIAN);
+ Font aFontCJK = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 );
+ nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage( aDefaultLocale_CTL), COMPLEX);
+ Font aFontCTL = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_NAME, OUString( aFont.GetName() ) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_STYLE_NAME, OUString(aFont.GetStyleName()) );
@@ -541,6 +555,7 @@ void CharacterProperties::AddDefaultsToMap(
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_PITCH, sal_Int16(aFontCTL.GetPitch()) );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_WRITING_MODE, sal_Int16( com::sun::star::text::WritingMode2::PAGE ) );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PARA_IS_CHARACTER_DISTANCE, sal_True );
}
bool CharacterProperties::IsCharacterPropertyHandle( sal_Int32 nHandle )
diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx
index 4dcc452bf939..2d6ce7cbfd9d 100644
--- a/chart2/source/tools/ChartModelHelper.cxx
+++ b/chart2/source/tools/ChartModelHelper.cxx
@@ -33,6 +33,12 @@
#include "ChartModelHelper.hxx"
#include "macros.hxx"
#include "DiagramHelper.hxx"
+#include "DataSourceHelper.hxx"
+#include "ControllerLockGuard.hxx"
+#include "UndoManager.hxx"
+#include "RangeHighlighter.hxx"
+#include "InternalDataProvider.hxx"
+
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
@@ -53,6 +59,39 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
//static
+uno::Reference< chart2::XUndoManager > ChartModelHelper::createUndoManager()
+{
+ return new UndoManager();
+}
+
+//static
+uno::Reference< chart2::data::XRangeHighlighter > ChartModelHelper::createRangeHighlighter(
+ const uno::Reference< view::XSelectionSupplier > & xSelectionSupplier )
+{
+ return new RangeHighlighter( xSelectionSupplier );
+}
+
+//static
+uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDataProvider()
+{
+ return new InternalDataProvider();
+}
+
+//static
+uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDataProvider(
+ const uno::Reference< ::com::sun::star::chart::XChartDataArray >& xDataToCopy )
+{
+ return new InternalDataProvider( xDataToCopy );
+}
+
+//static
+uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDataProvider(
+ const uno::Reference< ::com::sun::star::chart2::XChartDocument >& xChartDoc )
+{
+ return new InternalDataProvider( xChartDoc );
+}
+
+//static
uno::Reference< XDiagram > ChartModelHelper::findDiagram( const uno::Reference< frame::XModel >& xModel )
{
uno::Reference< XChartDocument > xChartDoc( xModel, uno::UNO_QUERY );
@@ -137,6 +176,96 @@ void ChartModelHelper::triggerRangeHighlighting( const uno::Reference< frame::XM
}
}
+bool ChartModelHelper::isIncludeHiddenCells( const uno::Reference< frame::XModel >& xChartModel )
+{
+ bool bIncluded = true; // hidden cells are included by default.
+
+ uno::Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) );
+ if (!xDiagram.is())
+ return bIncluded;
+
+ uno::Reference< beans::XPropertySet > xProp( xDiagram, uno::UNO_QUERY );
+ if (!xProp.is())
+ return bIncluded;
+
+ try
+ {
+ xProp->getPropertyValue(C2U("IncludeHiddenCells")) >>= bIncluded;
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ }
+
+ return bIncluded;
+}
+
+bool ChartModelHelper::setIncludeHiddenCells( bool bIncludeHiddenCells, const uno::Reference< frame::XModel >& xChartModel )
+{
+ bool bChanged = false;
+ try
+ {
+ ControllerLockGuard aLockedControllers( xChartModel );
+
+ uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(xChartModel), uno::UNO_QUERY );
+ if (xDiagramProperties.is())
+ {
+ bool bOldValue = bIncludeHiddenCells;
+ xDiagramProperties->getPropertyValue( C2U("IncludeHiddenCells") ) >>= bOldValue;
+ if( bOldValue == bIncludeHiddenCells )
+ bChanged = true;
+
+ //set the property on all instances in all cases to get the different objects in sync!
+
+ uno::Any aNewValue = uno::makeAny(bIncludeHiddenCells);
+
+ try
+ {
+ uno::Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
+ if( xChartDoc.is() )
+ {
+ uno::Reference< beans::XPropertySet > xDataProviderProperties( xChartDoc->getDataProvider(), uno::UNO_QUERY );
+ if( xDataProviderProperties.is() )
+ xDataProviderProperties->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
+ }
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ //the property is optional!
+ }
+
+ try
+ {
+ uno::Reference< chart2::data::XDataSource > xUsedData( DataSourceHelper::getUsedData( xChartModel ) );
+ if( xUsedData.is() )
+ {
+ uno::Reference< beans::XPropertySet > xProp;
+ uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aData( xUsedData->getDataSequences());
+ for( sal_Int32 i=0; i<aData.getLength(); ++i )
+ {
+ xProp.set( uno::Reference< beans::XPropertySet >( aData[i]->getValues(), uno::UNO_QUERY ) );
+ if(xProp.is())
+ xProp->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
+ xProp.set( uno::Reference< beans::XPropertySet >( aData[i]->getLabel(), uno::UNO_QUERY ) );
+ if(xProp.is())
+ xProp->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
+ }
+ }
+ }
+ catch( const beans::UnknownPropertyException& )
+ {
+ //the property is optional!
+ }
+
+ xDiagramProperties->setPropertyValue( C2U("IncludeHiddenCells"), aNewValue);
+ }
+ }
+ catch (uno::Exception& e)
+ {
+ ASSERT_EXCEPTION(e);
+ }
+ return bChanged;
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx
index d7bb3a15bdf6..9e521fa76dae 100644
--- a/chart2/source/tools/ChartTypeHelper.cxx
+++ b/chart2/source/tools/ChartTypeHelper.cxx
@@ -106,8 +106,12 @@ sal_Bool ChartTypeHelper::isSupportingStatisticProperties( const uno::Reference<
return sal_False;
if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
return sal_False;
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
+ return sal_False;
if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
return sal_False;
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) ) //todo: BubbleChart support error bars and trend lines
+ return sal_False;
}
return sal_True;
}
@@ -195,6 +199,8 @@ sal_Bool ChartTypeHelper::isSupportingSecondaryAxis( const uno::Reference< XChar
return sal_False;
if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
return sal_False;
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
+ return sal_False;
}
return sal_True;
}
@@ -281,6 +287,7 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const
}
else if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER)
|| aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE)
)
{
aRet.realloc(5);
@@ -332,14 +339,21 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const
}
else if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
{
- aRet.realloc(5);
+ aRet.realloc(6);
sal_Int32* pSeq = aRet.getArray();
+ *pSeq++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE;
*pSeq++ = ::com::sun::star::chart::DataLabelPlacement::TOP;
*pSeq++ = ::com::sun::star::chart::DataLabelPlacement::BOTTOM;
*pSeq++ = ::com::sun::star::chart::DataLabelPlacement::LEFT;
*pSeq++ = ::com::sun::star::chart::DataLabelPlacement::RIGHT;
*pSeq++ = ::com::sun::star::chart::DataLabelPlacement::CENTER;
}
+ else if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
+ {
+ aRet.realloc(1);
+ sal_Int32* pSeq = aRet.getArray();
+ *pSeq++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE;
+ }
else if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
{
aRet.realloc( 1 );
@@ -396,6 +410,8 @@ bool ChartTypeHelper::isSupportingAxisPositioning( const uno::Reference< chart2:
rtl::OUString aChartTypeName = xChartType->getChartType();
if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
return false;
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
+ return false;
}
if( nDimensionCount==3 )
return nDimensionIndex<2;
@@ -509,7 +525,8 @@ sal_Int32 ChartTypeHelper::getAxisType( const uno::Reference<
return AxisType::REALNUMBER;
if(0==nDimensionIndex)//x-axis
{
- if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) )
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
return AxisType::REALNUMBER;
return AxisType::CATEGORY;
}
@@ -558,7 +575,8 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments(
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_BUBBLE) )
{
aRet.realloc( 2 );
sal_Int32* pSeq = aRet.getArray();
@@ -574,7 +592,8 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments(
*pSeq++ = ::com::sun::star::chart::MissingValueTreatment::CONTINUE;
}
else if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE) ||
- aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET))
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_NET) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
{
aRet.realloc( bStacked ? 2 : 3 );
sal_Int32* pSeq = aRet.getArray();
@@ -604,6 +623,65 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments(
return aRet;
}
+bool ChartTypeHelper::isSeriesInFrontOfAxisLine( const uno::Reference< XChartType >& xChartType )
+{
+ if( xChartType.is() )
+ {
+ rtl::OUString aChartTypeName = xChartType->getChartType();
+ if( aChartTypeName.match( CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET ) )
+ return false;
+ }
+ return true;
+}
+
+rtl::OUString ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( const uno::Reference< XChartType >& xChartType )
+{
+ rtl::OUString aRet( C2U( "values-y" ) );
+ if( !xChartType.is() )
+ return aRet;
+ rtl::OUString aChartTypeName = xChartType->getChartType();
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
+ aRet = xChartType->getRoleOfSequenceForSeriesLabel();
+ return aRet;
+}
+
+rtl::OUString ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( const uno::Reference< XChartType >& xChartType )
+{
+ rtl::OUString aRet( C2U( "values-y" ) );
+ if( !xChartType.is() )
+ return aRet;
+ rtl::OUString aChartTypeName = xChartType->getChartType();
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
+ aRet = xChartType->getRoleOfSequenceForSeriesLabel();
+ return aRet;
+}
+
+bool ChartTypeHelper::shouldLabelNumberFormatKeyBeDetectedFromYAxis( const uno::Reference< XChartType >& xChartType )
+{
+ bool bRet = true;
+ rtl::OUString aChartTypeName = xChartType->getChartType();
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
+ bRet = false;
+ return bRet;
+}
+
+bool ChartTypeHelper::isSupportingOnlyDeepStackingFor3D( const uno::Reference< XChartType >& xChartType )
+{
+ bool bRet = false;
+ if( !xChartType.is() )
+ return bRet;
+
+ rtl::OUString aChartTypeName = xChartType->getChartType();
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) ||
+ aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA) )
+ {
+ bRet = true;
+ }
+ return bRet;
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx
index 787d79668ca3..9452763153a5 100644
--- a/chart2/source/tools/CommonConverters.cxx
+++ b/chart2/source/tools/CommonConverters.cxx
@@ -155,15 +155,6 @@ drawing::Position3D B3DPointToPosition3D( const ::basegfx::B3DPoint& rPoint)
);
}
-::basegfx::B3DPoint Direction3DToB3DPoint( const drawing::Direction3D& rDirection)
-{
- return ::basegfx::B3DPoint(
- rDirection.DirectionX
- , rDirection.DirectionY
- , rDirection.DirectionZ
- );
-}
-
::basegfx::B3DVector Direction3DToB3DVector( const drawing::Direction3D& rDirection)
{
return ::basegfx::B3DVector(
@@ -173,39 +164,6 @@ drawing::Position3D B3DPointToPosition3D( const ::basegfx::B3DPoint& rPoint)
);
}
-drawing::PolyPolygonShape3D MakeLine3D(
- const drawing::Position3D & rStart,
- const drawing::Position3D & rEnd )
-{
- drawing::PolyPolygonShape3D aPP;
-
- aPP.SequenceX.realloc(1);
- aPP.SequenceY.realloc(1);
- aPP.SequenceZ.realloc(1);
-
- drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray();
- drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray();
- drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray();
-
- pOuterSequenceX->realloc(2);
- pOuterSequenceY->realloc(2);
- pOuterSequenceZ->realloc(2);
-
- double* pInnerSequenceX = pOuterSequenceX->getArray();
- double* pInnerSequenceY = pOuterSequenceY->getArray();
- double* pInnerSequenceZ = pOuterSequenceZ->getArray();
-
- *pInnerSequenceX++ = rStart.PositionX;
- *pInnerSequenceY++ = rStart.PositionY;
- *pInnerSequenceZ++ = rStart.PositionZ;
-
- *pInnerSequenceX++ = rEnd.PositionX;
- *pInnerSequenceY++ = rEnd.PositionY;
- *pInnerSequenceZ++ = rEnd.PositionZ;
-
- return aPP;
-}
-
void AddPointToPoly( drawing::PolyPolygonShape3D& rPoly, const drawing::Position3D& rPos, sal_Int32 nPolygonIndex )
{
if(nPolygonIndex<0)
@@ -265,6 +223,29 @@ drawing::Position3D getPointFromPoly( const drawing::PolyPolygonShape3D& rPolygo
return aRet;
}
+void addPolygon( drawing::PolyPolygonShape3D& rRet, const drawing::PolyPolygonShape3D& rAdd )
+{
+ sal_Int32 nAddOuterCount = rAdd.SequenceX.getLength();
+ sal_Int32 nOuterCount = rRet.SequenceX.getLength() + nAddOuterCount;
+ rRet.SequenceX.realloc( nOuterCount );
+ rRet.SequenceY.realloc( nOuterCount );
+ rRet.SequenceZ.realloc( nOuterCount );
+
+ sal_Int32 nIndex = 0;
+ sal_Int32 nOuter = nOuterCount - nAddOuterCount;
+ for( ; nOuter < nOuterCount; nOuter++ )
+ {
+ if( nIndex >= nAddOuterCount )
+ break;
+
+ rRet.SequenceX[nOuter] = rAdd.SequenceX[nIndex];
+ rRet.SequenceY[nOuter] = rAdd.SequenceY[nIndex];
+ rRet.SequenceZ[nOuter] = rAdd.SequenceZ[nIndex];
+
+ nIndex++;
+ }
+}
+
void appendPoly( drawing::PolyPolygonShape3D& rRet, const drawing::PolyPolygonShape3D& rAdd )
{
sal_Int32 nOuterCount = Max( rRet.SequenceX.getLength(), rAdd.SequenceX.getLength() );
@@ -298,110 +279,6 @@ void appendPoly( drawing::PolyPolygonShape3D& rRet, const drawing::PolyPolygonSh
}
}
-/*
-drawing::PolyPolygonShape3D operator+(
- const drawing::PolyPolygonShape3D& rPoly1
- , const drawing::PolyPolygonShape3D& rPoly2 )
-{
- drawing::PolyPolygonShape3D aRet;
-
- sal_Int32 nOuterCount = Max( rPoly1.SequenceX.getLength(), rPoly2.SequenceX.getLength() );
- aRet.SequenceX.realloc(nOuterCount);
- aRet.SequenceY.realloc(nOuterCount);
- aRet.SequenceZ.realloc(nOuterCount);
-
- for( sal_Int32 nOuter=0;nOuter<nOuterCount;nOuter++ )
- {
- sal_Int32 nPointCount_1 = 0;
- sal_Int32 nPointCount_2 = 0;
- if(nOuter<rPoly1.SequenceX.getLength())
- nPointCount_1 = rPoly1.SequenceX[nOuter].getLength();
- if(nOuter<rPoly2.SequenceX.getLength())
- nPointCount_2 = rPoly2.SequenceX[nOuter].getLength();
-
- sal_Int32 nPointCount = nPointCount_1 + nPointCount_2;
-
- aRet.SequenceX[nOuter].realloc(nPointCount);
- aRet.SequenceY[nOuter].realloc(nPointCount);
- aRet.SequenceZ[nOuter].realloc(nPointCount);
-
- sal_Int32 nPointTarget=0;
-
- {
- sal_Int32 nPointSourceCount = nPointCount_1;
- const drawing::PolyPolygonShape3D* pPoly = &rPoly1;
- for( sal_Int32 nPointSource=0; nPointSource<nPointSourceCount ; nPointSource++,nPointTarget++ )
- {
- aRet.SequenceX[nOuter][nPointTarget] = pPoly->SequenceX[nOuter][nPointSource];
- aRet.SequenceY[nOuter][nPointTarget] = pPoly->SequenceY[nOuter][nPointSource];
- aRet.SequenceZ[nOuter][nPointTarget] = pPoly->SequenceZ[nOuter][nPointSource];
- }
- }
- {
- sal_Int32 nPointSourceCount = nPointCount_2;
- const drawing::PolyPolygonShape3D* pPoly = &rPoly2;
- for( sal_Int32 nPointSource=nPointSourceCount; nPointSource-- ; nPointTarget++ )
- {
- aRet.SequenceX[nOuter][nPointTarget] = pPoly->SequenceX[nOuter][nPointSource];
- aRet.SequenceY[nOuter][nPointTarget] = pPoly->SequenceY[nOuter][nPointSource];
- aRet.SequenceZ[nOuter][nPointTarget] = pPoly->SequenceZ[nOuter][nPointSource];
- }
- }
- }
- return aRet;
-}
-*/
-/*
-drawing::PolyPolygonShape3D operator+(
- const drawing::PolyPolygonShape3D& rPoly1
- , const drawing::PolyPolygonShape3D& rPoly2 )
-{
- drawing::PolyPolygonShape3D aRet;
-
- sal_Int32 nOuterCount = rPoly1.SequenceX.getLength()+rPoly2.SequenceX.getLength();
- aRet.SequenceX.realloc(nOuterCount);
- aRet.SequenceY.realloc(nOuterCount);
- aRet.SequenceZ.realloc(nOuterCount);
-
- drawing::DoubleSequence* pOuterSequenceX = aRet.SequenceX.getArray();
- drawing::DoubleSequence* pOuterSequenceY = aRet.SequenceY.getArray();
- drawing::DoubleSequence* pOuterSequenceZ = aRet.SequenceZ.getArray();
-
- for( sal_Int32 nOuterTarget=0;nOuterTarget<nOuterCount;nOuterTarget++ )
- {
- const drawing::PolyPolygonShape3D* pPoly = &rPoly1;
- sal_Int32 nOuterSource = nOuterTarget;
- if(nOuterTarget>=rPoly1.SequenceX.getLength())
- {
- pPoly = &rPoly2;
- nOuterSource -= rPoly1.SequenceX.getLength();
- }
-
- sal_Int32 nPointCount = pPoly->SequenceX[nOuterSource].getLength();
-
- pOuterSequenceX->realloc(nPointCount);
- pOuterSequenceY->realloc(nPointCount);
- pOuterSequenceZ->realloc(nPointCount);
-
- double* pInnerSequenceX = pOuterSequenceX->getArray();
- double* pInnerSequenceY = pOuterSequenceY->getArray();
- double* pInnerSequenceZ = pOuterSequenceZ->getArray();
-
- for( sal_Int32 nPoint=0;nPoint<nPointCount;nPoint++ )
- {
- *pInnerSequenceX = pPoly->SequenceX[nOuterSource][nPoint];
- *pInnerSequenceY = pPoly->SequenceY[nOuterSource][nPoint];
- *pInnerSequenceZ = pPoly->SequenceZ[nOuterSource][nPoint];
-
- pInnerSequenceX++; pInnerSequenceY++; pInnerSequenceZ++;
- }
-
- pOuterSequenceX++; pOuterSequenceY++; pOuterSequenceZ++;
- }
- return aRet;
-}
-*/
-
drawing::PolyPolygonShape3D BezierToPoly(
const drawing::PolyPolygonBezierCoords& rBezier )
{
@@ -494,26 +371,6 @@ drawing::Position3D operator+( const drawing::Position3D& rPos
);
}
-drawing::Direction3D operator+( const drawing::Direction3D& rDirection
- , const drawing::Direction3D& rDirectionAdd)
-{
- return drawing::Direction3D(
- rDirection.DirectionX + rDirectionAdd.DirectionX
- , rDirection.DirectionY + rDirectionAdd.DirectionY
- , rDirection.DirectionZ + rDirectionAdd.DirectionZ
- );
-}
-
-drawing::Position3D operator-( const drawing::Position3D& rPos
- , const drawing::Direction3D& rDirection)
-{
- return drawing::Position3D(
- rPos.PositionX - rDirection.DirectionX
- , rPos.PositionY - rDirection.DirectionY
- , rPos.PositionZ - rDirection.DirectionZ
- );
-}
-
drawing::Direction3D operator-( const drawing::Position3D& rPos1
, const drawing::Position3D& rPos2)
{
@@ -524,16 +381,6 @@ drawing::Direction3D operator-( const drawing::Position3D& rPos1
);
}
-drawing::Direction3D operator*( const drawing::Direction3D& rDirection
- , double fFraction)
-{
- return drawing::Direction3D(
- fFraction*rDirection.DirectionX
- , fFraction*rDirection.DirectionY
- , fFraction*rDirection.DirectionZ
- );
-}
-
bool operator==( const drawing::Position3D& rPos1
, const drawing::Position3D& rPos2)
{
@@ -597,16 +444,6 @@ uno::Sequence< double > Position3DToSequence( const drawing::Position3D& rPositi
return aRet;
}
-drawing::Direction3D operator/( const drawing::Direction3D& rDirection, double f )
-{
- OSL_ENSURE(f,"a Direction3D is divided by NULL");
- return drawing::Direction3D(
- rDirection.DirectionX/f
- , rDirection.DirectionY/f
- , rDirection.DirectionZ/f
- );
-}
-
using namespace ::com::sun::star::chart2;
uno::Sequence< double > DataSequenceToDoubleSequence(
diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx
index 7e418f04ab7b..835872aad8e4 100644
--- a/chart2/source/tools/ConfigColorScheme.cxx
+++ b/chart2/source/tools/ConfigColorScheme.cxx
@@ -56,6 +56,12 @@ static const OUString aSeriesPropName( RTL_CONSTASCII_USTRINGPARAM("Series"));
namespace chart
{
+
+uno::Reference< chart2::XColorScheme > createConfigColorScheme( const uno::Reference< uno::XComponentContext > & xContext )
+{
+ return new ConfigColorScheme( xContext );
+}
+
namespace impl
{
class ChartConfigItem : public ::utl::ConfigItem
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index 8c3431905699..7203f9ad6e63 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -36,6 +36,7 @@
#include "macros.hxx"
#include "ContainerHelper.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
#include <com/sun/star/chart2/data/LabelOrigin.hpp>
@@ -57,6 +58,7 @@
#include <set>
using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
@@ -155,6 +157,50 @@ void lcl_getCooSysAndChartTypeOfSeries(
}
}
+void lcl_insertOrDeleteDataLabelsToSeriesAndAllPoints( const Reference< chart2::XDataSeries >& xSeries, bool bInsert )
+{
+ try
+ {
+ Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
+ if( xSeriesProperties.is() )
+ {
+ DataPointLabel aLabelAtSeries;
+ xSeriesProperties->getPropertyValue( C2U( "Label" ) ) >>= aLabelAtSeries;
+ aLabelAtSeries.ShowNumber = bInsert;
+ if( !bInsert )
+ {
+ aLabelAtSeries.ShowNumberInPercent = false;
+ aLabelAtSeries.ShowCategoryName = false;
+ }
+ xSeriesProperties->setPropertyValue( C2U( "Label" ), uno::makeAny( aLabelAtSeries ) );
+ uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
+ if( xSeriesProperties->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= aAttributedDataPointIndexList )
+ {
+ for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
+ {
+ Reference< beans::XPropertySet > xPointProp( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]) );
+ if( xPointProp.is() )
+ {
+ DataPointLabel aLabel;
+ xPointProp->getPropertyValue( C2U( "Label" ) ) >>= aLabel;
+ aLabel.ShowNumber = bInsert;
+ if( !bInsert )
+ {
+ aLabel.ShowNumberInPercent = false;
+ aLabel.ShowCategoryName = false;
+ }
+ xPointProp->setPropertyValue( C2U( "Label" ), uno::makeAny( aLabel ) );
+ }
+ }
+ }
+ }
+ }
+ catch( uno::Exception &e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+}
+
} // anonymous namespace
// ----------------------------------------
@@ -644,5 +690,232 @@ bool areAllSeriesAttachedToSameAxis( const uno::Reference< chart2::XChartType >&
}
}
+namespace
+{
+
+bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSequence >& xDataSequence )
+{
+ if( !xDataSequence.is() )
+ return false;
+ uno::Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY );
+ if( xProp.is() )
+ {
+ uno::Sequence< sal_Int32 > aHiddenValues;
+ try
+ {
+ xProp->getPropertyValue( C2U( "HiddenValues" ) ) >>= aHiddenValues;
+ if( !aHiddenValues.getLength() )
+ return true;
+ }
+ catch( uno::Exception& e )
+ {
+ (void)e; // avoid warning
+ return true;
+ }
+ }
+ if( xDataSequence->getData().getLength() )
+ return true;
+ return false;
+}
+
+}
+
+bool hasUnhiddenData( const uno::Reference< chart2::XDataSeries >& xSeries )
+{
+ uno::Reference< chart2::data::XDataSource > xDataSource =
+ uno::Reference< chart2::data::XDataSource >( xSeries, uno::UNO_QUERY );
+
+ uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aDataSequences = xDataSource->getDataSequences();
+
+ for(sal_Int32 nN = aDataSequences.getLength();nN--;)
+ {
+ if( !aDataSequences[nN].is() )
+ continue;
+ if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getValues() ) )
+ return true;
+ if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getLabel() ) )
+ return true;
+ }
+ return false;
+}
+
+struct lcl_LessIndex
+{
+ inline bool operator() ( const sal_Int32& first, const sal_Int32& second )
+ {
+ return ( first < second );
+ }
+};
+
+sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nIndex, const Reference< chart2::data::XDataSequence >& xDataSequence, bool bTranslate )
+{
+ if( !bTranslate )
+ return nIndex;
+
+ try
+ {
+ uno::Reference<beans::XPropertySet> xProp( xDataSequence, uno::UNO_QUERY );
+ if( xProp.is())
+ {
+ Sequence<sal_Int32> aHiddenIndicesSeq;
+ xProp->getPropertyValue( C2U("HiddenValues") ) >>= aHiddenIndicesSeq;
+ if( aHiddenIndicesSeq.getLength() )
+ {
+ ::std::vector< sal_Int32 > aHiddenIndices( ContainerHelper::SequenceToVector( aHiddenIndicesSeq ) );
+ ::std::sort( aHiddenIndices.begin(), aHiddenIndices.end(), lcl_LessIndex() );
+
+ sal_Int32 nHiddenCount = static_cast<sal_Int32>(aHiddenIndices.size());
+ for( sal_Int32 nN = 0; nN < nHiddenCount; ++nN)
+ {
+ if( aHiddenIndices[nN] <= nIndex )
+ nIndex += 1;
+ else
+ break;
+ }
+ }
+ }
+ }
+ catch (const beans::UnknownPropertyException&)
+ {
+ }
+ return nIndex;
+}
+
+bool hasDataLabelsAtSeries( const Reference< chart2::XDataSeries >& xSeries )
+{
+ bool bRet = false;
+ try
+ {
+ Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY );
+ if( xProp.is() )
+ {
+ DataPointLabel aLabel;
+ if( (xProp->getPropertyValue( C2U( "Label" ) ) >>= aLabel) )
+ bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent || aLabel.ShowCategoryName;
+ }
+ }
+ catch( uno::Exception &e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ return bRet;
+}
+
+bool hasDataLabelsAtPoints( const Reference< chart2::XDataSeries >& xSeries )
+{
+ bool bRet = false;
+ try
+ {
+ Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
+ if( xSeriesProperties.is() )
+ {
+ uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
+ if( xSeriesProperties->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= aAttributedDataPointIndexList )
+ {
+ for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
+ {
+ Reference< beans::XPropertySet > xPointProp( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]) );
+ if( xPointProp.is() )
+ {
+ DataPointLabel aLabel;
+ if( (xPointProp->getPropertyValue( C2U( "Label" ) ) >>= aLabel) )
+ bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent || aLabel.ShowCategoryName;
+ if( bRet )
+ break;
+ }
+ }
+ }
+ }
+ }
+ catch( uno::Exception &e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ return bRet;
+}
+
+bool hasDataLabelAtPoint( const Reference< chart2::XDataSeries >& xSeries, sal_Int32 nPointIndex )
+{
+ bool bRet = false;
+ try
+ {
+ Reference< beans::XPropertySet > xProp;
+ Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY );
+ if( xSeriesProperties.is() )
+ {
+ uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
+ if( xSeriesProperties->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= aAttributedDataPointIndexList )
+ {
+ ::std::vector< sal_Int32 > aIndices( ContainerHelper::SequenceToVector( aAttributedDataPointIndexList ) );
+ ::std::vector< sal_Int32 >::iterator aIt = ::std::find( aIndices.begin(), aIndices.end(), nPointIndex );
+ if( aIt != aIndices.end())
+ xProp = xSeries->getDataPointByIndex(nPointIndex);
+ else
+ xProp = xSeriesProperties;
+ }
+ if( xProp.is() )
+ {
+ DataPointLabel aLabel;
+ if( (xProp->getPropertyValue( C2U( "Label" ) ) >>= aLabel) )
+ bRet = aLabel.ShowNumber || aLabel.ShowNumberInPercent || aLabel.ShowCategoryName;
+ }
+ }
+ }
+ catch( uno::Exception &e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ return bRet;
+}
+
+void insertDataLabelsToSeriesAndAllPoints( const Reference< chart2::XDataSeries >& xSeries )
+{
+ lcl_insertOrDeleteDataLabelsToSeriesAndAllPoints( xSeries, true /*bInsert*/ );
+}
+
+void deleteDataLabelsFromSeriesAndAllPoints( const Reference< chart2::XDataSeries >& xSeries )
+{
+ lcl_insertOrDeleteDataLabelsToSeriesAndAllPoints( xSeries, false /*bInsert*/ );
+}
+
+
+void insertDataLabelToPoint( const Reference< beans::XPropertySet >& xPointProp )
+{
+ try
+ {
+ if( xPointProp.is() )
+ {
+ DataPointLabel aLabel;
+ xPointProp->getPropertyValue( C2U( "Label" ) ) >>= aLabel;
+ aLabel.ShowNumber = true;
+ xPointProp->setPropertyValue( C2U( "Label" ), uno::makeAny( aLabel ) );
+ }
+ }
+ catch( uno::Exception &e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+}
+
+void deleteDataLabelsFromPoint( const Reference< beans::XPropertySet >& xPointProp )
+{
+ try
+ {
+ if( xPointProp.is() )
+ {
+ DataPointLabel aLabel;
+ xPointProp->getPropertyValue( C2U( "Label" ) ) >>= aLabel;
+ aLabel.ShowNumber = false;
+ aLabel.ShowNumberInPercent = false;
+ aLabel.ShowCategoryName = false;
+ xPointProp->setPropertyValue( C2U( "Label" ), uno::makeAny( aLabel ) );
+ }
+ }
+ catch( uno::Exception &e)
+ {
+ ASSERT_EXCEPTION( e );
+ }
+}
+
} // namespace DataSeriesHelper
} // namespace chart
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index 0de52f8a53ea..37c3a609ac9f 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -40,6 +40,8 @@
#include "ContainerHelper.hxx"
#include "ControllerLockGuard.hxx"
#include "PropertyHelper.hxx"
+#include "CachedDataSequence.hxx"
+#include "LabeledDataSequence.hxx"
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
@@ -117,6 +119,41 @@ void lcl_addErrorBarRanges(
} // anonymous namespace
+Reference< chart2::data::XDataSource > DataSourceHelper::createDataSource(
+ const Sequence< Reference< chart2::data::XLabeledDataSequence > >& rSequences )
+{
+ return new DataSource(rSequences);
+}
+
+Reference< chart2::data::XDataSequence > DataSourceHelper::createCachedDataSequence()
+{
+ return new ::chart::CachedDataSequence();
+}
+
+Reference< chart2::data::XDataSequence > DataSourceHelper::createCachedDataSequence( const ::rtl::OUString& rSingleText )
+{
+ return new ::chart::CachedDataSequence( rSingleText );
+}
+
+Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
+ const Reference< chart2::data::XDataSequence >& xValues ,
+ const Reference< chart2::data::XDataSequence >& xLabels )
+{
+ return new ::chart::LabeledDataSequence( xValues, xLabels );
+}
+
+Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
+ const Reference< chart2::data::XDataSequence >& xValues )
+{
+ return new ::chart::LabeledDataSequence( xValues );
+}
+
+Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
+ const Reference< uno::XComponentContext >& xContext )
+{
+ return new ::chart::LabeledDataSequence( xContext );
+}
+
uno::Sequence< beans::PropertyValue > DataSourceHelper::createArguments(
bool bUseColumns, bool bFirstCellAsLabel, bool bHasCategories )
{
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 8af5b412c5c1..fbc8042af27b 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -503,8 +503,12 @@ void DiagramHelper::setDimension(
try
{
- //change all coordinate systems:
+ bool rbFound = false;
+ bool rbAmbiguous = true;
+ StackMode eStackMode = DiagramHelper::getStackMode( xDiagram, rbFound, rbAmbiguous );
+ bool bIsSupportingOnlyDeepStackingFor3D=false;
+ //change all coordinate systems:
Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY_THROW );
Sequence< Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() );
for( sal_Int32 nCS = 0; nCS < aCooSysList.getLength(); ++nCS )
@@ -520,6 +524,7 @@ void DiagramHelper::setDimension(
for( sal_Int32 nT = 0; nT < aChartTypeList.getLength(); ++nT )
{
Reference< XChartType > xChartType( aChartTypeList[nT], uno::UNO_QUERY );
+ bIsSupportingOnlyDeepStackingFor3D = ChartTypeHelper::isSupportingOnlyDeepStackingFor3D( xChartType );
if(!xNewCooSys.is())
{
xNewCooSys = xChartType->createCoordinateSystem( nNewDimensionCount );
@@ -533,6 +538,12 @@ void DiagramHelper::setDimension(
// replace the old coordinate system at all places where it was used
DiagramHelper::replaceCoordinateSystem( xDiagram, xOldCooSys, xNewCooSys );
}
+
+ //correct stack mode if necessary
+ if( nNewDimensionCount==3 && eStackMode != StackMode_Z_STACKED && bIsSupportingOnlyDeepStackingFor3D )
+ DiagramHelper::setStackMode( xDiagram, StackMode_Z_STACKED );
+ else if( nNewDimensionCount==2 && eStackMode == StackMode_Z_STACKED )
+ DiagramHelper::setStackMode( xDiagram, StackMode_NONE );
}
catch( uno::Exception & ex )
{
@@ -556,6 +567,8 @@ void DiagramHelper::replaceCoordinateSystem(
{
try
{
+ Reference< chart2::data::XLabeledDataSequence > xCategories = DiagramHelper::getCategoriesFromDiagram( xDiagram );
+
// move chart types of xCooSysToReplace to xReplacement
Reference< XChartTypeContainer > xCTCntCooSys( xCooSysToReplace, uno::UNO_QUERY_THROW );
Reference< XChartTypeContainer > xCTCntReplacement( xReplacement, uno::UNO_QUERY_THROW );
@@ -563,6 +576,9 @@ void DiagramHelper::replaceCoordinateSystem(
xCont->removeCoordinateSystem( xCooSysToReplace );
xCont->addCoordinateSystem( xReplacement );
+
+ if( xCategories.is() )
+ DiagramHelper::setCategoriesToDiagram( xCategories, xDiagram );
}
catch( uno::Exception & ex )
{
@@ -1304,6 +1320,8 @@ bool DiagramHelper::isSupportingFloorAndWall( const Reference<
return false;
if( xType.is() && xType->getChartType().match(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
return false;
+ if( xType.is() && xType->getChartType().match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
+ return false;
}
return true;
}
diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx
index 6a704dbc54d8..a1b8b7c02106 100644
--- a/chart2/source/tools/ErrorBar.cxx
+++ b/chart2/source/tools/ErrorBar.cxx
@@ -166,11 +166,16 @@ bool lcl_isInternalData( const uno::Reference< chart2::data::XLabeledDataSequenc
namespace chart
{
+uno::Reference< beans::XPropertySet > createErrorBar( const uno::Reference< uno::XComponentContext > & xContext )
+{
+ return new ErrorBar( xContext );
+}
+
ErrorBar::ErrorBar(
uno::Reference< uno::XComponentContext > const & xContext ) :
::property::OPropertySet( m_aMutex ),
m_xContext( xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
ErrorBar::ErrorBar( const ErrorBar & rOther ) :
@@ -178,7 +183,7 @@ ErrorBar::ErrorBar( const ErrorBar & rOther ) :
impl::ErrorBar_Base(),
::property::OPropertySet( rOther, m_aMutex ),
m_xContext( rOther.m_xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
if( ! rOther.m_aDataSequences.empty())
{
diff --git a/chart2/source/tools/ImplUndoManager.cxx b/chart2/source/tools/ImplUndoManager.cxx
index d5eab1b4b652..91d5f869bc53 100644
--- a/chart2/source/tools/ImplUndoManager.cxx
+++ b/chart2/source/tools/ImplUndoManager.cxx
@@ -37,6 +37,7 @@
#include "ControllerLockGuard.hxx"
#include "PropertyHelper.hxx"
#include "DataSourceHelper.hxx"
+#include "ChartModelHelper.hxx"
#include <com/sun/star/chart/XChartDataArray.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -170,6 +171,9 @@ void UndoElement::applyModelContentToModel(
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());
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index 3257821e521f..4d8f7be112ff 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -138,13 +138,6 @@ public:
void setColumnLabels( const ::std::vector< OUString > & rNewColumnLabels );
::std::vector< OUString > getColumnLabels() const;
- /** returns whether the data source was created by putting sequence contents
- into columns (true) or rows (false)
- */
- bool setDataByDataSource(
- const Reference< chart2::data::XDataSource > & xDataSource,
- const Sequence< beans::PropertyValue > & rArgs );
-
#if OSL_DEBUG_LEVEL > 2
void traceData() const;
#endif
@@ -400,8 +393,8 @@ void InternalData::swapAllDataAtIndexWithNext( sal_Int32 nAtIndex, bool bDataInC
bool InternalData::enlargeData( sal_Int32 nColumnCount, sal_Int32 nRowCount )
{
- sal_Int32 nNewColumnCount( ::std::max<sal_Int32>(1, ::std::max<sal_Int32>( m_nColumnCount, nColumnCount )));
- sal_Int32 nNewRowCount( ::std::max<sal_Int32>(1, ::std::max<sal_Int32>( m_nRowCount, nRowCount )));
+ sal_Int32 nNewColumnCount( ::std::max<sal_Int32>( m_nColumnCount, nColumnCount ) );
+ sal_Int32 nNewRowCount( ::std::max<sal_Int32>( m_nRowCount, nRowCount ) );
sal_Int32 nNewSize( nNewColumnCount*nNewRowCount );
bool bGrow = (nNewSize > m_nColumnCount*m_nRowCount);
@@ -419,9 +412,9 @@ bool InternalData::enlargeData( sal_Int32 nColumnCount, sal_Int32 nRowCount )
m_aData.resize( nNewSize );
m_aData = aNewData;
- m_nColumnCount = nNewColumnCount;
- m_nRowCount = nNewRowCount;
}
+ m_nColumnCount = nNewColumnCount;
+ m_nRowCount = nNewRowCount;
return bGrow;
}
@@ -628,49 +621,6 @@ void InternalData::setColumnLabels( const ::std::vector< OUString > & rNewColumn
return m_aColumnLabels;
}
-bool InternalData::setDataByDataSource(
- const Reference< chart2::data::XDataSource > & xDataSource,
- const Sequence< beans::PropertyValue > & rArgs )
-{
- OUString aRangeRepresentation;
- uno::Sequence< sal_Int32 > aSequenceMapping; //yyyy todo...? InternalData::setDataByDataSource
- bool bUseColumns = true;
- bool bFirstCellAsLabel = true;
- bool bHasCategories = true;
-
- DataSourceHelper::readArguments( rArgs, aRangeRepresentation, aSequenceMapping, bUseColumns, bFirstCellAsLabel, bHasCategories );
-
- typedef ::std::vector< Reference< chart2::data::XLabeledDataSequence > > tLSeqCntType;
- tLSeqCntType aLSeqVec( ContainerHelper::SequenceToVector( xDataSource->getDataSequences()));
- tLSeqCntType::const_iterator aIt( aLSeqVec.begin());
- const tLSeqCntType::const_iterator aEndIt( aLSeqVec.end());
-
- if( bHasCategories && aIt != aEndIt )
- {
- if( bUseColumns )
- setRowLabels( ContainerHelper::SequenceToVector(
- DataSequenceToStringSequence( (*aIt)->getValues() )));
- else
- setColumnLabels( ContainerHelper::SequenceToVector(
- DataSequenceToStringSequence( (*aIt)->getValues() )));
- ++aIt;
- }
-
- ::std::vector< Sequence< double > > aDataVec;
- ::std::vector< OUString > aLabelVec;
- transform( aIt, aEndIt, back_inserter( aDataVec ), lcl_ValuesOfLabeledSequence());
- transform( aIt, aEndIt, back_inserter( aLabelVec ), lcl_LabelOfLabeledSequence());
-
- setData( ContainerHelper::ContainerToSequence( aDataVec ), bUseColumns );
-
- if( bUseColumns )
- setColumnLabels( aLabelVec );
- else
- setRowLabels( aLabelVec );
-
- return bUseColumns;
-}
-
#if OSL_DEBUG_LEVEL > 2
void InternalData::traceData() const
{
@@ -789,6 +739,8 @@ Sequence< Reference< chart2::data::XLabeledDataSequence > >
{
::std::vector< OUString > aLabels( rInternalData.getColumnLabels());
OSL_ASSERT( static_cast< size_t >( nNewIndex ) < aLabels.size());
+ if( aLabels.size() <= static_cast< size_t >( nNewIndex ) )
+ aLabels.resize( nNewIndex+1 );
aLabels[nNewIndex] = impl::FlattenStringSequence( xLabel->getTextualData());
rInternalData.setColumnLabels( aLabels );
Reference< chart2::data::XDataSequence > xNewLabel(
@@ -1049,8 +1001,9 @@ Reference< chart2::data::XDataSource > SAL_CALL InternalDataProvider::createData
impl::InternalData & rData( getInternalData());
// categories
- aResultLSeqVec.push_back(
- new LabeledDataSequence( createDataSequenceAndAddToMap( lcl_aCategoriesRangeName, lcl_aCategoriesRoleName )));
+ if ( bHasCategories )
+ aResultLSeqVec.push_back(
+ new LabeledDataSequence( createDataSequenceAndAddToMap( lcl_aCategoriesRangeName, lcl_aCategoriesRoleName )));
// data with labels
::std::vector< Reference< chart2::data::XLabeledDataSequence > > aDataVec;
diff --git a/chart2/source/tools/LabeledDataSequence.cxx b/chart2/source/tools/LabeledDataSequence.cxx
index 83c3a1e5a059..bb0ec7053497 100644
--- a/chart2/source/tools/LabeledDataSequence.cxx
+++ b/chart2/source/tools/LabeledDataSequence.cxx
@@ -46,13 +46,13 @@ namespace chart
LabeledDataSequence::LabeledDataSequence( const Reference< uno::XComponentContext > & xContext ) :
m_xContext( xContext ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{}
LabeledDataSequence::LabeledDataSequence(
const uno::Reference< chart2::data::XDataSequence > & rValues ) :
m_xData( rValues ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
ModifyListenerHelper::addListener( m_xData, m_xModifyEventForwarder );
}
@@ -62,7 +62,7 @@ LabeledDataSequence::LabeledDataSequence(
const uno::Reference< chart2::data::XDataSequence > & rLabel ) :
m_xData( rValues ),
m_xLabel( rLabel ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
ModifyListenerHelper::addListener( m_xData, m_xModifyEventForwarder );
ModifyListenerHelper::addListener( m_xLabel, m_xModifyEventForwarder );
diff --git a/chart2/source/tools/LegendHelper.cxx b/chart2/source/tools/LegendHelper.cxx
index 6d21d13f0dc7..60da06f2b638 100644
--- a/chart2/source/tools/LegendHelper.cxx
+++ b/chart2/source/tools/LegendHelper.cxx
@@ -32,18 +32,66 @@
#include "precompiled_chart2.hxx"
#include "LegendHelper.hxx"
#include "macros.hxx"
+#include <com/sun/star/chart2/LegendExpansion.hpp>
+#include <com/sun/star/chart2/LegendPosition.hpp>
+#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XLegend.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <tools/debug.hxx>
using namespace ::com::sun::star;
+using ::com::sun::star::uno::Reference;
//.............................................................................
namespace chart
{
//.............................................................................
+
+//static
+Reference< chart2::XLegend > LegendHelper::showLegend( const Reference< frame::XModel >& xModel
+ , const uno::Reference< uno::XComponentContext >& xContext )
+{
+ uno::Reference< chart2::XLegend > xLegend = LegendHelper::getLegend( xModel, xContext, true );
+ uno::Reference< beans::XPropertySet > xProp( xLegend, uno::UNO_QUERY );
+ if( xProp.is())
+ {
+ xProp->setPropertyValue( C2U("Show"), uno::makeAny(sal_True) );
+
+ chart2::RelativePosition aRelativePosition;
+ if( !(xProp->getPropertyValue( C2U( "RelativePosition" )) >>= aRelativePosition) )
+ {
+ chart2::LegendPosition ePos = chart2::LegendPosition_LINE_END;
+ if( !(xProp->getPropertyValue( C2U( "AnchorPosition" )) >>= ePos ) )
+ xProp->setPropertyValue( C2U( "AnchorPosition" ), uno::makeAny( ePos ));
+
+ chart2::LegendExpansion eExpansion =
+ ( ePos == chart2::LegendPosition_LINE_END ||
+ ePos == chart2::LegendPosition_LINE_START )
+ ? chart2::LegendExpansion_HIGH
+ : chart2::LegendExpansion_WIDE;
+ if( !(xProp->getPropertyValue( C2U( "Expansion" )) >>= eExpansion ) )
+ xProp->setPropertyValue( C2U( "Expansion" ), uno::makeAny( eExpansion ));
+
+ xProp->setPropertyValue( C2U( "RelativePosition" ), uno::Any());
+ }
+
+ }
+ return xLegend;
+}
+
+//static
+void LegendHelper::hideLegend( const Reference< frame::XModel >& xModel )
+{
+ uno::Reference< chart2::XLegend > xLegend = LegendHelper::getLegend( xModel, 0, false );
+ uno::Reference< beans::XPropertySet > xProp( xLegend, uno::UNO_QUERY );
+ if( xProp.is())
+ {
+ xProp->setPropertyValue( C2U("Show"), uno::makeAny(sal_False) );
+ }
+}
+
// static
uno::Reference< chart2::XLegend > LegendHelper::getLegend(
const uno::Reference< frame::XModel >& xModel
diff --git a/chart2/source/tools/ModifyListenerHelper.cxx b/chart2/source/tools/ModifyListenerHelper.cxx
index 42943d192c0f..722ecb82e155 100644
--- a/chart2/source/tools/ModifyListenerHelper.cxx
+++ b/chart2/source/tools/ModifyListenerHelper.cxx
@@ -106,6 +106,11 @@ namespace chart
namespace ModifyListenerHelper
{
+uno::Reference< util::XModifyListener > createModifyEventForwarder()
+{
+ return new ModifyEventForwarder();
+}
+
ModifyEventForwarder::ModifyEventForwarder() :
::cppu::WeakComponentImplHelper2<
::com::sun::star::util::XModifyBroadcaster,
@@ -114,11 +119,6 @@ ModifyEventForwarder::ModifyEventForwarder() :
{
}
-void ModifyEventForwarder::FireEvent( const Reference< uno::XWeak > & xSource )
-{
- lcl_fireModifyEvent( m_aModifyListeners, xSource, 0 );
-}
-
void ModifyEventForwarder::FireEvent( const lang::EventObject & rEvent )
{
lcl_fireModifyEvent( m_aModifyListeners, Reference< uno::XWeak >(), & rEvent );
diff --git a/chart2/source/tools/NameContainer.cxx b/chart2/source/tools/NameContainer.cxx
index 3fefe3a920df..815f72257490 100644
--- a/chart2/source/tools/NameContainer.cxx
+++ b/chart2/source/tools/NameContainer.cxx
@@ -50,6 +50,12 @@ namespace chart
{
//.............................................................................
+uno::Reference< container::XNameContainer > createNameContainer(
+ const ::com::sun::star::uno::Type& rType, const rtl::OUString& rServicename, const rtl::OUString& rImplementationName )
+{
+ return new NameContainer( rType, rServicename, rImplementationName );
+}
+
NameContainer::NameContainer( const ::com::sun::star::uno::Type& rType, const OUString& rServicename, const OUString& rImplementationName )
: m_aType( rType )
, m_aServicename( rServicename )
diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx
index d3988bb93671..4ba7f99edcc1 100644
--- a/chart2/source/tools/OPropertySet.cxx
+++ b/chart2/source/tools/OPropertySet.cxx
@@ -63,7 +63,8 @@ OPropertySet::OPropertySet( ::osl::Mutex & par_rMutex ) :
// the following causes a warning; there seems to be no way to avoid it
OPropertySetHelper( static_cast< OBroadcastHelper & >( *this )),
m_rMutex( par_rMutex ),
- m_pImplProperties( new impl::ImplOPropertySet() )
+ m_pImplProperties( new impl::ImplOPropertySet() ),
+ m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault(false)
{
}
@@ -71,7 +72,8 @@ OPropertySet::OPropertySet( const OPropertySet & rOther, ::osl::Mutex & par_rMut
OBroadcastHelper( par_rMutex ),
// the following causes a warning; there seems to be no way to avoid it
OPropertySetHelper( static_cast< OBroadcastHelper & >( *this )),
- m_rMutex( par_rMutex )
+ m_rMutex( par_rMutex ),
+ m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault(false)
{
// /--
MutexGuard aGuard( m_rMutex );
@@ -80,6 +82,11 @@ OPropertySet::OPropertySet( const OPropertySet & rOther, ::osl::Mutex & par_rMut
// \--
}
+void OPropertySet::SetNewValuesExplicitlyEvenIfTheyEqualDefault()
+{
+ m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault = true;
+}
+
OPropertySet::~OPropertySet()
{}
@@ -322,6 +329,8 @@ sal_Bool SAL_CALL OPropertySet::convertFastPropertyValue
}
}
rConvertedValue = rValue;
+ if( !m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault && rOldValue == rConvertedValue )
+ return sal_False;//no change necessary
return sal_True;
}
@@ -341,7 +350,20 @@ void SAL_CALL OPropertySet::setFastPropertyValue_NoBroadcast
}
#endif
+ Any aDefault;
+ try
+ {
+ aDefault = GetDefaultValue( nHandle );
+ }
+ catch( beans::UnknownPropertyException ex )
+ {
+ aDefault.clear();
+ }
m_pImplProperties->SetPropertyValueByHandle( nHandle, rValue );
+ if( !m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault && aDefault.hasValue() && aDefault == rValue ) //#i98893# don't export defaults to file
+ m_pImplProperties->SetPropertyToDefault( nHandle );
+ else
+ m_pImplProperties->SetPropertyValueByHandle( nHandle, rValue );
}
void SAL_CALL OPropertySet::getFastPropertyValue
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index 57c8ef01d5d6..07f8d16efffd 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -439,14 +439,6 @@ OUString ObjectIdentifier::createParticleForGrid(
return aRet.makeStringAndClear();
}
-OUString ObjectIdentifier::createClassifiedIdentifierForAxis(
- const Reference< XAxis >& xAxis
- , const Reference< frame::XModel >& xChartModel )
-{
- rtl::OUString aAxisCID( createClassifiedIdentifierForObject( xAxis,xChartModel ) );
- return aAxisCID;
-}
-
//static
OUString ObjectIdentifier::createClassifiedIdentifierForGrid(
const Reference< XAxis >& xAxis
diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx
index 780a5ba373d9..bfbab86e9008 100644
--- a/chart2/source/tools/RangeHighlighter.cxx
+++ b/chart2/source/tools/RangeHighlighter.cxx
@@ -38,6 +38,7 @@
#include "ContainerHelper.hxx"
#include "macros.hxx"
#include "ObjectIdentifier.hxx"
+#include "DataSeriesHelper.hxx"
#include <com/sun/star/chart2/XDataSeries.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
@@ -78,7 +79,8 @@ RangeHighlighter::RangeHighlighter(
const Reference< view::XSelectionSupplier > & xSelectionSupplier ) :
impl::RangeHighlighter_Base( m_aMutex ),
m_xSelectionSupplier( xSelectionSupplier ),
- m_nAddedListenerCount( 0 )
+ m_nAddedListenerCount( 0 ),
+ m_bIncludeHiddenCells(true)
{
}
@@ -104,6 +106,8 @@ void RangeHighlighter::determineRanges()
if( xController.is())
xChartModel.set( xController->getModel());
+ m_bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( xChartModel );
+
uno::Any aSelection( m_xSelectionSupplier->getSelection());
OUString aCID;
if(( aSelection >>= aCID ) &&
@@ -271,11 +275,13 @@ void RangeHighlighter::fillRangesForDataPoint( const Reference< uno::XInterface
-1,
nPreferredColor,
sal_False ));
+
+ sal_Int32 nUnhiddenIndex = DataSeriesHelper::translateIndexFromHiddenToFullSequence( nIndex, xValues, !m_bIncludeHiddenCells );
if( xValues.is())
aHilightedRanges.push_back(
chart2::data::HighlightedRange(
xValues->getSourceRangeRepresentation(),
- nIndex,
+ nUnhiddenIndex,
nPreferredColor,
sal_False ));
}
diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx
index 93ba4b43cfc3..ddddc7d71ee4 100644
--- a/chart2/source/tools/ReferenceSizeProvider.cxx
+++ b/chart2/source/tools/ReferenceSizeProvider.cxx
@@ -226,32 +226,18 @@ void ReferenceSizeProvider::getAutoResizeFromPropSet(
}
}
-void ReferenceSizeProvider::getAutoResizeFromTitle(
- const Reference< XTitle > & xTitle,
- ReferenceSizeProvider::AutoResizeState & rInOutState )
-{
- Reference< beans::XPropertySet > xProp( xTitle, uno::UNO_QUERY );
- if( xProp.is())
- getAutoResizeFromPropSet( xProp, rInOutState );
-}
-
void ReferenceSizeProvider::impl_getAutoResizeFromTitled(
const Reference< XTitled > & xTitled,
ReferenceSizeProvider::AutoResizeState & rInOutState )
{
if( xTitled.is())
{
- Reference< XTitle > xTitle( xTitled->getTitleObject());
- if( xTitle.is())
- getAutoResizeFromTitle( xTitle, rInOutState );
+ Reference< beans::XPropertySet > xProp( xTitled->getTitleObject(), uno::UNO_QUERY );
+ if( xProp.is())
+ getAutoResizeFromPropSet( xProp, rInOutState );
}
}
-ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState() const
-{
- return getAutoResizeState( m_xChartDoc );
-}
-
/** Retrieves the state auto-resize from all objects that support this
feature. If all objects return the same state, AUTO_RESIZE_YES or
AUTO_RESIZE_NO is returned.
diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx
index 7686b2c7009d..8a4fd8ce4f7e 100644
--- a/chart2/source/tools/RegressionCurveHelper.cxx
+++ b/chart2/source/tools/RegressionCurveHelper.cxx
@@ -457,6 +457,39 @@ bool RegressionCurveHelper::removeAllExceptMeanValueLine(
return bRemovedSomething;
}
+void RegressionCurveHelper::removeEquations(
+ uno::Reference< chart2::XRegressionCurveContainer > & xRegCnt )
+{
+ if( xRegCnt.is())
+ {
+ try
+ {
+ uno::Sequence< uno::Reference< chart2::XRegressionCurve > > aCurves(
+ xRegCnt->getRegressionCurves());
+ for( sal_Int32 i = 0; i < aCurves.getLength(); ++i )
+ {
+ if( !isMeanValueLine( aCurves[i] ) )
+ {
+ uno::Reference< chart2::XRegressionCurve > xRegCurve( aCurves[ i ] );
+ if( xRegCurve.is() )
+ {
+ uno::Reference< beans::XPropertySet > xEqProp( xRegCurve->getEquationProperties() ) ;
+ if( xEqProp.is())
+ {
+ xEqProp->setPropertyValue( C2U("ShowEquation"), uno::makeAny( false ));
+ xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( false ));
+ }
+ }
+ }
+ }
+ }
+ catch( uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+ }
+}
+
// static
void RegressionCurveHelper::replaceOrAddCurveAndReduceToOne(
tRegressionType eType,
@@ -683,6 +716,24 @@ sal_Int32 RegressionCurveHelper::getRegressionCurveIndex(
return -1;
}
+bool RegressionCurveHelper::hasEquation( const Reference< chart2::XRegressionCurve > & xCurve )
+{
+ bool bHasEquation = false;
+ if( xCurve.is())
+ {
+ uno::Reference< beans::XPropertySet > xEquationProp( xCurve->getEquationProperties());
+ if( xEquationProp.is())
+ {
+ bool bShowEquation = false;
+ bool bShowCoefficient = false;
+ xEquationProp->getPropertyValue( C2U("ShowEquation")) >>= bShowEquation;
+ xEquationProp->getPropertyValue( C2U("ShowCorrelationCoefficient")) >>= bShowCoefficient;
+ bHasEquation = bShowEquation || bShowCoefficient;
+ }
+ }
+ return bHasEquation;
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/tools/RegressionCurveModel.cxx b/chart2/source/tools/RegressionCurveModel.cxx
index 377f087315ae..dea90a312845 100644
--- a/chart2/source/tools/RegressionCurveModel.cxx
+++ b/chart2/source/tools/RegressionCurveModel.cxx
@@ -109,7 +109,7 @@ RegressionCurveModel::RegressionCurveModel(
::property::OPropertySet( m_aMutex ),
m_xContext( xContext ),
m_eRegressionCurveType( eCurveType ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()),
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()),
m_xEquationProperties( new RegressionEquation( xContext ))
{
// set 0 line width (default) hard, so that it is always written to XML,
@@ -125,7 +125,7 @@ RegressionCurveModel::RegressionCurveModel( const RegressionCurveModel & rOther
::property::OPropertySet( rOther, m_aMutex ),
m_xContext( rOther.m_xContext ),
m_eRegressionCurveType( rOther.m_eRegressionCurveType ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
m_xEquationProperties.set( CloneHelper::CreateRefClone< uno::Reference< beans::XPropertySet > >()( rOther.m_xEquationProperties ));
ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx
index 83f9cde5f783..f820fb78c89e 100644
--- a/chart2/source/tools/StatisticsHelper.cxx
+++ b/chart2/source/tools/StatisticsHelper.cxx
@@ -337,7 +337,7 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars(
if( !( xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar ) ||
!xErrorBar.is())
{
- xErrorBar.set( new ErrorBar( xContext ));
+ xErrorBar.set( createErrorBar( xContext ));
}
OSL_ASSERT( xErrorBar.is());
diff --git a/chart2/source/tools/TitleHelper.cxx b/chart2/source/tools/TitleHelper.cxx
index 24e55ccfc90e..fe10c92e78cc 100644
--- a/chart2/source/tools/TitleHelper.cxx
+++ b/chart2/source/tools/TitleHelper.cxx
@@ -36,6 +36,7 @@
#include "AxisHelper.hxx"
#include "DiagramHelper.hxx"
#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <rtl/ustrbuf.hxx>
//.............................................................................
namespace chart
@@ -191,7 +192,7 @@ uno::Reference< XTitle > TitleHelper::createTitle(
switch( eTitleType )
{
case TitleHelper::SUB_TITLE:
- chart::TitleHelper::setCompleteString(
+ TitleHelper::setCompleteString(
rTitleText, xTitle, xContext, & fDefaultCharHeightSub );
break;
case TitleHelper::X_AXIS_TITLE:
@@ -201,11 +202,11 @@ uno::Reference< XTitle > TitleHelper::createTitle(
case TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION:
case TitleHelper::SECONDARY_X_AXIS_TITLE:
case TitleHelper::SECONDARY_Y_AXIS_TITLE:
- chart::TitleHelper::setCompleteString(
+ TitleHelper::setCompleteString(
rTitleText, xTitle, xContext, & fDefaultCharHeightAxis );
break;
default:
- chart::TitleHelper::setCompleteString( rTitleText, xTitle, xContext );
+ TitleHelper::setCompleteString( rTitleText, xTitle, xContext );
break;
}
@@ -269,13 +270,44 @@ void TitleHelper::setCompleteString( const rtl::OUString& rNewText
if(!xTitle.is())
return;
+ rtl::OUString aNewText = rNewText;
+
+ bool bStacked = false;
+ uno::Reference< beans::XPropertySet > xTitleProperties( xTitle, uno::UNO_QUERY );
+ if( xTitleProperties.is() )
+ xTitleProperties->getPropertyValue( C2U( "StackCharacters" ) ) >>= bStacked;
+
+ if( bStacked )
+ {
+ //#i99841# remove linebreaks that were added for vertical stacking
+ rtl::OUStringBuffer aUnstackedStr;
+ rtl::OUStringBuffer aSource(rNewText);
+
+ bool bBreakIgnored = false;
+ sal_Int32 nLen = rNewText.getLength();
+ for( sal_Int32 nPos = 0; nPos < nLen; ++nPos )
+ {
+ sal_Unicode aChar = aSource.charAt( nPos );
+ if( aChar != '\n' )
+ {
+ aUnstackedStr.append( aChar );
+ bBreakIgnored = false;
+ }
+ else if( aChar == '\n' && bBreakIgnored )
+ aUnstackedStr.append( aChar );
+ else
+ bBreakIgnored = true;
+ }
+ aNewText = aUnstackedStr.makeStringAndClear();
+ }
+
uno::Sequence< uno::Reference< XFormattedString > > aNewStringList(1);
uno::Sequence< uno::Reference< XFormattedString > > aOldStringList = xTitle->getText();
if( aOldStringList.getLength() )
{
aNewStringList[0].set( aOldStringList[0] );
- aNewStringList[0]->setString( rNewText );
+ aNewStringList[0]->setString( aNewText );
}
else
{
@@ -286,7 +318,7 @@ void TitleHelper::setCompleteString( const rtl::OUString& rNewText
if(xFormattedString.is())
{
- xFormattedString->setString( rNewText );
+ xFormattedString->setString( aNewText );
aNewStringList[0].set( xFormattedString );
if( pDefaultCharHeight != 0 )
{
diff --git a/chart2/source/tools/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx
index 9f265bd364ba..53a1f1d93c68 100644
--- a/chart2/source/tools/UncachedDataSequence.cxx
+++ b/chart2/source/tools/UncachedDataSequence.cxx
@@ -63,8 +63,6 @@ enum
// PROP_SOURCE_IDENTIFIER,
PROP_NUMBERFORMAT_KEY,
PROP_PROPOSED_ROLE,
- PROP_HIDDEN,
- PROP_HIDDEN_VALUES,
PROP_XML_RANGE
};
} // anonymous namespace
@@ -79,10 +77,10 @@ UncachedDataSequence::UncachedDataSequence(
const OUString & rRangeRepresentation )
: OPropertyContainer( GetBroadcastHelper()),
UncachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
+ m_nNumberFormatKey(0),
m_xDataProvider( xIntDataProv ),
m_aSourceRepresentation( rRangeRepresentation ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
registerProperties();
}
@@ -93,10 +91,10 @@ UncachedDataSequence::UncachedDataSequence(
const OUString & rRole )
: OPropertyContainer( GetBroadcastHelper()),
UncachedDataSequence_Base( GetMutex()),
- m_bIsHidden( true ),
+ m_nNumberFormatKey(0),
m_xDataProvider( xIntDataProv ),
m_aSourceRepresentation( rRangeRepresentation ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
registerProperties();
setFastPropertyValue_NoBroadcast( PROP_PROPOSED_ROLE, uno::makeAny( rRole ));
@@ -109,11 +107,9 @@ UncachedDataSequence::UncachedDataSequence( const UncachedDataSequence & rSource
UncachedDataSequence_Base( GetMutex()),
m_nNumberFormatKey( rSource.m_nNumberFormatKey ),
m_sRole( rSource.m_sRole ),
- m_bIsHidden( rSource.m_bIsHidden ),
- m_aHiddenValues( rSource.m_aHiddenValues ),
m_xDataProvider( rSource.m_xDataProvider ),
m_aSourceRepresentation( rSource.m_aSourceRepresentation ),
- m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+ m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder())
{
registerProperties();
}
@@ -135,18 +131,6 @@ void UncachedDataSequence::registerProperties()
& m_sRole,
::getCppuType( & m_sRole ) );
- registerProperty( C2U( "IsHidden" ),
- PROP_HIDDEN,
- 0, // PropertyAttributes
- & m_bIsHidden,
- ::getCppuType( & m_bIsHidden ) );
-
- registerProperty( C2U( "HiddenValues" ),
- PROP_HIDDEN_VALUES,
- 0, // PropertyAttributes
- & m_aHiddenValues,
- ::getCppuType( & m_aHiddenValues ) );
-
registerProperty( C2U( "CachedXMLRange" ),
PROP_XML_RANGE,
0, // PropertyAttributes
@@ -266,7 +250,7 @@ Sequence< OUString > SAL_CALL UncachedDataSequence::generateLabel( chart2::data:
throw (lang::IndexOutOfBoundsException,
uno::RuntimeException)
{
- return 0;
+ return m_nNumberFormatKey;
}
// ____ XIndexReplace ____
diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx
index 29e4fc0d06da..5287ecbcdc13 100644
--- a/chart2/source/view/axes/ScaleAutomatism.cxx
+++ b/chart2/source/view/axes/ScaleAutomatism.cxx
@@ -33,7 +33,6 @@
#include "ScaleAutomatism.hxx"
#include "macros.hxx"
#include "TickmarkHelper.hxx"
-#include "Scaling.hxx"
#include "AxisHelper.hxx"
#include <rtl/math.hxx>
#include <tools/debug.hxx>
@@ -134,7 +133,7 @@ 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 scsaling or from plotter????
+ rExplicitScale.Minimum = 0.0; //@todo get Minimum from scaling or from plotter????
else
rExplicitScale.Minimum = m_fValueMinimum;
}
@@ -143,7 +142,7 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
if( bAutoMaximum )
{
if( m_aSourceScale.AxisType==AxisType::PERCENT )
- rExplicitScale.Minimum = 1.0;
+ rExplicitScale.Maximum = 1.0;
else if( ::rtl::math::isNan( m_fValueMaximum ) )
rExplicitScale.Maximum = 10.0; //@todo get Maximum from scaling or from plotter????
else
@@ -257,6 +256,9 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
{
// *** STEP 1: initialize the range data ***
+ const double fInputMinimum = rExplicitScale.Minimum;
+ const double fInputMaximum = rExplicitScale.Maximum;
+
double fSourceMinimum = rExplicitScale.Minimum;
double fSourceMaximum = rExplicitScale.Maximum;
@@ -269,7 +271,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
values. In the last step, the original values will be restored. */
uno::Reference< XScaling > xScaling = rExplicitScale.Scaling;
if( !xScaling.is() )
- xScaling.set( new LogarithmicScaling );
+ xScaling.set( AxisHelper::createLogarithmicScaling() );
uno::Reference< XScaling > xInverseScaling = xScaling->getInverseScaling();
fSourceMinimum = xScaling->doScaling( fSourceMinimum );
@@ -412,10 +414,38 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
// round to entire multiples of the distance and add additional space
if( bAutoMinimum && m_bExpandBorderToIncrementRhythm )
+ {
fAxisMinimum = TickmarkHelper::getMinimumAtIncrement( fAxisMinimum, rExplicitIncrement );
+
+ //ensure valid values after scaling #i100995#
+ if( !bAutoDistance )
+ {
+ double fCheck = xInverseScaling->doScaling( fAxisMinimum );
+ if( !::rtl::math::isFinite( fCheck ) || fCheck <= 0 )
+ {
+ bAutoDistance = true;
+ bHasCalculatedDistance = false;
+ continue;
+ }
+ }
+ }
if( bAutoMaximum && m_bExpandBorderToIncrementRhythm )
+ {
fAxisMaximum = TickmarkHelper::getMaximumAtIncrement( fAxisMaximum, rExplicitIncrement );
+ //ensure valid values after scaling #i100995#
+ if( !bAutoDistance )
+ {
+ double fCheck = xInverseScaling->doScaling( fAxisMaximum );
+ if( !::rtl::math::isFinite( fCheck ) || fCheck <= 0 )
+ {
+ bAutoDistance = true;
+ bHasCalculatedDistance = false;
+ continue;
+ }
+ }
+ }
+
// set the resulting limits (swap back to negative range if needed)
if( bSwapAndNegateRange )
{
@@ -440,6 +470,22 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLogarithmic(
// convert limits back to logarithmic scale
rExplicitScale.Minimum = xInverseScaling->doScaling( rExplicitScale.Minimum );
rExplicitScale.Maximum = xInverseScaling->doScaling( rExplicitScale.Maximum );
+
+ //ensure valid values after scaling #i100995#
+ if( !::rtl::math::isFinite( rExplicitScale.Minimum ) || rExplicitScale.Minimum <= 0)
+ {
+ rExplicitScale.Minimum = fInputMinimum;
+ if( !::rtl::math::isFinite( rExplicitScale.Minimum ) || rExplicitScale.Minimum <= 0 )
+ rExplicitScale.Minimum = 1.0;
+ }
+ if( !::rtl::math::isFinite( rExplicitScale.Maximum) || rExplicitScale.Maximum <= 0 )
+ {
+ rExplicitScale.Maximum= fInputMaximum;
+ if( !::rtl::math::isFinite( rExplicitScale.Maximum) || rExplicitScale.Maximum <= 0 )
+ rExplicitScale.Maximum = 10.0;
+ }
+ if( rExplicitScale.Maximum < rExplicitScale.Minimum )
+ ::std::swap( rExplicitScale.Maximum, rExplicitScale.Minimum );
}
//---------------------------------------------------------------
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index c64102f6c984..0f18029254ef 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -64,193 +64,6 @@ using namespace ::com::sun::star::chart2;
using namespace ::rtl::math;
using ::com::sun::star::uno::Reference;
-void lcl_correctRotation_Left( double& rfXCorrection, double& rfYCorrection
- , double fAnglePositiveDegree, const awt::Size& aSize )
-{
- //correct label positions left of an axis with right centered alignment
- double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
- if( fAnglePositiveDegree==0.0 )
- {
- }
- else if( fAnglePositiveDegree<= 90.0 )
- {
- rfXCorrection = -aSize.Height*rtl::math::sin( fAnglePi )/2.0;
- }
- else if( fAnglePositiveDegree<= 180.0 )
- {
- double beta = fAnglePi-F_PI/2.0;
- rfXCorrection = -aSize.Width *rtl::math::sin( beta )
- -aSize.Height *rtl::math::cos( beta )/2.0;
- rfYCorrection = -aSize.Width *rtl::math::cos( beta );
- }
- else if( fAnglePositiveDegree<= 270.0 )
- {
- double beta = fAnglePi - F_PI;
- rfXCorrection = -aSize.Width *rtl::math::cos( beta )
- -aSize.Height*rtl::math::sin( beta )/2.0;
- rfYCorrection = aSize.Width *rtl::math::sin( beta );
- }
- else
- {
- double beta = 2*F_PI - fAnglePi;
- rfXCorrection = -aSize.Height*rtl::math::sin( beta )/2.0;
-
- }
-}
-
-void lcl_correctRotation_Right( double& rfXCorrection, double& rfYCorrection
- , double fAnglePositiveDegree, const awt::Size& aSize )
-{
- //correct label positions right of an axis with left centered alignment
- double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
- if( fAnglePositiveDegree== 0.0 )
- {
- }
- else if( fAnglePositiveDegree<= 90.0 )
- {
- rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi )/2.0;
- }
- else if( fAnglePositiveDegree<= 180.0 )
- {
- double beta = F_PI - fAnglePi;
- rfXCorrection = aSize.Width *rtl::math::cos( beta )
- + aSize.Height*rtl::math::sin( beta )/2.0;
- rfYCorrection = aSize.Width *rtl::math::sin( beta );
- }
- else if( fAnglePositiveDegree<= 270.0 )
- {
- double beta = 3*F_PI/2.0 - fAnglePi;
- rfXCorrection = aSize.Width *rtl::math::sin( beta )
- +aSize.Height*rtl::math::cos( beta )/2.0;
- rfYCorrection = -aSize.Width *rtl::math::cos( beta );
- }
- else
- {
- rfXCorrection = aSize.Height*rtl::math::sin( 2*F_PI - fAnglePi )/2.0;
- }
-}
-
-void lcl_correctRotation_Top( double& rfXCorrection, double& rfYCorrection
- , double fAnglePositiveDegree, const awt::Size& aSize )
-{
- //correct label positions on top of an axis with bottom centered alignment
- double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
- if( fAnglePositiveDegree== 0.0 )
- {
- }
- else if( fAnglePositiveDegree<= 90.0 )
- {
- rfXCorrection = aSize.Width*rtl::math::cos( fAnglePi )/2.0
- +aSize.Height*rtl::math::sin( fAnglePi )/2.0;
- rfYCorrection = -aSize.Width*rtl::math::sin( fAnglePi )/2.0;
- }
- else if( fAnglePositiveDegree<= 180.0 )
- {
- double beta = fAnglePi - F_PI/2.0;
- rfYCorrection = -aSize.Width*rtl::math::cos( beta )/2.0
- - aSize.Height*rtl::math::sin( beta );
- rfXCorrection = - aSize.Width*rtl::math::sin( beta )/2.0
- + aSize.Height*rtl::math::cos( beta )/2.0;
- }
- else if( fAnglePositiveDegree<= 270.0 )
- {
- double beta = fAnglePi - F_PI;
- rfXCorrection = +aSize.Width *rtl::math::cos( beta )/2.0
- -aSize.Height *rtl::math::sin( beta )/2.0; ;
- rfYCorrection = -aSize.Width *rtl::math::sin( beta )/2.0
- -aSize.Height *rtl::math::cos( beta );
- }
- else
- {
- rfXCorrection = -aSize.Width*rtl::math::cos( fAnglePi )/2.0
- +aSize.Height*rtl::math::sin( fAnglePi )/2.0;
- rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi )/2.0;
- }
-}
-
-void lcl_correctRotation_Bottom( double& rfXCorrection, double& rfYCorrection
- , double fAnglePositiveDegree, const awt::Size& aSize )
-{
- //correct label positions below of an axis with top centered alignment
- double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
- if( fAnglePositiveDegree==0.0 )
- {
- }
- else if( fAnglePositiveDegree<= 90.0 )
- {
- rfXCorrection = -aSize.Width *rtl::math::cos( fAnglePi )/2.0
- -aSize.Height*rtl::math::sin( fAnglePi )/2.0;
- rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi )/2.0;
- }
- else if( fAnglePositiveDegree<= 180.0 )
- {
- double beta = fAnglePi-F_PI/2.0;
- rfYCorrection = aSize.Width *rtl::math::cos( beta )/2.0
- +aSize.Height*rtl::math::sin( beta );
- rfXCorrection = aSize.Width *rtl::math::sin( beta )/2.0
- -aSize.Height*rtl::math::cos( beta )/2.0;
- }
- else if( fAnglePositiveDegree<= 270.0 )
- {
- double beta = 3*F_PI/2.0 - fAnglePi;
- rfXCorrection = -aSize.Width *rtl::math::sin( beta )/2.0
- +aSize.Height*rtl::math::cos( beta )/2.0;
- rfYCorrection = aSize.Height*rtl::math::sin( beta )
- +aSize.Width*rtl::math::cos( beta )/2.0;
- }
- else
- {
- double beta = 2*F_PI - fAnglePi;
- rfXCorrection = aSize.Height*rtl::math::sin( beta )/2.0
- +aSize.Width*rtl::math::cos( beta )/2.0;
- rfYCorrection = aSize.Width*rtl::math::sin( beta )/2.0;
- }
-}
-
-void lcl_correctPositionForRotation(
- const Reference< drawing::XShape >& xShape2DText
- , LabelAlignment eLabelAlignment
- , const double fRotationAngle )
-{
- if( !xShape2DText.is() )
- return;
-
- awt::Point aOldPos = xShape2DText->getPosition();
- awt::Size aSize = xShape2DText->getSize();
-
- double fYCorrection = 0.0;
- double fXCorrection = 0.0;
-
- double fAnglePositiveDegree = fRotationAngle;
- while(fAnglePositiveDegree<0.0)
- fAnglePositiveDegree+=360.0;
-
- switch(eLabelAlignment)
- {
- case LABEL_ALIGN_LEFT:
- case LABEL_ALIGN_LEFT_TOP:
- case LABEL_ALIGN_LEFT_BOTTOM:
- lcl_correctRotation_Left( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
- break;
- case LABEL_ALIGN_RIGHT:
- case LABEL_ALIGN_RIGHT_TOP:
- case LABEL_ALIGN_RIGHT_BOTTOM:
- lcl_correctRotation_Right( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
- break;
- case LABEL_ALIGN_TOP:
- lcl_correctRotation_Top( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
- break;
- case LABEL_ALIGN_BOTTOM:
- lcl_correctRotation_Bottom( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
- default: //LABEL_ALIGN_CENTER
- break;
- }
-
- xShape2DText->setPosition( awt::Point(
- static_cast<sal_Int32>(aOldPos.X + fXCorrection )
- , static_cast<sal_Int32>(aOldPos.Y + fYCorrection ) ) );
-}
-
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
@@ -299,9 +112,8 @@ Reference< drawing::XShape > createSingleLabel(
.createText( xTarget, aLabel, rPropNames, rPropValues, aATransformation );
//correctPositionForRotation
- lcl_correctPositionForRotation( xShape2DText
- , rAxisProperties.m_aLabelAlignment
- , rAxisLabelProperties.fRotationAngleDegree );
+ LabelPositionHelper::correctPositionForRotation( xShape2DText
+ , rAxisProperties.m_aLabelAlignment, rAxisLabelProperties.fRotationAngleDegree, false );
return xShape2DText;
}
@@ -1424,9 +1236,8 @@ void SAL_CALL VCartesianAxis::updatePositions()
}
//correctPositionForRotation
- lcl_correctPositionForRotation( xShape2DText
- , m_aAxisProperties.m_aLabelAlignment
- , m_aAxisLabelProperties.fRotationAngleDegree );
+ LabelPositionHelper::correctPositionForRotation( xShape2DText
+ , m_aAxisProperties.m_aLabelAlignment, m_aAxisLabelProperties.fRotationAngleDegree, false );
}
}
diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx
index 6e43ebc75b67..47cc6de405f7 100644
--- a/chart2/source/view/axes/VCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCoordinateSystem.cxx
@@ -112,7 +112,8 @@ VCoordinateSystem::~VCoordinateSystem()
void SAL_CALL VCoordinateSystem::initPlottingTargets( const Reference< drawing::XShapes >& xLogicTarget
, const Reference< drawing::XShapes >& xFinalTarget
- , const Reference< lang::XMultiServiceFactory >& xShapeFactory )
+ , const Reference< lang::XMultiServiceFactory >& xShapeFactory
+ , Reference< drawing::XShapes >& xLogicTargetForSeriesBehindAxis )
throw (uno::RuntimeException)
{
DBG_ASSERT(xLogicTarget.is()&&xFinalTarget.is()&&xShapeFactory.is(),"no proper initialization parameters");
@@ -125,12 +126,14 @@ void SAL_CALL VCoordinateSystem::initPlottingTargets( const Reference< drawing:
{
//create and add to target
m_xLogicTargetForGrids = aShapeFactory.createGroup2D( xLogicTarget );
+ xLogicTargetForSeriesBehindAxis = aShapeFactory.createGroup2D( xLogicTarget );
m_xLogicTargetForAxes = aShapeFactory.createGroup2D( xLogicTarget );
}
else
{
//create and added to target
m_xLogicTargetForGrids = aShapeFactory.createGroup3D( xLogicTarget );
+ xLogicTargetForSeriesBehindAxis = aShapeFactory.createGroup3D( xLogicTarget );
m_xLogicTargetForAxes = aShapeFactory.createGroup3D( xLogicTarget );
}
m_xFinalTarget = xFinalTarget;
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index 1401ab43a159..406e5d119cd6 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -45,6 +45,7 @@
#include "LabelPositionHelper.hxx"
#include "Clipping.hxx"
#include "Stripe.hxx"
+#include "PolarLabelPositionHelper.hxx"
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
@@ -84,12 +85,12 @@ AreaChart::AreaChart( const uno::Reference<XChartType>& xChartTypeModel
, m_bArea(!bNoArea)
, m_bLine(bNoArea)
, m_bSymbol( ChartTypeHelper::isSupportingSymbolProperties(xChartTypeModel,nDimensionCount) )
+ , m_bIsPolarCooSys( bConnectLastToFirstPoint )
, m_bConnectLastToFirstPoint( bConnectLastToFirstPoint )
, m_bAddOneToXMax(bAddOneToXMax)
, m_bExpandIfValuesCloseToBorder( bExpandIfValuesCloseToBorder )
, m_nKeepAspectRatio(nKeepAspectRatio)
, m_aGivenAspectRatio(rAspectRatio)
- , m_eNanHandling( bCategoryXAxis ? NAN_AS_GAP : NAN_AS_INTERPOLATED )
, m_eCurveStyle(CurveStyle_LINES)
, m_nCurveResolution(20)
, m_nSplineOrder(3)
@@ -103,9 +104,6 @@ AreaChart::AreaChart( const uno::Reference<XChartType>& xChartTypeModel
PlotterBase::m_pPosHelper = m_pMainPosHelper;
VSeriesPlotter::m_pMainPosHelper = m_pMainPosHelper;
- if( m_bArea )
- m_eNanHandling = NAN_AS_ZERO;
-
try
{
if( m_xChartTypeModelProps.is() )
@@ -234,6 +232,12 @@ bool AreaChart::keepAspectRatio() const
void AreaChart::addSeries( VDataSeries* pSeries, sal_Int32 zSlot, sal_Int32 xSlot, sal_Int32 ySlot )
{
+ if( m_bArea && !m_bIsPolarCooSys && pSeries )
+ {
+ sal_Int32 nMissingValueTreatment = pSeries->getMissingValueTreatment();
+ if( nMissingValueTreatment == ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP )
+ pSeries->setMissingValueTreatment( ::com::sun::star::chart::MissingValueTreatment::USE_ZERO );
+ }
if( m_nDimension == 3 && !m_bCategoryXAxis )
{
//3D xy always deep
@@ -351,9 +355,10 @@ bool AreaChart::impl_createLine( VDataSeries* pSeries
if( m_bConnectLastToFirstPoint && !ShapeFactory::isPolygonEmptyOrSinglePoint(*pSeriesPoly) )
{
// do NOT connect last and first point, if one is NAN, and NAN handling is NAN_AS_GAP
- double fFirstY = pSeries->getY( 0 );
- double fLastY = pSeries->getY( VSeriesPlotter::getPointCount() - 1 );
- if( (m_eNanHandling != NAN_AS_GAP) || (::rtl::math::isFinite( fFirstY ) && ::rtl::math::isFinite( fLastY )) )
+ double fFirstY = pSeries->getYValue( 0 );
+ double fLastY = pSeries->getYValue( VSeriesPlotter::getPointCount() - 1 );
+ if( (pSeries->getMissingValueTreatment() != ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP)
+ || (::rtl::math::isFinite( fFirstY ) && ::rtl::math::isFinite( fLastY )) )
{
// connect last point in last polygon with first point in first polygon
::basegfx::B2DRectangle aScaledLogicClipDoubleRect( pPosHelper->getScaledLogicClipDoubleRect() );
@@ -429,7 +434,12 @@ bool AreaChart::impl_createArea( VDataSeries* pSeries
drawing::PolyPolygonShape3D aPoly( *pSeriesPoly );
//add second part to the polygon (grounding points or previous series points)
- if(!pPreviousSeriesPoly)
+ if( m_bConnectLastToFirstPoint && !ShapeFactory::isPolygonEmptyOrSinglePoint(*pSeriesPoly) )
+ {
+ if( pPreviousSeriesPoly )
+ addPolygon( aPoly, *pPreviousSeriesPoly );
+ }
+ else if(!pPreviousSeriesPoly)
{
double fMinX = pSeries->m_fLogicMinX;
double fMaxX = pSeries->m_fLogicMaxX;
@@ -573,13 +583,6 @@ void lcl_reorderSeries( ::std::vector< ::std::vector< VDataSeriesGroup > >& rZS
}//anonymous namespace
-void AreaChart::impl_maybeReplaceNanWithZero( double& rfValue )
-{
- if( m_eNanHandling == NAN_AS_ZERO &&
- ( ::rtl::math::isNan(rfValue) || ::rtl::math::isInf(rfValue) ) )
- rfValue = 0.0;
-}
-
//better performance for big data
struct FormerPoint
{
@@ -676,8 +679,7 @@ void AreaChart::createShapes()
pPosHelper = m_pMainPosHelper;
PlotterBase::m_pPosHelper = pPosHelper;
- double fAdd = pSeries->getY( nIndex );
- impl_maybeReplaceNanWithZero( fAdd );
+ double fAdd = pSeries->getYValue( nIndex );
if( !::rtl::math::isNan(fAdd) && !::rtl::math::isInf(fAdd) )
aLogicYSumMap[nAttachedAxisIndex] += fabs( fAdd );
}
@@ -709,23 +711,6 @@ void AreaChart::createShapes()
if(!pSeries)
continue;
- sal_Int32 nMissingValueTreatment = pSeries->getMissingValueTreatment();
- switch( nMissingValueTreatment )
- {
- case ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP:
- if( !m_bArea )
- m_eNanHandling = NAN_AS_GAP;
- break;
- case ::com::sun::star::chart::MissingValueTreatment::USE_ZERO:
- m_eNanHandling = NAN_AS_ZERO;
- break;
- case ::com::sun::star::chart::MissingValueTreatment::CONTINUE:
- m_eNanHandling = NAN_AS_INTERPOLATED;
- break;
- default:
- break;
- }
-
/* #i70133# ignore points outside of series length in standard area
charts. Stacked area charts will use missing points as zeros. In
standard charts, pSeriesList contains only one series. */
@@ -745,10 +730,24 @@ void AreaChart::createShapes()
(*aSeriesIter)->m_fLogicZPos = fLogicZ;
//collect data point information (logic coordinates, style ):
- double fLogicX = (*aSeriesIter)->getX(nIndex);
- double fLogicY = (*aSeriesIter)->getY(nIndex);
- impl_maybeReplaceNanWithZero( fLogicX );
- impl_maybeReplaceNanWithZero( fLogicY );
+ double fLogicX = (*aSeriesIter)->getXValue(nIndex);
+ double fLogicY = (*aSeriesIter)->getYValue(nIndex);
+
+ if( m_bIsPolarCooSys && m_bArea &&
+ ( ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY) ) )
+ {
+ if( (*aSeriesIter)->getMissingValueTreatment() == ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP )
+ {
+ if( pSeriesList->size() == 1 || nSeriesIndex == 0 )
+ {
+ fLogicY = pPosHelper->getLogicMinY();
+ if( !pPosHelper->isMathematicalOrientationY() )
+ fLogicY = pPosHelper->getLogicMaxY();
+ }
+ else
+ fLogicY = 0.0;
+ }
+ }
if( m_nDimension==3 && m_bArea && pSeriesList->size()!=1 )
fLogicY = fabs( fLogicY );
@@ -762,7 +761,7 @@ void AreaChart::createShapes()
|| ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY)
|| ::rtl::math::isNan(fLogicZ) || ::rtl::math::isInf(fLogicZ) )
{
- if( m_eNanHandling == NAN_AS_GAP )
+ if( (*aSeriesIter)->getMissingValueTreatment() == ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP )
{
drawing::PolyPolygonShape3D& rPolygon = (*aSeriesIter)->m_aPolyPolygonShape3D;
sal_Int32& rIndex = (*aSeriesIter)->m_nPolygonIndex;
@@ -821,8 +820,22 @@ void AreaChart::createShapes()
//store point information for series polygon
//for area and/or line (symbols only do not need this)
if( isValidPosition(aScaledLogicPosition) )
+ {
AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aScaledLogicPosition, (*aSeriesIter)->m_nPolygonIndex );
+ //prepare clipping for filled net charts
+ if( !bIsVisible && m_bIsPolarCooSys && m_bArea )
+ {
+ drawing::Position3D aClippedPos(aScaledLogicPosition);
+ pPosHelper->clipScaledLogicValues( 0, &aClippedPos.PositionY, 0 );
+ if( pPosHelper->isLogicVisible( aClippedPos.PositionX, aClippedPos.PositionY, aClippedPos.PositionZ ) )
+ {
+ AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aClippedPos, (*aSeriesIter)->m_nPolygonIndex );
+ AddPointToPoly( (*aSeriesIter)->m_aPolyPolygonShape3D, aScaledLogicPosition, (*aSeriesIter)->m_nPolygonIndex );
+ }
+ }
+ }
+
//create a single datapoint if point is visible
//apply clipping:
if( !bIsVisible )
@@ -933,12 +946,29 @@ void AreaChart::createShapes()
break;
}
+ awt::Point aScreenPosition2D;//get the screen position for the labels
+ sal_Int32 nOffset = 100; //todo maybe calculate this font height dependent
+ if( m_bIsPolarCooSys && nLabelPlacement == ::com::sun::star::chart::DataLabelPlacement::OUTSIDE )
+ {
+ PolarPlottingPositionHelper* pPolarPosHelper = dynamic_cast<PolarPlottingPositionHelper*>(pPosHelper);
+ if( pPolarPosHelper )
+ {
+ PolarLabelPositionHelper aPolarLabelPositionHelper(pPolarPosHelper,m_nDimension,m_xLogicTarget,m_pShapeFactory);
+ aScreenPosition2D = awt::Point( aPolarLabelPositionHelper.getLabelScreenPositionAndAlignmentForLogicValues(
+ eAlignment, fLogicX, fLogicY, fLogicZ, nOffset ));
+ }
+ }
+ else
+ {
+ if(LABEL_ALIGN_CENTER==eAlignment || m_nDimension == 3 )
+ nOffset = 0;
+ aScreenPosition2D = awt::Point( LabelPositionHelper(pPosHelper,m_nDimension,m_xLogicTarget,m_pShapeFactory)
+ .transformSceneToScreenPosition( aScenePosition3D ) );
+ }
- awt::Point aScreenPosition2D( LabelPositionHelper(pPosHelper,m_nDimension,m_xLogicTarget,m_pShapeFactory)
- .transformSceneToScreenPosition( aScenePosition3D ) );
this->createDataLabel( m_xTextTarget, **aSeriesIter, nIndex
, fLogicValueForLabeDisplay
- , aLogicYSumMap[nAttachedAxisIndex], aScreenPosition2D, eAlignment );
+ , aLogicYSumMap[nAttachedAxisIndex], aScreenPosition2D, eAlignment, nOffset );
}
}
diff --git a/chart2/source/view/charttypes/AreaChart.hxx b/chart2/source/view/charttypes/AreaChart.hxx
index 89790912893d..ec90e92ba1a4 100644
--- a/chart2/source/view/charttypes/AreaChart.hxx
+++ b/chart2/source/view/charttypes/AreaChart.hxx
@@ -104,28 +104,20 @@ private: //methods
, ::com::sun::star::drawing::PolyPolygonShape3D* pSeriesPoly
, PlottingPositionHelper* pPosHelper );
- void impl_maybeReplaceNanWithZero( double& rfValue );
-
private: //member
PlottingPositionHelper* m_pMainPosHelper;
bool m_bArea;//false -> line or symbol only
bool m_bLine;
bool m_bSymbol;
+ bool m_bIsPolarCooSys;//used e.g. for net chart (the data labels need to be placed different)
bool m_bConnectLastToFirstPoint;//used e.g. for net chart
bool m_bAddOneToXMax;//used e.g. for net chart (the angle axis needs a different autoscaling)
bool m_bExpandIfValuesCloseToBorder; // e.g. false for net charts
+
sal_Int32 m_nKeepAspectRatio; //0->no 1->yes other value->automatic
::com::sun::star::drawing::Direction3D m_aGivenAspectRatio; //only used if nKeepAspectRatio==1
- enum tNanHandling
- {
- NAN_AS_ZERO,
- NAN_AS_GAP,
- NAN_AS_INTERPOLATED
- };
- tNanHandling m_eNanHandling;
-
//Properties for splines:
::com::sun::star::chart2::CurveStyle m_eCurveStyle;
sal_Int32 m_nCurveResolution;
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index baeac4a29cf1..41cef61561bb 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -45,7 +45,6 @@
#include "Clipping.hxx"
#include <com/sun/star/chart/DataLabelPlacement.hpp>
-#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <tools/debug.hxx>
@@ -653,15 +652,10 @@ void BarChart::createShapes()
getSeriesGroupShape(*aSeriesIter, xSeriesTarget) );
//collect data point information (logic coordinates, style ):
- double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getX( nCatIndex ), fSlotX );
- double fLogicBarHeight = (*aSeriesIter)->getY( nCatIndex );
+ double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getXValue( nCatIndex ), fSlotX );
+ double fLogicBarHeight = (*aSeriesIter)->getYValue( nCatIndex );
if( ::rtl::math::isNan( fLogicBarHeight )) //no value at this category
- {
- if( pSeries->getMissingValueTreatment() == ::com::sun::star::chart::MissingValueTreatment::USE_ZERO )
- fLogicBarHeight = 0.0;
- else
- continue;
- }
+ continue;
double fLogicValueForLabeDisplay = fLogicBarHeight;
fLogicBarHeight-=fBaseValue;
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
new file mode 100644
index 000000000000..6069189ff0ac
--- /dev/null
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -0,0 +1,420 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ,v $
+ * $Revision: $
+ *
+ * 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 "BubbleChart.hxx"
+#include "PlottingPositionHelper.hxx"
+#include "ShapeFactory.hxx"
+#include "CommonConverters.hxx"
+#include "macros.hxx"
+#include "ViewDefines.hxx"
+#include "ObjectIdentifier.hxx"
+#include "Splines.hxx"
+#include "LabelPositionHelper.hxx"
+#include "Clipping.hxx"
+#include "Stripe.hxx"
+
+#include <com/sun/star/chart2/Symbol.hpp>
+#include <com/sun/star/chart/DataLabelPlacement.hpp>
+#include <tools/debug.hxx>
+#include <svx/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>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using namespace ::rtl::math;
+using namespace ::com::sun::star::chart2;
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+BubbleChart::BubbleChart( const uno::Reference<XChartType>& xChartTypeModel
+ , sal_Int32 nDimensionCount )
+ : VSeriesPlotter( xChartTypeModel, nDimensionCount, false )
+ , m_bShowNegativeValues(false)
+ , m_bBubbleSizeAsArea(true)
+ , m_fBubbleSizeScaling(1.0)
+ , m_fMaxLogicBubbleSize( 0.0 )
+ , m_fBubbleSizeFactorToScreen( 1.0 )
+{
+ if( !m_pMainPosHelper )
+ m_pMainPosHelper = new PlottingPositionHelper();
+ PlotterBase::m_pPosHelper = m_pMainPosHelper;
+ VSeriesPlotter::m_pMainPosHelper = m_pMainPosHelper;
+}
+
+BubbleChart::~BubbleChart()
+{
+ delete m_pMainPosHelper;
+}
+
+void BubbleChart::calculateMaximumLogicBubbleSize()
+{
+ double fMaxSize = 0.0;
+
+ sal_Int32 nStartIndex = 0;
+ sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
+ 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();
+ 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< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
+ ::std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
+ const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
+ for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ )
+ {
+ VDataSeries* pSeries( *aSeriesIter );
+ if(!pSeries)
+ continue;
+
+ double fSize = pSeries->getBubble_Size( nIndex );
+ if( m_bShowNegativeValues )
+ fSize = fabs(fSize);
+ if( fSize > fMaxSize )
+ fMaxSize = fSize;
+ }
+ }
+ }
+ }
+
+ m_fMaxLogicBubbleSize = fMaxSize;
+}
+
+void BubbleChart::calculateBubbleSizeScalingFactor()
+{
+ double fLogicZ=0.5;
+ 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 ) );
+
+ awt::Point aScreenMinPos( LabelPositionHelper(m_pMainPosHelper,m_nDimension,m_xLogicTarget,m_pShapeFactory).transformSceneToScreenPosition( aSceneMinPos ) );
+ awt::Point aScreenMaxPos( LabelPositionHelper(m_pMainPosHelper,m_nDimension,m_xLogicTarget,m_pShapeFactory).transformSceneToScreenPosition( aSceneMaxPos ) );
+
+ sal_Int32 nWidth = abs( aScreenMaxPos.X - aScreenMinPos.X );
+ sal_Int32 nHeight = abs( aScreenMaxPos.Y - aScreenMinPos.Y );
+
+ sal_Int32 nMinExtend = std::min( nWidth, nHeight );
+ m_fBubbleSizeFactorToScreen = nMinExtend * 0.25;//max bubble size is 25 percent of diagram size
+}
+
+drawing::Direction3D BubbleChart::transformToScreenBubbleSize( double fLogicSize )
+{
+ drawing::Direction3D aRet(0,0,0);
+
+ if( ::rtl::math::isNan(fLogicSize) || ::rtl::math::isInf(fLogicSize) )
+ return aRet;
+
+ if( m_bShowNegativeValues )
+ fLogicSize = fabs(fLogicSize);
+
+ double fMaxSize = m_fMaxLogicBubbleSize;
+
+ double fMaxRadius = fMaxSize;
+ double fRaduis = fLogicSize;
+ if( m_bBubbleSizeAsArea )
+ {
+ fMaxRadius = sqrt( fMaxSize / F_PI );
+ fRaduis = sqrt( fLogicSize / F_PI );
+ }
+
+ aRet.DirectionX = m_fBubbleSizeScaling * m_fBubbleSizeFactorToScreen * fRaduis / fMaxRadius;
+ aRet.DirectionY = aRet.DirectionX;
+
+ return aRet;
+}
+
+bool BubbleChart::isExpandIfValuesCloseToBorder( sal_Int32 /*nDimensionIndex*/ )
+{
+ return true;
+}
+
+bool BubbleChart::isSeperateStackingForDifferentSigns( sal_Int32 /*nDimensionIndex*/ )
+{
+ return false;
+}
+
+//-----------------------------------------------------------------
+
+LegendSymbolStyle BubbleChart::getLegendSymbolStyle()
+{
+ return chart2::LegendSymbolStyle_CIRCLE;
+}
+
+drawing::Direction3D BubbleChart::getPreferredDiagramAspectRatio() const
+{
+ return drawing::Direction3D(-1,-1,-1);
+}
+
+void BubbleChart::addSeries( VDataSeries* pSeries, sal_Int32 zSlot, sal_Int32 xSlot, sal_Int32 ySlot )
+{
+ VSeriesPlotter::addSeries( pSeries, zSlot, xSlot, ySlot );
+}
+
+//better performance for big data
+struct FormerPoint
+{
+ FormerPoint( double fX, double fY, double fZ )
+ : m_fX(fX), m_fY(fY), m_fZ(fZ)
+ {}
+ FormerPoint()
+ {
+ ::rtl::math::setNan( &m_fX );
+ ::rtl::math::setNan( &m_fY );
+ ::rtl::math::setNan( &m_fZ );
+ }
+
+ double m_fX;
+ double m_fY;
+ double m_fZ;
+};
+
+void BubbleChart::createShapes()
+{
+ if( m_aZSlots.begin() == m_aZSlots.end() ) //no series
+ return;
+
+ DBG_ASSERT(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is(),"BubbleChart is not proper initialized");
+ if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is()))
+ return;
+
+ //therefore create an own group for the texts and the error bars to move them to front
+ //(because the text group is created after the series group the texts are displayed on top)
+ uno::Reference< drawing::XShapes > xSeriesTarget(
+ createGroupShape( m_xLogicTarget,rtl::OUString() ));
+ uno::Reference< drawing::XShapes > xTextTarget(
+ m_pShapeFactory->createGroup2D( m_xFinalTarget,rtl::OUString() ));
+
+ //update/create information for current group
+ double fLogicZ = 0.5;//as defined
+
+ sal_Int32 nStartIndex = 0; // inclusive ;..todo get somehow from x scale
+ sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
+ if(nEndIndex<=0)
+ nEndIndex=1;
+
+ //better performance for big data
+ std::map< VDataSeries*, FormerPoint > aSeriesFormerPointMap;
+ m_bPointsWereSkipped = false;
+ sal_Int32 nSkippedPoints = 0;
+ sal_Int32 nCreatedPoints = 0;
+ //
+
+ calculateMaximumLogicBubbleSize();
+ calculateBubbleSizeScalingFactor();
+ if( m_fMaxLogicBubbleSize <= 0 || m_fBubbleSizeFactorToScreen <= 0 )
+ return;
+
+//=============================================================================
+ //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();
+
+ aZSlotIter = m_aZSlots.begin();
+ for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; aZSlotIter++, nZ++ )
+ {
+ ::std::vector< VDataSeriesGroup >::iterator aXSlotIter = aZSlotIter->begin();
+ const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
+
+ aXSlotIter = aZSlotIter->begin();
+ for( sal_Int32 nX=0; aXSlotIter != aXSlotEnd; aXSlotIter++, nX++ )
+ {
+ ::std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
+ ::std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin();
+ const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end();
+
+ //=============================================================================
+ //iterate through all series
+ for( sal_Int32 nSeriesIndex = 0; aSeriesIter != aSeriesEnd; aSeriesIter++, nSeriesIndex++ )
+ {
+ VDataSeries* pSeries( *aSeriesIter );
+ if(!pSeries)
+ continue;
+
+ uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(*aSeriesIter, xSeriesTarget);
+
+ sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
+ PlottingPositionHelper* pPosHelper = &(this->getPlottingPositionHelper( nAttachedAxisIndex ));
+ if(!pPosHelper)
+ pPosHelper = m_pMainPosHelper;
+ PlotterBase::m_pPosHelper = pPosHelper;
+
+ if(m_nDimension==3)
+ fLogicZ = nZ+0.5;
+
+ //collect data point information (logic coordinates, style ):
+ double fLogicX = pSeries->getXValue(nIndex);
+ double fLogicY = pSeries->getYValue(nIndex);
+ double fBubbleSize = pSeries->getBubble_Size( nIndex );
+
+ if( !m_bShowNegativeValues && fBubbleSize<0.0 )
+ continue;
+
+ if( ::rtl::math::approxEqual( fBubbleSize, 0.0 ) || ::rtl::math::isNan(fBubbleSize) )
+ continue;
+
+ if( ::rtl::math::isNan(fLogicX) || ::rtl::math::isInf(fLogicX)
+ || ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY) )
+ continue;
+
+ bool bIsVisible = pPosHelper->isLogicVisible( fLogicX, fLogicY, fLogicZ );
+
+ drawing::Position3D aUnscaledLogicPosition( fLogicX, fLogicY, fLogicZ );
+ drawing::Position3D aScaledLogicPosition(aUnscaledLogicPosition);
+ pPosHelper->doLogicScaling( aScaledLogicPosition );
+
+ //transformation 3) -> 4)
+ drawing::Position3D aScenePosition( pPosHelper->transformLogicToScene( fLogicX,fLogicY,fLogicZ, false ) );
+
+ //better performance for big data
+ FormerPoint aFormerPoint( aSeriesFormerPointMap[pSeries] );
+ pPosHelper->setCoordinateSystemResolution( m_aCoordinateSystemResolution );
+ if( !pSeries->isAttributedDataPoint(nIndex)
+ &&
+ pPosHelper->isSameForGivenResolution( aFormerPoint.m_fX, aFormerPoint.m_fY, aFormerPoint.m_fZ
+ , aScaledLogicPosition.PositionX, aScaledLogicPosition.PositionY, aScaledLogicPosition.PositionZ ) )
+ {
+ nSkippedPoints++;
+ m_bPointsWereSkipped = true;
+ continue;
+ }
+ aSeriesFormerPointMap[pSeries] = FormerPoint(aScaledLogicPosition.PositionX, aScaledLogicPosition.PositionY, aScaledLogicPosition.PositionZ);
+
+ //create a single datapoint if point is visible
+ if( !bIsVisible )
+ continue;
+
+ //create a group shape for this point and add to the series shape:
+ rtl::OUString aPointCID = ObjectIdentifier::createPointCID(
+ pSeries->getPointCID_Stub(), nIndex );
+ uno::Reference< drawing::XShapes > xPointGroupShape_Shapes(
+ createGroupShape(xSeriesGroupShape_Shapes,aPointCID) );
+ uno::Reference<drawing::XShape> xPointGroupShape_Shape =
+ uno::Reference<drawing::XShape>( xPointGroupShape_Shapes, uno::UNO_QUERY );
+
+ {
+ nCreatedPoints++;
+
+ //create data point
+ drawing::Direction3D aSymbolSize = transformToScreenBubbleSize( fBubbleSize );
+ if(m_nDimension!=3)
+ {
+ uno::Reference<drawing::XShape> xShape;
+ xShape = m_pShapeFactory->createCircle2D( xPointGroupShape_Shapes
+ , aScenePosition, aSymbolSize );
+
+ this->setMappedProperties( xShape
+ , pSeries->getPropertiesOfPoint( nIndex )
+ , PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
+
+ m_pShapeFactory->setShapeName( xShape, C2U("MarkHandles") );
+ }
+
+ //create data point label
+ if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) )
+ {
+ LabelAlignment eAlignment = LABEL_ALIGN_TOP;
+ drawing::Position3D aScenePosition3D( aScenePosition.PositionX
+ , aScenePosition.PositionY
+ , aScenePosition.PositionZ+this->getTransformedDepth() );
+
+ sal_Int32 nLabelPlacement = pSeries->getLabelPlacement( nIndex, m_xChartTypeModel, m_nDimension, pPosHelper->isSwapXAndY() );
+
+ switch(nLabelPlacement)
+ {
+ case ::com::sun::star::chart::DataLabelPlacement::TOP:
+ aScenePosition3D.PositionY -= (aSymbolSize.DirectionY/2+1);
+ eAlignment = LABEL_ALIGN_TOP;
+ break;
+ case ::com::sun::star::chart::DataLabelPlacement::BOTTOM:
+ aScenePosition3D.PositionY += (aSymbolSize.DirectionY/2+1);
+ eAlignment = LABEL_ALIGN_BOTTOM;
+ break;
+ case ::com::sun::star::chart::DataLabelPlacement::LEFT:
+ aScenePosition3D.PositionX -= (aSymbolSize.DirectionX/2+1);
+ eAlignment = LABEL_ALIGN_LEFT;
+ break;
+ case ::com::sun::star::chart::DataLabelPlacement::RIGHT:
+ aScenePosition3D.PositionX += (aSymbolSize.DirectionX/2+1);
+ eAlignment = LABEL_ALIGN_RIGHT;
+ break;
+ case ::com::sun::star::chart::DataLabelPlacement::CENTER:
+ eAlignment = LABEL_ALIGN_CENTER;
+ break;
+ default:
+ DBG_ERROR("this label alignment is not implemented yet");
+ aScenePosition3D.PositionY -= (aSymbolSize.DirectionY/2+1);
+ eAlignment = LABEL_ALIGN_TOP;
+ break;
+ }
+
+
+ awt::Point aScreenPosition2D( LabelPositionHelper(pPosHelper,m_nDimension,m_xLogicTarget,m_pShapeFactory)
+ .transformSceneToScreenPosition( aScenePosition3D ) );
+ sal_Int32 nOffset = 0;
+ if(LABEL_ALIGN_CENTER!=eAlignment)
+ nOffset = 100;//add some spacing //@todo maybe get more intelligent values
+ this->createDataLabel( xTextTarget, **aSeriesIter, nIndex
+ , fBubbleSize, fBubbleSize, aScreenPosition2D, eAlignment, nOffset );
+ }
+ }
+
+ //remove PointGroupShape if empty
+ if(!xPointGroupShape_Shapes->getCount())
+ xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape);
+
+ }//next series in x slot (next y slot)
+ }//next x slot
+ }//next z slot
+ }//next category
+//=============================================================================
+//=============================================================================
+//=============================================================================
+ OSL_TRACE( "\nPPPPPPPPP<<<<<<<<<<<< area chart :: createShapes():: skipped points: %d created points: %d", nSkippedPoints, nCreatedPoints );
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/charttypes/BubbleChart.hxx b/chart2/source/view/charttypes/BubbleChart.hxx
new file mode 100644
index 000000000000..4771a4cccee3
--- /dev/null
+++ b/chart2/source/view/charttypes/BubbleChart.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ,v $
+ * $Revision: $
+ *
+ * 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_BUBBLECHART_HXX
+#define _CHART2_BUBBLECHART_HXX
+
+#include "VSeriesPlotter.hxx"
+#include <com/sun/star/drawing/Direction3D.hpp>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+class BubbleChart : public VSeriesPlotter
+{
+ //-------------------------------------------------------------------------
+ // public methods
+ //-------------------------------------------------------------------------
+public:
+ BubbleChart( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XChartType >& xChartTypeModel
+ , sal_Int32 nDimensionCount );
+ virtual ~BubbleChart();
+
+ //-------------------------------------------------------------------------
+ // chart2::XPlotter
+ //-------------------------------------------------------------------------
+
+ virtual void SAL_CALL 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;
+
+ //-------------------------------------------------------------------------
+ // MinimumAndMaximumSupplier
+ //-------------------------------------------------------------------------
+ virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex );
+ virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
+
+ //-------------------------------------------------------------------------
+
+ virtual ::com::sun::star::chart2::LegendSymbolStyle getLegendSymbolStyle();
+
+ //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
+private: //methods
+ //no default constructor
+ BubbleChart();
+
+ void calculateMaximumLogicBubbleSize();
+ void calculateBubbleSizeScalingFactor();
+
+ com::sun::star::drawing::Direction3D transformToScreenBubbleSize( double fLogicSize );
+
+private: //member
+
+ bool m_bShowNegativeValues;//input parameter
+ bool m_bBubbleSizeAsArea;//input parameter
+ double m_fBubbleSizeScaling;//input parameter
+
+ double m_fMaxLogicBubbleSize;//calculated values
+ double m_fBubbleSizeFactorToScreen;//calculated values
+};
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx
index 46fdf3d8f04d..e19a44cdcda6 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -250,7 +250,7 @@ void CandleStickChart::createShapes()
for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ )
{
//collect data point information (logic coordinates, style ):
- double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getX( nIndex ), fSlotX );
+ 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 );
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index 7759f3110cbd..608adb49290b 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -376,7 +376,7 @@ void PieChart::createShapes()
sal_Int32 nPointCount=pSeries->getTotalPointCount();
for( nPointIndex = 0; nPointIndex < nPointCount; nPointIndex++ )
{
- double fY = pSeries->getY( nPointIndex );
+ double fY = pSeries->getYValue( nPointIndex );
if(fY<0.0)
{
//@todo warn somehow that negative values are treated as positive
@@ -402,7 +402,7 @@ void PieChart::createShapes()
uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(pSeries, xSeriesTarget);
//collect data point information (logic coordinates, style ):
- double fLogicYValue = fabs(pSeries->getY( nPointIndex ));
+ double fLogicYValue = fabs(pSeries->getYValue( nPointIndex ));
if( ::rtl::math::isNan(fLogicYValue) )
continue;
if(fLogicYValue==0.0)//@todo: continue also if the resolution to small
diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx
index a684b9a3228e..6d37d7444868 100644
--- a/chart2/source/view/charttypes/Splines.cxx
+++ b/chart2/source/view/charttypes/Splines.cxx
@@ -318,108 +318,133 @@ void SplineCalculater::CalculateCubicSplines(
, sal_Int32 nGranularity )
{
DBG_ASSERT( nGranularity > 0, "Granularity is invalid" );
+
rResult.SequenceX.realloc(0);
rResult.SequenceY.realloc(0);
rResult.SequenceZ.realloc(0);
- if( !rInput.SequenceX.getLength() )
+ sal_Int32 nOuterCount = rInput.SequenceX.getLength();
+ if( !nOuterCount )
return;
- if( rInput.SequenceX[0].getLength() <= 1 )
- return; //we need at least two points
-
- sal_Int32 nMaxIndexPoints = rInput.SequenceX[0].getLength()-1; // is >=1
- const double* pOldX = rInput.SequenceX[0].getConstArray();
- const double* pOldY = rInput.SequenceY[0].getConstArray();
- const double* pOldZ = rInput.SequenceZ[0].getConstArray();
-
- // #i13699# The curve gets a parameter and then for each coordinate a
- // separate spline will be calculated using the parameter as first argument
- // and the point coordinate as second argument. Therefore the points need
- // not to be sorted in its x-coordinates. The parameter is sorted by
- // construction.
-
- ::std::vector < double > aParameter(nMaxIndexPoints+1);
- aParameter[0]=0.0;
- for( sal_Int32 nIndex=1; nIndex<=nMaxIndexPoints; nIndex++ )
- {
- // The euclidian distance leads to curve loops for functions having single extreme points
-// aParameter[nIndex]=aParameter[nIndex-1]+
-// sqrt( (pOldX[nIndex]-pOldX[nIndex-1])*(pOldX[nIndex]-pOldX[nIndex-1])+
-// (pOldY[nIndex]-pOldY[nIndex-1])*(pOldY[nIndex]-pOldY[nIndex-1])+
-// (pOldZ[nIndex]-pOldZ[nIndex-1])*(pOldZ[nIndex]-pOldZ[nIndex-1]));
-
- // use increment of 1 instead
- aParameter[nIndex]=aParameter[nIndex-1]+1;
- }
- // Split the calculation to X, Y and Z coordinate
- tPointVecType aInputX;
- aInputX.resize(nMaxIndexPoints+1);
- tPointVecType aInputY;
- aInputY.resize(nMaxIndexPoints+1);
- tPointVecType aInputZ;
- aInputZ.resize(nMaxIndexPoints+1);
- for (sal_Int32 nN=0;nN<=nMaxIndexPoints; nN++ )
- {
- aInputX[ nN ].first=aParameter[nN];
- aInputX[ nN ].second=pOldX[ nN ];
- aInputY[ nN ].first=aParameter[nN];
- aInputY[ nN ].second=pOldY[ nN ];
- aInputZ[ nN ].first=aParameter[nN];
- aInputZ[ nN ].second=pOldZ[ nN ];
- }
- // generate a spline for each coordinate. It holds the complete
- // information to calculate each point of the curve
-
- // generate the kind "natural spline"
- double fInfty;
- ::rtl::math::setInf( &fInfty, sal_False );
- lcl_SplineCalculation aSplineX( aInputX, fInfty, fInfty );
- lcl_SplineCalculation aSplineY( aInputY, fInfty, fInfty );
- lcl_SplineCalculation aSplineZ( aInputZ, fInfty, fInfty );
-
- // fill result polygon with calculated values
- rResult.SequenceX.realloc(1);
- rResult.SequenceY.realloc(1);
- rResult.SequenceZ.realloc(1);
- rResult.SequenceX[0].realloc( nMaxIndexPoints*nGranularity + 1);
- rResult.SequenceY[0].realloc( nMaxIndexPoints*nGranularity + 1);
- rResult.SequenceZ[0].realloc( nMaxIndexPoints*nGranularity + 1);
-
- double* pNewX = rResult.SequenceX[0].getArray();
- double* pNewY = rResult.SequenceY[0].getArray();
- double* pNewZ = rResult.SequenceZ[0].getArray();
-
- sal_Int32 nNewPointIndex = 0; // Index in result points
- // needed for inner loop
- double fInc; // step for intermediate points
- sal_Int32 nj; // for loop
- double fParam; // a intermediate parameter value
-
- for( sal_Int32 ni = 0; ni < nMaxIndexPoints; ni++ )
- {
- // given point is surely a curve point
- pNewX[nNewPointIndex] = pOldX[ni];
- pNewY[nNewPointIndex] = pOldY[ni];
- pNewZ[nNewPointIndex] = pOldZ[ni];
- nNewPointIndex++;
-
- // calculate intermediate points
- fInc = ( aParameter[ ni+1 ] - aParameter[ni] ) / static_cast< double >( nGranularity );
- for(nj = 1; nj < nGranularity; nj++)
+ rResult.SequenceX.realloc(nOuterCount);
+ rResult.SequenceY.realloc(nOuterCount);
+ rResult.SequenceZ.realloc(nOuterCount);
+
+ for( sal_Int32 nOuter = 0; nOuter < nOuterCount; ++nOuter )
+ {
+ if( rInput.SequenceX[nOuter].getLength() <= 1 )
+ continue; //we need at least two points
+
+ sal_Int32 nMaxIndexPoints = rInput.SequenceX[nOuter].getLength()-1; // is >=1
+ const double* pOldX = rInput.SequenceX[nOuter].getConstArray();
+ const double* pOldY = rInput.SequenceY[nOuter].getConstArray();
+ const double* pOldZ = rInput.SequenceZ[nOuter].getConstArray();
+
+ // #i13699# The curve gets a parameter and then for each coordinate a
+ // separate spline will be calculated using the parameter as first argument
+ // and the point coordinate as second argument. Therefore the points need
+ // not to be sorted in its x-coordinates. The parameter is sorted by
+ // construction.
+
+ ::std::vector < double > aParameter(nMaxIndexPoints+1);
+ aParameter[0]=0.0;
+ for( sal_Int32 nIndex=1; nIndex<=nMaxIndexPoints; nIndex++ )
+ {
+ // The euclidian distance leads to curve loops for functions having single extreme points
+ //aParameter[nIndex]=aParameter[nIndex-1]+
+ //sqrt( (pOldX[nIndex]-pOldX[nIndex-1])*(pOldX[nIndex]-pOldX[nIndex-1])+
+ //(pOldY[nIndex]-pOldY[nIndex-1])*(pOldY[nIndex]-pOldY[nIndex-1])+
+ //(pOldZ[nIndex]-pOldZ[nIndex-1])*(pOldZ[nIndex]-pOldZ[nIndex-1]));
+
+ // use increment of 1 instead
+ aParameter[nIndex]=aParameter[nIndex-1]+1;
+ }
+ // Split the calculation to X, Y and Z coordinate
+ tPointVecType aInputX;
+ aInputX.resize(nMaxIndexPoints+1);
+ tPointVecType aInputY;
+ aInputY.resize(nMaxIndexPoints+1);
+ tPointVecType aInputZ;
+ aInputZ.resize(nMaxIndexPoints+1);
+ for (sal_Int32 nN=0;nN<=nMaxIndexPoints; nN++ )
{
- fParam = aParameter[ni] + ( fInc * static_cast< double >( nj ) );
+ aInputX[ nN ].first=aParameter[nN];
+ aInputX[ nN ].second=pOldX[ nN ];
+ aInputY[ nN ].first=aParameter[nN];
+ aInputY[ nN ].second=pOldY[ nN ];
+ aInputZ[ nN ].first=aParameter[nN];
+ aInputZ[ nN ].second=pOldZ[ nN ];
+ }
- pNewX[nNewPointIndex]=aSplineX.GetInterpolatedValue( fParam );
- pNewY[nNewPointIndex]=aSplineY.GetInterpolatedValue( fParam );
- pNewZ[nNewPointIndex]=aSplineZ.GetInterpolatedValue( fParam );
+ // generate a spline for each coordinate. It holds the complete
+ // information to calculate each point of the curve
+ double fXDerivation;
+ double fYDerivation;
+ double fZDerivation;
+ if( pOldX[ 0 ] == pOldX[nMaxIndexPoints] &&
+ pOldY[ 0 ] == pOldY[nMaxIndexPoints] &&
+ pOldZ[ 0 ] == pOldZ[nMaxIndexPoints] )
+ {
+ // #i101050# avoid a corner in closed lines, which are smoothed by spline
+ // This derivation are special for parameter of kind 0,1,2,3... If you
+ // change generating parameters (see above), then adapt derivations too.)
+ fXDerivation = 0.5 * (pOldX[1]-pOldX[nMaxIndexPoints-1]);
+ fYDerivation = 0.5 * (pOldY[1]-pOldY[nMaxIndexPoints-1]);
+ fZDerivation = 0.5 * (pOldZ[1]-pOldZ[nMaxIndexPoints-1]);
+ }
+ else // generate the kind "natural spline"
+ {
+ double fInfty;
+ ::rtl::math::setInf( &fInfty, sal_False );
+ fXDerivation = fInfty;
+ fYDerivation = fInfty;
+ fZDerivation = fInfty;
+ }
+ lcl_SplineCalculation aSplineX( aInputX, fXDerivation, fXDerivation );
+ lcl_SplineCalculation aSplineY( aInputY, fYDerivation, fYDerivation );
+ lcl_SplineCalculation aSplineZ( aInputZ, fZDerivation, fZDerivation );
+
+ // fill result polygon with calculated values
+ rResult.SequenceX[nOuter].realloc( nMaxIndexPoints*nGranularity + 1);
+ rResult.SequenceY[nOuter].realloc( nMaxIndexPoints*nGranularity + 1);
+ rResult.SequenceZ[nOuter].realloc( nMaxIndexPoints*nGranularity + 1);
+
+ double* pNewX = rResult.SequenceX[nOuter].getArray();
+ double* pNewY = rResult.SequenceY[nOuter].getArray();
+ double* pNewZ = rResult.SequenceZ[nOuter].getArray();
+
+ sal_Int32 nNewPointIndex = 0; // Index in result points
+ // needed for inner loop
+ double fInc; // step for intermediate points
+ sal_Int32 nj; // for loop
+ double fParam; // a intermediate parameter value
+
+ for( sal_Int32 ni = 0; ni < nMaxIndexPoints; ni++ )
+ {
+ // given point is surely a curve point
+ pNewX[nNewPointIndex] = pOldX[ni];
+ pNewY[nNewPointIndex] = pOldY[ni];
+ pNewZ[nNewPointIndex] = pOldZ[ni];
nNewPointIndex++;
+
+ // calculate intermediate points
+ fInc = ( aParameter[ ni+1 ] - aParameter[ni] ) / static_cast< double >( nGranularity );
+ for(nj = 1; nj < nGranularity; nj++)
+ {
+ fParam = aParameter[ni] + ( fInc * static_cast< double >( nj ) );
+
+ pNewX[nNewPointIndex]=aSplineX.GetInterpolatedValue( fParam );
+ pNewY[nNewPointIndex]=aSplineY.GetInterpolatedValue( fParam );
+ pNewZ[nNewPointIndex]=aSplineZ.GetInterpolatedValue( fParam );
+ nNewPointIndex++;
+ }
}
+ // add last point
+ pNewX[nNewPointIndex] = pOldX[nMaxIndexPoints];
+ pNewY[nNewPointIndex] = pOldY[nMaxIndexPoints];
+ pNewZ[nNewPointIndex] = pOldZ[nMaxIndexPoints];
}
- // add last point
- pNewX[nNewPointIndex] = pOldX[nMaxIndexPoints];
- pNewY[nNewPointIndex] = pOldY[nMaxIndexPoints];
- pNewZ[nNewPointIndex] = pOldZ[nMaxIndexPoints];
}
void SplineCalculater::CalculateBSplines(
@@ -436,80 +461,85 @@ void SplineCalculater::CalculateBSplines(
rResult.SequenceY.realloc(0);
rResult.SequenceZ.realloc(0);
- if( !rInput.SequenceX.getLength() )
+ sal_Int32 nOuterCount = rInput.SequenceX.getLength();
+ if( !nOuterCount )
return; // no input
- if( rInput.SequenceX[0].getLength() <= 1 )
- return; // need at least 2 control points
-
- sal_Int32 n = rInput.SequenceX[0].getLength()-1; // maximum index of control points
-
- double fCurveparam =0.0; // parameter for the curve
- // 0<= fCurveparam < fMaxCurveparam
- double fMaxCurveparam = 2.0+ n - k;
- if (fMaxCurveparam <= 0.0)
- return; // not enough control points for desired spline order
-
- if (nGranularity < 1)
- return; //need at least 1 line for each part beween the control points
-
- const double* pOldX = rInput.SequenceX[0].getConstArray();
- const double* pOldY = rInput.SequenceY[0].getConstArray();
- const double* pOldZ = rInput.SequenceZ[0].getConstArray();
-
- // keep this amount of steps to go well with old version
- sal_Int32 nNewSectorCount = nGranularity * n;
- double fCurveStep = fMaxCurveparam/static_cast< double >(nNewSectorCount);
-
- double *b = new double [n + k + 1]; // values of blending functions
-
- const double* t = createTVector(n, k); // knot vector
-
- rResult.SequenceX.realloc(1);
- rResult.SequenceY.realloc(1);
- rResult.SequenceZ.realloc(1);
- rResult.SequenceX[0].realloc(nNewSectorCount+1);
- rResult.SequenceY[0].realloc(nNewSectorCount+1);
- rResult.SequenceZ[0].realloc(nNewSectorCount+1);
- double* pNewX = rResult.SequenceX[0].getArray();
- double* pNewY = rResult.SequenceY[0].getArray();
- double* pNewZ = rResult.SequenceZ[0].getArray();
-
- // variables needed inside loop, when calculating one point of output
- sal_Int32 nPointIndex =0; //index of given contol points
- double fX=0.0;
- double fY=0.0;
- double fZ=0.0; //coordinates of a new BSpline point
-
- for(sal_Int32 nNewSector=0; nNewSector<nNewSectorCount; nNewSector++)
- { // in first looping fCurveparam has value 0.0
-
- // Calculate the values of the blending functions for actual curve parameter
- BVector(fCurveparam, n, k, b, t);
-
- // output point(fCurveparam) = sum over {input point * value of blending function}
- fX = 0.0;
- fY = 0.0;
- fZ = 0.0;
- for (nPointIndex=0;nPointIndex<=n;nPointIndex++)
- {
- fX +=pOldX[nPointIndex]*b[nPointIndex];
- fY +=pOldY[nPointIndex]*b[nPointIndex];
- fZ +=pOldZ[nPointIndex]*b[nPointIndex];
+ rResult.SequenceX.realloc(nOuterCount);
+ rResult.SequenceY.realloc(nOuterCount);
+ rResult.SequenceZ.realloc(nOuterCount);
+
+ for( sal_Int32 nOuter = 0; nOuter < nOuterCount; ++nOuter )
+ {
+ if( rInput.SequenceX[nOuter].getLength() <= 1 )
+ continue; // need at least 2 control points
+
+ sal_Int32 n = rInput.SequenceX[nOuter].getLength()-1; // maximum index of control points
+
+ double fCurveparam =0.0; // parameter for the curve
+ // 0<= fCurveparam < fMaxCurveparam
+ double fMaxCurveparam = 2.0+ n - k;
+ if (fMaxCurveparam <= 0.0)
+ return; // not enough control points for desired spline order
+
+ if (nGranularity < 1)
+ return; //need at least 1 line for each part beween the control points
+
+ const double* pOldX = rInput.SequenceX[nOuter].getConstArray();
+ const double* pOldY = rInput.SequenceY[nOuter].getConstArray();
+ const double* pOldZ = rInput.SequenceZ[nOuter].getConstArray();
+
+ // keep this amount of steps to go well with old version
+ sal_Int32 nNewSectorCount = nGranularity * n;
+ double fCurveStep = fMaxCurveparam/static_cast< double >(nNewSectorCount);
+
+ double *b = new double [n + k + 1]; // values of blending functions
+
+ const double* t = createTVector(n, k); // knot vector
+
+ rResult.SequenceX[nOuter].realloc(nNewSectorCount+1);
+ rResult.SequenceY[nOuter].realloc(nNewSectorCount+1);
+ rResult.SequenceZ[nOuter].realloc(nNewSectorCount+1);
+ double* pNewX = rResult.SequenceX[nOuter].getArray();
+ double* pNewY = rResult.SequenceY[nOuter].getArray();
+ double* pNewZ = rResult.SequenceZ[nOuter].getArray();
+
+ // variables needed inside loop, when calculating one point of output
+ sal_Int32 nPointIndex =0; //index of given contol points
+ double fX=0.0;
+ double fY=0.0;
+ double fZ=0.0; //coordinates of a new BSpline point
+
+ for(sal_Int32 nNewSector=0; nNewSector<nNewSectorCount; nNewSector++)
+ { // in first looping fCurveparam has value 0.0
+
+ // Calculate the values of the blending functions for actual curve parameter
+ BVector(fCurveparam, n, k, b, t);
+
+ // output point(fCurveparam) = sum over {input point * value of blending function}
+ fX = 0.0;
+ fY = 0.0;
+ fZ = 0.0;
+ for (nPointIndex=0;nPointIndex<=n;nPointIndex++)
+ {
+ fX +=pOldX[nPointIndex]*b[nPointIndex];
+ fY +=pOldY[nPointIndex]*b[nPointIndex];
+ fZ +=pOldZ[nPointIndex]*b[nPointIndex];
+ }
+ pNewX[nNewSector] = fX;
+ pNewY[nNewSector] = fY;
+ pNewZ[nNewSector] = fZ;
+
+ fCurveparam += fCurveStep; //for next looping
}
- pNewX[nNewSector] = fX;
- pNewY[nNewSector] = fY;
- pNewZ[nNewSector] = fZ;
+ // add last control point to BSpline curve
+ pNewX[nNewSectorCount] = pOldX[n];
+ pNewY[nNewSectorCount] = pOldY[n];
+ pNewZ[nNewSectorCount] = pOldZ[n];
- fCurveparam += fCurveStep; //for next looping
+ delete[] t;
+ delete[] b;
}
- // add last control point to BSpline curve
- pNewX[nNewSectorCount] = pOldX[n];
- pNewY[nNewSectorCount] = pOldY[n];
- pNewZ[nNewSectorCount] = pOldZ[n];
-
- delete[] t;
- delete[] b;
}
//.............................................................................
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 1f37ae7c3aea..c8f473d226d0 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -61,6 +61,7 @@
#include "PieChart.hxx"
#include "AreaChart.hxx"
#include "CandleStickChart.hxx"
+#include "BubbleChart.hxx"
//
#include <com/sun/star/chart/ErrorBarStyle.hpp>
@@ -76,6 +77,8 @@
#include <basegfx/vector/b2dvector.hxx>
#include <com/sun/star/util/XCloneable.hpp>
+#include <svx/unoshape.hxx>
+
#include <functional>
//.............................................................................
@@ -116,13 +119,6 @@ VDataSeriesGroup::VDataSeriesGroup( VDataSeries* pSeries )
{
}
-VDataSeriesGroup::VDataSeriesGroup( const ::std::vector< VDataSeries* >& rSeriesVector )
- : m_aSeriesVector(rSeriesVector)
- , m_bMaxPointCountDirty(true)
- , m_nMaxPointCount(0)
- , m_aListOfCachedYValues()
-{
-}
VDataSeriesGroup::~VDataSeriesGroup()
{
}
@@ -394,7 +390,7 @@ OUString VSeriesPlotter::getLabelTextForValue( VDataSeries& rDataSeries
}
else
{
- if( m_aAxesNumberFormats.hasFormat(1,rDataSeries.getAttachedAxisIndex()) ) //y-axis
+ if( rDataSeries.shouldLabelNumberFormatKeyBeDetectedFromYAxis() && m_aAxesNumberFormats.hasFormat(1,rDataSeries.getAttachedAxisIndex()) ) //y-axis
nNumberFormatKey = m_aAxesNumberFormats.getFormat(1,rDataSeries.getAttachedAxisIndex());
else
nNumberFormatKey = rDataSeries.detectNumberFormatKey( nPointIndex );
@@ -465,11 +461,15 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
//prepare text
::rtl::OUStringBuffer aText;
::rtl::OUString aSeparator(sal_Unicode(' '));
+ double fRotationDegrees = 0.0;
try
{
uno::Reference< beans::XPropertySet > xPointProps( rDataSeries.getPropertiesOfPoint( nPointIndex ) );
if(xPointProps.is())
+ {
xPointProps->getPropertyValue( C2U( "LabelSeparator" ) ) >>= aSeparator;
+ xPointProps->getPropertyValue( C2U( "TextRotation" ) ) >>= fRotationDegrees;
+ }
}
catch( uno::Exception& e )
{
@@ -537,8 +537,21 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
createText( xTarget_, aText.makeStringAndClear()
, *pPropNames, *pPropValues, ShapeFactory::makeTransformation( aScreenPosition2D ) );
+ const awt::Point aUnrotatedTextPos( xTextShape->getPosition() );
+ if( fRotationDegrees != 0.0 )
+ {
+ const double fDegreesPi( fRotationDegrees * ( F_PI / -180.0 ) );
+ uno::Reference< beans::XPropertySet > xProp( xTextShape, uno::UNO_QUERY );
+ if( xProp.is() )
+ xProp->setPropertyValue( C2U( "Transformation" ), ShapeFactory::makeTransformation( aScreenPosition2D, fDegreesPi ) );
+ LabelPositionHelper::correctPositionForRotation( xTextShape, eAlignment, fRotationDegrees, true /*bRotateAroundCenter*/ );
+ }
+
if( xSymbol.is() && xTextShape.is() )
{
+ const awt::Point aOldTextPos( xTextShape->getPosition() );
+ awt::Point aNewTextPos( aOldTextPos );
+
awt::Size aSymbolSize( xSymbol->getSize() );
awt::Size aTextSize( xTextShape->getSize() );
@@ -550,7 +563,7 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
aSymbolSize.Width = nXDiff * 75/100;
aSymbolSize.Height = nYDiff * 75/100;
- awt::Point aSymbolPosition( xTextShape->getPosition() );
+ awt::Point aSymbolPosition( aUnrotatedTextPos );
aSymbolPosition.Y += (nYDiff * 25/200);
if(LABEL_ALIGN_LEFT==eAlignment
@@ -563,39 +576,21 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
|| LABEL_ALIGN_RIGHT_TOP==eAlignment
|| LABEL_ALIGN_RIGHT_BOTTOM==eAlignment )
{
- aScreenPosition2D.X += nXDiff;
+ aNewTextPos.X += nXDiff;
}
else if(LABEL_ALIGN_TOP==eAlignment
|| LABEL_ALIGN_BOTTOM==eAlignment
|| LABEL_ALIGN_CENTER==eAlignment )
{
aSymbolPosition.X -= nXDiff/2;
- aScreenPosition2D.X += nXDiff/2;
+ aNewTextPos.X += nXDiff/2;
}
xSymbol->setSize( aSymbolSize );
xSymbol->setPosition( aSymbolPosition );
- /*
- ::basegfx::B2DHomMatrix aM;
- //As autogrow is active the rectangle is automatically expanded to that side
- //to which the text is not adjusted.
- aM.scale( aSymbolSize.Width, aSymbolSize.Height );
- aM.translate( aSymbolPosition.X, aSymbolPosition.Y );
- uno::Any aATransformation( uno::makeAny( B2DHomMatrixToHomogenMatrix3(aM) ) );
-
- //set position
- uno::Reference< beans::XPropertySet > xSymbolProp( xSymbol, uno::UNO_QUERY );
- if( xSymbolProp.is() )
- {
- xSymbolProp->setPropertyValue( C2U( "Transformation" ), aATransformation );
- }
- */
-
//set position
- uno::Reference< beans::XPropertySet > xProp( xTextShape, uno::UNO_QUERY );
- if( xProp.is() )
- xProp->setPropertyValue( C2U( "Transformation" ), ShapeFactory::makeTransformation( aScreenPosition2D ) );
+ xTextShape->setPosition( aNewTextPos );
}
}
catch( uno::Exception& e )
@@ -1415,7 +1410,7 @@ void VDataSeriesGroup::getMinimumAndMaximiumX( double& rfMinimum, double& rfMaxi
sal_Int32 nPointCount = (*aSeriesIter)->getTotalPointCount();
for(sal_Int32 nN=0;nN<nPointCount;nN++)
{
- double fX = (*aSeriesIter)->getX( nN );
+ double fX = (*aSeriesIter)->getXValue( nN );
if( ::rtl::math::isNan(fX) )
continue;
if(rfMaximum<fX)
@@ -1447,12 +1442,12 @@ void VDataSeriesGroup::getMinimumAndMaximiumYInContinuousXRange( double& rfMinY,
if( nAxisIndex != (*aSeriesIter)->getAttachedAxisIndex() )
continue;
- double fX = (*aSeriesIter)->getX( nN );
+ double fX = (*aSeriesIter)->getXValue( nN );
if( ::rtl::math::isNan(fX) )
continue;
if( fX < fMinX || fX > fMaxX )
continue;
- double fY = (*aSeriesIter)->getY( nN );
+ double fY = (*aSeriesIter)->getYValue( nN );
if( ::rtl::math::isNan(fY) )
continue;
if(rfMaxY<fY)
@@ -1731,6 +1726,11 @@ bool VSeriesPlotter::PointsWereSkipped() const
return m_bPointsWereSkipped;
}
+bool VSeriesPlotter::WantToPlotInFrontOfAxisLine()
+{
+ return ChartTypeHelper::isSeriesInFrontOfAxisLine( m_xChartTypeModel );
+}
+
Sequence< ViewLegendEntry > SAL_CALL VSeriesPlotter::createLegendEntries(
LegendExpansion eLegendExpansion
, const Reference< beans::XPropertySet >& xTextProperties
@@ -2069,10 +2069,14 @@ VSeriesPlotter* VSeriesPlotter::createSeriesPlotter(
pRet = new AreaChart(xChartTypeModel,nDimensionCount,true,true);
else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) )
pRet = new AreaChart(xChartTypeModel,nDimensionCount,false,true);
+ else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
+ pRet = new BubbleChart(xChartTypeModel,nDimensionCount);
else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
pRet = new PieChart(xChartTypeModel,nDimensionCount);
else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
pRet = new AreaChart(xChartTypeModel,nDimensionCount,true,true,new PolarPlottingPositionHelper(),true,true,false,1,drawing::Direction3D(1,1,1) );
+ else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET) )
+ pRet = new AreaChart(xChartTypeModel,nDimensionCount,true,false,new PolarPlottingPositionHelper(),true,true,false,1,drawing::Direction3D(1,1,1) );
else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
pRet = new CandleStickChart(xChartTypeModel,nDimensionCount);
else
diff --git a/chart2/source/view/charttypes/makefile.mk b/chart2/source/view/charttypes/makefile.mk
index 434db9304788..1da5697fd25f 100644
--- a/chart2/source/view/charttypes/makefile.mk
+++ b/chart2/source/view/charttypes/makefile.mk
@@ -51,7 +51,8 @@ SLOFILES = $(SLO)$/Splines.obj \
$(SLO)$/BarChart.obj \
$(SLO)$/PieChart.obj \
$(SLO)$/AreaChart.obj \
- $(SLO)$/CandleStickChart.obj
+ $(SLO)$/CandleStickChart.obj \
+ $(SLO)$/BubbleChart.obj
# --- Targets -----------------------------------------------------------------
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx
index 70f930aa8623..5e0db2644cc5 100644
--- a/chart2/source/view/diagram/VDiagram.cxx
+++ b/chart2/source/view/diagram/VDiagram.cxx
@@ -553,13 +553,13 @@ void VDiagram::createShapes_3d()
CuboidPlanePosition eLeftWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardLeftWall( uno::Reference< beans::XPropertySet >( m_xDiagram, uno::UNO_QUERY ) ) );
if( CuboidPlanePosition_Right==eLeftWallPos )
xPos = FIXED_SIZE_FOR_3D_CHART_VOLUME;
- Stripe aStripe( drawing::Position3D(xPos,0,0)
- , drawing::Direction3D(0,FIXED_SIZE_FOR_3D_CHART_VOLUME,0)
+ Stripe aStripe( drawing::Position3D(xPos,FIXED_SIZE_FOR_3D_CHART_VOLUME,0)
+ , drawing::Direction3D(0,-FIXED_SIZE_FOR_3D_CHART_VOLUME,0)
, drawing::Direction3D(0,0,FIXED_SIZE_FOR_3D_CHART_VOLUME) );
uno::Reference< drawing::XShape > xShape =
m_pShapeFactory->createStripe( xWallGroup_Shapes, aStripe
- , xWallProp, PropertyMapper::getPropertyNameMapForFillAndLineProperties(), true );
+ , xWallProp, PropertyMapper::getPropertyNameMapForFillAndLineProperties(), true, true );
if( !bAddFloorAndWall )
{
//we always need this object as dummy object for correct scene dimensions
@@ -573,9 +573,9 @@ void VDiagram::createShapes_3d()
CuboidPlanePosition eBackWallPos( ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBackWall( uno::Reference< beans::XPropertySet >( m_xDiagram, uno::UNO_QUERY ) ) );
if( CuboidPlanePosition_Front==eBackWallPos )
zPos = FIXED_SIZE_FOR_3D_CHART_VOLUME;
- Stripe aStripe( drawing::Position3D(0,0,zPos)
+ Stripe aStripe( drawing::Position3D(0,FIXED_SIZE_FOR_3D_CHART_VOLUME,zPos)
, drawing::Direction3D(FIXED_SIZE_FOR_3D_CHART_VOLUME,0,0)
- , drawing::Direction3D(0,FIXED_SIZE_FOR_3D_CHART_VOLUME,0) );
+ , drawing::Direction3D(0,-FIXED_SIZE_FOR_3D_CHART_VOLUME,0) );
uno::Reference< drawing::XShape > xShape =
m_pShapeFactory->createStripe(xWallGroup_Shapes, aStripe
diff --git a/chart2/source/view/inc/LabelPositionHelper.hxx b/chart2/source/view/inc/LabelPositionHelper.hxx
index 8b14869aa773..454be825305f 100644
--- a/chart2/source/view/inc/LabelPositionHelper.hxx
+++ b/chart2/source/view/inc/LabelPositionHelper.hxx
@@ -66,6 +66,9 @@ public:
, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xAxisModelProps
, const ::com::sun::star::awt::Size& rNewReferenceSize );
+ static void correctPositionForRotation( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape2DText
+ , LabelAlignment eLabelAlignment, const double fRotationAngle, bool bRotateAroundCenter );
+
private:
LabelPositionHelper();
diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx b/chart2/source/view/inc/PlottingPositionHelper.hxx
index 9c79e226b265..316ada70cac0 100644
--- a/chart2/source/view/inc/PlottingPositionHelper.hxx
+++ b/chart2/source/view/inc/PlottingPositionHelper.hxx
@@ -193,7 +193,9 @@ public:
using PlottingPositionHelper::transformScaledLogicToScene;
+#ifdef NOTYET
double getInnerLogicRadius() const;
+#endif
double getOuterLogicRadius() const;
inline bool isMathematicalOrientationAngle() const;
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index 63a7c7558a5b..a03bbd3237d8 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -122,7 +122,7 @@ public:
, const Stripe& rStripe
, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSourceProp
, const tPropertyNameMap& rPropertyNameMap
- , sal_Bool bDoubleSided = true);
+ , sal_Bool bDoubleSided = true, bool bRotatedTexture=false );
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
createArea3D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
@@ -159,6 +159,11 @@ public:
, const ::com::sun::star::drawing::PolyPolygonShape3D& rPoints
, const VLineProperties& rLineProperties );
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+ createCircle2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
+ , const ::com::sun::star::drawing::Position3D& rPos
+ , const ::com::sun::star::drawing::Direction3D& rSize );
+
//------------------- create 2D elements:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
diff --git a/chart2/source/view/inc/Stripe.hxx b/chart2/source/view/inc/Stripe.hxx
index fe3a728daa02..dc017fc7aaba 100644
--- a/chart2/source/view/inc/Stripe.hxx
+++ b/chart2/source/view/inc/Stripe.hxx
@@ -65,7 +65,7 @@ public:
::com::sun::star::uno::Any getPolyPolygonShape3D() const;
::com::sun::star::uno::Any getNormalsPolygon() const;
- ::com::sun::star::uno::Any getTexturePolygon() const;
+ ::com::sun::star::uno::Any getTexturePolygon( bool bRotatedTexture ) const;
::com::sun::star::drawing::Position3D GetPosition1() const { return m_aPoint1; }
::com::sun::star::drawing::Position3D GetPosition2() const { return m_aPoint2; }
diff --git a/chart2/source/view/inc/VCoordinateSystem.hxx b/chart2/source/view/inc/VCoordinateSystem.hxx
index f9a575be0123..111b1cb02f99 100644
--- a/chart2/source/view/inc/VCoordinateSystem.hxx
+++ b/chart2/source/view/inc/VCoordinateSystem.hxx
@@ -74,7 +74,9 @@ public:
, const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xFinalTarget
, const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
+ ::com::sun::star::lang::XMultiServiceFactory >& xFactory
+ , ::com::sun::star::uno::Reference<
+ ::com::sun::star::drawing::XShapes >& xLogicTargetForSeriesBehindAxis )
throw (::com::sun::star::uno::RuntimeException);
void setParticle( const rtl::OUString& rCooSysParticle );
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index d3f14a9a1bdd..9426c1e9256c 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -59,7 +59,7 @@ class VDataSequence
{
public:
void init( const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::data::XDataSequence >& xModel);
+ ::com::sun::star::chart2::data::XDataSequence >& xModel );
bool is() const;
void clear();
double getValue( sal_Int32 index ) const;
@@ -89,14 +89,16 @@ public:
void setPageReferenceSize( const ::com::sun::star::awt::Size & rPageRefSize );
sal_Int32 getTotalPointCount() const;
- double getX( sal_Int32 index ) const;
- double getY( sal_Int32 index ) const;
+ double getXValue( sal_Int32 index ) const;
+ double getYValue( sal_Int32 index ) const;
double getY_Min( sal_Int32 index ) const;
double getY_Max( sal_Int32 index ) const;
double getY_First( sal_Int32 index ) const;
double getY_Last( sal_Int32 index ) const;
+ double getBubble_Size( sal_Int32 index ) const;
+
double getMinimumofAllDifferentYValues( sal_Int32 index ) const;
double getMaximumofAllDifferentYValues( sal_Int32 index ) const;
@@ -108,6 +110,7 @@ public:
bool hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const;
sal_Int32 getExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const;
sal_Int32 detectNumberFormatKey( sal_Int32 nPointIndex ) const;
+ bool shouldLabelNumberFormatKeyBeDetectedFromYAxis() const;
sal_Int32 getLabelPlacement( sal_Int32 nPointIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType
, sal_Int32 nDimensionCount, sal_Bool bSwapXAndY ) const;
@@ -141,6 +144,8 @@ public:
void setStartingAngle( sal_Int32 nStartingAngle );
sal_Int32 getStartingAngle() const;
+ void setRoleOfSequenceForDataLabelNumberFormatDetection( const rtl::OUString& rRole );
+
//this is only temporarily here for area chart:
::com::sun::star::drawing::PolyPolygonShape3D m_aPolyPolygonShape3D;
sal_Int32 m_nPolygonIndex;
@@ -174,7 +179,6 @@ public:
sal_Int32 getMissingValueTreatment() const;
private: //methods
- VDataSeries();
::com::sun::star::chart2::DataPointLabel*
getDataPointLabel( sal_Int32 index ) const;
void adaptPointCache( sal_Int32 nNewPointIndex ) const;
@@ -208,6 +212,10 @@ private: //member
VDataSequence m_aValues_Y_First;
VDataSequence m_aValues_Y_Last;
+ VDataSequence m_aValues_Bubble_Size;
+
+ VDataSequence* m_pValueSequenceForDataLabelNumberFormatDetection;
+
mutable double m_fYMeanValue;
::com::sun::star::uno::Sequence< sal_Int32 > m_aAttributedDataPointIndexList;
@@ -249,7 +257,8 @@ private: //member
::com::sun::star::awt::Size m_aReferenceSize;
//
- sal_Int32 m_nMissingValueTreatment;
+ sal_Int32 m_nMissingValueTreatment;
+ bool m_bAllowPercentValueInDataLabel;
};
//.............................................................................
diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx
index b5ea7f7c2bfd..e94ef6c68687 100644
--- a/chart2/source/view/inc/VSeriesPlotter.hxx
+++ b/chart2/source/view/inc/VSeriesPlotter.hxx
@@ -99,7 +99,6 @@ class VDataSeriesGroup
public:
VDataSeriesGroup();
VDataSeriesGroup( VDataSeries* pSeries );
- VDataSeriesGroup( const ::std::vector< VDataSeries* >& rSeriesVector );
virtual ~VDataSeriesGroup();
void addSeries( VDataSeries* pSeries );//takes ownership of pSeries
@@ -297,6 +296,8 @@ public:
virtual void rearrangeLabelToAvoidOverlapIfRequested( const ::com::sun::star::awt::Size& rPageSize );
+ bool WantToPlotInFrontOfAxisLine();
+
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 47eb3f59595f..f3024a10e958 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -66,6 +66,7 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_DATADESCR_PLACEMENT - SCHATTR_START] = new SfxInt32Item(SCHATTR_DATADESCR_PLACEMENT,0);
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_ORIENT - SCHATTR_START] = new SvxChartTextOrientItem;
@@ -184,6 +185,7 @@ ChartItemPool::ChartItemPool():
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_STARTING_ANGLE - SCHATTR_START] = new SfxInt32Item( SCHATTR_STARTING_ANGLE, 90 );
ppPoolDefaults[SCHATTR_CLOCKWISE - SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, FALSE );
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index d9699afb059a..dfd57f9bce92 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -86,7 +86,6 @@
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
#include <com/sun/star/chart2/XTitled.hpp>
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
@@ -631,6 +630,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
sal_Bool bSortByXValues = sal_False;
sal_Bool bConnectBars = sal_False;
sal_Bool bGroupBarsPerAxis = sal_True;
+ sal_Bool bIncludeHiddenCells = sal_True;
sal_Int32 nStartingAngle = 90;
try
{
@@ -638,6 +638,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
xDiaProp->getPropertyValue( C2U( "SortByXValues" ) ) >>= bSortByXValues;
xDiaProp->getPropertyValue( C2U( "ConnectBars" ) ) >>= bConnectBars;
xDiaProp->getPropertyValue( C2U( "GroupBarsPerAxis" ) ) >>= bGroupBarsPerAxis;
+ xDiaProp->getPropertyValue( C2U( "IncludeHiddenCells" ) ) >>= bIncludeHiddenCells;
xDiaProp->getPropertyValue( C2U( "StartingAngle" ) ) >>= nStartingAngle;
}
catch( const uno::Exception & ex )
@@ -703,6 +704,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
uno::Reference< XDataSeries > xDataSeries( aSeriesList[nS], uno::UNO_QUERY );
if(!xDataSeries.is())
continue;
+ if( !bIncludeHiddenCells && !DataSeriesHelper::hasUnhiddenData(xDataSeries) )
+ continue;
+
VDataSeries* pSeries = new VDataSeries( xDataSeries );
pSeries->setGlobalSeriesIndex(nGlobalSeriesIndex);
@@ -720,6 +724,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
rtl::OUString aSeriesParticle( ObjectIdentifier::createParticleForSeries( nDiagramIndex, nCS, nT, nS ) );
pSeries->setParticle(aSeriesParticle);
+ OUString aRole( ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( xChartType ) );
+ pSeries->setRoleOfSequenceForDataLabelNumberFormatDetection(aRole);
+
//ignore secondary axis for charttypes that do not suppoert them
if( pSeries->getAttachedAxisIndex() != MAIN_AXIS_INDEX &&
!ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimensionCount, 1 ) )
@@ -1370,12 +1377,13 @@ void ChartView::impl_createDiagramAndContent( SeriesPlotterContainer& rSeriesPlo
drawing::Direction3D aPreferredAspectRatio(
rSeriesPlotterContainer.getPreferredAspectRatio() );
- uno::Reference< drawing::XShapes > xCoordinateRegionTarget(0);
+ uno::Reference< drawing::XShapes > xSeriesTargetInFrontOfAxis(0);
+ uno::Reference< drawing::XShapes > xSeriesTargetBehindAxis(0);
VDiagram aVDiagram(xDiagram, aPreferredAspectRatio, nDimensionCount);
{//create diagram
aVDiagram.init(xDiagramPlusAxes_Shapes,xDiagramPlusAxes_Shapes,m_xShapeFactory);
aVDiagram.createShapes(rAvailablePos,rAvailableSize);
- xCoordinateRegionTarget = aVDiagram.getCoordinateRegion();
+ xSeriesTargetInFrontOfAxis = aVDiagram.getCoordinateRegion();
aVDiagram.reduceToMimimumSize();
}
@@ -1387,7 +1395,7 @@ void ChartView::impl_createDiagramAndContent( SeriesPlotterContainer& rSeriesPlo
for( nC=0; nC < rVCooSysList.size(); nC++)
{
VCoordinateSystem* pVCooSys = rVCooSysList[nC];
- pVCooSys->initPlottingTargets(xCoordinateRegionTarget,xTextTargetShapes,m_xShapeFactory);
+ pVCooSys->initPlottingTargets(xSeriesTargetInFrontOfAxis,xTextTargetShapes,m_xShapeFactory,xSeriesTargetBehindAxis);
pVCooSys->setTransformationSceneToScreen( B3DHomMatrixToHomogenMatrix(
createTransformationSceneToScreen( aVDiagram.getCurrentRectangle() ) ));
@@ -1462,7 +1470,15 @@ void ChartView::impl_createDiagramAndContent( SeriesPlotterContainer& rSeriesPlo
//------------ set transformation to plotter / create series
VSeriesPlotter* pSeriesPlotter = *aPlotterIter;
rtl::OUString aCID; //III
- pSeriesPlotter->initPlotter(xCoordinateRegionTarget,xTextTargetShapes,m_xShapeFactory,aCID);
+ uno::Reference< drawing::XShapes > xSeriesTarget(0);
+ if( pSeriesPlotter->WantToPlotInFrontOfAxisLine() )
+ xSeriesTarget = xSeriesTargetInFrontOfAxis;
+ else
+ {
+ xSeriesTarget = xSeriesTargetBehindAxis;
+ DBG_ASSERT( !lcl_resizeAfterCompleteCreation(xDiagram), "not implemented yet! - during a complete recreation this shape is destroyed so no series can be created anymore" );
+ }
+ pSeriesPlotter->initPlotter( xSeriesTarget,xTextTargetShapes,m_xShapeFactory,aCID );
pSeriesPlotter->setPageReferenceSize( rPageSize );
VCoordinateSystem* pVCooSys = lcl_getCooSysForPlotter( rVCooSysList, pSeriesPlotter );
if(2==nDimensionCount)
@@ -1496,7 +1512,8 @@ void ChartView::impl_createDiagramAndContent( SeriesPlotterContainer& rSeriesPlo
}
//clear and recreate
- ShapeFactory::removeSubShapes( xCoordinateRegionTarget );
+ ShapeFactory::removeSubShapes( xSeriesTargetInFrontOfAxis ); //xSeriesTargetBehindAxis is a sub shape of xSeriesTargetInFrontOfAxis and will be removed here
+ xSeriesTargetBehindAxis.clear();
ShapeFactory::removeSubShapes( xTextTargetShapes );
//set new transformation
@@ -1689,11 +1706,11 @@ bool lcl_getPropertySwapXAndYAxis( const uno::Reference< XDiagram >& xDiagram )
}
-//static
-sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
+sal_Int32 lcl_getExplicitNumberFormatKeyForAxis(
const Reference< chart2::XAxis >& xAxis
, const Reference< chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem
- , const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
+ , const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
+ , bool bSearchForParallelAxisIfNothingIsFound )
{
sal_Int32 nNumberFormatKey(0);
Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
@@ -1720,13 +1737,15 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
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() )
{
- sal_Int32 nDimensionIndex = 1;
- sal_Int32 nAxisIndex = 0;
AxisHelper::getIndicesForAxis( xAxis, xCorrespondingCoordinateSystem, nDimensionIndex, nAxisIndex );
::rtl::OUString aRoleToMatch;
if( nDimensionIndex == 0 )
@@ -1735,7 +1754,7 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
{
if( nDimensionIndex != 0 )
- aRoleToMatch = aChartTypes[nCTIdx]->getRoleOfSequenceForSeriesLabel();
+ 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 )
@@ -1796,16 +1815,39 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
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;
}
//static
+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
+ , true /*bSearchForParallelAxisIfNothingIsFound*/ );
+}
+
+//static
sal_Int32 ExplicitValueProvider::getPercentNumberFormat( const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
{
sal_Int32 nRet=-1;
@@ -1825,24 +1867,36 @@ sal_Int32 ExplicitValueProvider::getPercentNumberFormat( const Reference< util::
}
-sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForLabel(
+sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
const uno::Reference< beans::XPropertySet >& xSeriesOrPointProp,
const uno::Reference< XDataSeries >& xSeries,
sal_Int32 nPointIndex /*-1 for whole series*/,
- const uno::Reference< beans::XPropertySet >& xAttachedAxisProps
+ const uno::Reference< XDiagram >& xDiagram
)
{
sal_Int32 nFormat=0;
if( !xSeriesOrPointProp.is() )
return nFormat;
+
rtl::OUString aPropName( C2U( "NumberFormat" ) );
if( !(xSeriesOrPointProp->getPropertyValue(aPropName) >>= nFormat) )
{
- if( xAttachedAxisProps.is() && !( xAttachedAxisProps->getPropertyValue( aPropName ) >>= nFormat ) )
+ uno::Reference< chart2::XChartType > xChartType( DataSeriesHelper::getChartTypeOfSeries( xSeries, xDiagram ) );
+
+ bool bFormatFound = false;
+ if( ChartTypeHelper::shouldLabelNumberFormatKeyBeDetectedFromYAxis( xChartType ) )
+ {
+ uno::Reference< beans::XPropertySet > xAttachedAxisProps( DiagramHelper::getAttachedAxis( xSeries, xDiagram ), uno::UNO_QUERY );
+ if( xAttachedAxisProps.is() && ( xAttachedAxisProps->getPropertyValue( aPropName ) >>= nFormat ) )
+ bFormatFound = true;
+ }
+ if( !bFormatFound )
{
Reference< chart2::data::XDataSource > xSeriesSource( xSeries, uno::UNO_QUERY );
+ OUString aRole( ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( xChartType ) );
+
Reference< data::XLabeledDataSequence > xLabeledSequence(
- DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-y"), false ));
+ DataSeriesHelper::getDataSequenceByRole( xSeriesSource, aRole, false ));
if( xLabeledSequence.is() )
{
Reference< data::XDataSequence > xValues( xLabeledSequence->getValues() );
@@ -1856,7 +1910,7 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForLabel(
return nFormat;
}
-sal_Int32 ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForLabel(
+sal_Int32 ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
const uno::Reference< beans::XPropertySet >& xSeriesOrPointProp,
const uno::Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
{
diff --git a/chart2/source/view/main/LabelPositionHelper.cxx b/chart2/source/view/main/LabelPositionHelper.cxx
index b5bf518770fa..e2784f488ab0 100644
--- a/chart2/source/view/main/LabelPositionHelper.cxx
+++ b/chart2/source/view/main/LabelPositionHelper.cxx
@@ -131,6 +131,361 @@ void LabelPositionHelper::doDynamicFontResize( tAnySequence& rPropValues
}
}
+namespace
+{
+
+void lcl_correctRotation_Left( double& rfXCorrection, double& rfYCorrection
+ , double fAnglePositiveDegree, const awt::Size& aSize, bool bRotateAroundCenter )
+{
+ //correct label positions for labels on a left side of something with a right centered alignment
+ double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
+ if( fAnglePositiveDegree==0.0 )
+ {
+ }
+ else if( fAnglePositiveDegree<= 90.0 )
+ {
+ rfXCorrection = -aSize.Height*rtl::math::sin( fAnglePi )/2.0;
+ if( bRotateAroundCenter )
+ rfYCorrection = -aSize.Width*rtl::math::sin( fAnglePi )/2.0;
+ }
+ else if( fAnglePositiveDegree<= 180.0 )
+ {
+ double beta = fAnglePi-F_PI/2.0;
+ rfXCorrection = -aSize.Width *rtl::math::sin( beta )
+ -aSize.Height *rtl::math::cos( beta )/2.0;
+ if( bRotateAroundCenter )
+ rfYCorrection = -aSize.Width *rtl::math::cos( beta )/2.0;
+ else
+ rfYCorrection = -aSize.Width *rtl::math::cos( beta );
+ }
+ else if( fAnglePositiveDegree<= 270.0 )
+ {
+ double beta = fAnglePi - F_PI;
+ rfXCorrection = -aSize.Width *rtl::math::cos( beta )
+ -aSize.Height*rtl::math::sin( beta )/2.0;
+ if( bRotateAroundCenter )
+ rfYCorrection = aSize.Width *rtl::math::sin( beta )/2.0;
+ else
+ rfYCorrection = aSize.Width *rtl::math::sin( beta );
+ }
+ else
+ {
+ double beta = 2*F_PI - fAnglePi;
+ rfXCorrection = -aSize.Height*rtl::math::sin( beta )/2.0;
+ if( bRotateAroundCenter )
+ rfYCorrection = aSize.Width*rtl::math::sin( beta )/2.0;
+ }
+}
+
+void lcl_correctRotation_Right( double& rfXCorrection, double& rfYCorrection
+ , double fAnglePositiveDegree, const awt::Size& aSize, bool bRotateAroundCenter )
+{
+ //correct label positions for labels on a right side of something with a left centered alignment
+ double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
+ if( fAnglePositiveDegree== 0.0 )
+ {
+ }
+ else if( fAnglePositiveDegree<= 90.0 )
+ {
+ rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi )/2.0;
+ if( bRotateAroundCenter )
+ rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi )/2.0;
+ }
+ else if( fAnglePositiveDegree<= 180.0 )
+ {
+ double beta = F_PI - fAnglePi;
+ rfXCorrection = aSize.Width *rtl::math::cos( beta )
+ + aSize.Height*rtl::math::sin( beta )/2.0;
+ if( bRotateAroundCenter )
+ rfYCorrection = aSize.Width *rtl::math::sin( beta )/2.0;
+ else
+ rfYCorrection = aSize.Width *rtl::math::sin( beta );
+ }
+ else if( fAnglePositiveDegree<= 270.0 )
+ {
+ double beta = 3*F_PI/2.0 - fAnglePi;
+ rfXCorrection = aSize.Width *rtl::math::sin( beta )
+ +aSize.Height*rtl::math::cos( beta )/2.0;
+ if( bRotateAroundCenter )
+ rfYCorrection = -aSize.Width *rtl::math::cos( beta )/2.0;
+ else
+ rfYCorrection = -aSize.Width *rtl::math::cos( beta );
+ }
+ else
+ {
+ rfXCorrection = aSize.Height*rtl::math::sin( 2*F_PI - fAnglePi )/2.0;
+ if( bRotateAroundCenter )
+ rfYCorrection = -aSize.Width*rtl::math::sin( 2*F_PI - fAnglePi )/2.0;
+ }
+}
+
+void lcl_correctRotation_Top( double& rfXCorrection, double& rfYCorrection
+ , double fAnglePositiveDegree, const awt::Size& aSize, bool bRotateAroundCenter )
+{
+ //correct label positions for labels on top of something with a bottom centered alignment
+ double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
+ if( fAnglePositiveDegree== 0.0 )
+ {
+ }
+ else if( fAnglePositiveDegree<= 90.0 )
+ {
+ rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi )/2.0;
+ if( !bRotateAroundCenter )
+ rfXCorrection += aSize.Width*rtl::math::cos( fAnglePi )/2.0;
+ rfYCorrection = -aSize.Width*rtl::math::sin( fAnglePi )/2.0;
+ }
+ else if( fAnglePositiveDegree<= 180.0 )
+ {
+ double beta = fAnglePi - F_PI/2.0;
+ rfXCorrection = aSize.Height*rtl::math::cos( beta )/2.0;
+ if( !bRotateAroundCenter )
+ rfXCorrection -= aSize.Width*rtl::math::sin( beta )/2.0;
+ rfYCorrection = -aSize.Width*rtl::math::cos( beta )/2.0
+ - aSize.Height*rtl::math::sin( beta );
+ }
+ else if( fAnglePositiveDegree<= 270.0 )
+ {
+ double beta = fAnglePi - F_PI;
+ rfXCorrection = -aSize.Height *rtl::math::sin( beta )/2.0;
+ if( !bRotateAroundCenter )
+ rfXCorrection += aSize.Width *rtl::math::cos( beta )/2.0;
+ rfYCorrection = -aSize.Width *rtl::math::sin( beta )/2.0
+ -aSize.Height *rtl::math::cos( beta );
+ }
+ else
+ {
+ rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi )/2.0;
+ if( !bRotateAroundCenter )
+ rfXCorrection -= aSize.Width*rtl::math::cos( fAnglePi )/2.0;
+ rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi )/2.0;
+ }
+}
+
+void lcl_correctRotation_Bottom( double& rfXCorrection, double& rfYCorrection
+ , double fAnglePositiveDegree, const awt::Size& aSize, bool bRotateAroundCenter )
+{
+ //correct label positions for labels below something with a top centered alignment
+ double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
+ if( fAnglePositiveDegree==0.0 )
+ {
+ }
+ else if( fAnglePositiveDegree<= 90.0 )
+ {
+ rfXCorrection = -aSize.Height*rtl::math::sin( fAnglePi )/2.0;
+ if( !bRotateAroundCenter )
+ rfXCorrection -= aSize.Width *rtl::math::cos( fAnglePi )/2.0;
+ rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi )/2.0;
+ }
+ else if( fAnglePositiveDegree<= 180.0 )
+ {
+ double beta = fAnglePi-F_PI/2.0;
+ rfXCorrection = -aSize.Height*rtl::math::cos( beta )/2.0;
+ if( !bRotateAroundCenter )
+ rfXCorrection += aSize.Width *rtl::math::sin( beta )/2.0;
+ rfYCorrection = aSize.Width *rtl::math::cos( beta )/2.0
+ +aSize.Height*rtl::math::sin( beta );
+ }
+ else if( fAnglePositiveDegree<= 270.0 )
+ {
+ double beta = 3*F_PI/2.0 - fAnglePi;
+ rfXCorrection = aSize.Height*rtl::math::cos( beta )/2.0;
+ if( !bRotateAroundCenter )
+ rfXCorrection -= aSize.Width *rtl::math::sin( beta )/2.0;
+ rfYCorrection = aSize.Height*rtl::math::sin( beta )
+ +aSize.Width*rtl::math::cos( beta )/2.0;
+ }
+ else
+ {
+ double beta = 2*F_PI - fAnglePi;
+ rfXCorrection = aSize.Height*rtl::math::sin( beta )/2.0;
+ if( !bRotateAroundCenter )
+ rfXCorrection += aSize.Width*rtl::math::cos( beta )/2.0;
+ rfYCorrection = aSize.Width*rtl::math::sin( beta )/2.0;
+ }
+}
+
+void lcl_correctRotation_Left_Top( double& rfXCorrection, double& rfYCorrection
+ , double fAnglePositiveDegree, const awt::Size& aSize )
+{
+ //correct position for labels at the left top corner of something with a bottom right alignment
+ double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
+ if( fAnglePositiveDegree==0.0 )
+ {
+ }
+ else if( fAnglePositiveDegree<= 90.0 )
+ {
+ rfYCorrection = -aSize.Width*rtl::math::sin( fAnglePi );
+ }
+ else if( fAnglePositiveDegree<= 180.0 )
+ {
+ double beta = fAnglePi-F_PI/2.0;
+ rfXCorrection = -aSize.Width*rtl::math::sin( beta );
+ rfYCorrection = -aSize.Height*rtl::math::sin( beta )
+ -aSize.Width*rtl::math::cos( beta );
+ }
+ else if( fAnglePositiveDegree<= 270.0 )
+ {
+ double beta = 3*F_PI/2.0 - fAnglePi;
+ rfXCorrection = -aSize.Height*rtl::math::cos( beta )
+ -aSize.Width*rtl::math::sin( beta );
+ rfYCorrection = -aSize.Height*rtl::math::sin( beta );
+ }
+ else
+ {
+ rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi );
+ }
+}
+
+void lcl_correctRotation_Left_Bottom( double& rfXCorrection, double& rfYCorrection
+ , double fAnglePositiveDegree, const awt::Size& aSize )
+{
+ //correct position for labels at the left bottom corner of something with a top right alignment
+ double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
+ if( fAnglePositiveDegree==0.0 )
+ {
+ }
+ else if( fAnglePositiveDegree<= 90.0 )
+ {
+ rfXCorrection = -aSize.Height*rtl::math::sin( fAnglePi );
+ }
+ else if( fAnglePositiveDegree<= 180.0 )
+ {
+ double beta = fAnglePi-F_PI/2.0;
+ rfXCorrection = -aSize.Width*rtl::math::sin( beta )
+ -aSize.Height*rtl::math::cos( beta );;
+ rfYCorrection = aSize.Height*rtl::math::sin( beta );
+ }
+ else if( fAnglePositiveDegree<= 270.0 )
+ {
+ double beta = 3*F_PI/2.0 - fAnglePi;
+ rfXCorrection = -aSize.Width*rtl::math::sin( beta );
+ rfYCorrection = aSize.Width*rtl::math::cos( beta )
+ +aSize.Height*rtl::math::sin( beta );
+ }
+ else
+ {
+ rfYCorrection = -aSize.Width*rtl::math::sin( fAnglePi );
+ }
+}
+
+void lcl_correctRotation_Right_Top( double& rfXCorrection, double& rfYCorrection
+ , double fAnglePositiveDegree, const awt::Size& aSize )
+{
+ //correct position for labels at the right top corner of something with a bottom left alignment
+ double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
+ if( fAnglePositiveDegree==0.0 )
+ {
+ }
+ else if( fAnglePositiveDegree<= 90.0 )
+ {
+ rfXCorrection = aSize.Height*rtl::math::sin( fAnglePi );
+ }
+ else if( fAnglePositiveDegree<= 180.0 )
+ {
+ double beta = fAnglePi-F_PI/2.0;
+ rfXCorrection = aSize.Width*rtl::math::sin( beta )
+ +aSize.Height*rtl::math::cos( beta );
+ rfYCorrection = -aSize.Height*rtl::math::sin( beta );
+ }
+ else if( fAnglePositiveDegree<= 270.0 )
+ {
+ double beta = 3*F_PI/2.0 - fAnglePi;
+ rfXCorrection = aSize.Width*rtl::math::sin( beta );
+ rfYCorrection = -aSize.Width*rtl::math::cos( beta )
+ -aSize.Height*rtl::math::sin( beta );
+ }
+ else
+ {
+ rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi );
+ }
+}
+
+void lcl_correctRotation_Right_Bottom( double& rfXCorrection, double& rfYCorrection
+ , double fAnglePositiveDegree, const awt::Size& aSize )
+{
+ //correct position for labels at the right bottom corner of something with a top left alignment
+ double fAnglePi = fAnglePositiveDegree*F_PI/180.0;
+ if( fAnglePositiveDegree==0.0 )
+ {
+ }
+ else if( fAnglePositiveDegree<= 90.0 )
+ {
+ rfYCorrection = aSize.Width*rtl::math::sin( fAnglePi );
+ }
+ else if( fAnglePositiveDegree<= 180.0 )
+ {
+ double beta = fAnglePi-F_PI/2.0;
+ rfXCorrection = aSize.Width*rtl::math::sin( beta );
+ rfYCorrection = aSize.Height*rtl::math::sin( beta )
+ +aSize.Width*rtl::math::cos( beta );
+ }
+ else if( fAnglePositiveDegree<= 270.0 )
+ {
+ double beta = 3*F_PI/2.0 - fAnglePi;
+ rfXCorrection = aSize.Height*rtl::math::cos( beta )
+ +aSize.Width*rtl::math::sin( beta );
+ rfYCorrection = aSize.Height*rtl::math::sin( beta );
+ }
+ else
+ {
+ rfXCorrection = -aSize.Height*rtl::math::sin( fAnglePi );
+ }
+}
+
+}//end anonymous namespace
+
+//static
+void LabelPositionHelper::correctPositionForRotation( const uno::Reference< drawing::XShape >& xShape2DText
+ , LabelAlignment eLabelAlignment, const double fRotationAngle, bool bRotateAroundCenter )
+{
+ if( !xShape2DText.is() )
+ return;
+
+ awt::Point aOldPos = xShape2DText->getPosition();
+ awt::Size aSize = xShape2DText->getSize();
+
+ double fYCorrection = 0.0;
+ double fXCorrection = 0.0;
+
+ double fAnglePositiveDegree = fRotationAngle;
+ while(fAnglePositiveDegree<0.0)
+ fAnglePositiveDegree+=360.0;
+
+ switch(eLabelAlignment)
+ {
+ case LABEL_ALIGN_LEFT:
+ lcl_correctRotation_Left( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize, bRotateAroundCenter );
+ break;
+ case LABEL_ALIGN_RIGHT:
+ lcl_correctRotation_Right( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize, bRotateAroundCenter );
+ break;
+ case LABEL_ALIGN_TOP:
+ lcl_correctRotation_Top( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize, bRotateAroundCenter );
+ break;
+ case LABEL_ALIGN_BOTTOM:
+ lcl_correctRotation_Bottom( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize, bRotateAroundCenter );
+ break;
+ case LABEL_ALIGN_LEFT_TOP:
+ lcl_correctRotation_Left_Top( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
+ break;
+ case LABEL_ALIGN_LEFT_BOTTOM:
+ lcl_correctRotation_Left_Bottom( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
+ break;
+ case LABEL_ALIGN_RIGHT_TOP:
+ lcl_correctRotation_Right_Top( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
+ break;
+ case LABEL_ALIGN_RIGHT_BOTTOM:
+ lcl_correctRotation_Right_Bottom( fXCorrection, fYCorrection, fAnglePositiveDegree, aSize );
+ break;
+ default: //LABEL_ALIGN_CENTER
+ break;
+ }
+
+ xShape2DText->setPosition( awt::Point(
+ static_cast<sal_Int32>(aOldPos.X + fXCorrection )
+ , static_cast<sal_Int32>(aOldPos.Y + fYCorrection ) ) );
+}
+
//.............................................................................
} //namespace chart
//.............................................................................
diff --git a/chart2/source/view/main/NumberFormatterWrapper.cxx b/chart2/source/view/main/NumberFormatterWrapper.cxx
index a36f13793a2b..2a01d2f1cde3 100644
--- a/chart2/source/view/main/NumberFormatterWrapper.cxx
+++ b/chart2/source/view/main/NumberFormatterWrapper.cxx
@@ -40,6 +40,7 @@
#include <tools/color.hxx>
#include <i18npool/mslangid.hxx>
#include <tools/debug.hxx>
+#include <com/sun/star/util/DateTime.hpp>
//.............................................................................
namespace chart
@@ -83,6 +84,10 @@ NumberFormatterWrapper::NumberFormatterWrapper( const uno::Reference< util::XNum
, m_pNumberFormatter(NULL)
{
+ uno::Reference<beans::XPropertySet> xProp(m_xNumberFormatsSupplier,uno::UNO_QUERY);
+ rtl::OUString sNullDate( RTL_CONSTASCII_USTRINGPARAM("NullDate"));
+ if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(sNullDate) )
+ m_aNullDate = xProp->getPropertyValue(sNullDate);
SvNumberFormatsSupplierObj* pSupplierObj = SvNumberFormatsSupplierObj::getImplementation( xSupplier );
if( pSupplierObj )
m_pNumberFormatter = pSupplierObj->GetNumberFormatter();
@@ -108,8 +113,27 @@ rtl::OUString NumberFormatterWrapper::getFormattedString(
DBG_ERROR("Need a NumberFormatter");
return aText;
}
+ // i99104 handle null date correctly
+ USHORT nYear = 1899,nDay = 30,nMonth = 12;
+ if ( m_aNullDate.hasValue() )
+ {
+ Date* pDate = m_pNumberFormatter->GetNullDate();
+ if ( pDate )
+ {
+ nYear = pDate->GetYear();
+ nMonth = pDate->GetMonth();
+ nDay = pDate->GetDay();
+ } // if ( pDate )
+ util::DateTime aNewNullDate;
+ m_aNullDate >>= aNewNullDate;
+ m_pNumberFormatter->ChangeNullDate(aNewNullDate.Day,aNewNullDate.Month,aNewNullDate.Year);
+ }
m_pNumberFormatter->GetOutputString(
fValue, nNumberFormatKey, aText, &pTextColor);
+ if ( m_aNullDate.hasValue() )
+ {
+ m_pNumberFormatter->ChangeNullDate(nDay,nMonth,nYear);
+ }
rtl::OUString aRet( aText );
if(pTextColor)
diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx
index c975519d9628..e99c260c6d04 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -142,19 +142,6 @@ uno::Reference< XTransformation > PlottingPositionHelper::getTransformationScale
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;
@@ -163,9 +150,24 @@ uno::Reference< XTransformation > PlottingPositionHelper::getTransformationScale
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);
+ double fScaleX = fScaleDirectionX*FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthX;
+ double fScaleY = fScaleDirectionY*FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthY;
+ double fScaleZ = fScaleDirectionZ*FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthZ;
+
+ aMatrix.scale(fScaleX, fScaleY, fScaleZ);
+
+ if( AxisOrientation_MATHEMATICAL==nXAxisOrientation )
+ aMatrix.translate(-MinX*fScaleX, 0.0, 0.0);
+ else
+ aMatrix.translate(-MaxX*fScaleX, 0.0, 0.0);
+ if( AxisOrientation_MATHEMATICAL==nYAxisOrientation )
+ aMatrix.translate(0.0, -MinY*fScaleY, 0.0);
+ else
+ aMatrix.translate(0.0, -MaxY*fScaleY, 0.0);
+ if( AxisOrientation_MATHEMATICAL==nZAxisOrientation )
+ aMatrix.translate(0.0, 0.0, -MaxZ*fScaleZ);//z direction in draw is reverse mathematical direction
+ else
+ aMatrix.translate(0.0, 0.0, -MinZ*fScaleZ);
aMatrix = m_aMatrixScreenToScene*aMatrix;
@@ -612,6 +614,7 @@ drawing::Position3D PolarPlottingPositionHelper::transformAngleRadiusToScene( do
return transformUnitCircleToScene( fUnitAngleDegree, fUnitRadius, fLogicZ, bDoScaling );
}
+#ifdef NOTYET
double PolarPlottingPositionHelper::getInnerLogicRadius() const
{
const ExplicitScaleData& rScale = m_bSwapXAndY ? m_aScales[0] : m_aScales[1];
@@ -620,6 +623,7 @@ double PolarPlottingPositionHelper::getInnerLogicRadius() const
else
return rScale.Maximum;
}
+#endif
double PolarPlottingPositionHelper::getOuterLogicRadius() const
{
diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx
index 53a1b3673c81..04d95ce249a6 100644
--- a/chart2/source/view/main/PropertyMapper.cxx
+++ b/chart2/source/view/main/PropertyMapper.cxx
@@ -250,6 +250,7 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProper
// ( C2U( "RubyAdjust" ), C2U("RubyAdjust") )
// ( C2U( "RubyCharStyleName" ), C2U("RubyStyleName") )
// ( C2U( "RubyIsAbove" ), C2U("RubyIsAbove") )
+ ( C2U( "ParaIsCharacterDistance" ), C2U("ParaIsCharacterDistance") )
;
return m_aShapePropertyMapForCharacterProperties;
}
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index 21bf943c9899..8a19e66334fb 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -1023,7 +1023,8 @@ uno::Reference< drawing::XShape >
, const Stripe& rStripe
, const uno::Reference< beans::XPropertySet >& xSourceProp
, const tPropertyNameMap& rPropertyNameMap
- , sal_Bool bDoubleSided )
+ , sal_Bool bDoubleSided
+ , bool bRotatedTexture )
{
if( !xTarget.is() )
return 0;
@@ -1047,7 +1048,7 @@ uno::Reference< drawing::XShape >
//TexturePolygon
xProp->setPropertyValue( C2U( UNO_NAME_3D_TEXTUREPOLYGON3D )
- , rStripe.getTexturePolygon() );
+ , rStripe.getTexturePolygon( bRotatedTexture ) );
//Normals Polygon
@@ -1573,6 +1574,53 @@ uno::Reference< drawing::XShapes >
}
uno::Reference< drawing::XShape >
+ ShapeFactory::createCircle2D( const uno::Reference< drawing::XShapes >& xTarget
+ , const drawing::Position3D& rPosition
+ , const drawing::Direction3D& rSize )
+{
+ if( !xTarget.is() )
+ return 0;
+
+ //create shape
+ uno::Reference< drawing::XShape > xShape(
+ m_xShapeFactory->createInstance( C2U(
+ "com.sun.star.drawing.EllipseShape") ), uno::UNO_QUERY );
+ xTarget->add(xShape);
+
+ try
+ {
+ drawing::Position3D aCenterPosition(
+ rPosition.PositionX - (rSize.DirectionX / 2.0),
+ rPosition.PositionY - (rSize.DirectionY / 2.0),
+ rPosition.PositionZ );
+ xShape->setPosition( Position3DToAWTPoint( aCenterPosition ));
+ xShape->setSize( Direction3DToAWTSize( rSize ));
+ }
+ catch( const uno::Exception & e )
+ {
+ ASSERT_EXCEPTION( e );
+ }
+
+ //set properties
+ uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY );
+ DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet");
+ if( xProp.is())
+ {
+ try
+ {
+ drawing::CircleKind eKind = drawing::CircleKind_FULL;
+ xProp->setPropertyValue( C2U( UNO_NAME_CIRCKIND )
+ , uno::makeAny( eKind ) );
+ }
+ catch( uno::Exception& e )
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ }
+ return xShape;
+}
+
+uno::Reference< drawing::XShape >
ShapeFactory::createLine3D( const uno::Reference< drawing::XShapes >& xTarget
, const drawing::PolyPolygonShape3D& rPoints
, const VLineProperties& rLineProperties )
diff --git a/chart2/source/view/main/Stripe.cxx b/chart2/source/view/main/Stripe.cxx
index 67b2396682aa..cb35e0e010b9 100644
--- a/chart2/source/view/main/Stripe.cxx
+++ b/chart2/source/view/main/Stripe.cxx
@@ -161,7 +161,7 @@ uno::Any Stripe::getNormalsPolygon() const
return uno::Any( &aPP, ::getCppuType((const drawing::PolyPolygonShape3D*)0) );
}
-uno::Any Stripe::getTexturePolygon() const
+uno::Any Stripe::getTexturePolygon( bool bRotatedTexture ) const
{
drawing::PolyPolygonShape3D aPP;
@@ -181,21 +181,42 @@ uno::Any Stripe::getTexturePolygon() const
double* pInnerSequenceY = pOuterSequenceY->getArray();
double* pInnerSequenceZ = pOuterSequenceZ->getArray();
- *pInnerSequenceX++ = 0.0;
- *pInnerSequenceY++ = 0.0;
- *pInnerSequenceZ++ = 0.0;
+ if( !bRotatedTexture )
+ {
+ *pInnerSequenceX++ = 0.0;
+ *pInnerSequenceY++ = 0.0;
+ *pInnerSequenceZ++ = 0.0;
+
+ *pInnerSequenceX++ = 1.0;
+ *pInnerSequenceY++ = 0.0;
+ *pInnerSequenceZ++ = 0.0;
- *pInnerSequenceX++ = 1.0;
- *pInnerSequenceY++ = 0.0;
- *pInnerSequenceZ++ = 0.0;
+ *pInnerSequenceX++ = 1.0;
+ *pInnerSequenceY++ = 1.0;
+ *pInnerSequenceZ++ = 0.0;
- *pInnerSequenceX++ = 1.0;
- *pInnerSequenceY++ = 1.0;
- *pInnerSequenceZ++ = 0.0;
+ *pInnerSequenceX++ = 0.0;
+ *pInnerSequenceY++ = 1.0;
+ *pInnerSequenceZ++ = 0.0;
+ }
+ else
+ {
+ *pInnerSequenceX++ = 1.0;
+ *pInnerSequenceY++ = 0.0;
+ *pInnerSequenceZ++ = 0.0;
- *pInnerSequenceX++ = 0.0;
- *pInnerSequenceY++ = 1.0;
- *pInnerSequenceZ++ = 0.0;
+ *pInnerSequenceX++ = 1.0;
+ *pInnerSequenceY++ = 1.0;
+ *pInnerSequenceZ++ = 0.0;
+
+ *pInnerSequenceX++ = 0.0;
+ *pInnerSequenceY++ = 1.0;
+ *pInnerSequenceZ++ = 0.0;
+
+ *pInnerSequenceX++ = 0.0;
+ *pInnerSequenceY++ = 0.0;
+ *pInnerSequenceZ++ = 0.0;
+ }
return uno::Any( &aPP, ::getCppuType((const drawing::PolyPolygonShape3D*)0) );
}
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index f648b7510cec..f537612efd8b 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -37,7 +37,8 @@
#include "LabelPositionHelper.hxx"
#include "ChartTypeHelper.hxx"
#include "ContainerHelper.hxx"
-#include "MeanValueRegressionCurveCalculator.hxx"
+#include "DataSeriesHelper.hxx"
+#include "RegressionCurveHelper.hxx"
#include <com/sun/star/chart/MissingValueTreatment.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
@@ -61,87 +62,10 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
-namespace
-{
- struct lcl_LessIndex
- {
- inline bool operator() ( const sal_Int32& first,
- const sal_Int32& second )
- {
- return ( first < second );
- }
- };
-
- void lcl_removeIndices( uno::Sequence< double >& rValues, const uno::Sequence< sal_Int32 >& rIndicesToRemove )
- {
- if( !rIndicesToRemove.getLength() )
- return;
-
- ::std::vector< sal_Int32 > aIndicesToRemove( ContainerHelper::SequenceToVector( rIndicesToRemove) );
- ::std::sort( aIndicesToRemove.begin(), aIndicesToRemove.end(), lcl_LessIndex() );
-
- sal_Int32 nTarget=0;
- sal_Int32 nR = 0;
- sal_Int32 nRemove = aIndicesToRemove[nR];
- for( sal_Int32 nSource=0; nSource<rValues.getLength(); nSource++ )
- {
- if( nSource<nRemove || nRemove==-1 )
- {
- if( nTarget < nSource )
- rValues[nTarget]=rValues[nSource];
- nTarget++;
- continue;
- }
- if( nSource==nRemove )
- {
- ++nR;
- if( nR<static_cast<sal_Int32>(aIndicesToRemove.size()) )
- nRemove = aIndicesToRemove[nR];
- else
- nRemove = -1;
- }
- }
-
- if( nTarget>0 )
- rValues.realloc( nTarget );
- else
- rValues.realloc(0);
- }
-}
-
void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
{
- bool bDisplayHiddenCells = true; //todo: make this configurable in future
- bool bIsHidden = false;
- uno::Sequence< sal_Int32 > aHiddenValues;
- if( !bDisplayHiddenCells )
- {
- uno::Reference<beans::XPropertySet> xProp(xModel, uno::UNO_QUERY );
- if( xProp.is())
- {
- try
- {
- xProp->getPropertyValue( C2U( "IsHidden" ) ) >>= bIsHidden;
- xProp->getPropertyValue( C2U( "HiddenValues" ) ) >>= aHiddenValues;
- }
- catch( uno::Exception& e )
- {
- ASSERT_EXCEPTION( e );
- }
- }
- }
-
Model = xModel;
- if( bDisplayHiddenCells || !bIsHidden )
- Doubles = DataSequenceToDoubleSequence( xModel );
-
- if( !bDisplayHiddenCells )
- {
- if( bIsHidden )
- Doubles.realloc(0);
- else if( aHiddenValues.getLength() )
- lcl_removeIndices( Doubles, aHiddenValues );
- }
+ Doubles = DataSequenceToDoubleSequence( xModel );
}
bool VDataSequence::is() const
@@ -200,27 +124,37 @@ struct lcl_LessXOfPoint
}
};
-void lcl_clearIfTextIsContained( VDataSequence& rData, const uno::Reference<data::XDataSequence>& xDataSequence )
+void lcl_clearIfNoValuesButTextIsContained( VDataSequence& rData, const uno::Reference<data::XDataSequence>& xDataSequence )
{
+ //#i71686#, #i101968#, #i102428#
+ sal_Int32 nCount = rData.Doubles.getLength();
+ for( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ if( !::rtl::math::isNan( rData.Doubles[i] ) )
+ return;
+ }
+ //no double value is countained
+ //is there any text?
uno::Sequence< rtl::OUString > aStrings( DataSequenceToStringSequence( xDataSequence ) );
- for( sal_Int32 i = 0; i < rData.Doubles.getLength(); ++i )
+ sal_Int32 nTextCount = aStrings.getLength();
+ for( sal_Int32 j = 0; j < nTextCount; ++j )
{
- if( ::rtl::math::isNan( rData.Doubles[i] ) )
+ if( aStrings[j].getLength() )
{
- if( i < aStrings.getLength() && aStrings[i].getLength() )
- {
- rData.clear();
- break;
- }
+ rData.clear();
+ return;
}
}
+ //no content at all
}
+void lcl_maybeReplaceNanWithZero( double& rfValue, sal_Int32 nMissingValueTreatment )
+{
+ if( nMissingValueTreatment == ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
+ && (::rtl::math::isNan(rfValue) || ::rtl::math::isInf(rfValue)) )
+ rfValue = 0.0;
}
-VDataSeries::VDataSeries()
-{
- DBG_ERROR("not implemented");
}
VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
@@ -244,6 +178,8 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
, m_aValues_Y_Max()
, m_aValues_Y_First()
, m_aValues_Y_Last()
+ , m_aValues_Bubble_Size()
+ , m_pValueSequenceForDataLabelNumberFormatDetection(&m_aValues_Y)
, m_fYMeanValue(1.0)
@@ -274,6 +210,7 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
, m_apSymbolProperties_InvisibleSymbolForSelection(NULL)
, m_nCurrentAttributedPoint(-1)
, m_nMissingValueTreatment(::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP)
+ , m_bAllowPercentValueInDataLabel(false)
{
::rtl::math::setNan( & m_fYMeanValue );
@@ -299,7 +236,7 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
if( aRole.equals(C2U("values-x")) )
{
m_aValues_X.init( xDataSequence );
- lcl_clearIfTextIsContained( m_aValues_X, xDataSequence );
+ lcl_clearIfNoValuesButTextIsContained( m_aValues_X, xDataSequence );
}
else if( aRole.equals(C2U("values-y")) )
m_aValues_Y.init( xDataSequence );
@@ -311,7 +248,8 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
m_aValues_Y_First.init( xDataSequence );
else if( aRole.equals(C2U("values-last")) )
m_aValues_Y_Last.init( xDataSequence );
- //@todo assign the other roles (+ error for unknown?)
+ else if( aRole.equals(C2U("values-size")) )
+ m_aValues_Bubble_Size.init( xDataSequence );
}
catch( uno::Exception& e )
{
@@ -323,13 +261,15 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
//determine the point count
m_nPointCount = m_aValues_Y.getLength();
{
+ if( m_nPointCount < m_aValues_Bubble_Size.getLength() )
+ m_nPointCount = m_aValues_Bubble_Size.getLength();
if( m_nPointCount < m_aValues_Y_Min.getLength() )
m_nPointCount = m_aValues_Y_Min.getLength();
- if( m_nPointCount < m_aValues_Y_Max.getLength() )
+ if( m_nPointCount < m_aValues_Y_Max.getLength() )
m_nPointCount = m_aValues_Y_Max.getLength();
- if( m_nPointCount < m_aValues_Y_First.getLength() )
+ if( m_nPointCount < m_aValues_Y_First.getLength() )
m_nPointCount = m_aValues_Y_First.getLength();
- if( m_nPointCount < m_aValues_Y_Last.getLength() )
+ if( m_nPointCount < m_aValues_Y_Last.getLength() )
m_nPointCount = m_aValues_Y_Last.getLength();
}
@@ -412,6 +352,7 @@ void VDataSeries::releaseShapes()
void VDataSeries::setCategoryXAxis()
{
m_aValues_X.clear();
+ m_bAllowPercentValueInDataLabel = true;
}
void VDataSeries::setGlobalSeriesIndex( sal_Int32 nGlobalSeriesIndex )
@@ -526,27 +467,48 @@ sal_Int32 VDataSeries::getTotalPointCount() const
return m_nPointCount;
}
-double VDataSeries::getX( sal_Int32 index ) const
+double VDataSeries::getXValue( sal_Int32 index ) const
{
+ double fRet = 0.0;
if(m_aValues_X.is())
{
if( 0<=index && index<m_aValues_X.getLength() )
- return m_aValues_X.Doubles[index];
+ fRet = m_aValues_X.Doubles[index];
+ else
+ ::rtl::math::setNan( &fRet );
}
else
{
// #i70133# always return correct X position - needed for short data series
if( 0<=index /*&& index < m_nPointCount*/ )
- return index+1;//first category (index 0) matches with real number 1.0
+ fRet = index+1;//first category (index 0) matches with real number 1.0
+ else
+ ::rtl::math::setNan( &fRet );
}
- double fNan;
- ::rtl::math::setNan( & fNan );
- return fNan;
+ lcl_maybeReplaceNanWithZero( fRet, getMissingValueTreatment() );
+ return fRet;
}
-double VDataSeries::getY( sal_Int32 index ) const
+double VDataSeries::getYValue( sal_Int32 index ) const
{
- return m_aValues_Y.getValue( index );
+ double fRet = 0.0;
+ if(m_aValues_Y.is())
+ {
+ if( 0<=index && index<m_aValues_Y.getLength() )
+ fRet = m_aValues_Y.Doubles[index];
+ else
+ ::rtl::math::setNan( &fRet );
+ }
+ else
+ {
+ // #i70133# always return correct X position - needed for short data series
+ if( 0<=index /*&& index < m_nPointCount*/ )
+ fRet = index+1;//first category (index 0) matches with real number 1.0
+ else
+ ::rtl::math::setNan( &fRet );
+ }
+ lcl_maybeReplaceNanWithZero( fRet, getMissingValueTreatment() );
+ return fRet;
}
double VDataSeries::getY_Min( sal_Int32 index ) const
@@ -565,6 +527,10 @@ double VDataSeries::getY_Last( sal_Int32 index ) const
{
return m_aValues_Y_Last.getValue( index );
}
+double VDataSeries::getBubble_Size( sal_Int32 index ) const
+{
+ return m_aValues_Bubble_Size.getValue( index );
+}
bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const
{
@@ -585,9 +551,37 @@ sal_Int32 VDataSeries::getExplicitNumberFormat( sal_Int32 nPointIndex, bool bFor
xPointProp->getPropertyValue(aPropName) >>= nNumberFormat;
return nNumberFormat;
}
+void VDataSeries::setRoleOfSequenceForDataLabelNumberFormatDetection( const rtl::OUString& rRole )
+{
+ if( rRole.equals(C2U("values-y")) )
+ m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y;
+ else if( rRole.equals(C2U("values-size")) )
+ m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Bubble_Size;
+ else if( rRole.equals(C2U("values-min")) )
+ m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Min;
+ else if( rRole.equals(C2U("values-max")) )
+ m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Max;
+ else if( rRole.equals(C2U("values-first")) )
+ m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_First;
+ else if( rRole.equals(C2U("values-last")) )
+ m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Last;
+ else if( rRole.equals(C2U("values-x")) )
+ m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_X;
+}
+bool VDataSeries::shouldLabelNumberFormatKeyBeDetectedFromYAxis() const
+{
+ if( m_pValueSequenceForDataLabelNumberFormatDetection == &m_aValues_Bubble_Size )
+ return false;
+ else if( m_pValueSequenceForDataLabelNumberFormatDetection == &m_aValues_X )
+ return false;
+ return true;
+}
sal_Int32 VDataSeries::detectNumberFormatKey( sal_Int32 index ) const
{
- return m_aValues_Y.detectNumberFormatKey( index );
+ sal_Int32 nRet = 0;
+ if( m_pValueSequenceForDataLabelNumberFormatDetection )
+ nRet = m_pValueSequenceForDataLabelNumberFormatDetection->detectNumberFormatKey( index );
+ return nRet;
}
sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const uno::Reference< chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Bool bSwapXAndY ) const
@@ -626,24 +620,33 @@ sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const uno::Refe
double VDataSeries::getMinimumofAllDifferentYValues( sal_Int32 index ) const
{
- double fY = getY( index );
- double fY_Min = getY_Min( index );
- double fY_Max = getY_Max( index );
- double fY_First = getY_First( index );
- double fY_Last = getY_Last( index );
-
double fMin=0.0;
::rtl::math::setInf(&fMin, false);
- if(fMin>fY)
- fMin=fY;
- if(fMin>fY_First)
- fMin=fY_First;
- if(fMin>fY_Last)
- fMin=fY_Last;
- if(fMin>fY_Min)
- fMin=fY_Min;
- if(fMin>fY_Max)
- fMin=fY_Max;
+
+ if( !m_aValues_Y.is() &&
+ (m_aValues_Y_Min.is() || m_aValues_Y_Max.is()
+ || m_aValues_Y_First.is() || m_aValues_Y_Last.is() ) )
+ {
+ double fY_Min = getY_Min( index );
+ double fY_Max = getY_Max( index );
+ double fY_First = getY_First( index );
+ double fY_Last = getY_Last( index );
+
+ if(fMin>fY_First)
+ fMin=fY_First;
+ if(fMin>fY_Last)
+ fMin=fY_Last;
+ if(fMin>fY_Min)
+ fMin=fY_Min;
+ if(fMin>fY_Max)
+ fMin=fY_Max;
+ }
+ else
+ {
+ double fY = getYValue( index );
+ if(fMin>fY)
+ fMin=fY;
+ }
if( ::rtl::math::isInf(fMin) )
::rtl::math::setNan(&fMin);
@@ -653,24 +656,33 @@ double VDataSeries::getMinimumofAllDifferentYValues( sal_Int32 index ) const
double VDataSeries::getMaximumofAllDifferentYValues( sal_Int32 index ) const
{
- double fY = getY( index );
- double fY_Min = getY_Min( index );
- double fY_Max = getY_Max( index );
- double fY_First = getY_First( index );
- double fY_Last = getY_Last( index );
-
double fMax=0.0;
::rtl::math::setInf(&fMax, true);
- if(fMax<fY)
- fMax=fY;
- if(fMax<fY_First)
- fMax=fY_First;
- if(fMax<fY_Last)
- fMax=fY_Last;
- if(fMax<fY_Min)
- fMax=fY_Min;
- if(fMax<fY_Max)
- fMax=fY_Max;
+
+ if( !m_aValues_Y.is() &&
+ (m_aValues_Y_Min.is() || m_aValues_Y_Max.is()
+ || m_aValues_Y_First.is() || m_aValues_Y_Last.is() ) )
+ {
+ double fY_Min = getY_Min( index );
+ double fY_Max = getY_Max( index );
+ double fY_First = getY_First( index );
+ double fY_Last = getY_Last( index );
+
+ if(fMax<fY_First)
+ fMax=fY_First;
+ if(fMax<fY_Last)
+ fMax=fY_Last;
+ if(fMax<fY_Min)
+ fMax=fY_Min;
+ if(fMax<fY_Max)
+ fMax=fY_Max;
+ }
+ else
+ {
+ double fY = getYValue( index );
+ if(fMax<fY)
+ fMax=fY;
+ }
if( ::rtl::math::isInf(fMax) )
::rtl::math::setNan(&fMax);
@@ -693,6 +705,14 @@ uno::Sequence< double > VDataSeries::getAllX() const
uno::Sequence< double > VDataSeries::getAllY() const
{
+ if(!m_aValues_Y.is() && !m_aValues_Y.getLength() && m_nPointCount)
+ {
+ //init y values from indexes
+ //first y-value (index 0) matches with real number 1.0
+ m_aValues_Y.Doubles.realloc( m_nPointCount );
+ for(sal_Int32 nN=m_aValues_Y.getLength();nN--;)
+ m_aValues_Y.Doubles[nN] = nN+1;
+ }
return m_aValues_Y.Doubles;
}
@@ -700,7 +720,7 @@ double VDataSeries::getYMeanValue() const
{
if( ::rtl::math::isNan( m_fYMeanValue ) )
{
- uno::Reference< XRegressionCurveCalculator > xCalculator( new MeanValueRegressionCurveCalculator() );
+ uno::Reference< XRegressionCurveCalculator > xCalculator( RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( C2U("com.sun.star.chart2.MeanValueRegressionCurve") ) );
uno::Sequence< double > aXValuesDummy;
xCalculator->recalculateRegression( aXValuesDummy, getAllY() );
double fXDummy = 1.0;
@@ -887,6 +907,11 @@ DataPointLabel* VDataSeries::getDataPointLabel( sal_Int32 index ) const
m_apLabel_Series = getDataPointLabelFromPropertySet( this->getPropertiesOfPoint( index ) );
pRet = m_apLabel_Series.get();
}
+ if( !m_bAllowPercentValueInDataLabel )
+ {
+ if( pRet )
+ pRet->ShowNumberInPercent = false;
+ }
return pRet;
}
diff --git a/chart2/source/view/makefile.mk b/chart2/source/view/makefile.mk
index 58229edf1217..8ab947b9cedc 100644
--- a/chart2/source/view/makefile.mk
+++ b/chart2/source/view/makefile.mk
@@ -82,7 +82,7 @@ SHL1STDLIBS= $(CHARTTOOLS) \
$(SALLIB) \
$(SVLLIB) \
$(SVTOOLLIB) \
- $(SVXLIB) \
+ $(SVXCORELIB) \
$(TOOLSLIB) \
$(UNOTOOLSLIB) \
$(BASEGFXLIB) \