sc/inc/SheetView.hxx | 4 ---- sc/source/ui/view/viewdata.cxx | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-)
New commits: commit b11ed15cf54ac7baf79e8ecabb7e4404f0528b7c Author: Tomaž Vajngerl <[email protected]> AuthorDate: Mon Oct 6 23:41:44 2025 +0900 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Tue Oct 7 05:40:06 2025 +0200 sc: fix wrong condition in IsValidTabNumber, clean SheetView It should be "&&" and not "||" or the function will never find an invalid tab number. Also remove default constructor and IsValid declaration from the SheetView class, as those are not used anymore. Change-Id: Ifd04009e10ce88c0248be7eded0fc4b6d5a0064e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191996 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <[email protected]> diff --git a/sc/inc/SheetView.hxx b/sc/inc/SheetView.hxx index 2f381f1472e9..352a28863a17 100644 --- a/sc/inc/SheetView.hxx +++ b/sc/inc/SheetView.hxx @@ -25,14 +25,10 @@ private: ScTable* mpTable = nullptr; public: - SheetView() = default; SheetView(ScTable* pTable); ScTable* getTablePointer() const; SCTAB getTableNumber() const; - - /** A sheet view is valid if the pointer to the table is set */ - bool isValid() const; }; } diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 4185f2e96b17..072089cf7eff 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -846,7 +846,7 @@ ScDBFunc* ScViewData::GetView() const { return pView; } bool ScViewData::IsValidTabNumber(SCTAB nTabNumber) const { - return nTabNumber >= 0 || o3tl::make_unsigned(nTabNumber) < maTabData.size(); + return nTabNumber >= 0 && o3tl::make_unsigned(nTabNumber) < maTabData.size(); } void ScViewData::UpdateCurrentTab()
