Bug 163854 - Pictures in PPTX get same name in Navigator and cannot be selected from Navigator
Summary: Pictures in PPTX get same name in Navigator and cannot be selected from Navig...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.3.1.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Impress-Images
  Show dependency treegraph
 
Reported: 2024-11-12 05:24 UTC by Alistair Saywell
Modified: 2024-11-14 05:53 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
There are three slides with a different image on each slide. Open Navigator and click on any of the named "Picture 2" and only the image in the first slide will be selected. (49.77 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2024-11-12 05:24 UTC, Alistair Saywell
Details
presentation with macro (18.40 KB, application/vnd.ms-powerpoint.presentation.macroenabled.12)
2024-11-13 12:20 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alistair Saywell 2024-11-12 05:24:26 UTC
Created attachment 197558 [details]
There are three slides with a different image on each slide. Open Navigator and click on any  of the named "Picture 2" and only the image in the first slide will be selected.

A pptx file created in PowerPoint 2010 has some different images on each page.
When the file is opened in LibreOffice, each image in Navigator is named the same as the first image, as a consequence only the first image will be selected from the Navigator pane when any of the same named images is clicked

Expected: Each image should have a unique name for identification and selection from Navigator.

Earliest I tested on was 7.3.1.3

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 8; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: en-NZ (en_NZ); UI: en-GB
Calc: CL threaded
Comment 1 m_a_riosv 2024-11-12 21:51:04 UTC
The same happens with PowerPoint.
Microsoft® PowerPoint® para Microsoft 365 MSO (versión 2410 compilación 16.0.18129.20100) 64 bits 

So maybe is something about how the file was created.
Comment 2 Regina Henschel 2024-11-12 22:29:18 UTC
This happens, when the shape/image has got the same name. In the UI of LibreOffice it is not possible to give the same name to different shapes/images. And when you duplicate a slide the given names are automatically changed so that they are unique.

But in PowerPoint the shape names remain the same, when you duplicate a slide. Inside PowerPoint it is no problem because PowerPoint uses object names per slide. But when such file is imported to LibreOffice, LibreOffice does not check whether there are duplicate names.

We could e.g add the slide name or check for uniqueness and add a counter if needed. For jumps renaming on import is no problem, as PowerPoint does not allow jumps to objects but only to slides. When objects have no name, then they are selected correctly in the Navigator, so not importing duplicate names might be an option as well. But I see as problem with renaming or deleting names, that macros might use the name. I have no idea for a solution.
Comment 3 Mike Kaganski 2024-11-13 05:14:43 UTC
(In reply to Regina Henschel from comment #2)

Can you please create a sample macro of such kind? I believe, that it should be a VBA macro, not LibreOffice one, because we are talking about importing an external format; the problems would be the renaming of the objects, and at the same time, keeping the macros working. The macros would either read the names, or use them as indexes (accessing children by names, or something)?

If I remember correctly, we have user-visible names, and API names (or maybe I confuse it with something else - needs code reading, which I can't do now).
Comment 4 Regina Henschel 2024-11-13 12:20:36 UTC
Created attachment 197589 [details]
presentation with macro

(In reply to Mike Kaganski from comment #3)
> (In reply to Regina Henschel from comment #2)
> 
> Can you please create a sample macro of such kind? I believe, that it should
> be a VBA macro, not LibreOffice one, because we are talking about importing
> an external format; the problems would be the renaming of the objects, and
> at the same time, keeping the macros working. The macros would either read
> the names, or use them as indexes (accessing children by names, or
> something)?

The attached presentation contains a macro. You can run the macro in a running presentation in PowerPoint, when you click on the blue rectangle.
It seems we currently do not import and convert the macro at all. Thus we might ignore renaming problems with macros.

> 
> If I remember correctly, we have user-visible names, and API names (or maybe
> I confuse it with something else - needs code reading, which I can't do now).

A user-visible name is the same as the value of the Name property of the API and the msName member in class OOX_DLLPUBLIC Shape. That class has a member
    msInternalName; // used by diagram; not displayed in UI
The comment indicates that it is not used for normal shapes.