diff options
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/codecompletecache.cxx | 2 | ||||
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 29 |
2 files changed, 20 insertions, 11 deletions
diff --git a/basic/source/classes/codecompletecache.cxx b/basic/source/classes/codecompletecache.cxx index 952e4ee7538a..51eee1c84c0a 100644 --- a/basic/source/classes/codecompletecache.cxx +++ b/basic/source/classes/codecompletecache.cxx @@ -28,7 +28,7 @@ namespace CodeCompleteOptions::CodeCompleteOptions() : bIsCodeCompleteOn( false ), -bIsProcedureAutoCompleteOn( false ) +bIsProcedureAutoCompleteOn( true ) { } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 694fbf338fe0..fa04809b7c54 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -894,6 +894,10 @@ void SbModule::SetSource32( const OUString& r ) StartDefinitions(); SbiTokenizer aTok( r ); aTok.SetCompatible( IsVBACompat() ); + if( CodeCompleteOptions::IsProcedureAutoCompleteOn() ) + { + aIncompleteProcs.clear(); + } while( !aTok.IsEof() ) { SbiToken eEndTok = NIL; @@ -976,24 +980,29 @@ void SbModule::SetSource32( const OUString& r ) if( aTok.IsEof() ) { pMeth->nLine2 = aTok.GetLine(); - std::cerr << "EOF reached, no end for "<< sMethName <<", line " << aTok.GetLine() << std::endl; - //std::cerr << "write end to: " << aOUSource.getLength() / pMeth->nLine2 << std::endl; - sal_Int32 nPos=0; - sal_Int32 nCounter = 0; - std::cerr << "source length: " << aOUSource.getLength() << std::endl; - for(sal_uInt32 i=0; i < aOUSource.getLength() ; ++i) + if( CodeCompleteOptions::IsProcedureAutoCompleteOn() ) { - nPos++; - if( aOUSource[i] == '\n' && nCounter != aTok.GetLine() ) - nCounter++; + IncompleteProcData aProcData; + aProcData.sProcName = sMethName; + aProcData.nLine = pMeth->nLine2; + + if( eEndTok == ENDSUB ) + aProcData.aType = ACSUB; + if( eEndTok == ENDFUNC ) + aProcData.aType = ACFUNC; + aIncompleteProcs.push_back(aProcData); } - std::cerr << "newline index: " << nPos << std::endl; } } } EndDefinitions( sal_True ); } +IncompleteProcedures SbModule::GetIncompleteProcedures() const +{ + return aIncompleteProcs; +} + // Broadcast of a hint to all Basics static void _SendHint( SbxObject* pObj, sal_uIntPtr nId, SbMethod* p ) |