diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-19 10:10:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-19 13:32:24 +0200 |
commit | a7f9d632bb283955fb79e1e557665759a1b196a7 (patch) | |
tree | d9644a3e27c89531cd0cebc13b0bb8fdae3440f6 /sc | |
parent | fe930b18bc6ae2431860887fbc980b8550a95ed3 (diff) |
index validity check looks dubious
Change-Id: I0952bbaabeb8353b27b478ad6b17bc9348c6f61a
Reviewed-on: https://gerrit.libreoffice.org/61978
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index ddb2d9f8c0ea..d7a621c30150 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -2609,7 +2609,7 @@ sal_uInt16 XclExpXFBuffer::GetXFIndex( sal_uInt32 nXFId ) const sal_Int32 XclExpXFBuffer::GetXmlStyleIndex( sal_uInt32 nXFIndex ) const { OSL_ENSURE( nXFIndex < maStyleIndexes.size(), "XclExpXFBuffer::GetXmlStyleIndex - invalid index!" ); - if( nXFIndex > maStyleIndexes.size() ) + if( nXFIndex >= maStyleIndexes.size() ) return 0; // should be caught/debugged via above assert; return "valid" index. return maStyleIndexes[ nXFIndex ]; } @@ -2617,7 +2617,7 @@ sal_Int32 XclExpXFBuffer::GetXmlStyleIndex( sal_uInt32 nXFIndex ) const sal_Int32 XclExpXFBuffer::GetXmlCellIndex( sal_uInt32 nXFIndex ) const { OSL_ENSURE( nXFIndex < maCellIndexes.size(), "XclExpXFBuffer::GetXmlStyleIndex - invalid index!" ); - if( nXFIndex > maCellIndexes.size() ) + if( nXFIndex >= maCellIndexes.size() ) return 0; // should be caught/debugged via above assert; return "valid" index. return maCellIndexes[ nXFIndex ]; } |