From 40dcf2d713e67ef4d8c68a6df98954f1f0b783db Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 25 Mar 2013 16:24:48 +0100 Subject: Add test case for toInt overflow detection Change-Id: I1c5b66888baac8aa1bc99c06579e0ef3638a4877 --- sal/inc/rtl/string.hxx | 9 ++++++--- sal/inc/rtl/ustring.hxx | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'sal/inc') diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index 01ee46477f34..f6cec59dc04e 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -1349,7 +1349,8 @@ public: @param radix the radix (between 2 and 36) @return the int32 represented from this string. - 0 if this string represents no number. + 0 if this string represents no number or one of too large + magnitude. */ sal_Int32 toInt32( sal_Int16 radix = 10 ) const SAL_THROW(()) { @@ -1363,7 +1364,8 @@ public: @param radix the radix (between 2 and 36) @return the int64 represented from this string. - 0 if this string represents no number. + 0 if this string represents no number or one of too large + magnitude. */ sal_Int64 toInt64( sal_Int16 radix = 10 ) const SAL_THROW(()) { @@ -1377,7 +1379,8 @@ public: @param radix the radix (between 2 and 36) @return the uint64 represented from this string. - 0 if this string represents no number. + 0 if this string represents no number or one of too large + magnitude. @since LibreOffice 4.1 */ diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index 2afd95cc62f0..768f5521303d 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -1828,7 +1828,8 @@ public: @param radix the radix (between 2 and 36) @return the int32 represented from this string. - 0 if this string represents no number. + 0 if this string represents no number or one of too large + magnitude. */ sal_Int32 toInt32( sal_Int16 radix = 10 ) const SAL_THROW(()) { @@ -1842,7 +1843,8 @@ public: @param radix the radix (between 2 and 36) @return the int64 represented from this string. - 0 if this string represents no number. + 0 if this string represents no number or one of too large + magnitude. */ sal_Int64 toInt64( sal_Int16 radix = 10 ) const SAL_THROW(()) { @@ -1856,7 +1858,8 @@ public: @param radix the radix (between 2 and 36) @return the uint64 represented from this string. - 0 if this string represents no number. + 0 if this string represents no number or one of too large + magnitude. @since LibreOffice 4.1 */ -- cgit