summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-30 10:23:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-30 11:56:56 +0000
commit8ad0669955228b2da64ecce34ea71d761d066864 (patch)
tree78aac28383202d89d696bd429ea1b18bcb54bd20 /tools
parentf24d38de3c23479e79768cd3fcfe37692cee27e4 (diff)
loplugin:stringadd in test..tools
when applying my upcoming patch to also consider O[U]StringBuffer Change-Id: I8619fa3280338afdfe75bdbfda6cb118d396e1c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149749 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/fsys/urlobj.cxx44
-rw-r--r--tools/source/inet/inetmime.cxx18
2 files changed, 27 insertions, 35 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 417618acbc94..ca5a014ecc56 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -2062,15 +2062,13 @@ bool INetURLObject::convertAbsToRel(OUString const & rTheAbsURIRef,
// to the new relative URL:
if (aSubject.m_aQuery.isPresent())
{
- aSynRelURIRef.append('?');
- aSynRelURIRef.append(aSubject.decode(aSubject.m_aQuery,
- eDecodeMechanism, eCharset));
+ aSynRelURIRef.append("?"
+ + aSubject.decode(aSubject.m_aQuery, eDecodeMechanism, eCharset));
}
if (aSubject.m_aFragment.isPresent())
{
- aSynRelURIRef.append('#');
- aSynRelURIRef.append(aSubject.decode(aSubject.m_aFragment,
- eDecodeMechanism, eCharset));
+ aSynRelURIRef.append("#"
+ + aSubject.decode(aSubject.m_aFragment, eDecodeMechanism, eCharset));
}
rTheRelURIRef = aSynRelURIRef.makeStringAndClear();
@@ -3354,8 +3352,9 @@ bool INetURLObject::insertName(std::u16string_view rTheName,
}
OUStringBuffer aNewPath(256);
- aNewPath.append(pPathBegin, pPrefixEnd - pPathBegin);
- aNewPath.append('/');
+ aNewPath.append(
+ OUString::Concat(std::u16string_view(pPathBegin, pPrefixEnd - pPathBegin))
+ + "/");
encodeText(aNewPath, rTheName, PART_PCHAR,
eMechanism, eCharset, true);
if (bInsertSlash) {
@@ -3607,9 +3606,7 @@ INetURLObject::getAbbreviated(
OUStringBuffer aResult(aBuffer);
if (pSuffixEnd != pBegin)
aResult.append("...");
- aResult.append(aSegment);
- aResult.append(aTrailer);
- aResult.append(aRest);
+ aResult.append(aSegment + aTrailer + aRest);
if (rStringWidth->
queryStringWidth(aResult.makeStringAndClear())
<= nWidth)
@@ -3644,12 +3641,10 @@ INetURLObject::getAbbreviated(
eMechanism,
eCharset));
pPrefixBegin = p;
- OUStringBuffer aResult(aBuffer);
- aResult.append(aSegment);
+ OUStringBuffer aResult(aBuffer + aSegment);
if (pPrefixBegin != pEnd)
aResult.append("...");
- aResult.append(aTrailer);
- aResult.append(aRest);
+ aResult.append(aTrailer + aRest);
if (rStringWidth->
queryStringWidth(aResult.makeStringAndClear())
<= nWidth)
@@ -3681,13 +3676,11 @@ INetURLObject::getAbbreviated(
eCharset));
if (m_aQuery.isPresent())
{
- aBuffer.append('?');
- aBuffer.append(decode(m_aQuery, eMechanism, eCharset));
+ aBuffer.append("?" + decode(m_aQuery, eMechanism, eCharset));
}
if (m_aFragment.isPresent())
{
- aBuffer.append('#');
- aBuffer.append(decode(m_aFragment, eMechanism, eCharset));
+ aBuffer.append("#" + decode(m_aFragment, eMechanism, eCharset));
}
if (!aBuffer.isEmpty())
{
@@ -3980,8 +3973,7 @@ OUString INetURLObject::GetHostPort(DecodeMechanism eMechanism,
OUStringBuffer aHostPort(decode(m_aHost, eMechanism, eCharset));
if (m_aPort.isPresent())
{
- aHostPort.append(':');
- aHostPort.append(decode(m_aPort, eMechanism, eCharset));
+ aHostPort.append(":" + decode(m_aPort, eMechanism, eCharset));
}
return aHostPort.makeStringAndClear();
}
@@ -4362,8 +4354,7 @@ OUString INetURLObject::getFSysPath(FSysStyle eStyle,
if (pDelimiter)
*pDelimiter = '/';
- OUStringBuffer aSynFSysPath;
- aSynFSysPath.append("//");
+ OUStringBuffer aSynFSysPath("//");
if (m_aHost.isPresent() && m_aHost.getLength() > 0)
aSynFSysPath.append(decode(m_aHost, DecodeMechanism::WithCharset,
RTL_TEXTENCODING_UTF8));
@@ -4393,10 +4384,9 @@ OUString INetURLObject::getFSysPath(FSysStyle eStyle,
OUStringBuffer aSynFSysPath(64);
if (m_aHost.isPresent() && m_aHost.getLength() > 0)
{
- aSynFSysPath.append("\\\\");
- aSynFSysPath.append(decode(m_aHost, DecodeMechanism::WithCharset,
- RTL_TEXTENCODING_UTF8));
- aSynFSysPath.append('\\');
+ aSynFSysPath.append("\\\\"
+ + decode(m_aHost, DecodeMechanism::WithCharset, RTL_TEXTENCODING_UTF8)
+ + "\\");
}
sal_Unicode const * p
= m_aAbsURIRef.getStr() + m_aPath.getBegin();
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index 1d4f05b0e9da..e6b725490e58 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -1270,10 +1270,11 @@ OUString INetMIME::decodeHeaderFieldBody(const OString& rBody)
bDone = true;
break;
}
- sText.append(rBody.subView(
- (pEncodedTextCopyBegin - pBegin),
- (q - 1 - pEncodedTextCopyBegin)));
- sText.append(char(nDigit1 << 4 | nDigit2));
+ sText.append(
+ rBody.subView(
+ (pEncodedTextCopyBegin - pBegin),
+ (q - 1 - pEncodedTextCopyBegin))
+ + OStringChar(char(nDigit1 << 4 | nDigit2)));
q += 2;
pEncodedTextCopyBegin = q;
break;
@@ -1290,10 +1291,11 @@ OUString INetMIME::decodeHeaderFieldBody(const OString& rBody)
break;
case '_':
- sText.append(rBody.subView(
- (pEncodedTextCopyBegin - pBegin),
- (q - 1 - pEncodedTextCopyBegin)));
- sText.append(' ');
+ sText.append(
+ rBody.subView(
+ (pEncodedTextCopyBegin - pBegin),
+ (q - 1 - pEncodedTextCopyBegin))
+ + OString::Concat(" "));
pEncodedTextCopyBegin = q;
break;