[Libreoffice-commits] core.git: 3 commits - framework/source vcl/source vcl/unx
Maxim Monastirsky
momonasmon at gmail.com
Tue Oct 18 14:29:50 UTC 2016
framework/source/uielement/resourcemenucontroller.cxx | 3 +++
vcl/source/window/menu.cxx | 5 +++++
vcl/unx/gtk/gtksalmenu.cxx | 5 +++++
3 files changed, 13 insertions(+)
New commits:
commit 0eebe7387fd88aaef12fc3e303ed477d0aea6066
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Tue Oct 18 17:24:24 2016 +0300
Don't crash on closing gtk3 popup menu without enabled items
This thing:
GtkSalMenu::ShowNativePopupMenu
Menu::Deactivate
MenuItemList::Remove
GtkInstance::DestroyMenuItem
deletes the SalMenuItem, leaving GtkSalMenu with invalid
pointers.
Change-Id: I22ff10fc62421a800d808a56625ce7144c8e04b4
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index bb2f60d..7af1ad3 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -239,7 +239,12 @@ void Menu::Deactivate()
{
MenuItemData* pData = pItemList->GetDataFromPos( --n );
if ( pData->bIsTemporary )
+ {
+ if ( ImplGetSalMenu() )
+ ImplGetSalMenu()->RemoveItem( n );
+
pItemList->Remove( n );
+ }
}
bInCallback = true;
commit b088d89d00cd0716a50219f4eef4da080393fd63
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Tue Oct 18 14:17:57 2016 +0300
Skip the placeholder added by PopupMenu::ImplExecute
Change-Id: I7766a63aff240141342db8b4a9236f5930236b13
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 94931cf..2d32168 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -253,6 +253,11 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries)
GtkSalMenuItem *pSalMenuItem = GetItemAtPos( nItem );
sal_uInt16 nId = pSalMenuItem->mnId;
+ // PopupMenu::ImplExecute might add <No Selection Possible> entry to top-level
+ // popup menu, but we have our own implementation below, so skip that one.
+ if ( nId == 0xFFFF )
+ continue;
+
if ( pSalMenuItem->mnType == MenuItemType::SEPARATOR )
{
// Delete extra items from current section.
commit 1cb46e27475d5b026de0e5aafb339ca16a26822c
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Tue Oct 18 11:20:10 2016 +0300
Avoid warning when opening the save dropdown
Change-Id: I92980d8d9326b8c0ed865d2ce796dccb7729e3e7
diff --git a/framework/source/uielement/resourcemenucontroller.cxx b/framework/source/uielement/resourcemenucontroller.cxx
index 02011c7..12d3d09 100644
--- a/framework/source/uielement/resourcemenucontroller.cxx
+++ b/framework/source/uielement/resourcemenucontroller.cxx
@@ -85,6 +85,9 @@ ResourceMenuController::ResourceMenuController( const css::uno::Reference< css::
{
OUString aMenuName;
aPropValue.Value >>= aMenuName;
+ if ( aMenuName.isEmpty() )
+ continue;
+
if ( m_bToolbarContainer )
m_aMenuURL = "private:resource/toolbar/" + aMenuName;
else
More information about the Libreoffice-commits
mailing list