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