diff options
Diffstat (limited to 'chart2/source/model')
43 files changed, 1279 insertions, 400 deletions
diff --git a/chart2/source/model/inc/BaseCoordinateSystem.hxx b/chart2/source/model/inc/BaseCoordinateSystem.hxx index afb0c5027f72..4afd4f6ff51f 100644 --- a/chart2/source/model/inc/BaseCoordinateSystem.hxx +++ b/chart2/source/model/inc/BaseCoordinateSystem.hxx @@ -33,7 +33,6 @@ #include "ServiceMacros.hxx" #include "OPropertySet.hxx" #include "MutexContainer.hxx" -#include "ModifyListenerHelper.hxx" #include <cppuhelper/implbase6.hxx> #include <comphelper/uno3.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> diff --git a/chart2/source/model/inc/Diagram.hxx b/chart2/source/model/inc/Diagram.hxx index 283885866546..69e58bad0128 100644 --- a/chart2/source/model/inc/Diagram.hxx +++ b/chart2/source/model/inc/Diagram.hxx @@ -45,7 +45,6 @@ #include <com/sun/star/util/XModifyListener.hpp> #include "ServiceMacros.hxx" -#include "ModifyListenerHelper.hxx" #include <map> #include <vector> diff --git a/chart2/source/model/inc/StockBar.hxx b/chart2/source/model/inc/StockBar.hxx index 9f1b7aac9fc0..6db0c02b8959 100644 --- a/chart2/source/model/inc/StockBar.hxx +++ b/chart2/source/model/inc/StockBar.hxx @@ -37,7 +37,6 @@ #include "OPropertySet.hxx" #include "ServiceMacros.hxx" -#include "ModifyListenerHelper.hxx" #include <cppuhelper/implbase3.hxx> #include <comphelper/uno3.hxx> diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx index d4a1cdff49e8..2b119c633537 100644 --- a/chart2/source/model/main/Axis.cxx +++ b/chart2/source/model/main/Axis.cxx @@ -296,7 +296,7 @@ namespace chart Axis::Axis( Reference< uno::XComponentContext > const & /* xContext */ ) : ::property::OPropertySet( m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()), + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), m_aScaleData( AxisHelper::createDefaultScale() ), m_xGrid( new GridProperties() ), m_aSubGridProperties(), @@ -317,7 +317,7 @@ Axis::Axis( const Axis & rOther ) : MutexContainer(), impl::Axis_Base(), ::property::OPropertySet( rOther, m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()), + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), m_aScaleData( rOther.m_aScaleData ) { m_xGrid.set( CloneHelper::CreateRefClone< Reference< beans::XPropertySet > >()( rOther.m_xGrid )); diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx index 6384964e7738..ebbffe2ef1eb 100644 --- a/chart2/source/model/main/BaseCoordinateSystem.cxx +++ b/chart2/source/model/main/BaseCoordinateSystem.cxx @@ -113,7 +113,7 @@ BaseCoordinateSystem::BaseCoordinateSystem( sal_Bool bSwapXAndYAxis /* = sal_False */ ) : ::property::OPropertySet( m_aMutex ), m_xContext( xContext ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()), + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), m_nDimensionCount( nDimensionCount ) { m_aAllAxis.resize( m_nDimensionCount ); @@ -154,7 +154,7 @@ BaseCoordinateSystem::BaseCoordinateSystem( MutexContainer(), ::property::OPropertySet( rSource, m_aMutex ), m_xContext( rSource.m_xContext ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()), + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), m_nDimensionCount( rSource.m_nDimensionCount ), m_aOrigin( rSource.m_aOrigin ) { diff --git a/chart2/source/model/main/ChartData.cxx b/chart2/source/model/main/ChartData.cxx index b17c0e27bb16..af332f6c3c6e 100644 --- a/chart2/source/model/main/ChartData.cxx +++ b/chart2/source/model/main/ChartData.cxx @@ -32,7 +32,10 @@ #include "precompiled_chart2.hxx" #include "ChartData.hxx" -#include "InternalDataProvider.hxx" +#include "ChartModelHelper.hxx" + +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/beans/NamedValue.hpp> using namespace ::com::sun::star; @@ -45,7 +48,8 @@ namespace chart ChartData::ChartData( const Reference< uno::XComponentContext > & xContext ) : m_xContext( xContext ), - m_pInternalDataProvider( 0 ) + m_xDataProvider( 0 ), + m_xInternalDataProvider( 0 ) {} ChartData::~ChartData() @@ -55,7 +59,7 @@ void ChartData::setDataProvider( const Reference< chart2::data::XDataProvider > & xDataProvider ) throw() { m_xDataProvider.set( xDataProvider ); - m_pInternalDataProvider = 0; + m_xInternalDataProvider.clear(); } Reference< chart2::data::XDataProvider > ChartData::getDataProvider() const throw() @@ -70,25 +74,32 @@ bool ChartData::createInternalData( return false; if( bCloneOldData ) - m_pInternalDataProvider = new InternalDataProvider( xChartDoc ); + m_xInternalDataProvider = ChartModelHelper::createInternalDataProvider( xChartDoc ); else - m_pInternalDataProvider = new InternalDataProvider(); + m_xInternalDataProvider = ChartModelHelper::createInternalDataProvider(); - m_xDataProvider.set( m_pInternalDataProvider ); + m_xDataProvider.set( m_xInternalDataProvider ); return true; } bool ChartData::hasInternalData() const { - return (m_xDataProvider.is() && m_pInternalDataProvider != 0); + return (m_xDataProvider.is() && m_xInternalDataProvider.is()); } bool ChartData::createDefaultData() throw() { if( hasInternalData() ) { - m_pInternalDataProvider->createDefaultData(); - return true; + uno::Reference< lang::XInitialization > xIni(m_xInternalDataProvider,uno::UNO_QUERY);
+ if ( xIni.is() ) + { + uno::Sequence< uno::Any > aArgs(1);
+ beans::NamedValue aParam(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDefaultData")),uno::makeAny(sal_True));
+ aArgs[0] <<= aParam;
+ xIni->initialize(aArgs); + return true; + } } return false; } diff --git a/chart2/source/model/main/ChartData.hxx b/chart2/source/model/main/ChartData.hxx index f13971f67629..308db5ab0f6a 100644 --- a/chart2/source/model/main/ChartData.hxx +++ b/chart2/source/model/main/ChartData.hxx @@ -58,8 +58,6 @@ namespace com { namespace sun { namespace star { namespace chart { -class InternalDataProvider; - class ChartData { public: @@ -93,15 +91,12 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > m_xDataProvider; + /** is only valid if m_xDataProvider is set. If m_xDataProvider is set to an - external data provider this pointer must be set to 0 + external data provider this reference must be set to 0 */ - InternalDataProvider * m_pInternalDataProvider; - -// ::com::sun::star::uno::Reference< -// ::com::sun::star::embed::XEmbeddedClient > m_xInternalData; -// /// is only valid if m_xInternalData exists -// InternalData * m_pInternalData; + ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > + m_xInternalDataProvider; }; } // namespace chart diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 49551bf78c7c..4882ecef72de 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -39,10 +39,12 @@ #include "servicenames.hxx" #include "DataSourceHelper.hxx" #include "NoWarningThisInCTOR.hxx" -#include "RangeHighlighter.hxx" +#include "ChartModelHelper.hxx" #include "DisposeHelper.hxx" #include "ControllerLockGuard.hxx" #include "ObjectIdentifier.hxx" +#include "ChartModelHelper.hxx" + #include <comphelper/InlineContainer.hxx> #include <comphelper/processfactory.hxx> @@ -703,6 +705,19 @@ sal_Bool SAL_CALL ChartModel::hasInternalDataProvider() { // /-- MutexGuard aGuard( m_aModelMutex ); + uno::Reference< beans::XPropertySet > xProp( xProvider, uno::UNO_QUERY ); + if( xProp.is() ) + { + try + { + sal_Bool bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( Reference< frame::XModel >(this) ); + xProp->setPropertyValue(C2U("IncludeHiddenCells"), uno::makeAny(bIncludeHiddenCells)); + } + catch( const beans::UnknownPropertyException& ) + { + } + } + m_pImplChartModel->SetDataProvider( xProvider ); // \-- } @@ -769,7 +784,7 @@ sal_Bool SAL_CALL ChartModel::hasInternalDataProvider() { uno::Reference< view::XSelectionSupplier > xSelSupp( this->getCurrentController(), uno::UNO_QUERY ); if( xSelSupp.is() ) - m_xRangeHighlighter.set( new RangeHighlighter( xSelSupp )); + m_xRangeHighlighter.set( ChartModelHelper::createRangeHighlighter( xSelSupp )); } return m_xRangeHighlighter; } diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx index d720443270d2..2e317ba7a0db 100644 --- a/chart2/source/model/main/ChartModel_Persistence.cxx +++ b/chart2/source/model/main/ChartModel_Persistence.cxx @@ -37,6 +37,7 @@ #include "ChartDebugTrace.hxx" #include "macros.hxx" #include "ChartViewHelper.hxx" +#include "ChartModelHelper.hxx" #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/document/XImporter.hpp> @@ -407,6 +408,7 @@ void SAL_CALL ChartModel::initNew() try { m_pImplChartModel->CreateDefaultChart(); + ChartModelHelper::setIncludeHiddenCells( false, this ); } catch( uno::Exception & ex ) { diff --git a/chart2/source/model/main/DataPoint.cxx b/chart2/source/model/main/DataPoint.cxx index 57680c4c15e7..983ba72080c1 100644 --- a/chart2/source/model/main/DataPoint.cxx +++ b/chart2/source/model/main/DataPoint.cxx @@ -90,17 +90,21 @@ namespace chart DataPoint::DataPoint( const uno::Reference< beans::XPropertySet > & rParentProperties ) : ::property::OPropertySet( m_aMutex ), m_xParentProperties( rParentProperties ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()), + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), m_bNoParentPropAllowed( false ) -{} +{ + SetNewValuesExplicitlyEvenIfTheyEqualDefault(); +} DataPoint::DataPoint( const DataPoint & rOther ) : MutexContainer(), impl::DataPoint_Base(), ::property::OPropertySet( rOther, m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()), + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), m_bNoParentPropAllowed( true ) { + SetNewValuesExplicitlyEvenIfTheyEqualDefault(); + // m_xParentProperties has to be set from outside, like in the method // DataSeries::createClone diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx index 8e80bc1e8a47..a748d04d4b64 100644 --- a/chart2/source/model/main/DataPointProperties.cxx +++ b/chart2/source/model/main/DataPointProperties.cxx @@ -332,6 +332,13 @@ void DataPointProperties::AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID )); + rOutProperties.push_back( + Property( C2U( "TextRotation" ), + PROP_DATAPOINT_TEXT_ROTATION, + ::getCppuType( reinterpret_cast< const double * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + // statistics rOutProperties.push_back( Property( C2U( "ErrorBarX" ), @@ -427,6 +434,8 @@ void DataPointProperties::AddDefaultsToMap( PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_ERROR_BAR_X, uno::Reference< beans::XPropertySet >()); PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATAPOINT_ERROR_BAR_Y, uno::Reference< beans::XPropertySet >()); PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_DATAPOINT_PERCENT_DIAGONAL, 0 ); + + PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_DATAPOINT_TEXT_ROTATION, 0.0 ); } } // namespace chart diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx index 02d41b734503..6482adaa8679 100644 --- a/chart2/source/model/main/DataPointProperties.hxx +++ b/chart2/source/model/main/DataPointProperties.hxx @@ -77,6 +77,7 @@ public: PROP_DATAPOINT_PERCENTAGE_NUMBER_FORMAT, PROP_DATAPOINT_LABEL_PLACEMENT, PROP_DATAPOINT_REFERENCE_DIAGRAM_SIZE, + PROP_DATAPOINT_TEXT_ROTATION, // statistics PROP_DATAPOINT_ERROR_BAR_X, diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx index 5324c1eaae5c..9f331ce2a215 100644 --- a/chart2/source/model/main/DataSeries.cxx +++ b/chart2/source/model/main/DataSeries.cxx @@ -136,7 +136,7 @@ namespace chart DataSeries::DataSeries( const uno::Reference< uno::XComponentContext > & xContext ) : ::property::OPropertySet( m_aMutex ), m_xContext( xContext ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { } @@ -145,7 +145,7 @@ DataSeries::DataSeries( const DataSeries & rOther ) : impl::DataSeries_Base(), ::property::OPropertySet( rOther, m_aMutex ), m_xContext( rOther.m_xContext ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { if( ! rOther.m_aDataSequences.empty()) { diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 1718ddb1646d..3e8c8ea9cd24 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -78,6 +78,7 @@ enum PROP_DIAGRAM_SORT_BY_X_VALUES, PROP_DIAGRAM_CONNECT_BARS, PROP_DIAGRAM_GROUP_BARS_PER_AXIS, + PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, PROP_DIAGRAM_STARTING_ANGLE, PROP_DIAGRAM_RIGHT_ANGLED_AXES, PROP_DIAGRAM_PERSPECTIVE, @@ -125,6 +126,13 @@ void lcl_AddPropertiesToVector( | beans::PropertyAttribute::MAYBEDEFAULT )); rOutProperties.push_back( + Property( C2U("IncludeHiddenCells"), + PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, + ::getBooleanCppuType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( Property( C2U( "StartingAngle" ), PROP_DIAGRAM_STARTING_ANGLE, ::getCppuType( reinterpret_cast< const sal_Int32 * >(0) ), @@ -170,6 +178,7 @@ void lcl_AddDefaultsToMap( ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_SORT_BY_X_VALUES, false ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_CONNECT_BARS, false ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_GROUP_BARS_PER_AXIS, true ); + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false ); ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 ); } @@ -241,7 +250,7 @@ namespace chart Diagram::Diagram( uno::Reference< uno::XComponentContext > const & xContext ) : ::property::OPropertySet( m_aMutex ), m_xContext( xContext ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { // Set camera position to a default position (that should be set hard, so // that it will be exported. The property default is a camera looking @@ -257,7 +266,7 @@ Diagram::Diagram( const Diagram & rOther ) : impl::Diagram_Base(), ::property::OPropertySet( rOther, m_aMutex ), m_xContext( rOther.m_xContext ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { lcl_tCooSysMapping aCooSysMapping = lcl_CloneCoordinateSystems( rOther.m_aCoordSystems, m_aCoordSystems ); @@ -352,7 +361,7 @@ Reference< chart2::XColorScheme > SAL_CALL Diagram::getDefaultColorScheme() { if( ! m_xColorScheme.is()) { - m_xColorScheme.set( new ConfigColorScheme( m_xContext )); + m_xColorScheme.set( createConfigColorScheme( m_xContext )); } return m_xColorScheme; } diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx index a2175b68a1da..e0d565bdb187 100644 --- a/chart2/source/model/main/FormattedString.cxx +++ b/chart2/source/model/main/FormattedString.cxx @@ -91,7 +91,7 @@ FormattedString::FormattedString( uno::Reference< uno::XComponentContext > const & /* xContext */ ) : ::property::OPropertySet( m_aMutex ), m_aString(), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} FormattedString::FormattedString( const FormattedString & rOther ) : @@ -99,7 +99,7 @@ FormattedString::FormattedString( const FormattedString & rOther ) : impl::FormattedString_Base(), ::property::OPropertySet( rOther, m_aMutex ), m_aString( rOther.m_aString ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} FormattedString::~FormattedString() diff --git a/chart2/source/model/main/GridProperties.cxx b/chart2/source/model/main/GridProperties.cxx index 590aed34339b..4f48d16886b1 100644 --- a/chart2/source/model/main/GridProperties.cxx +++ b/chart2/source/model/main/GridProperties.cxx @@ -128,20 +128,20 @@ namespace chart GridProperties::GridProperties( Reference< uno::XComponentContext > const & /* xContext */ ) : ::property::OPropertySet( m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { } GridProperties::GridProperties() : ::property::OPropertySet( m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} GridProperties::GridProperties( const GridProperties & rOther ) : MutexContainer(), impl::GridProperties_Base(), ::property::OPropertySet( rOther, m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { } diff --git a/chart2/source/model/main/ImplChartModel.cxx b/chart2/source/model/main/ImplChartModel.cxx index bd4ad5630cb2..87383dcf5817 100644 --- a/chart2/source/model/main/ImplChartModel.cxx +++ b/chart2/source/model/main/ImplChartModel.cxx @@ -40,7 +40,7 @@ #include "ModifyListenerHelper.hxx" #include "DataSourceHelper.hxx" #include "DisposeHelper.hxx" -#include "UndoManager.hxx" +#include "ChartModelHelper.hxx" #include "ThreeDHelper.hxx" #include "AxisHelper.hxx" @@ -112,19 +112,19 @@ ImplChartModel::ImplChartModel( m_spChartData( new ChartData( m_xContext )), m_bIsDisposed( false ), m_xPageBackground( new PageBackground( m_xContext )), - m_xUndoManager( new UndoManager()), - m_xDashTable( new NameContainer( ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)), + m_xUndoManager( ChartModelHelper::createUndoManager() ), + m_xDashTable( createNameContainer( ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)), C2U( "com.sun.star.drawing.DashTable" ), C2U( "com.sun.star.comp.chart.DashTable" ) )), - m_xGradientTable( new NameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)), + m_xGradientTable( createNameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)), C2U( "com.sun.star.drawing.GradientTable" ), C2U( "com.sun.star.comp.chart.GradientTable" ) )), - m_xHatchTable( new NameContainer( ::getCppuType( reinterpret_cast< const drawing::Hatch * >(0)), + m_xHatchTable( createNameContainer( ::getCppuType( reinterpret_cast< const drawing::Hatch * >(0)), C2U( "com.sun.star.drawing.HatchTable" ), C2U( "com.sun.star.comp.chart.HatchTable" ) )), - m_xBitmapTable( new NameContainer( ::getCppuType( reinterpret_cast< const OUString * >(0)), // URL + m_xBitmapTable( createNameContainer( ::getCppuType( reinterpret_cast< const OUString * >(0)), // URL C2U( "com.sun.star.drawing.BitmapTable" ), C2U( "com.sun.star.comp.chart.BitmapTable" ) )), - m_xTransparencyGradientTable( new NameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)), + m_xTransparencyGradientTable( createNameContainer( ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)), C2U( "com.sun.star.drawing.TransparencyGradientTable" ), C2U( "com.sun.star.comp.chart.TransparencyGradientTable" ) )), - m_xXMLNamespaceMap( new NameContainer( ::getCppuType( (const OUString*) 0 ), - C2U( "com.sun.star.xml.NamespaceMap" ), C2U( "com.sun.star.comp.chart.XMLNameSpaceMap" ) )), + m_xXMLNamespaceMap( createNameContainer( ::getCppuType( (const OUString*) 0 ), + C2U( "com.sun.star.xml.NamespaceMap" ), C2U( "com.sun.star.comp.chart.XMLNameSpaceMap" ) ), uno::UNO_QUERY), m_xModifyListener( xListener ) { ModifyListenerHelper::addListener( m_xPageBackground, m_xModifyListener ); diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx index 9f501b41ef63..3f7f66d23950 100644 --- a/chart2/source/model/main/Legend.cxx +++ b/chart2/source/model/main/Legend.cxx @@ -166,7 +166,7 @@ namespace chart Legend::Legend( Reference< uno::XComponentContext > const & /* xContext */ ) : ::property::OPropertySet( m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { } @@ -174,7 +174,7 @@ Legend::Legend( const Legend & rOther ) : MutexContainer(), impl::Legend_Base(), ::property::OPropertySet( rOther, m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { CloneHelper::CloneRefVector< Reference< chart2::XLegendEntry > >( rOther.m_aLegendEntries, m_aLegendEntries ); ModifyListenerHelper::addListenerToAllElements( m_aLegendEntries, m_xModifyEventForwarder ); diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx index 5a16e30a3733..07def9bf496c 100644 --- a/chart2/source/model/main/PageBackground.cxx +++ b/chart2/source/model/main/PageBackground.cxx @@ -108,7 +108,7 @@ namespace chart PageBackground::PageBackground( const uno::Reference< uno::XComponentContext > & xContext ) : ::property::OPropertySet( m_aMutex ), m_xContext( xContext ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} PageBackground::PageBackground( const PageBackground & rOther ) : @@ -116,7 +116,7 @@ PageBackground::PageBackground( const PageBackground & rOther ) : impl::PageBackground_Base(), ::property::OPropertySet( rOther, m_aMutex ), m_xContext( rOther.m_xContext ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} PageBackground::~PageBackground() diff --git a/chart2/source/model/main/RectangularDataSource.cxx b/chart2/source/model/main/RectangularDataSource.cxx deleted file mode 100644 index edd852927300..000000000000 --- a/chart2/source/model/main/RectangularDataSource.cxx +++ /dev/null @@ -1,297 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: RectangularDataSource.cxx,v $ - * $Revision: 1.6 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_chart2.hxx" -#include "RectangularDataSource.hxx" -#include "CachedDataSequence.hxx" -#include "StandardNaNHelper.hxx" -#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp> -#include <com/sun/star/chart2/data/XTextualDataSequence.hpp> -#include <com/sun/star/util/XNumberFormatsSupplier.hpp> -#include <com/sun/star/beans/PropertyAttribute.hpp> - -using namespace ::com::sun::star; - -using ::rtl::OUString; -using ::osl::MutexGuard; -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::beans::Property; -using ::com::sun::star::uno::RuntimeException; -using ::com::sun::star::uno::Any; -using ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT; - -// necessary for MS compiler -using ::comphelper::OPropertyContainer; -using ::chart::impl::RectangularDataSource_Base; - -// ________________________________________ - -// Property-Ids - -namespace -{ -enum -{ - PROP_SOURCE_RANGE, - PROP_DATA_ROW_SOURCE -}; -} // anonymous namespace - - -// ________________________________________ - -namespace chart -{ - -#define STANDARD_PROPERTY_ATTRIBUTES ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT - -RectangularDataSource::RectangularDataSource( uno::Reference< uno::XComponentContext > const & xContext ) - : OPropertyContainer( GetBroadcastHelper() ), - RectangularDataSource_Base( GetMutex() ), - m_aDataRowSource( ::com::sun::star::chart::ChartDataRowSource_COLUMNS ) -{ - registerProperty( C2U( "SourceRange" ), - PROP_SOURCE_RANGE, // Handle for fast access - 0, // PropertyAttributes - & m_aSourceRange, // pointer to corresponding member - ::getCppuType( & m_aSourceRange ) // Type of property - ); - - registerProperty( C2U( "DataRowSource" ), - PROP_DATA_ROW_SOURCE, // Handle for fast access - MAYBEDEFAULT, // PropertyAttributes - & m_aDataRowSource, // pointer to corresponding member - ::getCppuType( & m_aDataRowSource ) // Type of property - ); -} - -RectangularDataSource::~RectangularDataSource() -{} - -// base for XServiceInfo -Sequence< OUString > RectangularDataSource::getSupportedServiceNames_Static() -{ - Sequence< OUString > aServices( 4 ); - aServices[ 0 ] = C2U( "com.sun.star.chart2.RectangularDataSource" ); - aServices[ 1 ] = C2U( "com.sun.star.chart2.data.DataFilter" ); - aServices[ 2 ] = C2U( "com.sun.star.chart2.data.DataSource" ); - aServices[ 3 ] = C2U( "com.sun.star.chart2.data.DataSink" ); - return aServices; -} - -// ____ XDataSink ____ -void SAL_CALL RectangularDataSource::setData( const uno::Sequence< Reference< chart2::data::XDataSequence > >& aData ) - throw (RuntimeException) -{ - m_aDataSequences = aData; -} - -// ____ XDataSource ____ -uno::Sequence< Reference< chart2::data::XDataSequence > > SAL_CALL RectangularDataSource::getDataSequences() - throw (RuntimeException) -{ - return m_aDataSequences; -} - -double SAL_CALL RectangularDataSource::getNotANumber() - throw (uno::RuntimeException) -{ - return StandardNaNHelper::getNotANumber(); -} - -sal_Bool SAL_CALL RectangularDataSource::isNotANumber( double fNumber ) - throw (uno::RuntimeException) -{ - return StandardNaNHelper::isNotANumber( fNumber ); -} - -// ____ XIndexAccess ____ - sal_Int32 SAL_CALL RectangularDataSource::getCount() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( GetMutex() ); - return m_aDataSequences.getLength(); - // \-- -} - - Any SAL_CALL RectangularDataSource::getByIndex( sal_Int32 Index ) - throw (lang::IndexOutOfBoundsException, - lang::WrappedTargetException, - RuntimeException) -{ - // /-- - MutexGuard aGuard( GetMutex() ); - return uno::makeAny( GetDataByIndex( Index ) ); - // \-- -} - -// ____ XElementAccess (base of XIndexAccess) ____ - uno::Type SAL_CALL RectangularDataSource::getElementType() - throw (RuntimeException) -{ - return ::getCppuType((const Reference< chart2::data::XDataSequence >*)0); -} - -sal_Bool SAL_CALL RectangularDataSource::hasElements() - throw (RuntimeException) -{ - // /-- - MutexGuard aGuard( GetMutex() ); - return static_cast< sal_Bool >( m_aDataSequences.getLength() > 0 ); - // \-- -} - -Reference< chart2::data::XDataSequence > RectangularDataSource::GetDataByIndex( sal_Int32 Index ) const - throw (lang::IndexOutOfBoundsException) -{ - if( 0 > Index || Index >= m_aDataSequences.getLength() ) - throw lang::IndexOutOfBoundsException(); - - return m_aDataSequences.getConstArray() [ Index ]; -} - -void SAL_CALL RectangularDataSource::setFastPropertyValue_NoBroadcast( - sal_Int32 nHandle, - const Any& rValue ) - throw (uno::Exception) -{ - // at this point it is clear that rValue contains a different value than the - // property currently still has, and that it will be overwritten by it in - // the final base class call - - switch( nHandle ) - { - case PROP_DATA_ROW_SOURCE: - { - ::com::sun::star::chart::ChartDataRowSource aRowSource; - if( rValue >>= aRowSource ) - { - if( aRowSource != m_aDataRowSource ) - { - SwapData(); - } - } - } - break; - } - - OPropertyContainer::setFastPropertyValue_NoBroadcast( nHandle, rValue ); -} - -// ================================================================================ - -using impl::RectangularDataSource_Base; - -IMPLEMENT_FORWARD_XINTERFACE2( RectangularDataSource, RectangularDataSource_Base, OPropertyContainer ) -IMPLEMENT_FORWARD_XTYPEPROVIDER2( RectangularDataSource, RectangularDataSource_Base, OPropertyContainer ) - -// ____ XPropertySet ____ -Reference< beans::XPropertySetInfo > SAL_CALL RectangularDataSource::getPropertySetInfo() - throw(RuntimeException) -{ - return Reference< beans::XPropertySetInfo >( createPropertySetInfo( getInfoHelper() ) ); -} - -// ____ ::comphelper::OPropertySetHelper ____ -// __________________________________________ -::cppu::IPropertyArrayHelper& RectangularDataSource::getInfoHelper() -{ - return *getArrayHelper(); -} - -// ____ ::comphelper::OPropertyArrayHelper ____ -// ____________________________________________ -::cppu::IPropertyArrayHelper* RectangularDataSource::createArrayHelper() const -{ - Sequence< Property > aProps; - // describes all properties which have been registered in the ctor - describeProperties( aProps ); - - return new ::cppu::OPropertyArrayHelper( aProps ); -} - -// implement XServiceInfo methods basing upon getSupportedServiceNames_Static -APPHELPER_XSERVICEINFO_IMPL( RectangularDataSource, - C2U( "com.sun.star.comp.chart.RectangularDataSource" )) - -void RectangularDataSource::SwapData() -{ - try - { - // assume that there are always text labels - Reference< chart2::data::XTextualDataSequence > xCategories( GetDataByIndex( 0 ), uno::UNO_QUERY ); - - // -1: the first sequence contains labels - sal_Int32 nNewSequenceSize = m_aDataSequences.getLength() - 1; - if( nNewSequenceSize > 0 ) - { - // +1: one series more for labels - sal_Int32 nNewNumOfSequences = GetDataByIndex( 0 )->getData().getLength() + 1; - Sequence< Reference< chart2::data::XDataSequence > > aResult( nNewNumOfSequences ); - ::std::vector< OUString > aCategoryVector( nNewSequenceSize ); - sal_Int32 nIdx = 0; - - // fill new categories consisting of former labels - for( nIdx = 0; nIdx < nNewSequenceSize; ++nIdx ) - { - aCategoryVector.push_back( GetDataByIndex( nIdx )->getLabel() ); - } - aResult[ 0 ] = Reference< chart2::data::XDataSequence >( - static_cast< chart2::data::XTextualDataSequence * >( - new ::chart::CachedDataSequence( aCategoryVector ))); - - // fill new data sequences. The label is set by the former categories - for( sal_Int32 nSeqIdx = 1; nSeqIdx < nNewNumOfSequences; ++ nSeqIdx ) - { - ::std::vector< double > aDataVector( nNewSequenceSize ); - for( nIdx = 0; nIdx < nNewSequenceSize; ++nIdx ) - { - aDataVector.push_back( - Reference< chart2::data::XNumericalDataSequence >( - GetDataByIndex( nIdx ), - uno::UNO_QUERY )->getNumericalData().getConstArray()[ nSeqIdx - 1 ] ); - } - aResult[ nSeqIdx ] = Reference< chart2::data::XDataSequence >( - static_cast< chart2::data::XNumericalDataSequence * >( - new ::chart::CachedDataSequence( aDataVector ))); - } - - setData( aResult ); - } - } - catch( lang::IndexOutOfBoundsException aEx ) - { - } -} - -} // namespace chart diff --git a/chart2/source/model/main/StockBar.cxx b/chart2/source/model/main/StockBar.cxx index 68f4e8a6d4f0..5edaf6a606d8 100644 --- a/chart2/source/model/main/StockBar.cxx +++ b/chart2/source/model/main/StockBar.cxx @@ -38,6 +38,7 @@ #include "PropertyHelper.hxx" #include "macros.hxx" #include "ContainerHelper.hxx" +#include "ModifyListenerHelper.hxx" #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/style/XStyle.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -110,7 +111,7 @@ namespace chart StockBar::StockBar( bool bRisingCourse ) : ::property::OPropertySet( m_aMutex ), m_bRisingCourse( bRisingCourse ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { if( ! m_bRisingCourse ) { @@ -128,7 +129,7 @@ StockBar::StockBar( const StockBar & rOther ) : impl::StockBar_Base(), ::property::OPropertySet( rOther, m_aMutex ), m_bRisingCourse( rOther.m_bRisingCourse ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} StockBar::~StockBar() diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx index e2b9db4e6d2a..55fa2df663cd 100644 --- a/chart2/source/model/main/Title.cxx +++ b/chart2/source/model/main/Title.cxx @@ -225,14 +225,14 @@ namespace chart Title::Title( uno::Reference< uno::XComponentContext > const & /* xContext */ ) : ::property::OPropertySet( m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} Title::Title( const Title & rOther ) : MutexContainer(), impl::Title_Base(), ::property::OPropertySet( rOther, m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { CloneHelper::CloneRefSequence< uno::Reference< chart2::XFormattedString > >( rOther.m_aStrings, m_aStrings ); diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx index 6da6ff9bba3b..bd27e9fd733a 100644 --- a/chart2/source/model/main/Wall.cxx +++ b/chart2/source/model/main/Wall.cxx @@ -112,14 +112,14 @@ namespace chart Wall::Wall() : ::property::OPropertySet( m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} Wall::Wall( const Wall & rOther ) : MutexContainer(), impl::Wall_Base(), ::property::OPropertySet( rOther, m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} Wall::~Wall() diff --git a/chart2/source/model/makefile.mk b/chart2/source/model/makefile.mk index 4d70f1048d68..8fb1e9dc3bed 100644 --- a/chart2/source/model/makefile.mk +++ b/chart2/source/model/makefile.mk @@ -75,7 +75,6 @@ SHL1LIBS= $(LIB1TARGET) #Links import libraries. SHL1STDLIBS= $(CHARTTOOLS) \ - $(BASEGFXLIB) \ $(CPPULIB) \ $(CPPUHELPERLIB) \ $(COMPHELPERLIB) \ @@ -84,7 +83,6 @@ SHL1STDLIBS= $(CHARTTOOLS) \ $(SVLLIB) \ $(SVTOOLLIB) \ $(GOODIESLIB) \ - $(SOTLIB) \ $(SALLIB) \ $(UCBHELPERLIB) diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx new file mode 100644 index 000000000000..09e629462d48 --- /dev/null +++ b/chart2/source/model/template/BubbleChartType.cxx @@ -0,0 +1,245 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ,v $ + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_chart2.hxx" +#include "BubbleChartType.hxx" +#include "PropertyHelper.hxx" +#include "macros.hxx" +#include "servicenames_charttypes.hxx" +#include "ContainerHelper.hxx" +#include "CartesianCoordinateSystem.hxx" +#include "AxisHelper.hxx" +#include "AxisIndexDefines.hxx" +#include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/chart2/AxisType.hpp> +#include <com/sun/star/chart2/CurveStyle.hpp> + +using namespace ::com::sun::star; + +using ::rtl::OUString; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::osl::MutexGuard; + +namespace +{ + +void lcl_AddPropertiesToVector( + ::std::vector< Property > & /*rOutProperties*/ ) +{ +} + +void lcl_AddDefaultsToMap( + ::chart::tPropertyValueMap & /*rOutMap*/ ) +{ +} + +const Sequence< Property > & lcl_GetPropertySequence() +{ + static Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + lcl_AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties ); + } + + return aPropSeq; +} + +} // anonymous namespace + +namespace chart +{ + +BubbleChartType::BubbleChartType( + const uno::Reference< uno::XComponentContext > & xContext ) + : ChartType( xContext ) +{ +} + +BubbleChartType::BubbleChartType( const BubbleChartType & rOther ) : + ChartType( rOther ) +{ +} + +BubbleChartType::~BubbleChartType() +{} + +// ____ XCloneable ____ +uno::Reference< util::XCloneable > SAL_CALL BubbleChartType::createClone() + throw (uno::RuntimeException) +{ + return uno::Reference< util::XCloneable >( new BubbleChartType( *this )); +} + +// ____ XChartType ____ +Reference< chart2::XCoordinateSystem > SAL_CALL + BubbleChartType::createCoordinateSystem( ::sal_Int32 DimensionCount ) + throw (lang::IllegalArgumentException, + uno::RuntimeException) +{ + Reference< chart2::XCoordinateSystem > xResult( + new CartesianCoordinateSystem( + GetComponentContext(), DimensionCount, /* bSwapXAndYAxis */ sal_False )); + + for( sal_Int32 i=0; i<DimensionCount; ++i ) + { + Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) ); + if( !xAxis.is() ) + { + OSL_ENSURE(false,"a created coordinate system should have an axis for each dimension"); + continue; + } + + chart2::ScaleData aScaleData = xAxis->getScaleData(); + aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL; + aScaleData.Scaling = AxisHelper::createLinearScaling(); + + if( i == 2 ) + aScaleData.AxisType = chart2::AxisType::SERIES; + else + aScaleData.AxisType = chart2::AxisType::REALNUMBER; + + xAxis->setScaleData( aScaleData ); + } + + return xResult; +} + +::rtl::OUString SAL_CALL BubbleChartType::getChartType() + throw (uno::RuntimeException) +{ + return CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE; +} + +uno::Sequence< ::rtl::OUString > SAL_CALL BubbleChartType::getSupportedMandatoryRoles() + throw (uno::RuntimeException) +{ + static uno::Sequence< ::rtl::OUString > aMandRolesSeq; + + if( aMandRolesSeq.getLength() == 0 ) + { + aMandRolesSeq.realloc( 4 ); + aMandRolesSeq[0] = C2U( "label" ); + aMandRolesSeq[1] = C2U( "values-x" ); + aMandRolesSeq[2] = C2U( "values-y" ); + aMandRolesSeq[3] = C2U( "values-size" ); + } + + return aMandRolesSeq; +} + +OUString SAL_CALL BubbleChartType::getRoleOfSequenceForSeriesLabel() + throw (uno::RuntimeException) +{ + return C2U( "values-size" ); +} + +// ____ OPropertySet ____ +uno::Any BubbleChartType::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + lcl_AddDefaultsToMap( aStaticDefaults ); + } + + tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + return uno::Any(); + + return (*aFound).second; + // \-- +} + +// ____ OPropertySet ____ +::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartType::getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + BubbleChartType::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +uno::Sequence< ::rtl::OUString > BubbleChartType::getSupportedServiceNames_Static() +{ + uno::Sequence< ::rtl::OUString > aServices( 3 ); + aServices[ 0 ] = CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE; + aServices[ 1 ] = C2U( "com.sun.star.chart2.ChartType" ); + aServices[ 2 ] = C2U( "com.sun.star.beans.PropertySet" ); + return aServices; +} + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( BubbleChartType, + C2U( "com.sun.star.comp.chart.BubbleChartType" )); + +} // namespace chart diff --git a/chart2/source/model/template/BubbleChartType.hxx b/chart2/source/model/template/BubbleChartType.hxx new file mode 100644 index 000000000000..3694ac1c955c --- /dev/null +++ b/chart2/source/model/template/BubbleChartType.hxx @@ -0,0 +1,89 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ,v $ + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef CHART_BUBBLECHARTTYPE_HXX +#define CHART_BUBBLECHARTTYPE_HXX + +#include "ChartType.hxx" +#include "ServiceMacros.hxx" +#include <com/sun/star/chart2/CurveStyle.hpp> + +namespace chart +{ + +class BubbleChartType : public ChartType +{ +public: + BubbleChartType( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext ); + virtual ~BubbleChartType(); + + APPHELPER_XSERVICEINFO_DECL() + + /// establish methods for factory instatiation + APPHELPER_SERVICE_FACTORY_HELPER( BubbleChartType ) + +protected: + explicit BubbleChartType( const BubbleChartType & rOther ); + + // ____ XChartType ____ + virtual ::rtl::OUString SAL_CALL getChartType() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedMandatoryRoles() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > SAL_CALL + createCoordinateSystem( ::sal_Int32 DimensionCount ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getRoleOfSequenceForSeriesLabel() + throw (::com::sun::star::uno::RuntimeException); + + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + + // ____ XCloneable ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() + throw (::com::sun::star::uno::RuntimeException); +}; + +} // namespace chart + +// CHART_BUBBLECHARTTYPE_HXX +#endif diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx new file mode 100644 index 000000000000..0853cea6a5cb --- /dev/null +++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx @@ -0,0 +1,322 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ,v $ + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_chart2.hxx" +#include "BubbleChartTypeTemplate.hxx" +#include "macros.hxx" +#include "BubbleDataInterpreter.hxx" +#include "CartesianCoordinateSystem.hxx" +#include "Scaling.hxx" +#include "DiagramHelper.hxx" +#include "servicenames_charttypes.hxx" +#include "ContainerHelper.hxx" +#include "DataSeriesHelper.hxx" +#include <com/sun/star/chart2/SymbolStyle.hpp> +#include <com/sun/star/chart2/Symbol.hpp> +#include <com/sun/star/drawing/LineStyle.hpp> +#include "PropertyHelper.hxx" +#include <com/sun/star/beans/PropertyAttribute.hpp> + +#include <algorithm> + +using namespace ::com::sun::star; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::rtl::OUString; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::osl::MutexGuard; + +namespace +{ + +static const OUString lcl_aServiceName( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.BubbleChartTypeTemplate" )); + +void lcl_AddPropertiesToVector( + ::std::vector< Property > & /*rOutProperties*/ ) +{ +} + +void lcl_AddDefaultsToMap( + ::chart::tPropertyValueMap & /*rOutMap*/ ) +{ +} + +const Sequence< Property > & lcl_GetPropertySequence() +{ + static Sequence< Property > aPropSeq; + + // /-- + MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + lcl_AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties ); + } + + return aPropSeq; +} + +::cppu::IPropertyArrayHelper & lcl_getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( + lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + +} // anonymous namespace + +namespace chart +{ + +BubbleChartTypeTemplate::BubbleChartTypeTemplate( + Reference< + uno::XComponentContext > const & xContext, + const OUString & rServiceName ) : + ChartTypeTemplate( xContext, rServiceName ), + ::property::OPropertySet( m_aMutex ) +{ +} + +BubbleChartTypeTemplate::~BubbleChartTypeTemplate() +{} + +// ____ OPropertySet ____ +uno::Any BubbleChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + lcl_AddDefaultsToMap( aStaticDefaults ); + } + + tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + return uno::Any(); + + return (*aFound).second; + // \-- +} + +::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartTypeTemplate::getInfoHelper() +{ + return lcl_getInfoHelper(); +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + BubbleChartTypeTemplate::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +sal_Int32 BubbleChartTypeTemplate::getDimension() const +{ + return 2; +} + +StackMode BubbleChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */ ) const +{ + return StackMode_NONE; +} + +bool BubbleChartTypeTemplate::supportsCategories() const +{ + return false; +} + + +void SAL_CALL BubbleChartTypeTemplate::applyStyle( + const Reference< chart2::XDataSeries >& xSeries, + ::sal_Int32 nChartTypeIndex, + ::sal_Int32 nSeriesIndex, + ::sal_Int32 nSeriesCount ) + throw (uno::RuntimeException) +{ + ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount ); + + try + { + } + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } +} + +// ____ XChartTypeTemplate ____ +Sequence< OUString > SAL_CALL BubbleChartTypeTemplate::getAvailableCreationParameterNames() + throw (uno::RuntimeException) +{ + return Sequence< OUString >(); +} + +sal_Bool SAL_CALL BubbleChartTypeTemplate::matchesTemplate( + const Reference< chart2::XDiagram >& xDiagram, + sal_Bool bAdaptProperties ) + throw (uno::RuntimeException) +{ + sal_Bool bResult = ChartTypeTemplate::matchesTemplate( xDiagram, bAdaptProperties ); + + if( bResult ) + { + ::std::vector< Reference< chart2::XDataSeries > > aSeriesVec( + DiagramHelper::getDataSeriesFromDiagram( xDiagram )); + + for( ::std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt = + aSeriesVec.begin(); aIt != aSeriesVec.end(); ++aIt ) + { + try + { + } + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } + } + } + + // adapt curve style, spline order and resolution + if( bResult && bAdaptProperties ) + { + try + { + } + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } + } + + return bResult; +} + +Reference< chart2::XChartType > BubbleChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ ) +{ + Reference< chart2::XChartType > xResult; + + try + { + Reference< lang::XMultiServiceFactory > xFact( + GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW ); + xResult.set( xFact->createInstance( + CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ), uno::UNO_QUERY_THROW ); + } + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } + + return xResult; +} + +Reference< chart2::XChartType > SAL_CALL BubbleChartTypeTemplate::getChartTypeForNewSeries( + const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes ) + throw (uno::RuntimeException) +{ + Reference< chart2::XChartType > xResult; + + try + { + Reference< lang::XMultiServiceFactory > xFact( + GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW ); + xResult.set( xFact->createInstance( + CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ), uno::UNO_QUERY_THROW ); + + ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult ); + } + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } + + return xResult; +} + +Reference< chart2::XDataInterpreter > SAL_CALL BubbleChartTypeTemplate::getDataInterpreter() + throw (uno::RuntimeException) +{ + if( ! m_xDataInterpreter.is()) + m_xDataInterpreter.set( new BubbleDataInterpreter( GetComponentContext()) ); + + return m_xDataInterpreter; +} + +// ---------------------------------------- + +Sequence< OUString > BubbleChartTypeTemplate::getSupportedServiceNames_Static() +{ + Sequence< OUString > aServices( 2 ); + aServices[ 0 ] = lcl_aServiceName; + aServices[ 1 ] = C2U( "com.sun.star.chart2.ChartTypeTemplate" ); + return aServices; +} + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( BubbleChartTypeTemplate, lcl_aServiceName ); + +IMPLEMENT_FORWARD_XINTERFACE2( BubbleChartTypeTemplate, ChartTypeTemplate, OPropertySet ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( BubbleChartTypeTemplate, ChartTypeTemplate, OPropertySet ) + +} // namespace chart diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.hxx b/chart2/source/model/template/BubbleChartTypeTemplate.hxx new file mode 100644 index 000000000000..c094e38e28ac --- /dev/null +++ b/chart2/source/model/template/BubbleChartTypeTemplate.hxx @@ -0,0 +1,106 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ,v $ + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef CHART_BUBBLECHARTTYPETEMPLATE_HXX +#define CHART_BUBBLECHARTTYPETEMPLATE_HXX + +#include "ChartTypeTemplate.hxx" +#include "OPropertySet.hxx" +#include "MutexContainer.hxx" +#include <comphelper/uno3.hxx> + +namespace chart +{ + +class BubbleChartTypeTemplate : + public MutexContainer, + public ChartTypeTemplate, + public ::property::OPropertySet +{ +public: + explicit BubbleChartTypeTemplate( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext, + const ::rtl::OUString & rServiceName ); + virtual ~BubbleChartTypeTemplate(); + + /// XServiceInfo declarations + APPHELPER_XSERVICEINFO_DECL() + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +protected: + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + + // ____ XChartTypeTemplate ____ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableCreationParameterNames() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL matchesTemplate( + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XDiagram >& xDiagram, + sal_Bool bAdaptProperties ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > SAL_CALL + getChartTypeForNewSeries( const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XChartType > >& aFormerlyUsedChartTypes ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataInterpreter > SAL_CALL getDataInterpreter() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL applyStyle( + const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries, + ::sal_Int32 nChartTypeGroupIndex, + ::sal_Int32 nSeriesIndex, + ::sal_Int32 nSeriesCount ) + throw (::com::sun::star::uno::RuntimeException); + + // ____ ChartTypeTemplate ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > + getChartTypeForIndex( sal_Int32 nChartTypeIndex ); + virtual sal_Int32 getDimension() const; + virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const; + + virtual bool supportsCategories() const; +}; + +} // namespace chart + +// CHART_BUBBLECHARTTYPETEMPLATE_HXX +#endif diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx new file mode 100644 index 000000000000..a5ebb6b1ec2f --- /dev/null +++ b/chart2/source/model/template/BubbleDataInterpreter.cxx @@ -0,0 +1,317 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ,v $ + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_chart2.hxx" + +#include "BubbleDataInterpreter.hxx" +#include "DataSeries.hxx" +#include "macros.hxx" +#include "DataSeriesHelper.hxx" +#include "CommonConverters.hxx" +#include "ContainerHelper.hxx" +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/chart2/data/XDataSink.hpp> +#include <com/sun/star/util/XCloneable.hpp> + +using namespace ::com::sun::star; +using namespace ::com::sun::star::chart2; +using namespace ::std; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::rtl::OUString; + +namespace chart +{ + +BubbleDataInterpreter::BubbleDataInterpreter( + const uno::Reference< uno::XComponentContext > & xContext ) : + DataInterpreter( xContext ) +{ +} + +BubbleDataInterpreter::~BubbleDataInterpreter() +{ +} + +// ____ XDataInterpreter ____ +chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource( + const Reference< chart2::data::XDataSource >& xSource, + const Sequence< beans::PropertyValue >& aArguments, + const Sequence< Reference< XDataSeries > >& aSeriesToReUse ) + throw (uno::RuntimeException) +{ + if( ! xSource.is()) + return InterpretedData(); + + Sequence< Reference< data::XLabeledDataSequence > > aData( xSource->getDataSequences() ); + + Reference< data::XLabeledDataSequence > xValuesX; + vector< Reference< data::XLabeledDataSequence > > aYValuesVector; + vector< Reference< data::XLabeledDataSequence > > aSizeValuesVector; + + Reference< data::XLabeledDataSequence > xCategories; + bool bHasCategories = HasCategories( aArguments, aData ); + + Sequence< Reference< data::XLabeledDataSequence > > aUnusedData; + + bool bHasXValues = false; + sal_Int32 nDataSeqCount = aData.getLength(); + + bHasXValues = bHasCategories ? ( (nDataSeqCount-1) > 2 && (nDataSeqCount-1) % 2 != 0 ) + :( nDataSeqCount > 2 && nDataSeqCount % 2 != 0 ); + + bool bCategoriesUsed = false; + bool bNextIsYValues = bHasCategories ? nDataSeqCount>2 : nDataSeqCount>1; + for( sal_Int32 nDataIdx = 0; nDataIdx < aData.getLength(); ++nDataIdx ) + { + try + { + if( bHasCategories && !bCategoriesUsed ) + { + xCategories.set( aData[nDataIdx] ); + if( xCategories.is()) + SetRole( xCategories->getValues(), C2U("categories")); + bCategoriesUsed = true; + } + else if( !xValuesX.is() && bHasXValues ) + { + xValuesX.set( aData[nDataIdx] ); + if( xValuesX.is()) + SetRole( xValuesX->getValues(), C2U("values-x")); + } + else if( bNextIsYValues ) + { + aYValuesVector.push_back( aData[nDataIdx] ); + if( aData[nDataIdx].is()) + SetRole( aData[nDataIdx]->getValues(), C2U("values-y")); + bNextIsYValues = false; + } + else if( !bNextIsYValues ) + { + aSizeValuesVector.push_back( aData[nDataIdx] ); + if( aData[nDataIdx].is()) + SetRole( aData[nDataIdx]->getValues(), C2U("values-size")); + bNextIsYValues = true; + } + } + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } + } + + // create DataSeries + sal_Int32 nSeriesIndex = 0; + vector< Reference< XDataSeries > > aSeriesVec; + aSeriesVec.reserve( aSizeValuesVector.size()); + + Reference< data::XLabeledDataSequence > xClonedXValues = xValuesX; + Reference< util::XCloneable > xCloneableX( xValuesX, uno::UNO_QUERY ); + + for( size_t nCount = 0; nCount < aSizeValuesVector.size(); ++nCount, ++nSeriesIndex ) + { + sal_Int32 nDataSequenceCount = 2; + if( xValuesX.is() ) + nDataSequenceCount = 3; + else if( aYValuesVector.empty() ) + nDataSequenceCount = 1; + + Sequence< Reference< data::XLabeledDataSequence > > aNewData( nDataSequenceCount ); + sal_Int32 nDataIndex = 0; + if( xValuesX.is() ) + { + if( nCount > 0 && xCloneableX.is() ) + xClonedXValues.set( xCloneableX->createClone(), uno::UNO_QUERY ); + aNewData[nDataIndex++] = xClonedXValues; + } + if( aYValuesVector.size() > nCount ) + aNewData[nDataIndex++] = aYValuesVector[nCount]; + if( aSizeValuesVector.size() > nCount ) + aNewData[nDataIndex++] = aSizeValuesVector[nCount]; + + Reference< XDataSeries > xSeries; + if( nSeriesIndex < aSeriesToReUse.getLength()) + xSeries.set( aSeriesToReUse[nSeriesIndex] ); + else + xSeries.set( new DataSeries( GetComponentContext() ) ); + OSL_ASSERT( xSeries.is() ); + Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY ); + OSL_ASSERT( xSink.is() ); + xSink->setData( aNewData ); + + aSeriesVec.push_back( xSeries ); + } + + Sequence< Sequence< Reference< XDataSeries > > > aSeries(1); + aSeries[0] = ContainerHelper::ContainerToSequence( aSeriesVec ); + return InterpretedData( aSeries, xCategories, aUnusedData ); +} + +chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries( + const chart2::InterpretedData& aInterpretedData ) + throw (uno::RuntimeException) +{ + InterpretedData aResult( aInterpretedData ); + vector< Reference< data::XLabeledDataSequence > > aUnused( + ContainerHelper::SequenceToVector( aInterpretedData.UnusedData )); + + sal_Int32 i=0; + Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series )); + const sal_Int32 nCount = aSeries.getLength(); + for( ; i<nCount; ++i ) + { + try + { + Reference< data::XDataSource > xSeriesSource( aSeries[i], uno::UNO_QUERY_THROW ); + Sequence< Reference< data::XLabeledDataSequence > > aNewSequences; + + Reference< data::XLabeledDataSequence > xValuesSize( + DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-size"), false )); + Reference< data::XLabeledDataSequence > xValuesY( + DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-y"), false )); + Reference< data::XLabeledDataSequence > xValuesX( + DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-x"), false )); + + if( ! xValuesX.is() || + ! xValuesY.is() || + ! xValuesSize.is() ) + { + vector< Reference< data::XLabeledDataSequence > > aValueSeqVec( + DataSeriesHelper::getAllDataSequencesByRole( + xSeriesSource->getDataSequences(), C2U("values"), true )); + if( xValuesX.is()) + aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesX )); + if( xValuesY.is()) + aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesY )); + if( xValuesSize.is()) + aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesSize )); + + size_t nIndex = 0; + + if( ! xValuesSize.is() && + aValueSeqVec.size() > nIndex ) + { + xValuesSize.set( aValueSeqVec[nIndex++] ); + if( xValuesSize.is()) + SetRole( xValuesSize->getValues(), C2U("values-size")); + } + + if( ! xValuesY.is() && + aValueSeqVec.size() > nIndex ) + { + xValuesY.set( aValueSeqVec[nIndex++] ); + if( xValuesY.is()) + SetRole( xValuesY->getValues(), C2U("values-y")); + } + + if( ! xValuesX.is() && + aValueSeqVec.size() > nIndex ) + { + xValuesX.set( aValueSeqVec[nIndex++] ); + if( xValuesX.is()) + SetRole( xValuesY->getValues(), C2U("values-x")); + } + } + if( xValuesSize.is()) + { + if( xValuesY.is() ) + { + if( xValuesX.is() ) + { + aNewSequences.realloc(3); + aNewSequences[0] = xValuesX; + aNewSequences[1] = xValuesY; + aNewSequences[2] = xValuesSize; + } + else + { + aNewSequences.realloc(2); + aNewSequences[0] = xValuesY; + aNewSequences[1] = xValuesSize; + } + } + else + { + aNewSequences.realloc(1); + aNewSequences[0] = xValuesSize; + } + } + + Sequence< Reference< data::XLabeledDataSequence > > aSeqs( xSeriesSource->getDataSequences()); + if( aSeqs.getLength() != aNewSequences.getLength() ) + { + sal_Int32 j=0; + for( ; j<aSeqs.getLength(); ++j ) + { + if( aSeqs[j] != xValuesY && + aSeqs[j] != xValuesX && + aSeqs[j] != xValuesSize ) + aUnused.push_back( aSeqs[j] ); + } + Reference< data::XDataSink > xSink( xSeriesSource, uno::UNO_QUERY_THROW ); + xSink->setData( aNewSequences ); + aResult.UnusedData = ContainerHelper::ContainerToSequence( aUnused ); + } + } + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } + } + + return aResult; +} + +sal_Bool SAL_CALL BubbleDataInterpreter::isDataCompatible( + const chart2::InterpretedData& aInterpretedData ) + throw (uno::RuntimeException) +{ + Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series )); + for( sal_Int32 i=0; i<aSeries.getLength(); ++i ) + { + try + { + Reference< data::XDataSource > xSrc( aSeries[i], uno::UNO_QUERY_THROW ); + Sequence< Reference< data::XLabeledDataSequence > > aSeq( xSrc->getDataSequences()); + if( aSeq.getLength() != 3 ) + return sal_False; + } + catch( uno::Exception & ex ) + { + ASSERT_EXCEPTION( ex ); + } + } + + return sal_True; +} + +} // namespace chart diff --git a/chart2/source/model/template/BubbleDataInterpreter.hxx b/chart2/source/model/template/BubbleDataInterpreter.hxx new file mode 100644 index 000000000000..a173f801812c --- /dev/null +++ b/chart2/source/model/template/BubbleDataInterpreter.hxx @@ -0,0 +1,64 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ,v $ + * $Revision: $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef CHART_BUBBLEDATAINTERPRETER_HXX +#define CHART_BUBBLEDATAINTERPRETER_HXX + +#include "DataInterpreter.hxx" + +namespace chart +{ + +class BubbleDataInterpreter : public DataInterpreter +{ +public: + explicit BubbleDataInterpreter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > & xContext ); + virtual ~BubbleDataInterpreter(); + +protected: + // ____ XDataInterpreter ____ + virtual ::com::sun::star::chart2::InterpretedData SAL_CALL interpretDataSource( + const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xSource, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > >& aSeriesToReUse ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::chart2::InterpretedData SAL_CALL reinterpretDataSeries( + const ::com::sun::star::chart2::InterpretedData& aInterpretedData ) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isDataCompatible( + const ::com::sun::star::chart2::InterpretedData& aInterpretedData ) + throw (::com::sun::star::uno::RuntimeException); +}; + +} // namespace chart + +// CHART_BUBBLEDATAINTERPRETER_HXX +#endif diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx index 35b40f3c3d76..2834d9354f95 100644 --- a/chart2/source/model/template/ChartType.cxx +++ b/chart2/source/model/template/ChartType.cxx @@ -35,7 +35,7 @@ #include "CommonFunctors.hxx" #include "macros.hxx" #include "CartesianCoordinateSystem.hxx" -#include "Scaling.hxx" +#include "AxisHelper.hxx" #include "CloneHelper.hxx" #include "AxisIndexDefines.hxx" #include "ContainerHelper.hxx" @@ -57,7 +57,7 @@ namespace chart ChartType::ChartType( const Reference< uno::XComponentContext > & xContext ) : ::property::OPropertySet( m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()), + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), m_xContext( xContext ), m_bNotifyChanges( true ) {} @@ -66,7 +66,7 @@ ChartType::ChartType( const ChartType & rOther ) : MutexContainer(), impl::ChartType_Base(), ::property::OPropertySet( rOther, m_aMutex ), - m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder()), + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), m_xContext( rOther.m_xContext ), m_bNotifyChanges( true ) { @@ -106,7 +106,7 @@ Reference< chart2::XCoordinateSystem > SAL_CALL chart2::ScaleData aScaleData = xAxis->getScaleData(); aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL; - aScaleData.Scaling = new LinearScaling( 1.0, 0.0 ); + aScaleData.Scaling = AxisHelper::createLinearScaling(); switch( i ) { diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx index a8eb36d6e5c8..0e4a3a119a02 100644 --- a/chart2/source/model/template/ChartTypeManager.cxx +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -35,7 +35,6 @@ #include "StackMode.hxx" #include "ContainerHelper.hxx" -#include "Scaling.hxx" #include "CartesianCoordinateSystem.hxx" #include "LineChartTypeTemplate.hxx" @@ -46,6 +45,7 @@ #include "ScatterChartTypeTemplate.hxx" #include "StockChartTypeTemplate.hxx" #include "NetChartTypeTemplate.hxx" +#include "BubbleChartTypeTemplate.hxx" #include <cppuhelper/component_context.hxx> #include <comphelper/InlineContainer.hxx> #include <com/sun/star/container/XContentEnumerationAccess.hpp> @@ -132,6 +132,7 @@ enum TemplateId TEMPLATE_STOCKOPENLOWHIGHCLOSE, TEMPLATE_STOCKVOLUMELOWHIGHCLOSE, TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE, + TEMPLATE_BUBBLE, // TEMPLATE_SURFACE, // TEMPLATE_ADDIN, TEMPLATE_NOT_FOUND = 0xffff @@ -203,6 +204,7 @@ const tTemplateMapType & lcl_DefaultChartTypeMap() ( C2U( "com.sun.star.chart2.template.StockOpenLowHighClose" ), TEMPLATE_STOCKOPENLOWHIGHCLOSE ) ( C2U( "com.sun.star.chart2.template.StockVolumeLowHighClose" ), TEMPLATE_STOCKVOLUMELOWHIGHCLOSE ) ( C2U( "com.sun.star.chart2.template.StockVolumeOpenLowHighClose" ), TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE ) + ( C2U( "com.sun.star.chart2.template.Bubble" ), TEMPLATE_BUBBLE ) // ( C2U( "com.sun.star.chart2.template.Surface" ), TEMPLATE_SURFACE ) // ( C2U( "com.sun.star.chart2.template.Addin" ), TEMPLATE_ADDIN ) ); @@ -519,6 +521,11 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance( StockChartTypeTemplate::VOL_OPEN_LOW_HI_CLOSE, true )); break; + //BubbleChart + case TEMPLATE_BUBBLE: + xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier )); + break; + // case TEMPLATE_SURFACE: // case TEMPLATE_ADDIN: // break; diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index d328f3fb6921..1996cc12830e 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -39,7 +39,6 @@ #include "ContainerHelper.hxx" #include "ChartTypeHelper.hxx" -#include "Scaling.hxx" #include "CartesianCoordinateSystem.hxx" #include "AxisHelper.hxx" #include "LegendHelper.hxx" @@ -69,27 +68,6 @@ using ::com::sun::star::uno::Any; namespace { -sal_Int32 lcl_getSeriesLength( const Reference< XDataSeries > & xSeries ) -{ - sal_Int32 nResult = 0; - try - { - Reference< data::XDataSource > xDataSource( xSeries, uno::UNO_QUERY_THROW ); - Sequence< Reference< data::XLabeledDataSequence > > aLabSeq( xDataSource->getDataSequences()); - if( aLabSeq.getLength()) - { - Reference< data::XDataSequence > xSeq( aLabSeq[0]->getValues()); - if( xSeq.is()) - nResult = xSeq->getData().getLength(); - } - } - catch( const uno::Exception & ex ) - { - ASSERT_EXCEPTION( ex ); - } - return nResult; -} - void lcl_applyDefaultStyle( const Reference< XDataSeries > & xSeries, sal_Int32 nIndex, @@ -348,12 +326,9 @@ void SAL_CALL ChartTypeTemplate::changeDiagramData( Sequence< Sequence< Reference< XDataSeries > > > aSeriesSeq( aData.Series ); sal_Int32 i, j, nIndex = 0; - sal_Int32 nFirstSeriesLength = 0; for( i=0; i<aSeriesSeq.getLength(); ++i ) for( j=0; j<aSeriesSeq[i].getLength(); ++j, ++nIndex ) { - if( i==0 && j==0 ) - nFirstSeriesLength = lcl_getSeriesLength( aSeriesSeq[0][0] ); if( nIndex >= nFormerSeriesCount ) { lcl_applyDefaultStyle( aSeriesSeq[i][j], nIndex, xDiagram ); diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx index 6bfec80d2fa5..8073b7af04ef 100644 --- a/chart2/source/model/template/DataInterpreter.cxx +++ b/chart2/source/model/template/DataInterpreter.cxx @@ -33,7 +33,7 @@ #include "DataInterpreter.hxx" #include "DataSeries.hxx" -#include "DataSource.hxx" +#include "DataSourceHelper.hxx" #include "DataSeriesHelper.hxx" #include "macros.hxx" #include "CommonConverters.hxx" @@ -355,7 +355,7 @@ Reference< data::XDataSource > SAL_CALL DataInterpreter::mergeInterpretedData( // add unused data at end copy( aUnusedDataVec.begin(), aUnusedDataVec.end(), back_inserter( aResultVec )); - return Reference< data::XDataSource >( new DataSource( ContainerToSequence( aResultVec ))); + return Reference< data::XDataSource >( DataSourceHelper::createDataSource( ContainerToSequence( aResultVec ) ) ); } // convenience methods diff --git a/chart2/source/model/template/NetChartType.cxx b/chart2/source/model/template/NetChartType.cxx index d36bb4331a46..9de315679223 100644 --- a/chart2/source/model/template/NetChartType.cxx +++ b/chart2/source/model/template/NetChartType.cxx @@ -34,10 +34,11 @@ #include "PropertyHelper.hxx" #include "macros.hxx" #include "PolarCoordinateSystem.hxx" -#include "Scaling.hxx" #include "servicenames_charttypes.hxx" #include "ContainerHelper.hxx" #include "AxisIndexDefines.hxx" +#include "AxisHelper.hxx" + #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/chart2/AxisType.hpp> @@ -137,7 +138,7 @@ Reference< XCoordinateSystem > SAL_CALL if( xAxis.is() ) { ScaleData aScaleData = xAxis->getScaleData(); - aScaleData.Scaling = new LinearScaling( 1.0, 0.0 ); + aScaleData.Scaling = AxisHelper::createLinearScaling(); aScaleData.AxisType = AxisType::CATEGORY; aScaleData.Orientation = AxisOrientation_MATHEMATICAL; xAxis->setScaleData( aScaleData ); diff --git a/chart2/source/model/template/NetChartTypeTemplate.cxx b/chart2/source/model/template/NetChartTypeTemplate.cxx index ab90f0f7ff42..e348b32b7bc6 100644 --- a/chart2/source/model/template/NetChartTypeTemplate.cxx +++ b/chart2/source/model/template/NetChartTypeTemplate.cxx @@ -33,7 +33,6 @@ #include "NetChartTypeTemplate.hxx" #include "macros.hxx" #include "PolarCoordinateSystem.hxx" -#include "Scaling.hxx" #include "DiagramHelper.hxx" #include "servicenames_charttypes.hxx" #include "DataSeriesHelper.hxx" diff --git a/chart2/source/model/template/PieChartType.cxx b/chart2/source/model/template/PieChartType.cxx index 4cccd4bedcde..a4c98413fe7d 100644 --- a/chart2/source/model/template/PieChartType.cxx +++ b/chart2/source/model/template/PieChartType.cxx @@ -34,7 +34,7 @@ #include "PropertyHelper.hxx" #include "macros.hxx" #include "PolarCoordinateSystem.hxx" -#include "Scaling.hxx" +#include "AxisHelper.hxx" #include "servicenames_charttypes.hxx" #include "ContainerHelper.hxx" #include "AxisIndexDefines.hxx" @@ -156,7 +156,7 @@ Reference< chart2::XCoordinateSystem > SAL_CALL //hhhh todo make axis invisible chart2::ScaleData aScaleData = xAxis->getScaleData(); - aScaleData.Scaling = new LinearScaling( 1.0, 0.0 ); + aScaleData.Scaling = AxisHelper::createLinearScaling(); aScaleData.AxisType = chart2::AxisType::REALNUMBER; if( i == 0 ) diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx index 774eafed625f..1ece7c5edb93 100644 --- a/chart2/source/model/template/PieChartTypeTemplate.cxx +++ b/chart2/source/model/template/PieChartTypeTemplate.cxx @@ -31,7 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_chart2.hxx" #include "PieChartTypeTemplate.hxx" -#include "Scaling.hxx" #include "macros.hxx" #include "CommonConverters.hxx" #include "DiagramHelper.hxx" diff --git a/chart2/source/model/template/ScatterChartType.cxx b/chart2/source/model/template/ScatterChartType.cxx index 38249e3e72fe..50b1b4f0ac70 100644 --- a/chart2/source/model/template/ScatterChartType.cxx +++ b/chart2/source/model/template/ScatterChartType.cxx @@ -36,7 +36,7 @@ #include "servicenames_charttypes.hxx" #include "ContainerHelper.hxx" #include "CartesianCoordinateSystem.hxx" -#include "Scaling.hxx" +#include "AxisHelper.hxx" #include "AxisIndexDefines.hxx" #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/chart2/AxisType.hpp> @@ -179,7 +179,7 @@ Reference< chart2::XCoordinateSystem > SAL_CALL chart2::ScaleData aScaleData = xAxis->getScaleData(); aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL; - aScaleData.Scaling = new LinearScaling( 1.0, 0.0 ); + aScaleData.Scaling = AxisHelper::createLinearScaling(); if( i == 2 ) aScaleData.AxisType = chart2::AxisType::SERIES; diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.cxx b/chart2/source/model/template/ScatterChartTypeTemplate.cxx index 6e5449d49f49..a87a82c05827 100644 --- a/chart2/source/model/template/ScatterChartTypeTemplate.cxx +++ b/chart2/source/model/template/ScatterChartTypeTemplate.cxx @@ -34,7 +34,6 @@ #include "macros.hxx" #include "XYDataInterpreter.hxx" #include "CartesianCoordinateSystem.hxx" -#include "Scaling.hxx" #include "DiagramHelper.hxx" #include "servicenames_charttypes.hxx" #include "ContainerHelper.hxx" diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx index ae48f1cc932e..719decae49a7 100644 --- a/chart2/source/model/template/StockChartTypeTemplate.cxx +++ b/chart2/source/model/template/StockChartTypeTemplate.cxx @@ -35,7 +35,6 @@ #include "DataSeriesHelper.hxx" #include "StockDataInterpreter.hxx" #include "CartesianCoordinateSystem.hxx" -#include "Scaling.hxx" #include "AxisHelper.hxx" #include "DiagramHelper.hxx" #include "servicenames_charttypes.hxx" diff --git a/chart2/source/model/template/_serviceregistration_charttypes.cxx b/chart2/source/model/template/_serviceregistration_charttypes.cxx index b059eb24957a..6e5960410445 100644 --- a/chart2/source/model/template/_serviceregistration_charttypes.cxx +++ b/chart2/source/model/template/_serviceregistration_charttypes.cxx @@ -41,6 +41,7 @@ #include "NetChartType.hxx" #include "PieChartType.hxx" #include "ScatterChartType.hxx" +#include "BubbleChartType.hxx" namespace { @@ -110,6 +111,14 @@ static struct ::cppu::ImplementationEntry g_entries_chart2_charttypes[] = , 0 , 0 } + ,{ + ::chart::BubbleChartType::create + , ::chart::BubbleChartType::getImplementationName_Static + , ::chart::BubbleChartType::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } ,{ 0, 0, 0, 0, 0, 0 } }; diff --git a/chart2/source/model/template/makefile.mk b/chart2/source/model/template/makefile.mk index 0913c42a89e2..ad8fcd552c8d 100644 --- a/chart2/source/model/template/makefile.mk +++ b/chart2/source/model/template/makefile.mk @@ -71,6 +71,9 @@ SLOFILES= \ $(SLO)$/PieChartTypeTemplate.obj \ $(SLO)$/ScatterChartType.obj \ $(SLO)$/ScatterChartTypeTemplate.obj \ + $(SLO)$/BubbleChartType.obj \ + $(SLO)$/BubbleChartTypeTemplate.obj \ + $(SLO)$/BubbleDataInterpreter.obj \ $(SLO)$/StockChartTypeTemplate.obj \ $(SLO)$/StockDataInterpreter.obj \ $(SLO)$/XYDataInterpreter.obj \ |