oovbaapi/ooo/vba/word/XGlobals.idl | 1 + sw/qa/core/data/docm/testVBA.docm |binary sw/source/ui/vba/vbaglobals.cxx | 5 +++++ sw/source/ui/vba/vbaglobals.hxx | 1 + 4 files changed, 7 insertions(+)
New commits: commit e88aa18972de17f5307356933e29d20026077042 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Sat Feb 25 09:59:31 2023 -0500 Commit: Justin Luth <jl...@mail.com> CommitDate: Sat Feb 25 16:37:17 2023 +0000 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 <jl...@mail.com> 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 index 9b97fbd9dccd..7b8495c0567d 100644 Binary files a/sw/qa/core/data/docm/testVBA.docm and b/sw/qa/core/data/docm/testVBA.docm differ 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;