calc: Properly handle the disable state

Doesn't hide the grid when the Function wizard is open anymore
when disabling the ToggleSheetGrid button.

Depends on https://gerrit.libreoffice.org/c/core/+/167370

This is a follow up for issue #8066.

Signed-off-by: Hubert Figuière <hub@collabora.com>
Change-Id: I79ba99716eb1103e7239fe5cc302c64827c9ef53
pull/8771/merge
Hubert Figuière 2024-05-08 17:43:51 -04:00 committed by Hubert Figuière
parent f4265ce8a7
commit dbd3bc1482
1 changed files with 8 additions and 4 deletions

View File

@ -841,10 +841,14 @@ L.CalcTileLayer = L.CanvasTileLayer.extend({
this.insertMode = e.state.trim() === '' ? false: true;
}
else if (e.commandName === '.uno:ToggleSheetGrid') {
let newState = e.state.trim() === 'true';
if (this._sheetGrid != newState) {
this._sheetGrid = newState;
this._painter._sectionContainer.requestReDraw();
let trimmedState = e.state.trim();
// Disabled mean we don't change the sheet grid state.
if (trimmedState != 'disabled') {
let newState = trimmedState === 'true';
if (this._sheetGrid != newState) {
this._sheetGrid = newState;
this._painter._sectionContainer.requestReDraw();
}
}
}
},