diff options
author | Joseph Powers <jpowers27@cox.net> | 2010-12-10 20:42:06 -0800 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2010-12-10 20:42:06 -0800 |
commit | 9df180a0fcf085686c16c4720fe4e983208d5658 (patch) | |
tree | cd9602a4cbe683ef323c593b1ba5a1a7c233003d /basctl | |
parent | 2b70fbec45f7a058710310d88c747e0fb828c6c9 (diff) |
Remove DECLARE_LIST( MacroList, SbMethod* ) & Cleanup previous patch
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/macrodlg.cxx | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index e3f21bba669a..155079ed30f0 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -56,12 +56,12 @@ #include <com/sun/star/script/XLibraryContainer2.hpp> #include <com/sun/star/document/MacroExecMode.hpp> +#include <list> +using ::std::list; + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; - -DECLARE_LIST( MacroList, SbMethod* ) - MacroChooser::MacroChooser( Window* pParnt, BOOL bCreateEntries ) : SfxModalDialog( pParnt, IDEResId( RID_MACROCHOOSER ) ), aMacroNameTxt( this, IDEResId( RID_TXT_MACRONAME ) ), @@ -552,39 +552,36 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox ) // Die Macros sollen in der Reihenfolge angezeigt werden, // wie sie im Modul stehen. - MacroList aMacros; - USHORT nMacroCount = pModule->GetMethods()->Count(); - USHORT nRealMacroCount = 0; - USHORT iMeth; - for ( iMeth = 0; iMeth < nMacroCount; iMeth++ ) + + list< SbMethod* > aMacros; + size_t nMacroCount = pModule->GetMethods()->Count(); + for ( size_t iMeth = 0; iMeth < nMacroCount; iMeth++ ) { SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( iMeth ); if( pMethod->IsHidden() ) continue; - ++nRealMacroCount; DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); - ULONG nPos = LIST_APPEND; // Eventuell weiter vorne ? USHORT nStart, nEnd; pMethod->GetLineRange( nStart, nEnd ); - for ( ULONG n = 0; n < aMacros.Count(); n++ ) + list< SbMethod* >::iterator itr; + for ( itr = aMacros.begin(); itr != aMacros.end(); ++itr ) { USHORT nS, nE; - SbMethod* pM = aMacros.GetObject( n ); + SbMethod* pM = *itr; DBG_ASSERT( pM, "Macro nicht in Liste ?!" ); pM->GetLineRange( nS, nE ); - if ( nS > nStart ) - { - nPos = n; + if ( nS > nStart ) { break; } } - aMacros.Insert( pMethod, nPos ); + if ( itr != aMacros.end() ) ++itr; + aMacros.insert( itr, pMethod ); } aMacroBox.SetUpdateMode( FALSE ); - for ( iMeth = 0; iMeth < nRealMacroCount; iMeth++ ) - aMacroBox.InsertEntry( aMacros.GetObject( iMeth )->GetName() ); + for ( list< SbMethod* >::iterator itr = aMacros.begin(); itr != aMacros.end(); ++itr ) + aMacroBox.InsertEntry( (*itr)->GetName() ); aMacroBox.SetUpdateMode( TRUE ); if ( aMacroBox.GetEntryCount() ) |