diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-09 12:16:58 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-02-09 14:54:36 +0100 |
commit | 108edd58e854a0121c5c73a384614c1d216633cf (patch) | |
tree | 31ba1754d26501aa5fc8b0582df3aae4b9c0e6f6 /chart2 | |
parent | 112dd7edb69a0262d829fb071df1bc5d402aab50 (diff) |
cid#1591760 COPY_INSTEAD_OF_MOVE
and
cid#1591761 COPY_INSTEAD_OF_MOVE
cid#1591763 COPY_INSTEAD_OF_MOVE
cid#1591768 COPY_INSTEAD_OF_MOVE
cid#1591769 COPY_INSTEAD_OF_MOVE
Change-Id: Ia1c829f96148dc79cea02a69b3442c18d51e1288
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163162
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 6 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Insert.cxx | 30 |
2 files changed, 18 insertions, 18 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 29f5d9b6a24d..f17c3dae353e 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1339,17 +1339,17 @@ void SAL_CALL ChartController::releaseContextMenuInterceptor( void ChartController::executeDispatch_ChartType() { - auto aUndoGuard = std::make_shared<UndoLiveUpdateGuard>(SchResId(STR_ACTION_EDIT_CHARTTYPE), + auto xUndoGuard = std::make_shared<UndoLiveUpdateGuard>(SchResId(STR_ACTION_EDIT_CHARTTYPE), m_xUndoManager); SolarMutexGuard aSolarGuard; //prepare and open dialog auto aDlg = std::make_shared<ChartTypeDialog>(GetChartFrame(), getChartModel()); - weld::DialogController::runAsync(aDlg, [this, aUndoGuard](int nResult) { + weld::DialogController::runAsync(aDlg, [this, xUndoGuard=std::move(xUndoGuard)](int nResult) { if (nResult == RET_OK) { impl_adaptDataSeriesAutoResize(); - aUndoGuard->commit(); + xUndoGuard->commit(); } }); } diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index adb5b74b67d3..b80ef2bd5fd1 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -90,7 +90,7 @@ namespace chart void ChartController::executeDispatch_InsertAxes() { - auto aUndoGuard = std::make_shared<UndoGuard>( + auto xUndoGuard = std::make_shared<UndoGuard>( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_AXES )), m_xUndoManager ); @@ -104,7 +104,7 @@ void ChartController::executeDispatch_InsertAxes() SolarMutexGuard aGuard; auto aDlg = std::make_shared<SchAxisDlg>(GetChartFrame(), *aDialogInput); - weld::DialogController::runAsync(aDlg, [this, aDlg, aDialogInput, aUndoGuard](int nResult) { + weld::DialogController::runAsync(aDlg, [this, aDlg, aDialogInput, xUndoGuard=std::move(xUndoGuard)](int nResult) { if ( nResult == RET_OK ) { // lock controllers till end of block @@ -117,7 +117,7 @@ void ChartController::executeDispatch_InsertAxes() , aDialogInput->aExistenceList, aDialogOutput.aExistenceList, m_xCC , &aRefSizeProvider ); if( bChanged ) - aUndoGuard->commit(); + xUndoGuard->commit(); } }); } @@ -276,7 +276,7 @@ void ChartController::executeDispatch_DeleteDataTable() void ChartController::executeDispatch_InsertTitles() { - auto aUndoGuard = std::make_shared<UndoGuard>( + auto xUndoGuard = std::make_shared<UndoGuard>( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_TITLES )), m_xUndoManager ); @@ -288,7 +288,7 @@ void ChartController::executeDispatch_InsertTitles() SolarMutexGuard aGuard; auto aDlg = std::make_shared<SchTitleDlg>(GetChartFrame(), *aDialogInput); - weld::DialogController::runAsync(aDlg, [this, aDlg, aDialogInput, aUndoGuard](int nResult){ + weld::DialogController::runAsync(aDlg, [this, aDlg, aDialogInput, xUndoGuard=std::move(xUndoGuard)](int nResult){ if ( nResult == RET_OK ) { // lock controllers till end of block @@ -297,7 +297,7 @@ void ChartController::executeDispatch_InsertTitles() aDlg->getResult( aDialogOutput ); bool bChanged = aDialogOutput.writeDifferenceToModel( getChartModel(), m_xCC, aDialogInput.get() ); if( bChanged ) - aUndoGuard->commit(); + xUndoGuard->commit(); } }); } @@ -474,7 +474,7 @@ void ChartController::executeDispatch_InsertTrendline() if( !xRegressionCurveContainer.is() ) return; - auto aUndoGuard = std::make_shared<UndoLiveUpdateGuard>( + auto xUndoGuard = std::make_shared<UndoLiveUpdateGuard>( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_CURVE )), m_xUndoManager ); @@ -507,7 +507,7 @@ void ChartController::executeDispatch_InsertTrendline() // note: when a user pressed "OK" but didn't change any settings in the // dialog, the SfxTabDialog returns "Cancel" - SfxTabDialogController::runAsync(aDialog, [this, aDialog, aItemConverter, aUndoGuard](int nResult) { + SfxTabDialogController::runAsync(aDialog, [this, aDialog, aItemConverter, xUndoGuard=std::move(xUndoGuard)](int nResult) { if ( nResult == RET_OK || aDialog->DialogWasClosedWithOK() ) { const SfxItemSet* pOutItemSet = aDialog->GetOutputItemSet(); @@ -516,7 +516,7 @@ void ChartController::executeDispatch_InsertTrendline() ControllerLockGuardUNO aCLGuard( getChartModel() ); aItemConverter->ApplyItemSet( *pOutItemSet ); } - aUndoGuard->commit(); + xUndoGuard->commit(); } }); } @@ -531,7 +531,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) if( xSeries.is()) { - auto aUndoGuard = std::make_shared<UndoLiveUpdateGuard>( + auto xUndoGuard = std::make_shared<UndoLiveUpdateGuard>( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::ActionType::Insert, SchResId( bYError ? STR_OBJECT_ERROR_BARS_Y : STR_OBJECT_ERROR_BARS_X )), @@ -569,7 +569,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) // note: when a user pressed "OK" but didn't change any settings in the // dialog, the SfxTabDialog returns "Cancel" - SfxTabDialogController::runAsync(aDlg, [this, aDlg, aItemConverter, aUndoGuard](int nResult) { + SfxTabDialogController::runAsync(aDlg, [this, aDlg, aItemConverter, xUndoGuard=std::move(xUndoGuard)](int nResult) { if ( nResult == RET_OK || aDlg->DialogWasClosedWithOK() ) { const SfxItemSet* pOutItemSet = aDlg->GetOutputItemSet(); @@ -578,14 +578,14 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) ControllerLockGuardUNO aCLGuard( getChartModel() ); aItemConverter->ApplyItemSet( *pOutItemSet ); } - aUndoGuard->commit(); + xUndoGuard->commit(); } }); } else { //if no series is selected insert error bars for all series - auto aUndoGuard = std::make_shared<UndoGuard>( + auto xUndoGuard = std::make_shared<UndoGuard>( ActionDescriptionProvider::createDescription( ActionDescriptionProvider::ActionType::Insert, ObjectNameProvider::getName_ObjectForAllSeries( objType ) ), @@ -608,7 +608,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) aDlg->SetAxisMinorStepWidthForErrorBarDecimals( InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getChartModel(), m_xChartView, u"" ) ); - weld::DialogController::runAsync(aDlg, [this, aDlg, aItemConverter, aUndoGuard](int nResult) { + weld::DialogController::runAsync(aDlg, [this, aDlg, aItemConverter, xUndoGuard=std::move(xUndoGuard)](int nResult) { if ( nResult == RET_OK ) { SfxItemSet aOutItemSet = aItemConverter->CreateEmptyItemSet(); @@ -618,7 +618,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) ControllerLockGuardUNO aCLGuard( getChartModel() ); bool bChanged = aItemConverter->ApplyItemSet( aOutItemSet );//model should be changed now if( bChanged ) - aUndoGuard->commit(); + xUndoGuard->commit(); } }); } |