diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-09-25 11:34:56 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-09-25 21:10:05 +0200 |
commit | ac0989b02fc6b8ff8fa7c985f8dcaf71547c489b (patch) | |
tree | d596a5517c569ce7c9dc7006b9ad07728ebf173b /vcl/source | |
parent | 92820328943623ef29a76cf7721a52bc7d051c90 (diff) |
tdf#130857 VclBuilder: Use existing VclBuilder::get
... instead of reimplementing the logic in
VclBuilder::set_response.
Change-Id: I634d918a356caddc79419b94dda7bd0657fa8c20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173929
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/builder.cxx | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 4b7d3148be9a..bcbdb3bd9f52 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -3934,20 +3934,12 @@ void VclBuilder::set_response(std::u16string_view sID, short nResponse) break; } - for (const auto & child : m_aChildren) - { - if (child.m_sID == sID) - { - PushButton* pPushButton = dynamic_cast<PushButton*>(child.m_pWindow.get()); - assert(pPushButton); - Dialog* pDialog = pPushButton->GetParentDialog(); - assert(pDialog); - pDialog->add_button(pPushButton, nResponse, false); - return; - } - } - - assert(false); + PushButton* pPushButton = get<PushButton>(sID); + assert(pPushButton); + Dialog* pDialog = pPushButton->GetParentDialog(); + assert(pDialog); + pDialog->add_button(pPushButton, nResponse, false); + return; } void VclBuilder::delete_by_name(const OUString& sID) |