tdf#84806 Writer: drag and drop selected tables, don't empty

Drag and drop operation on a wholly selected table
resulted a copy of the original table, keeping also the
original one without its text content, ie. emptying it.

Now drag and drop works as intended: moving the table
instead of copying and emptying (like also MSO does).

See also commit 144bdd189d07faef0f71edbd039359665a45876c
"tdf#118311 Writer: cut selected table, not only its text content".

Change-Id: I7156420d35bd8de320c2559bc9453dbad846517d
Reviewed-on: https://gerrit.libreoffice.org/79517
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 3d1a27a..055d091 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -3611,6 +3611,7 @@
    bool bSttWrd = false;
    bool bSttPara = false;
    bool bTableSel = false;
    bool bTableWholeSel = false;
    bool bFrameSel = false;

    SwWrtShell& rSrcSh = *GetShell();
@@ -3674,7 +3675,11 @@
        return false;

    if( rSrcSh.IsTableMode() )
    {
        bTableSel = true;
        if ( rSrcSh.HasWholeTabSelection() )
            bTableWholeSel = true;
    }
    else if( rSrcSh.IsSelFrameMode() || rSrcSh.IsObjSelected() )
    {
        // don't move position-protected objects!
@@ -3847,6 +3852,11 @@
            }
        }
    }
    else if ( bRet && bTableWholeSel )
    {
        SfxDispatcher* pDispatch = rSrcSh.GetView().GetViewFrame()->GetDispatcher();
        pDispatch->Execute(FN_TABLE_DELETE_TABLE, SfxCallMode::SYNCHRON);
    }

    if( bRet && bMove && bFrameSel )
        rSrcSh.LeaveSelFrameMode();