[ooo-build-commit] .: basctl/source
Noel Power
noelp at kemper.freedesktop.org
Wed Sep 29 06:33:40 PDT 2010
basctl/source/basicide/baside2.cxx | 23 +++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)
New commits:
commit c43ac455fe23c130a394c3a561e09697e08752e1
Author: Noel Power <noel.power at novell.com>
Date: Wed Sep 29 14:32:58 2010 +0100
fix for bugs.freedesktop.org/show_bug.cgi?id=30452
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 93625b0..84a8781 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -348,8 +348,8 @@ BOOL ModulWindow::BasicExecute()
AddStatus( BASWIN_RUNNINGBASIC );
USHORT nStart, nEnd, nCurMethodStart = 0;
TextSelection aSel = GetEditView()->GetSelection();
- if ( aDocument.isInVBAMode() )
- nCurMethodStart = ( aSel.GetStart().GetPara() + 1 );
+ // Init cursor to top
+ nCurMethodStart = ( aSel.GetStart().GetPara() + 1 );
SbMethod* pMethod = 0;
// erstes Macro, sonst blind "Main" (ExtSearch?)
for ( USHORT nMacro = 0; nMacro < xModule->GetMethods()->Count(); nMacro++ )
@@ -357,26 +357,17 @@ BOOL ModulWindow::BasicExecute()
SbMethod* pM = (SbMethod*)xModule->GetMethods()->Get( nMacro );
DBG_ASSERT( pM, "Method?" );
pM->GetLineRange( nStart, nEnd );
- if ( aDocument.isInVBAMode() )
- {
- if ( nCurMethodStart >= nStart && nCurMethodStart <= nEnd )
- {
- pMethod = pM;
- break;
- }
- }
- else if ( !pMethod || ( nStart < nCurMethodStart && !pM->IsHidden() ) )
+ if ( nCurMethodStart >= nStart && nCurMethodStart <= nEnd )
{
+ // matched a method to the cursor position
pMethod = pM;
- nCurMethodStart = nStart;
+ break;
}
}
if ( !pMethod )
{
- if ( aDocument.isInVBAMode() )
- 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 not in a method then prompt the user
+ return ( BasicIDE::ChooseMacro( uno::Reference< frame::XModel >(), FALSE, rtl::OUString() ).getLength() > 0 ) ? TRUE : FALSE;
}
if ( pMethod )
{
More information about the ooo-build-commit
mailing list