Bug 122945 - VIEWING: Tab colors of protected worksheets not shown in Excel 2007 spreadsheet
Summary: VIEWING: Tab colors of protected worksheets not shown in Excel 2007 spreadsheet
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.1.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Sheet-Tabs-Bar
  Show dependency treegraph
 
Reported: 2019-01-25 07:45 UTC by Ben Elliston
Modified: 2023-01-13 20:58 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Reproducible test case. (9.06 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2019-01-25 10:09 UTC, Ben Elliston
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Elliston 2019-01-25 07:45:44 UTC
Description:
I have a spreadsheet created with Excel (in .xlsx format). In Excel, the various worksheet tabs are shown in a variety of colours. When opening this spreadsheet in LibreOffice, the tab colours are not shown. The file command reports:

foo.xlsx: Microsoft Excel 2007+

Steps to Reproduce:
1. Open the .xlsx file in LibreOffice.
2. Note that tabs are not rendered in the correct colour(s).

Actual Results:
Tabs are shown in the default colour.

Expected Results:
Tabs should be shown in the colours as I see them in Excel.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
I will try to make a reproducible file that I can attach here.
Comment 1 raal 2019-01-25 08:48:47 UTC
Hello,

Thank you for filing the bug. Please send us a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO', so please do change it back to 'UNCONFIRMED' once you have attached a document.
(Please note that the attachment will be public, remove any sensitive information before attaching it.)
How can I eliminate confidential data from a sample document?
https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F
Thank you
Comment 2 Ben Elliston 2019-01-25 10:09:56 UTC
Created attachment 148623 [details]
Reproducible test case.

The problem appears to be that the tab colour is not rendered correctly when the worksheet is protected.
Comment 3 raal 2019-01-25 20:38:42 UTC
Confirm. Version: 6.3.0.0.alpha0+
Build ID: 3fa4674615b747e219afe5bf0a9b689df3840439
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: x11;
Comment 4 Ben Elliston 2019-01-30 11:46:28 UTC
Any progress on this? Thanks.
Comment 5 Roman Kuznetsov 2020-08-16 20:27:15 UTC
still repro in current 7.1 master
Comment 6 LeroyG 2020-11-05 21:02:44 UTC
Also in LibreOffice 6.4.7.2 (x86) and 7.0.2.2 (x64).
Do not matter if file is created with Calc or Excel. Unprotected sheet tabs retain  its color.
Comment 7 ethan young 2022-04-02 20:21:06 UTC
I can confirm this bug persists in LO 7.3.2.2

The issue only affects protected sheets in documents saved in xlsx format.
Comment 8 ethan young 2022-04-02 20:31:05 UTC
Protecting any sheets in an xlsx-formatted file with intact tab colors will also strip it of its tab colors.
Comment 9 Andreas Heinisch 2023-01-13 15:58:24 UTC
LibreOffice sets the background color of the tab in ScDocFunc::SetTabBgColor where it checks if the tabs is protected or not. If the tab is protected, no background will be set for the corresponding tab. 

Allowing to change the background color in the function will allow the change of the background color via Basic macro:
ThisComponent.getCurrentController().getActiveSheet().TabColor = 255*200

In M$ Excel I can change the background color of a tab via VBA as well:
Worksheets("Sheet1").Tab.Color = RGB(25, 25, 25)

Saving the document in LibreOffice/M$ will keep the changed background color of the tab.

Should we stick to the behaviour of M$ or try to set the background color differently for a protected tab in LibreOffice?
Comment 10 Ben Elliston 2023-01-13 20:58:01 UTC
I vote for mimicking MS Excel behaviour.