diff -ur ooo_SRC680_m179_src.orig/vcl/aqua/inc/aquavcltypes.h ooo_SRC680_m179_src/vcl/aqua/inc/aquavcltypes.h
--- ooo_SRC680_m179_src.orig/vcl/aqua/inc/aquavcltypes.h	2006-07-29 12:32:44.000000000 +0200
+++ ooo_SRC680_m179_src/vcl/aqua/inc/aquavcltypes.h	2006-07-29 16:42:34.000000000 +0200
@@ -8,4 +8,8 @@
 typedef WindowRef CarbonWindowRef;
 typedef ControlRef CarbonViewRef;
 
+// Constants for menu property back pointers passing
+#define APP_PROPERTY_CREATOR 'OOo2'
+#define APP_PROPERTY_TAG_MENU_POINTER 'mptr'
+
 #endif _AQUAVCLTYPES_H
diff -ur ooo_SRC680_m179_src.orig/vcl/aqua/source/window/salframe.cxx ooo_SRC680_m179_src/vcl/aqua/source/window/salframe.cxx
--- ooo_SRC680_m179_src.orig/vcl/aqua/source/window/salframe.cxx	2006-07-29 12:32:44.000000000 +0200
+++ ooo_SRC680_m179_src/vcl/aqua/source/window/salframe.cxx	2006-07-29 16:39:58.000000000 +0200
@@ -753,14 +753,14 @@
       if (commandStruct.commandID == kHICommandQuit)
 	fprintf(stderr, "PJ: Quit from application menu received!\n");
 
-      UInt32 pointer;
-      GetMenuItemRefCon (commandStruct.menu.menuRef,
-			 commandStruct.menu.menuItemIndex,
-			 &pointer);
-
-      if (pointer) {
-	SalMenuItem *pSalMenuItem = (SalMenuItem *) pointer;
-	fprintf(stderr, "PJ: SalMenuItem = %p\n", pSalMenuItem);
+      SalMenuItem *pSalMenuItem;
+
+      GetMenuItemProperty (commandStruct.menu.menuRef, commandStruct.menu.menuItemIndex,
+			   APP_PROPERTY_CREATOR, APP_PROPERTY_TAG_MENU_POINTER,
+			   sizeof(pSalMenuItem), NULL, &pSalMenuItem);
+
+      if (pSalMenuItem) {
+	fprintf(stderr, "PJ: pSalMenuItem = %p\n", pSalMenuItem);
 	fprintf(stderr, "PJ: mnId = %p\n", ((AquaSalMenuItem *)pSalMenuItem)->mnId);
 
 	// Posting native menu event...
@@ -791,16 +791,19 @@
     GetEventParameter (inEvent, kEventParamDirectObject, typeMenuRef, NULL, sizeof(typeMenuRef), NULL, &pMenuRef);
     fprintf(stderr, "PJ: MenuRef = %p\n", pMenuRef);
 
-    UInt32 pointer;
-    GetMenuItemRefCon (pMenuRef, 0, &pointer);
-    SalMenu *pSalMenu = (SalMenu *) pointer;
+    SalMenu *pSalMenu;
+    GetMenuItemProperty (pMenuRef, 0,
+			 APP_PROPERTY_CREATOR, APP_PROPERTY_TAG_MENU_POINTER,
+			 sizeof(pSalMenu), NULL, &pSalMenu);
     fprintf(stderr, "PJ: SalMenu = %p\n", pSalMenu);
 
-    // Posting native menu event...
-    SalMenuEvent aMenuEvt;
-    aMenuEvt.mpMenu = pSalMenu;
-    // FIXME: This does not propagate to the application yet. WHY?
-    // pSalFrame->CallCallback(SALEVENT_MENUACTIVATE, &aMenuEvt);
+    if (pSalMenu) {
+      // Posting native menu event...
+      SalMenuEvent aMenuEvt;
+      aMenuEvt.mpMenu = pSalMenu;
+      // FIXME: This does not propagate to the application yet. WHY?
+      // pSalFrame->CallCallback(SALEVENT_MENUACTIVATE, &aMenuEvt);
+    }
 
     ImplSalYieldMutexRelease();
 
@@ -820,16 +823,21 @@
     GetEventParameter (inEvent, kEventParamDirectObject, typeMenuRef, NULL, sizeof(typeMenuRef), NULL, &pMenuRef);
     fprintf(stderr, "PJ: MenuRef = %p\n", pMenuRef);
 
-    UInt32 pointer;
-    GetMenuItemRefCon (pMenuRef, 0, &pointer);
-    SalMenu *pSalMenu = (SalMenu *) pointer;
+
+    SalMenu *pSalMenu;
+    GetMenuItemProperty (pMenuRef, 0,
+			 APP_PROPERTY_CREATOR, APP_PROPERTY_TAG_MENU_POINTER,
+			 sizeof(pSalMenu), NULL, &pSalMenu);
+
     fprintf(stderr, "PJ: SalMenu = %p\n", pSalMenu);
 
-    // Posting native menu event...
-    SalMenuEvent aMenuEvt;
-    aMenuEvt.mpMenu = pSalMenu;
-    // FIXME: This does not propagate to the application yet. WHY?
-    // pSalFrame->CallCallback(SALEVENT_MENUDEACTIVATE, &aMenuEvt);
+    if (pSalMenu) {
+      // Posting native menu event...
+      SalMenuEvent aMenuEvt;
+      aMenuEvt.mpMenu = pSalMenu;
+      // FIXME: This does not propagate to the application yet. WHY?
+      // pSalFrame->CallCallback(SALEVENT_MENUDEACTIVATE, &aMenuEvt);
+    }
 
     ImplSalYieldMutexRelease();
 
@@ -854,17 +862,19 @@
     fprintf(stderr, "PJ: MenuItemIndex = %p\n", mnMenuItemIndex);
 
     // kEventMenutargetItem is sent also for top-level items. Ignore
-    // them (MenuItemIndex == 0 for them).
+    // them (MenuItemIndex == 0 for them). Or should we send
+    // MENUACTIVATE events for them?
     if (mnMenuItemIndex != 0) {
-      UInt32 pointer;
-      GetMenuItemRefCon (pMenuRef, mnMenuItemIndex, &pointer);
+      SalMenuItem *pSalMenuItem;
+
+      GetMenuItemProperty (pMenuRef, mnMenuItemIndex,
+			   APP_PROPERTY_CREATOR, APP_PROPERTY_TAG_MENU_POINTER,
+			   sizeof(pSalMenuItem), NULL, &pSalMenuItem);
 
       // We also receive kEventMenuTargetItem events for
       // non-application menus (Apple menu or Application menu). But
       // they do not have SalMenuItem attached with them.
-      if (pointer) {
-	SalMenuItem *pSalMenuItem = (SalMenuItem *) pointer;
-	fprintf(stderr, "PJ: SalMenuItem = %p\n", pSalMenuItem);
+      if (pSalMenuItem) {
 	fprintf(stderr, "PJ: mnId = %p\n", ((AquaSalMenuItem *)pSalMenuItem)->mnId);
 
 	// Posting native menu event...
diff -ur ooo_SRC680_m179_src.orig/vcl/aqua/source/window/salmenu.cxx ooo_SRC680_m179_src/vcl/aqua/source/window/salmenu.cxx
--- ooo_SRC680_m179_src.orig/vcl/aqua/source/window/salmenu.cxx	2006-07-29 12:32:44.000000000 +0200
+++ ooo_SRC680_m179_src/vcl/aqua/source/window/salmenu.cxx	2006-07-29 16:28:42.000000000 +0200
@@ -61,12 +61,9 @@
   /* Associate the pointer to this SalMenu with the menu */
   fprintf(stderr, "PJ: Associating %p, 0 = %p\n", pAquaSalMenu->mrMenuRef, pAquaSalMenu);
 
-  // FIXME: should probably be done using SetMenuItemProperty, but I
-  // was not able to make it work properly outside of this
-  // function. It worked here, but not in salframe.cxx :-(
-  // So for now, I'll misuse SetMenuItemRefCon and pass pointer to
-  // this SalMenu to it as UInt32
-  SetMenuItemRefCon (pAquaSalMenu->mrMenuRef, 0, (UInt32) pAquaSalMenu);
+  SetMenuItemProperty (pAquaSalMenu->mrMenuRef, 0,
+		       APP_PROPERTY_CREATOR, APP_PROPERTY_TAG_MENU_POINTER,
+		       sizeof(pAquaSalMenu), &pAquaSalMenu);
 
   fprintf(stderr, "PJ: returning %p (MenuRef = %p)\n", pAquaSalMenu, pAquaSalMenu->mrMenuRef);
 
@@ -167,12 +164,9 @@
   /* Associate the pointer to this SalMenuItem with the menu item */
   fprintf(stderr, "PJ: Associating %p, %d = %p\n", mrMenuRef, pAquaSalMenuItem->mnMenuItemIndex, pSalMenuItem);
 
-  // FIXME: should probably be done using SetMenuItemProperty, but I
-  // was not able to make it work properly outside of this
-  // function. It worked here, but not in salframe.cxx :-(
-  // So for now, I'll misuse SetMenuItemRefCon and pass pointer to
-  // this SalMenuItem to it as UInt32
-  SetMenuItemRefCon (mrMenuRef, pAquaSalMenuItem->mnMenuItemIndex, (UInt32) pSalMenuItem);
+  SetMenuItemProperty (mrMenuRef, pAquaSalMenuItem->mnMenuItemIndex,
+		       APP_PROPERTY_CREATOR, APP_PROPERTY_TAG_MENU_POINTER,
+		       sizeof(pSalMenuItem), &pSalMenuItem);
 }
 
 void AquaSalMenu::RemoveItem( unsigned nPos )
