diff options
Diffstat (limited to 'cui/source/customize/selector.cxx')
-rw-r--r-- | cui/source/customize/selector.cxx | 105 |
1 files changed, 31 insertions, 74 deletions
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx index 6fee34f67ca6..0900a1ff4847 100644 --- a/cui/source/customize/selector.cxx +++ b/cui/source/customize/selector.cxx @@ -38,7 +38,6 @@ #include <sfx2/app.hxx> #include <sfx2/msg.hxx> #include <sfx2/msgpool.hxx> -#include <sfx2/macrconf.hxx> #include <sfx2/minfitem.hxx> #include <sfx2/objsh.hxx> #include <sfx2/dispatch.hxx> @@ -89,7 +88,7 @@ SvxConfigFunctionListBox_Impl::SvxConfigFunctionListBox_Impl( Window* pParent, c , pCurEntry( 0 ) , m_pDraggingEntry( 0 ) { - SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT ); + SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT ); GetModel()->SetSortMode( SortAscending ); // Timer for the BallonHelp @@ -142,8 +141,8 @@ IMPL_LINK( SvxConfigFunctionListBox_Impl, TimerHdl, Timer*, EMPTYARG) void SvxConfigFunctionListBox_Impl::ClearAll() { - USHORT nCount = aArr.Count(); - for ( USHORT i=0; i<nCount; ++i ) + sal_uInt16 nCount = aArr.Count(); + for ( sal_uInt16 i=0; i<nCount; ++i ) { SvxGroupInfo_Impl *pData = aArr[i]; delete pData; @@ -153,42 +152,6 @@ void SvxConfigFunctionListBox_Impl::ClearAll() Clear(); } -SvLBoxEntry* SvxConfigFunctionListBox_Impl::GetEntry_Impl( const String& rName ) -{ - SvLBoxEntry *pEntry = First(); - while ( pEntry ) - { - if ( GetEntryText( pEntry ) == rName ) - return pEntry; - pEntry = Next( pEntry ); - } - - return NULL; -} - -SvLBoxEntry* SvxConfigFunctionListBox_Impl::GetEntry_Impl( USHORT nId ) -{ - SvLBoxEntry *pEntry = First(); - while ( pEntry ) - { - SvxGroupInfo_Impl *pData = (SvxGroupInfo_Impl*) pEntry->GetUserData(); - if ( pData && pData->nOrd == nId ) - return pEntry; - pEntry = Next( pEntry ); - } - - return NULL; -} - -USHORT SvxConfigFunctionListBox_Impl::GetId( SvLBoxEntry *pEntry ) -{ - SvxGroupInfo_Impl *pData = pEntry ? - (SvxGroupInfo_Impl*) pEntry->GetUserData() : 0; - if ( pData ) - return pData->nOrd; - return 0; -} - String SvxConfigFunctionListBox_Impl::GetHelpText( SvLBoxEntry *pEntry ) { // Information zum selektierten Entry aus den Userdaten holen @@ -257,7 +220,7 @@ SvxConfigGroupListBox_Impl::SvxConfigGroupListBox_Impl( m_xFrame.set( xFrame ); } - SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ); + SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ); ImageList aNavigatorImages( SVX_RES( RID_SVXIMGLIST_FMEXPL ) ); @@ -275,8 +238,8 @@ SvxConfigGroupListBox_Impl::~SvxConfigGroupListBox_Impl() void SvxConfigGroupListBox_Impl::ClearAll() { - USHORT nCount = aArr.Count(); - for ( USHORT i=0; i<nCount; ++i ) + sal_uInt16 nCount = aArr.Count(); + for ( sal_uInt16 i=0; i<nCount; ++i ) { SvxGroupInfo_Impl *pData = aArr[i]; delete pData; @@ -353,12 +316,12 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows Sequence< Reference< browse::XBrowseNode > > children = _rxRootNode->getChildNodes(); - BOOL bIsRootNode = _rxRootNode->getName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Root")); + sal_Bool bIsRootNode = _rxRootNode->getName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Root")); /* To mimic current starbasic behaviour we need to make sure that only the current document is displayed in the config tree. Tests below - set the bDisplay flag to FALSE if the current + set the bDisplay flag to sal_False if the current node is a first level child of the Root and is NOT either the current document, user or share */ OUString sCurrentDocTitle; @@ -375,7 +338,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows if ( !theChild.is() ) continue; ::rtl::OUString sUIName = theChild->getName(); - BOOL bDisplay = TRUE; + sal_Bool bDisplay = sal_True; if ( bIsRootNode || ( m_bShowSlots && _pParentEntry && ( GetModel()->GetDepth( _pParentEntry ) == 0 ) ) @@ -395,7 +358,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows } else if ( !sUIName.equals( sCurrentDocTitle ) ) { - bDisplay = FALSE; + bDisplay = sal_False; } } @@ -423,7 +386,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows * way to determine if a basic lib had children * without having to ask for them (which forces * the library to be loaded */ - pNewEntry->EnableChildsOnDemand( TRUE ); + pNewEntry->EnableChildsOnDemand( sal_True ); } else { @@ -436,7 +399,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows { if ( grandchildren[m]->getType() == browse::BrowseNodeTypes::CONTAINER ) { - pNewEntry->EnableChildsOnDemand( TRUE ); + pNewEntry->EnableChildsOnDemand( sal_True ); break; } } @@ -452,7 +415,7 @@ void SvxConfigGroupListBox_Impl::fillScriptList( const Reference< browse::XBrows void SvxConfigGroupListBox_Impl::Init() { - SetUpdateMode(FALSE); + SetUpdateMode(sal_False); ClearAll(); Reference< XComponentContext > xContext; @@ -602,7 +565,7 @@ void SvxConfigGroupListBox_Impl::Init() SvLBoxEntry *pNewEntry = InsertEntry( aTitle, NULL ); pNewEntry->SetUserData( pInfo ); - pNewEntry->EnableChildsOnDemand( TRUE ); + pNewEntry->EnableChildsOnDemand( sal_True ); aArr.Insert( pInfo, aArr.Count() ); } else @@ -612,7 +575,7 @@ void SvxConfigGroupListBox_Impl::Init() } } MakeVisible( GetEntry( 0,0 ) ); - SetUpdateMode( TRUE ); + SetUpdateMode( sal_True ); } Image SvxConfigGroupListBox_Impl::GetImage( @@ -723,12 +686,12 @@ void SvxConfigGroupListBox_Impl::GroupSelected() { SvLBoxEntry *pEntry = FirstSelected(); SvxGroupInfo_Impl *pInfo = (SvxGroupInfo_Impl*) pEntry->GetUserData(); - pFunctionListBox->SetUpdateMode(FALSE); + pFunctionListBox->SetUpdateMode(sal_False); pFunctionListBox->ClearAll(); if ( pInfo->nKind != SVX_CFGGROUP_FUNCTION && pInfo->nKind != SVX_CFGGROUP_SCRIPTCONTAINER ) { - pFunctionListBox->SetUpdateMode(TRUE); + pFunctionListBox->SetUpdateMode(sal_True); return; } @@ -896,31 +859,31 @@ void SvxConfigGroupListBox_Impl::GroupSelected() if ( pFunctionListBox->GetEntryCount() ) pFunctionListBox->Select( pFunctionListBox->GetEntry( 0, 0 ) ); - pFunctionListBox->SetUpdateMode(TRUE); + pFunctionListBox->SetUpdateMode(sal_True); } -BOOL SvxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent ) +sal_Bool SvxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent ) { - BOOL bRet = SvTreeListBox::Expand( pParent ); + sal_Bool bRet = SvTreeListBox::Expand( pParent ); if ( bRet ) { // Wieviele Entries k"onnen angezeigt werden ? - ULONG nEntries = GetOutputSizePixel().Height() / GetEntryHeight(); + sal_uLong nEntries = GetOutputSizePixel().Height() / GetEntryHeight(); // Wieviele Kinder sollen angezeigt werden ? - ULONG nChildCount = GetVisibleChildCount( pParent ); + sal_uLong nChildCount = GetVisibleChildCount( pParent ); // Passen alle Kinder und der parent gleichzeitig in die View ? if ( nChildCount+1 > nEntries ) { // Wenn nicht, wenigstens parent ganz nach oben schieben - MakeVisible( pParent, TRUE ); + MakeVisible( pParent, sal_True ); } else { // An welcher relativen ViewPosition steht der aufzuklappende parent SvLBoxEntry *pEntry = GetFirstEntryInView(); - ULONG nParentPos = 0; + sal_uLong nParentPos = 0; while ( pEntry && pEntry != pParent ) { ++nParentPos; @@ -939,7 +902,7 @@ BOOL SvxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent ) void SvxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) { SvxGroupInfo_Impl *pInfo = (SvxGroupInfo_Impl*) pEntry->GetUserData(); - pInfo->bWasOpened = TRUE; + pInfo->bWasOpened = sal_True; switch ( pInfo->nKind ) { case SVX_CFGGROUP_SCRIPTCONTAINER: @@ -966,7 +929,7 @@ void SvxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry ) */ SvxScriptSelectorDialog::SvxScriptSelectorDialog( - Window* pParent, BOOL bShowSlots, const Reference< frame::XFrame >& xFrame ) + Window* pParent, sal_Bool bShowSlots, const Reference< frame::XFrame >& xFrame ) : ModelessDialog( pParent, CUI_RES( RID_DLG_SCRIPTSELECTOR ) ), aDialogDescription( this, CUI_RES( TXT_SELECTOR_DIALOG_DESCRIPTION ) ), @@ -1022,7 +985,7 @@ void SvxScriptSelectorDialog::ResizeControls() Size s, news; long gap; - USHORT style = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | + sal_uInt16 style = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT | TEXT_DRAW_WORDBREAK; // get dimensions of dialog instructions control @@ -1115,12 +1078,12 @@ SvxScriptSelectorDialog::UpdateUI() aCommands.GetHelpText( aCommands.FirstSelected() ); aDescriptionText.SetText( rMessage ); - aOKButton.Enable( TRUE ); + aOKButton.Enable( sal_True ); } else { aDescriptionText.SetText( String() ); - aOKButton.Enable( FALSE ); + aOKButton.Enable( sal_False ); } } @@ -1130,7 +1093,7 @@ IMPL_LINK( SvxScriptSelectorDialog, ClickHdl, Button *, pButton ) { // If we are displaying Slot API commands then the dialog is being // run from Tools/Configure and we should not close it, just hide it - if ( m_bShowSlots == FALSE ) + if ( m_bShowSlots == sal_False ) { EndDialog( RET_CANCEL ); } @@ -1145,7 +1108,7 @@ IMPL_LINK( SvxScriptSelectorDialog, ClickHdl, Button *, pButton ) // If we are displaying Slot API commands then this the dialog is being // run from Tools/Configure and we should not close it - if ( m_bShowSlots == FALSE ) + if ( m_bShowSlots == sal_False ) { EndDialog( RET_OK ); } @@ -1177,12 +1140,6 @@ SvxScriptSelectorDialog::SetDialogDescription( const String& rDescription ) aDialogDescription.SetText( rDescription ); } -USHORT -SvxScriptSelectorDialog::GetSelectedId() -{ - return aCommands.GetId( aCommands.GetLastSelectedEntry() ); -} - String SvxScriptSelectorDialog::GetScriptURL() const { |