update dev300-m57
[ooovba.git] / applied_patches / 0059-vba-ide-choose-macro-to-run.diff
blob6559585d3a8d10794489633d538eb038b6a8484c
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 );
9 SbMethod* pMethod = 0;
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 )
19 pMethod = pM;
20 - nCurMethodStart = nStart;
21 + break;
24 if ( !pMethod )
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;
28 - if ( pMethod )
29 + else
31 pMethod->SetDebugFlags( aStatus.nBasicFlags );
32 BasicDLL::SetDebugMode( TRUE );