shell/source/win32/jumplist/JumpList.cxx | 32 ++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-)
New commits: commit 7e3d93fd5776244e9028ff4fb3b551222b49cd87 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Sun Apr 10 09:54:26 2022 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Sun Apr 10 10:54:32 2022 +0200 Various loplugin warnings (in new Windows-only code) Change-Id: I78863816c9ad520e0fc4919aeaa2e25ff768d451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/shell/source/win32/jumplist/JumpList.cxx b/shell/source/win32/jumplist/JumpList.cxx index a8770840d38e..f5d8ca8532cd 100644 --- a/shell/source/win32/jumplist/JumpList.cxx +++ b/shell/source/win32/jumplist/JumpList.cxx @@ -46,13 +46,14 @@ using namespace css::system::windows; using namespace osl; using namespace sal::systools; +namespace +{ class JumpListImpl : public BaseMutex, public WeakComponentImplHelper<XJumpList, XServiceInfo> { Reference<XComponentContext> m_xContext; public: explicit JumpListImpl(const Reference<XComponentContext>& xContext); - ~JumpListImpl(); // XJumpList virtual void SAL_CALL appendCategory(const OUString& sCategory, @@ -73,10 +74,6 @@ JumpListImpl::JumpListImpl(const Reference<XComponentContext>& xContext) { } -JumpListImpl::~JumpListImpl() {} - -namespace -{ // Determines if the provided IShellLinkItem is listed in the array of items that the user has removed bool lcl_isItemInArray(COMReference<IShellLinkW> pShellLinkItem, COMReference<IObjectArray> poaRemoved) @@ -155,7 +152,7 @@ void SAL_CALL JumpListImpl::appendCategory(const OUString& sCategory, COMReference<IObjectCollection> aCollection(CLSID_EnumerableObjectCollection, nullptr, CLSCTX_INPROC_SERVER); - for (auto item : aJumpListItems) + for (auto const& item : aJumpListItems) { if (item.name.isEmpty()) continue; @@ -178,20 +175,21 @@ void SAL_CALL JumpListImpl::appendCategory(const OUString& sCategory, PropVariantClear(&propvar); } - ThrowIfFailed( - pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())), - OString("Setting description '" + item.description.toUtf8() + "' failed.")); - - ThrowIfFailed(pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())), - OString("Setting path '" + sofficePath.toUtf8() + "' failed.")); + ThrowIfFailed(pShellLinkItem->SetDescription(o3tl::toW(item.description.getStr())), + OStringConcatenation("Setting description '" + + item.description.toUtf8() + "' failed.")); ThrowIfFailed( - pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())), - OString("Setting arguments '" + item.arguments.toUtf8() + "' failed.")); + pShellLinkItem->SetPath(o3tl::toW(sofficePath.getStr())), + OStringConcatenation("Setting path '" + sofficePath.toUtf8() + "' failed.")); - ThrowIfFailed( - pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0), - OString("Setting icon path '" + item.iconPath.toUtf8() + "' failed.")); + ThrowIfFailed(pShellLinkItem->SetArguments(o3tl::toW(item.arguments.getStr())), + OStringConcatenation("Setting arguments '" + item.arguments.toUtf8() + + "' failed.")); + + ThrowIfFailed(pShellLinkItem->SetIconLocation(o3tl::toW(item.iconPath.getStr()), 0), + OStringConcatenation("Setting icon path '" + item.iconPath.toUtf8() + + "' failed.")); if (lcl_isItemInArray(pShellLinkItem, removed)) {