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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 6 11:49:45 UTC 2019


 oovbaapi/ooo/vba/word/XWordBasic.idl |    5 +++
 sw/source/ui/vba/vbaapplication.cxx  |   55 +++++++++++++++++++++++++++++++----
 2 files changed, 55 insertions(+), 5 deletions(-)

New commits:
commit ef16a585dd4429b25ca7ba1cccb898342cdbc6b4
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Feb 6 12:32:35 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Feb 6 13:48:34 2019 +0200

    Ignore RuntimeException in Application.WindowState setter
    
    Probably helps VB6 clients.
    
    Change-Id: I3a1072e6ededbd0322c4b0dcd0ef4b16ace215d1

diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index 7f66e47ae1e1..add0d31ca6eb 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -291,12 +291,18 @@ sal_Int32 SAL_CALL SwVbaApplication::getWindowState()
 
 void SAL_CALL SwVbaApplication::setWindowState( sal_Int32 _windowstate )
 {
-    auto xWindow = getActiveWindow();
-    if (xWindow.is())
+    try
+    {
+        auto xWindow = getActiveWindow();
+        if (xWindow.is())
+        {
+            uno::Any aState;
+            aState <<= _windowstate;
+            xWindow->setWindowState( aState );
+        }
+    }
+    catch (const uno::RuntimeException&)
     {
-        uno::Any aState;
-        aState <<= _windowstate;
-        xWindow->setWindowState( aState );
     }
 }
 
commit ca7bffb060ae50331700b79aad8885b66b9f35f2
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Feb 6 12:22:39 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Feb 6 13:48:34 2019 +0200

    Add a dummy implementation of WordBasic.AppCount()
    
    Change-Id: Ia9e78c331d2cb711653ee3e64597ebf2824e0eeb

diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl b/oovbaapi/ooo/vba/word/XWordBasic.idl
index 4a91a7f7af11..d9e2a239668e 100644
--- a/oovbaapi/ooo/vba/word/XWordBasic.idl
+++ b/oovbaapi/ooo/vba/word/XWordBasic.idl
@@ -42,6 +42,7 @@ interface XWordBasic
     long AppMaximize( [in] string WindowName, [in] any State );
     long DocMaximize( [in] any State );
     void AppShow( [in] string WindowName );
+    long AppCount();
 };
 
 }; }; };
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index f6382ad19c41..7f66e47ae1e1 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -112,6 +112,7 @@ public:
     virtual sal_Int32 SAL_CALL AppMaximize( const OUString& WindowName, const css::uno::Any& State ) override;
     virtual sal_Int32 SAL_CALL DocMaximize( const css::uno::Any& State ) override;
     virtual void SAL_CALL AppShow(  const OUString& WindowName ) override;
+    virtual sal_Int32 SAL_CALL AppCount() override;
 };
 
 SwVbaApplication::SwVbaApplication( uno::Reference<uno::XComponentContext >& xContext ):
@@ -667,4 +668,13 @@ SwWordBasic::AppShow( const OUString& WindowName )
     // FIXME: Implement if necessary
 }
 
+sal_Int32 SAL_CALL
+SwWordBasic::AppCount()
+{
+    SAL_INFO("sw.vba", "WordBasic.AppCount()");
+
+    // FIXME: Implement if necessary. Return a random number for now.
+    return 2;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit f58e3f17c9efd70aab8dbcd50eb938a998edacd1
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Feb 6 12:20:45 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Feb 6 13:48:34 2019 +0200

    Add a dummy implementation of WordBasic.AppShow()
    
    Change-Id: I14379c5732c1921b8f52293045d01acf99e0b840

diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl b/oovbaapi/ooo/vba/word/XWordBasic.idl
index bbebd72ebd89..4a91a7f7af11 100644
--- a/oovbaapi/ooo/vba/word/XWordBasic.idl
+++ b/oovbaapi/ooo/vba/word/XWordBasic.idl
@@ -41,6 +41,7 @@ interface XWordBasic
 
     long AppMaximize( [in] string WindowName, [in] any State );
     long DocMaximize( [in] any State );
+    void AppShow( [in] string WindowName );
 };
 
 }; }; };
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index c29f9f562f51..f6382ad19c41 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -111,6 +111,7 @@ public:
                                                   const css::uno::Any& OpenExclusive, const css::uno::Any& SubType) override;
     virtual sal_Int32 SAL_CALL AppMaximize( const OUString& WindowName, const css::uno::Any& State ) override;
     virtual sal_Int32 SAL_CALL DocMaximize( const css::uno::Any& State ) override;
+    virtual void SAL_CALL AppShow(  const OUString& WindowName ) override;
 };
 
 SwVbaApplication::SwVbaApplication( uno::Reference<uno::XComponentContext >& xContext ):
@@ -658,4 +659,12 @@ SwWordBasic::DocMaximize( const css::uno::Any& State )
     return 0;
 }
 
+void SAL_CALL
+SwWordBasic::AppShow( const OUString& WindowName )
+{
+    SAL_INFO("sw.vba", "WordBasic.AppShow(WindowName:=" << WindowName << ")");
+
+    // FIXME: Implement if necessary
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit fffe41c1247eea37150f43f3b856d1ee45e6e31c
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Feb 6 12:08:59 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Feb 6 13:48:34 2019 +0200

    Add a dummy implementation of WordBasic.DocMaximize()
    
    Change-Id: I972f9446560cc8ac51031dbc36fc05d438d150e7

diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl b/oovbaapi/ooo/vba/word/XWordBasic.idl
index 3b3fbe79f4cc..bbebd72ebd89 100644
--- a/oovbaapi/ooo/vba/word/XWordBasic.idl
+++ b/oovbaapi/ooo/vba/word/XWordBasic.idl
@@ -40,6 +40,7 @@ interface XWordBasic
                                   [in] any SubType );
 
     long AppMaximize( [in] string WindowName, [in] any State );
+    long DocMaximize( [in] any State );
 };
 
 }; }; };
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index 26c407f8f9bb..c29f9f562f51 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -110,6 +110,7 @@ public:
                                                   const css::uno::Any& SQLStatement, const css::uno::Any& SQLStatement1,
                                                   const css::uno::Any& OpenExclusive, const css::uno::Any& SubType) override;
     virtual sal_Int32 SAL_CALL AppMaximize( const OUString& WindowName, const css::uno::Any& State ) override;
+    virtual sal_Int32 SAL_CALL DocMaximize( const css::uno::Any& State ) override;
 };
 
 SwVbaApplication::SwVbaApplication( uno::Reference<uno::XComponentContext >& xContext ):
@@ -648,4 +649,13 @@ SwWordBasic::AppMaximize( const OUString& WindowName, const css::uno::Any& State
     return 0;
 }
 
+sal_Int32 SAL_CALL
+SwWordBasic::DocMaximize( const css::uno::Any& State )
+{
+    SAL_INFO("sw.vba", "WordBasic.DocMaximize(State:=" << State << ")");
+
+    // FIXME: Implement if necessary
+    return 0;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 02035ea7939894c03c57b88b2db50796e7dbb7bd
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Feb 6 11:58:56 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Feb 6 13:48:33 2019 +0200

    Add a dummy implementation of WordBasic.AppMaximize()
    
    Change-Id: I4606e5a3717c3717d105dd2e63c9fd7d2e1abf83

diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl b/oovbaapi/ooo/vba/word/XWordBasic.idl
index 5150a431401b..3b3fbe79f4cc 100644
--- a/oovbaapi/ooo/vba/word/XWordBasic.idl
+++ b/oovbaapi/ooo/vba/word/XWordBasic.idl
@@ -38,6 +38,8 @@ interface XWordBasic
                                   [in] any SQLStatement1,
                                   [in] any OpenExclusive,
                                   [in] any SubType );
+
+    long AppMaximize( [in] string WindowName, [in] any State );
 };
 
 }; }; };
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index d9e33430c9d1..26c407f8f9bb 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -109,6 +109,7 @@ public:
                                                   const css::uno::Any& WritePasswordTemplate, const css::uno::Any& Connection,
                                                   const css::uno::Any& SQLStatement, const css::uno::Any& SQLStatement1,
                                                   const css::uno::Any& OpenExclusive, const css::uno::Any& SubType) override;
+    virtual sal_Int32 SAL_CALL AppMaximize( const OUString& WindowName, const css::uno::Any& State ) override;
 };
 
 SwVbaApplication::SwVbaApplication( uno::Reference<uno::XComponentContext >& xContext ):
@@ -638,4 +639,13 @@ SwWordBasic::MailMergeOpenDataSource( const OUString& Name, const css::uno::Any&
                                                                 OpenExclusive, SubType );
 }
 
+sal_Int32 SAL_CALL
+SwWordBasic::AppMaximize( const OUString& WindowName, const css::uno::Any& State )
+{
+    SAL_INFO("sw.vba", "WordBasic.AppMaximize( WindowName:=" << WindowName << ", State:=" << State);
+
+    // FIXME: Implement if necessary
+    return 0;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list