diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-04-16 21:09:01 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-05-31 14:24:23 +0300 |
commit | 269c29131f5921ab92acf167ca24e8880cfa8bd4 (patch) | |
tree | ce5c4f1bfba6b74f8cf72b46518996ddc9a97406 /sw/source/ui | |
parent | a5a8346cca567b7657fd144c4f0ad7f2113c5dae (diff) |
Add a WindowState attribute to ooo.vba.word.XApplication, too
It seems to be something 3rd-party VB6 clients expect to be able to
get and put.
Change-Id: If5079da8ba99fde74b12b9590737d575f6636210
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/vba/vbaapplication.cxx | 26 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaapplication.hxx | 2 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx index 45c53114e2cc..d9d245a12d49 100644 --- a/sw/source/ui/vba/vbaapplication.cxx +++ b/sw/source/ui/vba/vbaapplication.cxx @@ -29,6 +29,7 @@ #include "vbadialogs.hxx" #include <ooo/vba/XConnectionPoint.hpp> #include <ooo/vba/word/WdEnableCancelKey.hpp> +#include <ooo/vba/word/WdWindowState.hpp> #include <ooo/vba/word/XApplicationOutgoing.hpp> #include <basic/sbuno.hxx> #include <editeng/acorrcfg.hxx> @@ -189,6 +190,31 @@ void SAL_CALL SwVbaApplication::setEnableCancelKey( sal_Int32/* _enableCancelKey // seems not supported in Writer } +sal_Int32 SAL_CALL SwVbaApplication::getWindowState() +{ + auto xWindow = getActiveWindow(); + if (xWindow.is()) + { + uno::Any aState = xWindow->getWindowState(); + sal_Int32 nState; + if (aState >>= nState) + return nState; + } + + return word::WdWindowState::wdWindowStateNormal; // ? +} + +void SAL_CALL SwVbaApplication::setWindowState( sal_Int32 _windowstate ) +{ + auto xWindow = getActiveWindow(); + if (xWindow.is()) + { + uno::Any aState; + aState <<= _windowstate; + xWindow->setWindowState( aState ); + } +} + float SAL_CALL SwVbaApplication::CentimetersToPoints( float Centimeters ) { return VbaApplicationBase::CentimetersToPoints( Centimeters ); diff --git a/sw/source/ui/vba/vbaapplication.hxx b/sw/source/ui/vba/vbaapplication.hxx index a8763cc15d6e..808f7c1c10b8 100644 --- a/sw/source/ui/vba/vbaapplication.hxx +++ b/sw/source/ui/vba/vbaapplication.hxx @@ -71,6 +71,8 @@ public: virtual void SAL_CALL setDisplayAutoCompleteTips( sal_Bool _displayAutoCompleteTips ) override; virtual sal_Int32 SAL_CALL getEnableCancelKey() override; virtual void SAL_CALL setEnableCancelKey( sal_Int32 _enableCancelKey ) override; + virtual sal_Int32 SAL_CALL getWindowState() override; + virtual void SAL_CALL setWindowState( sal_Int32 _windowstate ) override; virtual float SAL_CALL CentimetersToPoints( float Centimeters ) override; virtual void SAL_CALL ShowMe() override; |