From 7e3d93fd5776244e9028ff4fb3b551222b49cd87 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sun, 10 Apr 2022 09:54:26 +0200 Subject: 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 --- shell/source/win32/jumplist/JumpList.cxx | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'shell/source/win32') 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 { Reference m_xContext; public: explicit JumpListImpl(const Reference& xContext); - ~JumpListImpl(); // XJumpList virtual void SAL_CALL appendCategory(const OUString& sCategory, @@ -73,10 +74,6 @@ JumpListImpl::JumpListImpl(const Reference& 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 pShellLinkItem, COMReference poaRemoved) @@ -155,7 +152,7 @@ void SAL_CALL JumpListImpl::appendCategory(const OUString& sCategory, COMReference 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)) { -- cgit