Bug 37156 - FORMATTING: Paste table result different for paste destination "table cell" or "normal text area"
Summary: FORMATTING: Paste table result different for paste destination "table cell" o...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: high minor
Assignee: László Németh
URL:
Whiteboard: target:5.0.0 target:4.4.3 target:6.5....
Keywords:
: 34535 90602 (view as bug list)
Depends on:
Blocks: Paste Writer-Tables
  Show dependency treegraph
 
Reported: 2011-05-12 18:39 UTC by Chris Peñalver
Modified: 2021-03-31 14:33 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
20061006_final_pres_handout.odt (10.87 KB, application/vnd.oasis.opendocument.text)
2011-05-12 18:39 UTC, Chris Peñalver
Details
Sample Document, see Comment 1 (13.55 KB, application/vnd.oasis.opendocument.text)
2011-05-13 02:14 UTC, Rainer Bielefeld Retired
Details
Proposed patch with table popup menu->Paste Special->Paste in Cell (14.93 KB, patch)
2019-12-11 14:55 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Peñalver 2011-05-12 18:39:31 UTC
Created attachment 46653 [details]
20061006_final_pres_handout.odt

Downstream bug may be found at:
https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/64295

OOo bug may be found at:
http://openoffice.org/bugzilla/show_bug.cgi?id=55944

1) lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

2) apt-cache policy libreoffice-writer
libreoffice-writer:
  Installed: 1:3.3.2-1ubuntu5
  Candidate: 1:3.3.2-1ubuntu5
  Version table:
 *** 1:3.3.2-1ubuntu5 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty-proposed/main i386
Packages
        100 /var/lib/dpkg/status
     1:3.3.2-1ubuntu4 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages

3) What is expected to happen in LibreOffice Writer via the Terminal:

cd ~/Desktop && wget https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/64295/+attachment/18400/+files/20061006_final_pres_handout.odt && lowriter -nologo 20061006_final_pres_handout.odt

click box to right of [GP Practice?] -> Edit -> Select All -> Edit -> Copy -> click cell below Joe elects Option A -> Edit -> Paste and the table is pasted into cell.

4) What happens instead is the table is not pasted, but the word Car is pasted into the cell, and 30,000 is pasted into the cell to the right.
Comment 1 Rainer Bielefeld Retired 2011-05-13 02:06:20 UTC
[Reproducible] with "LibreOffice 3.4Beta5  – WIN7  Home Premium  (64bit) English UI [DEV300m103 (Build:5)]". It seems to be a pure paste problem, hte reproduce I created a more simple "sample.odt"

Steps to reproduce:
1. Click into cell containing "1!
2. 2 times <cntl+a> to select complete table
3.  <cntl+c> for copy
4. Click below text "Paste below here"
5. <cntl+v> for paste
   expected: a complete clone of the 4 cells table should appear
   actual: as expected
6. Click into single cell table below
7. <cntl+v> for paste
   Expected: Nested table should be created as a clone of the 4 cells table
   Actual: second row will be created, cels contain Nos. 1,3

That seems inconsistent.

A workaround is to include the line in front ofsmall  table and line behind small table into marked area , then the complete table will be inserted in 
step 7

I doubt that that can be fixed easily, for some needs the current behavior just might be the desired one, please see second example in "sample.odt".

To me this bug seems to be an enhancement request.
Comment 2 Rainer Bielefeld Retired 2011-05-13 02:14:14 UTC
Created attachment 46668 [details]
Sample Document, see Comment 1

The problem has already been reported as 
Bug 34535 - TABLES copy inner table to other location
But I will mar that one as DUP of this one because here we have collected more  details of the problem
Comment 3 Rainer Bielefeld Retired 2011-05-13 02:17:19 UTC
*** Bug 34535 has been marked as a duplicate of this bug. ***
Comment 4 Björn Michaelsen 2011-12-23 12:02:30 UTC Comment hidden (obsolete)
Comment 5 Alexander 2012-01-09 06:45:55 UTC
In LO3.5a2 an inner table cannot even be selected to be copied.
Comment 6 Alexander 2012-01-09 06:53:33 UTC
(In reply to comment #5)
> In LO3.5a2 an inner table cannot even be selected to be copied.

I meant LO3.5 beta2, sorry
Comment 7 Rainer Bielefeld Retired 2012-01-09 07:45:08 UTC
Status of this bug report has been modified wrongly by a bulk change. 

@Reporter:
Please do not touch picker fields if you do not know for what they are!
<http://wiki.documentfoundation.org/BugReport_Details#Version>

A Quick test did not show new behavior with 3.5.0Beta2, If you found a new (Regression) problem please submit a new Bug report!

@Cédric:
Please feel free to reassign (or reset Assignee to default) if it’s not your area or if provided information is not sufficient. Please set Status to ASSIGNED if you accept this Bug.
Comment 8 sasha.libreoffice 2012-01-24 10:46:39 UTC
> for some needs the current behavior just
> might be the desired one, please see second example in "sample.odt".
I agree that current behaviour is very handy.
And different behaviour my added into Edit->Paste special
Comment 9 A (Andy) 2013-05-04 21:56:18 UTC
reproducible with LO 4.0.2.2 (Win7 Home, 64bit)
Comment 10 Commit Notification 2015-03-13 21:34:04 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7600a2942ce2b9dac66836105bed6620d55abec2

fdo#37156 insert table copy as nested table in non-starting cell position

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 László Németh 2015-03-16 11:13:38 UTC
I have limited the normal cell overwriting behaviour of Writer for the case, where the text cursor is there at the beginning of the cell. Now it is possible to insert a nested table in a simple way: positionate the text cursor in a non-cell-starting position (in an empty cell, for example, press space), and paste it. So now a multi-paragraph cell supports also nested table insertion similarly to the normal text area.

Commit message: "fdo#37156 insert table copy as nested table in non-starting cell position
Inserted table content overwrote full cell content, when it was inserted in the middle of a multi-paragraph table cell. Now overwriting depends from the cursor position within the cell: if the cursor is not at the beginning of the first paragraph of the cell, Writer inserts the copied table content as a nested table, instead of overwriting the cell (or also the other cells of the destination)."
Comment 12 Commit Notification 2015-04-06 01:41:27 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=46ed3c7fd370416186080a35e091dcbb50d533cf&h=libreoffice-4-4

tdf#37156 insert table copy as nested table in non-starting cell position

It will be available in 4.4.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Chris Peñalver 2016-01-24 07:27:20 UTC
Sorry for the very *lagged* response (my email backlog is that deep).

Despite this, this is still reproducible verbatim with same outcome as noted in https://bugs.documentfoundation.org/show_bug.cgi?id=37156#c0 :
Version: 5.0.2.2
Build ID: 1:5.0.2-0ubuntu7
Locale: en-US (en_US.UTF-8)
Comment 14 QA Administrators 2017-03-06 13:54:35 UTC Comment hidden (obsolete)
Comment 15 Thomas Lendo 2017-09-23 20:57:27 UTC
Still reproducible.

Version: 6.0.0.0.alpha0+
Build ID: b439971c9f580db43a5cdcce9217ba1b555d5cce
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: de-DE (de_DE.UTF-8); Calc: group
2017-09-23
Comment 16 QA Administrators 2018-09-24 02:49:07 UTC Comment hidden (obsolete)
Comment 17 László Németh 2019-12-11 14:55:49 UTC
Created attachment 156494 [details]
Proposed patch with table popup menu->Paste Special->Paste in Cell
Comment 18 László Németh 2019-12-11 15:00:05 UTC
Note: It worth to create similar options to insert table rows before/after the actual row/column instead of overwrite the content of the actual cells, as in MSO (where there is a "paste table special" toolbar on the popup table menu with mouseover preview).
Comment 19 László Németh 2019-12-13 11:09:14 UTC
*** Bug 90602 has been marked as a duplicate of this bug. ***
Comment 20 Commit Notification 2019-12-14 16:59:50 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1e278d1d0cfb1d5375195aa764739f00633f21e8

tdf#37156 Writer menu: Paste as Nested table

It will be available in 6.5.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 21 László Németh 2019-12-14 17:02:31 UTC
See Edit->Paste Special->Paste As Nested Table and in the popup/local table menu, Paste Special->As Nested Table.
Comment 22 Commit Notification 2019-12-14 21:31:30 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/d53cd7d7e229568b0c9597bc89d973e0d1050b44

tdf#37156 Writer menu: Paste as Nested table

It will be available in 6.4.0.1.

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 23 Xisco Faulí 2019-12-20 10:58:10 UTC
Hi László Németh,
I see the option 'Nested Table' in the context menu, however, if I use Ctrl + Shft + V, I don't see it listed, should be there too ?
Comment 24 László Németh 2020-01-06 15:58:29 UTC
(In reply to Xisco Faulí from comment #23)
> Hi László Németh,
> I see the option 'Nested Table' in the context menu, however, if I use Ctrl
> + Shft + V, I don't see it listed, should be there too ?

@Xisco: maybe not, because it's not a different format. But extending the local menu of the Paste icon on the Standard toolbar would be useful.