Kaydet (Commit) b4cfc712 authored tarafından npower Developer's avatar npower Developer

npower13_objectmodule: tweak IDE to only run macros from cursor in VBA mode

üst 07716c77
...@@ -336,7 +336,8 @@ BOOL ModulWindow::BasicExecute() ...@@ -336,7 +336,8 @@ BOOL ModulWindow::BasicExecute()
AddStatus( BASWIN_RUNNINGBASIC ); AddStatus( BASWIN_RUNNINGBASIC );
USHORT nStart, nEnd, nCurMethodStart = 0; USHORT nStart, nEnd, nCurMethodStart = 0;
TextSelection aSel = GetEditView()->GetSelection(); TextSelection aSel = GetEditView()->GetSelection();
nCurMethodStart = ( aSel.GetStart().GetPara() + 1 ); if ( aDocument.isInVBAMode() )
nCurMethodStart = ( aSel.GetStart().GetPara() + 1 );
SbMethod* pMethod = 0; SbMethod* pMethod = 0;
// erstes Macro, sonst blind "Main" (ExtSearch?) // erstes Macro, sonst blind "Main" (ExtSearch?)
for ( USHORT nMacro = 0; nMacro < xModule->GetMethods()->Count(); nMacro++ ) for ( USHORT nMacro = 0; nMacro < xModule->GetMethods()->Count(); nMacro++ )
...@@ -344,16 +345,20 @@ BOOL ModulWindow::BasicExecute() ...@@ -344,16 +345,20 @@ BOOL ModulWindow::BasicExecute()
SbMethod* pM = (SbMethod*)xModule->GetMethods()->Get( nMacro ); SbMethod* pM = (SbMethod*)xModule->GetMethods()->Get( nMacro );
DBG_ASSERT( pM, "Method?" ); DBG_ASSERT( pM, "Method?" );
pM->GetLineRange( nStart, nEnd ); pM->GetLineRange( nStart, nEnd );
if ( nCurMethodStart >= nStart && nCurMethodStart <= nEnd ) if ( ( aDocument.isInVBAMode() && ( nCurMethodStart >= nStart && nCurMethodStart <= nEnd ) ) || ( !aDocument.isInVBAMode() && !pMethod ) )
{ {
pMethod = pM; pMethod = pM;
break; break;
} }
} }
if ( !pMethod ) if ( !pMethod )
return ( BasicIDE::ChooseMacro( uno::Reference< frame::XModel >(), FALSE, rtl::OUString() ).getLength() > 0 ) ? TRUE : FALSE; {
if ( aDocument.isInVBAMode() )
else return ( BasicIDE::ChooseMacro( uno::Reference< frame::XModel >(), FALSE, rtl::OUString() ).getLength() > 0 ) ? TRUE : FALSE;
else
pMethod = (SbMethod*)xModule->Find( String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ), SbxCLASS_METHOD );
}
if ( pMethod )
{ {
pMethod->SetDebugFlags( aStatus.nBasicFlags ); pMethod->SetDebugFlags( aStatus.nBasicFlags );
BasicDLL::SetDebugMode( TRUE ); BasicDLL::SetDebugMode( TRUE );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment