[Libreoffice-commits] core.git: vcl/inc vcl/osx

Stephan Bergmann sbergman at redhat.com
Tue Jun 28 12:49:36 UTC 2016


 vcl/inc/osx/salmenu.h |    4 ++--
 vcl/osx/salmenu.cxx   |    1 -
 vcl/osx/salnsmenu.mm  |    2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit c63ae748b301db1f4996b43f6faf4bb317c37467
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 28 14:48:29 2016 +0200

    Adapt OS-X--only code to aa0d0536a444fb26d9e570bd6bf6c1bdc3596cf3
    
    ..."tdf#97527 - vcl: reference-count Menu"
    
    Change-Id: I47457205ae99025d2ca13965dcf2fac79962124a

diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index ad1b29e..f4407f3 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -88,7 +88,7 @@ public:
 
     bool                    mbMenuBar;          // true - Menubar, false - Menu
     NSMenu*                 mpMenu;             // The Carbon reference to this menu
-    Menu*                   mpVCLMenu;          // the corresponding vcl Menu object
+    VclPtr<Menu>            mpVCLMenu;          // the corresponding vcl Menu object
     const AquaSalFrame*     mpFrame;            // the frame to dispatch the menu events to
     AquaSalMenu*            mpParentSalMenu;    // the parent menu that contains us (and perhaps has a frame)
 
@@ -103,7 +103,7 @@ public:
     virtual ~AquaSalMenuItem();
 
     sal_uInt16          mnId;                 // Item ID
-    Menu*               mpVCLMenu;            // VCL Menu into which this MenuItem is inserted
+    VclPtr<Menu>        mpVCLMenu;            // VCL Menu into which this MenuItem is inserted
     AquaSalMenu*        mpParentMenu;         // The menu in which this menu item is inserted
     AquaSalMenu*        mpSubMenu;            // Sub menu of this item (if defined)
     NSMenuItem*         mpMenuItem;           // The NSMenuItem
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index b9d8e69..3c2a476 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -257,7 +257,6 @@ void AquaSalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem )
 AquaSalMenu::AquaSalMenu( bool bMenuBar ) :
     mbMenuBar( bMenuBar ),
     mpMenu( nil ),
-    mpVCLMenu( nullptr ),
     mpFrame( nullptr ),
     mpParentSalMenu( nullptr )
 {
diff --git a/vcl/osx/salnsmenu.mm b/vcl/osx/salnsmenu.mm
index b30792d..cd22b78 100644
--- a/vcl/osx/salnsmenu.mm
+++ b/vcl/osx/salnsmenu.mm
@@ -125,7 +125,7 @@
         // if an item from submenu was selected. the corresponding Window does not exist because
         // we use native popup menus, so we have to set the selected menuitem directly
         // incidentally this of course works for top level popup menus, too
-        PopupMenu * pPopupMenu = dynamic_cast<PopupMenu *>(mpMenuItem->mpVCLMenu);
+        PopupMenu * pPopupMenu = dynamic_cast<PopupMenu *>(mpMenuItem->mpVCLMenu.get());
         if( pPopupMenu )
         {
             // FIXME: revise this ugly code


More information about the Libreoffice-commits mailing list