diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-10-04 22:18:17 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-10-05 09:39:56 +0200 |
commit | b54ffcb1337fb76c8c29ce6145c914f80c7f95b5 (patch) | |
tree | e5be40799b1ac488f566eb768e81aafef828c2dc /include/vcl/widgetbuilder.hxx | |
parent | 9bf932c00ba1ee8a2554f1c3c4bbc7ebff8b1995 (diff) |
tdf#130857 VclBuilder: Extract setMnemonicWidget helper + call from base
Instead of iterating over the map of mnemonic widgets
in the VclBuilder ctor, split the logic:
Add a new purely virtual WidgetBuilder::setMnemonicWidget
method to the base class that passes the IDs of a single
pair of label + the corresponding mnemonic widget as params,
and let WidgetBuilder::processUIFile call the method
once for every pair in the map.
Implement that for VclBuilder (by moving the remaining
logic for that previously in the ctor) to the new
override VclBuilder::setMnemonicWidget and add a dummy
implementation for QtBuilder that only triggers a warning for now.
Change-Id: I32c922f91e5e1d06c003e6d26a4342cbb98942e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174509
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'include/vcl/widgetbuilder.hxx')
-rw-r--r-- | include/vcl/widgetbuilder.hxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/vcl/widgetbuilder.hxx b/include/vcl/widgetbuilder.hxx index 54d3d89c4d4f..b111b2d2041f 100644 --- a/include/vcl/widgetbuilder.hxx +++ b/include/vcl/widgetbuilder.hxx @@ -55,6 +55,12 @@ protected: assert(false && "missing ui file or missing gb_CppunitTest_use_uiconfigs dependency"); throw; } + + // Set Mnemonic widgets when everything has been imported + for (const MnemonicWidgetMap& rMnemonic : getMnemonicWidgetMaps()) + { + setMnemonicWidget(rMnemonic.m_sID, rMnemonic.m_sValue); + } } // either pParent or pAtkProps must be set, pParent for a child of a widget, pAtkProps for @@ -282,6 +288,7 @@ protected: std::string_view sInternalChild) = 0; + virtual void setMnemonicWidget(const OUString& rLabelId, const OUString& rMnemonicWidgetId) = 0; virtual void setPriority(Widget* pWidget, int nPriority) = 0; virtual void setContext(Widget* pWidget, std::vector<vcl::EnumContext::Context>&& aContext) = 0; |