diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-03 15:43:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-03 16:52:12 +0000 |
commit | 093b3d30f257a01122042eb4d116ee54fbdb7033 (patch) | |
tree | c7a047945dd7f1cb25308b682b148c3aaf148d72 /sc/inc/table.hxx | |
parent | remove boolean parameter default from ScDocument::SetDirty (diff) | |
download | core-093b3d30f257a01122042eb4d116ee54fbdb7033.tar.gz core-093b3d30f257a01122042eb4d116ee54fbdb7033.zip |
coverity#1242942 Use of untrusted scalar value
see can we make this somewhat more obvious to coverity
Change-Id: I2a3d9259f36c45b74391ecb5d96bf168959eb268
Diffstat (limited to 'sc/inc/table.hxx')
-rw-r--r-- | sc/inc/table.hxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index c7898f1918de..318805ab8376 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -1163,6 +1163,15 @@ private: SCROW mnUBound; }; + bool ValidCol(SCCOL nCol) const + { + return nCol >= 0 && static_cast<size_t>(nCol) < SAL_N_ELEMENTS(aCol); + } + + bool ValidColRow(SCCOL nCol, SCROW nRow) const + { + return ValidCol(nCol) && ValidRow(nRow); + } }; #endif |