diff options
author | Justin Luth <jluth@mail.com> | 2022-06-09 20:53:57 -0400 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-06-29 13:24:34 +0200 |
commit | 0031f34d0ba99de5384e13843e99ffbb01f729d0 (patch) | |
tree | 1d9da57b12b7b5dfbb7c0d1989cceb73f9b29e70 /sw | |
parent | c71e26b4cf6181791acff4017f661edb3523c70e (diff) |
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 <jluth@mail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/swcrsr.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
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(); |