sc/source/ui/view/gridwin.cxx | 4 +++- sc/source/ui/view/tableshell.cxx | 2 +- sc/source/ui/view/tabview3.cxx | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-)
New commits: commit cc452442409af61101a541faa279e284f7d60233 Author: Balazs Varga <[email protected]> AuthorDate: Thu Oct 30 18:33:37 2025 +0100 Commit: Balazs Varga <[email protected]> CommitDate: Wed Jan 7 17:13:58 2026 +0100 Calc Table style: limit UI and functionality only for ranges with table styles. Do not allow for simple DbRanges. Change-Id: I03ddc5760eff95f1284c08e0904f711309dbdef9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193227 Tested-by: Balazs Varga <[email protected]> Reviewed-by: Balazs Varga <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193684 Reviewed-by: Andras Timar <[email protected]> Tested-by: Andras Timar <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196752 diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 4848b117fc4f..c00c190e871e 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -7001,7 +7001,9 @@ void ScGridWindow::UpdateDatabaseOverlay() ScAddress aCurrentAddress = mrViewData.GetCurPos(); std::vector<basegfx::B2DRange> aRanges; ScRange aCurrRange; - if (ScDBData* pDBData = rDocument.GetDBAtCursor(aCurrentAddress.Col(), aCurrentAddress.Row(), aCurrentAddress.Tab(), ScDBDataPortion::AREA)) + ScDBData* pDBData = rDocument.GetDBAtCursor(aCurrentAddress.Col(), aCurrentAddress.Row(), + aCurrentAddress.Tab(), ScDBDataPortion::AREA); + if (pDBData && pDBData->GetTableStyleInfo()) { pDBData->GetArea(aCurrRange); Point aStart = mrViewData.GetScrPos(aCurrRange.aStart.Col(), diff --git a/sc/source/ui/view/tableshell.cxx b/sc/source/ui/view/tableshell.cxx index 6436073b9b10..52744dd972bb 100644 --- a/sc/source/ui/view/tableshell.cxx +++ b/sc/source/ui/view/tableshell.cxx @@ -77,7 +77,7 @@ void ScTableShell::ExecuteDatabaseSettings(SfxRequest& rReq) const ScDatabaseSettingItem* pDBItem = static_cast<const ScDatabaseSettingItem*>(pItem); const ScDBData* pDBData = GetDBDataAtCursor(); - if (pDBData) + if (pDBData && pDBData->GetTableStyleInfo()) { ScDBData aNewDBData(*pDBData); aNewDBData.SetAutoFilter(pDBItem->HasShowFilters()); diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 5b1bc08da37f..d5bbdb0576c6 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -679,8 +679,9 @@ void ScTabView::CursorPosChanged() aViewData.GetViewShell()->SetSparklineShell(bSparkline); if (!bSparkline) { - bool bHasDBTable = rDocument.GetDBAtCursor(rAddr.Col(), rAddr.Row(), rAddr.Tab(), ScDBDataPortion::AREA) != nullptr; - aViewData.GetViewShell()->SetTableShell(bHasDBTable); + const ScDBData* pDbData = rDocument.GetDBAtCursor(rAddr.Col(), rAddr.Row(), rAddr.Tab(), ScDBDataPortion::AREA); + bool bHasDBTableStyle = pDbData && pDbData->GetTableStyleInfo(); + aViewData.GetViewShell()->SetTableShell(bHasDBTableStyle); } }
