diff options
Diffstat (limited to 'vcl/source/window/menu.cxx')
-rw-r--r-- | vcl/source/window/menu.cxx | 1276 |
1 files changed, 638 insertions, 638 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index cebe1d1f596c..4679915d3627 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -80,9 +80,9 @@ namespace vcl struct MenuLayoutData : public ControlLayoutData { - std::vector< USHORT > m_aLineItemIds; - std::vector< USHORT > m_aLineItemPositions; - std::map< USHORT, Rectangle > m_aVisibleItemBoundRects; + std::vector< sal_uInt16 > m_aLineItemIds; + std::vector< sal_uInt16 > m_aLineItemPositions; + std::map< sal_uInt16, Rectangle > m_aVisibleItemBoundRects; }; } @@ -104,32 +104,32 @@ DBG_NAME( Menu ) #include <xwphook.h> -// return TRUE if hilite should be executed: left mouse button down +// return sal_True if hilite should be executed: left mouse button down // or xwp mouse hook enabled -static BOOL ImplHilite( const MouseEvent& rMEvt ) +static sal_Bool ImplHilite( const MouseEvent& rMEvt ) { - static BOOL init = FALSE; + static sal_Bool init = sal_False; static HOOKCONFIG hc; // read XWP settings at program startup - if (init == FALSE) { - BOOL rc; - ULONG cb = sizeof(HOOKCONFIG); + if (init == sal_False) { + sal_Bool rc; + sal_uIntPtr cb = sizeof(HOOKCONFIG); memset(&hc, 0, sizeof(HOOKCONFIG)); rc = PrfQueryProfileData( HINI_USER, INIAPP_XWPHOOK, INIKEY_HOOK_CONFIG, &hc, &cb); - init = TRUE; + init = sal_True; } // check mouse left button if (rMEvt.GetButtons() == MOUSE_LEFT) - return TRUE; + return sal_True; // return xwp flag return hc.fSlidingMenus; } #endif -static BOOL ImplAccelDisabled() +static sal_Bool ImplAccelDisabled() { // display of accelerator strings may be suppressed via configuration static int nAccelDisabled = -1; @@ -142,12 +142,12 @@ static BOOL ImplAccelDisabled() rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuppressAccelerators" ) ) ); nAccelDisabled = aStr.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0; } - return (nAccelDisabled == 1) ? TRUE : FALSE; + return (nAccelDisabled == 1) ? sal_True : sal_False; } struct MenuItemData { - USHORT nId; // SV Id + sal_uInt16 nId; // SV Id MenuItemType eType; // MenuItem-Type MenuItemBits nBits; // MenuItem-Bits Menu* pSubMenu; // Pointer auf das SubMenu @@ -157,15 +157,15 @@ struct MenuItemData XubString aTipHelpText; // TipHelp-String (eg, expanded filenames) XubString aCommandStr; // CommandString XubString aHelpCommandStr; // Help command string (to reference external help) - ULONG nHelpId; // Help-Id - ULONG nUserValue; // User value + sal_uIntPtr nHelpId; // Help-Id + sal_uIntPtr nUserValue; // User value Image aImage; // Image KeyCode aAccelKey; // Accelerator-Key - BOOL bChecked; // Checked - BOOL bEnabled; // Enabled - BOOL bVisible; // Visible (note: this flag will not override MENU_FLAG_HIDEDISABLEDENTRIES when true) - BOOL bIsTemporary; // Temporary inserted ('No selection possible') - BOOL bMirrorMode; + sal_Bool bChecked; // Checked + sal_Bool bEnabled; // Enabled + sal_Bool bVisible; // Visible (note: this flag will not override MENU_FLAG_HIDEDISABLEDENTRIES when true) + sal_Bool bIsTemporary; // Temporary inserted ('No selection possible') + sal_Bool bMirrorMode; long nItemImageAngle; Size aSz; // nur temporaer gueltig XubString aAccessibleName; // accessible name @@ -210,22 +210,22 @@ public: MenuItemList() : List( 16, 4 ) {} ~MenuItemList(); - MenuItemData* Insert( USHORT nId, MenuItemType eType, MenuItemBits nBits, + MenuItemData* Insert( sal_uInt16 nId, MenuItemType eType, MenuItemBits nBits, const XubString& rStr, const Image& rImage, - Menu* pMenu, USHORT nPos ); - void InsertSeparator( USHORT nPos ); - void Remove( USHORT nPos ); + Menu* pMenu, sal_uInt16 nPos ); + void InsertSeparator( sal_uInt16 nPos ); + void Remove( sal_uInt16 nPos ); - MenuItemData* GetData( USHORT nSVId, USHORT& rPos ) const; - MenuItemData* GetData( USHORT nSVId ) const - { USHORT nTemp; return GetData( nSVId, nTemp ); } - MenuItemData* GetDataFromPos( ULONG nPos ) const + MenuItemData* GetData( sal_uInt16 nSVId, sal_uInt16& rPos ) const; + MenuItemData* GetData( sal_uInt16 nSVId ) const + { sal_uInt16 nTemp; return GetData( nSVId, nTemp ); } + MenuItemData* GetDataFromPos( sal_uIntPtr nPos ) const { return (MenuItemData*)List::GetObject( nPos ); } - MenuItemData* SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, USHORT& rPos, USHORT& nDuplicates, USHORT nCurrentPos ) const; - USHORT GetItemCount( xub_Unicode cSelectChar ) const; - USHORT GetItemCount( KeyCode aKeyCode ) const; + MenuItemData* SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, sal_uInt16& rPos, sal_uInt16& nDuplicates, sal_uInt16 nCurrentPos ) const; + sal_uInt16 GetItemCount( xub_Unicode cSelectChar ) const; + sal_uInt16 GetItemCount( KeyCode aKeyCode ) const; uno::Reference< i18n::XCharacterClassification > GetCharClass() const; }; @@ -234,17 +234,17 @@ public: MenuItemList::~MenuItemList() { - for ( ULONG n = Count(); n; ) + for ( sal_uIntPtr n = Count(); n; ) { MenuItemData* pData = GetDataFromPos( --n ); delete pData; } } -MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType, +MenuItemData* MenuItemList::Insert( sal_uInt16 nId, MenuItemType eType, MenuItemBits nBits, const XubString& rStr, const Image& rImage, - Menu* pMenu, USHORT nPos ) + Menu* pMenu, sal_uInt16 nPos ) { MenuItemData* pData = new MenuItemData( rStr, rImage ); pData->nId = nId; @@ -254,11 +254,11 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType, pData->pAutoSubMenu = NULL; pData->nHelpId = 0; pData->nUserValue = 0; - pData->bChecked = FALSE; - pData->bEnabled = TRUE; - pData->bVisible = TRUE; - pData->bIsTemporary = FALSE; - pData->bMirrorMode = FALSE; + pData->bChecked = sal_False; + pData->bEnabled = sal_True; + pData->bVisible = sal_True; + pData->bIsTemporary = sal_False; + pData->bMirrorMode = sal_False; pData->nItemImageAngle = 0; SalItemParams aSalMIData; @@ -276,7 +276,7 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType, return pData; } -void MenuItemList::InsertSeparator( USHORT nPos ) +void MenuItemList::InsertSeparator( sal_uInt16 nPos ) { MenuItemData* pData = new MenuItemData; pData->nId = 0; @@ -286,11 +286,11 @@ void MenuItemList::InsertSeparator( USHORT nPos ) pData->pAutoSubMenu = NULL; pData->nHelpId = 0; pData->nUserValue = 0; - pData->bChecked = FALSE; - pData->bEnabled = TRUE; - pData->bVisible = TRUE; - pData->bIsTemporary = FALSE; - pData->bMirrorMode = FALSE; + pData->bChecked = sal_False; + pData->bEnabled = sal_True; + pData->bVisible = sal_True; + pData->bIsTemporary = sal_False; + pData->bMirrorMode = sal_False; pData->nItemImageAngle = 0; SalItemParams aSalMIData; @@ -307,14 +307,14 @@ void MenuItemList::InsertSeparator( USHORT nPos ) List::Insert( (void*)pData, nPos ); } -void MenuItemList::Remove( USHORT nPos ) +void MenuItemList::Remove( sal_uInt16 nPos ) { - MenuItemData* pData = (MenuItemData*)List::Remove( (ULONG)nPos ); + MenuItemData* pData = (MenuItemData*)List::Remove( (sal_uIntPtr)nPos ); if ( pData ) delete pData; } -MenuItemData* MenuItemList::GetData( USHORT nSVId, USHORT& rPos ) const +MenuItemData* MenuItemList::GetData( sal_uInt16 nSVId, sal_uInt16& rPos ) const { rPos = 0; MenuItemData* pData = (MenuItemData*)GetObject( rPos ); @@ -330,11 +330,11 @@ MenuItemData* MenuItemList::GetData( USHORT nSVId, USHORT& rPos ) const return NULL; } -MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, USHORT& rPos, USHORT& nDuplicates, USHORT nCurrentPos ) const +MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, sal_uInt16& rPos, sal_uInt16& nDuplicates, sal_uInt16 nCurrentPos ) const { const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); - USHORT nListCount = (USHORT)Count(); + sal_uInt16 nListCount = (sal_uInt16)Count(); // try character code first nDuplicates = GetItemCount( cSelectChar ); // return number of duplicates @@ -367,7 +367,7 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod MenuItemData* pData = GetDataFromPos( rPos ); if ( pData->bEnabled ) { - USHORT n = pData->aText.Search( '~' ); + sal_uInt16 n = pData->aText.Search( '~' ); if ( n != STRING_NOTFOUND ) { KeyCode mnKeyCode; @@ -391,13 +391,13 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod return NULL; } -USHORT MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const +sal_uInt16 MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const { // returns number of entries with same mnemonic const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); - USHORT nItems = 0, nPos; - for ( nPos = (USHORT)Count(); nPos; ) + sal_uInt16 nItems = 0, nPos; + for ( nPos = (sal_uInt16)Count(); nPos; ) { MenuItemData* pData = GetDataFromPos( --nPos ); if ( pData->bEnabled && rI18nHelper.MatchMnemonic( pData->aText, cSelectChar ) ) @@ -407,7 +407,7 @@ USHORT MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const return nItems; } -USHORT MenuItemList::GetItemCount( KeyCode aKeyCode ) const +sal_uInt16 MenuItemList::GetItemCount( KeyCode aKeyCode ) const { // returns number of entries with same mnemonic // uses key codes instead of character codes @@ -416,13 +416,13 @@ USHORT MenuItemList::GetItemCount( KeyCode aKeyCode ) const if( aKeyCode.GetCode() >= KEY_A && aKeyCode.GetCode() <= KEY_Z ) ascii = sal::static_int_cast<char>('A' + (aKeyCode.GetCode() - KEY_A)); - USHORT nItems = 0, nPos; - for ( nPos = (USHORT)Count(); nPos; ) + sal_uInt16 nItems = 0, nPos; + for ( nPos = (sal_uInt16)Count(); nPos; ) { MenuItemData* pData = GetDataFromPos( --nPos ); if ( pData->bEnabled ) { - USHORT n = pData->aText.Search( '~' ); + sal_uInt16 n = pData->aText.Search( '~' ); if ( n != STRING_NOTFOUND ) { KeyCode mnKeyCode; @@ -464,21 +464,21 @@ private: Timer aHighlightChangedTimer; Timer aSubmenuCloseTimer; Timer aScrollTimer; - ULONG nSaveFocusId; + sal_uIntPtr nSaveFocusId; // long nStartY; - USHORT nHighlightedItem; // gehighlightetes/selektiertes Item - USHORT nMBDownPos; - USHORT nScrollerHeight; - USHORT nFirstEntry; - USHORT nBorder; - USHORT nPosInParent; - BOOL bInExecute; - - BOOL bScrollMenu; - BOOL bScrollUp; - BOOL bScrollDown; - BOOL bIgnoreFirstMove; - BOOL bKeyInput; + sal_uInt16 nHighlightedItem; // gehighlightetes/selektiertes Item + sal_uInt16 nMBDownPos; + sal_uInt16 nScrollerHeight; + sal_uInt16 nFirstEntry; + sal_uInt16 nBorder; + sal_uInt16 nPosInParent; + sal_Bool bInExecute; + + sal_Bool bScrollMenu; + sal_Bool bScrollUp; + sal_Bool bScrollDown; + sal_Bool bIgnoreFirstMove; + sal_Bool bKeyInput; DECL_LINK( PopupEnd, FloatingWindow* ); DECL_LINK( HighlightChanged, Timer* ); @@ -489,16 +489,16 @@ private: void StateChanged( StateChangedType nType ); void DataChanged( const DataChangedEvent& rDCEvt ); protected: - Region ImplCalcClipRegion( BOOL bIncludeLogo = TRUE ) const; + Region ImplCalcClipRegion( sal_Bool bIncludeLogo = sal_True ) const; void ImplInitClipRegion(); - void ImplDrawScroller( BOOL bUp ); + void ImplDrawScroller( sal_Bool bUp ); using Window::ImplScroll; void ImplScroll( const Point& rMousePos ); - void ImplScroll( BOOL bUp ); - void ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd = FALSE ); - void ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown ); + void ImplScroll( sal_Bool bUp ); + void ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd = sal_False ); + void ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown ); long ImplGetStartY() const; - Rectangle ImplGetItemRect( USHORT nPos ); + Rectangle ImplGetItemRect( sal_uInt16 nPos ); public: MenuFloatingWindow( Menu* pMenu, Window* pParent, WinBits nStyle ); @@ -515,27 +515,27 @@ public: virtual void RequestHelp( const HelpEvent& rHEvt ); virtual void Resize(); - void SetFocusId( ULONG nId ) { nSaveFocusId = nId; } - ULONG GetFocusId() const { return nSaveFocusId; } + void SetFocusId( sal_uIntPtr nId ) { nSaveFocusId = nId; } + sal_uIntPtr GetFocusId() const { return nSaveFocusId; } - void EnableScrollMenu( BOOL b ); - BOOL IsScrollMenu() const { return bScrollMenu; } - USHORT GetScrollerHeight() const { return nScrollerHeight; } + void EnableScrollMenu( sal_Bool b ); + sal_Bool IsScrollMenu() const { return bScrollMenu; } + sal_uInt16 GetScrollerHeight() const { return nScrollerHeight; } void Execute(); - void StopExecute( ULONG nFocusId = 0 ); + void StopExecute( sal_uIntPtr nFocusId = 0 ); void EndExecute(); - void EndExecute( USHORT nSelectId ); + void EndExecute( sal_uInt16 nSelectId ); PopupMenu* GetActivePopup() const { return pActivePopup; } void KillActivePopup( PopupMenu* pThisOnly = NULL ); - void HighlightItem( USHORT nPos, BOOL bHighlight ); - void ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ); - USHORT GetHighlightedItem() const { return nHighlightedItem; } + void HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight ); + void ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopupTimer ); + sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; } - void SetPosInParent( USHORT nPos ) { nPosInParent = nPos; } - USHORT GetPosInParent() const { return nPosInParent; } + void SetPosInParent( sal_uInt16 nPos ) { nPosInParent = nPos; } + sal_uInt16 GetPosInParent() const { return nPosInParent; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); }; @@ -607,10 +607,10 @@ void DecoToolBox::calcMinSize() } else { - USHORT nItems = GetItemCount(); - for( USHORT i = 0; i < nItems; i++ ) + sal_uInt16 nItems = GetItemCount(); + for( sal_uInt16 i = 0; i < nItems; i++ ) { - USHORT nId = GetItemId( i ); + sal_uInt16 nId = GetItemId( i ); aTbx.InsertItem( nId, GetItemImage( nId ) ); } } @@ -672,7 +672,7 @@ class MenuBarWindow : public Window private: struct AddButtonEntry { - USHORT m_nId; + sal_uInt16 m_nId; Link m_aSelectLink; Link m_aHighlightLink; @@ -681,25 +681,25 @@ private: Menu* pMenu; PopupMenu* pActivePopup; - USHORT nHighlightedItem; - ULONG nSaveFocusId; - BOOL mbAutoPopup; - BOOL bIgnoreFirstMove; - BOOL bStayActive; + sal_uInt16 nHighlightedItem; + sal_uIntPtr nSaveFocusId; + sal_Bool mbAutoPopup; + sal_Bool bIgnoreFirstMove; + sal_Bool bStayActive; DecoToolBox aCloser; PushButton aFloatBtn; PushButton aHideBtn; - std::map< USHORT, AddButtonEntry > m_aAddButtons; + std::map< sal_uInt16, AddButtonEntry > m_aAddButtons; - void HighlightItem( USHORT nPos, BOOL bHighlight ); - void ChangeHighlightItem( USHORT n, BOOL bSelectPopupEntry, BOOL bAllowRestoreFocus = TRUE, BOOL bDefaultToDocument = TRUE ); + void HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight ); + void ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectPopupEntry, sal_Bool bAllowRestoreFocus = sal_True, sal_Bool bDefaultToDocument = sal_True ); - USHORT ImplFindEntry( const Point& rMousePos ) const; - void ImplCreatePopup( BOOL bPreSelectFirst ); - BOOL ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu = TRUE ); - Rectangle ImplGetItemRect( USHORT nPos ); + sal_uInt16 ImplFindEntry( const Point& rMousePos ) const; + void ImplCreatePopup( sal_Bool bPreSelectFirst ); + sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu = sal_True ); + Rectangle ImplGetItemRect( sal_uInt16 nPos ); void ImplInitStyleSettings(); @@ -718,7 +718,7 @@ public: MenuBarWindow( Window* pParent ); ~MenuBarWindow(); - void ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide ); + void ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide ); virtual void MouseMove( const MouseEvent& rMEvt ); virtual void MouseButtonDown( const MouseEvent& rMEvt ); @@ -728,26 +728,26 @@ public: virtual void Resize(); virtual void RequestHelp( const HelpEvent& rHEvt ); - void SetFocusId( ULONG nId ) { nSaveFocusId = nId; } - ULONG GetFocusId() const { return nSaveFocusId; } + void SetFocusId( sal_uIntPtr nId ) { nSaveFocusId = nId; } + sal_uIntPtr GetFocusId() const { return nSaveFocusId; } void SetMenu( MenuBar* pMenu ); void KillActivePopup(); PopupMenu* GetActivePopup() const { return pActivePopup; } void PopupClosed( Menu* pMenu ); - USHORT GetHighlightedItem() const { return nHighlightedItem; } + sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); - void SetAutoPopup( BOOL bAuto ) { mbAutoPopup = bAuto; } + void SetAutoPopup( sal_Bool bAuto ) { mbAutoPopup = bAuto; } void ImplLayoutChanged(); Size MinCloseButtonSize(); // add an arbitrary button to the menubar (will appear next to closer) - USHORT AddMenuBarButton( const Image&, const Link&, const String&, USHORT nPos ); - void SetMenuBarButtonHighlightHdl( USHORT nId, const Link& ); - Rectangle GetMenuBarButtonRectPixel( USHORT nId ); - void RemoveMenuBarButton( USHORT nId ); - bool HandleMenuButtonEvent( USHORT i_nButtonId ); + sal_uInt16 AddMenuBarButton( const Image&, const Link&, const String&, sal_uInt16 nPos ); + void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& ); + Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId ); + void RemoveMenuBarButton( sal_uInt16 nId ); + bool HandleMenuButtonEvent( sal_uInt16 i_nButtonId ); }; static void ImplAddNWFSeparator( Window *pThis, const MenubarValue& rMenubarValue ) @@ -777,24 +777,24 @@ static void ImplSetMenuItemData( MenuItemData* pData ) pData->eType = MENUITEM_STRINGIMAGE; } -static ULONG ImplChangeTipTimeout( ULONG nTimeout, Window *pWindow ) +static sal_uIntPtr ImplChangeTipTimeout( sal_uIntPtr nTimeout, Window *pWindow ) { AllSettings aAllSettings( pWindow->GetSettings() ); HelpSettings aHelpSettings( aAllSettings.GetHelpSettings() ); - ULONG nRet = aHelpSettings.GetTipTimeout(); + sal_uIntPtr nRet = aHelpSettings.GetTipTimeout(); aHelpSettings.SetTipTimeout( nTimeout ); aAllSettings.SetHelpSettings( aHelpSettings ); pWindow->SetSettings( aAllSettings ); return nRet; } -static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighlightedItem, const HelpEvent& rHEvt, const Rectangle &rHighlightRect ) +static sal_Bool ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, sal_uInt16 nHighlightedItem, const HelpEvent& rHEvt, const Rectangle &rHighlightRect ) { if( ! pMenu ) - return FALSE; + return sal_False; - BOOL bDone = FALSE; - USHORT nId = 0; + sal_Bool bDone = sal_False; + sal_uInt16 nId = 0; if ( nHighlightedItem != ITEMPOS_INVALID ) { @@ -817,23 +817,23 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl else { // give user a chance to read the full filename - ULONG oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow ); + sal_uIntPtr oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow ); // call always, even when strlen==0 to correctly remove tip Help::ShowQuickHelp( pMenuWindow, aRect, pMenu->GetTipHelpText( nId ) ); ImplChangeTipTimeout( oldTimeout, pMenuWindow ); } - bDone = TRUE; + bDone = sal_True; } else if ( ( rHEvt.GetMode() & HELPMODE_QUICK ) && pMenuWindow ) { Point aPos = rHEvt.GetMousePosPixel(); Rectangle aRect( aPos, Size() ); // give user a chance to read the full filename - ULONG oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow ); + sal_uIntPtr oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow ); // call always, even when strlen==0 to correctly remove tip Help::ShowQuickHelp( pMenuWindow, aRect, pMenu->GetTipHelpText( nId ) ); ImplChangeTipTimeout( oldTimeout, pMenuWindow ); - bDone = TRUE; + bDone = sal_True; } else if ( rHEvt.GetMode() & (HELPMODE_CONTEXT | HELPMODE_EXTENDED) ) { @@ -844,7 +844,7 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl // Ist eine ID vorhanden, dann Hilfe mit der ID aufrufen, sonst // den Hilfe-Index String aCommand = pMenu->GetItemCommand( nId ); - ULONG nHelpId = pMenu->GetHelpId( nId ); + sal_uIntPtr nHelpId = pMenu->GetHelpId( nId ); if ( aCommand.Len() ) pHelp->Start( aCommand, NULL ); @@ -853,7 +853,7 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl else pHelp->Start( OOO_HELP_INDEX, NULL ); } - bDone = TRUE; + bDone = sal_True; } return bDone; } @@ -863,7 +863,7 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow ) // find docking area that is top aligned and return its height // note: dockingareas are direct children of the SystemWindow int height=0; - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if( pWindow->ImplGetFrameWindow() ) { Window *pWin = pWindow->ImplGetFrameWindow()->GetWindow( WINDOW_FIRSTCHILD); //mpWindowImpl->mpFirstChild; @@ -877,7 +877,7 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow ) DockingAreaWindow *pDockingArea = dynamic_cast< DockingAreaWindow* >( pWin ); if( pDockingArea && pDockingArea->GetAlign() == WINDOWALIGN_TOP ) { - bDone = TRUE; + bDone = sal_True; if( pDockingArea->IsVisible() ) height = pDockingArea->GetOutputSizePixel().Height(); } @@ -896,13 +896,13 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow ) Menu::Menu() { DBG_CTOR( Menu, NULL ); - bIsMenuBar = FALSE; + bIsMenuBar = sal_False; ImplInit(); } // this constructor makes sure we're creating the native menu // with the correct type (ie, MenuBar vs. PopupMenu) -Menu::Menu( BOOL bMenubar ) +Menu::Menu( sal_Bool bMenubar ) { DBG_CTOR( Menu, NULL ); bIsMenuBar = bMenubar; @@ -938,7 +938,7 @@ Menu::~Menu() if ( nEventId ) Application::RemoveUserEvent( nEventId ); - bKilled = TRUE; + bKilled = sal_True; delete pItemList; delete pLogo; @@ -959,16 +959,16 @@ void Menu::ImplInit() mpSalMenu = NULL; nMenuFlags = MENU_FLAG_SHOWCHECKIMAGES; nDefaultItem = 0; - //bIsMenuBar = FALSE; // this is now set in the ctor, must not be changed here!!! + //bIsMenuBar = sal_False; // this is now set in the ctor, must not be changed here!!! nSelectedId = 0; pItemList = new MenuItemList; pLogo = NULL; pStartedFrom = NULL; pWindow = NULL; nEventId = 0; - bCanceled = FALSE; - bInCallback = FALSE; - bKilled = FALSE; + bCanceled = sal_False; + bInCallback = sal_False; + bKilled = sal_False; mpLayoutData = NULL; // Native-support: returns NULL if not supported @@ -989,13 +989,13 @@ void Menu::ImplLoadRes( const ResId& rResId ) rResId.SetRT( RSC_MENU ); GetRes( rResId ); - ULONG nObjMask = ReadLongRes(); + sal_uIntPtr nObjMask = ReadLongRes(); if( nObjMask & RSC_MENU_ITEMS ) { - ULONG nObjFollows = ReadLongRes(); + sal_uIntPtr nObjFollows = ReadLongRes(); // MenuItems einfuegen - for( ULONG i = 0; i < nObjFollows; i++ ) + for( sal_uIntPtr i = 0; i < nObjFollows; i++ ) { InsertItem( ResId( (RSHEADER_TYPE*)GetClassRes(), *pMgr ) ); IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) ); @@ -1010,13 +1010,13 @@ void Menu::ImplLoadRes( const ResId& rResId ) aTitleText = ReadStringRes(); } if( nObjMask & RSC_MENU_DEFAULTITEMID ) - SetDefaultItem( sal::static_int_cast<USHORT>(ReadLongRes()) ); + SetDefaultItem( sal::static_int_cast<sal_uInt16>(ReadLongRes()) ); } void Menu::CreateAutoMnemonics() { MnemonicGenerator aMnemonicGenerator; - ULONG n; + sal_uIntPtr n; for ( n = 0; n < pItemList->Count(); n++ ) { MenuItemData* pData = pItemList->GetDataFromPos(n); @@ -1033,44 +1033,44 @@ void Menu::CreateAutoMnemonics() void Menu::Activate() { - bInCallback = TRUE; + bInCallback = sal_True; ImplCallEventListeners( VCLEVENT_MENU_ACTIVATE, ITEMPOS_INVALID ); if ( !aActivateHdl.Call( this ) ) { Menu* pStartMenu = ImplGetStartMenu(); if ( pStartMenu && ( pStartMenu != this ) ) { - pStartMenu->bInCallback = TRUE; + pStartMenu->bInCallback = sal_True; // MT 11/01: Call EventListener here? I don't know... pStartMenu->aActivateHdl.Call( this ); - pStartMenu->bInCallback = FALSE; + pStartMenu->bInCallback = sal_False; } } - bInCallback = FALSE; + bInCallback = sal_False; } void Menu::Deactivate() { - for ( USHORT n = (USHORT)pItemList->Count(); n; ) + for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; ) { MenuItemData* pData = pItemList->GetDataFromPos( --n ); if ( pData->bIsTemporary ) pItemList->Remove( n ); } - bInCallback = TRUE; + bInCallback = sal_True; Menu* pStartMenu = ImplGetStartMenu(); ImplCallEventListeners( VCLEVENT_MENU_DEACTIVATE, ITEMPOS_INVALID ); if ( !aDeactivateHdl.Call( this ) ) { if ( pStartMenu && ( pStartMenu != this ) ) { - pStartMenu->bInCallback = TRUE; + pStartMenu->bInCallback = sal_True; pStartMenu->aDeactivateHdl.Call( this ); - pStartMenu->bInCallback = FALSE; + pStartMenu->bInCallback = sal_False; } } - bInCallback = FALSE; + bInCallback = sal_False; if ( this == pStartMenu ) GetpApp()->HideHelpStatusText(); @@ -1094,11 +1094,11 @@ void Menu::ImplSelect() MenuItemData* pData = GetItemList()->GetData( nSelectedId ); if ( pData && (pData->nBits & MIB_AUTOCHECK) ) { - BOOL bChecked = IsItemChecked( nSelectedId ); + sal_Bool bChecked = IsItemChecked( nSelectedId ); if ( pData->nBits & MIB_RADIOCHECK ) { if ( !bChecked ) - CheckItem( nSelectedId, TRUE ); + CheckItem( nSelectedId, sal_True ); } else CheckItem( nSelectedId, !bChecked ); @@ -1139,7 +1139,7 @@ void Menu::RequestHelp( const HelpEvent& ) { } -void Menu::ImplCallEventListeners( ULONG nEvent, USHORT nPos ) +void Menu::ImplCallEventListeners( sal_uIntPtr nEvent, sal_uInt16 nPos ) { VclMenuEvent aEvent( this, nEvent, nPos ); @@ -1186,14 +1186,14 @@ void Menu::RemoveEventListener( const Link& rEventListener ) // mpDummy4_WindowChildEventListeners->remove( rEventListener ); //} -void Menu::InsertItem( USHORT nItemId, const XubString& rStr, MenuItemBits nItemBits, USHORT nPos ) +void Menu::InsertItem( sal_uInt16 nItemId, const XubString& rStr, MenuItemBits nItemBits, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "Menu::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == MENU_ITEM_NOTFOUND, "Menu::InsertItem(): ItemId already exists" ); // if Position > ItemCount, append - if ( nPos >= (USHORT)pItemList->Count() ) + if ( nPos >= (sal_uInt16)pItemList->Count() ) nPos = MENU_APPEND; // put Item in MenuItemList @@ -1215,39 +1215,39 @@ void Menu::InsertItem( USHORT nItemId, const XubString& rStr, MenuItemBits nItem ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos ); } -void Menu::InsertItem( USHORT nItemId, const Image& rImage, - MenuItemBits nItemBits, USHORT nPos ) +void Menu::InsertItem( sal_uInt16 nItemId, const Image& rImage, + MenuItemBits nItemBits, sal_uInt16 nPos ) { InsertItem( nItemId, ImplGetSVEmptyStr(), nItemBits, nPos ); SetItemImage( nItemId, rImage ); } -void Menu::InsertItem( USHORT nItemId, +void Menu::InsertItem( sal_uInt16 nItemId, const XubString& rStr, const Image& rImage, - MenuItemBits nItemBits, USHORT nPos ) + MenuItemBits nItemBits, sal_uInt16 nPos ) { InsertItem( nItemId, rStr, nItemBits, nPos ); SetItemImage( nItemId, rImage ); } -void Menu::InsertItem( const ResId& rResId, USHORT nPos ) +void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos ) { ResMgr* pMgr = rResId.GetResMgr(); if( ! pMgr ) return; - ULONG nObjMask; + sal_uIntPtr nObjMask; GetRes( rResId.SetRT( RSC_MENUITEM ) ); nObjMask = ReadLongRes(); - BOOL bSep = FALSE; + sal_Bool bSep = sal_False; if ( nObjMask & RSC_MENUITEM_SEPARATOR ) - bSep = (BOOL)ReadShortRes(); + bSep = (sal_Bool)ReadShortRes(); - USHORT nItemId = 1; + sal_uInt16 nItemId = 1; if ( nObjMask & RSC_MENUITEM_ID ) - nItemId = sal::static_int_cast<USHORT>(ReadLongRes()); + nItemId = sal::static_int_cast<sal_uInt16>(ReadLongRes()); MenuItemBits nStatus = 0; if ( nObjMask & RSC_MENUITEM_STATUS ) @@ -1283,7 +1283,7 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos ) SetHelpText( nItemId, aHelpText ); } - ULONG nHelpId = 0; + sal_uIntPtr nHelpId = 0; if ( nObjMask & RSC_MENUITEM_HELPID ) { nHelpId = ReadLongRes(); @@ -1303,12 +1303,12 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos ) if( nObjMask & RSC_MENUITEM_CHECKED ) { if ( !bSep ) - CheckItem( nItemId, (BOOL)ReadShortRes() ); + CheckItem( nItemId, (sal_Bool)ReadShortRes() ); } if ( nObjMask & RSC_MENUITEM_DISABLE ) { if ( !bSep ) - EnableItem( nItemId, !(BOOL)ReadShortRes() ); + EnableItem( nItemId, !(sal_Bool)ReadShortRes() ); } if ( nObjMask & RSC_MENUITEM_COMMAND ) { @@ -1335,21 +1335,21 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos ) delete mpLayoutData, mpLayoutData = NULL; } -void Menu::InsertSeparator( USHORT nPos ) +void Menu::InsertSeparator( sal_uInt16 nPos ) { // do nothing if its a menu bar if ( bIsMenuBar ) return; // if position > ItemCount, append - if ( nPos >= (USHORT)pItemList->Count() ) + if ( nPos >= (sal_uInt16)pItemList->Count() ) nPos = MENU_APPEND; // put separator in item list pItemList->InsertSeparator( nPos ); // update native menu - USHORT itemPos = nPos != MENU_APPEND ? nPos : (USHORT)pItemList->Count() - 1; + sal_uInt16 itemPos = nPos != MENU_APPEND ? nPos : (sal_uInt16)pItemList->Count() - 1; MenuItemData *pData = pItemList->GetDataFromPos( itemPos ); if( ImplGetSalMenu() && pData && pData->pSalMenuItem ) ImplGetSalMenu()->InsertItem( pData->pSalMenuItem, nPos ); @@ -1359,9 +1359,9 @@ void Menu::InsertSeparator( USHORT nPos ) ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos ); } -void Menu::RemoveItem( USHORT nPos ) +void Menu::RemoveItem( sal_uInt16 nPos ) { - BOOL bRemove = FALSE; + sal_Bool bRemove = sal_False; if ( nPos < GetItemCount() ) { @@ -1370,7 +1370,7 @@ void Menu::RemoveItem( USHORT nPos ) ImplGetSalMenu()->RemoveItem( nPos ); pItemList->Remove( nPos ); - bRemove = TRUE; + bRemove = sal_True; } Window* pWin = ImplGetWindow(); @@ -1386,8 +1386,8 @@ void Menu::RemoveItem( USHORT nPos ) ImplCallEventListeners( VCLEVENT_MENU_REMOVEITEM, nPos ); } -void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos, - USHORT nMode = 0 ) +void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos, + sal_uInt16 nMode = 0 ) { MenuItemType eType = rMenu.GetItemType( nPos ); @@ -1398,7 +1398,7 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos, pThis->InsertSeparator( nNewPos ); else { - USHORT nId = rMenu.GetItemId( nPos ); + sal_uInt16 nId = rMenu.GetItemId( nPos ); DBG_ASSERT( pThis->GetItemPos( nId ) == MENU_ITEM_NOTFOUND, "Menu::CopyItem(): ItemId already exists" ); @@ -1413,9 +1413,9 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos, pThis->InsertItem( nId, pData->aImage, pData->nBits, nNewPos ); if ( rMenu.IsItemChecked( nId ) ) - pThis->CheckItem( nId, TRUE ); + pThis->CheckItem( nId, sal_True ); if ( !rMenu.IsItemEnabled( nId ) ) - pThis->EnableItem( nId, FALSE ); + pThis->EnableItem( nId, sal_False ); pThis->SetHelpId( nId, pData->nHelpId ); pThis->SetHelpText( nId, pData->aHelpText ); pThis->SetAccelKey( nId, pData->aAccelKey ); @@ -1438,26 +1438,26 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos, } } -void Menu::CopyItem( const Menu& rMenu, USHORT nPos, USHORT nNewPos ) +void Menu::CopyItem( const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos ) { ImplCopyItem( this, rMenu, nPos, nNewPos ); } void Menu::Clear() { - for ( USHORT i = GetItemCount(); i; i-- ) + for ( sal_uInt16 i = GetItemCount(); i; i-- ) RemoveItem( 0 ); } -USHORT Menu::GetItemCount() const +sal_uInt16 Menu::GetItemCount() const { - return (USHORT)pItemList->Count(); + return (sal_uInt16)pItemList->Count(); } -USHORT Menu::ImplGetVisibleItemCount() const +sal_uInt16 Menu::ImplGetVisibleItemCount() const { - USHORT nItems = 0; - for ( USHORT n = (USHORT)pItemList->Count(); n; ) + sal_uInt16 nItems = 0; + for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; ) { if ( ImplIsVisible( --n ) ) nItems++; @@ -1465,9 +1465,9 @@ USHORT Menu::ImplGetVisibleItemCount() const return nItems; } -USHORT Menu::ImplGetFirstVisible() const +sal_uInt16 Menu::ImplGetFirstVisible() const { - for ( USHORT n = 0; n < pItemList->Count(); n++ ) + for ( sal_uInt16 n = 0; n < pItemList->Count(); n++ ) { if ( ImplIsVisible( n ) ) return n; @@ -1475,9 +1475,9 @@ USHORT Menu::ImplGetFirstVisible() const return ITEMPOS_INVALID; } -USHORT Menu::ImplGetPrevVisible( USHORT nPos ) const +sal_uInt16 Menu::ImplGetPrevVisible( sal_uInt16 nPos ) const { - for ( USHORT n = nPos; n; ) + for ( sal_uInt16 n = nPos; n; ) { if ( n && ImplIsVisible( --n ) ) return n; @@ -1485,9 +1485,9 @@ USHORT Menu::ImplGetPrevVisible( USHORT nPos ) const return ITEMPOS_INVALID; } -USHORT Menu::ImplGetNextVisible( USHORT nPos ) const +sal_uInt16 Menu::ImplGetNextVisible( sal_uInt16 nPos ) const { - for ( USHORT n = nPos+1; n < pItemList->Count(); n++ ) + for ( sal_uInt16 n = nPos+1; n < pItemList->Count(); n++ ) { if ( ImplIsVisible( n ) ) return n; @@ -1495,7 +1495,7 @@ USHORT Menu::ImplGetNextVisible( USHORT nPos ) const return ITEMPOS_INVALID; } -USHORT Menu::GetItemId( USHORT nPos ) const +sal_uInt16 Menu::GetItemId( sal_uInt16 nPos ) const { MenuItemData* pData = pItemList->GetDataFromPos( nPos ); @@ -1505,9 +1505,9 @@ USHORT Menu::GetItemId( USHORT nPos ) const return 0; } -USHORT Menu::GetItemPos( USHORT nItemId ) const +sal_uInt16 Menu::GetItemPos( sal_uInt16 nItemId ) const { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( pData ) @@ -1516,7 +1516,7 @@ USHORT Menu::GetItemPos( USHORT nItemId ) const return MENU_ITEM_NOTFOUND; } -MenuItemType Menu::GetItemType( USHORT nPos ) const +MenuItemType Menu::GetItemType( sal_uInt16 nPos ) const { MenuItemData* pData = pItemList->GetDataFromPos( nPos ); @@ -1526,19 +1526,19 @@ MenuItemType Menu::GetItemType( USHORT nPos ) const return MENUITEM_DONTKNOW; } -USHORT Menu::GetCurItemId() const +sal_uInt16 Menu::GetCurItemId() const { return nSelectedId; } -void Menu::SetItemBits( USHORT nItemId, MenuItemBits nBits ) +void Menu::SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits ) { MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) pData->nBits = nBits; } -MenuItemBits Menu::GetItemBits( USHORT nItemId ) const +MenuItemBits Menu::GetItemBits( sal_uInt16 nItemId ) const { MenuItemBits nBits = 0; MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1547,22 +1547,22 @@ MenuItemBits Menu::GetItemBits( USHORT nItemId ) const return nBits; } -void Menu::SetUserValue( USHORT nItemId, ULONG nValue ) +void Menu::SetUserValue( sal_uInt16 nItemId, sal_uIntPtr nValue ) { MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) pData->nUserValue = nValue; } -ULONG Menu::GetUserValue( USHORT nItemId ) const +sal_uIntPtr Menu::GetUserValue( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); return pData ? pData->nUserValue : 0; } -void Menu::SetPopupMenu( USHORT nItemId, PopupMenu* pMenu ) +void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); // Item does not exist -> return NULL @@ -1592,7 +1592,7 @@ void Menu::SetPopupMenu( USHORT nItemId, PopupMenu* pMenu ) ImplCallEventListeners( VCLEVENT_MENU_SUBMENUCHANGED, nPos ); } -PopupMenu* Menu::GetPopupMenu( USHORT nItemId ) const +PopupMenu* Menu::GetPopupMenu( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1602,9 +1602,9 @@ PopupMenu* Menu::GetPopupMenu( USHORT nItemId ) const return NULL; } -void Menu::SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode ) +void Menu::SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData ) @@ -1620,7 +1620,7 @@ void Menu::SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode ) ImplGetSalMenu()->SetAccelerator( nPos, pData->pSalMenuItem, rKeyCode, rKeyCode.GetName() ); } -KeyCode Menu::GetAccelKey( USHORT nItemId ) const +KeyCode Menu::GetAccelKey( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1630,16 +1630,16 @@ KeyCode Menu::GetAccelKey( USHORT nItemId ) const return KeyCode(); } -KeyEvent Menu::GetActivationKey( USHORT nItemId ) const +KeyEvent Menu::GetActivationKey( sal_uInt16 nItemId ) const { KeyEvent aRet; MenuItemData* pData = pItemList->GetData( nItemId ); if( pData ) { - USHORT nPos = pData->aText.Search( '~' ); + sal_uInt16 nPos = pData->aText.Search( '~' ); if( nPos != STRING_NOTFOUND && nPos < pData->aText.Len()-1 ) { - USHORT nCode = 0; + sal_uInt16 nCode = 0; sal_Unicode cAccel = pData->aText.GetChar( nPos+1 ); if( cAccel >= 'a' && cAccel <= 'z' ) nCode = KEY_A + (cAccel-'a'); @@ -1655,9 +1655,9 @@ KeyEvent Menu::GetActivationKey( USHORT nItemId ) const return aRet; } -void Menu::CheckItem( USHORT nItemId, BOOL bCheck ) +void Menu::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData || pData->bChecked == bCheck ) @@ -1668,9 +1668,9 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck ) (pData->nBits & MIB_RADIOCHECK) ) { MenuItemData* pGroupData; - USHORT nGroupPos; - USHORT nItemCount = GetItemCount(); - BOOL bFound = FALSE; + sal_uInt16 nGroupPos; + sal_uInt16 nItemCount = GetItemCount(); + sal_Bool bFound = sal_False; nGroupPos = nPos; while ( nGroupPos ) @@ -1680,8 +1680,8 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck ) { if ( IsItemChecked( pGroupData->nId ) ) { - CheckItem( pGroupData->nId, FALSE ); - bFound = TRUE; + CheckItem( pGroupData->nId, sal_False ); + bFound = sal_True; break; } } @@ -1700,7 +1700,7 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck ) { if ( IsItemChecked( pGroupData->nId ) ) { - CheckItem( pGroupData->nId, FALSE ); + CheckItem( pGroupData->nId, sal_False ); break; } } @@ -1720,20 +1720,20 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck ) ImplCallEventListeners( bCheck ? VCLEVENT_MENU_ITEMCHECKED : VCLEVENT_MENU_ITEMUNCHECKED, nPos ); } -BOOL Menu::IsItemChecked( USHORT nItemId ) const +sal_Bool Menu::IsItemChecked( sal_uInt16 nItemId ) const { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData ) - return FALSE; + return sal_False; return pData->bChecked; } -void Menu::EnableItem( USHORT nItemId, BOOL bEnable ) +void Menu::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pItemData = pItemList->GetData( nItemId, nPos ); if ( pItemData && ( pItemData->bEnabled != bEnable ) ) @@ -1745,8 +1745,8 @@ void Menu::EnableItem( USHORT nItemId, BOOL bEnable ) { DBG_ASSERT( bIsMenuBar, "Menu::EnableItem - Popup visible!" ); long nX = 0; - ULONG nCount = pItemList->Count(); - for ( ULONG n = 0; n < nCount; n++ ) + sal_uIntPtr nCount = pItemList->Count(); + for ( sal_uIntPtr n = 0; n < nCount; n++ ) { MenuItemData* pData = pItemList->GetDataFromPos( n ); if ( n == nPos ) @@ -1765,20 +1765,20 @@ void Menu::EnableItem( USHORT nItemId, BOOL bEnable ) } } -BOOL Menu::IsItemEnabled( USHORT nItemId ) const +sal_Bool Menu::IsItemEnabled( sal_uInt16 nItemId ) const { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData ) - return FALSE; + return sal_False; return pData->bEnabled; } -void Menu::ShowItem( USHORT nItemId, BOOL bVisible ) +void Menu::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); DBG_ASSERT( !bIsMenuBar, "Menu::ShowItem - ignored for menu bar entries!" ); @@ -1800,9 +1800,9 @@ void Menu::ShowItem( USHORT nItemId, BOOL bVisible ) } } -void Menu::SetItemText( USHORT nItemId, const XubString& rStr ) +void Menu::SetItemText( sal_uInt16 nItemId, const XubString& rStr ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData ) @@ -1829,9 +1829,9 @@ void Menu::SetItemText( USHORT nItemId, const XubString& rStr ) } } -XubString Menu::GetItemText( USHORT nItemId ) const +XubString Menu::GetItemText( sal_uInt16 nItemId ) const { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( pData ) @@ -1840,9 +1840,9 @@ XubString Menu::GetItemText( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -void Menu::SetItemImage( USHORT nItemId, const Image& rImage ) +void Menu::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData ) @@ -1866,9 +1866,9 @@ static inline Image ImplRotImage( const Image& rImage, long nAngle10 ) return Image( aBmpEx ); } -void Menu::SetItemImageAngle( USHORT nItemId, long nAngle10 ) +void Menu::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( pData ) @@ -1893,9 +1893,9 @@ static inline Image ImplMirrorImage( const Image& rImage ) return Image( aBmpEx ); } -void Menu::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror ) +void Menu::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( pData ) @@ -1911,7 +1911,7 @@ void Menu::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror ) } } -Image Menu::GetItemImage( USHORT nItemId ) const +Image Menu::GetItemImage( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1921,7 +1921,7 @@ Image Menu::GetItemImage( USHORT nItemId ) const return Image(); } -long Menu::GetItemImageAngle( USHORT nItemId ) const +long Menu::GetItemImageAngle( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1931,17 +1931,17 @@ long Menu::GetItemImageAngle( USHORT nItemId ) const return 0; } -BOOL Menu::GetItemImageMirrorMode( USHORT nItemId ) const +sal_Bool Menu::GetItemImageMirrorMode( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) return pData->bMirrorMode; else - return FALSE; + return sal_False; } -void Menu::SetItemCommand( USHORT nItemId, const String& rCommand ) +void Menu::SetItemCommand( sal_uInt16 nItemId, const String& rCommand ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1949,7 +1949,7 @@ void Menu::SetItemCommand( USHORT nItemId, const String& rCommand ) pData->aCommandStr = rCommand; } -const XubString& Menu::GetItemCommand( USHORT nItemId ) const +const XubString& Menu::GetItemCommand( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1959,7 +1959,7 @@ const XubString& Menu::GetItemCommand( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -void Menu::SetHelpCommand( USHORT nItemId, const XubString& rStr ) +void Menu::SetHelpCommand( sal_uInt16 nItemId, const XubString& rStr ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1967,7 +1967,7 @@ void Menu::SetHelpCommand( USHORT nItemId, const XubString& rStr ) pData->aHelpCommandStr = rStr; } -const XubString& Menu::GetHelpCommand( USHORT nItemId ) const +const XubString& Menu::GetHelpCommand( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1977,7 +1977,7 @@ const XubString& Menu::GetHelpCommand( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -void Menu::SetHelpText( USHORT nItemId, const XubString& rStr ) +void Menu::SetHelpText( sal_uInt16 nItemId, const XubString& rStr ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1985,7 +1985,7 @@ void Menu::SetHelpText( USHORT nItemId, const XubString& rStr ) pData->aHelpText = rStr; } -const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const +const XubString& Menu::ImplGetHelpText( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -2011,12 +2011,12 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -const XubString& Menu::GetHelpText( USHORT nItemId ) const +const XubString& Menu::GetHelpText( sal_uInt16 nItemId ) const { return ImplGetHelpText( nItemId ); } -void Menu::SetTipHelpText( USHORT nItemId, const XubString& rStr ) +void Menu::SetTipHelpText( sal_uInt16 nItemId, const XubString& rStr ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -2024,7 +2024,7 @@ void Menu::SetTipHelpText( USHORT nItemId, const XubString& rStr ) pData->aTipHelpText = rStr; } -const XubString& Menu::GetTipHelpText( USHORT nItemId ) const +const XubString& Menu::GetTipHelpText( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -2034,7 +2034,7 @@ const XubString& Menu::GetTipHelpText( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -void Menu::SetHelpId( USHORT nItemId, ULONG nHelpId ) +void Menu::SetHelpId( sal_uInt16 nItemId, sal_uIntPtr nHelpId ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -2042,7 +2042,7 @@ void Menu::SetHelpId( USHORT nItemId, ULONG nHelpId ) pData->nHelpId = nHelpId; } -ULONG Menu::GetHelpId( USHORT nItemId ) const +sal_uIntPtr Menu::GetHelpId( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -2058,8 +2058,8 @@ Menu& Menu::operator=( const Menu& rMenu ) Clear(); // Items kopieren - USHORT nCount = rMenu.GetItemCount(); - for ( USHORT i = 0; i < nCount; i++ ) + sal_uInt16 nCount = rMenu.GetItemCount(); + for ( sal_uInt16 i = 0; i < nCount; i++ ) ImplCopyItem( this, rMenu, i, MENU_APPEND, 1 ); nDefaultItem = rMenu.nDefaultItem; @@ -2073,24 +2073,24 @@ Menu& Menu::operator=( const Menu& rMenu ) return *this; } -BOOL Menu::ImplIsVisible( USHORT nPos ) const +sal_Bool Menu::ImplIsVisible( sal_uInt16 nPos ) const { - BOOL bVisible = TRUE; + sal_Bool bVisible = sal_True; MenuItemData* pData = pItemList->GetDataFromPos( nPos ); // check general visibility first if( pData && !pData->bVisible ) - bVisible = FALSE; + bVisible = sal_False; if ( bVisible && pData && pData->eType == MENUITEM_SEPARATOR ) { if( nPos == 0 ) // no separator should be shown at the very beginning - bVisible = FALSE; + bVisible = sal_False; else { // always avoid adjacent separators - USHORT nCount = (USHORT) pItemList->Count(); - USHORT n; + sal_uInt16 nCount = (sal_uInt16) pItemList->Count(); + sal_uInt16 n; MenuItemData* pNextData = NULL; // search next visible item for( n = nPos + 1; n < nCount; n++ ) @@ -2103,10 +2103,10 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const } } if( n == nCount ) // no next visible item - bVisible = FALSE; + bVisible = sal_False; // check for separator if( pNextData && pNextData->bVisible && pNextData->eType == MENUITEM_SEPARATOR ) - bVisible = FALSE; + bVisible = sal_False; if( bVisible ) { @@ -2120,7 +2120,7 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const } } if( n == 0 ) // no previous visible item - bVisible = FALSE; + bVisible = sal_False; } } } @@ -2131,10 +2131,10 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const !( nMenuFlags & MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES ) ) { if( !pData ) // e.g. nPos == ITEMPOS_INVALID - bVisible = FALSE; + bVisible = sal_False; else if ( pData->eType != MENUITEM_SEPARATOR ) // separators handled above { - // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( TRUE ) ); + // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( sal_True ) ); bVisible = pData->bEnabled; // SubMenus nicht pruefen, weil sie ggf. erst im Activate() gefuellt werden. } } @@ -2142,34 +2142,34 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const return bVisible; } -BOOL Menu::IsItemVisible( USHORT nItemId ) const +sal_Bool Menu::IsItemVisible( sal_uInt16 nItemId ) const { return IsMenuVisible() && ImplIsVisible( GetItemPos( nItemId ) ); } -BOOL Menu::IsItemPosVisible( USHORT nItemPos ) const +sal_Bool Menu::IsItemPosVisible( sal_uInt16 nItemPos ) const { return IsMenuVisible() && ImplIsVisible( nItemPos ); } -BOOL Menu::IsMenuVisible() const +sal_Bool Menu::IsMenuVisible() const { return pWindow && pWindow->IsReallyVisible(); } -BOOL Menu::ImplIsSelectable( USHORT nPos ) const +sal_Bool Menu::ImplIsSelectable( sal_uInt16 nPos ) const { - BOOL bSelectable = TRUE; + sal_Bool bSelectable = sal_True; MenuItemData* pData = pItemList->GetDataFromPos( nPos ); // check general visibility first if ( pData && ( pData->nBits & MIB_NOSELECT ) ) - bSelectable = FALSE; + bSelectable = sal_False; return bSelectable; } -void Menu::SelectItem( USHORT nItemId ) +void Menu::SelectItem( sal_uInt16 nItemId ) { if( bIsMenuBar ) static_cast<MenuBar*>(this)->SelectEntry( nItemId ); @@ -2284,7 +2284,7 @@ Size Menu::ImplCalcSize( Window* pWin ) if ( rSettings.GetUseImagesInMenus() ) { nMinMenuItemHeight = 16; - for ( USHORT i = (USHORT)pItemList->Count(); i; ) + for ( sal_uInt16 i = (sal_uInt16)pItemList->Count(); i; ) { MenuItemData* pData = pItemList->GetDataFromPos( --i ); if ( ImplIsVisible( i ) && (( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ))) @@ -2299,7 +2299,7 @@ Size Menu::ImplCalcSize( Window* pWin ) } } - for ( USHORT n = (USHORT)pItemList->Count(); n; ) + for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; ) { MenuItemData* pData = pItemList->GetDataFromPos( --n ); @@ -2397,8 +2397,8 @@ Size Menu::ImplCalcSize( Window* pWin ) if ( !bIsMenuBar ) { - USHORT gfxExtra = (USHORT) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text - nCheckPos = (USHORT)nExtra; + sal_uInt16 gfxExtra = (sal_uInt16) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text + nCheckPos = (sal_uInt16)nExtra; if (nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES) { long nImgOrChkWidth = 0; @@ -2408,12 +2408,12 @@ Size Menu::ImplCalcSize( Window* pWin ) else // non NWF case nImgOrChkWidth = nFontHeight/2 + gfxExtra; nImgOrChkWidth = Max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra ); - nTextPos = (USHORT)(nImagePos + nImgOrChkWidth); + nTextPos = (sal_uInt16)(nImagePos + nImgOrChkWidth); } else { nImagePos = nCheckPos; - nTextPos = (USHORT)(nImagePos + Max( aMaxImgSz.Width(), nCheckWidth )); + nTextPos = (sal_uInt16)(nImagePos + Max( aMaxImgSz.Width(), nCheckWidth )); } nTextPos = nTextPos + gfxExtra; @@ -2426,7 +2426,7 @@ Size Menu::ImplCalcSize( Window* pWin ) } else { - nTextPos = (USHORT)(2*nExtra); + nTextPos = (sal_uInt16)(2*nExtra); aSz.Height() = nFontHeight+6; // get menubar height from native methods if supported @@ -2468,7 +2468,7 @@ Size Menu::ImplCalcSize( Window* pWin ) static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRect, bool i_bHighlight ) { - BOOL bNativeOk = FALSE; + sal_Bool bNativeOk = sal_False; if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) { ImplControlValue aControlValue; @@ -2486,11 +2486,11 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec { const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings(); Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() ); - i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, FALSE, 2, NULL, &aColor ); + i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, sal_True, sal_False, 2, NULL, &aColor ); } } -void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* pThisItemOnly, BOOL bHighlighted, bool bLayout ) const +void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemData* pThisItemOnly, sal_Bool bHighlighted, bool bLayout ) const { // Fuer Symbole: nFontHeight x nFontHeight long nFontHeight = pWin->GetTextHeight(); @@ -2516,10 +2516,10 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* } Size aOutSz = pWin->GetOutputSizePixel(); - USHORT nCount = (USHORT)pItemList->Count(); + sal_uInt16 nCount = (sal_uInt16)pItemList->Count(); if( bLayout ) mpLayoutData->m_aVisibleItemBoundRects.clear(); - for ( USHORT n = 0; n < nCount; n++ ) + for ( sal_uInt16 n = 0; n < nCount; n++ ) { MenuItemData* pData = pItemList->GetDataFromPos( n ); if ( ImplIsVisible( n ) && ( !pThisItemOnly || ( pData == pThisItemOnly ) ) ) @@ -2536,9 +2536,9 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* long nTextOffsetY = ((pData->aSz.Height()-nFontHeight)/2); if( bIsMenuBar ) nTextOffsetY += (aOutSz.Height()-pData->aSz.Height()) / 2; - USHORT nTextStyle = 0; - USHORT nSymbolStyle = 0; - USHORT nImageStyle = 0; + sal_uInt16 nTextStyle = 0; + sal_uInt16 nSymbolStyle = 0; + sal_uInt16 nImageStyle = 0; // SubMenus ohne Items werden nicht mehr disablte dargestellt, // wenn keine Items enthalten sind, da die Anwendung selber // darauf achten muss. Ansonsten gibt es Faelle, wo beim @@ -2656,7 +2656,7 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* aTmpPos.X() = aPos.X() + nTextPos; aTmpPos.Y() = aPos.Y(); aTmpPos.Y() += nTextOffsetY; - USHORT nStyle = nTextStyle|TEXT_DRAW_MNEMONIC; + sal_uInt16 nStyle = nTextStyle|TEXT_DRAW_MNEMONIC; if ( pData->bIsTemporary ) nStyle |= TEXT_DRAW_DISABLE; MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL; @@ -2788,7 +2788,7 @@ Menu* Menu::ImplGetStartMenu() return pStart; } -void Menu::ImplCallHighlight( USHORT nHighlightedItem ) +void Menu::ImplCallHighlight( sal_uInt16 nHighlightedItem ) { nSelectedId = 0; MenuItemData* pData = pItemList->GetDataFromPos( nHighlightedItem ); @@ -2810,7 +2810,7 @@ Menu* Menu::ImplFindSelectMenu() { Menu* pSelMenu = nEventId ? this : NULL; - for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; ) + for ( sal_uIntPtr n = GetItemList()->Count(); n && !pSelMenu; ) { MenuItemData* pData = GetItemList()->GetDataFromPos( --n ); @@ -2821,11 +2821,11 @@ Menu* Menu::ImplFindSelectMenu() return pSelMenu; } -Menu* Menu::ImplFindMenu( USHORT nItemId ) +Menu* Menu::ImplFindMenu( sal_uInt16 nItemId ) { Menu* pSelMenu = NULL; - for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; ) + for ( sal_uIntPtr n = GetItemList()->Count(); n && !pSelMenu; ) { MenuItemData* pData = GetItemList()->GetDataFromPos( --n ); @@ -2838,25 +2838,25 @@ Menu* Menu::ImplFindMenu( USHORT nItemId ) return pSelMenu; } -void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups ) +void Menu::RemoveDisabledEntries( sal_Bool bCheckPopups, sal_Bool bRemoveEmptyPopups ) { - for ( USHORT n = 0; n < GetItemCount(); n++ ) + for ( sal_uInt16 n = 0; n < GetItemCount(); n++ ) { - BOOL bRemove = FALSE; + sal_Bool bRemove = sal_False; MenuItemData* pItem = pItemList->GetDataFromPos( n ); if ( pItem->eType == MENUITEM_SEPARATOR ) { if ( !n || ( GetItemType( n-1 ) == MENUITEM_SEPARATOR ) ) - bRemove = TRUE; + bRemove = sal_True; } else bRemove = !pItem->bEnabled; if ( bCheckPopups && pItem->pSubMenu ) { - pItem->pSubMenu->RemoveDisabledEntries( TRUE ); + pItem->pSubMenu->RemoveDisabledEntries( sal_True ); if ( bRemoveEmptyPopups && !pItem->pSubMenu->GetItemCount() ) - bRemove = TRUE; + bRemove = sal_True; } if ( bRemove ) @@ -2865,7 +2865,7 @@ void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups ) if ( GetItemCount() ) { - USHORT nLast = GetItemCount() - 1; + sal_uInt16 nLast = GetItemCount() - 1; MenuItemData* pItem = pItemList->GetDataFromPos( nLast ); if ( pItem->eType == MENUITEM_SEPARATOR ) RemoveItem( nLast ); @@ -2873,19 +2873,19 @@ void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups ) delete mpLayoutData, mpLayoutData = NULL; } -BOOL Menu::HasValidEntries( BOOL bCheckPopups ) +sal_Bool Menu::HasValidEntries( sal_Bool bCheckPopups ) { - BOOL bValidEntries = FALSE; - USHORT nCount = GetItemCount(); - for ( USHORT n = 0; !bValidEntries && ( n < nCount ); n++ ) + sal_Bool bValidEntries = sal_False; + sal_uInt16 nCount = GetItemCount(); + for ( sal_uInt16 n = 0; !bValidEntries && ( n < nCount ); n++ ) { MenuItemData* pItem = pItemList->GetDataFromPos( n ); if ( pItem->bEnabled && ( pItem->eType != MENUITEM_SEPARATOR ) ) { if ( bCheckPopups && pItem->pSubMenu ) - bValidEntries = pItem->pSubMenu->HasValidEntries( TRUE ); + bValidEntries = pItem->pSubMenu->HasValidEntries( sal_True ); else - bValidEntries = TRUE; + bValidEntries = sal_True; } } return bValidEntries; @@ -2923,12 +2923,12 @@ void Menu::ImplFillLayoutData() const mpLayoutData = new MenuLayoutData(); if( bIsMenuBar ) { - ImplPaint( pWindow, 0, 0, 0, FALSE, true ); + ImplPaint( pWindow, 0, 0, 0, sal_False, true ); } else { MenuFloatingWindow* pFloat = (MenuFloatingWindow*)pWindow; - ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, FALSE, true ); + ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, sal_False, true ); } } } @@ -2940,7 +2940,7 @@ String Menu::GetDisplayText() const return mpLayoutData ? mpLayoutData->m_aDisplayText : String(); } -Rectangle Menu::GetCharacterBounds( USHORT nItemID, long nIndex ) const +Rectangle Menu::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const { long nItemIndex = -1; if( ! mpLayoutData ) @@ -2960,7 +2960,7 @@ Rectangle Menu::GetCharacterBounds( USHORT nItemID, long nIndex ) const } -long Menu::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const +long Menu::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const { long nIndex = -1; rItemID = 0; @@ -2998,7 +2998,7 @@ Pair Menu::GetLineStartEnd( long nLine ) const return mpLayoutData ? mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 ); } -Pair Menu::GetItemStartEnd( USHORT nItem ) const +Pair Menu::GetItemStartEnd( sal_uInt16 nItem ) const { if( ! mpLayoutData ) ImplFillLayoutData(); @@ -3010,9 +3010,9 @@ Pair Menu::GetItemStartEnd( USHORT nItem ) const return Pair( -1, -1 ); } -USHORT Menu::GetDisplayItemId( long nLine ) const +sal_uInt16 Menu::GetDisplayItemId( long nLine ) const { - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if( ! mpLayoutData ) ImplFillLayoutData(); if( mpLayoutData && ( nLine >= 0 ) && ( nLine < (long)mpLayoutData->m_aLineItemIds.size() ) ) @@ -3020,19 +3020,19 @@ USHORT Menu::GetDisplayItemId( long nLine ) const return nItemId; } -BOOL Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const +sal_Bool Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( pWindow && pReferenceWindow ) { rPoint = pReferenceWindow->OutputToAbsoluteScreenPixel( rPoint ); rPoint = pWindow->AbsoluteScreenToOutputPixel( rPoint ); - bRet = TRUE; + bRet = sal_True; } return bRet; } -Rectangle Menu::GetBoundingRectangle( USHORT nPos ) const +Rectangle Menu::GetBoundingRectangle( sal_uInt16 nPos ) const { Rectangle aRet; @@ -3040,16 +3040,16 @@ Rectangle Menu::GetBoundingRectangle( USHORT nPos ) const ImplFillLayoutData(); if( mpLayoutData ) { - std::map< USHORT, Rectangle >::const_iterator it = mpLayoutData->m_aVisibleItemBoundRects.find( nPos ); + std::map< sal_uInt16, Rectangle >::const_iterator it = mpLayoutData->m_aVisibleItemBoundRects.find( nPos ); if( it != mpLayoutData->m_aVisibleItemBoundRects.end() ) aRet = it->second; } return aRet; } -void Menu::SetAccessibleName( USHORT nItemId, const XubString& rStr ) +void Menu::SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( pData && !rStr.Equals( pData->aAccessibleName ) ) @@ -3059,7 +3059,7 @@ void Menu::SetAccessibleName( USHORT nItemId, const XubString& rStr ) } } -XubString Menu::GetAccessibleName( USHORT nItemId ) const +XubString Menu::GetAccessibleName( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -3069,7 +3069,7 @@ XubString Menu::GetAccessibleName( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -void Menu::SetAccessibleDescription( USHORT nItemId, const XubString& rStr ) +void Menu::SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -3077,7 +3077,7 @@ void Menu::SetAccessibleDescription( USHORT nItemId, const XubString& rStr ) pData->aAccessibleDescription = rStr; } -XubString Menu::GetAccessibleDescription( USHORT nItemId ) const +XubString Menu::GetAccessibleDescription( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -3094,19 +3094,19 @@ void Menu::ImplSetSalMenu( SalMenu *pSalMenu ) mpSalMenu = pSalMenu; } -BOOL Menu::GetSystemMenuData( SystemMenuData* pData ) const +sal_Bool Menu::GetSystemMenuData( SystemMenuData* pData ) const { Menu* pMenu = (Menu*)this; if( pData && pMenu->ImplGetSalMenu() ) { pMenu->ImplGetSalMenu()->GetSystemMenuData( pData ); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } -bool Menu::IsHighlighted( USHORT nItemPos ) const +bool Menu::IsHighlighted( sal_uInt16 nItemPos ) const { bool bRet = false; @@ -3121,19 +3121,19 @@ bool Menu::IsHighlighted( USHORT nItemPos ) const return bRet; } -void Menu::HighlightItem( USHORT nItemPos ) +void Menu::HighlightItem( sal_uInt16 nItemPos ) { if ( pWindow ) { if ( bIsMenuBar ) { MenuBarWindow* pMenuWin = static_cast< MenuBarWindow* >( pWindow ); - pMenuWin->SetAutoPopup( FALSE ); - pMenuWin->ChangeHighlightItem( nItemPos, FALSE ); + pMenuWin->SetAutoPopup( sal_False ); + pMenuWin->ChangeHighlightItem( nItemPos, sal_False ); } else { - static_cast< MenuFloatingWindow* >( pWindow )->ChangeHighlightItem( nItemPos, FALSE ); + static_cast< MenuFloatingWindow* >( pWindow )->ChangeHighlightItem( nItemPos, sal_False ); } } } @@ -3142,54 +3142,54 @@ void Menu::HighlightItem( USHORT nItemPos ) // - MenuBar - // ----------- -MenuBar::MenuBar() : Menu( TRUE ) +MenuBar::MenuBar() : Menu( sal_True ) { - mbDisplayable = TRUE; - mbCloserVisible = FALSE; - mbFloatBtnVisible = FALSE; - mbHideBtnVisible = FALSE; + mbDisplayable = sal_True; + mbCloserVisible = sal_False; + mbFloatBtnVisible = sal_False; + mbHideBtnVisible = sal_False; } -MenuBar::MenuBar( const MenuBar& rMenu ) : Menu( TRUE ) +MenuBar::MenuBar( const MenuBar& rMenu ) : Menu( sal_True ) { - mbDisplayable = TRUE; - mbCloserVisible = FALSE; - mbFloatBtnVisible = FALSE; - mbHideBtnVisible = FALSE; + mbDisplayable = sal_True; + mbCloserVisible = sal_False; + mbFloatBtnVisible = sal_False; + mbHideBtnVisible = sal_False; *this = rMenu; - bIsMenuBar = TRUE; + bIsMenuBar = sal_True; } -MenuBar::MenuBar( const ResId& rResId ) : Menu ( TRUE ) +MenuBar::MenuBar( const ResId& rResId ) : Menu ( sal_True ) { - mbDisplayable = TRUE; - mbCloserVisible = FALSE; - mbFloatBtnVisible = FALSE; - mbHideBtnVisible = FALSE; + mbDisplayable = sal_True; + mbCloserVisible = sal_False; + mbFloatBtnVisible = sal_False; + mbHideBtnVisible = sal_False; ImplLoadRes( rResId ); } MenuBar::~MenuBar() { - ImplDestroy( this, TRUE ); + ImplDestroy( this, sal_True ); } -void MenuBar::ShowCloser( BOOL bShow ) +void MenuBar::ShowCloser( sal_Bool bShow ) { ShowButtons( bShow, mbFloatBtnVisible, mbHideBtnVisible ); } -void MenuBar::ShowFloatButton( BOOL bShow ) +void MenuBar::ShowFloatButton( sal_Bool bShow ) { ShowButtons( mbCloserVisible, bShow, mbHideBtnVisible ); } -void MenuBar::ShowHideButton( BOOL bShow ) +void MenuBar::ShowHideButton( sal_Bool bShow ) { ShowButtons( mbCloserVisible, mbFloatBtnVisible, bShow ); } -void MenuBar::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide ) +void MenuBar::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide ) { if ( (bClose != mbCloserVisible) || (bFloat != mbFloatBtnVisible) || @@ -3203,7 +3203,7 @@ void MenuBar::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide ) } } -void MenuBar::SetDisplayable( BOOL bDisplayable ) +void MenuBar::SetDisplayable( sal_Bool bDisplayable ) { if( bDisplayable != mbDisplayable ) { @@ -3234,7 +3234,7 @@ Window* MenuBar::ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu ) return pWindow; } -void MenuBar::ImplDestroy( MenuBar* pMenu, BOOL bDelete ) +void MenuBar::ImplDestroy( MenuBar* pMenu, sal_Bool bDelete ) { MenuBarWindow* pWindow = (MenuBarWindow*) pMenu->ImplGetWindow(); if ( pWindow && bDelete ) @@ -3245,9 +3245,9 @@ void MenuBar::ImplDestroy( MenuBar* pMenu, BOOL bDelete ) pMenu->pWindow = NULL; } -BOOL MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu ) +sal_Bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; // No keyboard processing when system handles the menu or our menubar is invisible if( !IsDisplayable() || @@ -3263,7 +3263,7 @@ BOOL MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu ) // ----------------------------------------------------------------------- -void MenuBar::SelectEntry( USHORT nId ) +void MenuBar::SelectEntry( sal_uInt16 nId ) { MenuBarWindow* pMenuWin = (MenuBarWindow*) ImplGetWindow(); @@ -3273,14 +3273,14 @@ void MenuBar::SelectEntry( USHORT nId ) nId = GetItemPos( nId ); // #99705# popup the selected menu - pMenuWin->SetAutoPopup( TRUE ); + pMenuWin->SetAutoPopup( sal_True ); if( ITEMPOS_INVALID != pMenuWin->nHighlightedItem ) { pMenuWin->KillActivePopup(); - pMenuWin->ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + pMenuWin->ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); } if( nId != ITEMPOS_INVALID ) - pMenuWin->ChangeHighlightItem( nId, FALSE ); + pMenuWin->ChangeHighlightItem( nId, sal_False ); } } @@ -3288,31 +3288,31 @@ void MenuBar::SelectEntry( USHORT nId ) // handler for native menu selection and command events -BOOL MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const +sal_Bool MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const { if( pMenu ) { pMenu->pStartedFrom = (Menu*)this; - pMenu->bInCallback = TRUE; + pMenu->bInCallback = sal_True; pMenu->Activate(); - pMenu->bInCallback = FALSE; + pMenu->bInCallback = sal_False; } - return TRUE; + return sal_True; } -BOOL MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const +sal_Bool MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const { if( pMenu ) { pMenu->pStartedFrom = (Menu*)this; - pMenu->bInCallback = TRUE; + pMenu->bInCallback = sal_True; pMenu->Deactivate(); - pMenu->bInCallback = FALSE; + pMenu->bInCallback = sal_False; } - return TRUE; + return sal_True; } -BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId ) const +sal_Bool MenuBar::HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nHighlightEventId ) const { if( !pMenu ) pMenu = ((Menu*) this)->ImplFindMenu( nHighlightEventId ); @@ -3325,13 +3325,13 @@ BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId ) pMenu->nSelectedId = nHighlightEventId; pMenu->pStartedFrom = (Menu*)this; pMenu->ImplCallHighlight( pMenu->mnHighlightedItemPos ); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } -BOOL MenuBar::HandleMenuCommandEvent( Menu *pMenu, USHORT nCommandEventId ) const +sal_Bool MenuBar::HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nCommandEventId ) const { if( !pMenu ) pMenu = ((Menu*) this)->ImplFindMenu( nCommandEventId ); @@ -3340,47 +3340,47 @@ BOOL MenuBar::HandleMenuCommandEvent( Menu *pMenu, USHORT nCommandEventId ) cons pMenu->nSelectedId = nCommandEventId; pMenu->pStartedFrom = (Menu*)this; pMenu->ImplSelect(); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } -USHORT MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, USHORT i_nPos ) +sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, sal_uInt16 i_nPos ) { return AddMenuBarButton( i_rImage, i_rLink, String(), i_nPos ); } -USHORT MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, USHORT i_nPos ) +sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, sal_uInt16 i_nPos ) { return pWindow ? static_cast<MenuBarWindow*>(pWindow)->AddMenuBarButton( i_rImage, i_rLink, i_rToolTip, i_nPos ) : 0; } -void MenuBar::SetMenuBarButtonHighlightHdl( USHORT nId, const Link& rLink ) +void MenuBar::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& rLink ) { if( pWindow ) static_cast<MenuBarWindow*>(pWindow)->SetMenuBarButtonHighlightHdl( nId, rLink ); } -Rectangle MenuBar::GetMenuBarButtonRectPixel( USHORT nId ) +Rectangle MenuBar::GetMenuBarButtonRectPixel( sal_uInt16 nId ) { return pWindow ? static_cast<MenuBarWindow*>(pWindow)->GetMenuBarButtonRectPixel( nId ) : Rectangle(); } -void MenuBar::RemoveMenuBarButton( USHORT nId ) +void MenuBar::RemoveMenuBarButton( sal_uInt16 nId ) { if( pWindow ) static_cast<MenuBarWindow*>(pWindow)->RemoveMenuBarButton( nId ); } -BOOL MenuBar::HandleMenuButtonEvent( Menu *, USHORT i_nButtonId ) const +sal_Bool MenuBar::HandleMenuButtonEvent( Menu *, sal_uInt16 i_nButtonId ) const { return static_cast<MenuBarWindow*>(pWindow)->HandleMenuButtonEvent( i_nButtonId ); } // ----------------------------------------------------------------------- -// BOOL PopupMenu::bAnyPopupInExecute = FALSE; +// sal_Bool PopupMenu::bAnyPopupInExecute = sal_False; PopupMenu::PopupMenu() { @@ -3405,9 +3405,9 @@ PopupMenu::~PopupMenu() *pRefAutoSubMenu = NULL; // #111060# avoid second delete in ~MenuItemData } -BOOL PopupMenu::IsInExecute() +sal_Bool PopupMenu::IsInExecute() { - return GetActivePopupMenu() ? TRUE : FALSE; + return GetActivePopupMenu() ? sal_True : sal_False; } PopupMenu* PopupMenu::GetActivePopupMenu() @@ -3416,22 +3416,22 @@ PopupMenu* PopupMenu::GetActivePopupMenu() return pSVData->maAppData.mpActivePopupMenu; } -void PopupMenu::EndExecute( USHORT nSelectId ) +void PopupMenu::EndExecute( sal_uInt16 nSelectId ) { if ( ImplGetWindow() ) ImplGetFloatingWindow()->EndExecute( nSelectId ); } -void PopupMenu::SelectEntry( USHORT nId ) +void PopupMenu::SelectEntry( sal_uInt16 nId ) { if ( ImplGetWindow() ) { if( nId != ITEMPOS_INVALID ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = GetItemList()->GetData( nId, nPos ); if ( pData->pSubMenu ) - ImplGetFloatingWindow()->ChangeHighlightItem( nPos, TRUE ); + ImplGetFloatingWindow()->ChangeHighlightItem( nPos, sal_True ); else ImplGetFloatingWindow()->EndExecute( nId ); } @@ -3439,7 +3439,7 @@ void PopupMenu::SelectEntry( USHORT nId ) { MenuFloatingWindow* pFloat = ImplGetFloatingWindow(); pFloat->GrabFocus(); - USHORT nPos; + sal_uInt16 nPos; for( nPos = 0; nPos < GetItemList()->Count(); nPos++ ) { MenuItemData* pData = (MenuItemData*)GetItemList()->GetObject( nPos ); @@ -3448,27 +3448,27 @@ void PopupMenu::SelectEntry( USHORT nId ) pFloat->KillActivePopup(); } } - pFloat->ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + pFloat->ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); } } } -void PopupMenu::SetSelectedEntry( USHORT nId ) +void PopupMenu::SetSelectedEntry( sal_uInt16 nId ) { nSelectedId = nId; } -USHORT PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos ) +sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos ) { return Execute( pExecWindow, Rectangle( rPopupPos, rPopupPos ), POPUPMENU_EXECUTE_DOWN ); } -USHORT PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, USHORT nFlags ) +sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, sal_uInt16 nFlags ) { ENSURE_OR_RETURN( pExecWindow, "PopupMenu::Execute: need a non-NULL window!", 0 ); - ULONG nPopupModeFlags = 0; + sal_uIntPtr nPopupModeFlags = 0; if ( nFlags & POPUPMENU_EXECUTE_DOWN ) nPopupModeFlags = FLOATWIN_POPUPMODE_DOWN; else if ( nFlags & POPUPMENU_EXECUTE_UP ) @@ -3483,10 +3483,10 @@ USHORT PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, USHORT n if (nFlags & POPUPMENU_NOMOUSEUPCLOSE ) // allow popup menus to stay open on mouse button up nPopupModeFlags |= FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE; // useful if the menu was opened on mousebutton down (eg toolbox configuration) - return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, FALSE ); + return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, sal_False ); } -USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupModeFlags, Menu* pSFrom, BOOL bPreSelectFirst ) +sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uIntPtr nPopupModeFlags, Menu* pSFrom, sal_Bool bPreSelectFirst ) { if ( !pSFrom && ( PopupMenu::IsInExecute() || !GetItemCount() ) ) return 0; @@ -3497,15 +3497,15 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM pStartedFrom = pSFrom; nSelectedId = 0; - bCanceled = FALSE; + bCanceled = sal_False; - ULONG nFocusId = 0; - BOOL bRealExecute = FALSE; + sal_uIntPtr nFocusId = 0; + sal_Bool bRealExecute = sal_False; if ( !pStartedFrom ) { - pSVData->maWinData.mbNoDeactivate = TRUE; + pSVData->maWinData.mbNoDeactivate = sal_True; nFocusId = Window::SaveFocus(); - bRealExecute = TRUE; + bRealExecute = sal_True; } else { @@ -3532,9 +3532,9 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM ImplDelData aDelData; pW->ImplAddDel( &aDelData ); - bInCallback = TRUE; // hier schon setzen, falls Activate ueberladen + bInCallback = sal_True; // hier schon setzen, falls Activate ueberladen Activate(); - bInCallback = FALSE; + bInCallback = sal_False; if ( aDelData.IsDelete() ) return 0; // Error @@ -3560,7 +3560,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM nMenuFlags |= MENU_FLAG_HIDEDISABLEDENTRIES; - USHORT nVisibleEntries = ImplGetVisibleItemCount(); + sal_uInt16 nVisibleEntries = ImplGetVisibleItemCount(); if ( !nVisibleEntries ) { ResMgr* pResMgr = ImplGetResMgr(); @@ -3569,7 +3569,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM String aTmpEntryText( ResId( SV_RESID_STRING_NOSELECTIONPOSSIBLE, *pResMgr ) ); MenuItemData* pData = pItemList->Insert( 0xFFFF, MENUITEM_STRING, 0, aTmpEntryText, Image(), NULL, 0xFFFF ); - pData->bIsTemporary = TRUE; + pData->bIsTemporary = sal_True; } } else if ( Application::GetSettings().GetStyleSettings().GetAutoMnemonic() && !( nMenuFlags & MENU_FLAG_NOAUTOMNEMONICS ) ) @@ -3604,9 +3604,9 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM nMaxHeight -= nTop+nBottom; if ( aSz.Height() > nMaxHeight ) { - pWin->EnableScrollMenu( TRUE ); - USHORT nStart = ImplGetFirstVisible(); - USHORT nEntries = ImplCalcVisEntries( nMaxHeight, nStart ); + pWin->EnableScrollMenu( sal_True ); + sal_uInt16 nStart = ImplGetFirstVisible(); + sal_uInt16 nEntries = ImplCalcVisEntries( nMaxHeight, nStart ); aSz.Height() = ImplCalcHeight( nEntries ); } @@ -3635,7 +3635,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM } if( pSFrom ) { - USHORT aPos; + sal_uInt16 aPos; if( pSFrom->bIsMenuBar ) aPos = ((MenuBarWindow *) pSFrom->pWindow)->GetHighlightedItem(); else @@ -3647,14 +3647,14 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM } if ( bPreSelectFirst ) { - USHORT nCount = (USHORT)pItemList->Count(); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nCount = (sal_uInt16)pItemList->Count(); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { MenuItemData* pData = pItemList->GetDataFromPos( n ); if ( ( pData->bEnabled || !Application::GetSettings().GetStyleSettings().GetSkipDisabledInMenus() ) && ( pData->eType != MENUITEM_SEPARATOR ) && ImplIsVisible( n ) && ImplIsSelectable( n ) ) { - pWin->ChangeHighlightItem( n, FALSE ); + pWin->ChangeHighlightItem( n, sal_False ); break; } } @@ -3684,7 +3684,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM if ( nFocusId ) { pWin->SetFocusId( 0 ); - pSVData->maWinData.mbNoDeactivate = FALSE; + pSVData->maWinData.mbNoDeactivate = sal_False; } pWin->ImplEndPopupMode( 0, nFocusId ); @@ -3715,18 +3715,18 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM return bRealExecute ? nSelectedId : 0; } -USHORT PopupMenu::ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry, USHORT* pLastVisible ) const +sal_uInt16 PopupMenu::ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible ) const { nMaxHeight -= 2 * ImplGetFloatingWindow()->GetScrollerHeight(); long nHeight = 0; - USHORT nEntries = (USHORT) pItemList->Count(); - USHORT nVisEntries = 0; + sal_uInt16 nEntries = (sal_uInt16) pItemList->Count(); + sal_uInt16 nVisEntries = 0; if ( pLastVisible ) *pLastVisible = 0; - for ( USHORT n = nStartEntry; n < nEntries; n++ ) + for ( sal_uInt16 n = nStartEntry; n < nEntries; n++ ) { if ( ImplIsVisible( n ) ) { @@ -3743,14 +3743,14 @@ USHORT PopupMenu::ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry, USHOR return nVisEntries; } -long PopupMenu::ImplCalcHeight( USHORT nEntries ) const +long PopupMenu::ImplCalcHeight( sal_uInt16 nEntries ) const { long nHeight = 0; - USHORT nFound = 0; - for ( USHORT n = 0; ( nFound < nEntries ) && ( n < pItemList->Count() ); n++ ) + sal_uInt16 nFound = 0; + for ( sal_uInt16 n = 0; ( nFound < nEntries ) && ( n < pItemList->Count() ); n++ ) { - if ( ImplIsVisible( (USHORT) n ) ) + if ( ImplIsVisible( (sal_uInt16) n ) ) { MenuItemData* pData = pItemList->GetDataFromPos( n ); nHeight += pData->aSz.Height(); @@ -3764,7 +3764,7 @@ long PopupMenu::ImplCalcHeight( USHORT nEntries ) const } -static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar ) +static void ImplInitMenuWindow( Window* pWin, sal_Bool bFont, sal_Bool bMenuBar ) { const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings(); @@ -3781,7 +3781,7 @@ static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar ) Wallpaper aWallpaper; aWallpaper.SetStyle( WALLPAPER_APPLICATIONGRADIENT ); pWin->SetBackground( aWallpaper ); - pWin->SetPaintTransparent( FALSE ); + pWin->SetPaintTransparent( sal_False ); pWin->SetParentClipMode( 0 ); } } @@ -3806,12 +3806,12 @@ static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar ) MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nStyle ) : FloatingWindow( pParent, nStyle ) { - mpWindowImpl->mbMenuFloatingWindow= TRUE; + mpWindowImpl->mbMenuFloatingWindow= sal_True; pMenu = pMen; pActivePopup = 0; nSaveFocusId = 0; - bInExecute = FALSE; - bScrollMenu = FALSE; + bInExecute = sal_False; + bScrollMenu = sal_False; nHighlightedItem = ITEMPOS_INVALID; nMBDownPos = ITEMPOS_INVALID; nPosInParent = ITEMPOS_INVALID; @@ -3819,13 +3819,13 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nSt // nStartY = 0; nBorder = EXTRASPACEY; nFirstEntry = 0; - bScrollUp = FALSE; - bScrollDown = FALSE; - bIgnoreFirstMove = TRUE; - bKeyInput = FALSE; + bScrollUp = sal_False; + bScrollDown = sal_False; + bIgnoreFirstMove = sal_True; + bKeyInput = sal_False; EnableSaveBackground(); - ImplInitMenuWindow( this, TRUE, FALSE ); + ImplInitMenuWindow( this, sal_True, sal_False ); SetPopupModeEndHdl( LINK( this, MenuFloatingWindow, PopupEnd ) ); @@ -3851,7 +3851,7 @@ void MenuFloatingWindow::doShutdown() { // #102461# remove highlight in parent MenuItemData* pData; - USHORT i, nCount = (USHORT)pMenu->pStartedFrom->pItemList->Count(); + sal_uInt16 i, nCount = (sal_uInt16)pMenu->pStartedFrom->pItemList->Count(); for(i = 0; i < nCount; i++) { pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i ); @@ -3862,7 +3862,7 @@ void MenuFloatingWindow::doShutdown() { MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow(); if( pPWin ) - pPWin->HighlightItem( i, FALSE ); + pPWin->HighlightItem( i, sal_False ); } } @@ -3898,13 +3898,13 @@ long MenuFloatingWindow::ImplGetStartY() const long nY = 0; if( pMenu ) { - for ( USHORT n = 0; n < nFirstEntry; n++ ) + for ( sal_uInt16 n = 0; n < nFirstEntry; n++ ) nY += pMenu->GetItemList()->GetDataFromPos( n )->aSz.Height(); } return -nY; } -Region MenuFloatingWindow::ImplCalcClipRegion( BOOL bIncludeLogo ) const +Region MenuFloatingWindow::ImplCalcClipRegion( sal_Bool bIncludeLogo ) const { Size aOutSz = GetOutputSizePixel(); Point aPos; @@ -3934,7 +3934,7 @@ void MenuFloatingWindow::ImplInitClipRegion() } } -void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown ) +void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown ) { if( ! pMenu ) return; @@ -3944,10 +3944,10 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow Size aOutSz = GetOutputSizePixel(); if ( ( nMouseY >= nY ) && ( nMouseY < ( aOutSz.Height() - nY ) ) ) { - BOOL bHighlighted = FALSE; - USHORT nCount = (USHORT)pMenu->pItemList->Count(); + sal_Bool bHighlighted = sal_False; + sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count(); nY += ImplGetStartY(); // ggf. gescrollt. - for ( USHORT n = 0; !bHighlighted && ( n < nCount ); n++ ) + for ( sal_uInt16 n = 0; !bHighlighted && ( n < nCount ); n++ ) { if ( pMenu->ImplIsVisible( n ) ) { @@ -3956,7 +3956,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow nY += pItemData->aSz.Height(); if ( ( nOldY <= nMouseY ) && ( nY > nMouseY ) && pMenu->ImplIsSelectable( n ) ) { - BOOL bPopupArea = TRUE; + sal_Bool bPopupArea = sal_True; if ( pItemData->nBits & MIB_POPUPSELECT ) { // Nur wenn ueber dem Pfeil geklickt wurde... @@ -3969,10 +3969,10 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow { if ( n != nHighlightedItem ) { - ChangeHighlightItem( (USHORT)n, FALSE ); + ChangeHighlightItem( (sal_uInt16)n, sal_False ); } - BOOL bAllowNewPopup = TRUE; + sal_Bool bAllowNewPopup = sal_True; if ( pActivePopup ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); @@ -3990,7 +3990,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow { if ( n != nHighlightedItem ) { - ChangeHighlightItem( (USHORT)n, TRUE ); + ChangeHighlightItem( (sal_uInt16)n, sal_True ); } else if ( pItemData->nBits & MIB_POPUPSELECT ) { @@ -3998,17 +3998,17 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow HighlightChanged( NULL ); } } - bHighlighted = TRUE; + bHighlighted = sal_True; } } } if ( !bHighlighted ) - ChangeHighlightItem( ITEMPOS_INVALID, TRUE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_True ); } else { ImplScroll( rMEvt.GetPosPixel() ); - ChangeHighlightItem( ITEMPOS_INVALID, TRUE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_True ); } } @@ -4022,12 +4022,12 @@ IMPL_LINK( MenuFloatingWindow, PopupEnd, FloatingWindow*, EMPTYARG ) { //DBG_ASSERT( !pActivePopup->ImplGetWindow(), "PopupEnd, obwohl pActivePopup MIT Window!" ); KillActivePopup(); // should be ok to just remove it - //pActivePopup->bCanceled = TRUE; + //pActivePopup->bCanceled = sal_True; } - bInExecute = FALSE; - pMenu->bInCallback = TRUE; + bInExecute = sal_False; + pMenu->bInCallback = sal_True; pMenu->Deactivate(); - pMenu->bInCallback = FALSE; + pMenu->bInCallback = sal_False; } else { @@ -4077,7 +4077,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer ) { if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) ) { - ULONG nOldFlags = GetPopupModeFlags(); + sal_uIntPtr nOldFlags = GetPopupModeFlags(); SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); KillActivePopup(); SetPopupModeFlags( nOldFlags ); @@ -4087,7 +4087,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer ) pActivePopup = (PopupMenu*)pItemData->pSubMenu; long nY = nScrollerHeight+ImplGetStartY(); MenuItemData* pData = 0; - for ( ULONG n = 0; n < nHighlightedItem; n++ ) + for ( sal_uIntPtr n = 0; n < nHighlightedItem; n++ ) { pData = pMenu->pItemList->GetDataFromPos( n ); nY += pData->aSz.Height(); @@ -4118,9 +4118,9 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer ) // die lange im Activate Rescheduled haben und jetzt schon nicht mehr // angezeigt werden sollen. Menu* pTest = pActivePopup; - ULONG nOldFlags = GetPopupModeFlags(); + sal_uIntPtr nOldFlags = GetPopupModeFlags(); SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); - USHORT nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? FALSE : TRUE ); + sal_uInt16 nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? sal_False : sal_True ); SetPopupModeFlags( nOldFlags ); // nRet != 0, wenn es waerend Activate() abgeschossen wurde... @@ -4155,11 +4155,11 @@ IMPL_LINK( MenuFloatingWindow, ShowHideListener, VclWindowEvent*, pEvent ) return 0; } -void MenuFloatingWindow::EnableScrollMenu( BOOL b ) +void MenuFloatingWindow::EnableScrollMenu( sal_Bool b ) { bScrollMenu = b; - nScrollerHeight = b ? (USHORT) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0; - bScrollDown = TRUE; + nScrollerHeight = b ? (sal_uInt16) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0; + bScrollDown = sal_True; ImplInitClipRegion(); } @@ -4169,8 +4169,8 @@ void MenuFloatingWindow::Execute() pSVData->maAppData.mpActivePopupMenu = (PopupMenu*)pMenu; - bInExecute = TRUE; -// bCallingSelect = FALSE; + bInExecute = sal_True; +// bCallingSelect = sal_False; while ( bInExecute ) Application::Yield(); @@ -4181,24 +4181,24 @@ void MenuFloatingWindow::Execute() // Application::Yield(); } -void MenuFloatingWindow::StopExecute( ULONG nFocusId ) +void MenuFloatingWindow::StopExecute( sal_uIntPtr nFocusId ) { // Focus wieder herstellen // (kann schon im Select wieder hergestellt wurden sein) if ( nSaveFocusId ) { - Window::EndSaveFocus( nFocusId, FALSE ); + Window::EndSaveFocus( nFocusId, sal_False ); nFocusId = nSaveFocusId; if ( nFocusId ) { nSaveFocusId = 0; - ImplGetSVData()->maWinData.mbNoDeactivate = FALSE; + ImplGetSVData()->maWinData.mbNoDeactivate = sal_False; } } ImplEndPopupMode( 0, nFocusId ); aHighlightChangedTimer.Stop(); - bInExecute = FALSE; + bInExecute = sal_False; if ( pActivePopup ) { KillActivePopup(); @@ -4216,15 +4216,15 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) if( ((FloatingWindow *) pActivePopup->pWindow)->IsInCleanUp() ) return; // kill it later if ( pActivePopup->bInCallback ) - pActivePopup->bCanceled = TRUE; + pActivePopup->bCanceled = sal_True; // Vor allen Aktionen schon pActivePopup = 0, falls z.B. // PopupModeEndHdl des zu zerstoerenden Popups mal synchron gerufen wird. PopupMenu* pPopup = pActivePopup; pActivePopup = NULL; - pPopup->bInCallback = TRUE; + pPopup->bInCallback = sal_True; pPopup->Deactivate(); - pPopup->bInCallback = FALSE; + pPopup->bInCallback = sal_False; if ( pPopup->ImplGetWindow() ) { pPopup->ImplGetFloatingWindow()->StopExecute(); @@ -4240,14 +4240,14 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) void MenuFloatingWindow::EndExecute() { Menu* pStart = pMenu ? pMenu->ImplGetStartMenu() : NULL; - ULONG nFocusId = 0; + sal_uIntPtr nFocusId = 0; if ( pStart && pStart->bIsMenuBar ) { nFocusId = ((MenuBarWindow*)((MenuBar*)pStart)->ImplGetWindow())->GetFocusId(); if ( nFocusId ) { ((MenuBarWindow*)((MenuBar*)pStart)->ImplGetWindow())->SetFocusId( 0 ); - ImplGetSVData()->maWinData.mbNoDeactivate = FALSE; + ImplGetSVData()->maWinData.mbNoDeactivate = sal_False; } } @@ -4264,7 +4264,7 @@ void MenuFloatingWindow::EndExecute() // Dies Fenster wird gleich zerstoert => Daten lokal merken... Menu* pM = pMenu; - USHORT nItem = nHighlightedItem; + sal_uInt16 nItem = nHighlightedItem; pCleanUpFrom->StopExecute( nFocusId ); @@ -4282,9 +4282,9 @@ void MenuFloatingWindow::EndExecute() } } -void MenuFloatingWindow::EndExecute( USHORT nId ) +void MenuFloatingWindow::EndExecute( sal_uInt16 nId ) { - USHORT nPos; + sal_uInt16 nPos; if ( pMenu && pMenu->GetItemList()->GetData( nId, nPos ) ) nHighlightedItem = nPos; else @@ -4301,7 +4301,7 @@ void MenuFloatingWindow::MouseButtonDown( const MouseEvent& rMEvt ) //if ( pActivePopup && pActivePopup->ImplGetWindow() && !pActivePopup->ImplGetFloatingWindow()->pActivePopup ) // pActivePopup->ImplGetFloatingWindow()->ToTop( TOTOP_NOGRABFOCUS ); - ImplHighlightItem( rMEvt, TRUE ); + ImplHighlightItem( rMEvt, sal_True ); nMBDownPos = nHighlightedItem; } @@ -4311,7 +4311,7 @@ void MenuFloatingWindow::MouseButtonUp( const MouseEvent& rMEvt ) MenuItemData* pData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL; // nMBDownPos in lokaler Variable merken und gleich zuruecksetzen, // weil nach EndExecute zu spaet - USHORT _nMBDownPos = nMBDownPos; + sal_uInt16 _nMBDownPos = nMBDownPos; nMBDownPos = ITEMPOS_INVALID; if ( pData && pData->bEnabled && ( pData->eType != MENUITEM_SEPARATOR ) ) { @@ -4349,7 +4349,7 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt ) pActivePopup->ImplGetFloatingWindow()->aSubmenuCloseTimer.Start(); if( !pActivePopup || (pData && pData->pSubMenu != pActivePopup ) ) - ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); #ifdef OS2 } #endif @@ -4364,13 +4364,13 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt ) { aSubmenuCloseTimer.Stop(); if( bIgnoreFirstMove ) - bIgnoreFirstMove = FALSE; + bIgnoreFirstMove = sal_False; else - ImplHighlightItem( rMEvt, FALSE ); + ImplHighlightItem( rMEvt, sal_False ); } } -void MenuFloatingWindow::ImplScroll( BOOL bUp ) +void MenuFloatingWindow::ImplScroll( sal_Bool bUp ) { KillActivePopup(); Update(); @@ -4378,7 +4378,7 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp ) if( ! pMenu ) return; - HighlightItem( nHighlightedItem, FALSE ); + HighlightItem( nHighlightedItem, sal_False ); pMenu->ImplKillLayoutData(); @@ -4393,17 +4393,17 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp ) if ( !bScrollDown ) { - bScrollDown = TRUE; - ImplDrawScroller( FALSE ); + bScrollDown = sal_True; + ImplDrawScroller( sal_False ); } if ( pMenu->ImplGetPrevVisible( nFirstEntry ) == ITEMPOS_INVALID ) { - bScrollUp = FALSE; - ImplDrawScroller( TRUE ); + bScrollUp = sal_False; + ImplDrawScroller( sal_True ); } - Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion( FALSE ).GetBoundRect(), SCROLL_CLIP ); + Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion( sal_False ).GetBoundRect(), SCROLL_CLIP ); } else if ( bScrollDown && !bUp ) { @@ -4415,24 +4415,24 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp ) if ( !bScrollUp ) { - bScrollUp = TRUE; - ImplDrawScroller( TRUE ); + bScrollUp = sal_True; + ImplDrawScroller( sal_True ); } long nHeight = GetOutputSizePixel().Height(); - USHORT nLastVisible; + sal_uInt16 nLastVisible; ((PopupMenu*)pMenu)->ImplCalcVisEntries( nHeight, nFirstEntry, &nLastVisible ); if ( pMenu->ImplGetNextVisible( nLastVisible ) == ITEMPOS_INVALID ) { - bScrollDown = FALSE; - ImplDrawScroller( FALSE ); + bScrollDown = sal_False; + ImplDrawScroller( sal_False ); } // nStartY -= nEntryHeight; - Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion( FALSE ).GetBoundRect(), SCROLL_CLIP ); + Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion( sal_False ).GetBoundRect(), SCROLL_CLIP ); } - HighlightItem( nHighlightedItem, TRUE ); + HighlightItem( nHighlightedItem, sal_True ); } void MenuFloatingWindow::ImplScroll( const Point& rMousePos ) @@ -4445,12 +4445,12 @@ void MenuFloatingWindow::ImplScroll( const Point& rMousePos ) if ( bScrollUp && ( nMouseY < nY ) ) { - ImplScroll( TRUE ); + ImplScroll( sal_True ); nDelta = nY - nMouseY; } else if ( bScrollDown && ( nMouseY > ( aOutSz.Height() - nY ) ) ) { - ImplScroll( FALSE ); + ImplScroll( sal_False ); nDelta = nMouseY - ( aOutSz.Height() - nY ); } @@ -4472,7 +4472,7 @@ void MenuFloatingWindow::ImplScroll( const Point& rMousePos ) aScrollTimer.Start(); } } -void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ) +void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopupTimer ) { // #57934# ggf. das aktive Popup sofort schliessen, damit TH's Hintergrundsicherung funktioniert. // #65750# Dann verzichten wir lieber auf den schmalen Streifen Hintergrundsicherung. @@ -4487,11 +4487,11 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ) if ( nHighlightedItem != ITEMPOS_INVALID ) { - HighlightItem( nHighlightedItem, FALSE ); + HighlightItem( nHighlightedItem, sal_False ); pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem ); } - nHighlightedItem = (USHORT)n; + nHighlightedItem = (sal_uInt16)n; DBG_ASSERT( pMenu->ImplIsVisible( nHighlightedItem ) || nHighlightedItem == ITEMPOS_INVALID, "ChangeHighlightItem: Not visible!" ); if( nHighlightedItem != ITEMPOS_INVALID ) { @@ -4499,7 +4499,7 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ) { // #102461# make sure parent entry is highlighted as well MenuItemData* pData; - USHORT i, nCount = (USHORT)pMenu->pStartedFrom->pItemList->Count(); + sal_uInt16 i, nCount = (sal_uInt16)pMenu->pStartedFrom->pItemList->Count(); for(i = 0; i < nCount; i++) { pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i ); @@ -4511,12 +4511,12 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ) MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow(); if( pPWin && pPWin->nHighlightedItem != i ) { - pPWin->HighlightItem( i, TRUE ); + pPWin->HighlightItem( i, sal_True ); pPWin->nHighlightedItem = i; } } } - HighlightItem( nHighlightedItem, TRUE ); + HighlightItem( nHighlightedItem, sal_True ); pMenu->ImplCallHighlight( nHighlightedItem ); } else @@ -4535,7 +4535,7 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ) } } -void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) +void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight ) { if( ! pMenu ) return; @@ -4551,8 +4551,8 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) int nOuterSpace = ImplGetSVData()->maNWFData.mnMenuFormatExtraBorder; nY += nOuterSpace; - USHORT nCount = (USHORT)pMenu->pItemList->Count(); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count(); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( n == nPos ) @@ -4560,7 +4560,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) DBG_ASSERT( pMenu->ImplIsVisible( n ), "Highlight: Item not visible!" ); if ( pData->eType != MENUITEM_SEPARATOR ) { - BOOL bRestoreLineColor = FALSE; + sal_Bool bRestoreLineColor = sal_False; Color oldLineColor; bool bDrawItemRect = true; @@ -4586,7 +4586,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) ) { bDrawItemRect = false; - if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, + if( sal_False == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, Region( aItemRect ), CTRL_STATE_SELECTED | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ), ImplControlValue(), @@ -4610,7 +4610,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) SetFillColor(); oldLineColor = GetLineColor(); SetLineColor( GetSettings().GetStyleSettings().GetMenuHighlightColor() ); - bRestoreLineColor = TRUE; + bRestoreLineColor = sal_True; } } else @@ -4629,7 +4629,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) } } -Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos ) +Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos ) { if( ! pMenu ) return Rectangle(); @@ -4643,8 +4643,8 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos ) if ( pMenu->pLogo ) nX = pMenu->pLogo->aBitmap.GetSizePixel().Width(); - USHORT nCount = (USHORT)pMenu->pItemList->Count(); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count(); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( n == nPos ) @@ -4667,14 +4667,14 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos ) } -void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd ) +void MenuFloatingWindow::ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd ) { if( ! pMenu ) return; const StyleSettings& rSettings = GetSettings().GetStyleSettings(); - USHORT n = nHighlightedItem; + sal_uInt16 n = nHighlightedItem; if ( n == ITEMPOS_INVALID ) { if ( bUp ) @@ -4683,7 +4683,7 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd ) n = pMenu->GetItemCount()-1; } - USHORT nLoop = n; + sal_uInt16 nLoop = n; if( bHomeEnd ) { @@ -4695,7 +4695,7 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd ) } else { - n = (USHORT)-1; + n = (sal_uInt16)-1; nLoop = n+1; } } @@ -4731,21 +4731,21 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd ) // Selektion noch im sichtbaren Bereich? if ( IsScrollMenu() ) { - ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); while ( n < nFirstEntry ) - ImplScroll( TRUE ); + ImplScroll( sal_True ); Size aOutSz = GetOutputSizePixel(); - USHORT nLastVisible; + sal_uInt16 nLastVisible; ((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible ); while ( n > nLastVisible ) { - ImplScroll( FALSE ); + ImplScroll( sal_False ); ((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible ); } } - ChangeHighlightItem( n, FALSE ); + ChangeHighlightItem( n, sal_False ); break; } } while ( n != nLoop ); @@ -4756,8 +4756,8 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) ImplDelData aDelData; ImplAddDel( &aDelData ); - USHORT nCode = rKEvent.GetKeyCode().GetCode(); - bKeyInput = TRUE; + sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode(); + bKeyInput = sal_True; switch ( nCode ) { case KEY_UP: @@ -4769,7 +4769,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) case KEY_END: case KEY_HOME: { - ImplCursorUpDown( nCode == KEY_END, TRUE ); + ImplCursorUpDown( nCode == KEY_END, sal_True ); } break; case KEY_F6: @@ -4825,14 +4825,14 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) { if( pMenu ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( nHighlightedItem != ITEMPOS_INVALID ) { MenuItemData* pData = pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ); if ( pData && pData->pSubMenu ) { HighlightChanged( 0 ); - bDone = TRUE; + bDone = sal_True; } } if ( !bDone ) @@ -4880,14 +4880,14 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) default: { xub_Unicode nCharCode = rKEvent.GetCharCode(); - USHORT nPos = 0; - USHORT nDuplicates = 0; + sal_uInt16 nPos = 0; + sal_uInt16 nDuplicates = 0; MenuItemData* pData = (nCharCode && pMenu) ? pMenu->GetItemList()->SearchItem( nCharCode, rKEvent.GetKeyCode(), nPos, nDuplicates, nHighlightedItem ) : NULL; if ( pData ) { if ( pData->pSubMenu || nDuplicates > 1 ) { - ChangeHighlightItem( nPos, FALSE ); + ChangeHighlightItem( nPos, sal_False ); HighlightChanged( 0 ); } else @@ -4909,7 +4909,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) if ( !aDelData.IsDelete() ) { ImplRemoveDel( &aDelData ); - bKeyInput = FALSE; + bKeyInput = sal_False; } } @@ -4933,16 +4933,16 @@ void MenuFloatingWindow::Paint( const Rectangle& ) } if ( IsScrollMenu() ) { - ImplDrawScroller( TRUE ); - ImplDrawScroller( FALSE ); + ImplDrawScroller( sal_True ); + ImplDrawScroller( sal_False ); } SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() ); pMenu->ImplPaint( this, nScrollerHeight, ImplGetStartY() ); if ( nHighlightedItem != ITEMPOS_INVALID ) - HighlightItem( nHighlightedItem, TRUE ); + HighlightItem( nHighlightedItem, sal_True ); } -void MenuFloatingWindow::ImplDrawScroller( BOOL bUp ) +void MenuFloatingWindow::ImplDrawScroller( sal_Bool bUp ) { if( ! pMenu ) return; @@ -4957,7 +4957,7 @@ void MenuFloatingWindow::ImplDrawScroller( BOOL bUp ) DecorationView aDecoView( this ); SymbolType eSymbol = bUp ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN; - USHORT nStyle = 0; + sal_uInt16 nStyle = 0; if ( ( bUp && !bScrollUp ) || ( !bUp && !bScrollDown ) ) nStyle |= SYMBOL_DRAW_DISABLE; @@ -4968,7 +4968,7 @@ void MenuFloatingWindow::ImplDrawScroller( BOOL bUp ) void MenuFloatingWindow::RequestHelp( const HelpEvent& rHEvt ) { - USHORT nId = nHighlightedItem; + sal_uInt16 nId = nHighlightedItem; Menu* pM = pMenu; Window* pW = this; @@ -4992,7 +4992,7 @@ void MenuFloatingWindow::StateChanged( StateChangedType nType ) if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) || ( nType == STATE_CHANGE_CONTROLBACKGROUND ) ) { - ImplInitMenuWindow( this, FALSE, FALSE ); + ImplInitMenuWindow( this, sal_False, sal_False ); Invalidate(); } } @@ -5006,7 +5006,7 @@ void MenuFloatingWindow::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - ImplInitMenuWindow( this, FALSE, FALSE ); + ImplInitMenuWindow( this, sal_False, sal_False ); Invalidate(); } } @@ -5046,10 +5046,10 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) : pActivePopup = NULL; nSaveFocusId = 0; nHighlightedItem = ITEMPOS_INVALID; - mbAutoPopup = TRUE; + mbAutoPopup = sal_True; nSaveFocusId = 0; - bIgnoreFirstMove = TRUE; - bStayActive = FALSE; + bIgnoreFirstMove = sal_True; + bStayActive = sal_False; ResMgr* pResMgr = ImplGetResMgr(); @@ -5063,7 +5063,7 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) : aCloser.SetOutStyle( TOOLBOX_STYLE_FLAT ); aCloser.SetBackground(); - aCloser.SetPaintTransparent( TRUE ); + aCloser.SetPaintTransparent( sal_True ); aCloser.SetParentClipMode( PARENTCLIPMODE_NOCLIP ); aCloser.InsertItem( IID_DOCUMENTCLOSE, @@ -5097,7 +5097,7 @@ void MenuBarWindow::SetMenu( MenuBar* pMen ) pMenu = pMen; KillActivePopup(); nHighlightedItem = ITEMPOS_INVALID; - ImplInitMenuWindow( this, TRUE, TRUE ); + ImplInitMenuWindow( this, sal_True, sal_True ); if ( pMen ) { aCloser.ShowItem( IID_DOCUMENTCLOSE, pMen->HasCloser() ); @@ -5117,7 +5117,7 @@ void MenuBarWindow::SetMenu( MenuBar* pMen ) } } -void MenuBarWindow::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide ) +void MenuBarWindow::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide ) { aCloser.ShowItem( IID_DOCUMENTCLOSE, bClose ); aCloser.Show( bClose || ! m_aAddButtons.empty() ); @@ -5145,7 +5145,7 @@ IMPL_LINK( MenuBarWindow, CloserHdl, PushButton*, EMPTYARG ) } else { - std::map<USHORT,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() ); + std::map<sal_uInt16,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() ); if( it != m_aAddButtons.end() ) { MenuBar::MenuBarButtonCallbackArg aArg; @@ -5171,10 +5171,10 @@ IMPL_LINK( MenuBarWindow, ToolboxEventHdl, VclWindowEvent*, pEvent ) aArg.nId = aCloser.GetHighlightItemId(); else if( pEvent->GetId() == VCLEVENT_TOOLBOX_HIGHLIGHTOFF ) { - USHORT nPos = static_cast< USHORT >(reinterpret_cast<sal_IntPtr>(pEvent->GetData())); + sal_uInt16 nPos = static_cast< sal_uInt16 >(reinterpret_cast<sal_IntPtr>(pEvent->GetData())); aArg.nId = aCloser.GetItemId( nPos ); } - std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId ); + std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId ); if( it != m_aAddButtons.end() ) { it->second.m_aHighlightLink.Call( &aArg ); @@ -5204,12 +5204,12 @@ IMPL_LINK( MenuBarWindow, HideHdl, PushButton*, EMPTYARG ) return pMenu ? ((MenuBar*)pMenu)->GetHideButtonClickHdl().Call( pMenu ) : 0; } -void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst ) +void MenuBarWindow::ImplCreatePopup( sal_Bool bPreSelectFirst ) { MenuItemData* pItemData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL; if ( pItemData ) { - bIgnoreFirstMove = TRUE; + bIgnoreFirstMove = sal_True; if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) ) { KillActivePopup(); @@ -5219,7 +5219,7 @@ void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst ) pActivePopup = (PopupMenu*)pItemData->pSubMenu; long nX = 0; MenuItemData* pData = 0; - for ( ULONG n = 0; n < nHighlightedItem; n++ ) + for ( sal_uIntPtr n = 0; n < nHighlightedItem; n++ ) { pData = pMenu->GetItemList()->GetDataFromPos( n ); nX += pData->aSz.Width(); @@ -5266,11 +5266,11 @@ void MenuBarWindow::KillActivePopup() return; // kill it later if ( pActivePopup->bInCallback ) - pActivePopup->bCanceled = TRUE; + pActivePopup->bCanceled = sal_True; - pActivePopup->bInCallback = TRUE; + pActivePopup->bInCallback = sal_True; pActivePopup->Deactivate(); - pActivePopup->bInCallback = FALSE; + pActivePopup->bInCallback = sal_False; // Abfrage auf pActivePopup, falls im Deactivate abgeschossen... if ( pActivePopup && pActivePopup->ImplGetWindow() ) { @@ -5288,22 +5288,22 @@ void MenuBarWindow::PopupClosed( Menu* pPopup ) if ( pPopup == pActivePopup ) { KillActivePopup(); - ChangeHighlightItem( ITEMPOS_INVALID, FALSE, ImplGetFrameWindow()->ImplGetFrameData()->mbHasFocus, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False, ImplGetFrameWindow()->ImplGetFrameData()->mbHasFocus, sal_False ); } } void MenuBarWindow::MouseButtonDown( const MouseEvent& rMEvt ) { - mbAutoPopup = TRUE; - USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() ); + mbAutoPopup = sal_True; + sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() ); if ( ( nEntry != ITEMPOS_INVALID ) && ( nEntry != nHighlightedItem ) ) { - ChangeHighlightItem( nEntry, FALSE ); + ChangeHighlightItem( nEntry, sal_False ); } else { KillActivePopup(); - ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); } } @@ -5319,20 +5319,20 @@ void MenuBarWindow::MouseMove( const MouseEvent& rMEvt ) if( bIgnoreFirstMove ) { - bIgnoreFirstMove = FALSE; + bIgnoreFirstMove = sal_False; return; } - USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() ); + sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() ); if ( ( nEntry != ITEMPOS_INVALID ) #ifdef OS2 && ( ImplHilite(rMEvt) ) #endif && ( nEntry != nHighlightedItem ) ) - ChangeHighlightItem( nEntry, FALSE ); + ChangeHighlightItem( nEntry, sal_False ); } -void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllowRestoreFocus, BOOL bDefaultToDocument) +void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectEntry, sal_Bool bAllowRestoreFocus, sal_Bool bDefaultToDocument) { if( ! pMenu ) return; @@ -5343,21 +5343,21 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo KillActivePopup(); // pActivePopup ggf. ohne pWin, wenn in Activate() Rescheduled wurde // Activate am MenuBar immer nur einmal pro Vorgang... - BOOL bJustActivated = FALSE; + sal_Bool bJustActivated = sal_False; if ( ( nHighlightedItem == ITEMPOS_INVALID ) && ( n != ITEMPOS_INVALID ) ) { - ImplGetSVData()->maWinData.mbNoDeactivate = TRUE; + ImplGetSVData()->maWinData.mbNoDeactivate = sal_True; if( !bStayActive ) { // #105406# avoid saving the focus when we already have the focus - BOOL bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin ); + sal_Bool bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin ); if( nSaveFocusId ) { if( !ImplGetSVData()->maWinData.mbNoSaveFocus ) { // we didn't clean up last time - Window::EndSaveFocus( nSaveFocusId, FALSE ); // clean up + Window::EndSaveFocus( nSaveFocusId, sal_False ); // clean up nSaveFocusId = 0; if( !bNoSaveFocus ) nSaveFocusId = Window::SaveFocus(); // only save focus when initially activated @@ -5373,21 +5373,21 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo } } else - bStayActive = FALSE; - pMenu->bInCallback = TRUE; // hier schon setzen, falls Activate ueberladen + bStayActive = sal_False; + pMenu->bInCallback = sal_True; // hier schon setzen, falls Activate ueberladen pMenu->Activate(); - pMenu->bInCallback = FALSE; - bJustActivated = TRUE; + pMenu->bInCallback = sal_False; + bJustActivated = sal_True; } else if ( ( nHighlightedItem != ITEMPOS_INVALID ) && ( n == ITEMPOS_INVALID ) ) { - pMenu->bInCallback = TRUE; + pMenu->bInCallback = sal_True; pMenu->Deactivate(); - pMenu->bInCallback = FALSE; - ImplGetSVData()->maWinData.mbNoDeactivate = FALSE; + pMenu->bInCallback = sal_False; + ImplGetSVData()->maWinData.mbNoDeactivate = sal_False; if( !ImplGetSVData()->maWinData.mbNoSaveFocus ) { - ULONG nTempFocusId = nSaveFocusId; + sal_uIntPtr nTempFocusId = nSaveFocusId; nSaveFocusId = 0; Window::EndSaveFocus( nTempFocusId, bAllowRestoreFocus ); // #105406# restore focus to document if we could not save focus before @@ -5398,13 +5398,13 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo if ( nHighlightedItem != ITEMPOS_INVALID ) { - HighlightItem( nHighlightedItem, FALSE ); + HighlightItem( nHighlightedItem, sal_False ); pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem ); } - nHighlightedItem = (USHORT)n; + nHighlightedItem = (sal_uInt16)n; DBG_ASSERT( ( nHighlightedItem == ITEMPOS_INVALID ) || pMenu->ImplIsVisible( nHighlightedItem ), "ChangeHighlightItem: Not visible!" ); - HighlightItem( nHighlightedItem, TRUE ); + HighlightItem( nHighlightedItem, sal_True ); pMenu->ImplCallHighlight( nHighlightedItem ); if( mbAutoPopup ) @@ -5415,14 +5415,14 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo GrabFocus(); } -void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) +void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight ) { if( ! pMenu ) return; long nX = 0; - ULONG nCount = pMenu->pItemList->Count(); - for ( ULONG n = 0; n < nCount; n++ ) + sal_uIntPtr nCount = pMenu->pItemList->Count(); + for ( sal_uIntPtr n = 0; n < nCount; n++ ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( n == nPos ) @@ -5498,14 +5498,14 @@ void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) } } -Rectangle MenuBarWindow::ImplGetItemRect( USHORT nPos ) +Rectangle MenuBarWindow::ImplGetItemRect( sal_uInt16 nPos ) { Rectangle aRect; if( pMenu ) { long nX = 0; - ULONG nCount = pMenu->pItemList->Count(); - for ( ULONG n = 0; n < nCount; n++ ) + sal_uIntPtr nCount = pMenu->pItemList->Count(); + for ( sal_uIntPtr n = 0; n < nCount; n++ ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( n == nPos ) @@ -5528,16 +5528,16 @@ void MenuBarWindow::KeyInput( const KeyEvent& rKEvent ) Window::KeyInput( rKEvent ); } -BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu ) +sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu ) { if( ! pMenu ) - return FALSE; + return sal_False; if ( pMenu->bInCallback ) - return TRUE; // schlucken + return sal_True; // schlucken - BOOL bDone = FALSE; - USHORT nCode = rKEvent.GetKeyCode().GetCode(); + sal_Bool bDone = sal_False; + sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode(); if( GetParent() ) { @@ -5546,7 +5546,7 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu SystemWindow *pSysWin = (SystemWindow*)GetParent()->GetWindow( WINDOW_CLIENT ); if( pSysWin->GetTaskPaneList() ) if( pSysWin->GetTaskPaneList()->HandleKeyEvent( rKEvent ) ) - return TRUE; + return sal_True; } } @@ -5555,22 +5555,22 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu mbAutoPopup = ImplGetSVData()->maNWFData.mbOpenMenuOnF10; if ( nHighlightedItem == ITEMPOS_INVALID ) { - ChangeHighlightItem( 0, FALSE ); + ChangeHighlightItem( 0, sal_False ); GrabFocus(); } else { - ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); nSaveFocusId = 0; } - bDone = TRUE; + bDone = sal_True; } else if ( bFromMenu ) { if ( ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) || ( nCode == KEY_HOME ) || ( nCode == KEY_END ) ) { - USHORT n = nHighlightedItem; + sal_uInt16 n = nHighlightedItem; if ( n == ITEMPOS_INVALID ) { if ( nCode == KEY_LEFT) @@ -5590,10 +5590,10 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu bWasHighlight = (pSubWindow->GetHighlightedItem() != ITEMPOS_INVALID); } - USHORT nLoop = n; + sal_uInt16 nLoop = n; if( nCode == KEY_HOME ) - { n = (USHORT)-1; nLoop = n+1; } + { n = (sal_uInt16)-1; nLoop = n+1; } if( nCode == KEY_END ) { n = pMenu->GetItemCount(); nLoop = n-1; } @@ -5616,14 +5616,14 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu MenuItemData* pData = (MenuItemData*)pMenu->GetItemList()->GetDataFromPos( n ); if ( ( pData->eType != MENUITEM_SEPARATOR ) && pMenu->ImplIsVisible( n ) ) { - BOOL bDoSelect = TRUE; + sal_Bool bDoSelect = sal_True; if( ImplGetSVData()->maNWFData.mbOpenMenuOnF10 ) bDoSelect = bWasHighlight; ChangeHighlightItem( n, bDoSelect ); break; } } while ( n != nLoop ); - bDone = TRUE; + bDone = sal_True; } else if ( nCode == KEY_RETURN ) { @@ -5631,36 +5631,36 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu else if ( !mbAutoPopup ) { - ImplCreatePopup( TRUE ); - mbAutoPopup = TRUE; + ImplCreatePopup( sal_True ); + mbAutoPopup = sal_True; } - bDone = TRUE; + bDone = sal_True; } else if ( ( nCode == KEY_UP ) || ( nCode == KEY_DOWN ) ) { if ( !mbAutoPopup ) { - ImplCreatePopup( TRUE ); - mbAutoPopup = TRUE; + ImplCreatePopup( sal_True ); + mbAutoPopup = sal_True; } - bDone = TRUE; + bDone = sal_True; } else if ( nCode == KEY_ESCAPE || ( nCode == KEY_F6 && rKEvent.GetKeyCode().IsMod1() ) ) { if( pActivePopup ) { // bring focus to menu bar without any open popup - mbAutoPopup = FALSE; - USHORT n = nHighlightedItem; + mbAutoPopup = sal_False; + sal_uInt16 n = nHighlightedItem; nHighlightedItem = ITEMPOS_INVALID; - bStayActive = TRUE; - ChangeHighlightItem( n, FALSE ); - bStayActive = FALSE; + bStayActive = sal_True; + ChangeHighlightItem( n, sal_False ); + bStayActive = sal_False; KillActivePopup(); GrabFocus(); } else - ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); if( nCode == KEY_F6 && rKEvent.GetKeyCode().IsMod1() ) { @@ -5668,7 +5668,7 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu GrabFocusToDocument(); } - bDone = TRUE; + bDone = sal_True; } } @@ -5677,19 +5677,19 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu xub_Unicode nCharCode = rKEvent.GetCharCode(); if ( nCharCode ) { - USHORT nEntry, nDuplicates; + sal_uInt16 nEntry, nDuplicates; MenuItemData* pData = pMenu->GetItemList()->SearchItem( nCharCode, rKEvent.GetKeyCode(), nEntry, nDuplicates, nHighlightedItem ); if ( pData && (nEntry != ITEMPOS_INVALID) ) { - mbAutoPopup = TRUE; - ChangeHighlightItem( nEntry, TRUE ); - bDone = TRUE; + mbAutoPopup = sal_True; + ChangeHighlightItem( nEntry, sal_True ); + bDone = sal_True; } else { // Wegen Systemmenu und anderen System-HotKeys, nur // eigenstaendige Character-Kombinationen auswerten - USHORT nKeyCode = rKEvent.GetKeyCode().GetCode(); + sal_uInt16 nKeyCode = rKEvent.GetKeyCode().GetCode(); if ( ((nKeyCode >= KEY_A) && (nKeyCode <= KEY_Z)) ) Sound::Beep(); } @@ -5726,7 +5726,7 @@ void MenuBarWindow::Paint( const Rectangle& ) SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() ); pMenu->ImplPaint( this, 0 ); if ( nHighlightedItem != ITEMPOS_INVALID ) - HighlightItem( nHighlightedItem, TRUE ); + HighlightItem( nHighlightedItem, sal_True ); // in high contrast mode draw a separating line on the lower edge if( ! IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) && @@ -5778,20 +5778,20 @@ void MenuBarWindow::Resize() Invalidate(); } -USHORT MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const +sal_uInt16 MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const { if( pMenu ) { long nX = 0; - USHORT nCount = (USHORT)pMenu->pItemList->Count(); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count(); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( pMenu->ImplIsVisible( n ) ) { nX += pData->aSz.Width(); if ( nX > rMousePos.X() ) - return (USHORT)n; + return (sal_uInt16)n; } } } @@ -5800,9 +5800,9 @@ USHORT MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const void MenuBarWindow::RequestHelp( const HelpEvent& rHEvt ) { - USHORT nId = nHighlightedItem; + sal_uInt16 nId = nHighlightedItem; if ( rHEvt.GetMode() & (HELPMODE_CONTEXT | HELPMODE_EXTENDED) ) - ChangeHighlightItem( ITEMPOS_INVALID, TRUE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_True ); Rectangle aHighlightRect( ImplGetItemRect( nHighlightedItem ) ); if( !ImplHandleHelpEvent( this, pMenu, nId, rHEvt, aHighlightRect ) ) @@ -5816,7 +5816,7 @@ void MenuBarWindow::StateChanged( StateChangedType nType ) if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) || ( nType == STATE_CHANGE_CONTROLBACKGROUND ) ) { - ImplInitMenuWindow( this, FALSE, TRUE ); + ImplInitMenuWindow( this, sal_False, sal_True ); Invalidate(); } else if( pMenu ) @@ -5828,7 +5828,7 @@ void MenuBarWindow::ImplLayoutChanged() { if( pMenu ) { - ImplInitMenuWindow( this, TRUE, TRUE ); + ImplInitMenuWindow( this, sal_True, sal_True ); // Falls sich der Font geaendert hat. long nHeight = pMenu->ImplCalcSize( this ).Height(); @@ -5880,16 +5880,16 @@ void MenuBarWindow::DataChanged( const DataChangedEvent& rDCEvt ) void MenuBarWindow::LoseFocus() { - if ( !HasChildPathFocus( TRUE ) ) - ChangeHighlightItem( ITEMPOS_INVALID, FALSE, FALSE ); + if ( !HasChildPathFocus( sal_True ) ) + ChangeHighlightItem( ITEMPOS_INVALID, sal_False, sal_False ); } void MenuBarWindow::GetFocus() { if ( nHighlightedItem == ITEMPOS_INVALID ) { - mbAutoPopup = FALSE; // do not open menu when activated by focus handling like taskpane cycling - ChangeHighlightItem( 0, FALSE ); + mbAutoPopup = sal_False; // do not open menu when activated by focus handling like taskpane cycling + ChangeHighlightItem( 0, sal_False ); } } @@ -5903,13 +5903,13 @@ void MenuBarWindow::GetFocus() return xAcc; } -USHORT MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, USHORT i_nPos ) +sal_uInt16 MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, sal_uInt16 i_nPos ) { // find first free button id - USHORT nId = IID_DOCUMENTCLOSE; - std::map< USHORT, AddButtonEntry >::const_iterator it; + sal_uInt16 nId = IID_DOCUMENTCLOSE; + std::map< sal_uInt16, AddButtonEntry >::const_iterator it; if( i_nPos > m_aAddButtons.size() ) - i_nPos = static_cast<USHORT>(m_aAddButtons.size()); + i_nPos = static_cast<sal_uInt16>(m_aAddButtons.size()); do { nId++; @@ -5932,14 +5932,14 @@ USHORT MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLi return nId; } -void MenuBarWindow::SetMenuBarButtonHighlightHdl( USHORT nId, const Link& rLink ) +void MenuBarWindow::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& rLink ) { - std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( nId ); + std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( nId ); if( it != m_aAddButtons.end() ) it->second.m_aHighlightLink = rLink; } -Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( USHORT nId ) +Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( sal_uInt16 nId ) { Rectangle aRect; if( m_aAddButtons.find( nId ) != m_aAddButtons.end() ) @@ -5964,9 +5964,9 @@ Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( USHORT nId ) return aRect; } -void MenuBarWindow::RemoveMenuBarButton( USHORT nId ) +void MenuBarWindow::RemoveMenuBarButton( sal_uInt16 nId ) { - USHORT nPos = aCloser.GetItemPos( nId ); + sal_uInt16 nPos = aCloser.GetItemPos( nId ); aCloser.RemoveItem( nPos ); m_aAddButtons.erase( nId ); aCloser.calcMinSize(); @@ -5976,9 +5976,9 @@ void MenuBarWindow::RemoveMenuBarButton( USHORT nId ) pMenu->mpSalMenu->RemoveMenuBarButton( nId ); } -bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId ) +bool MenuBarWindow::HandleMenuButtonEvent( sal_uInt16 i_nButtonId ) { - std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( i_nButtonId ); + std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( i_nButtonId ); if( it != m_aAddButtons.end() ) { MenuBar::MenuBarButtonCallbackArg aArg; @@ -5987,5 +5987,5 @@ bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId ) aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu); return it->second.m_aSelectLink.Call( &aArg ); } - return FALSE; + return sal_False; } |