summaryrefslogtreecommitdiff
path: root/vcl/source/window/menu.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window/menu.cxx')
-rwxr-xr-xvcl/source/window/menu.cxx1270
1 files changed, 635 insertions, 635 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 5909ab9f8489..dda796ba41e4 100755
--- 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;
};
}
@@ -105,32 +105,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_uLong 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;
@@ -143,12 +143,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
@@ -159,14 +159,14 @@ struct MenuItemData
XubString aCommandStr; // CommandString
XubString aHelpCommandStr; // Help command string (to reference external help)
rtl::OString aHelpId; // Help-Id
- ULONG nUserValue; // User value
+ sal_uLong 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
@@ -211,22 +211,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_uLong 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;
};
@@ -235,17 +235,17 @@ public:
MenuItemList::~MenuItemList()
{
- for ( ULONG n = Count(); n; )
+ for ( sal_uLong 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->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
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;
@@ -285,11 +285,11 @@ void MenuItemList::InsertSeparator( USHORT nPos )
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
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;
@@ -306,14 +306,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_uLong)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 );
@@ -329,11 +329,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
@@ -366,7 +366,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;
@@ -390,13 +390,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 ) )
@@ -406,7 +406,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
@@ -415,13 +415,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;
@@ -463,21 +463,21 @@ private:
Timer aHighlightChangedTimer;
Timer aSubmenuCloseTimer;
Timer aScrollTimer;
- ULONG nSaveFocusId;
+ sal_uLong 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* );
@@ -488,16 +488,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 );
@@ -514,27 +514,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_uLong nId ) { nSaveFocusId = nId; }
+ sal_uLong 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_uLong 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();
};
@@ -606,10 +606,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 ) );
}
}
@@ -671,7 +671,7 @@ class MenuBarWindow : public Window
private:
struct AddButtonEntry
{
- USHORT m_nId;
+ sal_uInt16 m_nId;
Link m_aSelectLink;
Link m_aHighlightLink;
@@ -680,25 +680,25 @@ private:
Menu* pMenu;
PopupMenu* pActivePopup;
- USHORT nHighlightedItem;
- ULONG nSaveFocusId;
- BOOL mbAutoPopup;
- BOOL bIgnoreFirstMove;
- BOOL bStayActive;
+ sal_uInt16 nHighlightedItem;
+ sal_uLong 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();
@@ -717,7 +717,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 );
@@ -727,26 +727,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_uLong nId ) { nSaveFocusId = nId; }
+ sal_uLong 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 )
@@ -776,24 +776,24 @@ static void ImplSetMenuItemData( MenuItemData* pData )
pData->eType = MENUITEM_STRINGIMAGE;
}
-static ULONG ImplChangeTipTimeout( ULONG nTimeout, Window *pWindow )
+static sal_uLong ImplChangeTipTimeout( sal_uLong nTimeout, Window *pWindow )
{
AllSettings aAllSettings( pWindow->GetSettings() );
HelpSettings aHelpSettings( aAllSettings.GetHelpSettings() );
- ULONG nRet = aHelpSettings.GetTipTimeout();
+ sal_uLong 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 )
{
@@ -816,23 +816,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_uLong 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_uLong 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) )
{
@@ -852,7 +852,7 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl
else
pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
}
@@ -862,7 +862,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;
@@ -876,7 +876,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();
}
@@ -895,13 +895,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;
@@ -945,7 +945,7 @@ Menu::~Menu()
pDelData = pDelData->mpNext;
}
- bKilled = TRUE;
+ bKilled = sal_True;
delete pItemList;
delete pLogo;
@@ -966,16 +966,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;
mpFirstDel = NULL; // Dtor notification list
// Native-support: returns NULL if not supported
@@ -996,13 +996,13 @@ void Menu::ImplLoadRes( const ResId& rResId )
rResId.SetRT( RSC_MENU );
GetRes( rResId );
- ULONG nObjMask = ReadLongRes();
+ sal_uLong nObjMask = ReadLongRes();
if( nObjMask & RSC_MENU_ITEMS )
{
- ULONG nObjFollows = ReadLongRes();
+ sal_uLong nObjFollows = ReadLongRes();
// MenuItems einfuegen
- for( ULONG i = 0; i < nObjFollows; i++ )
+ for( sal_uLong i = 0; i < nObjFollows; i++ )
{
InsertItem( ResId( (RSHEADER_TYPE*)GetClassRes(), *pMgr ) );
IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) );
@@ -1017,13 +1017,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_uLong n;
for ( n = 0; n < pItemList->Count(); n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos(n);
@@ -1040,7 +1040,7 @@ void Menu::CreateAutoMnemonics()
void Menu::Activate()
{
- bInCallback = TRUE;
+ bInCallback = sal_True;
ImplMenuDelData aDelData( this );
@@ -1055,27 +1055,27 @@ void Menu::Activate()
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;
ImplMenuDelData aDelData( this );
@@ -1090,9 +1090,9 @@ void Menu::Deactivate()
{
if ( pStartMenu && ( pStartMenu != this ) )
{
- pStartMenu->bInCallback = TRUE;
+ pStartMenu->bInCallback = sal_True;
pStartMenu->aDeactivateHdl.Call( this );
- pStartMenu->bInCallback = FALSE;
+ pStartMenu->bInCallback = sal_False;
}
}
}
@@ -1100,7 +1100,7 @@ void Menu::Deactivate()
if( !aDelData.isDeleted() )
{
- bInCallback = FALSE;
+ bInCallback = sal_False;
if ( this == pStartMenu )
GetpApp()->HideHelpStatusText();
@@ -1127,11 +1127,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 );
@@ -1177,7 +1177,7 @@ void Menu::RequestHelp( const HelpEvent& )
{
}
-void Menu::ImplCallEventListeners( ULONG nEvent, USHORT nPos )
+void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos )
{
ImplMenuDelData aDelData( this );
@@ -1232,14 +1232,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
@@ -1261,39 +1261,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_uLong 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 )
@@ -1348,12 +1348,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 )
{
@@ -1380,21 +1380,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 );
@@ -1404,9 +1404,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() )
{
@@ -1415,7 +1415,7 @@ void Menu::RemoveItem( USHORT nPos )
ImplGetSalMenu()->RemoveItem( nPos );
pItemList->Remove( nPos );
- bRemove = TRUE;
+ bRemove = sal_True;
}
Window* pWin = ImplGetWindow();
@@ -1431,8 +1431,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 );
@@ -1443,7 +1443,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" );
@@ -1458,9 +1458,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->aHelpId );
pThis->SetHelpText( nId, pData->aHelpText );
pThis->SetAccelKey( nId, pData->aAccelKey );
@@ -1483,26 +1483,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++;
@@ -1510,9 +1510,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;
@@ -1520,9 +1520,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;
@@ -1530,9 +1530,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;
@@ -1540,7 +1540,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 );
@@ -1550,9 +1550,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 )
@@ -1561,7 +1561,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 );
@@ -1571,19 +1571,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 );
@@ -1592,22 +1592,22 @@ MenuItemBits Menu::GetItemBits( USHORT nItemId ) const
return nBits;
}
-void Menu::SetUserValue( USHORT nItemId, ULONG nValue )
+void Menu::SetUserValue( sal_uInt16 nItemId, sal_uLong nValue )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
pData->nUserValue = nValue;
}
-ULONG Menu::GetUserValue( USHORT nItemId ) const
+sal_uLong 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
@@ -1637,7 +1637,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 );
@@ -1647,9 +1647,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 )
@@ -1665,7 +1665,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 );
@@ -1675,16 +1675,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');
@@ -1700,9 +1700,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 )
@@ -1713,9 +1713,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 )
@@ -1725,8 +1725,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;
}
}
@@ -1745,7 +1745,7 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck )
{
if ( IsItemChecked( pGroupData->nId ) )
{
- CheckItem( pGroupData->nId, FALSE );
+ CheckItem( pGroupData->nId, sal_False );
break;
}
}
@@ -1765,20 +1765,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 ) )
@@ -1790,8 +1790,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_uLong nCount = pItemList->Count();
+ for ( sal_uLong n = 0; n < nCount; n++ )
{
MenuItemData* pData = pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -1810,20 +1810,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!" );
@@ -1845,9 +1845,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 )
@@ -1874,9 +1874,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 )
@@ -1885,9 +1885,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 )
@@ -1911,9 +1911,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 )
@@ -1938,9 +1938,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 )
@@ -1956,7 +1956,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 );
@@ -1966,7 +1966,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 );
@@ -1976,17 +1976,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 );
@@ -1994,7 +1994,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 );
@@ -2004,7 +2004,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 );
@@ -2012,7 +2012,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 );
@@ -2022,7 +2022,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 );
@@ -2030,7 +2030,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 );
@@ -2056,12 +2056,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 );
@@ -2069,7 +2069,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 );
@@ -2079,7 +2079,7 @@ const XubString& Menu::GetTipHelpText( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
+void Menu::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
{
MenuItemData* pData = pItemList->GetData( nItemId );
@@ -2087,7 +2087,7 @@ void Menu::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
pData->aHelpId = rHelpId;
}
-rtl::OString Menu::GetHelpId( USHORT nItemId ) const
+rtl::OString Menu::GetHelpId( sal_uInt16 nItemId ) const
{
rtl::OString aRet;
@@ -2110,8 +2110,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;
@@ -2125,24 +2125,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++ )
@@ -2155,10 +2155,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 )
{
@@ -2172,7 +2172,7 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const
}
}
if( n == 0 ) // no previous visible item
- bVisible = FALSE;
+ bVisible = sal_False;
}
}
}
@@ -2183,10 +2183,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.
}
}
@@ -2194,34 +2194,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 );
@@ -2372,7 +2372,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 )))
@@ -2387,7 +2387,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 );
@@ -2495,8 +2495,8 @@ Size Menu::ImplCalcSize( Window* pWin )
if( nMaxWidth > nScreenWidth/2 )
nMaxWidth = nScreenWidth/2;
- 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;
@@ -2506,12 +2506,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;
@@ -2524,7 +2524,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
@@ -2566,7 +2566,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;
@@ -2584,7 +2584,7 @@ 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 );
}
}
@@ -2608,7 +2608,7 @@ static String getShortenedString( const String& i_rLong, Window* i_pWin, long i_
return aNonMnem;
}
-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();
@@ -2634,10 +2634,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 ) ) )
@@ -2654,9 +2654,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
@@ -2797,7 +2797,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;
@@ -2931,7 +2931,7 @@ Menu* Menu::ImplGetStartMenu()
return pStart;
}
-void Menu::ImplCallHighlight( USHORT nHighlightedItem )
+void Menu::ImplCallHighlight( sal_uInt16 nHighlightedItem )
{
ImplMenuDelData aDelData( this );
@@ -2959,7 +2959,7 @@ Menu* Menu::ImplFindSelectMenu()
{
Menu* pSelMenu = nEventId ? this : NULL;
- for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; )
+ for ( sal_uLong n = GetItemList()->Count(); n && !pSelMenu; )
{
MenuItemData* pData = GetItemList()->GetDataFromPos( --n );
@@ -2970,11 +2970,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_uLong n = GetItemList()->Count(); n && !pSelMenu; )
{
MenuItemData* pData = GetItemList()->GetDataFromPos( --n );
@@ -2987,25 +2987,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 )
@@ -3014,7 +3014,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 );
@@ -3022,19 +3022,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;
@@ -3072,12 +3072,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 );
}
}
}
@@ -3089,7 +3089,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 )
@@ -3109,7 +3109,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;
@@ -3147,7 +3147,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();
@@ -3159,9 +3159,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() ) )
@@ -3169,19 +3169,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;
@@ -3189,16 +3189,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 ) )
@@ -3208,7 +3208,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 );
@@ -3218,7 +3218,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 );
@@ -3226,7 +3226,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 );
@@ -3243,19 +3243,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;
@@ -3270,19 +3270,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 );
}
}
}
@@ -3291,54 +3291,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) ||
@@ -3352,7 +3352,7 @@ void MenuBar::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide )
}
}
-void MenuBar::SetDisplayable( BOOL bDisplayable )
+void MenuBar::SetDisplayable( sal_Bool bDisplayable )
{
if( bDisplayable != mbDisplayable )
{
@@ -3383,7 +3383,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 )
@@ -3394,9 +3394,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() ||
@@ -3412,7 +3412,7 @@ BOOL MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu )
// -----------------------------------------------------------------------
-void MenuBar::SelectEntry( USHORT nId )
+void MenuBar::SelectEntry( sal_uInt16 nId )
{
MenuBarWindow* pMenuWin = (MenuBarWindow*) ImplGetWindow();
@@ -3422,14 +3422,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 );
}
}
@@ -3437,38 +3437,38 @@ 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 )
{
ImplMenuDelData aDelData( this );
pMenu->pStartedFrom = (Menu*)this;
- pMenu->bInCallback = TRUE;
+ pMenu->bInCallback = sal_True;
pMenu->Activate();
if( !aDelData.isDeleted() )
- 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 )
{
ImplMenuDelData aDelData( this );
pMenu->pStartedFrom = (Menu*)this;
- pMenu->bInCallback = TRUE;
+ pMenu->bInCallback = sal_True;
pMenu->Deactivate();
if( !aDelData.isDeleted() )
- 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 );
@@ -3486,13 +3486,13 @@ BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT 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 );
@@ -3501,47 +3501,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()
{
@@ -3566,9 +3566,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()
@@ -3577,22 +3577,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 );
}
@@ -3600,7 +3600,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 );
@@ -3609,27 +3609,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_uLong nPopupModeFlags = 0;
if ( nFlags & POPUPMENU_EXECUTE_DOWN )
nPopupModeFlags = FLOATWIN_POPUPMODE_DOWN;
else if ( nFlags & POPUPMENU_EXECUTE_UP )
@@ -3644,10 +3644,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_uLong nPopupModeFlags, Menu* pSFrom, sal_Bool bPreSelectFirst )
{
if ( !pSFrom && ( PopupMenu::IsInExecute() || !GetItemCount() ) )
return 0;
@@ -3658,15 +3658,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_uLong 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
{
@@ -3693,9 +3693,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
@@ -3721,7 +3721,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();
@@ -3730,7 +3730,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 ) )
@@ -3765,9 +3765,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 );
}
@@ -3796,7 +3796,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
@@ -3808,14 +3808,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;
}
}
@@ -3845,7 +3845,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 );
@@ -3876,18 +3876,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 ) )
{
@@ -3904,14 +3904,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();
@@ -3925,7 +3925,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();
@@ -3942,7 +3942,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 );
}
}
@@ -3967,12 +3967,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;
@@ -3980,13 +3980,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 ) );
@@ -4012,7 +4012,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 );
@@ -4023,7 +4023,7 @@ void MenuFloatingWindow::doShutdown()
{
MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow();
if( pPWin )
- pPWin->HighlightItem( i, FALSE );
+ pPWin->HighlightItem( i, sal_False );
}
}
@@ -4059,13 +4059,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;
@@ -4095,7 +4095,7 @@ void MenuFloatingWindow::ImplInitClipRegion()
}
}
-void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown )
+void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown )
{
if( ! pMenu )
return;
@@ -4105,10 +4105,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 ) )
{
@@ -4117,7 +4117,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...
@@ -4130,10 +4130,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 );
@@ -4151,7 +4151,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 )
{
@@ -4159,17 +4159,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 );
}
}
@@ -4183,12 +4183,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
{
@@ -4238,7 +4238,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer )
{
if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) )
{
- ULONG nOldFlags = GetPopupModeFlags();
+ sal_uLong nOldFlags = GetPopupModeFlags();
SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
KillActivePopup();
SetPopupModeFlags( nOldFlags );
@@ -4248,7 +4248,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_uLong n = 0; n < nHighlightedItem; n++ )
{
pData = pMenu->pItemList->GetDataFromPos( n );
nY += pData->aSz.Height();
@@ -4279,9 +4279,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_uLong 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...
@@ -4316,11 +4316,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();
}
@@ -4330,8 +4330,8 @@ void MenuFloatingWindow::Execute()
pSVData->maAppData.mpActivePopupMenu = (PopupMenu*)pMenu;
- bInExecute = TRUE;
-// bCallingSelect = FALSE;
+ bInExecute = sal_True;
+// bCallingSelect = sal_False;
while ( bInExecute )
Application::Yield();
@@ -4342,24 +4342,24 @@ void MenuFloatingWindow::Execute()
// Application::Yield();
}
-void MenuFloatingWindow::StopExecute( ULONG nFocusId )
+void MenuFloatingWindow::StopExecute( sal_uLong 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();
@@ -4377,15 +4377,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();
@@ -4401,14 +4401,14 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly )
void MenuFloatingWindow::EndExecute()
{
Menu* pStart = pMenu ? pMenu->ImplGetStartMenu() : NULL;
- ULONG nFocusId = 0;
+ sal_uLong 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;
}
}
@@ -4425,7 +4425,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 );
@@ -4443,9 +4443,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
@@ -4462,7 +4462,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;
}
@@ -4472,7 +4472,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 ) )
{
@@ -4510,7 +4510,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
@@ -4525,13 +4525,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();
@@ -4539,7 +4539,7 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp )
if( ! pMenu )
return;
- HighlightItem( nHighlightedItem, FALSE );
+ HighlightItem( nHighlightedItem, sal_False );
pMenu->ImplKillLayoutData();
@@ -4554,17 +4554,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 )
{
@@ -4576,24 +4576,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 )
@@ -4606,12 +4606,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 );
}
@@ -4633,7 +4633,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.
@@ -4648,11 +4648,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 )
{
@@ -4660,7 +4660,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 );
@@ -4672,12 +4672,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
@@ -4696,7 +4696,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;
@@ -4712,8 +4712,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 )
@@ -4721,7 +4721,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;
@@ -4748,7 +4748,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,
aItemRect,
CTRL_STATE_SELECTED | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ),
aVal,
@@ -4772,7 +4772,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
SetFillColor();
oldLineColor = GetLineColor();
SetLineColor( GetSettings().GetStyleSettings().GetMenuHighlightColor() );
- bRestoreLineColor = TRUE;
+ bRestoreLineColor = sal_True;
}
}
else
@@ -4791,7 +4791,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
}
}
-Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos )
+Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos )
{
if( ! pMenu )
return Rectangle();
@@ -4805,8 +4805,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 )
@@ -4829,14 +4829,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 )
@@ -4845,7 +4845,7 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
n = pMenu->GetItemCount()-1;
}
- USHORT nLoop = n;
+ sal_uInt16 nLoop = n;
if( bHomeEnd )
{
@@ -4857,7 +4857,7 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd )
}
else
{
- n = (USHORT)-1;
+ n = (sal_uInt16)-1;
nLoop = n+1;
}
}
@@ -4893,21 +4893,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 );
@@ -4918,8 +4918,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:
@@ -4931,7 +4931,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:
@@ -4987,14 +4987,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 )
@@ -5042,14 +5042,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
@@ -5071,7 +5071,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
if ( !aDelData.IsDelete() )
{
ImplRemoveDel( &aDelData );
- bKeyInput = FALSE;
+ bKeyInput = sal_False;
}
}
@@ -5096,16 +5096,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;
@@ -5120,7 +5120,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;
@@ -5131,7 +5131,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;
@@ -5155,7 +5155,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();
}
}
@@ -5169,7 +5169,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();
}
}
@@ -5209,10 +5209,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();
@@ -5226,7 +5226,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,
@@ -5260,7 +5260,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() );
@@ -5280,7 +5280,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() );
@@ -5308,7 +5308,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;
@@ -5334,10 +5334,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 );
@@ -5367,12 +5367,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();
@@ -5382,7 +5382,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_uLong n = 0; n < nHighlightedItem; n++ )
{
pData = pMenu->GetItemList()->GetDataFromPos( n );
nX += pData->aSz.Width();
@@ -5429,11 +5429,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() )
{
@@ -5451,22 +5451,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 );
}
}
@@ -5482,20 +5482,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;
@@ -5506,21 +5506,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
@@ -5536,21 +5536,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_uLong nTempFocusId = nSaveFocusId;
nSaveFocusId = 0;
Window::EndSaveFocus( nTempFocusId, bAllowRestoreFocus );
// #105406# restore focus to document if we could not save focus before
@@ -5561,13 +5561,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 )
@@ -5578,14 +5578,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_uLong nCount = pMenu->pItemList->Count();
+ for ( sal_uLong n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -5656,14 +5656,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_uLong nCount = pMenu->pItemList->Count();
+ for ( sal_uLong n = 0; n < nCount; n++ )
{
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
@@ -5686,16 +5686,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() )
{
@@ -5704,7 +5704,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;
}
}
@@ -5713,22 +5713,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)
@@ -5748,10 +5748,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; }
@@ -5774,14 +5774,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 )
{
@@ -5789,36 +5789,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() )
{
@@ -5826,7 +5826,7 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu
GrabFocusToDocument();
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
@@ -5835,19 +5835,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();
}
@@ -5882,7 +5882,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) &&
@@ -5934,20 +5934,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;
}
}
}
@@ -5956,9 +5956,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 ) )
@@ -5972,7 +5972,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 )
@@ -5984,7 +5984,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();
@@ -6036,16 +6036,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 );
}
}
@@ -6059,13 +6059,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++;
@@ -6088,14 +6088,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() )
@@ -6120,9 +6120,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();
@@ -6132,9 +6132,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;
@@ -6143,7 +6143,7 @@ bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId )
aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu);
return it->second.m_aSelectLink.Call( &aArg );
}
- return FALSE;
+ return sal_False;
}
ImplMenuDelData::ImplMenuDelData( const Menu* pMenu )