diff options
Diffstat (limited to 'cui/source/customize/macropg.cxx')
-rw-r--r-- | cui/source/customize/macropg.cxx | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 3f26f09d9761..62731acc4b68 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -37,7 +37,6 @@ #include <tools/diagnose_ex.h> #include <sfx2/app.hxx> #include <sfx2/objsh.hxx> -#include <sfx2/macrconf.hxx> #include <sfx2/sfxdefs.hxx> #include <com/sun/star/container/NoSuchElementException.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> @@ -71,11 +70,11 @@ _SvxMacroTabPage_Impl::_SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet ) : pStrEvent( NULL ), pAssignedMacro( NULL ), pEventLB( NULL ), - bReadOnly( FALSE ), - bIDEDialogMode( FALSE ) + bReadOnly( sal_False ), + bIDEDialogMode( sal_False ) { const SfxPoolItem* pItem; - if ( SFX_ITEM_SET == rAttrSet.GetItemState( SID_ATTR_MACROITEM, FALSE, &pItem ) ) + if ( SFX_ITEM_SET == rAttrSet.GetItemState( SID_ATTR_MACROITEM, sal_False, &pItem ) ) bIDEDialogMode = ((const SfxBoolItem*)pItem)->GetValue(); } @@ -121,7 +120,7 @@ IMPL_LINK( _HeaderTabListBox, HeaderEndDrag_Impl, HeaderBar*, pBar ) if( !maHeaderBar.IsItemMode() ) { Size aSz; - USHORT _nTabs = maHeaderBar.GetItemCount(); + sal_uInt16 _nTabs = maHeaderBar.GetItemCount(); long nWidth = maHeaderBar.GetItemSize( ITEMID_EVENT ); long nBarWidth = maHeaderBar.GetSizePixel().Width(); @@ -132,7 +131,7 @@ IMPL_LINK( _HeaderTabListBox, HeaderEndDrag_Impl, HeaderBar*, pBar ) { long _nWidth, nTmpSz = 0; - for( USHORT i = 1 ; i < _nTabs ; ++i ) + for( sal_uInt16 i = 1 ; i < _nTabs ; ++i ) { _nWidth = maHeaderBar.GetItemSize( i ); aSz.Width() = _nWidth + nTmpSz; @@ -189,7 +188,7 @@ void _HeaderTabListBox::ConnectElements( void ) maListBox.InitHeaderBar( &maHeaderBar ); } -void _HeaderTabListBox::Show( BOOL bVisible, USHORT nFlags ) +void _HeaderTabListBox::Show( sal_Bool bVisible, sal_uInt16 nFlags ) { maListBox.Show( bVisible, nFlags ); maHeaderBar.Show( bVisible, nFlags ); @@ -204,7 +203,7 @@ void _HeaderTabListBox::Enable( bool bEnable, bool bChild ) // assign button ("Add Command") is enabled only if it is not read only // delete button ("Remove Command") is enabled if a current binding exists // and it is not read only -void _SvxMacroTabPage::EnableButtons( const String& /*rLangName*/ ) +void _SvxMacroTabPage::EnableButtons() { const SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected(); if ( pE ) @@ -329,7 +328,7 @@ void _SvxMacroTabPage::InitResources() // the following method is called when the user clicks OK // We use the contents of the hashes to replace the settings -BOOL _SvxMacroTabPage::FillItemSet( SfxItemSet& /*rSet*/ ) +sal_Bool _SvxMacroTabPage::FillItemSet( SfxItemSet& /*rSet*/ ) { try { @@ -380,7 +379,7 @@ BOOL _SvxMacroTabPage::FillItemSet( SfxItemSet& /*rSet*/ ) { } // what is the return value about?? - return FALSE; + return sal_False; } // the following method clears the bindings in the hashes for both doc & app @@ -427,12 +426,12 @@ void _SvxMacroTabPage::Reset() DisplayAppEvents(bAppEvents); } -void _SvxMacroTabPage::SetReadOnly( BOOL bSet ) +void _SvxMacroTabPage::SetReadOnly( sal_Bool bSet ) { mpImpl->bReadOnly = bSet; } -BOOL _SvxMacroTabPage::IsReadOnly() const +sal_Bool _SvxMacroTabPage::IsReadOnly() const { return mpImpl->bReadOnly; } @@ -445,13 +444,13 @@ class IconLBoxString : public SvLBoxString int m_nxImageOffset; public: - IconLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, const String& sText, + IconLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& sText, Image* pMacroImg, Image* pComponentImg ); - virtual void Paint(const Point& aPos, SvLBox& aDevice, USHORT nFlags, SvLBoxEntry* pEntry ); + virtual void Paint(const Point& aPos, SvLBox& aDevice, sal_uInt16 nFlags, SvLBoxEntry* pEntry ); }; -IconLBoxString::IconLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, const String& sText, +IconLBoxString::IconLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& sText, Image* pMacroImg, Image* pComponentImg ) : SvLBoxString( pEntry, nFlags, sText ) , m_pMacroImg( pMacroImg ) @@ -462,7 +461,7 @@ IconLBoxString::IconLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, const String //=============================================== void IconLBoxString::Paint( const Point& aPos, SvLBox& aDevice, - USHORT /*nFlags*/, SvLBoxEntry* /*pEntry*/ ) + sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/ ) { String aTxt( GetText() ); if( aTxt.Len() ) @@ -500,7 +499,7 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents) bAppEvents = appEvents; SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - mpImpl->pEventLB->SetUpdateMode( FALSE ); + mpImpl->pEventLB->SetUpdateMode( sal_False ); rListBox.Clear(); SvLBoxEntry* pE = rListBox.GetEntry( 0 ); EventsHash* eventsHash; @@ -568,8 +567,8 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents) rListBox.MakeVisible( pE ); } - rListBox.SetUpdateMode( TRUE ); - EnableButtons( String() ); + rListBox.SetUpdateMode( sal_True ); + EnableButtons(); } // select event handler on the listbox @@ -578,7 +577,7 @@ IMPL_STATIC_LINK( _SvxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG ) _SvxMacroTabPage_Impl* pImpl = pThis->mpImpl; SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox(); SvLBoxEntry* pE = rListBox.FirstSelected(); - ULONG nPos; + sal_uLong nPos; if( !pE || LISTBOX_ENTRY_NOTFOUND == ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) ) @@ -587,7 +586,7 @@ IMPL_STATIC_LINK( _SvxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG ) return 0; } - pThis->EnableButtons( String() ); + pThis->EnableButtons(); return 0; } @@ -607,7 +606,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* _SvxMacroTabPage_Impl* pImpl = pThis->mpImpl; SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox(); SvLBoxEntry* pE = rListBox.FirstSelected(); - ULONG nPos; + sal_uLong nPos; if( !pE || LISTBOX_ENTRY_NOTFOUND == ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) ) { @@ -615,7 +614,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* return 0; } - const BOOL bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled(); + const sal_Bool bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled(); ::rtl::OUString* pEventName = (::rtl::OUString*)pE->GetUserData(); @@ -673,7 +672,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* else if( bAssEnabled ) { // assign pressed - SvxScriptSelectorDialog* pDlg = new SvxScriptSelectorDialog( pThis, FALSE, pThis->GetFrame() ); + SvxScriptSelectorDialog* pDlg = new SvxScriptSelectorDialog( pThis, sal_False, pThis->GetFrame() ); if( pDlg ) { short ret = pDlg->Execute(); @@ -702,16 +701,16 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* } // update the listbox entry - pImpl->pEventLB->SetUpdateMode( FALSE ); + pImpl->pEventLB->SetUpdateMode( sal_False ); pE->ReplaceItem( new IconLBoxString( pE, 0, sEventURL, pImpl->pMacroImg, pImpl->pComponentImg ), LB_MACROS_ITEMPOS ); rListBox.GetModel()->InvalidateEntry( pE ); rListBox.Select( pE ); rListBox.MakeVisible( pE ); - rListBox.SetUpdateMode( TRUE ); + rListBox.SetUpdateMode( sal_True ); - pThis->EnableButtons( String() ); + pThis->EnableButtons(); return 0; } @@ -749,7 +748,7 @@ void _SvxMacroTabPage::InitAndSetHandler( Reference< container::XNameReplace> xA mpImpl->pEventLB->GetListBox().SetEntryHeight( sal::static_int_cast< short >(nMinLineHeight) ); - mpImpl->pEventLB->Enable( TRUE ); + mpImpl->pEventLB->Enable( sal_True ); if(!m_xAppEvents.is()) { @@ -854,7 +853,7 @@ SvxMacroTabPage::SvxMacroTabPage( Window* pParent, const Reference< frame::XFram InitAndSetHandler( xNameReplace, Reference< container::XNameReplace>(0), Reference< util::XModifiable >(0)); DisplayAppEvents(true); SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - SvLBoxEntry* pE = rListBox.GetEntry( (ULONG)nSelectedIndex ); + SvLBoxEntry* pE = rListBox.GetEntry( (sal_uLong)nSelectedIndex ); if( pE ) rListBox.Select(pE); } |