sw/source/core/access/accmap.cxx  |    2 +-
 sw/source/core/unocore/unotbl.cxx |   18 +++++++++---------
 sw/source/filter/xml/swxml.cxx    |   10 +++++++++-
 vcl/source/window/mouse.cxx       |    6 +++++-
 4 files changed, 24 insertions(+), 12 deletions(-)

New commits:
commit 161809f2f20ce0cc6cba413f6dee06133cae1dc2
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Aug 26 17:11:45 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Aug 26 20:46:50 2024 +0200

    cid#1556212 COPY_INSTEAD_OF_MOVE
    
    and
    
    cid#1556339 COPY_INSTEAD_OF_MOVE
    cid#1556900 COPY_INSTEAD_OF_MOVE
    
    Change-Id: Iaf503afab3f8133f051ae08982d412c6e8587dcd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172431
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index b8ec7b9a293c..353ec72d85e4 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2369,7 +2369,7 @@ so run here: save the parent's SwFrame not the accessible 
object parent,
             {
                 SwAccessibleEvent_Impl aEvent(
                     SwAccessibleEvent_Impl::CHILD_POS_CHANGED,
-                    pParent, aFrameOrObj, rOldBox );
+                    pParent, std::move(aFrameOrObj), rOldBox );
                 AppendEvent( aEvent );
             }
             else
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 04fa8c3a3ee8..efcf33e2900d 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -3277,21 +3277,21 @@ SwXCellRange::getCellRangeByPosition(
                 const SwStartNode* pSttNd = pTLBox->GetSttNd();
                 SwPosition aPos(*pSttNd);
                 // set cursor in the upper-left cell of the range
-                auto pUnoCursor(pFormat->GetDoc()->CreateUnoCursor(aPos, 
true));
-                pUnoCursor->Move( fnMoveForward, GoInNode );
-                pUnoCursor->SetRemainInSection( false );
+                std::shared_ptr<SwUnoCursor> 
xUnoCursor(pFormat->GetDoc()->CreateUnoCursor(aPos, true));
+                xUnoCursor->Move( fnMoveForward, GoInNode );
+                xUnoCursor->SetRemainInSection( false );
                 const SwTableBox* pBRBox = pTable->GetTableBox( sBRName );
                 if(pBRBox)
                 {
-                    pUnoCursor->SetMark();
-                    pUnoCursor->GetPoint()->Assign( *pBRBox->GetSttNd() );
-                    pUnoCursor->Move( fnMoveForward, GoInNode );
-                    SwUnoTableCursor& rCursor = 
dynamic_cast<SwUnoTableCursor&>(*pUnoCursor);
+                    xUnoCursor->SetMark();
+                    xUnoCursor->GetPoint()->Assign( *pBRBox->GetSttNd() );
+                    xUnoCursor->Move( fnMoveForward, GoInNode );
+                    SwUnoTableCursor& rCursor = 
dynamic_cast<SwUnoTableCursor&>(*xUnoCursor);
                     // HACK: remove pending actions for selecting old style 
tables
                     UnoActionRemoveContext aRemoveContext(rCursor);
                     rCursor.MakeBoxSels();
-                    // pUnoCursor will be provided and will not be deleted
-                    aRet = SwXCellRange::CreateXCellRange(pUnoCursor, 
*pFormat, aNewDesc).get();
+                    // xUnoCursor will be provided and will not be deleted
+                    aRet = 
SwXCellRange::CreateXCellRange(std::move(xUnoCursor), *pFormat, aNewDesc).get();
                 }
             }
         }
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index a3b0cd161a3e..9d16fdaa3602 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -861,7 +861,15 @@ ErrCodeMsg XMLReader::Read( SwDoc &rDoc, const OUString& 
rBaseURL, SwPaM &rPaM,
     else if ( rDoc.IsOLEPrtNotifyPending() )
         rDoc.PrtOLENotify( true );
 
-    nRet = nRet ? nRet : (nWarn ? nWarn : (nWarn2 ? nWarn2 : nWarnRDF ) );
+    if (!nRet)
+    {
+        if (nWarn)
+            nRet = nWarn;
+        else if (nWarn2)
+            nRet = nWarn2;
+        else
+            nRet = nWarnRDF;
+    }
 
     ::svx::DropUnusedNamedItems(xModelComp);
 
commit f9d1c1ca6c231e14b3706f5451e5079d79d2d1ce
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Aug 26 17:05:29 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Aug 26 20:46:39 2024 +0200

    cid#1556160 COPY_INSTEAD_OF_MOVE
    
    Change-Id: Iefeb8ec1803312b45989147272926266dec6b6d4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172430
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index e5c8e130f74e..eebcbd85f394 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -383,7 +383,11 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
             if ( !ImplCallPreNotify( aNEvt ) && !xWindow->isDisposed() )
                 CompatGetFocus();
             if( !xWindow->isDisposed() )
-                ImplCallActivateListeners( (pOldFocusWindow && ! 
pOldFocusWindow->isDisposed()) ? pOldFocusWindow : nullptr );
+            {
+                if (pOldFocusWindow && pOldFocusWindow->isDisposed())
+                    pOldFocusWindow = nullptr;
+                ImplCallActivateListeners(pOldFocusWindow);
+            }
             if( !xWindow->isDisposed() )
             {
                 mpWindowImpl->mnGetFocusFlags = GetFocusFlags::NONE;

Reply via email to