summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-08 14:05:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-08 20:44:43 +0200
commit3e7679738413054c7e6ce973380eac501bf41cf2 (patch)
treead80f5bd2f11020fa864488792b6cc0e98a00207 /connectivity
parent3bfac2a7fad9737f31443292699bd6fee6ac3a6f (diff)
move comphelper::string::toInt32 to o3tl
so we can use it in places where we cannot include comphelper Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx7
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx5
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaData.cxx6
3 files changed, 9 insertions, 9 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index aacad7e6e08f..8c8461fd485d 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <comphelper/property.hxx>
#include <comphelper/servicehelper.hxx>
+#include <o3tl/string_view.hxx>
#include <comphelper/string.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/tempfile.hxx>
@@ -952,9 +953,9 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool
(*_rRow)[i]->setNull();
break;
}
- const sal_uInt16 nYear = static_cast<sal_uInt16>(comphelper::string::toInt32(aStr.subView( 0, 4 )));
- const sal_uInt16 nMonth = static_cast<sal_uInt16>(comphelper::string::toInt32(aStr.subView( 4, 2 )));
- const sal_uInt16 nDay = static_cast<sal_uInt16>(comphelper::string::toInt32(aStr.subView( 6, 2 )));
+ const sal_uInt16 nYear = static_cast<sal_uInt16>(o3tl::toInt32(aStr.subView( 0, 4 )));
+ const sal_uInt16 nMonth = static_cast<sal_uInt16>(o3tl::toInt32(aStr.subView( 4, 2 )));
+ const sal_uInt16 nDay = static_cast<sal_uInt16>(o3tl::toInt32(aStr.subView( 6, 2 )));
const css::util::Date aDate(nDay,nMonth,nYear);
*(*_rRow)[i] = aDate;
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
index 43348041b039..40d144730f6b 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
@@ -22,7 +22,7 @@
#include <com/sun/star/sdbc/Deferrability.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <comphelper/sequence.hxx>
-#include <comphelper/string.hxx>
+#include <o3tl/string_view.hxx>
#include <sal/log.hxx>
#include <rtl/ustrbuf.hxx>
@@ -751,8 +751,7 @@ Reference<XResultSet> SAL_CALL ODatabaseMetaData::getColumns(const Any& /*catalo
sal_Int32 nCharMaxLen = xRow->getShort(6);
bool bIsCharMax = !xRow->wasNull();
if (sDataType.equalsIgnoreAsciiCase("year"))
- nColumnSize
- = comphelper::string::toInt32(sColumnType.subView(6, 1)); // 'year(' length is 5
+ nColumnSize = o3tl::toInt32(sColumnType.subView(6, 1)); // 'year(' length is 5
else if (sDataType.equalsIgnoreAsciiCase("date"))
nColumnSize = 10;
else if (sDataType.equalsIgnoreAsciiCase("time"))
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
index 7959081df70c..ce3f107e2864 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
@@ -28,7 +28,7 @@
#include <TPrivilegesResultSet.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
-#include <comphelper/string.hxx>
+#include <o3tl/string_view.hxx>
using namespace connectivity::odbc;
using namespace com::sun::star::uno;
@@ -1242,7 +1242,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) try
{
OUString aValue;
OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
- return comphelper::string::toInt32(aValue.subView(0,aValue.indexOf('.')));
+ return o3tl::toInt32(aValue.subView(0,aValue.indexOf('.')));
}
catch (const SQLException &)
{
@@ -1278,7 +1278,7 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) try
{
OUString aValue;
OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DRIVER_VER,aValue,*this,m_pConnection->getTextEncoding());
- return comphelper::string::toInt32(aValue.subView(0,aValue.lastIndexOf('.')));
+ return o3tl::toInt32(aValue.subView(0,aValue.lastIndexOf('.')));
}
catch (const SQLException &)
{