[Libreoffice-commits] .: dbaccess/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Jan 16 12:15:31 PST 2013
dbaccess/source/filter/xml/xmlDataSourceSetting.cxx | 35 ++++++++------------
1 file changed, 14 insertions(+), 21 deletions(-)
New commits:
commit 47d95d7591ec6218ad3c3ce75b232ee15d00c174
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Jan 16 21:11:31 2013 +0100
OXMLDataSourceSetting::convertString: try to make Clang tb happy
Change-Id: I8b2509f28206fd5b6c20c88d9186a9a18f76f7a5
diff --git a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
index 8838104..1246adb 100644
--- a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
@@ -178,13 +178,11 @@ Any OXMLDataSourceSetting::convertString(const ::com::sun::star::uno::Type& _rEx
case TypeClass_BOOLEAN: // sal_Bool
{
bool bValue(false);
- #if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
- #endif
+ bool const bSuccess =
::sax::Converter::convertBool(bValue, _rReadCharacters);
- OSL_ENSURE(bSuccess, OString(OString("OXMLDataSourceSetting::convertString: could not convert \"") +
- OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US) +
- OString("\" into a boolean!")).getStr());
+ SAL_WARN_IF(!bSuccess, "dbaccess",
+ "OXMLDataSourceSetting::convertString: could not convert \""
+ << _rReadCharacters << "\" into a boolean!");
aReturn <<= bValue;
}
break;
@@ -192,14 +190,11 @@ Any OXMLDataSourceSetting::convertString(const ::com::sun::star::uno::Type& _rEx
case TypeClass_LONG: // sal_Int32
{ // it's a real int32/16 property
sal_Int32 nValue(0);
- #if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
- #endif
+ bool const bSuccess =
::sax::Converter::convertNumber(nValue, _rReadCharacters);
- OSL_ENSURE(bSuccess,
- ::rtl::OStringBuffer("OXMLDataSourceSetting::convertString: could not convert \"")
- .append(::rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US))
- .append("\" into an integer!").getStr());
+ SAL_WARN_IF(!bSuccess, "dbaccess",
+ "OXMLDataSourceSetting::convertString: could not convert \""
+ << _rReadCharacters << "\" into an integer!");
if (TypeClass_SHORT == _rExpectedType.getTypeClass())
aReturn <<= (sal_Int16)nValue;
else
@@ -214,14 +209,11 @@ Any OXMLDataSourceSetting::convertString(const ::com::sun::star::uno::Type& _rEx
case TypeClass_DOUBLE:
{
double nValue = 0.0;
- #if OSL_DEBUG_LEVEL > 0
- sal_Bool bSuccess =
- #endif
+ bool const bSuccess =
::sax::Converter::convertDouble(nValue, _rReadCharacters);
- OSL_ENSURE(bSuccess,
- ::rtl::OStringBuffer("OXMLDataSourceSetting::convertString: could not convert \"")
- .append(rtl::OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US))
- .append("\" into a double!").getStr());
+ SAL_WARN_IF(!bSuccess, "dbaccess",
+ "OXMLDataSourceSetting::convertString: could not convert \""
+ << _rReadCharacters << "\" into a double!");
aReturn <<= (double)nValue;
}
break;
@@ -229,7 +221,8 @@ Any OXMLDataSourceSetting::convertString(const ::com::sun::star::uno::Type& _rEx
aReturn <<= _rReadCharacters;
break;
default:
- OSL_FAIL("OXMLDataSourceSetting::convertString: invalid type class!");
+ SAL_WARN("dbaccess",
+ "OXMLDataSourceSetting::convertString: invalid type class!");
}
return aReturn;
More information about the Libreoffice-commits
mailing list