Bug 119392 - new inserted Layer gets wrong visible/printable/locked properties
Summary: new inserted Layer gets wrong visible/printable/locked properties
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:6.2.0
Keywords:
: 121494 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-08-20 19:19 UTC by Regina Henschel
Modified: 2018-11-18 18:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
File to reproduce the problem (37.61 KB, application/vnd.oasis.opendocument.graphics)
2018-08-20 19:19 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2018-08-20 19:19:41 UTC
Created attachment 144335 [details]
File to reproduce the problem

Open the attached document. It has eight user defined layers, which have all possible combinations of visible/printable/locked. They are named accordingly to make the properties more obvious. The layer "VP-" is visible, printable, not locked, for example. Besides that the tab-bar shows the status of that properties. These properties can be toggled by shortcuts.

visible black, not visible blue, toggle Shift
printable normal, not printable underline, toggle Ctrl+Shift
locked italic, not locked upright, toggle Ctrl

Click on tab "V--" to make it the active layer.
Rightclick > Insert Layer
Name the new layer "NewV--" and set its properties to visible, not printable, not locked. OK.

Notice, that the new layer is inserted after "V--" and the tab has the appearance black+underline+upright, which is correct.

Save the document and reopen it.
Notice, that the properties are assigned to the layers as if the new layer has been inserted at the end of the tab-bar. The error is in the saved document. I don't know yet, where in the inserting process the wrong assignment happens.
Comment 1 Regina Henschel 2018-08-20 19:26:20 UTC
I see this error already in OOo2.4.3.
Comment 2 Regina Henschel 2018-09-01 18:38:27 UTC
The ODF attributes draw:display and draw:protected (support was implemented in bug 101242) get the correct values on saving. But currently the settings.xml has precedence and so the wrong values are used on loading.
Comment 3 Regina Henschel 2018-09-06 10:33:52 UTC
The SdrLayerIDSet in a view interprets its bits according the layer ID. But in file the attribute "ID" does not exists. In file the bitfield is interpreted in order of the layers in <draw:layer-set>. It is needed to reorder the bits when saving the file.
Comment 4 Commit Notification 2018-09-12 07:25:24 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d52c8fd4cc025ca9da474a20aa0f5514032273e2

tdf#119392 write bitfield in <draw:layer-set> order

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Regina Henschel 2018-10-09 09:22:23 UTC
Fixed in current master
Comment 6 Regina Henschel 2018-11-18 18:46:51 UTC
*** Bug 121494 has been marked as a duplicate of this bug. ***