diff options
author | Gergo Mocsi <gmocsi91@gmail.com> | 2013-07-29 22:27:41 +0200 |
---|---|---|
committer | Gergo Mocsi <gmocsi91@gmail.com> | 2013-09-02 18:16:52 +0200 |
commit | c149c96cf4c42820f15a0fea14cb7a4927ae4b1e (patch) | |
tree | 03e4e409130cf775a137545a300c1a64ad1f3b78 /include/basic | |
parent | 92374fb966d35a1f2584c1d4fc1459b350a70474 (diff) |
GSOC work, "autocomplete procedures" fix + new feature
Fixed the procedure autoclose function. Now, autoclose is based on the syntax higlighter: if finds an opening token, starts searching forward to a close token.
If there is another sub/function keyword, or EOF is reached, the procedure is considered incomplete.
If the end token is found, the procedure is considered to be closed.
Added function autocorrect symbol spelling, wich corrects the ascii case of the keywords, and corrects the spelling of the extended types.
Change-Id: Ibd17f319a6d6ff5c3f91f4adb7a10dc701f0468a
Diffstat (limited to 'include/basic')
-rw-r--r-- | include/basic/codecompletecache.hxx | 20 | ||||
-rw-r--r-- | include/basic/sbmod.hxx | 2 |
2 files changed, 6 insertions, 16 deletions
diff --git a/include/basic/codecompletecache.hxx b/include/basic/codecompletecache.hxx index c12139b71bbd..cb92a64320cf 100644 --- a/include/basic/codecompletecache.hxx +++ b/include/basic/codecompletecache.hxx @@ -29,24 +29,10 @@ #include <svtools/miscopt.hxx> #include <vector> -enum BASIC_DLLPUBLIC AutocompleteType -{ - ACSUB, - ACFUNC -}; - -struct IncompleteProcData -{ - OUString sProcName; - sal_uInt16 nLine; - AutocompleteType aType; -}; - typedef boost::unordered_map< OUString, OUString, OUStringHash > CodeCompleteVarTypes; /* variable name, type */ typedef boost::unordered_map< OUString, CodeCompleteVarTypes, OUStringHash > CodeCompleteVarScopes; /* procedure, CodeCompleteVarTypes */ -typedef std::vector< IncompleteProcData > IncompleteProcedures; class BASIC_DLLPUBLIC CodeCompleteOptions { @@ -59,6 +45,7 @@ private: bool bIsProcedureAutoCompleteOn; bool bIsAutoCloseQuotesOn; bool bIsAutoCloseParenthesisOn; + bool bIsAutoCorrectSpellingOn; SvtMiscOptions aMiscOptions; public: @@ -76,6 +63,10 @@ public: static bool IsAutoCloseParenthesisOn(); static void SetAutoCloseParenthesisOn( const bool& b ); + + static bool IsAutoCorrectSpellingOn(); + static void SetAutoCorrectSpellingOn( const bool& b ); + }; class BASIC_DLLPUBLIC CodeCompleteDataCache @@ -100,6 +91,7 @@ public: void InsertGlobalVar( const OUString& sVarName, const OUString& sVarType ); void InsertLocalVar( const OUString& sProcName, const OUString& sVarName, const OUString& sVarType ); OUString GetVarType( const OUString& sVarName ) const; + OUString GetCorrectCaseVarName( const OUString& sVarName ) const; void print() const; // wrapper for operator<<, prints to std::cerr void Clear(); }; diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx index 22b2bdb962ab..543a199b6c04 100644 --- a/include/basic/sbmod.hxx +++ b/include/basic/sbmod.hxx @@ -56,7 +56,6 @@ class BASIC_DLLPUBLIC SbModule : public SbxObject, private ::boost::noncopyable std::vector< OUString > mModuleVariableNames; BASIC_DLLPRIVATE void implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic ); - IncompleteProcedures aIncompleteProcs; protected: com::sun::star::uno::Reference< com::sun::star::script::XInvocation > mxWrapper; @@ -137,7 +136,6 @@ public: bool createCOMWrapperForIface( ::com::sun::star::uno::Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject ); void GetCodeCompleteDataFromParse(CodeCompleteDataCache& aCache); SbxArrayRef GetMethods(); - IncompleteProcedures GetIncompleteProcedures() const; }; SV_DECL_IMPL_REF(SbModule) |