Bug 123440 - Introduce expert option 'WriteLayerStateAsConfigItem'
Summary: Introduce expert option 'WriteLayerStateAsConfigItem'
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: medium enhancement
Assignee: Regina Henschel
URL:
Whiteboard: target:6.3.0
Keywords:
Depends on:
Blocks: Options-Dialog-Expert
  Show dependency treegraph
 
Reported: 2019-02-13 15:39 UTC by Regina Henschel
Modified: 2019-03-18 20:09 UTC (History)
1 user (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 Regina Henschel 2019-02-13 15:39:21 UTC
LibreOffice writes the ODF attributes 'draw:display' and 'draw:protected' of the 'draw:layer' element since version 6.2. It can read the ODF attributes since version 6.2. But they are only evaluated if non of the config items VisibleLayers, PrintableLayers and LockedLayers exists. These config items are written as proprietary information into the 'office:settings' element.

Because default values for the ODF attributes 'draw:display' and 'draw:protected' are not written, it is not possible to decide from the ODF attributes, whether it is an old document, which has the layer state in config items or a new document with default layer state. Only the absence of config items ensures, that it is a new document with layer state in ODF attributes.

I propose a hidden expert options, that determines whether config items for layer state are written or not. It provides a smooth transition from using the proprietary settings to using ODF conform attributes. In the beginning the new option will have the default value 'true', so that the proprietary settings are written parallel to the ODF attributes. When version 6.1 is end of life, the default value can be set to 'false'. Users can then still set it to 'true' in case they need interoperability with older versions or with Apache OpenOffice. The option influences only writing of documents. Existing documents are read the same as before the option exists.

Users who use the file format directly or work with macros can immediately set the option to 'false' to produce documents without the config items, so that on loading the ODF attributes are used. In case users remove unused default layers per macro when saving a document, config items must not be written, because otherwise ODF attributes and config items are out of sync on reopening the document in LibreOffice. Removing unused default layers might be desired, if the document is going to be used in other applications like Calligra Karbon or Scribus.

If one day the set of default layers are changed, not writing config items is then necessary too, so that older versions with old set of default layers will not assign not fitting config items.
Comment 1 Regina Henschel 2019-02-13 16:01:40 UTC
The proposed change is in https://gerrit.libreoffice.org/67784
Comment 2 Commit Notification 2019-02-19 13:57:21 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

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

tdf#123440 new expert option 'WriteLayerStateAsConfigItem'

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 3 Regina Henschel 2019-03-17 00:35:27 UTC
Feature is available in Version: 6.3.0.0.alpha0+ (x64)
Build ID: 9c5dbbe4b0a62ff1af009beb00f1fc45318dad79
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-02-27_20:03:12
Locale: de-DE (en_US); UI-Language: en-US
Calc: threaded
Comment 4 Xisco Faulí 2019-03-18 20:09:56 UTC
(In reply to Regina Henschel from comment #3)
> Feature is available in Version: 6.3.0.0.alpha0+ (x64)
> Build ID: 9c5dbbe4b0a62ff1af009beb00f1fc45318dad79
> CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
> TinderBox: Win-x86_64@42, Branch:master, Time: 2019-02-27_20:03:12
> Locale: de-DE (en_US); UI-Language: en-US
> Calc: threaded

Hi Regina,
Thanks for implementing this feature.
Please, do no forget to mention it in the release notes -> https://wiki.documentfoundation.org/ReleaseNotes/6.3