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 8312e6f2ef5ea4fca7f2c9a08bee2984176f8628 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Wed Oct 12 13:08:59 2022 -0400 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Oct 24 15:05:26 2022 +0200 sw vba: add WordBasic.ScreenUpdating Cherry-pick of a8209c52d6daeb00ed85d5c705ec84c9603e2f3e 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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141574 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl b/oovbaapi/ooo/vba/word/XWordBasic.idl index 5a381daf3867..124b0809234d 100644 --- a/oovbaapi/ooo/vba/word/XWordBasic.idl +++ b/oovbaapi/ooo/vba/word/XWordBasic.idl @@ -44,6 +44,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 f3b10af8a30d..dc571ed928af 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -109,6 +109,10 @@ void SwMacrosTest::testVba() { OUString("testVba.doc"), OUString("vnd.sun.Star.script:Project.NewMacros.Macro1?language=Basic&location=document") + }, + { + OUString("testVBA.docm"), + OUString("vnd.sun.Star.script:Project.ThisDocument.testAll?language=Basic&location=document") } }; for ( size_t i=0; i<SAL_N_ELEMENTS( testInfo ); ++i ) 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 5933f104eb49..57b3c735f1df 100644 --- a/sw/source/ui/vba/vbawordbasic.hxx +++ b/sw/source/ui/vba/vbawordbasic.hxx @@ -74,6 +74,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