diff options
Diffstat (limited to 'connectivity/source/commontools/dbconversion.cxx')
-rw-r--r-- | connectivity/source/commontools/dbconversion.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx index d1cfd7ac7f6e..289eb0c2de3e 100644 --- a/connectivity/source/commontools/dbconversion.cxx +++ b/connectivity/source/commontools/dbconversion.cxx @@ -26,6 +26,7 @@ #include <rtl/math.hxx> #include <sal/log.hxx> #include <unotools/datetime.hxx> +#include <o3tl/string_view.hxx> #include <sstream> #include <iomanip> @@ -403,7 +404,7 @@ namespace dbtools return aRet; } - css::util::Date DBTypeConversion::toDate(const OUString& _sSQLString) + css::util::Date DBTypeConversion::toDate(std::u16string_view _sSQLString) { // get the token out of a string static const sal_Unicode sDateSep = '-'; @@ -412,12 +413,12 @@ namespace dbtools sal_uInt16 nYear = 0, nMonth = 0, nDay = 0; - nYear = static_cast<sal_uInt16>(_sSQLString.getToken(0,sDateSep,nIndex).toInt32()); + nYear = static_cast<sal_uInt16>(o3tl::toInt32(o3tl::getToken(_sSQLString, 0,sDateSep,nIndex))); if(nIndex != -1) { - nMonth = static_cast<sal_uInt16>(_sSQLString.getToken(0,sDateSep,nIndex).toInt32()); + nMonth = static_cast<sal_uInt16>(o3tl::toInt32(o3tl::getToken(_sSQLString, 0,sDateSep,nIndex))); if(nIndex != -1) - nDay = static_cast<sal_uInt16>(_sSQLString.getToken(0,sDateSep,nIndex).toInt32()); + nDay = static_cast<sal_uInt16>(o3tl::toInt32(o3tl::getToken(_sSQLString, 0,sDateSep,nIndex))); } return css::util::Date(nDay,nMonth,nYear); |