summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-06-28 16:01:42 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-06-28 16:55:05 +0200
commit936298c38b6f7007097700e5862db00da89d0334 (patch)
treedf8db8005529b82fcdc421a3bf6d7ef7fccd9f00
parent3f04160dd2b528e9d34a22c047e5f84282f77565 (diff)
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 <sbergman@redhat.com>
-rw-r--r--vcl/source/uitest/uno/uiobject_uno.cxx8
-rw-r--r--vcl/source/uitest/uno/uiobject_uno.hxx3
2 files changed, 3 insertions, 8 deletions
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<std::mutex> lk(mMutex);
- mAction = rAction;
- mPropValues = rPropValues;
mReady = false;
auto aIdle = std::make_unique<Idle>();
aIdle->SetDebugName("UI Test Idle Handler");
aIdle->SetPriority(TaskPriority::HIGHEST);
- std::function<void()> func = [this](){
+ std::function<void()> 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<css::beans::PropertyValue> mPropValues;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */