diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-04-26 10:00:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-04-26 13:57:55 +0200 |
commit | a32bd25acf541168c332d18e44be3a4ab558deec (patch) | |
tree | 4bd6d64b779e8a89ab9338dacecf0801ba17c904 /sc | |
parent | 2fa07953a6dfdcdbb4d214b289fe17a93f40f643 (diff) |
cid#1504074 silence Improper use of negative value
Change-Id: I4580d4cce8a53f2b1faf0738d08509d2730868df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133431
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 4 |
1 files 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<SCTAB>(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: |