summaryrefslogtreecommitdiff
path: root/chart2/source/controller
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller')
-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
95 files changed, 3084 insertions, 1534 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) \