summaryrefslogtreecommitdiff
path: root/basic/source/comp/dim.cxx
diff options
context:
space:
mode:
authorGergo Mocsi <gmocsi91@gmail.com>2013-07-23 12:42:37 +0200
committerGergo Mocsi <gmocsi91@gmail.com>2013-09-02 18:16:47 +0200
commit61ee2598b18890eb5798a3943fbedd22a24e7aea (patch)
tree81ba813855079ba888902514511e94ccf0b036c0 /basic/source/comp/dim.cxx
parentb0b511e9b5b18069b6f4dc9565e2a485d05e1cdd (diff)
GSOC work, code complete option, menu entry fixes
Menu entry is added under View->Enable Code Completition when in Experimental mode. Fixed the call of funtion SbModule::GetCodeCompleteDataFromParse() to be called only when code completition is enabled. Replaced the occurences of SvtMiscOptions to CodeCompleteOptions. Change-Id: If0520123ab5f612d7d24fb98f8e9bf6881af76cb
Diffstat (limited to 'basic/source/comp/dim.cxx')
-rw-r--r--basic/source/comp/dim.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index 8da4d1e13c3c..9a030ccff85a 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -28,6 +28,7 @@
#include "com/sun/star/reflection/XInterfaceMemberTypeDescription.hpp"
#include "com/sun/star/reflection/XIdlMethod.hpp"
#include "com/sun/star/uno/Exception.hpp"
+#include <basic/codecompletecache.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -207,7 +208,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
bool bSwitchPool = false;
bool bPersistantGlobal = false;
SbiToken eFirstTok = eCurTok;
- SvtMiscOptions aMiscOptions;
+
if( pProc && ( eCurTok == GLOBAL || eCurTok == PUBLIC || eCurTok == PRIVATE ) )
Error( SbERR_NOT_IN_SUBR, eCurTok );
if( eCurTok == PUBLIC || eCurTok == GLOBAL )
@@ -404,9 +405,18 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
if( !bCompatible && !pDef->IsNew() )
{
OUString aTypeName( aGblStrings.Find( pDef->GetTypeId() ) );
- if( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) == NULL && (aMiscOptions.IsExperimentalMode() && !IsUnoInterface(aTypeName)))
+ /*std::cerr <<"CodeCompleteOptions::IsExtendedTypeDeclaration():" << CodeCompleteOptions::IsExtendedTypeDeclaration() << std::endl;
+ std::cerr << "IsUnoInterface("<<aTypeName<<"):"<< IsUnoInterface(aTypeName) << std::endl;
+ std::cerr << "finally: " << (CodeCompleteOptions::IsExtendedTypeDeclaration() && !IsUnoInterface(aTypeName)) << std::endl;*/
+ if( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) == NULL )
{
- Error( SbERR_UNDEF_TYPE, aTypeName );
+ if(!CodeCompleteOptions::IsExtendedTypeDeclaration())
+ Error( SbERR_UNDEF_TYPE, aTypeName );
+ else
+ {
+ if(!IsUnoInterface(aTypeName))
+ Error( SbERR_UNDEF_TYPE, aTypeName );
+ }
}
}