This is useful for some complex controls (e.g. Combobox).
Regression of cb4177b5f6d2c63548fa544a19b36001c57193e4
Change-Id: I683cc20e9db72a4dd58d89063ec6bfcd05a1068e
This may sound crazy, but literally vcl::FontInfo serves no purpose
that I can see. The inheritance chain is like this:
┌────────────────────────┐
│ │
│ vcl::Font │
│ │
└────────────────────────┘
^
╱ ╲
│
│
┌────────────────────────┐
│ │
│ vcl::FontInfo │
│ │
└────────────────────────┘
^
╱ ╲
│
│
┌────────────────────────┐
│ │
│ FontMetric │
│ │
└────────────────────────┘
vcl::FontInfo (which, incidentally, needs to be put into the vcl
namespace due to collisions with poppler!) literally does nothing
and is acting as a bridge between FontMetric and vcl::Font. Unlike
a bridge though, this bridge doesn't actually *do* anything.
So I'm removing it, which means one less class to deal with in the
vcl fonts world.
Change-Id: I32725669c9bca7fbb0846b6a062135464046e4f6
Reviewed-on: https://gerrit.libreoffice.org/21058
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Changes in this commit:
- AlwaysAllowSave config is gone. Saving is always permitted, unless in
a read only document. Also changed the behavior in dbaccess to match
sfx2.
- The toolbar save button is always enabled, to always give access to
the dropdown. That's the case even in a read only document, except
that it changes to DROPDOWNONLY, and the save as command icon+tooltip.
In table/query designers we still disable the button in read only state.
- When the document is modified, the toolbar button gets a special icon
to indicate that.
TODO:
- Icons for the document modified state are still missing. I added some
fake links to Tango's links.txt in order to test the new behavior.
These links shouldn't stay as-is in a production version!
Change-Id: I56c169bf48b78faaf53c2989ce8624f8297ffb6e
Reviewed-on: https://gerrit.libreoffice.org/20839
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
Using internally MenuBarManager to manage this kind of menus.
Implemented as a popup menu controller to be able to use in
menubar/toolbar, not only as a context menu.
Change-Id: I46719d66c569db83edd04faf977e0b2b3df0c5fa
...even if no correpsonding xPopupMenu proxy has been set up for some i (because
that sub-menu has never been opened by the user). Otherwise, the Menu that
m_pVCLMenu->pItemList->maItemList[i]->m_pSubMenu points to will be deleted
(during a recursive xSubMenuManager->dispose call), and when later for some
sub-menu j > i that /has/ been opened by the user SetPopupMenu is called, that
can lead to
> Menu::GetPopupMenu(unsigned short) const at vcl/source/window/menu.cxx:835
> Menu::GetAccessible() at vcl/source/window/menu.cxx:1400
> OAccessibleMenuItemComponent::getAccessibleParent() at accessibility/source/standard/accessiblemenuitemcomponent.cxx:339
> non-virtual thunk to OAccessibleMenuItemComponent::getAccessibleParent() at accessibility/source/standard/accessiblemenuitemcomponent.cxx:335
> atk_object_wrapper_new(com::sun:⭐:uno::Reference<com::sun:⭐:accessibility::XAccessible> const&, AtkObject*) at vcl/unx/gtk3/a11y/../../gtk/a11y/atkwrapper.cxx:839
> atk_object_wrapper_ref(com::sun:⭐:uno::Reference<com::sun:⭐:accessibility::XAccessible> const&, bool) at vcl/unx/gtk3/a11y/../../gtk/a11y/atkwrapper.cxx:795
> AtkListener::handleChildAdded(com::sun:⭐:uno::Reference<com::sun:⭐:accessibility::XAccessibleContext> const&, com::sun:⭐:uno::Reference<com::sun:⭐:accessibility::XAccessible> const&) at vcl/unx/gtk3/a11y/../../gtk/a11y/atklistener.cxx:157
> AtkListener::notifyEvent(com::sun:⭐:accessibility::AccessibleEventObject const&) at vcl/unx/gtk3/a11y/../../gtk/a11y/atklistener.cxx:296
> comphelper::AccessibleEventNotifier::addEvent(unsigned int, com::sun:⭐:accessibility::AccessibleEventObject const&) at comphelper/source/misc/accessibleeventnotifier.cxx:281
> comphelper::OAccessibleContextHelper::NotifyAccessibleEvent(short, com::sun:⭐:uno::Any const&, com::sun:⭐:uno::Any const&) at comphelper/source/misc/accessiblecontexthelper.cxx:188
> OAccessibleMenuBaseComponent::InsertChild(int) at accessibility/source/standard/accessiblemenubasecomponent.cxx:436
> OAccessibleMenuBaseComponent::ProcessMenuEvent(VclMenuEvent const&) at accessibility/source/standard/accessiblemenubasecomponent.cxx:624
> OAccessibleMenuBaseComponent::MenuEventListener(VclMenuEvent&) at accessibility/source/standard/accessiblemenubasecomponent.cxx:572
> OAccessibleMenuBaseComponent::LinkStubMenuEventListener(void*, VclMenuEvent&) at accessibility/source/standard/accessiblemenubasecomponent.cxx:569
> Link<VclMenuEvent&, void>::Call(VclMenuEvent&) const at include/tools/link.hxx:84
> Menu::ImplCallEventListeners(unsigned long, unsigned short) at vcl/source/window/menu.cxx:355
> Menu::SetPopupMenu(unsigned short, PopupMenu*) at vcl/source/window/menu.cxx:825
> framework::MenuBarManager::RemoveListener() at framework/source/uielement/menubarmanager.cxx:556
looking at the dangling pSubMenu pointer (and even if the dangling pointer is
never dereferenced, UBSan will try to determine whether the static_cast in
return static_cast<PopupMenu*>(pData->pSubMenu);
in Menu::GetPopupMenu, vcl/source/window/menu.cxx, is fine and cause a crash).
Change-Id: I5e5f6dba266580e3c2e7693877ea79a07d80bb74
- The method to fill the menu shouldn't override impl_setPopupMenu
from the base class, because we can't fill the menu before getting
some data through status updates.
- Use vcl::CommandInfoProvider to get menu labels.
Change-Id: Ieeeafb81921bc4786256aae4e26d87c6106e63da