summaryrefslogtreecommitdiffstats
path: root/i18npool/source/breakiterator/breakiterator_th.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'i18npool/source/breakiterator/breakiterator_th.cxx')
-rw-r--r--i18npool/source/breakiterator/breakiterator_th.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/i18npool/source/breakiterator/breakiterator_th.cxx b/i18npool/source/breakiterator/breakiterator_th.cxx
index 37948d5904b0..2504ab888884 100644
--- a/i18npool/source/breakiterator/breakiterator_th.cxx
+++ b/i18npool/source/breakiterator/breakiterator_th.cxx
@@ -19,6 +19,7 @@
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
+#include <o3tl/safeint.hxx>
#include <breakiterator_th.hxx>
#include <wtt.h>
@@ -187,7 +188,7 @@ void BreakIterator_th::makeIndex(const OUString& Text, sal_Int32 const nStartPos
{
if (Text != cachedText) {
cachedText = Text;
- if (m_aNextCellIndex.size() < size_t(cachedText.getLength())) {
+ if (m_aNextCellIndex.size() < o3tl::make_unsigned(cachedText.getLength())) {
m_aNextCellIndex.resize(cachedText.getLength());
m_aPreviousCellIndex.resize(cachedText.getLength());
}
@@ -209,10 +210,10 @@ void BreakIterator_th::makeIndex(const OUString& Text, sal_Int32 const nStartPos
sal_Int32 start, end, pos;
pos = start = end = startPos;
- assert(size_t(endPos) <= m_aNextCellIndex.size());
+ assert(endPos >= 0 && o3tl::make_unsigned(endPos) <= m_aNextCellIndex.size());
while (pos < endPos) {
end += getACell(str, start, endPos);
- assert(size_t(end) <= m_aNextCellIndex.size());
+ assert(end >= 0 && o3tl::make_unsigned(end) <= m_aNextCellIndex.size());
while (pos < end) {
m_aNextCellIndex[pos] = end;
m_aPreviousCellIndex[pos] = start;