Bug 151828 - Table name should be retained, if table is cutted & pasted
Summary: Table name should be retained, if table is cutted & pasted
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.2.3 release
Hardware: All All
: medium enhancement
Assignee: Jim Raykowski
URL:
Whiteboard: target:7.5.0
Keywords:
Depends on:
Blocks: Writer-Tables-Enhancements
  Show dependency treegraph
 
Reported: 2022-10-30 15:47 UTC by M4nu
Modified: 2022-11-27 13:41 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description M4nu 2022-10-30 15:47:49 UTC
Description:
Hello, 

I produce documents with many tables. I give to each table a name (Right click on the table > Properties > Name : tab1, tab2 etc.). 

I usually put a link at the beginning of the document, leading to each table : Link to tab1, Link to tab2 etc.

The problem is, when I cut a table (for ex tab2) and paste it in another place of the document (for example before tab1), the name of tab2 is deleted and become the name by default (for exemple Table2). 

Then, the link at the beginning of the document to tab2 is not working any more ! Would it be possible to solve this bug ?

Please do not hesitate to contact me if this explanation is not clear enough. 

Best regards, 
M4nu

Steps to Reproduce:
1. Create two tables
2. Change the name of the second table : right click > Properties > Name and put for example "mytable"
3. Cut this second table and paste it before the first table. 
4. Check the table name of "mytable" : its name is not "mytable" any more. It came back to the name by default (table2 for example). 

Actual Results:
The links to tables cannot work properly.

Expected Results:
Table names should be kept after cutting & pasting.


Reproducible: Always


User Profile Reset: No

Additional Info:
Please do not hesitate to contact me if this bug explanation is not clear enough.
Comment 1 Dieter 2022-11-13 08:08:55 UTC
I confirm the described behaviour with

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 55cd20e6228a06836285c14ca6726adb1bb4ffcb
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-GB
Calc: CL threaded

and think, that this is a valid enhancement request

cc: Design-Team for double-check
Comment 2 Heiko Tietze 2022-11-14 09:37:17 UTC
Same is also true for other objects such as shapes and in fact the name is kept but added by a number. Like "Foo" becomes "Foo 1". With subsequent cut/paste operations it remains "Foo 1". => needsDevAdvice

In general the use case is valid and user-defined object names should be kept when pasting an object into different documents as well as cut/paste at the same docuemnt.
Comment 3 Jim Raykowski 2022-11-20 06:57:14 UTC
(In reply to Heiko Tietze from comment #2)
> Same is also true for other objects such as shapes and in fact the name is
> kept but added by a number. Like "Foo" becomes "Foo 1". With subsequent
> cut/paste operations it remains "Foo 1". => needsDevAdvice
Here is a fix for this:
https://gerrit.libreoffice.org/c/core/+/142983

I searched but didn't find a bug report specific to shape names changing when cut/paste so I've listed it under this bug report.
Comment 4 Jim Raykowski 2022-11-20 07:03:28 UTC
Here is a proposed patch to retain the table name on cut and paste:
https://gerrit.libreoffice.org/c/core/+/142984
Comment 5 Commit Notification 2022-11-21 17:55:33 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#151828 related: Make cut shape have the same name after paste

It will be available in 7.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 6 Commit Notification 2022-11-22 22:14:03 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#151828 fix table name changes on cut and paste

It will be available in 7.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 7 Heiko Tietze 2022-11-23 09:11:12 UTC
Guess it's solved now.
Comment 8 Dieter 2022-11-27 13:41:24 UTC
(In reply to Heiko Tietze from comment #7)
> Guess it's solved now.

Yes, tested with tables and shapes in

Version: 7.5.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 5b18eebc2c95321ce7e6edf10f4df81557382a48
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-GB
Calc: CL threaded

=> VERIFIED FIXED

Jim, thanks for fixing it!