Bug 122487 - Wrong Naming of Drawing Objects
Summary: Wrong Naming of Drawing Objects
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:6.3.0 target:6.2.4 target:6.3....
Keywords:
Depends on:
Blocks: Navigator Shapes
  Show dependency treegraph
 
Reported: 2019-01-04 16:07 UTC by Harald Koester
Modified: 2019-10-04 06:04 UTC (History)
5 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 Harald Koester 2019-01-04 16:07:52 UTC
In order to reproduce the bug:

[1] Create new text document.
[2] Display Navigator: F5
[3] Insert 2 shapes, e.g. rectangles: Insert > Shape … In the Navigator the objects get the names Shape1 and Shape2.
[4] Group both objects together: Click and Shift+Click. Then: Right-Click > Group > Group.
[5] Insert a third shape. The new shape gets the name Shape1 in the Navigator. Expected: Hence the name Shape1 is already assigned to an object at step 3, the name Shape1 should not be used a second time.
[6] Ungroup the first shapes: Right-click > Group > Ungroup. Three drawing objects (Shape1, Shape1, Shape2) are displayed in the Navigator.
[7] In the Navigator double-click one of the items Shape1. Both shapes Shape1 are selected. It looks like if these shapes are grouped. Expected: Only one of the shapes should be selected.

The automatic naming of drawing objects has been introduced in version 5.1.0. So I assume that this bug also occurs the first time in version 5.1.0 in this way.
Comment 1 Dieter 2019-01-04 20:11:21 UTC
I confirm it with

Version: 6.3.0.0.alpha0+ (x64)
Build ID: ffa5b8a82eab18041bbee4d6914892b82c7801d3
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-12-19_03:24:54
Locale: en-US (de_DE); UI-Language: en-US
Calc: threaded
Comment 2 Xisco Faulí 2019-01-16 17:43:25 UTC
Also reproduced in

Version: 5.2.0.0.alpha0+
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.15; Render: default;
Comment 3 Alex Thurgood 2019-03-08 08:24:23 UTC
Is this not a DUPLICATE of bug 116252 ?
Comment 4 Harald Koester 2019-03-11 16:18:46 UTC
(In reply to Alex Thurgood from comment #3)
> Is this not a DUPLICATE of bug 116252 ?

Bug 116252 also exists in Writer, not only in Draw. Equal is the result of both bugs: Same names for different objects. Different is the procedure in order to get the same result: 116252: Copy of 2 selected objects; 122487: Grouping of 2 objects

So from my point of view referencing the other bug under "See Also" is the best in this case.
Comment 5 Aron Budea 2019-04-20 18:16:48 UTC
(In reply to Harald Koester from comment #0)
> The automatic naming of drawing objects has been introduced in version
> 5.1.0. So I assume that this bug also occurs the first time in version 5.1.0
> in this way.
Introduced by this commit, might be helpful to know:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=3647626309ef89bf90d8b6a6539d41d8deb6b482
author		Caolán McNamara <caolanm@redhat.com>	2015-09-17 13:55:28 +0100
committer	Caolán McNamara <caolanm@redhat.com>	2015-09-17 14:12:08 +0100

Give drawing objects unique names by default
Comment 6 Dieter 2019-04-22 04:43:51 UTC
cc: Caolán
Comment 7 Caolán McNamara 2019-04-22 18:12:14 UTC
we could look inside the groups for duplicate names
Comment 8 Caolán McNamara 2019-04-22 18:13:28 UTC
https://gerrit.libreoffice.org/#/c/71077/
Comment 9 Commit Notification 2019-04-22 19:12:35 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/193996728c842a4a36f678d5bf34a775e3c30636%5E%21

Resolves: tdf#122487 take groups into account

It will be available in 6.3.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 10 Caolán McNamara 2019-04-22 19:24:26 UTC
working in master, backport for 6-2 in gerrit
Comment 11 Commit Notification 2019-04-24 09:32:30 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/771be5a31c6cb40e1be30f71c2f02708292f2518%5E%21

Resolves: tdf#122487 take groups into account

It will be available in 6.2.4.

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 12 Dieter 2019-06-07 16:06:29 UTC
I tried to verify it, but I wasn't able to group the shapes in LO 6.2.4.2. In LO 6.3 I even couldn' select a single shape (see bug 125729).
Comment 13 Harald Koester 2019-06-25 13:24:21 UTC
Checked with version 6.2.4. The bug still exists, but with some changes of the behaviour. Changes are marked with (!):

...
[4] Group both objects together: Click and Shift+Click. Then: Right-Click > Group (!).
[5] Insert a third shape. The new shape gets the name Shape2(!) in the Navigator. Expected: Hence the name Shape2(!) is already assigned to an object at step 3, the name Shape2(!) should not be used a second time.
[6] Ungroup the first shapes: Right-click > Ungroup (!). Three drawing objects (Shape1, Shape2(!), Shape2) are displayed in the Navigator.
[7] In the Navigator double-click one of the items Shape2(!). Both shapes Shape2(!) are selected. It looks like if these shapes are grouped. Expected: Only one of the shapes should be selected.
Comment 14 Xisco Faulí 2019-09-24 07:34:38 UTC
Still reproducible in

Version: 6.4.0.0.alpha0+
Build ID: a283627036c9b1c56e4b765866b8fb8a26ec87ab
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

after the commit fixing bug 127695
Comment 15 Caolán McNamara 2019-09-26 16:14:36 UTC
Ah, I see, there's a fixed range of numbers that gets checked, and that depends on the number of existing toplevel shapes.
Comment 16 Commit Notification 2019-09-27 09:27:29 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

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

Resolves: tdf#122487 avoid duplicates when auto-naming drawing objects

It will be available in 6.3.3.

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 17 Commit Notification 2019-09-27 11:12:38 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4a736dff5ae2865318cab5d504b5b68feeb949be

Resolves: tdf#122487 avoid duplicates when auto-naming drawing objects

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 18 Dieter 2019-10-04 06:04:08 UTC
Verified with

Version: 6.4.0.0.alpha0+ (x64)
Build ID: 460908269972fd1f89312a1e62897ed1503e9e98
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-09-30_09:18:03
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded

Caolán, thanks for fixing it!