]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/uma.cpp
Added various #includes for non-precompiled headers.
[wxWidgets.git] / src / mac / uma.cpp
index 2ca3e8cc2bec759f095533a783490ed7811e2dad..dbdb59341f67579a89479f8499342cb48602a16e 100644 (file)
@@ -379,7 +379,7 @@ GrafPtr             UMAGetWindowPort( WindowRef inWindowRef )
 {
        wxASSERT( inWindowRef != NULL ) ;
 #if TARGET_CARBON 
-       return GetWindowPort( inWindowRef ) ; 
+       return (GrafPtr) GetWindowPort( inWindowRef ) ; 
 #else
        return (GrafPtr) inWindowRef ;
 #endif
@@ -589,7 +589,6 @@ OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
 }
 
 static OSStatus helpMenuStatus = noErr ;
-static MenuRef helpMenuHandle = NULL ;
 static MenuItemIndex firstCustomItemIndex = 0 ;
 
 OSStatus UMAGetHelpMenu(
@@ -599,13 +598,11 @@ OSStatus UMAGetHelpMenu(
 #if TARGET_CARBON
   return HMGetHelpMenu( outHelpMenu , outFirstCustomItemIndex ) ;
 #else
-  if ( helpMenuHandle == NULL )
+  MenuRef helpMenuHandle ;
+  helpMenuStatus = HMGetHelpMenuHandle( &helpMenuHandle ) ;
+  if ( firstCustomItemIndex == 0 && helpMenuStatus == noErr )
   {
-    helpMenuStatus = HMGetHelpMenuHandle( &helpMenuHandle ) ;
-    if ( helpMenuStatus == noErr )
-    {
-      firstCustomItemIndex = CountMenuItems( helpMenuHandle ) + 1 ;
-    }
+    firstCustomItemIndex = CountMenuItems( helpMenuHandle ) + 1 ;
   }
   if ( outFirstCustomItemIndex )
   {