diff options
author | Gergo Mocsi <gmocsi91@gmail.com> | 2013-07-25 19:12:37 +0200 |
---|---|---|
committer | Gergo Mocsi <gmocsi91@gmail.com> | 2013-09-02 18:16:49 +0200 |
commit | 9a7b942a0a3bb113cf356f2642766f7a9f909bd6 (patch) | |
tree | ddc5cfca7dbd2fedaa03d2bc620ba6e75aac9496 /include/basic/sbmod.hxx | |
parent | d5aa9c3b23f6c9b5ff0b6af11ff6d6827c5f24bd (diff) |
GSOC work, procedure autoclose implementation
Now, function procedure autoclose is working.
Created a struct named IncompleteProcData to store the line number, type and name of the inclomplete procedure. Procedures are store in a vector (IncompleteProcedures), and are as a member in SbModule.
I've created a function called SbModule::GetIncompleteProcedures() to extract the data. Data extraction uses SbModule::SetSource32, beacuse that one tokenizes sthe source file, and recognizes procedures.
Closing procedures is triggered ky pressing the Enter key when typing. It checks the actual sub, and if it's incomplete, adds the correct ending( End Sub/End Function).
There is only one problem: function SbModule::SetSource32 is not too often calle, maybe extraction should be done by a timer.
Change-Id: Id88daaef329e8b5c194b765c5261d356bfb3a0c9
Diffstat (limited to 'include/basic/sbmod.hxx')
-rw-r--r-- | include/basic/sbmod.hxx | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx index b3e694bf624c..dbf3e69fb115 100644 --- a/include/basic/sbmod.hxx +++ b/include/basic/sbmod.hxx @@ -45,24 +45,6 @@ class ModuleInitDependencyMap; struct ClassModuleRunInitItem; struct SbClassData; -/* -struct CodeCompleteData -{ - OUString sVarName; - OUString sVarParent; - OUString sVarType; - - inline bool operator==( const CodeCompleteData& aOther ) - { - return (sVarName == aOther.sVarName && sVarParent == aOther.sVarParent); - } - - inline bool IsGlobal() const - { - return ( sVarParent == OUString("") ); - } -};*/ - class BASIC_DLLPUBLIC SbModule : public SbxObject, private ::boost::noncopyable { friend class SbiCodeGen; @@ -74,6 +56,7 @@ 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; @@ -155,6 +138,7 @@ public: //CodeCompleteDataCache GetCodeCompleteDataFromParse(); void GetCodeCompleteDataFromParse(CodeCompleteDataCache& aCache); SbxArrayRef GetMethods(); + IncompleteProcedures GetIncompleteProcedures() const; }; SV_DECL_IMPL_REF(SbModule) |