summaryrefslogtreecommitdiff
path: root/basic/source/classes/sbxmod.cxx
diff options
context:
space:
mode:
authorGergo Mocsi <gmocsi91@gmail.com>2013-07-29 22:27:41 +0200
committerGergo Mocsi <gmocsi91@gmail.com>2013-07-29 22:27:41 +0200
commit5b26a68284d6f3e79b1d63a2ebd5b60be6cdfa46 (patch)
tree206c991ef3c5a0cdcf5fb8870a6ec69b19ddb540 /basic/source/classes/sbxmod.cxx
parent27487350a0ac29f8b8997277d1e602d24e178ece (diff)
GSOC work, "autocomplete procedures" fix + new feature
Fixed the procedure autoclose function. Now, autoclose is based on the syntax higlighter: if finds an opening token, starts searching forward to a close token. If there is another sub/function keyword, or EOF is reached, the procedure is considered incomplete. If the end token is found, the procedure is considered to be closed. Added function autocorrect symbol spelling, wich corrects the ascii case of the keywords, and corrects the spelling of the extended types. Change-Id: Ibd17f319a6d6ff5c3f91f4adb7a10dc701f0468a
Diffstat (limited to 'basic/source/classes/sbxmod.cxx')
-rw-r--r--basic/source/classes/sbxmod.cxx26
1 files changed, 1 insertions, 25 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index fa04809b7c54..989f5f547dae 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -894,10 +894,7 @@ void SbModule::SetSource32( const OUString& r )
StartDefinitions();
SbiTokenizer aTok( r );
aTok.SetCompatible( IsVBACompat() );
- if( CodeCompleteOptions::IsProcedureAutoCompleteOn() )
- {
- aIncompleteProcs.clear();
- }
+
while( !aTok.IsEof() )
{
SbiToken eEndTok = NIL;
@@ -941,15 +938,12 @@ void SbModule::SetSource32( const OUString& r )
}
// Definition of the method
SbMethod* pMeth = NULL;
- OUString sMethName;
if( eEndTok != NIL )
{
sal_uInt16 nLine1 = aTok.GetLine();
if( aTok.Next() == SYMBOL )
{
OUString aName_( aTok.GetSym() );
- //std::cerr << "method name: " << aName_ << std::endl;
- sMethName = aName_;
SbxDataType t = aTok.GetType();
if( t == SbxVARIANT && eEndTok == ENDSUB )
{
@@ -973,36 +967,18 @@ void SbModule::SetSource32( const OUString& r )
if( aTok.Next() == eEndTok )
{
pMeth->nLine2 = aTok.GetLine();
- //std::cerr << "there is end for "<< sMethName << std::endl;
break;
}
}
if( aTok.IsEof() )
{
pMeth->nLine2 = aTok.GetLine();
- if( CodeCompleteOptions::IsProcedureAutoCompleteOn() )
- {
- 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);
- }
}
}
}
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 )