diff options
author | Justin Luth <justin.luth@collabora.com> | 2022-10-06 20:00:07 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2022-10-07 23:48:36 +0200 |
commit | 6834fda784f3066a89838cd6cda4fe945f4c7904 (patch) | |
tree | d972b8d62c56aedd70f2696ee291a934d7c341c5 /sc | |
parent | 4a07e9e31a6cd93958f94354a15325af098c93b8 (diff) |
related tdf#148806 xls/x vba: no auto_open if Auto_Open module
The presence of an Auto_Close module prevents any
auto_close subroutines from running.
Interestingly, Word is different. It doesn't care at all
if such a module is present. (In fact, it uses that
module's main() as an AutoClose if there is no
Sub AutoClose.)
Change-Id: I83a80b7f016dcf2ad3b7fd931acacb6f788241a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141036
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/vba/vbaeventshelper.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx index bd00fdcac3bd..d412af36b466 100644 --- a/sc/source/ui/vba/vbaeventshelper.cxx +++ b/sc/source/ui/vba/vbaeventshelper.cxx @@ -659,7 +659,8 @@ bool ScVbaEventsHelper::implPrepareEvent( EventQueue& rEventQueue, rEventQueue.emplace_back(WORKBOOK_ACTIVATE ); uno::Sequence< uno::Any > aArgs{ uno::Any(mxModel->getCurrentController()) }; rEventQueue.emplace_back( WORKBOOK_WINDOWACTIVATE, aArgs ); - rEventQueue.emplace_back(AUTO_OPEN ); + if (!hasModule("Auto_Open")) + rEventQueue.emplace_back(AUTO_OPEN ); // remember initial selection maOldSelection <<= mxModel->getCurrentSelection(); } @@ -779,7 +780,7 @@ void ScVbaEventsHelper::implPostProcessEvent( EventQueue& rEventQueue, case WORKBOOK_BEFORECLOSE: /* Execute Auto_Close only if not cancelled by event handler, but before UI asks user whether to cancel closing the document. */ - if( !bCancel ) + if (!bCancel && !hasModule("Auto_Close")) rEventQueue.emplace_back(AUTO_CLOSE ); break; } |