From 936298c38b6f7007097700e5862db00da89d0334 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 28 Jun 2021 16:01:42 +0200 Subject: No need for these function arguments to be captured in UIObjectUnoObj The lambda that uses them will never outlive the invocation of UIObjectUnoObj::executeAction. Change-Id: Icc5098a99389f7c70b69ca790acb4709f55b4dad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118025 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- vcl/source/uitest/uno/uiobject_uno.cxx | 8 +++----- vcl/source/uitest/uno/uiobject_uno.hxx | 3 --- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'vcl/source/uitest/uno') diff --git a/vcl/source/uitest/uno/uiobject_uno.cxx b/vcl/source/uitest/uno/uiobject_uno.cxx index 14a50f08c7b7..fe7a3d9901d7 100644 --- a/vcl/source/uitest/uno/uiobject_uno.cxx +++ b/vcl/source/uitest/uno/uiobject_uno.cxx @@ -106,18 +106,16 @@ void SAL_CALL UIObjectUnoObj::executeAction(const OUString& rAction, const css:: throw css::uno::RuntimeException(); std::unique_lock lk(mMutex); - mAction = rAction; - mPropValues = rPropValues; mReady = false; auto aIdle = std::make_unique(); aIdle->SetDebugName("UI Test Idle Handler"); aIdle->SetPriority(TaskPriority::HIGHEST); - std::function func = [this](){ + std::function func = [&rAction, &rPropValues, this](){ SolarMutexGuard aGuard; StringMap aMap; - for (const auto& rPropVal : std::as_const(mPropValues)) + for (const auto& rPropVal : rPropValues) { OUString aVal; if (!(rPropVal.Value >>= aVal)) @@ -125,7 +123,7 @@ void SAL_CALL UIObjectUnoObj::executeAction(const OUString& rAction, const css:: aMap[rPropVal.Name] = aVal; } - mpObj->execute(mAction, aMap); + mpObj->execute(rAction, aMap); }; ExecuteWrapper* pWrapper = new ExecuteWrapper(func, LINK(this, UIObjectUnoObj, NotifyHdl)); diff --git a/vcl/source/uitest/uno/uiobject_uno.hxx b/vcl/source/uitest/uno/uiobject_uno.hxx index f2e6d3e2b786..a9f2a294d9e3 100644 --- a/vcl/source/uitest/uno/uiobject_uno.hxx +++ b/vcl/source/uitest/uno/uiobject_uno.hxx @@ -63,9 +63,6 @@ private: std::condition_variable cv; std::mutex mMutex; bool mReady; - - OUString mAction; - css::uno::Sequence mPropValues; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit