From edcec5b1be9b224dbdfb4cd85c37148243f49389 Mon Sep 17 00:00:00 2001 From: Gergo Mocsi Date: Wed, 24 Jul 2013 17:27:02 +0200 Subject: GSOC work, cache implementation fix, code fixes The CodeCompleteDataCache got a new implementation: global variables are stored separately. The "static const" OUString-s were removed from the class. Data extraction is only done when pressing the dot key. Change-Id: I3ff94c0c6eabe328761336d4c74744eb7efc6056 --- include/basic/codecompletecache.hxx | 11 ++++++----- include/basic/sbmod.hxx | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'include/basic') diff --git a/include/basic/codecompletecache.hxx b/include/basic/codecompletecache.hxx index 57ed673c13fa..480c3c1dcf4c 100644 --- a/include/basic/codecompletecache.hxx +++ b/include/basic/codecompletecache.hxx @@ -33,6 +33,7 @@ typedef boost::unordered_map< OUString, OUString, OUStringHash > CodeCompleteVar typedef boost::unordered_map< OUString, CodeCompleteVarTypes, OUStringHash > CodeCompleteVarScopes; /* procedure, CodeCompleteVarTypes */ + class BASIC_DLLPUBLIC CodeCompleteOptions { /* @@ -63,11 +64,9 @@ class BASIC_DLLPUBLIC CodeCompleteDataCache * */ private: CodeCompleteVarScopes aVarScopes; + CodeCompleteVarTypes aGlobalVars; public: - static const OUString GLOB_KEY; - static const OUString NOT_FOUND; - CodeCompleteDataCache(){} virtual ~CodeCompleteDataCache(){} @@ -76,9 +75,11 @@ public: void SetVars( const CodeCompleteVarScopes& aScopes ); const CodeCompleteVarScopes& GetVars() const; - void InsertProcedure( const OUString& sProcName, const CodeCompleteVarTypes& aVarTypes ); - OUString GetVariableType( const OUString& sVarName, const OUString& sProcName ) const; + void InsertGlobalVar( const OUString& sVarName, const OUString& sVarType ); + void InsertLocalVar( const OUString& sProcName, const OUString& sVarName, const OUString& sVarType ); + OUString GetVarType( const OUString& sVarName ); void print() const; // wrapper for operator<<, prints to std::cerr + void Clear(); }; #endif // CODECOMPLETECACHE_H diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx index 5a77cfb9dd2d..b3e694bf624c 100644 --- a/include/basic/sbmod.hxx +++ b/include/basic/sbmod.hxx @@ -152,7 +152,8 @@ public: void RemoveVars(); ::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule(); bool createCOMWrapperForIface( ::com::sun::star::uno::Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject ); - CodeCompleteDataCache GetCodeCompleteDataFromParse(); + //CodeCompleteDataCache GetCodeCompleteDataFromParse(); + void GetCodeCompleteDataFromParse(CodeCompleteDataCache& aCache); SbxArrayRef GetMethods(); }; -- cgit