From ec1c4c49301758c54394f9943252e192ad54638b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 22 Nov 2021 14:08:27 +0200 Subject: O[U]String::replaceAt overloads that take string_view which results in lots of nice string_view improvements picked up by the plugins Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657 Tested-by: Jenkins Reviewed-by: Noel Grandin --- connectivity/source/commontools/DateConversion.cxx | 2 +- connectivity/source/commontools/dbtools2.cxx | 4 ++-- connectivity/source/commontools/predicateinput.cxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'connectivity/source/commontools') diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index 81338b3dc9fa..38f20af0926c 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -90,7 +90,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, nIndex += 2; nIndex = aTemp.indexOf(sQuot,nIndex); if(nIndex != -1) - aTemp = aTemp.replaceAt(nIndex,sQuot.getLength(), "\'\'"); + aTemp = aTemp.replaceAt(nIndex,sQuot.getLength(), u"\'\'"); } while (nIndex != -1); aRet.append(aTemp); diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 0adfe23bdac9..5f07a272cec2 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -122,7 +122,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const { sal_Int32 nIndex = sTypeName.indexOf(sAutoIncrementValue); if (nIndex != -1) - sTypeName = sTypeName.replaceAt(nIndex,sTypeName.getLength() - nIndex,OUString()); + sTypeName = sTypeName.replaceAt(nIndex,sTypeName.getLength() - nIndex, u""); } if ( (nPrecision > 0 || nScale > 0) && bUseLiteral ) @@ -387,7 +387,7 @@ OUString createSqlCreateTableStatement( const Reference< XPropertySet >& descri else { if ( aSql.endsWith(",") ) - aSql = aSql.replaceAt(aSql.getLength()-1, 1, ")"); + aSql = aSql.replaceAt(aSql.getLength()-1, 1, u")"); else aSql += ")"; } diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index 37a0d6862c62..047f9ccc7c94 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -153,7 +153,7 @@ namespace dbtools sal_Int32 nTemp = 0; while ( -1 != ( nIndex = sQuoted.indexOf( '\'',nTemp ) ) ) { - sQuoted = sQuoted.replaceAt( nIndex, 1, "''" ); + sQuoted = sQuoted.replaceAt( nIndex, 1, u"''" ); nTemp = nIndex+2; } -- cgit