sw/source/core/frmedt/fetab.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit bb47ffbc9d36e83695aa0d01767d3f83533c04e0
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Thu Sep 22 10:33:43 2022 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Fri Sep 23 16:05:08 2022 +0200

    tdf#46733 sw: don't double-select column during deleteCol
    
    The problem here was that under IsNewModel tables were
    selecting the entire column (including merged cells)
    and then using THAT selection to ExpandColumnSelection.
    
    Well, that ends in disaster. Since NewModel already
    expands to catch the cells that are contained inside
    the selected cells, there is no need to expand
    the selection of GetTableCell.
    
    Change-Id: I43089d912cdd17b2599619a43e40fecc2f5dd3b5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140455
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 6268a9794b04..66300afddc58 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -281,7 +281,15 @@ bool SwFEShell::DeleteCol()
     // search boxes via the layout
     bool bRet;
     SwSelBoxes aBoxes;
-    GetTableSel( *this, aBoxes, SwTableSearchType::Col );
+    SwTableSearchType eSearchType = SwTableSearchType::Col;
+
+    // NewModel tables already ExpandColumnSelection, so don't do it here also.
+    const SwContentNode* pContentNd = 
getShellCursor(false)->GetPointNode().GetContentNode();
+    const SwTableNode* pTableNd = pContentNd ? pContentNd->FindTableNode() : 
nullptr;
+    if (pTableNd && pTableNd->GetTable().IsNewModel())
+        eSearchType = SwTableSearchType::NONE;
+
+    GetTableSel(*this, aBoxes, eSearchType);
     if ( !aBoxes.empty() )
     {
         TableWait aWait( aBoxes.size(), pFrame, *GetDoc()->GetDocShell() );

Reply via email to