oovbaapi/ooo/vba/word/XWordBasic.idl |    1 +
 sw/qa/core/data/docm/testVBA.docm    |binary
 sw/qa/core/macros-test.cxx           |    4 ++++
 sw/source/ui/vba/vbawordbasic.cxx    |    7 +++++++
 sw/source/ui/vba/vbawordbasic.hxx    |    1 +
 5 files changed, 13 insertions(+)

New commits:
commit a8209c52d6daeb00ed85d5c705ec84c9603e2f3e
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Wed Oct 12 13:08:59 2022 -0400
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Oct 14 09:40:30 2022 +0200

    sw vba: add WordBasic.ScreenUpdating
    
    Change-Id: I3d074c224b77eff9f4ab1ea6bade6d66828fc88c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141273
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl 
b/oovbaapi/ooo/vba/word/XWordBasic.idl
index 7c694703a843..66c867f09364 100644
--- a/oovbaapi/ooo/vba/word/XWordBasic.idl
+++ b/oovbaapi/ooo/vba/word/XWordBasic.idl
@@ -42,6 +42,7 @@ interface XWordBasic
     any DocMaximize( [in] any State );
     void AppShow( [in] any WindowName );
     any AppCount();
+    void ScreenUpdating( [in] /*optional*/ any On );
 };
 
 }; }; };
diff --git a/sw/qa/core/data/docm/testVBA.docm 
b/sw/qa/core/data/docm/testVBA.docm
new file mode 100644
index 000000000000..c02e353c3c3e
Binary files /dev/null and b/sw/qa/core/data/docm/testVBA.docm differ
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index f02bd34d91be..23a489517b11 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -106,6 +106,10 @@ void SwMacrosTest::createFileURL(std::u16string_view 
aFile, OUString& rFilePath)
 void SwMacrosTest::testVba()
 {
     TestMacroInfo testInfo[] = {
+        {
+            OUString("testVBA.docm"),
+            
OUString("vnd.sun.Star.script:Project.ThisDocument.testAll?language=Basic&location=document")
+        },
         {
             OUString("testFind.docm"),
             
OUString("vnd.sun.Star.script:Project.Module1.testAll?language=Basic&location=document")
diff --git a/sw/source/ui/vba/vbawordbasic.cxx 
b/sw/source/ui/vba/vbawordbasic.cxx
index c5fe14289832..ae59cf245f55 100644
--- a/sw/source/ui/vba/vbawordbasic.cxx
+++ b/sw/source/ui/vba/vbawordbasic.cxx
@@ -242,4 +242,11 @@ css::uno::Any SAL_CALL SwWordBasic::AppCount()
     return css::uno::Any(sal_Int32(2));
 }
 
+void SAL_CALL SwWordBasic::ScreenUpdating(const uno::Any& On)
+{
+    sal_Int32 nOn;
+    if (On >>= nOn)
+        mpApp->setScreenUpdating(nOn != 0);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbawordbasic.hxx 
b/sw/source/ui/vba/vbawordbasic.hxx
index eb9ce5d500c2..75f8a05a3210 100644
--- a/sw/source/ui/vba/vbawordbasic.hxx
+++ b/sw/source/ui/vba/vbawordbasic.hxx
@@ -86,6 +86,7 @@ public:
     virtual css::uno::Any SAL_CALL DocMaximize(const css::uno::Any& State) 
override;
     virtual void SAL_CALL AppShow(const css::uno::Any& WindowName) override;
     virtual css::uno::Any SAL_CALL AppCount() override;
+    virtual void SAL_CALL ScreenUpdating(const css::uno::Any& On) override;
 };
 
 #endif // INCLUDED_SW_SOURCE_UI_VBA_VBAWORDBASIC_HXX

Reply via email to