diff options
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/dbgui/csvsplits.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/inc/csvsplits.hxx | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/ui/dbgui/csvsplits.cxx b/sc/source/ui/dbgui/csvsplits.cxx index aaa0952d6b7b..aa53a88c3f64 100644 --- a/sc/source/ui/dbgui/csvsplits.cxx +++ b/sc/source/ui/dbgui/csvsplits.cxx @@ -21,6 +21,8 @@ #include <algorithm> +#include <sal/log.hxx> + bool ScCsvSplits::Insert( sal_Int32 nPos ) { if (nPos < 0) @@ -31,6 +33,9 @@ bool ScCsvSplits::Insert( sal_Int32 nPos ) if (aIter != maVec.end() && *aIter == nPos) return false; + SAL_WARN_IF(maVec.size()>=static_cast<std::size_t>(SAL_MAX_UINT32-1), + "sc.ui", "ScCsvSplits::Insert: too many elements in vector"); + maVec.insert( aIter, nPos ); return true; } diff --git a/sc/source/ui/inc/csvsplits.hxx b/sc/source/ui/inc/csvsplits.hxx index 3a07f83b0b69..7ab80e34a76f 100644 --- a/sc/source/ui/inc/csvsplits.hxx +++ b/sc/source/ui/inc/csvsplits.hxx @@ -68,7 +68,7 @@ public: /** Returns the number of splits. */ sal_uInt32 Count() const - { return maVec.size(); } + { return static_cast<sal_uInt32>(maVec.size()); } /** Returns the position of the specified split. */ sal_Int32 GetPos( sal_uInt32 nIndex ) const; /** Returns the position of the specified split. */ |