Bug 141667 - [Calc] ThisComponent.CurrentController.ShowGrid => affects the grid of all sheets, but not the active one (inconsistent behavior)
Summary: [Calc] ThisComponent.CurrentController.ShowGrid => affects the grid of all sh...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: Macro-UNOAPI
  Show dependency treegraph
 
Reported: 2021-04-13 08:07 UTC by Igor
Modified: 2025-11-27 11:28 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
bt with debug symbols (4.48 KB, text/plain)
2021-04-13 17:35 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor 2021-04-13 08:07:21 UTC
Description:
It's an example of a non-uniform approach.
E.g.
>>> ThisComponent.CurrentController.ShowGrid = True  'affects all sheets
>>> ThisComponent.CurrentController.freezeAtPosition(0, 1)  'affects active sheet

NOTE: This looks like a 10 year-old bug. ODS's file 'settings.xml' contains the 'ShowGrid' property for each sheet.
<config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>

Steps to Reproduce:
1. Select a sheet.
2. Run in code: ThisComponent.CurrentController.ShowGrid = False
3. 

Actual Results:
The grid of all sheets will be hidden.

Expected Results:
The grid of only the active sheet is hidden.


Reproducible: Always


User Profile Reset: No



Additional Info:
To hide the sheet grid via the GUI, right-click on the sheet tab and select "View Grid Lines" (menu: View/View Grid Lines)

Some links solve a contrived problem:
https://forum.openoffice.org/en/forum/viewtopic.php?f=9&t=38999
https://extensions.openoffice.org/en/project/gridlines
Comment 1 Julien Nabet 2021-04-13 17:35:12 UTC
Created attachment 171168 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I could reproduce this.

I don't know if it's expected or not but attached a bt showing where the value for "ShowGrid" is set.
Comment 2 himajin100000 2021-04-14 18:06:59 UTC
What if you run?

Option Explicit

Sub Macro1()

	Dim dispatchhelper As com.sun.star.frame.XDispatchHelper
	dispatchhelper = createUnoService("com.sun.star.frame.DispatchHelper")

	rem ----------------------------------------------------------------------
	dispatchhelper.executeDispatch(ThisComponent.CurrentController.Frame, ".uno:ToggleSheetGrid", "", 0, Array())


end sub
Comment 3 Igor 2021-04-15 03:36:02 UTC
The dispatcher method works. But the question was different. "Toggle” does not allow you to determine the current state.
Comment 4 QA Administrators 2025-11-27 11:28:00 UTC
Dear Igor,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug