diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-09-01 19:07:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-09-02 08:56:56 +0200 |
commit | aff6205058e896ffa129f9efa470b49adee0a09d (patch) | |
tree | bb5c8949abc395a67950c02ebca0eb2407dd817b /chart2/source | |
parent | 9c636d76a9a7e167da39913ab60f5135f8e831a6 (diff) |
replace set(nullptr) with clear()
It's a little easier to read, but mostly it makes an upcoming
loplugin easier to implement
Change-Id: I4ae7db8eda77795dab3255d1afd8ba4f20a8de76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156451
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | 24 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_DataSource.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 4 | ||||
-rw-r--r-- | chart2/source/inc/DisposeHelper.hxx | 2 | ||||
-rw-r--r-- | chart2/source/model/main/Axis.cxx | 2 | ||||
-rw-r--r-- | chart2/source/view/main/VDataSeries.cxx | 12 |
6 files changed, 23 insertions, 23 deletions
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index 85ff5c7022c3..70c9ace455b9 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -868,9 +868,9 @@ void SAL_CALL ChartDocumentWrapper::dispose() DisposeHelper::DisposeAndClear( m_xChartData ); DisposeHelper::DisposeAndClear( m_xDiagram ); DisposeHelper::DisposeAndClear( m_xArea ); - m_xChartView.set( nullptr ); - m_xShapeFactory.set( nullptr ); - m_xDelegator.set( nullptr ); + m_xChartView.clear(); + m_xShapeFactory.clear(); + m_xDelegator.clear(); clearWrappedPropertySet(); m_spChart2ModelContact->clear(); @@ -897,7 +897,7 @@ void SAL_CALL ChartDocumentWrapper::dispose() void ChartDocumentWrapper::impl_resetAddIn() { Reference< util::XRefreshable > xAddIn( m_xAddIn ); - m_xAddIn.set( nullptr ); + m_xAddIn.clear(); if( !xAddIn.is() ) return; @@ -1349,21 +1349,21 @@ uno::Any SAL_CALL ChartDocumentWrapper::queryAggregation( const uno::Type& rType void ChartDocumentWrapper::_disposing( const lang::EventObject& rSource ) { if( rSource.Source == m_xTitle ) - m_xTitle.set( nullptr ); + m_xTitle.clear(); else if( rSource.Source == m_xSubTitle ) - m_xSubTitle.set( nullptr ); + m_xSubTitle.clear(); else if( rSource.Source == m_xLegend ) - m_xLegend.set( nullptr ); + m_xLegend.clear(); else if( rSource.Source == m_xChartData ) - m_xChartData.set( nullptr ); + m_xChartData.clear(); else if( rSource.Source == m_xDiagram ) - m_xDiagram.set( nullptr ); + m_xDiagram.clear(); else if( rSource.Source == m_xArea ) - m_xArea.set( nullptr ); + m_xArea.clear(); else if( rSource.Source == m_xAddIn ) - m_xAddIn.set( nullptr ); + m_xAddIn.clear(); else if( rSource.Source == static_cast<cppu::OWeakObject*>(m_xChartView.get()) ) - m_xChartView.set( nullptr ); + m_xChartView.clear(); } // WrappedPropertySet diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index 0f21a03fd4f8..7ac75f3afa2b 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -768,7 +768,7 @@ bool DataSourceTabPage::updateModelFromControl(const weld::Entry* pField) else if( xLabeledSeq.is()) { // clear existing categories - xLabeledSeq.set(nullptr); + xLabeledSeq.clear(); m_rDialogModel.setCategories( xLabeledSeq ); } } diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 3f94410d22b0..1c85ab369269 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -817,7 +817,7 @@ void SAL_CALL ChartController::dispose() if( m_xLayoutManagerEventBroadcaster.is()) { m_xLayoutManagerEventBroadcaster->removeLayoutManagerEventListener( this ); - m_xLayoutManagerEventBroadcaster.set( nullptr ); + m_xLayoutManagerEventBroadcaster.clear(); } m_xFrame.clear(); @@ -961,7 +961,7 @@ void SAL_CALL ChartController::disposing( if( !impl_releaseThisModel( rSource.Source )) { if( rSource.Source == m_xLayoutManagerEventBroadcaster ) - m_xLayoutManagerEventBroadcaster.set( nullptr ); + m_xLayoutManagerEventBroadcaster.clear(); } } diff --git a/chart2/source/inc/DisposeHelper.hxx b/chart2/source/inc/DisposeHelper.hxx index 8c9b0b7d47f3..58dc2d5c55ba 100644 --- a/chart2/source/inc/DisposeHelper.hxx +++ b/chart2/source/inc/DisposeHelper.hxx @@ -33,7 +33,7 @@ template <class T> void Dispose(const T& xInterface) template <class T> void DisposeAndClear(css::uno::Reference<T>& rInterface) { Dispose<css::uno::Reference<T>>(rInterface); - rInterface.set(nullptr); + rInterface.clear(); } template <class Container> void DisposeAllElements(Container& rContainer) diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx index 99e20fbc86fb..26a6d48368b9 100644 --- a/chart2/source/model/main/Axis.cxx +++ b/chart2/source/model/main/Axis.cxx @@ -340,7 +340,7 @@ Axis::~Axis() if( m_aScaleData.Categories.is()) { ModifyListenerHelper::removeListener( m_aScaleData.Categories, m_xModifyEventForwarder ); - m_aScaleData.Categories.set(nullptr); + m_aScaleData.Categories.clear(); } } catch( const uno::Exception & ) diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 0ff045b5fde9..49b606ae0a6c 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -285,12 +285,12 @@ void VDataSeries::doSortByXValues() void VDataSeries::releaseShapes() { - m_xGroupShape.set(nullptr); - m_xLabelsGroupShape.set(nullptr); - m_xErrorXBarsGroupShape.set(nullptr); - m_xErrorYBarsGroupShape.set(nullptr); - m_xFrontSubGroupShape.set(nullptr); - m_xBackSubGroupShape.set(nullptr); + m_xGroupShape.clear(); + m_xLabelsGroupShape.clear(); + m_xErrorXBarsGroupShape.clear(); + m_xErrorYBarsGroupShape.clear(); + m_xFrontSubGroupShape.clear(); + m_xBackSubGroupShape.clear(); m_aPolyPolygonShape3D.clear(); m_nPolygonIndex = 0; |