diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-17 13:16:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-17 13:10:42 +0000 |
commit | bb674aa5503ff40a5619d1fb4c9f310da5f5c983 (patch) | |
tree | e9b6d62f258cded0a5f207609a61157c8d0ef4c2 /chart2/source | |
parent | b79cf88a048e5d8c784c97d99155104aef3d5dca (diff) |
loplugin:unusedfields
Change-Id: Id2dbbf384637223db3d334d95332251832918003
Reviewed-on: https://gerrit.libreoffice.org/30927
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
21 files changed, 91 insertions, 159 deletions
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx index f240aa8d1ea8..957a346bbe52 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx @@ -187,8 +187,7 @@ protected: xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties; if( !xErrorBarProperties.is() ) { - // todo: use a valid context - xErrorBarProperties = ::chart::createErrorBar( uno::Reference< uno::XComponentContext >() ); + xErrorBarProperties = new ::chart::ErrorBar; //default in new and old api are different xErrorBarProperties->setPropertyValue( "ShowPositiveError" , uno::makeAny(false) ); xErrorBarProperties->setPropertyValue( "ShowNegativeError" , uno::makeAny(false) ); @@ -345,7 +344,7 @@ void WrappedMeanValueProperty::setValueToSeries( const Reference< beans::XProper if( xRegCnt.is() ) { if(aNewValue) - RegressionCurveHelper::addMeanValueLine( xRegCnt, nullptr, nullptr ); + RegressionCurveHelper::addMeanValueLine( xRegCnt, nullptr ); else RegressionCurveHelper::removeMeanValueLine( xRegCnt ); } diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx index 921f0331d51e..433b736fba40 100644 --- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx @@ -70,9 +70,7 @@ uno::Reference< beans::XPropertySet > lcl_GetErrorBar( uno::Reference< beans::XPropertySet > lcl_GetDefaultErrorBar() { - // todo: use a valid context - return uno::Reference< beans::XPropertySet >( - ::chart::createErrorBar( uno::Reference< uno::XComponentContext >())); + return uno::Reference< beans::XPropertySet >( new ::chart::ErrorBar ); } void lcl_getErrorValues( const uno::Reference< beans::XPropertySet > & xErrorBarProp, @@ -273,8 +271,7 @@ bool StatisticsItemConverter::ApplySpecialItem( if( ! bNewHasMeanValueLine ) RegressionCurveHelper::removeMeanValueLine( xRegCnt ); else - RegressionCurveHelper::addMeanValueLine( - xRegCnt, uno::Reference< uno::XComponentContext >(), GetPropertySet() ); + RegressionCurveHelper::addMeanValueLine( xRegCnt, GetPropertySet() ); bChanged = true; } } diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 78a97facd9ab..7d3a5a6c675d 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -68,15 +68,14 @@ using ::com::sun::star::uno::Sequence; namespace { -void lcl_InsertMeanValueLine( const uno::Reference< uno::XComponentContext > & xContext, - const uno::Reference< chart2::XDataSeries > & xSeries ) +void lcl_InsertMeanValueLine( const uno::Reference< chart2::XDataSeries > & xSeries ) { uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt( xSeries, uno::UNO_QUERY ); if( xRegCurveCnt.is()) { ::chart::RegressionCurveHelper::addMeanValueLine( - xRegCurveCnt, xContext, uno::Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY )); + xRegCurveCnt, uno::Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY )); } } @@ -308,8 +307,7 @@ void ChartController::executeDispatch_InsertMeanValue() ActionDescriptionProvider::createDescription( ActionDescriptionProvider::ActionType::Insert, SCH_RESSTR( STR_OBJECT_AVERAGE_LINE )), m_xUndoManager ); - lcl_InsertMeanValueLine( m_xCC, - ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), + lcl_InsertMeanValueLine( ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ) ); aUndoGuard.commit(); } @@ -326,7 +324,7 @@ void ChartController::executeDispatch_InsertMenu_MeanValues() if( xSeries.is() ) { //if a series is selected insert mean value only for that series: - lcl_InsertMeanValueLine( m_xCC, xSeries ); + lcl_InsertMeanValueLine( xSeries ); } else { @@ -334,7 +332,7 @@ void ChartController::executeDispatch_InsertMenu_MeanValues() DiagramHelper::getDataSeriesFromDiagram( ChartModelHelper::findDiagram( getModel() ))); for( const auto& xSrs : aSeries ) - lcl_InsertMeanValueLine( m_xCC, xSrs ); + lcl_InsertMeanValueLine( xSrs ); } aUndoGuard.commit(); } @@ -429,7 +427,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) // add error bars with standard deviation uno::Reference< beans::XPropertySet > xErrorBarProp( - StatisticsHelper::addErrorBars( xSeries, m_xCC, + StatisticsHelper::addErrorBars( xSeries, css::chart::ErrorBarStyle::STANDARD_DEVIATION, bYError)); diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx index 5ef6a5a48815..f8832e0ba061 100644 --- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx @@ -199,7 +199,7 @@ void setErrorBarVisible(const css::uno::Reference<css::frame::XModel>& if (bVisible) { - StatisticsHelper::addErrorBars( xSeries, comphelper::getProcessComponentContext(), + StatisticsHelper::addErrorBars( xSeries, css::chart::ErrorBarStyle::STANDARD_DEVIATION, bYError); } diff --git a/chart2/source/inc/ErrorBar.hxx b/chart2/source/inc/ErrorBar.hxx index 107d2ab1f4d7..565e93d94af2 100644 --- a/chart2/source/inc/ErrorBar.hxx +++ b/chart2/source/inc/ErrorBar.hxx @@ -45,9 +45,6 @@ namespace chart { -OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::beans::XPropertySet > createErrorBar( - const css::uno::Reference< css::uno::XComponentContext > & xContext ); - namespace impl { typedef ::cppu::WeakImplHelper< @@ -82,7 +79,7 @@ private: sal_Int32 meStyle; public: - explicit ErrorBar( const css::uno::Reference< css::uno::XComponentContext > & xContext ); + OOO_DLLPUBLIC_CHARTTOOLS explicit ErrorBar(); virtual ~ErrorBar() override; /// XServiceInfo declarations @@ -154,9 +151,6 @@ protected: throw (css::uno::RuntimeException, std::exception) override; private: - css::uno::Reference< css::uno::XComponentContext > - m_xContext; - typedef ::std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tDataSequenceContainer; tDataSequenceContainer m_aDataSequences; diff --git a/chart2/source/inc/RegressionCurveHelper.hxx b/chart2/source/inc/RegressionCurveHelper.hxx index 4c89c234a24a..46ee61e4e0df 100644 --- a/chart2/source/inc/RegressionCurveHelper.hxx +++ b/chart2/source/inc/RegressionCurveHelper.hxx @@ -38,14 +38,11 @@ namespace chart namespace RegressionCurveHelper { /// returns a model mean-value line - css::uno::Reference<css::chart2::XRegressionCurve> - createMeanValueLine(const css::uno::Reference<css::uno::XComponentContext> & xContext ); + css::uno::Reference<css::chart2::XRegressionCurve> createMeanValueLine(); /// returns a model regression curve css::uno::Reference<css::chart2::XRegressionCurve> - createRegressionCurveByServiceName( - const css::uno::Reference<css::uno::XComponentContext> & xContext, - const OUString& aServiceName ); + createRegressionCurveByServiceName( const OUString& aServiceName ); OOO_DLLPUBLIC_CHARTTOOLS bool hasMeanValueLine( const css::uno::Reference<css::chart2::XRegressionCurveContainer> & xRegCnt ); @@ -64,7 +61,6 @@ namespace RegressionCurveHelper */ OOO_DLLPUBLIC_CHARTTOOLS void addMeanValueLine( css::uno::Reference<css::chart2::XRegressionCurveContainer>& xRegCnt, - const css::uno::Reference<css::uno::XComponentContext>& xContext, const css::uno::Reference<css::beans::XPropertySet>& xSeriesProp ); OOO_DLLPUBLIC_CHARTTOOLS void removeMeanValueLine( diff --git a/chart2/source/inc/StatisticsHelper.hxx b/chart2/source/inc/StatisticsHelper.hxx index 675f478f9b02..f6410936ca3d 100644 --- a/chart2/source/inc/StatisticsHelper.hxx +++ b/chart2/source/inc/StatisticsHelper.hxx @@ -73,7 +73,6 @@ namespace StatisticsHelper OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::beans::XPropertySet > addErrorBars( const css::uno::Reference< css::chart2::XDataSeries > & xDataSeries, - const css::uno::Reference< css::uno::XComponentContext > & xContext, sal_Int32 nStyle, bool bYError = true ); diff --git a/chart2/source/model/inc/DataSeries.hxx b/chart2/source/model/inc/DataSeries.hxx index 27b9513e6528..7cac9977dfb7 100644 --- a/chart2/source/model/inc/DataSeries.hxx +++ b/chart2/source/model/inc/DataSeries.hxx @@ -67,7 +67,7 @@ class DataSeries : public ::property::OPropertySet { public: - explicit DataSeries( const css::uno::Reference< css::uno::XComponentContext > & xContext ); + explicit DataSeries(); virtual ~DataSeries() override; /// XServiceInfo declarations @@ -176,7 +176,6 @@ protected: void fireModifyEvent(); private: - css::uno::Reference< css::uno::XComponentContext > m_xContext; typedef ::std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tDataSequenceContainer; tDataSequenceContainer m_aDataSequences; diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 1997c565101f..6d3b8174c174 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -103,7 +103,7 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext) , m_aVisualAreaSize( ChartModelHelper::getDefaultPageSize() ) , m_xDataProvider( nullptr ) , m_xInternalDataProvider( nullptr ) - , m_xPageBackground( new PageBackground( m_xContext ) ) + , m_xPageBackground( new PageBackground ) , m_xXMLNamespaceMap( createNameContainer( ::cppu::UnoType<OUString>::get(), "com.sun.star.xml.NamespaceMap", "com.sun.star.comp.chart.XMLNameSpaceMap" ), uno::UNO_QUERY) , mnStart(0) diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx index 3f60181ac8ec..7d88338a308a 100644 --- a/chart2/source/model/main/DataSeries.cxx +++ b/chart2/source/model/main/DataSeries.cxx @@ -123,9 +123,8 @@ void lcl_CloneAttributedDataPoints( namespace chart { -DataSeries::DataSeries( const uno::Reference< uno::XComponentContext > & xContext ) : +DataSeries::DataSeries() : ::property::OPropertySet( m_aMutex ), - m_xContext( xContext ), m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { } @@ -134,7 +133,6 @@ DataSeries::DataSeries( const DataSeries & rOther ) : MutexContainer(), impl::DataSeries_Base(), ::property::OPropertySet( rOther, m_aMutex ), - m_xContext( rOther.m_xContext ), m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { if( ! rOther.m_aDataSequences.empty()) @@ -581,10 +579,10 @@ css::uno::Sequence< OUString > SAL_CALL DataSeries::getSupportedServiceNames() } // namespace chart extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart_DataSeries_get_implementation(css::uno::XComponentContext *context, +com_sun_star_comp_chart_DataSeries_get_implementation(css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new ::chart::DataSeries(context)); + return cppu::acquire(new ::chart::DataSeries ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx index 117eafb212ee..0252c8c431ba 100644 --- a/chart2/source/model/main/PageBackground.cxx +++ b/chart2/source/model/main/PageBackground.cxx @@ -110,9 +110,8 @@ struct StaticPageBackgroundInfo : public rtl::StaticAggregate< uno::Reference< b namespace chart { -PageBackground::PageBackground( const uno::Reference< uno::XComponentContext > & xContext ) : - ::property::OPropertySet( m_aMutex ), - m_xContext( xContext ), +PageBackground::PageBackground() : + ::property::OPropertySet( m_aMutex ), m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} @@ -120,7 +119,6 @@ PageBackground::PageBackground( const PageBackground & rOther ) : MutexContainer(), impl::PageBackground_Base(), ::property::OPropertySet( rOther, m_aMutex ), - m_xContext( rOther.m_xContext ), m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} @@ -233,10 +231,10 @@ IMPLEMENT_FORWARD_XINTERFACE2( PageBackground, PageBackground_Base, ::property:: } // namespace chart extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart2_PageBackground_get_implementation(css::uno::XComponentContext *context, +com_sun_star_comp_chart2_PageBackground_get_implementation(css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new ::chart::PageBackground(context)); + return cppu::acquire(new ::chart::PageBackground ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/PageBackground.hxx b/chart2/source/model/main/PageBackground.hxx index 99abf8150929..280ff9b9cde6 100644 --- a/chart2/source/model/main/PageBackground.hxx +++ b/chart2/source/model/main/PageBackground.hxx @@ -48,7 +48,7 @@ class PageBackground : public ::property::OPropertySet { public: - explicit PageBackground( const css::uno::Reference< css::uno::XComponentContext > & xContext ); + explicit PageBackground(); virtual ~PageBackground() override; /// XServiceInfo declarations @@ -104,8 +104,6 @@ protected: using OPropertySet::disposing; private: - css::uno::Reference< css::uno::XComponentContext > m_xContext; - css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder; }; diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx index b2abf8ed2a8b..ac29630151a8 100644 --- a/chart2/source/model/template/BubbleDataInterpreter.cxx +++ b/chart2/source/model/template/BubbleDataInterpreter.cxx @@ -144,7 +144,7 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource( if( nSeriesIndex < aSeriesToReUse.getLength()) xSeries.set( aSeriesToReUse[nSeriesIndex] ); else - xSeries.set( new DataSeries( GetComponentContext() ) ); + xSeries.set( new DataSeries ); OSL_ASSERT( xSeries.is() ); Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY ); OSL_ASSERT( xSink.is() ); diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx index 9d106dabc2ca..6ed15479e8a5 100644 --- a/chart2/source/model/template/DataInterpreter.cxx +++ b/chart2/source/model/template/DataInterpreter.cxx @@ -120,7 +120,7 @@ InterpretedData SAL_CALL DataInterpreter::interpretDataSource( if( nSeriesIndex < aSeriesToReUse.getLength()) xSeries.set( aSeriesToReUse[nSeriesIndex] ); else - xSeries.set( new DataSeries( GetComponentContext() )); + xSeries.set( new DataSeries ); OSL_ASSERT( xSeries.is() ); Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY ); OSL_ASSERT( xSink.is() ); diff --git a/chart2/source/model/template/StockDataInterpreter.cxx b/chart2/source/model/template/StockDataInterpreter.cxx index d92ee2857632..cbd77c7652b4 100644 --- a/chart2/source/model/template/StockDataInterpreter.cxx +++ b/chart2/source/model/template/StockDataInterpreter.cxx @@ -239,7 +239,7 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource( if( nReUsedSeriesIdx < rSeriesToReUse.getLength()) xSeries.set( rSeriesToReUse[nReUsedSeriesIdx] ); else - xSeries.set( new DataSeries( GetComponentContext() ) ); + xSeries.set( new DataSeries ); OSL_ASSERT( xSeries.is() ); Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY_THROW ); OSL_ASSERT( xSink.is() ); diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx index c64f54b99ba4..c008a1e67a64 100644 --- a/chart2/source/model/template/XYDataInterpreter.cxx +++ b/chart2/source/model/template/XYDataInterpreter.cxx @@ -128,7 +128,7 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::interpretDataSource( if( nSeriesIndex < aSeriesToReUse.getLength()) xSeries.set( aSeriesToReUse[nSeriesIndex] ); else - xSeries.set( new DataSeries( GetComponentContext() ) ); + xSeries.set( new DataSeries ); OSL_ASSERT( xSeries.is() ); Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY ); OSL_ASSERT( xSink.is() ); diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index ee4c228fe3e5..aa4573df29df 100644 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -81,12 +81,7 @@ const SfxItemPropertySet* GetErrorBarPropertySet() namespace chart { -uno::Reference< beans::XPropertySet > createErrorBar( const uno::Reference< uno::XComponentContext > & xContext ) -{ - return new ErrorBar( xContext ); -} - -ErrorBar::ErrorBar( uno::Reference< uno::XComponentContext > const & xContext ) : +ErrorBar::ErrorBar() : mnLineWidth(0), meLineStyle(drawing::LineStyle_SOLID), maLineColor(0), @@ -98,7 +93,6 @@ ErrorBar::ErrorBar( uno::Reference< uno::XComponentContext > const & xContext ) mfNegativeError(0), mfWeight(1), meStyle(css::chart::ErrorBarStyle::NONE), - m_xContext( xContext ), m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) {} @@ -118,7 +112,6 @@ ErrorBar::ErrorBar( const ErrorBar & rOther ) : mfNegativeError(rOther.mfNegativeError), mfWeight(rOther.mfWeight), meStyle(rOther.meStyle), - m_xContext( rOther.m_xContext ), m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { if( ! rOther.m_aDataSequences.empty()) @@ -502,10 +495,10 @@ using impl::ErrorBar_Base; } // namespace chart extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart2_ErrorBar_get_implementation(css::uno::XComponentContext *context, +com_sun_star_comp_chart2_ErrorBar_get_implementation(css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new ::chart::ErrorBar(context)); + return cppu::acquire(new ::chart::ErrorBar); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx index 084cc2fffaa0..abd80a3c8c7d 100644 --- a/chart2/source/tools/RegressionCurveHelper.cxx +++ b/chart2/source/tools/RegressionCurveHelper.cxx @@ -84,15 +84,12 @@ OUString lcl_getServiceNameForType(SvxChartRegress eType) namespace chart { -Reference< XRegressionCurve > RegressionCurveHelper::createMeanValueLine( - const Reference< XComponentContext > & xContext ) +Reference< XRegressionCurve > RegressionCurveHelper::createMeanValueLine() { - return Reference< XRegressionCurve >( - new MeanValueRegressionCurve( xContext )); + return Reference< XRegressionCurve >( new MeanValueRegressionCurve ); } Reference< XRegressionCurve > RegressionCurveHelper::createRegressionCurveByServiceName( - const Reference< XComponentContext > & xContext, const OUString& aServiceName ) { Reference< XRegressionCurve > xResult; @@ -100,27 +97,27 @@ Reference< XRegressionCurve > RegressionCurveHelper::createRegressionCurveByServ // todo: use factory methods with service name if( aServiceName == "com.sun.star.chart2.LinearRegressionCurve" ) { - xResult.set( new LinearRegressionCurve( xContext ) ); + xResult.set( new LinearRegressionCurve ); } else if( aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve" ) { - xResult.set( new LogarithmicRegressionCurve( xContext ) ); + xResult.set( new LogarithmicRegressionCurve ); } else if( aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve" ) { - xResult.set( new ExponentialRegressionCurve( xContext ) ); + xResult.set( new ExponentialRegressionCurve ); } else if( aServiceName == "com.sun.star.chart2.PotentialRegressionCurve" ) { - xResult.set( new PotentialRegressionCurve( xContext ) ); + xResult.set( new PotentialRegressionCurve ); } else if( aServiceName == "com.sun.star.chart2.PolynomialRegressionCurve" ) { - xResult.set( new PolynomialRegressionCurve( xContext ) ); + xResult.set( new PolynomialRegressionCurve ); } else if( aServiceName == "com.sun.star.chart2.MovingAverageRegressionCurve" ) { - xResult.set( new MovingAverageRegressionCurve( xContext ) ); + xResult.set( new MovingAverageRegressionCurve ); } return xResult; @@ -299,7 +296,6 @@ uno::Reference< chart2::XRegressionCurve > void RegressionCurveHelper::addMeanValueLine( uno::Reference< XRegressionCurveContainer > & xRegCnt, - const uno::Reference< XComponentContext > & xContext, const uno::Reference< XPropertySet > & xSeriesProp ) { if( !xRegCnt.is() || @@ -307,7 +303,7 @@ void RegressionCurveHelper::addMeanValueLine( return; // todo: use a valid context - uno::Reference< XRegressionCurve > xCurve( createMeanValueLine( xContext )); + uno::Reference< XRegressionCurve > xCurve( createMeanValueLine() ); xRegCnt->addRegressionCurve( xCurve ); if( xSeriesProp.is()) @@ -372,8 +368,7 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::addRegressionC if( !aServiceName.isEmpty()) { // todo: use a valid context - xCurve.set( createRegressionCurveByServiceName( - uno::Reference< uno::XComponentContext >(), aServiceName )); + xCurve.set( createRegressionCurveByServiceName( aServiceName ) ); if( xEquationProperties.is()) xCurve->setEquationProperties( xEquationProperties ); diff --git a/chart2/source/tools/RegressionCurveModel.cxx b/chart2/source/tools/RegressionCurveModel.cxx index addd33acdb30..bce0d5064e1f 100644 --- a/chart2/source/tools/RegressionCurveModel.cxx +++ b/chart2/source/tools/RegressionCurveModel.cxx @@ -176,14 +176,11 @@ struct StaticRegressionCurveInfo : public rtl::StaticAggregate< uno::Reference< namespace chart { -RegressionCurveModel::RegressionCurveModel( - uno::Reference< uno::XComponentContext > const & xContext, - tCurveType eCurveType ) : - ::property::OPropertySet( m_aMutex ), - m_xContext( xContext ), +RegressionCurveModel::RegressionCurveModel( tCurveType eCurveType ) : + ::property::OPropertySet( m_aMutex ), m_eRegressionCurveType( eCurveType ), - m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), - m_xEquationProperties( new RegressionEquation ) + m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()), + m_xEquationProperties( new RegressionEquation ) { // set 0 line width (default) hard, so that it is always written to XML, // because the old implementation uses different defaults @@ -193,10 +190,9 @@ RegressionCurveModel::RegressionCurveModel( } RegressionCurveModel::RegressionCurveModel( const RegressionCurveModel & rOther ) : - MutexContainer(), - impl::RegressionCurveModel_Base(), - ::property::OPropertySet( rOther, m_aMutex ), - m_xContext( rOther.m_xContext ), + MutexContainer(), + impl::RegressionCurveModel_Base(), + ::property::OPropertySet( rOther, m_aMutex ), m_eRegressionCurveType( rOther.m_eRegressionCurveType ), m_xModifyEventForwarder( ModifyListenerHelper::createModifyEventForwarder()) { @@ -345,9 +341,8 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( RegressionCurveModel, RegressionCurveModel_Bas // implementations -MeanValueRegressionCurve::MeanValueRegressionCurve( - const uno::Reference< uno::XComponentContext > & xContext ) - : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_MEAN_VALUE ) +MeanValueRegressionCurve::MeanValueRegressionCurve() + : RegressionCurveModel( RegressionCurveModel::CURVE_TYPE_MEAN_VALUE ) {} MeanValueRegressionCurve::MeanValueRegressionCurve( const MeanValueRegressionCurve & rOther ) : @@ -380,9 +375,8 @@ uno::Reference< util::XCloneable > SAL_CALL MeanValueRegressionCurve::createClon return uno::Reference< util::XCloneable >( new MeanValueRegressionCurve( *this )); } -LinearRegressionCurve::LinearRegressionCurve( - const uno::Reference< uno::XComponentContext > & xContext ) - : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_LINEAR ) +LinearRegressionCurve::LinearRegressionCurve() + : RegressionCurveModel( RegressionCurveModel::CURVE_TYPE_LINEAR ) {} LinearRegressionCurve::LinearRegressionCurve( const LinearRegressionCurve & rOther ) : @@ -415,9 +409,8 @@ uno::Reference< util::XCloneable > SAL_CALL LinearRegressionCurve::createClone() return uno::Reference< util::XCloneable >( new LinearRegressionCurve( *this )); } -LogarithmicRegressionCurve::LogarithmicRegressionCurve( - const uno::Reference< uno::XComponentContext > & xContext ) - : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_LOGARITHM ) +LogarithmicRegressionCurve::LogarithmicRegressionCurve() + : RegressionCurveModel( RegressionCurveModel::CURVE_TYPE_LOGARITHM ) {} LogarithmicRegressionCurve::LogarithmicRegressionCurve( const LogarithmicRegressionCurve & rOther ) : @@ -450,9 +443,8 @@ uno::Reference< util::XCloneable > SAL_CALL LogarithmicRegressionCurve::createCl return uno::Reference< util::XCloneable >( new LogarithmicRegressionCurve( *this )); } -ExponentialRegressionCurve::ExponentialRegressionCurve( - const uno::Reference< uno::XComponentContext > & xContext ) - : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_EXPONENTIAL ) +ExponentialRegressionCurve::ExponentialRegressionCurve() + : RegressionCurveModel( RegressionCurveModel::CURVE_TYPE_EXPONENTIAL ) {} ExponentialRegressionCurve::ExponentialRegressionCurve( const ExponentialRegressionCurve & rOther ) : @@ -485,9 +477,8 @@ uno::Reference< util::XCloneable > SAL_CALL ExponentialRegressionCurve::createCl return uno::Reference< util::XCloneable >( new ExponentialRegressionCurve( *this )); } -PotentialRegressionCurve::PotentialRegressionCurve( - const uno::Reference< uno::XComponentContext > & xContext ) - : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_POWER ) +PotentialRegressionCurve::PotentialRegressionCurve() + : RegressionCurveModel( RegressionCurveModel::CURVE_TYPE_POWER ) {} PotentialRegressionCurve::PotentialRegressionCurve( const PotentialRegressionCurve & rOther ) : @@ -520,9 +511,8 @@ uno::Reference< util::XCloneable > SAL_CALL PotentialRegressionCurve::createClon return uno::Reference< util::XCloneable >( new PotentialRegressionCurve( *this )); } -PolynomialRegressionCurve::PolynomialRegressionCurve( - const uno::Reference< uno::XComponentContext > & xContext ) - : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_POLYNOMIAL ) +PolynomialRegressionCurve::PolynomialRegressionCurve() + : RegressionCurveModel( RegressionCurveModel::CURVE_TYPE_POLYNOMIAL ) {} PolynomialRegressionCurve::PolynomialRegressionCurve( const PolynomialRegressionCurve & rOther ) : @@ -555,9 +545,8 @@ uno::Reference< util::XCloneable > SAL_CALL PolynomialRegressionCurve::createClo return uno::Reference< util::XCloneable >( new PolynomialRegressionCurve( *this )); } -MovingAverageRegressionCurve::MovingAverageRegressionCurve( - const uno::Reference< uno::XComponentContext > & xContext ) - : RegressionCurveModel( xContext, RegressionCurveModel::CURVE_TYPE_MOVING_AVERAGE ) +MovingAverageRegressionCurve::MovingAverageRegressionCurve() + : RegressionCurveModel( RegressionCurveModel::CURVE_TYPE_MOVING_AVERAGE ) {} MovingAverageRegressionCurve::MovingAverageRegressionCurve( const MovingAverageRegressionCurve & rOther ) : @@ -593,52 +582,52 @@ uno::Reference< util::XCloneable > SAL_CALL MovingAverageRegressionCurve::create } // namespace chart extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart2_ExponentialRegressionCurve_get_implementation(css::uno::XComponentContext *context, +com_sun_star_comp_chart2_ExponentialRegressionCurve_get_implementation(css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new ::chart::ExponentialRegressionCurve(context)); + return cppu::acquire(new ::chart::ExponentialRegressionCurve ); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart2_LinearRegressionCurve_get_implementation(css::uno::XComponentContext *context, +com_sun_star_comp_chart2_LinearRegressionCurve_get_implementation(css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new ::chart::LinearRegressionCurve(context)); + return cppu::acquire(new ::chart::LinearRegressionCurve ); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart2_LogarithmicRegressionCurve_get_implementation(css::uno::XComponentContext *context, +com_sun_star_comp_chart2_LogarithmicRegressionCurve_get_implementation(css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new ::chart::LogarithmicRegressionCurve(context)); + return cppu::acquire(new ::chart::LogarithmicRegressionCurve ); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart2_MeanValueRegressionCurve_get_implementation(css::uno::XComponentContext *context, +com_sun_star_comp_chart2_MeanValueRegressionCurve_get_implementation(css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new ::chart::MeanValueRegressionCurve(context)); + return cppu::acquire(new ::chart::MeanValueRegressionCurve ); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart2_PotentialRegressionCurve_get_implementation(css::uno::XComponentContext *context, +com_sun_star_comp_chart2_PotentialRegressionCurve_get_implementation(css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new ::chart::PotentialRegressionCurve(context)); + return cppu::acquire(new ::chart::PotentialRegressionCurve ); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart2_PolynomialRegressionCurve_get_implementation(css::uno::XComponentContext *context, +com_sun_star_comp_chart2_PolynomialRegressionCurve_get_implementation(css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new ::chart::PolynomialRegressionCurve(context)); + return cppu::acquire(new ::chart::PolynomialRegressionCurve ); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_chart2_MovingAverageRegressionCurve_get_implementation(css::uno::XComponentContext *context, +com_sun_star_comp_chart2_MovingAverageRegressionCurve_get_implementation(css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new ::chart::MovingAverageRegressionCurve(context)); + return cppu::acquire(new ::chart::MovingAverageRegressionCurve ); } diff --git a/chart2/source/tools/RegressionCurveModel.hxx b/chart2/source/tools/RegressionCurveModel.hxx index db135247c52d..4e7191a04177 100644 --- a/chart2/source/tools/RegressionCurveModel.hxx +++ b/chart2/source/tools/RegressionCurveModel.hxx @@ -65,8 +65,7 @@ public: CURVE_TYPE_MOVING_AVERAGE }; - RegressionCurveModel( css::uno::Reference< css::uno::XComponentContext > const & xContext, - tCurveType eCurveType ); + RegressionCurveModel( tCurveType eCurveType ); RegressionCurveModel( const RegressionCurveModel & rOther ); virtual ~RegressionCurveModel() override; @@ -127,9 +126,6 @@ protected: void fireModifyEvent(); private: - css::uno::Reference< css::uno::XComponentContext > - m_xContext; - const tCurveType m_eRegressionCurveType; css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder; @@ -141,8 +137,7 @@ private: class MeanValueRegressionCurve : public RegressionCurveModel { public: - explicit MeanValueRegressionCurve( - const css::uno::Reference< css::uno::XComponentContext > & xContext ); + explicit MeanValueRegressionCurve(); explicit MeanValueRegressionCurve( const MeanValueRegressionCurve & rOther ); virtual ~MeanValueRegressionCurve() override; @@ -163,11 +158,8 @@ public: class LinearRegressionCurve : public RegressionCurveModel { public: - explicit LinearRegressionCurve( - const css::uno::Reference< - css::uno::XComponentContext > & xContext ); - explicit LinearRegressionCurve( - const LinearRegressionCurve & rOther ); + explicit LinearRegressionCurve(); + explicit LinearRegressionCurve( const LinearRegressionCurve & rOther ); virtual ~LinearRegressionCurve() override; // ____ XCloneable ____ @@ -186,11 +178,8 @@ public: class LogarithmicRegressionCurve : public RegressionCurveModel { public: - explicit LogarithmicRegressionCurve( - const css::uno::Reference< - css::uno::XComponentContext > & xContext ); - explicit LogarithmicRegressionCurve( - const LogarithmicRegressionCurve & rOther ); + explicit LogarithmicRegressionCurve(); + explicit LogarithmicRegressionCurve( const LogarithmicRegressionCurve & rOther ); virtual ~LogarithmicRegressionCurve() override; // ____ XCloneable ____ @@ -209,10 +198,8 @@ public: class ExponentialRegressionCurve : public RegressionCurveModel { public: - explicit ExponentialRegressionCurve( - const css::uno::Reference< css::uno::XComponentContext > & xContext ); - explicit ExponentialRegressionCurve( - const ExponentialRegressionCurve & rOther ); + explicit ExponentialRegressionCurve(); + explicit ExponentialRegressionCurve( const ExponentialRegressionCurve & rOther ); virtual ~ExponentialRegressionCurve() override; // ____ XCloneable ____ @@ -231,11 +218,8 @@ public: class PotentialRegressionCurve : public RegressionCurveModel { public: - explicit PotentialRegressionCurve( - const css::uno::Reference< - css::uno::XComponentContext > & xContext ); - explicit PotentialRegressionCurve( - const PotentialRegressionCurve & rOther ); + explicit PotentialRegressionCurve(); + explicit PotentialRegressionCurve( const PotentialRegressionCurve & rOther ); virtual ~PotentialRegressionCurve() override; // ____ XCloneable ____ @@ -254,10 +238,8 @@ public: class PolynomialRegressionCurve : public RegressionCurveModel { public: - explicit PolynomialRegressionCurve( - const css::uno::Reference< css::uno::XComponentContext > & xContext ); - explicit PolynomialRegressionCurve( - const PolynomialRegressionCurve & rOther ); + explicit PolynomialRegressionCurve(); + explicit PolynomialRegressionCurve( const PolynomialRegressionCurve & rOther ); virtual ~PolynomialRegressionCurve() override; // ____ XCloneable ____ @@ -276,10 +258,8 @@ public: class MovingAverageRegressionCurve : public RegressionCurveModel { public: - explicit MovingAverageRegressionCurve( - const css::uno::Reference< css::uno::XComponentContext > & xContext ); - explicit MovingAverageRegressionCurve( - const MovingAverageRegressionCurve & rOther ); + explicit MovingAverageRegressionCurve(); + explicit MovingAverageRegressionCurve( const MovingAverageRegressionCurve & rOther ); virtual ~MovingAverageRegressionCurve() override; // ____ XCloneable ____ diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx index 5ea07e40e925..378d0f84b460 100644 --- a/chart2/source/tools/StatisticsHelper.cxx +++ b/chart2/source/tools/StatisticsHelper.cxx @@ -297,7 +297,6 @@ void StatisticsHelper::setErrorDataSequence( Reference< beans::XPropertySet > StatisticsHelper::addErrorBars( const Reference< chart2::XDataSeries > & xDataSeries, - const Reference< uno::XComponentContext > & xContext, sal_Int32 nStyle, bool bYError /* = true */ ) { @@ -311,7 +310,7 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars( if( !( xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar ) || !xErrorBar.is()) { - xErrorBar.set( createErrorBar( xContext )); + xErrorBar.set( new ErrorBar ); } OSL_ASSERT( xErrorBar.is()); |