diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-16 15:23:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-17 08:25:47 +0200 |
commit | ccb2a1f650bc505f8a4f1abebf8ce4f9396562a8 (patch) | |
tree | 2ee2fd4f300ae95cf23bade1f242e02f9b276c07 /chart2/source/controller | |
parent | da5c3a1ee43dd1a07cbd1b8005488bf05432593d (diff) |
clang-tidy readability-redundant-smartptr-get
redundant get() call on smart pointer
Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd
Reviewed-on: https://gerrit.libreoffice.org/61837
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/controller')
10 files changed, 30 insertions, 29 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 9f82483f5e66..b828828a546f 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -558,7 +558,7 @@ void DataBrowser::clearHeaders() void DataBrowser::RenewTable() { - if( ! m_apDataBrowserModel.get()) + if (!m_apDataBrowserModel) return; long nOldRow = GetCurRow(); @@ -636,7 +636,7 @@ void DataBrowser::RenewTable() OUString DataBrowser::GetColString( sal_Int32 nColumnId ) const { - OSL_ASSERT( m_apDataBrowserModel.get()); + OSL_ASSERT(m_apDataBrowserModel); if( nColumnId > 0 ) return m_apDataBrowserModel->getRoleOfColumn( nColumnId - 1 ); return OUString(); @@ -1119,14 +1119,14 @@ void DataBrowser::InitController( bool DataBrowser::CellContainsNumbers( sal_uInt16 nCol ) const { - if( ! m_apDataBrowserModel.get()) + if (!m_apDataBrowserModel) return false; return m_apDataBrowserModel->getCellType( lcl_getColumnInData( nCol )) == DataBrowserModel::NUMBER; } sal_uInt32 DataBrowser::GetNumberFormatKey( sal_uInt16 nCol ) const { - if( ! m_apDataBrowserModel.get()) + if (!m_apDataBrowserModel) return 0; return m_apDataBrowserModel->getNumberFormatKey( lcl_getColumnInData( nCol ) ); } diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx index 10af6e5cbf4c..15e1d00c307b 100644 --- a/chart2/source/controller/dialogs/DataBrowserModel.cxx +++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx @@ -279,7 +279,7 @@ private: void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) { - OSL_ASSERT( m_apDialogModel.get()); + OSL_ASSERT(m_apDialogModel); Reference< chart2::XInternalDataProvider > xDataProvider( m_apDialogModel->getDataProvider(), uno::UNO_QUERY ); @@ -400,7 +400,7 @@ void DataBrowserModel::insertComplexCategoryLevel( sal_Int32 nAfterColumnIndex ) { //create a new text column for complex categories - OSL_ASSERT( m_apDialogModel.get()); + OSL_ASSERT(m_apDialogModel); Reference< chart2::XInternalDataProvider > xDataProvider( m_apDialogModel->getDataProvider(), uno::UNO_QUERY ); if (!xDataProvider.is()) return; @@ -438,7 +438,7 @@ void DataBrowserModel::removeComplexCategoryLevel( sal_Int32 nAtColumnIndex ) void DataBrowserModel::removeDataSeriesOrComplexCategoryLevel( sal_Int32 nAtColumnIndex ) { - OSL_ASSERT( m_apDialogModel.get()); + OSL_ASSERT(m_apDialogModel); if (nAtColumnIndex < 0 || static_cast<size_t>(nAtColumnIndex) >= m_aColumns.size()) // Out of bound. return; @@ -507,7 +507,7 @@ void DataBrowserModel::removeDataSeriesOrComplexCategoryLevel( sal_Int32 nAtColu void DataBrowserModel::swapDataSeries( sal_Int32 nFirstColumnIndex ) { - OSL_ASSERT( m_apDialogModel.get()); + OSL_ASSERT(m_apDialogModel); if( static_cast< tDataColumnVector::size_type >( nFirstColumnIndex ) < m_aColumns.size() - 1 ) { Reference< chart2::XDataSeries > xSeries( m_aColumns[nFirstColumnIndex].m_xDataSeries ); @@ -521,7 +521,7 @@ void DataBrowserModel::swapDataSeries( sal_Int32 nFirstColumnIndex ) void DataBrowserModel::swapDataPointForAllSeries( sal_Int32 nFirstIndex ) { - OSL_ASSERT( m_apDialogModel.get()); + OSL_ASSERT(m_apDialogModel); Reference< chart2::XInternalDataProvider > xDataProvider( m_apDialogModel->getDataProvider(), uno::UNO_QUERY ); // lockControllers diff --git a/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx b/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx index 639fd1afe55c..55273a76fd3c 100644 --- a/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx +++ b/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx @@ -42,7 +42,7 @@ TimerTriggeredControllerLock::~TimerTriggeredControllerLock() void TimerTriggeredControllerLock::startTimer() { - if(!m_apControllerLockGuard.get()) + if (!m_apControllerLockGuard) m_apControllerLockGuard.reset( new ControllerLockGuardUNO(m_xModel) ); m_aTimer.Start(); } diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index ea7f55413225..9d958a582e86 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -192,7 +192,7 @@ void ErrorBarResources::SetChartDocumentForRangeChoosing( m_apRangeSelectionHelper.reset( new RangeSelectionHelper( xChartDocument )); // has internal data provider => rename "cell range" to "from data" - OSL_ASSERT( m_apRangeSelectionHelper.get()); + OSL_ASSERT(m_apRangeSelectionHelper); if( m_bHasInternalDataProvider ) { m_xRbRange->set_label(m_xUIStringRbRange->get_label()); @@ -435,8 +435,8 @@ IMPL_LINK_NOARG(ErrorBarResources, IndicatorChanged, weld::ToggleButton&, void) IMPL_LINK(ErrorBarResources, ChooseRange, weld::Button&, rButton, void) { - OSL_ASSERT( m_apRangeSelectionHelper.get()); - if( ! m_apRangeSelectionHelper.get()) + OSL_ASSERT(m_apRangeSelectionHelper); + if (!m_apRangeSelectionHelper) return; OSL_ASSERT( m_pCurrentRangeChoosingField == nullptr ); @@ -665,8 +665,8 @@ void ErrorBarResources::FillValueSets() void ErrorBarResources::listeningFinished( const OUString & rNewRange ) { - OSL_ASSERT( m_apRangeSelectionHelper.get()); - if( ! m_apRangeSelectionHelper.get()) + OSL_ASSERT(m_apRangeSelectionHelper); + if (!m_apRangeSelectionHelper) return; // rNewRange becomes invalid after removing the listener @@ -697,8 +697,8 @@ void ErrorBarResources::listeningFinished( void ErrorBarResources::disposingRangeSelection() { - OSL_ASSERT( m_apRangeSelectionHelper.get()); - if( m_apRangeSelectionHelper.get()) + OSL_ASSERT(m_apRangeSelectionHelper); + if (m_apRangeSelectionHelper) m_apRangeSelectionHelper->stopRangeListening( false ); } diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index 268c46dd5cf8..75f8a76ff5f8 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -432,7 +432,7 @@ SplineResourceGroup::SplineResourceGroup(weld::Builder* pBuilder, TabPageParent SplinePropertiesDialog& SplineResourceGroup::getSplinePropertiesDialog() { - if( !m_xSplinePropertiesDialog.get() ) + if (!m_xSplinePropertiesDialog) { m_xSplinePropertiesDialog.reset(new SplinePropertiesDialog(m_pParent.GetFrameWeld())); } diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx index 6f151d647956..5f2a688cc64f 100644 --- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx +++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx @@ -167,7 +167,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co SdrPage* pPage = new SdrPage( *pModel, false ); pPage->SetSize(Size(1000,1000)); pModel->InsertPage( pPage, 0 ); - std::unique_ptr<SdrView> pView( new SdrView( *pModel.get(), pVDev ) ); + std::unique_ptr<SdrView> pView(new SdrView(*pModel, pVDev)); pView->hideMarkHandles(); SdrPageView* pPageView = pView->ShowSdrPage(pPage); diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx index ef1df6ae35d2..0a9669626fcb 100644 --- a/chart2/source/controller/main/ChartController_TextEdit.cxx +++ b/chart2/source/controller/main/ChartController_TextEdit.cxx @@ -59,7 +59,8 @@ void ChartController::StartTextEdit( const Point* pMousePixel ) if(!pTextObj) return; - OSL_PRECOND( !m_pTextActionUndoGuard.get(), "ChartController::StartTextEdit: already have a TextUndoGuard!?" ); + OSL_PRECOND(!m_pTextActionUndoGuard, + "ChartController::StartTextEdit: already have a TextUndoGuard!?"); m_pTextActionUndoGuard.reset( new UndoGuard( SchResId( STR_ACTION_EDIT_TEXT ), m_xUndoManager ) ); SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner(); @@ -135,8 +136,8 @@ bool ChartController::EndTextEdit() TitleHelper::setCompleteString( aString, uno::Reference< css::chart2::XTitle >::query( xPropSet ), m_xCC ); - OSL_ENSURE( m_pTextActionUndoGuard.get(), "ChartController::EndTextEdit: no TextUndoGuard!" ); - if ( m_pTextActionUndoGuard.get() ) + OSL_ENSURE(m_pTextActionUndoGuard, "ChartController::EndTextEdit: no TextUndoGuard!"); + if (m_pTextActionUndoGuard) m_pTextActionUndoGuard->commit(); } m_pTextActionUndoGuard.reset(); diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index e552656f1da6..d59ae46fb52e 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -246,7 +246,7 @@ void ChartController::executeDispatch_ScaleText() ControllerLockGuardUNO aCtlLockGuard( getModel() ); std::unique_ptr<ReferenceSizeProvider> pRefSizeProv(impl_createReferenceSizeProvider()); - OSL_ASSERT( pRefSizeProv.get()); + OSL_ASSERT(pRefSizeProv); if (pRefSizeProv) pRefSizeProv->toggleAutoResizeState(); diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index e7f656337507..7e006d5f2cc1 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1315,11 +1315,11 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) return bReturn; // handle accelerators - if( ! m_apAccelExecute.get() && m_xFrame.is() && m_xCC.is() ) + if (!m_apAccelExecute && m_xFrame.is() && m_xCC.is()) { m_apAccelExecute = ::svt::AcceleratorExecute::createAcceleratorHelper(); - OSL_ASSERT( m_apAccelExecute.get()); - if( m_apAccelExecute.get() ) + OSL_ASSERT(m_apAccelExecute); + if (m_apAccelExecute) m_apAccelExecute->init( m_xCC, m_xFrame ); } @@ -1328,7 +1328,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) bool bAlternate = aKeyCode.IsMod2(); bool bCtrl = aKeyCode.IsMod1(); - if( m_apAccelExecute.get() ) + if (m_apAccelExecute) bReturn = m_apAccelExecute->execute( aKeyCode ); if( bReturn ) return bReturn; diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index a8f39ee5c989..d920a4a8c988 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -522,8 +522,8 @@ void ControllerCommandDispatch::fireStatusEventForURLImpl( void ControllerCommandDispatch::updateCommandAvailability() { - bool bModelStateIsValid = ( m_apModelState.get() != nullptr ); - bool bControllerStateIsValid = ( m_apControllerState.get() != nullptr ); + bool bModelStateIsValid = (m_apModelState != nullptr); + bool bControllerStateIsValid = (m_apControllerState != nullptr); // Model and controller states exist. OSL_ASSERT( bModelStateIsValid ); OSL_ASSERT( bControllerStateIsValid ); |