diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-11-10 20:35:08 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-11-11 01:50:22 +0100 |
commit | c88cd599d445b3d5ee3c867a14ea14c67d18e9e9 (patch) | |
tree | 43918204c4abdf2062041ea23461c414b5a85989 /vcl/source/window/builder.cxx | |
parent | 3bdcd536db4356d769e84237139710b399968924 (diff) |
VClBuilder: Avoid casting by using PopupMenu directly
Now that GtkMenuBar support was dropped in
Change-Id: I550c83c6d5d13a5e45dc9332e981bae8b0f0a9a3
commit fa245e4eea218b3c707998e597c526b9d1fdb508
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Sun Nov 10 20:24:11 2024 +0100
tdf#130857 VclBuilder: Drop unused "GtkMenuBar" support
, use PopupMenu directly in MenuAndId instead of just the
Menu base class, which makes it unnecessary to cast when
a PopupMenu is wanted.
Change-Id: I51a44f219970f29a12aa15ee58e8512c62fca43e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176358
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source/window/builder.cxx')
-rw-r--r-- | vcl/source/window/builder.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index d7d293fe7cb7..f90efaf34772 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -3013,7 +3013,7 @@ std::vector<ComboBoxTextItem> BuilderBase::handleItems(xmlreader::XmlReader& rea void VclBuilder::handleMenu(xmlreader::XmlReader& reader, const OUString& rID) { - VclPtr<Menu> pCurrentMenu = VclPtr<PopupMenu>::Create(); + VclPtr<PopupMenu> pCurrentMenu = VclPtr<PopupMenu>::Create(); pCurrentMenu->set_id(rID); int nLevel = 1; @@ -3147,7 +3147,7 @@ void VclBuilder::handleMenuObject(Menu *pParent, xmlreader::XmlReader &reader) handleChild(nullptr, &aAtkProperties, reader); bool bSubMenuInserted = m_aMenus.size() > nChildMenuIdx; if (bSubMenuInserted) - pSubMenu = dynamic_cast<PopupMenu*>(m_aMenus[nChildMenuIdx].m_pMenu.get()); + pSubMenu = m_aMenus[nChildMenuIdx].m_pMenu.get(); } else { @@ -3871,7 +3871,7 @@ PopupMenu *VclBuilder::get_menu(std::u16string_view sID) for (auto const& menu : m_aMenus) { if (menu.m_sID == sID) - return dynamic_cast<PopupMenu*>(menu.m_pMenu.get()); + return menu.m_pMenu.get(); } return nullptr; @@ -4195,7 +4195,7 @@ VclBuilder::VclParserState::VclParserState() , m_nLastMenuItemId(0) {} -VclBuilder::MenuAndId::MenuAndId(OUString aId, Menu *pMenu) +VclBuilder::MenuAndId::MenuAndId(OUString aId, PopupMenu *pMenu) : m_sID(std::move(aId)) , m_pMenu(pMenu) {} |