diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-29 11:06:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-01 08:30:18 +0200 |
commit | 5200a73627d13e2997f81b53f61e143e77e328ee (patch) | |
tree | f95c8346d061ecd0ad33d574895d18e169662785 /connectivity | |
parent | b90d3d316dd9c720c83180b31f6bbd7003fead78 (diff) |
use more string_view in various
found by examining uses of OUString::copy() for likely places
Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/firebird/PreparedStatement.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/parse/sqlbison.y | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index 10f034ce15ce..9cd9157a7d6d 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -783,7 +783,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, c sBuffer.append(sValue); if(sValue.indexOf('.') != -1) // there is a dot { - for(sal_Int32 i=sValue.copy(sValue.indexOf('.')+1).getLength(); i<scale;i++) + for(sal_Int32 i=sValue.subView(sValue.indexOf('.')+1).size(); i<scale;i++) { sBuffer.append('0'); } diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y index 18ee2e7cd43d..e0e9969ab68a 100644 --- a/connectivity/source/parse/sqlbison.y +++ b/connectivity/source/parse/sqlbison.y @@ -4809,12 +4809,11 @@ void OSQLParser::error(const char *fmt) sal_Int32 nPos2 = sStr.indexOf(sSQL_TOKEN,nPos1+1); if(nPos2 != -1) { - OUString sSecond = sStr.copy(nPos1+sSQL_TOKEN.getLength(),nPos2-nPos1-sSQL_TOKEN.getLength()); - sFirst += sSecond; - sFirst += sStr.copy(nPos2+sSQL_TOKEN.getLength()); + sFirst += sStr.subView(nPos1+sSQL_TOKEN.getLength(),nPos2-nPos1-sSQL_TOKEN.getLength()); + sFirst += sStr.subView(nPos2+sSQL_TOKEN.getLength()); } else - sFirst += sStr.copy(nPos1+sSQL_TOKEN.getLength()); + sFirst += sStr.subView(nPos1+sSQL_TOKEN.getLength()); m_sErrorMessage = sFirst; } |