Bug 137844 - Cannot rename slide if space is kept
Summary: Cannot rename slide if space is kept
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectNotNeeded, regression
Depends on:
Blocks: Impress-UX
  Show dependency treegraph
 
Reported: 2020-10-29 07:37 UTC by Timur
Modified: 2023-11-27 12:07 UTC (History)
4 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 Timur 2020-10-29 07:37:31 UTC
1. Open new Impress presentation
2. Right click Rename Slide
3. Try to rename from "Slide 1" to "Slide 11" or "Slide 2" or "Slide a"

Experienced: error message "Duplicate or empty names are not possible"
Expected: to rename 

Note that rename to "Slide 1A" is possible. 
Repro 7.1+. Inherited.
Comment 1 Roman Kuznetsov 2020-10-29 20:35:15 UTC
confirm

Version: 7.1.0.0.alpha0+ (x64)
Build ID: fca525d570f4fada3db1a9bbee2e88a5a02839d9
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL
Comment 2 Telesto 2020-10-29 20:50:42 UTC
Hmm strange not in Draw
Comment 3 QA Administrators 2022-10-30 03:46:40 UTC Comment hidden (obsolete)
Comment 4 Andreas Heinisch 2023-09-08 12:02:48 UTC
The problem arises in: https://opengrok.libreoffice.org/xref/core/sd/source/ui/docshell/docshel2.cxx?r=04bf1d23#304

The change was introduced with commit b6cebeeddccc485d3ee8dbaa7cf1d3d4a9311c92 (#*i2380# Doing smarter page name checking Thorsten Behrens committed on Mar 13, 2002)
Comment 5 Andreas Heinisch 2023-09-08 12:15:43 UTC
Regression introduced by:

67650: Use indexed getToken() | https://gerrit.libreoffice.org/c/core/+/67650

Use indexed getToken()

Change-Id: I28d1a4f5a32bbe6e2278e9694c85d9a72dde8a23
Reviewed-on: https://gerrit.libreoffice.org/67650
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Comment 6 Andreas Heinisch 2023-09-09 09:21:10 UTC
Thorsten, may I ask you what is the reasoning in preventing renaming slides to "Slide 20" or similar?
Comment 7 Thorsten Behrens (allotropia) 2023-10-15 23:02:12 UTC
(In reply to Andreas Heinisch from comment #6)
> Thorsten, may I ask you what is the reasoning in preventing renaming slides
> to "Slide 20" or similar?

Slide names end up being part of master page styles too - and at least at the time of my change, just adding enough slides to reach 20 would have ended up in a duplicate name (and a noticeable mess).

For a proper fix, I'd either devise a way to encode user-provided slide names, such that they are _always_ different from automatic ones. Or move away from name lookups, and go for unique object names / ptrs or somesuch. Then the names are just something we read and write (and can make sure things are unique at that time).