Bug 118311

Summary: EDITING Cut+paste table does not remove the table (like MSO does)
Product: LibreOffice Reporter: Gabor Kelemen (allotropia) <kelemeng>
Component: WriterAssignee: László Németh <nemeth>
Status: RESOLVED FIXED    
Severity: normal CC: cno, vsfoote
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
See Also: https://bz.apache.org/ooo/show_bug.cgi?id=39405
https://bz.apache.org/ooo/show_bug.cgi?id=8931
https://bugs.documentfoundation.org/show_bug.cgi?id=84806
https://bugs.documentfoundation.org/show_bug.cgi?id=127759
Whiteboard: target:6.4.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 103100, 108018    
Attachments: Cutting a full table
After pasting the clipboard

Description Gabor Kelemen (allotropia) 2018-06-21 21:39:24 UTC
Created attachment 143015 [details]
Cutting a full table

In the editor, cutting and pasting a full table does not remove the original table, only its contents. The empty table remains.

1, Insert a table in the editor, fill its cells with some words
2, Select the full table and cut it. The cell texts disappear, but the table structure stays.
3, Paste the table. The table appears with the correct amount of cells and text - this part is good.

Expected result:
There should be only one table after cut+paste
Comment 1 Gabor Kelemen (allotropia) 2018-06-21 21:40:18 UTC
Created attachment 143016 [details]
After pasting the clipboard
Comment 2 V Stuart Foote 2018-06-22 03:21:06 UTC

*** This bug has been marked as a duplicate of bug 84806 ***
Comment 3 V Stuart Foote 2018-06-22 03:25:57 UTC
Other than being a dupe, if you include an empty paragraph before with an <alt>+enter before selecting the table, a cut/copy & paste will behave...
Comment 4 Gabor Kelemen (allotropia) 2018-06-22 06:46:11 UTC
(In reply to V Stuart Foote from comment #3)
> Other than being a dupe, if you include an empty paragraph before with an
> <alt>+enter before selecting the table, a cut/copy & paste will behave...

Thanks for detecting the older one and the workaround tip, that works for now.
Comment 5 László Németh 2019-09-24 09:28:48 UTC
Reopened because table cut and table moving are not exactly the same, especially in terms of code fixing.

Note: the suggested workaround (selecting a paragraph before the table) doesn't work in the case of nested tables.
Comment 6 Commit Notification 2019-09-24 13:42:05 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/144bdd189d07faef0f71edbd039359665a45876c

tdf#118311 Writer: cut selected table, not only its text content

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 László Németh 2019-09-24 13:42:24 UTC
tdf#118311 Writer: cut selected table, not only its text content

like MSO does. For example, if the text cursor in the table, press
Ctrl-A (Select All) twice (or if the cell is empty, once), and
Ctrl-X (Cut) to cut the table.

Note: This speeds up table moving and deletion significantly,
because there were only the following nonintuitive and uncomfortable
methods to cut and insert the table:

1) inserting an empty line before the table, and selecting that, too,
   Ctrl-X, Ctrl-V (Paste) and deleting the empty line after table
   insertion. Unfortunately, this doesn't work in the case of nested
   tables.

2) or selecting only the table, Ctrl-C (Copy), Table->Delete->Table
   and Ctrl-V.

Note: It's still possible to cut only the selected text content
using Copy and Delete.

See also https://bz.apache.org/ooo/show_bug.cgi?id=8931
"Deleting a table" from 2002 and https://bz.apache.org/ooo/show_bug.cgi?id=39405
"delete/cut also table, not only contents" from 2004.