diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-02-24 12:45:35 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-02-24 21:55:40 +0000 |
commit | d6f3715190494b55e2ecc105cbd6e5ddeff47f0c (patch) | |
tree | c556055bbe33bb0fd6f126ca8681af88f7092c37 /sw/source/ui | |
parent | a39f5da6f621fc60df0dbdd6c5a08cae5a18763f (diff) |
word vba: Add activeWindow to XDocument
This allows ActiveDocument.ActiveWindow.*
It already works as a global, and as Aplication.ActiveWindow
Unit test will follow when some of the * items are added.
Change-Id: I7fb18df9f6259ec4b9d60516b2da704098831dfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147665
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/vba/vbadocument.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/vba/vbadocument.hxx | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx index 52907477dcff..caf520c3433a 100644 --- a/sw/source/ui/vba/vbadocument.cxx +++ b/sw/source/ui/vba/vbadocument.cxx @@ -30,6 +30,7 @@ #include "vbabookmarks.hxx" #include "vbamailmerge.hxx" #include "vbavariables.hxx" +#include "vbawindow.hxx" #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> #include <cppu/unotype.hxx> @@ -245,6 +246,13 @@ uno::Any SAL_CALL SwVbaDocument::SelectContentControlsByTitle(const uno::Any& in new SwVbaContentControls(this, mxContext, mxTextDocument, "", sTitle))); } +uno::Reference<word::XWindow> SwVbaDocument::getActiveWindow() +{ + // copied from vbaappliction which has a #FIXME so far can't determine Parent + return new SwVbaWindow(uno::Reference< XHelperInterface >(), mxContext, mxModel, + mxModel->getCurrentController()); +} + uno::Any SAL_CALL SwVbaDocument::Variables( const uno::Any& rIndex ) { diff --git a/sw/source/ui/vba/vbadocument.hxx b/sw/source/ui/vba/vbadocument.hxx index 31ca3751686a..069215513cc5 100644 --- a/sw/source/ui/vba/vbadocument.hxx +++ b/sw/source/ui/vba/vbadocument.hxx @@ -58,6 +58,7 @@ public: css::uno::Any SAL_CALL ContentControls(const css::uno::Any& index) override; css::uno::Any SAL_CALL SelectContentControlsByTag(const css::uno::Any& index) override; css::uno::Any SAL_CALL SelectContentControlsByTitle(const css::uno::Any& index) override; + css::uno::Reference<ov::word::XWindow> SAL_CALL getActiveWindow() override; virtual css::uno::Any SAL_CALL Variables( const css::uno::Any& rIndex ) override; virtual css::uno::Any SAL_CALL getAttachedTemplate() override; virtual void SAL_CALL setAttachedTemplate( const css::uno::Any& _attachedtemplate ) override; |