diff options
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/dbtools2.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Clob.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/PreparedStatement.cxx | 9 |
3 files changed, 16 insertions, 6 deletions
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index b8643e642efd..9134f02df358 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -47,6 +47,7 @@ #include <tools/diagnose_ex.h> #include <unotools/sharedunocomponent.hxx> #include <algorithm> +#include <string_view> namespace dbtools { @@ -132,7 +133,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const } else { - aSql.appendCopy(sTypeName, 0, ++nParenPos); + aSql.append(std::u16string_view(sTypeName).substr(0, ++nParenPos)); } if ( nPrecision > 0 && nDataType != DataType::TIMESTAMP ) @@ -149,7 +150,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const else { nParenPos = sTypeName.indexOf(')',nParenPos); - aSql.appendCopy(sTypeName, nParenPos); + aSql.append(std::u16string_view(sTypeName).substr(nParenPos)); } } else diff --git a/connectivity/source/drivers/firebird/Clob.cxx b/connectivity/source/drivers/firebird/Clob.cxx index 2d150da912f1..6fb7092457d7 100644 --- a/connectivity/source/drivers/firebird/Clob.cxx +++ b/connectivity/source/drivers/firebird/Clob.cxx @@ -7,6 +7,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <sal/config.h> + +#include <string_view> + #include "Clob.hxx" #include "Blob.hxx" #include "Connection.hxx" @@ -99,7 +103,7 @@ OUString SAL_CALL Clob::getSubString(sal_Int64 nPosition, if( nCharsToCopy > nLength ) nCharsToCopy = nLength; // append relevant part of first segment - sSegmentBuffer.appendCopy( sSegment, 0, nCharsToCopy ); + sSegmentBuffer.append( std::u16string_view(sSegment).substr(0, nCharsToCopy) ); nActLen += sSegmentBuffer.getLength(); } } @@ -115,7 +119,7 @@ OUString SAL_CALL Clob::getSubString(sal_Int64 nPosition, RTL_TEXTENCODING_UTF8 ); sal_Int32 nStrLen = sSegment.getLength(); if( nActLen + nStrLen > nLength ) - sSegmentBuffer.appendCopy(sSegment, 0, nLength - nActLen); + sSegmentBuffer.append(std::u16string_view(sSegment).substr(0, nLength - nActLen)); else sSegmentBuffer.append(sSegment); nActLen += nStrLen; diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index 648f3f678ff4..cf44aa4d238d 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -16,6 +16,11 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + +#include <sal/config.h> + +#include <string_view> + #include "Connection.hxx" #include "PreparedStatement.hxx" #include "ResultSet.hxx" @@ -333,9 +338,9 @@ sal_Int64 toNumericWithoutDecimalPlace(const OUString& sSource) OUStringBuffer sBuffer(15); if(nDotIndex > 0) { - sBuffer.appendCopy(sNumber, 0, nDotIndex); + sBuffer.append(std::u16string_view(sNumber).substr(0, nDotIndex)); } - sBuffer.appendCopy(sNumber, nDotIndex + 1); + sBuffer.append(std::u16string_view(sNumber).substr(nDotIndex + 1)); return sBuffer.makeStringAndClear().toInt64(); } } |