summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGergo Mocsi <gmocsi91@gmail.com>2013-08-20 13:29:18 +0200
committerGergo Mocsi <gmocsi91@gmail.com>2013-08-20 13:29:18 +0200
commit0c681742db11bc18e3d3a5284e4a56128b1f5531 (patch)
tree259a101b42156362f5bed86d9c5943ba728c06c3
parent54704aea436c6dc43a17c8aec5d102cc9652b220 (diff)
GSOC work, multiple fixes
Code completion: parser recognizes extended types ony when the checkbox is checked. Fixed a crash caused by a misspelled uno type. Fixed function CodeCompleteDataCache::Clear() to clear both internal variables. Change-Id: I82fdd2e1cf749237e2e2de4a9a2fc7d07fb7eb4a
-rw-r--r--basctl/source/basicide/baside2b.cxx4
-rw-r--r--basic/source/classes/codecompletecache.cxx1
-rw-r--r--basic/source/comp/dim.cxx6
3 files changed, 6 insertions, 5 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 7d67327b4d93..8c09adac1294 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -2899,7 +2899,7 @@ UnoTypeCodeCompletetor::UnoTypeCodeCompletetor( const std::vector< OUString >& a
std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassMethods() const
{
std::vector< OUString > aRetVect;
- if( bCanComplete )
+ if( bCanComplete && ( xClass != NULL ) )
{
Sequence< Reference< reflection::XIdlMethod > > aMethods = xClass->getMethods();
if( aMethods.getLength() != 0 )
@@ -2916,7 +2916,7 @@ std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassMethods() const
std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassFields() const
{
std::vector< OUString > aRetVect;
- if( bCanComplete )
+ if( bCanComplete && ( xClass != NULL ) )
{
Sequence< Reference< reflection::XIdlField > > aFields = xClass->getFields();
if( aFields.getLength() != 0 )
diff --git a/basic/source/classes/codecompletecache.cxx b/basic/source/classes/codecompletecache.cxx
index a5b9ce6a8601..aad0e4fcd622 100644
--- a/basic/source/classes/codecompletecache.cxx
+++ b/basic/source/classes/codecompletecache.cxx
@@ -136,6 +136,7 @@ void CodeCompleteDataCache::print() const
void CodeCompleteDataCache::Clear()
{
aVarScopes.clear();
+ aGlobalVars.clear();
}
void CodeCompleteDataCache::InsertGlobalVar( const OUString& sVarName, const OUString& sVarType )
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index 2b94c397ef52..64d056534c8f 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -407,13 +407,13 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
OUString aTypeName( aGblStrings.Find( pDef->GetTypeId() ) );
if( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) == NULL )
{
- if(!CodeCompleteOptions::IsCodeCompleteOn())
- Error( SbERR_UNDEF_TYPE, aTypeName );
- else
+ if( CodeCompleteOptions::IsExtendedTypeDeclaration() )
{
if(!IsUnoInterface(aTypeName))
Error( SbERR_UNDEF_TYPE, aTypeName );
}
+ else
+ Error( SbERR_UNDEF_TYPE, aTypeName );
}
}