From 6165d0b4846590d1d85d559636dd6587ea0dadd8 Mon Sep 17 00:00:00 2001 From: Gergo Mocsi Date: Sat, 20 Jul 2013 13:03:42 +0200 Subject: 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 --- include/basic/codecompletecache.hxx | 10 ++++++---- include/basic/sbmod.hxx | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'include/basic') diff --git a/include/basic/codecompletecache.hxx b/include/basic/codecompletecache.hxx index f375f04d0484..bba25d9b0659 100644 --- a/include/basic/codecompletecache.hxx +++ b/include/basic/codecompletecache.hxx @@ -32,7 +32,7 @@ typedef boost::unordered_map< OUString, OUString, OUStringHash > CodeCompleteVar typedef boost::unordered_map< OUString, CodeCompleteVarTypes, OUStringHash > CodeCompleteVarScopes; /* procedure, CodeCompleteVarTypes */ -class CodeCompleteDataCache +class BASIC_DLLPUBLIC CodeCompleteDataCache { /* * cache to store data for @@ -44,16 +44,18 @@ private: public: const OUString GLOB_KEY = OUString("global key"); const OUString NOT_FOUND = OUString("not found"); - CodeCompleteDataCache(){} + CodeCompleteDataCache(){} virtual ~CodeCompleteDataCache(){} + friend std::ostream& operator<< (std::ostream& aStream, const CodeCompleteDataCache& aCache); + void SetVars( const CodeCompleteVarScopes& aScopes ); const CodeCompleteVarScopes& GetVars() const; void InsertProcedure( const OUString& sProcName, const CodeCompleteVarTypes& aVarTypes ); - const OUString& GetVariableType( const OUString& sVarName, const OUString& sProcName ) const; - + OUString GetVariableType( const OUString& sVarName, const OUString& sProcName ) const; + void print() const; // wrapper for operator<<, prints to std::cerr }; #endif // CODECOMPLETECACHE_H diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx index 763beefe3c5d..5a77cfb9dd2d 100644 --- a/include/basic/sbmod.hxx +++ b/include/basic/sbmod.hxx @@ -152,7 +152,6 @@ 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 ); - //std::vector< CodeCompleteData > GetCodeCompleteDataFromParse(); CodeCompleteDataCache GetCodeCompleteDataFromParse(); SbxArrayRef GetMethods(); }; -- cgit