sw vba: add WordBasic.ScreenUpdating

Change-Id: I3d074c224b77eff9f4ab1ea6bade6d66828fc88c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141273
Tested-by: Jenkins
Reviewed-by: Justin Luth <[email protected]>
Reviewed-by: Miklos Vajna <[email protected]>
diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl b/oovbaapi/ooo/vba/word/XWordBasic.idl
index 7c69470..66c867f 100644
--- a/oovbaapi/ooo/vba/word/XWordBasic.idl
+++ b/oovbaapi/ooo/vba/word/XWordBasic.idl
@@ -42,6 +42,7 @@
    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 0000000..c02e353
--- /dev/null
+++ b/sw/qa/core/data/docm/testVBA.docm
Binary files differ
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index f02bd34..23a4895 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -107,6 +107,10 @@
{
    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 c5fe142..ae59cf24 100644
--- a/sw/source/ui/vba/vbawordbasic.cxx
+++ b/sw/source/ui/vba/vbawordbasic.cxx
@@ -242,4 +242,11 @@
    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 eb9ce5d..75f8a05 100644
--- a/sw/source/ui/vba/vbawordbasic.hxx
+++ b/sw/source/ui/vba/vbawordbasic.hxx
@@ -86,6 +86,7 @@
    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