1 --- basctl/source/basicide/baside2.cxx.old 2009-04-02 10:56:36.000000000 +0000
2 +++ basctl/source/basicide/baside2.cxx 2009-04-06 16:41:44.000000000 +0000
3 @@ -331,6 +331,8 @@ BOOL ModulWindow::BasicExecute()
4 DBG_ASSERT( xModule.Is(), "Kein Modul!" );
5 AddStatus( BASWIN_RUNNINGBASIC );
6 USHORT nStart, nEnd, nCurMethodStart = 0;
7 + TextSelection aSel = GetEditView()->GetSelection();
8 + nCurMethodStart = ( aSel.GetStart().GetPara() + 1 );
10 // erstes Macro, sonst blind "Main" (ExtSearch?)
11 for ( USHORT nMacro = 0; nMacro < xModule->GetMethods()->Count(); nMacro++ )
12 @@ -338,16 +340,16 @@ BOOL ModulWindow::BasicExecute()
13 SbMethod* pM = (SbMethod*)xModule->GetMethods()->Get( nMacro );
14 DBG_ASSERT( pM, "Method?" );
15 pM->GetLineRange( nStart, nEnd );
16 - if ( !pMethod || ( nStart < nCurMethodStart ) )
17 + if ( nCurMethodStart >= nStart && nCurMethodStart <= nEnd )
20 - nCurMethodStart = nStart;
25 - pMethod = (SbMethod*)xModule->Find( String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ), SbxCLASS_METHOD );
26 + return ( BasicIDE::ChooseMacro( uno::Reference< frame::XModel >(), FALSE, rtl::OUString() ).getLength() > 0 ) ? TRUE : FALSE;
31 pMethod->SetDebugFlags( aStatus.nBasicFlags );
32 BasicDLL::SetDebugMode( TRUE );