oovbaapi/ooo/vba/word/XWordBasic.idl | 5 +++ sw/source/ui/vba/vbaapplication.cxx | 57 +++++++++++++++++++++++++++++++---- 2 files changed, 56 insertions(+), 6 deletions(-)
New commits: commit e9f87f7b8e33352b66d52b37c459a52a6737eb80 Author: Tor Lillqvist <[email protected]> AuthorDate: Wed Feb 6 12:32:35 2019 +0200 Commit: Tor Lillqvist <[email protected]> CommitDate: Wed Feb 6 13:51:37 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 4b7b83bf3f62..222524f4207a 100644 --- a/sw/source/ui/vba/vbaapplication.cxx +++ b/sw/source/ui/vba/vbaapplication.cxx @@ -290,12 +290,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 c06a3f33d0de59f9cbfddef353f9018a6583df4a Author: Tor Lillqvist <[email protected]> AuthorDate: Wed Feb 6 12:22:39 2019 +0200 Commit: Tor Lillqvist <[email protected]> CommitDate: Wed Feb 6 13:51:26 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 12f81caee63a..4b7b83bf3f62 100644 --- a/sw/source/ui/vba/vbaapplication.cxx +++ b/sw/source/ui/vba/vbaapplication.cxx @@ -111,6 +111,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 ): @@ -669,4 +670,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 ad19df8696346e608b530a7e84b8da4fad6d8c80 Author: Tor Lillqvist <[email protected]> AuthorDate: Wed Feb 6 12:20:45 2019 +0200 Commit: Tor Lillqvist <[email protected]> CommitDate: Wed Feb 6 13:51:07 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 b48fecca1738..12f81caee63a 100644 --- a/sw/source/ui/vba/vbaapplication.cxx +++ b/sw/source/ui/vba/vbaapplication.cxx @@ -110,6 +110,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 ): @@ -660,4 +661,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 3c42f006076ecd71371612d67d84381ac42b88da Author: Tor Lillqvist <[email protected]> AuthorDate: Wed Feb 6 12:08:59 2019 +0200 Commit: Tor Lillqvist <[email protected]> CommitDate: Wed Feb 6 13:50:55 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 de37ae1efddb..b48fecca1738 100644 --- a/sw/source/ui/vba/vbaapplication.cxx +++ b/sw/source/ui/vba/vbaapplication.cxx @@ -109,6 +109,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 ): @@ -650,4 +651,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 990c88a9a84c1960a704052f84318bc33b744fb5 Author: Tor Lillqvist <[email protected]> AuthorDate: Wed Feb 6 11:58:56 2019 +0200 Commit: Tor Lillqvist <[email protected]> CommitDate: Wed Feb 6 13:50:45 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 c4340351b811..de37ae1efddb 100644 --- a/sw/source/ui/vba/vbaapplication.cxx +++ b/sw/source/ui/vba/vbaapplication.cxx @@ -108,6 +108,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 ): @@ -640,4 +641,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: */ commit 5f5726d82e92e0ed403240dbcea57567a5c38a1f Author: Tor Lillqvist <[email protected]> AuthorDate: Wed Feb 6 11:44:15 2019 +0200 Commit: Tor Lillqvist <[email protected]> CommitDate: Wed Feb 6 13:50:23 2019 +0200 Use bool and not sal_Bool, says a plugin Change-Id: I1714a609ecb520260b99f361e4ed65bdc77ddddc diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx index a8279c18b413..c4340351b811 100644 --- a/sw/source/ui/vba/vbaapplication.cxx +++ b/sw/source/ui/vba/vbaapplication.cxx @@ -546,7 +546,7 @@ SwWordBasic::FileClose( const css::uno::Any& Save ) { uno::Reference< frame::XModel > xModel( mpApp->getCurrentDocument(), uno::UNO_SET_THROW ); - sal_Bool bSave = false; + bool bSave = false; if (Save.hasValue() && (Save >>= bSave) && bSave) FileSave(); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
