diff options
author | Noel Power <noel.power@novell.com> | 2010-10-06 10:16:27 +0100 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2010-10-06 10:16:27 +0100 |
commit | 0b21b8b146fc4b982c7c9bbb866b9ff18a29332a (patch) | |
tree | 9b36a1dee6f92703604bcc86564568eefe711c22 /basic/source/inc | |
parent | 8d4d17664c9c6207fa35458075559d1fbfbfa2a5 (diff) |
initial commit for vba blob ( not including container_control stuff )
Diffstat (limited to 'basic/source/inc')
-rw-r--r-- | basic/source/inc/dlgcont.hxx | 4 | ||||
-rw-r--r-- | basic/source/inc/namecont.hxx | 5 | ||||
-rw-r--r-- | basic/source/inc/parser.hxx | 1 | ||||
-rw-r--r-- | basic/source/inc/runtime.hxx | 4 | ||||
-rw-r--r-- | basic/source/inc/sbunoobj.hxx | 21 | ||||
-rw-r--r-- | basic/source/inc/scriptcont.hxx | 4 | ||||
-rw-r--r-- | basic/source/inc/token.hxx | 2 |
7 files changed, 36 insertions, 5 deletions
diff --git a/basic/source/inc/dlgcont.hxx b/basic/source/inc/dlgcont.hxx index 2c927a8286f4..3aef2c5b067c 100644 --- a/basic/source/inc/dlgcont.hxx +++ b/basic/source/inc/dlgcont.hxx @@ -96,7 +96,9 @@ public: throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); - + // XLibraryQueryExecutable + virtual sal_Bool SAL_CALL HasExecutableCode(const rtl::OUString&) + throw (::com::sun::star::uno::RuntimeException); // Service static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(); static ::rtl::OUString getImplementationName_static(); diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx index 7fd6eb06f607..a2903caf6536 100644 --- a/basic/source/inc/namecont.hxx +++ b/basic/source/inc/namecont.hxx @@ -35,6 +35,7 @@ #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp> #include <com/sun/star/script/XLibraryContainerPassword.hpp> #include <com/sun/star/script/XLibraryContainerExport.hpp> +#include <com/sun/star/script/XLibraryQueryExecutable.hpp> #include <com/sun/star/script/XLibraryContainer3.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/container/XContainer.hpp> @@ -59,6 +60,7 @@ #include <cppuhelper/implbase2.hxx> #include <cppuhelper/compbase8.hxx> +#include <cppuhelper/compbase9.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <com/sun/star/script/vba/XVBACompatibility.hpp> @@ -67,13 +69,14 @@ class BasicManager; namespace basic { -typedef ::cppu::WeakComponentImplHelper8< +typedef ::cppu::WeakComponentImplHelper9< ::com::sun::star::lang::XInitialization, ::com::sun::star::script::XStorageBasedLibraryContainer, ::com::sun::star::script::XLibraryContainerPassword, ::com::sun::star::script::XLibraryContainerExport, ::com::sun::star::script::XLibraryContainer3, ::com::sun::star::container::XContainer, + ::com::sun::star::script::XLibraryQueryExecutable, ::com::sun::star::script::vba::XVBACompatibility, ::com::sun::star::lang::XServiceInfo > LibraryContainerHelper; diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx index 733a65db7f61..1e99f9421b82 100644 --- a/basic/source/inc/parser.hxx +++ b/basic/source/inc/parser.hxx @@ -107,6 +107,7 @@ public: void BadSyntax(); // Falsches SbiToken void NoIf(); // ELSE/ELSE IF ohne IF void Assign(); // LET + void Attribute(); // Attribute void Call(); // CALL void Close(); // CLOSE void Declare(); // DECLARE diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index 6ca69209a752..fc2bc0b37053 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -203,7 +203,6 @@ class SbiInstance BOOL bCompatibility; // Flag: TRUE = VBA runtime compatibility mode ComponentVector_t ComponentVector; - public: SbiRuntime* pRun; // Call-Stack SbiInstance* pNext; // Instanzen-Chain @@ -292,7 +291,9 @@ class SbiRuntime SbxArrayRef refExprStk; // expression stack SbxArrayRef refCaseStk; // CASE expression stack SbxArrayRef refRedimpArray; // Array saved to use for REDIM PRESERVE + SbxVariableRef refRedim; // Array saved to use for REDIM SbxVariableRef xDummyVar; // Ersatz fuer nicht gefundene Variablen + SbxVariable* mpExtCaller; // Caller ( external - e.g. button name, shape, range object etc. - only in vba mode ) SbiArgvStack* pArgvStk; // ARGV-Stack SbiGosubStack* pGosubStk; // GOSUB stack SbiForStack* pForStk; // FOR/NEXT-Stack @@ -462,6 +463,7 @@ public: SbMethod* GetCaller(); SbxArray* GetLocals(); SbxArray* GetParams(); + SbxVariable* GetExternalCaller(){ return mpExtCaller; } SbxBase* FindElementExtern( const String& rName ); static bool isVBAEnabled(); diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx index 78afa9783ca8..fc61484d4dbe 100644 --- a/basic/source/inc/sbunoobj.hxx +++ b/basic/source/inc/sbunoobj.hxx @@ -43,6 +43,7 @@ #include <com/sun/star/reflection/XServiceTypeDescription2.hpp> #include <com/sun/star/reflection/XSingletonTypeDescription.hpp> #include <rtl/ustring.hxx> +#include <hash_map> class SbUnoObject: public SbxObject { @@ -321,6 +322,26 @@ public: virtual void Clear(); }; +typedef std::hash_map< ::rtl::OUString, ::com::sun::star::uno::Any, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > VBAConstantsHash; + +typedef std::vector< rtl::OUString > VBAConstantsVector; + +class VBAConstantHelper +{ +private: + + VBAConstantsVector aConstCache; + VBAConstantsHash aConstHash; + bool isInited; + VBAConstantHelper():isInited( false ) {} + VBAConstantHelper(const VBAConstantHelper&); + void init(); +public: + static VBAConstantHelper& instance(); + SbxVariable* getVBAConstant( const String& rName ); + bool isVBAConstantType( const String& rName ); +}; + #endif diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx index 091fbc24cdbe..2310a3d633ec 100644 --- a/basic/source/inc/scriptcont.hxx +++ b/basic/source/inc/scriptcont.hxx @@ -122,7 +122,9 @@ public: throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - + // XLibraryQueryExecutable + virtual sal_Bool SAL_CALL HasExecutableCode(const rtl::OUString&) + throw (::com::sun::star::uno::RuntimeException); // Methods XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); diff --git a/basic/source/inc/token.hxx b/basic/source/inc/token.hxx index 930f68910b78..294e0ff863c5 100644 --- a/basic/source/inc/token.hxx +++ b/basic/source/inc/token.hxx @@ -72,7 +72,7 @@ enum SbiToken { IF, _IN_, INPUT, LET, LINE, LINEINPUT, LOCAL, LOOP, LPRINT, LSET, NAME, NEW, NEXT, - ON, OPEN, OPTION, IMPLEMENTS, + ON, OPEN, OPTION, ATTRIBUTE, IMPLEMENTS, PRINT, PRIVATE, PROPERTY, PUBLIC, REDIM, REM, RESUME, RETURN, RSET, SELECT, SET, SHARED, STATIC, STEP, STOP, SUB, |