From a32bd25acf541168c332d18e44be3a4ab558deec Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 26 Apr 2022 10:00:58 +0100 Subject: cid#1504074 silence Improper use of negative value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4580d4cce8a53f2b1faf0738d08509d2730868df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133431 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/ui/view/viewdata.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 054305c5278f..59be2185c1c6 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -3335,8 +3335,8 @@ void ScViewData::ReadUserData(std::u16string_view rData) // SetPagebreakMode must always be called due to CalcPPT / RecalcPixPos() // sheet may have become invalid (for instance last version): - SCTAB nNewTab = static_cast(o3tl::toInt64(o3tl::getToken(rData, 0, ';', nMainIdx))); - if (mrDoc.HasTable(nNewTab)) + sal_Int64 nNewTab = o3tl::toInt64(o3tl::getToken(rData, 0, ';', nMainIdx)); + if (nNewTab >= 0 && mrDoc.HasTable(nNewTab)) SetTabNo(nNewTab); // if available, get tab bar width: -- cgit v1.2.3