diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-11-24 12:33:05 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-11-24 17:01:46 +0100 |
commit | d4ca173f2babde53c1d20f10e335244b092c5c97 (patch) | |
tree | 3050e4a14bbc827537ca6003b160a15488520784 /extensions/source | |
parent | 965f349952a90334c14a86ce1dd65711b73e8e85 (diff) |
add set_buildable_name to enable distinguishing different instances
of widgets loaded from the same .ui snippet in the same dialog so
ui-testing can identify the right one
Change-Id: I2ecc7fd60ab891ae9f94971a3035585d4500f694
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106500
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index a981f7dff30c..c0f3cea4e51d 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -1108,6 +1108,8 @@ namespace pcr { std::unique_ptr<weld::Builder> xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/formattedcontrol.ui", m_xContext)); auto pSpinButton = xBuilder->weld_formatted_spin_button("formattedcontrol"); + // for ui-testing try and distinguish different instances of this formatted control + pSpinButton->set_buildable_name(pSpinButton->get_buildable_name() + "-" + aDescriptor.DisplayName.toUtf8()); auto pControl = new OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false); pControl->SetModifyHandler(); @@ -1147,6 +1149,8 @@ namespace pcr { std::unique_ptr<weld::Builder> xBuilder(PropertyHandlerHelper::makeBuilder("modules/spropctrlr/ui/formattedcontrol.ui", m_xContext)); auto pSpinButton = xBuilder->weld_formatted_spin_button("formattedcontrol"); + // for ui-testing try and distinguish different instances of this formatted control + pSpinButton->set_buildable_name(pSpinButton->get_buildable_name() + "-" + aDescriptor.DisplayName.toUtf8()); auto pControl = new OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false); pControl->SetModifyHandler(); aDescriptor.Control = pControl; |