[Libreoffice-commits] core.git: sw/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 25 14:37:54 UTC 2019
sw/source/uibase/dochdl/swdtflvr.cxx | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit 7fe64353dc9950e19182a59a486a1ecac27cf98e
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Wed Sep 25 10:24:56 2019 +0200
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Wed Sep 25 16:37:02 2019 +0200
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 at numbertext.org>
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();
More information about the Libreoffice-commits
mailing list