summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-01-11 11:21:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-11 13:55:14 +0100
commit70519a43e0d89a6b5d89859a6851f8c757c6b0c7 (patch)
treebc1f4a6b6510e3bff75e9dc54eb71e2fa6cfc3c8 /connectivity
parenta0210c5c5e8fd47b55567a8b18788d57d2b7decb (diff)
Replace OUStringBuffer::appendCopy with append(std::u16string_view)
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/dbtools2.cxx5
-rw-r--r--connectivity/source/drivers/firebird/Clob.cxx8
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx9
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();
}
}