sw/source/core/crsr/swcrsr.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 0031f34d0ba99de5384e13843e99ffbb01f729d0
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Thu Jun 9 20:53:57 2022 -0400
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Jun 29 13:24:34 2022 +0200

    tdf#145151 tdf#119540 sw IsTableMode: deselect unselected cell
    
    So far I have been playing whack-a-mole fixing the case where
    selecting table cells backwards leaves one cell seemingly
    still selected when applying paragraph properties.
    
    This patch seems to fix the underlying selection problem,
    meaning that the other patches can be reverted,
    and their unit tests become proof for this patch.
    
    Change-Id: I8d8a47333ab70917fccb80ff5e96c50302c386ea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135569
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index c5061c42f854..da1f1f5046f6 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -2434,7 +2434,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* 
pCurrentCursor )
         // compare old and new ones
         SwNodes& rNds = pCurrentCursor->GetDoc().GetNodes();
         const SwStartNode* pSttNd;
-        SwPaM* pCur = pCurrentCursor;
+        SwCursor* pCur = pCurrentCursor;
         do {
             size_t nPos;
             bool bDel = false;
@@ -2473,7 +2473,9 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* 
pCurrentCursor )
             pCur = pCur->GetNext();
             if( bDel )
             {
-                SwPaM* pDel = pCur->GetPrev();
+                SwCursor* pDel = pCur->GetPrev();
+                if (pDel == dynamic_cast<SwShellCursor*>(pCurrentCursor))
+                    pCurrentCursor = pDel->GetPrev();
 
                 if( pDel == pCurrentCursor )
                     pCurrentCursor->DeleteMark();

Reply via email to