diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-10-11 10:23:28 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-10-11 12:46:01 +0200 |
commit | 3d236177be255b2027a997bfc12fe0833ca9a2f7 (patch) | |
tree | d67582e355bccb43cf133c1857f5dd6136be2f35 /shell/source | |
parent | 6c65c62c26a8aa4d04466545f8f04ec86b797012 (diff) |
Deduplicate O(U)StringConcatenation
And use an overloaded helper function with a better (?) unified name
to show that the result is not an O(U)String.
Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'shell/source')
-rw-r--r-- | shell/source/backends/desktopbe/desktopbackend.cxx | 2 | ||||
-rw-r--r-- | shell/source/win32/jumplist/JumpList.cxx | 46 |
2 files changed, 23 insertions, 25 deletions
diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx index c14c679a608a..b6f49e37ed24 100644 --- a/shell/source/backends/desktopbe/desktopbackend.cxx +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -201,7 +201,7 @@ OUString xdg_user_dir_lookup (const char *type, bool bAllowHomeDir) { aDocumentsDirURL = aUserDirBuf.makeStringAndClear(); if ( bAllowHomeDir || - (aDocumentsDirURL != aHomeDirURL && aDocumentsDirURL != OUStringConcatenation(aHomeDirURL + "/")) ) + (aDocumentsDirURL != aHomeDirURL && aDocumentsDirURL != Concat2View(aHomeDirURL + "/")) ) { osl::Directory aDocumentsDir( aDocumentsDirURL ); if( osl::FileBase::E_None == aDocumentsDir.open() ) diff --git a/shell/source/win32/jumplist/JumpList.cxx b/shell/source/win32/jumplist/JumpList.cxx index 06a62a11038d..114c6f4e95b5 100644 --- a/shell/source/win32/jumplist/JumpList.cxx +++ b/shell/source/win32/jumplist/JumpList.cxx @@ -201,21 +201,20 @@ void SAL_CALL JumpListImpl::appendCategory(const OUString& sCategory, PropVariantClear(&propvar); } - ThrowIfFailed(pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())), - OStringConcatenation("Setting description '" - + item.description.toUtf8() + "' failed.")); - ThrowIfFailed( - pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())), - OStringConcatenation("Setting path '" + sofficePath.toUtf8() + "' failed.")); + pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())), + Concat2View("Setting description '" + item.description.toUtf8() + "' failed.")); + + ThrowIfFailed(pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())), + Concat2View("Setting path '" + sofficePath.toUtf8() + "' failed.")); - ThrowIfFailed(pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())), - OStringConcatenation("Setting arguments '" + item.arguments.toUtf8() - + "' failed.")); + ThrowIfFailed( + pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())), + Concat2View("Setting arguments '" + item.arguments.toUtf8() + "' failed.")); - ThrowIfFailed(pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0), - OStringConcatenation("Setting icon path '" + item.iconPath.toUtf8() - + "' failed.")); + ThrowIfFailed( + pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0), + Concat2View("Setting icon path '" + item.iconPath.toUtf8() + "' failed.")); if (lcl_isItemInArray(pShellLinkItem, m_aRemoved)) { @@ -300,21 +299,20 @@ void SAL_CALL JumpListImpl::addTasks(const Sequence<JumpListItem>& aJumpListItem PropVariantClear(&propvar); } - ThrowIfFailed(pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())), - OStringConcatenation("Setting description '" - + item.description.toUtf8() + "' failed.")); - ThrowIfFailed( - pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())), - OStringConcatenation("Setting path '" + sofficePath.toUtf8() + "' failed.")); + pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())), + Concat2View("Setting description '" + item.description.toUtf8() + "' failed.")); + + ThrowIfFailed(pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())), + Concat2View("Setting path '" + sofficePath.toUtf8() + "' failed.")); - ThrowIfFailed(pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())), - OStringConcatenation("Setting arguments '" + item.arguments.toUtf8() - + "' failed.")); + ThrowIfFailed( + pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())), + Concat2View("Setting arguments '" + item.arguments.toUtf8() + "' failed.")); - ThrowIfFailed(pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0), - OStringConcatenation("Setting icon path '" + item.iconPath.toUtf8() - + "' failed.")); + ThrowIfFailed( + pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0), + Concat2View("Setting icon path '" + item.iconPath.toUtf8() + "' failed.")); aCollection->AddObject(pShellLinkItem); } |