Stephan Bergmann wrote:
<http://www.openoffice.org/issues/show_bug.cgi?id=74781> claims that
erroneously
rtl::OUString::createFromAscii("0xFF11FF11").toInt32 == 0x0FF11FF1
Looking at the code (sal/rtl/source/strtmpl.c:1.22 l. 858 ff), this
seems to be by desing: only use in the toInt32 conversion the longest
prefix of the string that does not lead to numeric overflow. This is
not specified in the documentation of rtl::OUString::toInt32 or
rtl_ustr_toInt32, however.
Any objections against changing this behavior, so that toInt32 consumes
all the string's digits and silently wraps on overflow (just as all the
C/C++ operators do for signed integral types, at least on all today's
hardware)? And similarly for toInt64 and rtl::OString, and the
corresponding C functions rtl_ustr_toInt32 etc.
No objections, so I changed it.
-Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]