diff options
author | Eike Rathke <erack@redhat.com> | 2014-06-03 15:39:05 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-06-03 15:39:45 +0200 |
commit | 85d1b74fd0866dc54a3745743acd1aa76ef30aaf (patch) | |
tree | 65fa5858296b031c29b12199cb0bdbd93cb990b8 /include | |
parent | a8c5adabb98d4152527b553f904c1841c7393748 (diff) |
eliminate xub_StrLen left-over
Change-Id: I4862481d69ac86bf082e35b28d6326444deafee8
Diffstat (limited to 'include')
-rw-r--r-- | include/unotools/digitgroupingiterator.hxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/include/unotools/digitgroupingiterator.hxx b/include/unotools/digitgroupingiterator.hxx index d7bca117756b..ce1cf84f73db 100644 --- a/include/unotools/digitgroupingiterator.hxx +++ b/include/unotools/digitgroupingiterator.hxx @@ -31,9 +31,8 @@ namespace utl { digits per group. If the last group was encountered the iterator will always return the last grouping. - Grouping values are sanitized to be 0 <= value <= SAL_MAX_UINT16, even if - originally Int32, to be able to easily cast it down to String's xub_StrLen. - This shouldn't make any difference in practice. + Grouping values are sanitized to be >= 0, even if originally signed + sal_Int32. Usage example with a string buffer containing a decimal representation of an integer number. Note that of course this loop could be optimized to not @@ -81,11 +80,9 @@ class DigitGroupingIterator if (mnGroup < maGroupings.getLength()) { sal_Int32 n = maGroupings[mnGroup]; - OSL_ENSURE( 0 <= n && n <= SAL_MAX_UINT16, "DigitGroupingIterator::getGrouping: far out"); + SAL_WARN_IF( n < 0, "unotools", "DigitGroupingIterator::getGrouping: negative grouping"); if (n < 0) - n = 0; // sanitize ... - else if (n > SAL_MAX_UINT16) - n = SAL_MAX_UINT16; // limit for use with xub_StrLen + n = 0; // sanitize ... return n; } return 0; |