Bug 125191 - Copying and pasting objects needs to assign new, unique names
Summary: Copying and pasting objects needs to assign new, unique names
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Jim Raykowski
URL:
Whiteboard: target:6.4.0
Keywords: filter:ppt
Depends on:
Blocks: PPT
  Show dependency treegraph
 
Reported: 2019-05-09 11:37 UTC by Peter Benedek
Modified: 2023-05-03 14:22 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
impress jumps between the slides (14.96 MB, application/vnd.ms-powerpoint)
2019-05-09 11:37 UTC, Peter Benedek
Details
Impress Navigator selection issue with multiple objects having the same name. (17.63 KB, application/vnd.oasis.opendocument.presentation)
2019-05-23 06:55 UTC, howil
Details
Unique names for objects when copied (1.14 MB, video/x-matroska)
2019-10-14 22:41 UTC, Jim Raykowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Benedek 2019-05-09 11:37:25 UTC
Created attachment 151271 [details]
impress jumps between the slides

Tested in Linux Mint 19.1; Libreoffice 6.x; Impress

-- Open attached document (BESENYSZÖG.ppt)
-- CTRL+F5 -- choose: Navigator

In ppt document include many same picture name. This was created when the document was opened.
Now...

-- Find a picture with the same name (Picture 4, 5, 6 etc.)
-- Click on any of them.

Impress jumping always the first slide, where is first found it the picture.

https://youtu.be/2qZO8V9P9Nc
Comment 1 Roman Kuznetsov 2019-05-11 16:47:25 UTC
don't repro in

Version: 6.3.0.0.alpha0+ (x64)
Build ID: 4cd4063f9cf531d1e948f27fcfd2eaed3d4a1a2d
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-05-08_23:08:36
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded

only Linux problem?

Peter, add please info from dialog Help->About LibreOffice
Comment 2 Peter Benedek 2019-05-11 17:44:12 UTC
Verzió: 6.3.0.0.alpha0+
Build az.: 98630a0bd49bd80652145a21e4e0d0ded792b36b
CPU szálak: 2; OS: Linux 4.18; Felületmegjelenítés: alapértelmezett; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-05-04_04:44:35
Területi beállítások: hu-HU (hu_HU.UTF-8); UI nyelve: hu-HU
Calc: threaded
Comment 3 howil 2019-05-23 06:55:47 UTC
Created attachment 151611 [details]
Impress Navigator selection issue with multiple objects having the same name.

Hi, 
I can reproduce this on 

Version: 6.2.3.2
Build ID: aecc05fe267cc68dde00352a451aa867b3b546ac
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Flatpak
Locale: de-AT (en_US.UTF-8); UI-Language: en-US
Calc: threaded

I created a sample document where I simply duplicated a slide which ends up in several objects having the same name.

A automated renaming and a right click menu in the navigator for renaming objects would help a lot.
Thanks in advance,
BR
HoWil
Comment 4 howil 2019-05-23 07:08:00 UTC
I can also reproduce this with the prior attached example presentation (see above  attachment 151611 [details]) 

Version: 6.3.0.0.alpha1
Build ID: 547edd20e527fb02900f6174973770d26306e2e7
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

on Ubuntu 18.04.2 LTS

BR
HoWil
Comment 5 Xisco Faulí 2019-07-03 10:48:47 UTC
I can reproduce it in

Version: 6.4.0.0.alpha0+
Build ID: 3cdc1b35b9d86bcfa1277e3e94925ae7b18b8fde
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

I remember reading a similar report in Bugzilla so it might be already reported...

@jim, I thought you might be interested in this issue...
Comment 6 Jim Raykowski 2019-08-15 09:52:29 UTC
Hi all,

I noticed the name dialog for an object will only accept a unique name but a copy paste or drag copy object is given the same name as that being copied. Here is a  patch that gives the copy object a unique name based on the copied name as suggested by howil's attachment.

https://gerrit.libreoffice.org/#/c/77500/
Comment 7 Jim Raykowski 2019-08-31 02:37:37 UTC
Hi all, 

I have been focused on improving the original patch made to implement this request. It has been very interesting learning more of the code base while doing this. I feel the current patch set at the link above is ready for review and testing. It provides for unique names to be given to copies of named objects by appending an underscore with the next available whole number that will make the name unique. This works for copies of objects made in Impress, Draw, Writer, and Calc and resolves the problem of the navigator jumping to the first occurrence of an object which has the same name as other objects because all objects will have unique names.
Comment 8 Commit Notification 2019-10-14 06:03:13 UTC Comment hidden (off-topic)
Comment 9 Mike Kaganski 2019-10-14 06:13:37 UTC
(In reply to Commit Notification from comment #8)

Sorry for the noise; I have made a mistake in the commit message above, which should have referenced bug 127164, not this one.
Comment 10 Jim Raykowski 2019-10-14 06:27:00 UTC
I made a mistake with the bug number in the commit message. The patch I merged for Mike is for bug 127164. The commit message should have been tdf#127164: Disable Undo during pptx save

How should this be corrected?
Comment 11 Jim Raykowski 2019-10-14 22:41:09 UTC
Created attachment 155007 [details]
Unique names for objects when copied

Hello all, I've attached a video to show what this patch does. It would be great to have confirmation that this works as expected and that the code is in good order before merging. I believe it to be.
Comment 12 Commit Notification 2019-10-28 09:24:31 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9f86b320a997c77069cf93dcb32fb71f09ad1348

tdf#125191 Give object copies unique names

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.