summaryrefslogtreecommitdiff
path: root/basic/source/classes/sbxmod.cxx
diff options
context:
space:
mode:
authorGergo Mocsi <gmocsi91@gmail.com>2013-07-20 13:03:42 +0200
committerGergo Mocsi <gmocsi91@gmail.com>2013-07-20 13:03:42 +0200
commit623f0ecd35f96f2d047ae2f0461967407bb56cea (patch)
tree4220c58feccfc49c25e26cd091bf8495c9ac2060 /basic/source/classes/sbxmod.cxx
parent1ca65c728b36daa93eba550d22bd2b6959d9d454 (diff)
GSOC work, some code fixes
Fixed the link error: declared CodeCompleteDataCache as BASIC_DLLPUBLIC and it worked fine. Fixed sergmentation fault error in CodeCompleteWindow. The new cache implementation is fully functional. CodeCompleteWindow is now being used as boost::scoped_ptr. Change-Id: I76a0fc7407d589e7f94280fc4d50cea51b9639db
Diffstat (limited to 'basic/source/classes/sbxmod.cxx')
-rw-r--r--basic/source/classes/sbxmod.cxx40
1 files changed, 11 insertions, 29 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 15774d811bde..8b679c3600fc 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1780,7 +1780,6 @@ IMPL_LINK( ErrorHdlResetter, BasicErrorHdl, StarBASIC *, /*pBasic*/)
return 0;
}
-//std::vector< CodeCompleteData > SbModule::GetCodeCompleteDataFromParse()
CodeCompleteDataCache SbModule::GetCodeCompleteDataFromParse()
{
CodeCompleteDataCache aCache;
@@ -1793,55 +1792,38 @@ CodeCompleteDataCache SbModule::GetCodeCompleteDataFromParse()
while( pParser->Parse() ) {}
SbiSymPool* pPool = pParser->pPool;
- //std::vector< CodeCompleteData > aRet;
+ CodeCompleteVarTypes aGlobVarTypes;
for( sal_uInt16 i = 0; i < pPool->GetSize(); ++i )
{
SbiSymDef* pSymDef = pPool->Get(i);
if( pSymDef->GetType() == SbxOBJECT )
{
- //CodeCompleteData aCodeCompleteData;
- CodeCompleteVarTypes aVarTypes;
- /*aCodeCompleteData.sVarName = pSymDef->GetName();
- aCodeCompleteData.sVarParent = OUString("");
- aCodeCompleteData.sVarType = pParser->aGblStrings.Find( pSymDef->GetTypeId() );
- if(!aCodeCompleteData.sVarType.isEmpty())
+ if( !pParser->aGblStrings.Find( pSymDef->GetTypeId() ).isEmpty() )
{
- aRet.push_back(aCodeCompleteData);
- aVarTypes.insert(CodeCompleteVarTypes::value_type( pSymDef->GetName(), pParser->aGblStrings.Find( pSymDef->GetTypeId() ) ) );
- aCache.InsertProcedure( aCache.GLOB_KEY, aVarTypes );
- }*/
- if(pParser->aGblStrings.Find( pSymDef->GetTypeId() ).isEmpty() )
- {
- aVarTypes.insert(CodeCompleteVarTypes::value_type( pSymDef->GetName(), pParser->aGblStrings.Find( pSymDef->GetTypeId() ) ) );
- aCache.InsertProcedure( aCache.GLOB_KEY, aVarTypes );
+ //std::cerr << "global " << pSymDef->GetName() << std::endl;
+ aGlobVarTypes.insert( CodeCompleteVarTypes::value_type( pSymDef->GetName(), pParser->aGblStrings.Find( pSymDef->GetTypeId() ) ) );
}
}
SbiSymPool& pChildPool = pSymDef->GetPool();
+ CodeCompleteVarTypes aLocVarTypes;
for(sal_uInt16 j = 0; j < pChildPool.GetSize(); ++j )
{
- //CodeCompleteData aCodeCompleteData;
- CodeCompleteVarTypes aVarTypes;
-
SbiSymDef* pChildSymDef = pChildPool.Get(j);
if( pChildSymDef->GetType() == SbxOBJECT )
{
- /*aCodeCompleteData.sVarName = pChildSymDef->GetName();
- aCodeCompleteData.sVarParent = pSymDef->GetName();
- aCodeCompleteData.sVarType = pParser->aGblStrings.Find( pChildSymDef->GetTypeId() );
- if(!aCodeCompleteData.sVarType.isEmpty())*/
- if( pParser->aGblStrings.Find( pChildSymDef->GetTypeId() ).isEmpty() )
+ if( !pParser->aGblStrings.Find( pChildSymDef->GetTypeId() ).isEmpty() )
{
- //aRet.push_back(aCodeCompleteData);
- aVarTypes.insert(CodeCompleteVarTypes::value_type( pChildSymDef->GetName(), pParser->aGblStrings.Find( pChildSymDef->GetTypeId() ) ) );
- aCache.InsertProcedure( pSymDef->GetName(), aVarTypes );
+ //std::cerr << "local " << pChildSymDef->GetName() << std::endl;
+ aLocVarTypes.insert( CodeCompleteVarTypes::value_type( pChildSymDef->GetName(), pParser->aGblStrings.Find( pChildSymDef->GetTypeId() ) ) );
}
}
}
+ aCache.InsertProcedure( pSymDef->GetName(), aLocVarTypes );
}
- //std::cerr << aCache << std::endl;
+ aCache.InsertProcedure( aCache.GLOB_KEY, aGlobVarTypes );
+
delete pParser;
- //return aRet;
return aCache;
}