diff options
author | László Németh <nemeth@numbertext.org> | 2019-09-25 10:24:56 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-09-25 16:37:02 +0200 |
commit | 7fe64353dc9950e19182a59a486a1ecac27cf98e (patch) | |
tree | 6961bc0ac901b44880fccd17cfb602be984d9598 /sw | |
parent | f4fd98fc9f1b38071a806e52c17d26725c6a33c5 (diff) |
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>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 3d1a27a79ca8..055d091a75f9 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -3611,6 +3611,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, bool bSttWrd = false; bool bSttPara = false; bool bTableSel = false; + bool bTableWholeSel = false; bool bFrameSel = false; SwWrtShell& rSrcSh = *GetShell(); @@ -3674,7 +3675,11 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, 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 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, } } } + else if ( bRet && bTableWholeSel ) + { + SfxDispatcher* pDispatch = rSrcSh.GetView().GetViewFrame()->GetDispatcher(); + pDispatch->Execute(FN_TABLE_DELETE_TABLE, SfxCallMode::SYNCHRON); + } if( bRet && bMove && bFrameSel ) rSrcSh.LeaveSelFrameMode(); |