diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-23 15:29:06 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-23 20:41:57 +0100 |
commit | ed796e0fcd47edcc1df2766a08aaf0cb85622bab (patch) | |
tree | 7567ef514b87145545e36ade93c209593da1d1ee /extensions/source/propctrlr | |
parent | a54ccd575ccfe82444e3ad26cb543622cbff9e22 (diff) |
Set unique buildable names to each widget in the form properties dialog
the dialog has many 'listbox' items and it is not possible to use
them in uitests if they have the same name
follow-up of d4ca173f2babde53c1d20f10e335244b092c5c97
Change-Id: I3342c0d930f3567219008fc6048c337a8af447af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111407
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Diffstat (limited to 'extensions/source/propctrlr')
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 1fd26057a110..ccd910553249 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -1108,8 +1108,6 @@ 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()); rtl::Reference<OFormattedNumericControl> pControl = new OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false); pControl->SetModifyHandler(); @@ -1149,8 +1147,6 @@ 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()); rtl::Reference<OFormattedNumericControl> pControl = new OFormattedNumericControl(std::move(pSpinButton), std::move(xBuilder), false); pControl->SetModifyHandler(); aDescriptor.Control = pControl; @@ -1212,7 +1208,6 @@ namespace pcr break; } - if ( eType == TypeClass_SEQUENCE ) nControlType = PropertyControlType::StringListField; @@ -1380,6 +1375,16 @@ namespace pcr if ( !aDescriptor.SecondaryButtonId.isEmpty() ) aDescriptor.HasSecondaryButton = true; + // for ui-testing try and distinguish different instances of the controls + auto xWindow = aDescriptor.Control->getControlWindow(); + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xWindow.get())) + { + weld::Widget* m_pControlWindow = pTunnel->getWidget(); + if (m_pControlWindow) + m_pControlWindow->set_buildable_name(m_pControlWindow->get_buildable_name() + "-" + aDescriptor.DisplayName.toUtf8()); + } + + bool bIsDataProperty = ( nPropertyUIFlags & PROP_FLAG_DATA_PROPERTY ) != 0; aDescriptor.Category = bIsDataProperty ? std::u16string_view(u"Data") : std::u16string_view(u"General"); return aDescriptor; |