diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-02-25 09:59:31 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-02-25 16:37:17 +0000 |
commit | e88aa18972de17f5307356933e29d20026077042 (patch) | |
tree | ca399ba94fc6c8f05b848ed301351da9111d45ee | |
parent | 0f959ba9e8feef69ac0435795defd5f092147182 (diff) |
word vba: tie "Word" to VBAGlobals
This allows Word. to prefix global commands.
While this is superfluous to use this profix in a DOC/X,
the purpose is to allow the spreadsheet to call
Word.<whatever> macro calls that execute in a word processor.
At this point, it is simply added to SwVbaGlobals
to allow macro calls to run without raising an error.
make CppunitTest_sw_macros_test
Change-Id: Ibeda67d458d4757be809d8669a4e424c4e6c3458
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147682
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
-rw-r--r-- | oovbaapi/ooo/vba/word/XGlobals.idl | 1 | ||||
-rw-r--r-- | sw/qa/core/data/docm/testVBA.docm | bin | 34380 -> 32005 bytes | |||
-rw-r--r-- | sw/source/ui/vba/vbaglobals.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaglobals.hxx | 1 |
4 files changed, 7 insertions, 0 deletions
diff --git a/oovbaapi/ooo/vba/word/XGlobals.idl b/oovbaapi/ooo/vba/word/XGlobals.idl index 0e16bcb08d4e..dfbb47f2070b 100644 --- a/oovbaapi/ooo/vba/word/XGlobals.idl +++ b/oovbaapi/ooo/vba/word/XGlobals.idl @@ -31,6 +31,7 @@ interface XGlobals : com::sun::star::uno::XInterface [attribute, readonly] ooo::vba::word::XSystem System; [attribute, readonly] ooo::vba::word::XOptions Options; [attribute, readonly] ooo::vba::word::XSelection Selection; + [attribute, readonly] ooo::vba::word::XGlobals Word; [attribute, readonly] ooo::vba::word::XWordBasic WordBasic; any CommandBars( [in] any Index ); any Documents( [in] any Index ); diff --git a/sw/qa/core/data/docm/testVBA.docm b/sw/qa/core/data/docm/testVBA.docm Binary files differindex 9b97fbd9dccd..7b8495c0567d 100644 --- a/sw/qa/core/data/docm/testVBA.docm +++ b/sw/qa/core/data/docm/testVBA.docm diff --git a/sw/source/ui/vba/vbaglobals.cxx b/sw/source/ui/vba/vbaglobals.cxx index a319a4aea13d..3e9f7dbefef0 100644 --- a/sw/source/ui/vba/vbaglobals.cxx +++ b/sw/source/ui/vba/vbaglobals.cxx @@ -127,6 +127,11 @@ SwVbaGlobals::getSelection() return getApplication()->getSelection(); } +uno::Reference<word::XGlobals> SwVbaGlobals::getWord() +{ + return uno::Reference<word::XGlobals>(this); +} + uno::Reference<word::XWordBasic> SAL_CALL SwVbaGlobals::getWordBasic() { assert(dynamic_cast<SwVbaApplication*>(getApplication().get())); diff --git a/sw/source/ui/vba/vbaglobals.hxx b/sw/source/ui/vba/vbaglobals.hxx index 72f4ca07829c..c1713502dfa4 100644 --- a/sw/source/ui/vba/vbaglobals.hxx +++ b/sw/source/ui/vba/vbaglobals.hxx @@ -50,6 +50,7 @@ public: virtual css::uno::Reference<ov::word::XWindow> SAL_CALL getActiveWindow() override; virtual css::uno::Reference<ooo::vba::word::XOptions> SAL_CALL getOptions() override; virtual css::uno::Reference<ooo::vba::word::XSelection> SAL_CALL getSelection() override; + virtual css::uno::Reference<ooo::vba::word::XGlobals> SAL_CALL getWord() override; virtual css::uno::Reference<ooo::vba::word::XWordBasic> SAL_CALL getWordBasic() override; virtual css::uno::Any SAL_CALL CommandBars(const css::uno::Any& aIndex) override; virtual css::uno::Any SAL_CALL Documents(const css::uno::Any& aIndex) override; |