[Libreoffice-commits] core.git: 2 commits - oovbaapi/ooo sw/source

Tor Lillqvist tml at collabora.com
Thu May 31 11:25:36 UTC 2018


 oovbaapi/ooo/vba/word/XApplication.idl |   12 ++++--------
 sw/source/ui/vba/vbaapplication.cxx    |   26 ++++++++++++++++++++++++++
 sw/source/ui/vba/vbaapplication.hxx    |    2 ++
 3 files changed, 32 insertions(+), 8 deletions(-)

New commits:
commit 269c29131f5921ab92acf167ca24e8880cfa8bd4
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 16 21:09:01 2018 +0300

    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

diff --git a/oovbaapi/ooo/vba/word/XApplication.idl b/oovbaapi/ooo/vba/word/XApplication.idl
index a0ad911370a9..ea709e7ec2b2 100644
--- a/oovbaapi/ooo/vba/word/XApplication.idl
+++ b/oovbaapi/ooo/vba/word/XApplication.idl
@@ -34,6 +34,7 @@ interface XApplication : XConnectable
     [attribute, readonly] XSelection Selection;
     [attribute] boolean DisplayAutoCompleteTips;
     [attribute] long EnableCancelKey;
+    [attribute] long WindowState;
 
     any CommandBars( [in] any Index );
     any Documents( [in] any Index );
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;
 
commit a5a8346cca567b7657fd144c4f0ad7f2113c5dae
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Apr 16 21:00:42 2018 +0300

    Can simplify, our IDL compiler is more clever nowadays
    
    Change-Id: I785c115ab7bcb7cfddc8e79bd5d31278f0c544dc

diff --git a/oovbaapi/ooo/vba/word/XApplication.idl b/oovbaapi/ooo/vba/word/XApplication.idl
index de6fafc085a7..a0ad911370a9 100644
--- a/oovbaapi/ooo/vba/word/XApplication.idl
+++ b/oovbaapi/ooo/vba/word/XApplication.idl
@@ -24,19 +24,14 @@
 
 module ooo {  module vba {  module word {
 
-interface XDocument;
-interface XWindow;
-interface XSystem;
-interface XOptions;
-interface XSelection;
 interface XApplication : XConnectable
 {
     [attribute, readonly] XDocument ActiveDocument;
     [attribute, readonly] XWindow ActiveWindow;
     [attribute, readonly] string Name;
-    [attribute, readonly] ooo::vba::word::XSystem System;
-    [attribute, readonly] ooo::vba::word::XOptions Options;
-    [attribute, readonly] ooo::vba::word::XSelection Selection;
+    [attribute, readonly] XSystem System;
+    [attribute, readonly] XOptions Options;
+    [attribute, readonly] XSelection Selection;
     [attribute] boolean DisplayAutoCompleteTips;
     [attribute] long EnableCancelKey;
 


More information about the Libreoffice-commits mailing list