diff options
Diffstat (limited to 'sfx2/source/menu/mnumgr.cxx')
-rwxr-xr-x | sfx2/source/menu/mnumgr.cxx | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index 77dbd0dcb885..ed3bd40fb558 100755 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -77,7 +77,6 @@ #include <sfx2/bindings.hxx> #include "mnucfga.hxx" #include "sfx2/sfxresid.hxx" -#include <sfx2/macrconf.hxx> #include <sfx2/msgpool.hxx> #include <sfx2/sfx.hrc> #include "menu.hrc" @@ -87,8 +86,8 @@ #include "thessubmenu.hxx" -static const USHORT nCompatVersion = 4; -static const USHORT nVersion = 5; +static const sal_uInt16 nCompatVersion = 4; +static const sal_uInt16 nVersion = 5; // static member initialization PopupMenu * SfxPopupMenuManager::pStaticThesSubMenu = NULL; @@ -119,7 +118,7 @@ SfxMenuManager::SfxMenuManager( const ResId& rResId, SfxBindings &rBindings ) pResMgr(rResId.GetResMgr()), nType( rResId.GetId() ) { - bAddClipboardFuncs = FALSE; + bAddClipboardFuncs = sal_False; DBG_MEMTEST(); } @@ -154,8 +153,8 @@ void InsertVerbs_Impl( SfxBindings* pBindings, const com::sun::star::uno::Sequen { SfxObjectShell* pDoc = pView->GetObjectShell(); pMenu->InsertSeparator(); - USHORT nr=0; - for ( USHORT n = 0; n < aVerbs.getLength(); ++n ) + sal_uInt16 nr=0; + for ( sal_uInt16 n = 0; n < aVerbs.getLength(); ++n ) { // check for ReadOnly verbs if ( pDoc->IsReadOnly() && !(aVerbs[n].VerbAttributes & embed::VerbAttributes::MS_VERBATTR_NEVERDIRTIES) ) @@ -166,7 +165,7 @@ void InsertVerbs_Impl( SfxBindings* pBindings, const com::sun::star::uno::Sequen continue; // neue Id vergeben - USHORT nId = SID_VERB_START + nr++; + sal_uInt16 nId = SID_VERB_START + nr++; DBG_ASSERT(nId <= SID_VERB_END, "Zuviele Verben!"); if ( nId > SID_VERB_END ) break; @@ -239,10 +238,10 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) if (sThesImplName.Len() > 0 && aSynonymsImageUrl.getLength() > 0) aImage = Image( lcl_GetImageFromPngUrl( aSynonymsImageUrl ) ); - for (USHORT i = 0; (size_t)i < nNumSynonyms; ++i) + for (sal_uInt16 i = 0; (size_t)i < nNumSynonyms; ++i) { //! item ids should start with values > 0, since 0 has special meaning - const USHORT nId = i + 1; + const sal_uInt16 nId = i + 1; String aItemText( linguistic::GetThesaurusReplaceText( aSynonyms[i] ) ); pThesSubMenu->InsertItem( nId, aItemText ); @@ -297,10 +296,10 @@ void SfxMenuManager::UseDefault() if ( bAddClipboardFuncs ) { - USHORT n, nCount = pSVMenu->GetItemCount(); + sal_uInt16 n, nCount = pSVMenu->GetItemCount(); for ( n=0; n<nCount; n++ ) { - USHORT nId = pSVMenu->GetItemId( n ); + sal_uInt16 nId = pSVMenu->GetItemId( n ); if ( nId == SID_COPY || nId == SID_CUT || nId == SID_PASTE ) break; } @@ -312,13 +311,13 @@ void SfxMenuManager::UseDefault() pSVMenu->InsertSeparator(); for ( n=0; n<nCount; n++ ) { - USHORT nId = aPop.GetItemId( n ); + sal_uInt16 nId = aPop.GetItemId( n ); pSVMenu->InsertItem( nId, aPop.GetItemText( nId ), aPop.GetItemBits( nId ) ); } } } - pVMenu = new SfxVirtualMenu( pSVMenu, FALSE, *pBindings, TRUE, TRUE ); + pVMenu = new SfxVirtualMenu( pSVMenu, sal_False, *pBindings, sal_True, sal_True ); } Construct(*pVMenu); @@ -336,7 +335,7 @@ IMPL_LINK( SfxMenuManager, Select, Menu *, pSelMenu ) { DBG_MEMTEST(); - USHORT nId = (USHORT) pSelMenu->GetCurItemId(); + sal_uInt16 nId = (sal_uInt16) pSelMenu->GetCurItemId(); String aCommand = pSelMenu->GetItemCommand( nId ); if ( !aCommand.Len() && pBindings ) { @@ -359,12 +358,12 @@ IMPL_LINK( SfxMenuManager, Select, Menu *, pSelMenu ) // special menu function pBindings->GetDispatcher_Impl()->Execute( nId ); - return TRUE; + return sal_True; } //-------------------------------------------------------------------- -void SfxMenuManager::Construct_Impl( Menu* pSVMenu, BOOL bWithHelp ) +void SfxMenuManager::Construct_Impl( Menu* pSVMenu, sal_Bool bWithHelp ) { SfxVirtualMenu *pOldVirtMenu=0; if ( pMenu ) @@ -375,7 +374,7 @@ void SfxMenuManager::Construct_Impl( Menu* pSVMenu, BOOL bWithHelp ) } TryToHideDisabledEntries_Impl( pSVMenu ); - SfxVirtualMenu *pVMenu = new SfxVirtualMenu( pSVMenu, bWithHelp, *pBindings, TRUE ); + SfxVirtualMenu *pVMenu = new SfxVirtualMenu( pSVMenu, bWithHelp, *pBindings, sal_True ); Construct(*pVMenu); if ( pOldVirtMenu ) @@ -409,10 +408,10 @@ void SfxPopupMenuManager::RemoveDisabledEntries() //-------------------------------------------------------------------- -USHORT SfxPopupMenuManager::Execute( const Point& rPos, Window* pWindow ) +sal_uInt16 SfxPopupMenuManager::Execute( const Point& rPos, Window* pWindow ) { DBG_MEMTEST(); - USHORT nVal = ( (PopupMenu*) GetMenu()->GetSVMenu() )->Execute( pWindow, rPos ); + sal_uInt16 nVal = ( (PopupMenu*) GetMenu()->GetSVMenu() )->Execute( pWindow, rPos ); delete pStaticThesSubMenu; pStaticThesSubMenu = NULL; return nVal; } @@ -428,13 +427,13 @@ IMPL_LINK_INLINE_END( SfxPopupMenuManager, SelectHdl, void *, EMPTYARG ) //-------------------------------------------------------------------- -USHORT SfxPopupMenuManager::Execute( const Point& rPoint, Window* pWindow, va_list pArgs, const SfxPoolItem *pArg1 ) +sal_uInt16 SfxPopupMenuManager::Execute( const Point& rPoint, Window* pWindow, va_list pArgs, const SfxPoolItem *pArg1 ) { DBG_MEMTEST(); PopupMenu* pPopMenu = ( (PopupMenu*)GetMenu()->GetSVMenu() ); pPopMenu->SetSelectHdl( LINK( this, SfxPopupMenuManager, SelectHdl ) ); - USHORT nId = pPopMenu->Execute( pWindow, rPoint ); + sal_uInt16 nId = pPopMenu->Execute( pWindow, rPoint ); pPopMenu->SetSelectHdl( Link() ); if ( nId ) @@ -445,7 +444,7 @@ USHORT SfxPopupMenuManager::Execute( const Point& rPoint, Window* pWindow, va_li //-------------------------------------------------------------------- -USHORT SfxPopupMenuManager::Execute( const Point& rPoint, Window* pWindow, const SfxPoolItem *pArg1, ... ) +sal_uInt16 SfxPopupMenuManager::Execute( const Point& rPoint, Window* pWindow, const SfxPoolItem *pArg1, ... ) { DBG_MEMTEST(); @@ -470,21 +469,21 @@ void SfxPopupMenuManager::StartInsert() void SfxPopupMenuManager::EndInsert() { pBindings->ENTERREGISTRATIONS(); - pMenu = new SfxVirtualMenu( pSVMenu, FALSE, *pBindings, TRUE, TRUE ); + pMenu = new SfxVirtualMenu( pSVMenu, sal_False, *pBindings, sal_True, sal_True ); Construct( *pMenu ); pBindings->LEAVEREGISTRATIONS(); } //------------------------------------------------------------------------- -void SfxPopupMenuManager::InsertSeparator( USHORT nPos ) +void SfxPopupMenuManager::InsertSeparator( sal_uInt16 nPos ) { pSVMenu->InsertSeparator( nPos ); } //------------------------------------------------------------------------- -void SfxPopupMenuManager::InsertItem( USHORT nId, const String& rName, MenuItemBits nBits, const rtl::OString& rHelpId, USHORT nPos ) +void SfxPopupMenuManager::InsertItem( sal_uInt16 nId, const String& rName, MenuItemBits nBits, const rtl::OString& rHelpId, sal_uInt16 nPos ) { pSVMenu->InsertItem( nId, rName, nBits,nPos ); pSVMenu->SetHelpId( nId, rHelpId ); @@ -492,21 +491,21 @@ void SfxPopupMenuManager::InsertItem( USHORT nId, const String& rName, MenuItemB //------------------------------------------------------------------------- -void SfxPopupMenuManager::RemoveItem( USHORT nId ) +void SfxPopupMenuManager::RemoveItem( sal_uInt16 nId ) { pSVMenu->RemoveItem( nId ); } //------------------------------------------------------------------------- -void SfxPopupMenuManager::CheckItem( USHORT nId, BOOL bCheck ) +void SfxPopupMenuManager::CheckItem( sal_uInt16 nId, sal_Bool bCheck ) { pSVMenu->CheckItem( nId, bCheck ); } void SfxPopupMenuManager::AddClipboardFunctions() { - bAddClipboardFuncs = TRUE; + bAddClipboardFuncs = sal_True; } SfxMenuManager::SfxMenuManager( Menu* pMenuArg, SfxBindings &rBindings ) @@ -516,8 +515,8 @@ SfxMenuManager::SfxMenuManager( Menu* pMenuArg, SfxBindings &rBindings ) pResMgr(NULL), nType(0) { - bAddClipboardFuncs = FALSE; - SfxVirtualMenu* pVMenu = new SfxVirtualMenu( pMenuArg, FALSE, rBindings, TRUE, TRUE ); + bAddClipboardFuncs = sal_False; + SfxVirtualMenu* pVMenu = new SfxVirtualMenu( pMenuArg, sal_False, rBindings, sal_True, sal_True ); Construct(*pVMenu); } @@ -530,10 +529,10 @@ SfxPopupMenuManager::SfxPopupMenuManager( PopupMenu* pMenuArg, SfxBindings& rBin SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFrame* pFrame,const Point& rPoint, Window* pWindow ) { PopupMenu *pSVMenu = new PopupMenu( rResId ); - USHORT n, nCount = pSVMenu->GetItemCount(); + sal_uInt16 n, nCount = pSVMenu->GetItemCount(); for ( n=0; n<nCount; n++ ) { - USHORT nId = pSVMenu->GetItemId( n ); + sal_uInt16 nId = pSVMenu->GetItemId( n ); if ( nId == SID_COPY || nId == SID_CUT || nId == SID_PASTE ) break; } @@ -549,7 +548,7 @@ SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFra pSVMenu->InsertSeparator(); for ( n=0; n<nCount; n++ ) { - USHORT nId = aPop.GetItemId( n ); + sal_uInt16 nId = aPop.GetItemId( n ); pSVMenu->InsertItem( nId, aPop.GetItemText( nId ), aPop.GetItemBits( nId ) ); pSVMenu->SetHelpId( nId, aPop.GetHelpId( nId )); } @@ -582,10 +581,10 @@ SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFra void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFrame, const Point& rPoint, Window* pWindow ) { PopupMenu *pSVMenu = new PopupMenu( rResId ); - USHORT n, nCount = pSVMenu->GetItemCount(); + sal_uInt16 n, nCount = pSVMenu->GetItemCount(); for ( n=0; n<nCount; n++ ) { - USHORT nId = pSVMenu->GetItemId( n ); + sal_uInt16 nId = pSVMenu->GetItemId( n ); if ( nId == SID_COPY || nId == SID_CUT || nId == SID_PASTE ) break; } @@ -599,7 +598,7 @@ void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFram pSVMenu->InsertSeparator(); for ( n=0; n<nCount; n++ ) { - USHORT nId = aPop.GetItemId( n ); + sal_uInt16 nId = aPop.GetItemId( n ); pSVMenu->InsertItem( nId, aPop.GetItemText( nId ), aPop.GetItemBits( nId ) ); pSVMenu->SetHelpId( nId, aPop.GetHelpId( nId )); } |