Bug 154445 - Unused custom page styles are removed on save
Summary: Unused custom page styles are removed on save
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.6.0 target:7.5.3
Keywords:
: 156281 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-03-29 11:45 UTC by Miroslav Abrahám
Modified: 2023-07-14 15:07 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 Miroslav Abrahám 2023-03-29 11:45:57 UTC
Description:
When one creates custom page styles in Calc and saves the file (ods/ots), all unused custom page styles are removed automatically. They seem not to be saved at all unless used.

The first version of LibreOffice affected by this bug is 7.3.4.1 (it is not in the list of versions to pick from).

I looked at the log regarding this release and it might have been caused either by ticket #108188 or #131190.

Starting from version 7.3.4.1, templating with Calc is unusable.

Steps to Reproduce:
1. Open a new Calc sheet
2. Add a custom page style
3. Keep the default page style chosen
4. Save the sheet as ods or ots (it does not matter)
5. Re-open the file

Actual Results:
All custom page styles are removed, except for the one currently used (if it is a custom one).

Expected Results:
All custom page styles should be saved.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.3.4.1 (x64) / LibreOffice Community
Build ID: 13668373362b52f6e3ebcaaecb031bd59a3ac66b
CPU threads: 12; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: cs-CZ (cs_CZ); UI: cs-CZ
Calc: CL
Comment 1 Eike Rathke 2023-03-29 12:08:13 UTC
That could indeed be due to
https://git.libreoffice.org/core/+/10c07e001da992cff4078c1cb1f49fdb16673ac3%5E%21
tdf#108188, tdf#131190 - Verify that the page style is actually used

Andreas on Cc.
Comment 2 Andreas Heinisch 2023-03-29 14:32:12 UTC
So a page style should be saved in any case, regardless if it is in use or not?
Comment 3 Miroslav Abrahám 2023-03-29 14:50:35 UTC
At this point one cannot even create an *.ots file with multiple page styles to be used in regular *.ods files. Once you save the template file, all page styles except for the stock and currently used one are gone. Basically templating cannot be really used with this patch implemented.

In Writer all styles stay, meaning all page styles, whether you save an *.ott or *.odt. So I wonder whether Calc should work the same or have a different approach.
Comment 4 Andreas Heinisch 2023-03-29 14:55:16 UTC
Confirmed in:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 98cf5157d69d9f1692be7f2cac958b1dfb387ca9
CPU threads: 6; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL threaded
Comment 5 Commit Notification 2023-03-29 17:23:07 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8085a68be7604e7bd00004e0d9445be5e266ffbb

tdf#154445 - Export all page styles even if they are not in use

It will be available in 7.6.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 6 Commit Notification 2023-03-31 09:24:28 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/0aa559589035d496a5b80d0986b4cddf02437bab

tdf#154445 - Export all page styles even if they are not in use

It will be available in 7.5.3.

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 7 m_a_riosv 2023-07-14 15:07:18 UTC
*** Bug 156281 has been marked as a duplicate of this bug. ***