From c8852505f8bb9d94214250bf398c5c232dce8e43 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 6 Aug 2010 09:35:51 +0200 Subject: [PATCH] mib18: #163121# Declare Rework --- basctl/source/basicide/baside2.cxx | 2 +- basctl/source/basicide/basobj2.cxx | 18 ++++++++++++++---- basctl/source/basicide/macrodlg.cxx | 16 ++++++++++------ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 9f97e1766c3b..d0a8ca1a6ddb 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -365,7 +365,7 @@ BOOL ModulWindow::BasicExecute() break; } } - else if ( !pMethod || ( nStart < nCurMethodStart ) ) + else if ( !pMethod || ( nStart < nCurMethodStart && !pM->IsHidden() ) ) { pMethod = pM; nCurMethodStart = nStart; diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx index 3604866b4202..9604a8bd9933 100644 --- a/basctl/source/basicide/basobj2.cxx +++ b/basctl/source/basicide/basobj2.cxx @@ -364,13 +364,23 @@ Sequence< ::rtl::OUString > GetMethodNames( const ScriptDocument& rDocument, con SbModuleRef xModule = new SbModule( rModName ); xModule->SetSource32( aOUSource ); USHORT nCount = xModule->GetMethods()->Count(); - aSeqMethods.realloc( nCount ); - + USHORT nRealCount = nCount; for ( USHORT i = 0; i < nCount; i++ ) { SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i ); + if( pMethod->IsHidden() ) + --nRealCount; + } + aSeqMethods.realloc( nRealCount ); + + USHORT iTarget = 0; + for ( USHORT i = 0 ; i < nCount; ++i ) + { + SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i ); + if( pMethod->IsHidden() ) + continue; DBG_ASSERT( pMethod, "Method not found! (NULL)" ); - aSeqMethods.getArray()[ i ] = pMethod->GetName(); + aSeqMethods.getArray()[ iTarget++ ] = pMethod->GetName(); } } @@ -392,7 +402,7 @@ BOOL HasMethod( const ScriptDocument& rDocument, const String& rLibName, const S if ( pMethods ) { SbMethod* pMethod = (SbMethod*)pMethods->Find( rMethName, SbxCLASS_METHOD ); - if ( pMethod ) + if ( pMethod && !pMethod->IsHidden() ) bHasMethod = TRUE; } } diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 41a5fa488950..24bc5beacb30 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -554,11 +554,15 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox ) // Die Macros sollen in der Reihenfolge angezeigt werden, // wie sie im Modul stehen. MacroList aMacros; - USHORT nMacros = pModule->GetMethods()->Count(); - USHORT nMethod; - for ( nMethod = 0; nMethod < nMacros; nMethod++ ) + USHORT nMacroCount = pModule->GetMethods()->Count(); + USHORT nRealMacroCount = 0; + USHORT iMeth; + for ( iMeth = 0; iMeth < nMacroCount; iMeth++ ) { - SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); + 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 ? @@ -580,8 +584,8 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox ) } aMacroBox.SetUpdateMode( FALSE ); - for ( nMethod = 0; nMethod < nMacros; nMethod++ ) - aMacroBox.InsertEntry( aMacros.GetObject( nMethod )->GetName() ); + for ( iMeth = 0; iMeth < nRealMacroCount; iMeth++ ) + aMacroBox.InsertEntry( aMacros.GetObject( iMeth )->GetName() ); aMacroBox.SetUpdateMode( TRUE ); if ( aMacroBox.GetEntryCount() )