Bug 153204 - Draw: cannot create layer named "background"
Summary: Draw: cannot create layer named "background"
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
7.4.4.2 release
Hardware: All Linux (All)
: medium minor
Assignee: Olivier Hallot
URL:
Whiteboard: target:7.6.0
Keywords:
Depends on:
Blocks: HelpGaps-NewFeatures
  Show dependency treegraph
 
Reported: 2023-01-25 13:56 UTC by Callegar
Modified: 2023-02-22 22:51 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 Callegar 2023-01-25 13:56:52 UTC
Description:
It appears to be impossible to create layers in draw with certain names. For instance, if you try to create a layer named "background", LibO says that a Layer with that name already exists even if it does not appear in the bottom bar with the layers.

If there are some "reserved" names this would better be documented.

Steps to Reproduce:
1. Open Draw
2. Try to create a layer named "background"

Actual Results:
LibO tells you that a layer with that name already exists

Expected Results:
LibO should let you create a background layer or tell you that the name "background" is reserved.


Reproducible: Always


User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: DrawingDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes
Comment 1 Regina Henschel 2023-01-25 22:34:29 UTC
The following five names have an internal usage and cannot be set by the user:
layout, background, backgroundobjects, controls, measurelines

The naming on the tabs is different and depends on language. The internal name is visible in the Modify dialog.

'layout', 'controls', 'measurelines' layers are visible in normal view.
'backgroundobjects' layer is visible in master view.
'background' layer is never visible and is not intended to be directly used by the user.

'measureline' layer is special as a dimension-line shape is automatically placed on layer 'measureline'.

'controls' layer is special as a form control shape is automatically placed on 'controls' layer and objects on 'controls' layer are always rendered in front of objects on other layers.
Comment 2 Commit Notification 2023-02-22 11:11:33 UTC
Olivier Hallot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/48e0b7962fdcfd46f8754ffa6c15dc149719f523

tdf#153204 Draw reserved layer names
Comment 3 Callegar 2023-02-22 13:25:46 UTC
Improving the documentation to include info about the reserved names is already fine, thanks!

However, there is still something that I do not fully understand.

If the naming system has two names for each layer, a user facing name that is internationalized (the "TAB" names) and an internal name, why isn't it possible to let users create layers with whatever TAB name they want? The only important thing seems not to have conflicts at the internal name level.

For instance, if the user wants to define a layer with the tab name set to "background" why not allowing it by mapping it to an internal name different from the reserved keyword "background"?
Comment 4 Regina Henschel 2023-02-22 14:24:38 UTC
(In reply to Callegar from comment #3)
> Improving the documentation to include info about the reserved names is
> already fine, thanks!
> 
> However, there is still something that I do not fully understand.
> 
> If the naming system has two names for each layer, a user facing name that
> is internationalized (the "TAB" names) and an internal name, why isn't it
> possible to let users create layers with whatever TAB name they want? The
> only important thing seems not to have conflicts at the internal name level.
> 
> For instance, if the user wants to define a layer with the tab name set to
> "background" why not allowing it by mapping it to an internal name different
> from the reserved keyword "background"?

It is not implemented that way and changing the implementation is a lot of work without real benefit. You can easily workaround the problem by using an additional character e.g. an underscore or a space.

User defined layers are not mapped to internal ones but are total new layers. The five special names were made fixed to ease their use in the code and decouple them from the used UI language.
Comment 5 Callegar 2023-02-22 22:51:17 UTC
Thanks for the explanation