WaE: remove some warnings

This commit is contained in:
Caolán McNamara 2011-03-16 10:13:09 +00:00
parent ec1522ea64
commit 66584aa981
2 changed files with 4 additions and 3 deletions

View File

@ -88,10 +88,11 @@ void TestString::test()
CPPUNIT_ASSERT(n3 == -1); CPPUNIT_ASSERT(n3 == -1);
} }
void TestString::testDecimalStringToNumber() { void TestString::testDecimalStringToNumber()
{
rtl::OUString s1(RTL_CONSTASCII_USTRINGPARAM("1234")); rtl::OUString s1(RTL_CONSTASCII_USTRINGPARAM("1234"));
CPPUNIT_ASSERT_EQUAL((sal_uInt32)1234, comphelper::string::decimalStringToNumber(s1)); CPPUNIT_ASSERT_EQUAL((sal_uInt32)1234, comphelper::string::decimalStringToNumber(s1));
s1 += rtl::OUString(L'\u07C6'); s1 += rtl::OUString(static_cast<sal_Unicode>(0x07C6));
CPPUNIT_ASSERT_EQUAL((sal_uInt32)12346, comphelper::string::decimalStringToNumber(s1)); CPPUNIT_ASSERT_EQUAL((sal_uInt32)12346, comphelper::string::decimalStringToNumber(s1));
// Codepoints on 2 16bits words // Codepoints on 2 16bits words
sal_uInt32 utf16String[] = { 0x1D7FE /* 8 */, 0x1D7F7 /* 1 */}; sal_uInt32 utf16String[] = { 0x1D7FE /* 8 */, 0x1D7F7 /* 1 */};

View File

@ -101,7 +101,7 @@ sal_uInt32 decimalStringToNumber(
for( sal_Int32 i = 0 ; i < str.getLength() ; ) for( sal_Int32 i = 0 ; i < str.getLength() ; )
{ {
sal_uInt32 c = str.iterateCodePoints(&i); sal_uInt32 c = str.iterateCodePoints(&i);
sal_uInt8 value = 0; sal_uInt32 value = 0;
if( c <= 0x0039) // ASCII decimal digits, most common if( c <= 0x0039) // ASCII decimal digits, most common
value = c - 0x0030; value = c - 0x0030;
else if( c >= 0x1D7F6 ) // mathematical monospace digits else if( c >= 0x1D7F6 ) // mathematical monospace digits