chart2/source/controller/main/ChartController.cxx        |    6 +--
 chart2/source/controller/main/ChartController_Insert.cxx |   30 +++++++--------
 sc/source/ui/view/hintwin.cxx                            |   13 ++----
 3 files changed, 23 insertions(+), 26 deletions(-)

New commits:
commit 00ac644f0b7a8a5d987301582752c455621a62e4
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Feb 9 12:23:49 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Feb 9 14:54:46 2024 +0100

    cid#1591766 COPY_INSTEAD_OF_MOVE
    
    and
    
    cid#1591765 COPY_INSTEAD_OF_MOVE
    
    Change-Id: Id0a983dde94985025f84d081136d0f743f190855
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163163
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index 7a287ed25c77..fbc0b17596b3 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -146,16 +146,13 @@ drawinglayer::primitive2d::Primitive2DContainer 
ScOverlayHint::createOverlaySequ
 
     basegfx::B2DPolygon aPoly(basegfx::utils::createPolygonFromRect(rRange));
 
-    drawinglayer::primitive2d::Primitive2DReference aBg(
+    // background
+    aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
         new 
drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPoly),
 getBaseColor().getBColor()));
-
-    basegfx::BColor aBorderColor(0.5, 0.5, 0.5);
-    drawinglayer::primitive2d::Primitive2DReference aBorder(
+    // border
+    aSeq[1] = drawinglayer::primitive2d::Primitive2DReference(
         new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
-            std::move(aPoly), aBorderColor));
-
-    aSeq[0] = aBg;
-    aSeq[1] = aBorder;
+            std::move(aPoly), basegfx::BColor(0.5, 0.5, 0.5)));
 
     return aSeq;
 }
commit 108edd58e854a0121c5c73a384614c1d216633cf
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Feb 9 12:16:58 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Feb 9 14:54:36 2024 +0100

    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.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

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();
                 }
             });
         }

Reply via email to