summaryrefslogtreecommitdiff
path: root/sfx2/source/toolbox/tbxitem.cxx
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2011-01-07 17:14:47 +0100
committerMikhail Voytenko <mav@openoffice.org>2011-01-07 17:14:47 +0100
commitdcd8e4664d9a284c24ceb0360cab0606b22cf86d (patch)
tree19c2817590445d01056d62e793f68892eb1b23b4 /sfx2/source/toolbox/tbxitem.cxx
parent71747dd58636847fdfda6b5e4029a78d5e0cccfb (diff)
removetooltypes: #i112600# remove tooltypes
Diffstat (limited to 'sfx2/source/toolbox/tbxitem.cxx')
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx156
1 files changed, 78 insertions, 78 deletions
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 7cc25c872eb1..ef6e99562d83 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -125,7 +125,7 @@ using namespace ::com::sun::star::ui;
//====================================================================
-SFX_IMPL_TOOLBOX_CONTROL_ARG(SfxToolBoxControl, SfxStringItem, TRUE);
+SFX_IMPL_TOOLBOX_CONTROL_ARG(SfxToolBoxControl, SfxStringItem, sal_True);
SFX_IMPL_TOOLBOX_CONTROL(SfxAppToolBoxControl_Impl, SfxStringItem);
static Window* GetTopMostParentSystemWindow( Window* pWindow )
@@ -196,7 +196,7 @@ svt::ToolboxController* SAL_CALL SfxToolBoxControllerFactory( const Reference< X
const SfxSlot* pSlot = pSlotPool->GetUnoSlot( aTargetURL.Path );
if ( pSlot )
{
- USHORT nSlotId = pSlot->GetSlotId();
+ sal_uInt16 nSlotId = pSlot->GetSlotId();
if ( nSlotId > 0 )
return SfxToolBoxControl::CreateControl( nSlotId, nID, pToolbox, pModule );
}
@@ -207,11 +207,11 @@ svt::ToolboxController* SAL_CALL SfxToolBoxControllerFactory( const Reference< X
struct SfxToolBoxControl_Impl
{
ToolBox* pBox;
- BOOL bShowString;
- USHORT nSelectModifier;
+ sal_Bool bShowString;
+ sal_uInt16 nSelectModifier;
SfxTbxCtrlFactory* pFact;
- USHORT nTbxId;
- USHORT nSlotId;
+ sal_uInt16 nTbxId;
+ sal_uInt16 nSlotId;
SfxPopupWindow* mpFloatingWindow;
SfxPopupWindow* mpPopupWindow;
Reference< XUIElement > mxUIElement;
@@ -241,10 +241,10 @@ IMPL_LINK( SfxToolBoxControl_Impl, WindowEventListener, VclSimpleEvent*, pEvent
//--------------------------------------------------------------------
SfxToolBoxControl::SfxToolBoxControl(
- USHORT nSlotID,
- USHORT nID,
+ sal_uInt16 nSlotID,
+ sal_uInt16 nID,
ToolBox& rBox,
- BOOL bShowStringItems )
+ sal_Bool bShowStringItems )
: svt::ToolboxController()
{
pImpl = new SfxToolBoxControl_Impl;
@@ -328,7 +328,7 @@ void SfxToolBoxControl::RegisterToolBoxControl( SfxModule* pMod, SfxTbxCtrlFacto
SFX_APP()->RegisterToolBoxControl_Impl( pMod, pFact );
}
-SfxToolBoxControl* SfxToolBoxControl::CreateControl( USHORT nSlotId, USHORT nTbxId, ToolBox *pBox, SfxModule* pMod )
+SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule* pMod )
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
@@ -349,8 +349,8 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( USHORT nSlotId, USHORT nTbx
if ( pFactories )
{
SfxTbxCtrlFactArr_Impl &rFactories = *pFactories;
- USHORT nFactory;
- const USHORT nCount = rFactories.Count();
+ sal_uInt16 nFactory;
+ const sal_uInt16 nCount = rFactories.Count();
// search for a factory with the given slot id
for( nFactory = 0; nFactory < nCount; ++nFactory )
@@ -376,8 +376,8 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( USHORT nSlotId, USHORT nTbx
}
SfxTbxCtrlFactArr_Impl &rFactories = pApp->GetTbxCtrlFactories_Impl();
- USHORT nFactory;
- const USHORT nCount = rFactories.Count();
+ sal_uInt16 nFactory;
+ const sal_uInt16 nCount = rFactories.Count();
for( nFactory = 0; nFactory < nCount; ++nFactory )
if( (rFactories[nFactory]->nTypeId == aSlotType) && (rFactories[nFactory]->nSlotId == nSlotId) )
@@ -562,7 +562,7 @@ throw ( ::com::sun::star::uno::RuntimeException )
}
}
- USHORT nSlotId = 0;
+ sal_uInt16 nSlotId = 0;
SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( pViewFrame );
const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path );
if ( pSlot )
@@ -670,7 +670,7 @@ void SAL_CALL SfxToolBoxControl::updateImage() throw (::com::sun::star::uno::Run
void SAL_CALL SfxToolBoxControl::execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException)
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
- Select( (USHORT)KeyModifier );
+ Select( (sal_uInt16)KeyModifier );
}
void SAL_CALL SfxToolBoxControl::click() throw (::com::sun::star::uno::RuntimeException)
{
@@ -827,7 +827,7 @@ void SfxToolBoxControl::createAndPositionSubToolBar( const ::rtl::OUString& rSub
{
static WeakReference< XUIElementFactory > xWeakUIElementFactory;
- USHORT nItemId = pImpl->pBox->GetDownItemId();
+ sal_uInt16 nItemId = pImpl->pBox->GetDownItemId();
if ( !nItemId )
return;
@@ -962,7 +962,7 @@ IMPL_LINK( SfxToolBoxControl, ClosePopupWindow, SfxPopupWindow *, pWindow )
void SfxToolBoxControl::StateChanged
(
- USHORT nId,
+ sal_uInt16 nId,
SfxItemState eState,
const SfxPoolItem* pState
)
@@ -976,7 +976,7 @@ void SfxToolBoxControl::StateChanged
// enabled/disabled-Flag pauschal korrigieren
pImpl->pBox->EnableItem( GetId(), eState != SFX_ITEM_DISABLED );
- USHORT nItemBits = pImpl->pBox->GetItemBits( GetId() );
+ sal_uInt16 nItemBits = pImpl->pBox->GetItemBits( GetId() );
nItemBits &= ~TIB_CHECKABLE;
TriState eTri = STATE_NOCHECK;
switch ( eState )
@@ -1016,15 +1016,15 @@ void SfxToolBoxControl::StateChanged
//--------------------------------------------------------------------
-void SfxToolBoxControl::Select( USHORT nModifier )
+void SfxToolBoxControl::Select( sal_uInt16 nModifier )
{
pImpl->nSelectModifier = nModifier;
- Select( BOOL((nModifier & KEY_MOD1)!=0) );
+ Select( sal_Bool((nModifier & KEY_MOD1)!=0) );
}
//--------------------------------------------------------------------
-void SfxToolBoxControl::Select( BOOL /*bMod1*/ )
+void SfxToolBoxControl::Select( sal_Bool /*bMod1*/ )
{
if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# #i102805#
{
@@ -1135,7 +1135,7 @@ throw ( ::com::sun::star::uno::RuntimeException )
}
}
- USHORT nSlotId = 0;
+ sal_uInt16 nSlotId = 0;
SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( pViewFrame );
const SfxSlot* pSlot = rPool.GetUnoSlot( rEvent.FeatureURL.Path );
if ( pSlot )
@@ -1223,12 +1223,12 @@ throw ( ::com::sun::star::uno::RuntimeException )
//--------------------------------------------------------------------
SfxPopupWindow::SfxPopupWindow(
- USHORT nId,
+ sal_uInt16 nId,
const Reference< XFrame >& rFrame,
WinBits nBits ) :
FloatingWindow( SFX_APP()->GetTopWindow(), nBits )
- , m_bFloating(FALSE)
- , m_bCascading( FALSE )
+ , m_bFloating(sal_False)
+ , m_bCascading( sal_False )
, m_nId( nId )
, m_xFrame( rFrame )
, m_pStatusListener( 0 )
@@ -1243,12 +1243,12 @@ SfxPopupWindow::SfxPopupWindow(
//--------------------------------------------------------------------
SfxPopupWindow::SfxPopupWindow(
- USHORT nId,
+ sal_uInt16 nId,
const Reference< XFrame >& rFrame,
const ResId &rId ) :
FloatingWindow( SFX_APP()->GetTopWindow(), rId )
- , m_bFloating(FALSE)
- , m_bCascading( FALSE )
+ , m_bFloating(sal_False)
+ , m_bCascading( sal_False )
, m_nId( nId )
, m_xFrame( rFrame )
, m_pStatusListener( 0 )
@@ -1263,13 +1263,13 @@ SfxPopupWindow::SfxPopupWindow(
//--------------------------------------------------------------------
SfxPopupWindow::SfxPopupWindow(
- USHORT nId,
+ sal_uInt16 nId,
const Reference< XFrame >& rFrame,
Window* pParentWindow,
WinBits nBits ) :
FloatingWindow( pParentWindow, nBits )
- , m_bFloating(FALSE)
- , m_bCascading( FALSE )
+ , m_bFloating(sal_False)
+ , m_bCascading( sal_False )
, m_nId( nId )
, m_xFrame( rFrame )
, m_pStatusListener( 0 )
@@ -1284,13 +1284,13 @@ SfxPopupWindow::SfxPopupWindow(
//--------------------------------------------------------------------
SfxPopupWindow::SfxPopupWindow(
- USHORT nId,
+ sal_uInt16 nId,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
Window* pParentWindow,
const ResId &rId ) :
FloatingWindow( pParentWindow, rId )
- , m_bFloating(FALSE)
- , m_bCascading( FALSE )
+ , m_bFloating(sal_False)
+ , m_bCascading( sal_False )
, m_nId( nId )
, m_xFrame( rFrame )
, m_pStatusListener( 0 )
@@ -1381,13 +1381,13 @@ void SfxPopupWindow::UpdateStatus( const rtl::OUString& rCommandURL )
//--------------------------------------------------------------------
-BOOL SfxPopupWindow::Close()
+sal_Bool SfxPopupWindow::Close()
{
- m_bFloating = FALSE;
+ m_bFloating = sal_False;
FloatingWindow::Close();
Delete(0);
- return TRUE;
+ return sal_True;
}
//--------------------------------------------------------------------
@@ -1401,7 +1401,7 @@ void SfxPopupWindow::PopupModeEnd()
{
// wurde abgerissen
DeleteFloatingWindow();
- m_bFloating = TRUE;
+ m_bFloating = sal_True;
}
else
Close();
@@ -1422,14 +1422,14 @@ void SfxPopupWindow::DeleteFloatingWindow()
void SfxPopupWindow::MouseMove( const ::MouseEvent& rMEvt )
{
- if ( m_bCascading == FALSE )
+ if ( m_bCascading == sal_False )
FloatingWindow::MouseMove( rMEvt );
else
{
// MouseMove-Event an die Children forwarden
::Point aPos = rMEvt.GetPosPixel();
::Point aScrPos = OutputToScreenPixel( aPos );
- USHORT i = 0;
+ sal_uInt16 i = 0;
Window* pWindow = GetChild( i );
while ( pWindow )
{
@@ -1448,12 +1448,12 @@ void SfxPopupWindow::MouseMove( const ::MouseEvent& rMEvt )
void SfxPopupWindow::StartCascading()
{
- m_bCascading= TRUE;
+ m_bCascading= sal_True;
}
void SfxPopupWindow::EndCascading()
{
- m_bCascading = FALSE;
+ m_bCascading = sal_False;
}
//--------------------------------------------------------------------
@@ -1477,7 +1477,7 @@ SfxPopupWindow* SfxPopupWindow::Clone() const
//--------------------------------------------------------------------
void SfxPopupWindow::StateChanged(
- USHORT /*nSID*/,
+ sal_uInt16 /*nSID*/,
SfxItemState eState,
const SfxPoolItem* /*pState*/ )
/* [Bescheibung]
@@ -1499,7 +1499,7 @@ void SfxPopupWindow::StateChanged(
}
else if ( m_bFloating )
{
- Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
}
}
@@ -1515,9 +1515,9 @@ IMPL_LINK( SfxPopupWindow, Delete, void *, EMPTYARG )
//--------------------------------------------------------------------
-SfxAppToolBoxControl_Impl::SfxAppToolBoxControl_Impl( USHORT nSlotId, USHORT nId, ToolBox& rBox )
+SfxAppToolBoxControl_Impl::SfxAppToolBoxControl_Impl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox )
: SfxToolBoxControl( nSlotId, nId, rBox )
- , bBigImages( FALSE )
+ , bBigImages( sal_False )
, pMenu( 0 )
{
rBox.SetHelpId( nId, HID_TBXCONTROL_FILENEW );
@@ -1542,8 +1542,8 @@ SfxAppToolBoxControl_Impl::~SfxAppToolBoxControl_Impl()
it return the existing state of the given URL in the popupmenu of this toolbox control.
If the given URL can be located as an action command of one menu item of the
- popup menu of this control, we return TRUE. Otherwhise we return FALSE.
- Further we return a fallback URL, in case we have to return FALSE. Because
+ popup menu of this control, we return sal_True. Otherwhise we return sal_False.
+ Further we return a fallback URL, in case we have to return sal_False. Because
the outside code must select a valid item of the popup menu everytime ...
and we define it here. By the way this m ethod was written to handle
error situations gracefully. E.g. it can be called during creation time
@@ -1564,34 +1564,34 @@ SfxAppToolBoxControl_Impl::~SfxAppToolBoxControl_Impl()
@param pImage
contains the image of the menu for the URL.
- @return TRUE - if URL could be located as an item of the popup menu.
- FALSE - otherwhise.
+ @return sal_True - if URL could be located as an item of the popup menu.
+ sal_False - otherwhise.
*/
-BOOL Impl_ExistURLInMenu( const PopupMenu *pMenu ,
+sal_Bool Impl_ExistURLInMenu( const PopupMenu *pMenu ,
String &sURL ,
String *pFallback ,
Image *pImage )
{
- BOOL bValidFallback = FALSE;
+ sal_Bool bValidFallback = sal_False;
if (pMenu && sURL.Len())
{
- USHORT c = pMenu->GetItemCount();
- for (USHORT p=0; p<c; ++p)
+ sal_uInt16 c = pMenu->GetItemCount();
+ for (sal_uInt16 p=0; p<c; ++p)
{
- USHORT nId = pMenu->GetItemId(p);
+ sal_uInt16 nId = pMenu->GetItemId(p);
String aCmd( pMenu->GetItemCommand(nId) );
if (!bValidFallback && aCmd.Len())
{
*pFallback = aCmd;
- bValidFallback = TRUE;
+ bValidFallback = sal_True;
}
if (aCmd.Search(sURL)==0)//match even if the menu command is more detailed (maybe an additional query) #i28667#
{
sURL = aCmd;
*pImage = pMenu->GetItemImage( nId );
- return TRUE;
+ return sal_True;
}
}
}
@@ -1602,7 +1602,7 @@ BOOL Impl_ExistURLInMenu( const PopupMenu *pMenu ,
*pFallback += String(SvtModuleOptions().GetDefaultModuleName());
}
- return FALSE;
+ return sal_False;
}
long Select_Impl( void* pHdl, void* pVoid );
@@ -1625,15 +1625,15 @@ SfxPopupWindow* SfxAppToolBoxControl_Impl::CreatePopupWindow()
{
pMenu->SetSelectHdl( Link( NULL, Select_Impl ) );
pMenu->SetActivateHdl( LINK( this, SfxAppToolBoxControl_Impl, Activate ));
- rBox.SetItemDown( GetId(), TRUE );
- USHORT nSelected = pMenu->Execute( &rBox, aRect, POPUPMENU_EXECUTE_DOWN );
+ rBox.SetItemDown( GetId(), sal_True );
+ sal_uInt16 nSelected = pMenu->Execute( &rBox, aRect, POPUPMENU_EXECUTE_DOWN );
if ( nSelected )
{
aLastURL = pMenu->GetItemCommand( nSelected );
SetImage( pMenu->GetItemCommand( nSelected ) );
}
- rBox.SetItemDown( GetId(), FALSE );
+ rBox.SetItemDown( GetId(), sal_False );
}
return 0;
@@ -1646,12 +1646,12 @@ void SfxAppToolBoxControl_Impl::SetImage( const String &rURL )
String aURL = rURL;
String sFallback;
Image aMenuImage;
- BOOL bValid = Impl_ExistURLInMenu(pMenu,aURL,&sFallback,&aMenuImage);
+ sal_Bool bValid = Impl_ExistURLInMenu(pMenu,aURL,&sFallback,&aMenuImage);
if (!bValid)
aURL = sFallback;
- BOOL bBig = SvtMiscOptions().AreCurrentSymbolsLarge();
- BOOL bHC = GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode();
+ sal_Bool bBig = SvtMiscOptions().AreCurrentSymbolsLarge();
+ sal_Bool bHC = GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode();
Image aImage = SvFileInformationManager::GetImageNoDefault( INetURLObject( aURL ), bBig, bHC );
if ( !aImage )
aImage = !!aMenuImage ? aMenuImage :
@@ -1670,7 +1670,7 @@ void SfxAppToolBoxControl_Impl::SetImage( const String &rURL )
void SfxAppToolBoxControl_Impl::StateChanged
(
- USHORT nSlotId,
+ sal_uInt16 nSlotId,
SfxItemState eState,
const SfxPoolItem* pState
)
@@ -1700,7 +1700,7 @@ void SfxAppToolBoxControl_Impl::StateChanged
//--------------------------------------------------------------------
-void SfxAppToolBoxControl_Impl::Select( BOOL bMod1 )
+void SfxAppToolBoxControl_Impl::Select( sal_Bool bMod1 )
{
if( aLastURL.Len() )
{
@@ -1793,7 +1793,7 @@ long Select_Impl( void* /*pHdl*/, void* pVoid )
Application::PostUserEvent( STATIC_LINK( 0, SfxAppToolBoxControl_Impl, ExecuteHdl_Impl), pExecuteInfo );
}
- return TRUE;
+ return sal_True;
}
IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu )
@@ -1801,9 +1801,9 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu )
if ( pActMenu )
{
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
- ULONG nSymbolsStyle = rSettings.GetSymbolsStyle();
- BOOL bIsHiContrastMode = rSettings.GetHighContrastMode();
- BOOL bShowMenuImages = rSettings.GetUseImagesInMenus();
+ sal_uIntPtr nSymbolsStyle = rSettings.GetSymbolsStyle();
+ sal_Bool bIsHiContrastMode = rSettings.GetHighContrastMode();
+ sal_Bool bShowMenuImages = rSettings.GetUseImagesInMenus();
if (( nSymbolsStyle != m_nSymbolsStyle ) ||
( bIsHiContrastMode != m_bWasHiContrastMode ) ||
@@ -1813,10 +1813,10 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu )
m_bWasHiContrastMode = bIsHiContrastMode;
m_bShowMenuImages = bShowMenuImages;
- USHORT nCount = pActMenu->GetItemCount();
- for ( USHORT nSVPos = 0; nSVPos < nCount; nSVPos++ )
+ sal_uInt16 nCount = pActMenu->GetItemCount();
+ for ( sal_uInt16 nSVPos = 0; nSVPos < nCount; nSVPos++ )
{
- USHORT nId = pActMenu->GetItemId( nSVPos );
+ sal_uInt16 nId = pActMenu->GetItemId( nSVPos );
if ( pActMenu->GetItemType( nSVPos ) != MENUITEM_SEPARATOR )
{
if ( bShowMenuImages )
@@ -1832,7 +1832,7 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu )
if ( aImageId.getLength() > 0 )
{
Reference< ::com::sun::star::frame::XFrame > xFrame;
- Image aImage = GetImage( xFrame, aImageId, FALSE, bIsHiContrastMode );
+ Image aImage = GetImage( xFrame, aImageId, sal_False, bIsHiContrastMode );
if ( !!aImage )
{
bImageSet = sal_True;
@@ -1844,7 +1844,7 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu )
if ( !bImageSet && aCmd.Len() )
{
Image aImage = SvFileInformationManager::GetImage(
- INetURLObject(aCmd), FALSE, bIsHiContrastMode );
+ INetURLObject(aCmd), sal_False, bIsHiContrastMode );
if ( !!aImage )
pActMenu->SetItemImage( nId, aImage );
}
@@ -1855,10 +1855,10 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu )
}
}
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
//--------------------------------------------------------------------