sw/source/ui/vba/vbaeventshelper.cxx | 12 ++++++------ sw/source/uibase/app/docsh2.cxx | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-)
New commits: commit 21c0b368a3e7150fc5d18af5d568d5683a7a6a3a Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Fri Oct 7 11:20:20 2022 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Sat Oct 8 12:07:35 2022 +0200 tdf#148806 doc vba: AutoOpen runs before Document_Open The same is true for AutoClose and AutoNew. I tested in Word 2003, and DOCX with Word 2010. Change-Id: I7243573be0fee529494f1ab6031d89ec57805695 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141093 Tested-by: Justin Luth <jl...@mail.com> Reviewed-by: Justin Luth <jl...@mail.com> diff --git a/sw/source/ui/vba/vbaeventshelper.cxx b/sw/source/ui/vba/vbaeventshelper.cxx index 6e9e510973af..ccdb10548ca2 100644 --- a/sw/source/ui/vba/vbaeventshelper.cxx +++ b/sw/source/ui/vba/vbaeventshelper.cxx @@ -48,14 +48,14 @@ bool SwVbaEventsHelper::implPrepareEvent( EventQueue& rEventQueue, { switch( rInfo.mnEventId ) { - case DOCUMENT_NEW: - rEventQueue.emplace_back(AUTO_NEW ); + case AUTO_NEW: + rEventQueue.emplace_back(DOCUMENT_NEW); break; - case DOCUMENT_OPEN: - rEventQueue.emplace_back(AUTO_OPEN ); + case AUTO_OPEN: + rEventQueue.emplace_back(DOCUMENT_OPEN); break; - case DOCUMENT_CLOSE: - rEventQueue.emplace_back(AUTO_CLOSE ); + case AUTO_CLOSE: + rEventQueue.emplace_back(DOCUMENT_CLOSE); break; } return true; diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 8813828b5969..d9e1486e0e3a 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -221,10 +221,10 @@ static void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVB switch( pSfxEventHint->GetEventId() ) { case SfxEventHintId::CreateDoc: - xVbaEvents->processVbaEvent( DOCUMENT_NEW, aArgs ); + xVbaEvents->processVbaEvent(AUTO_NEW, aArgs); break; case SfxEventHintId::OpenDoc: - xVbaEvents->processVbaEvent( DOCUMENT_OPEN, aArgs ); + xVbaEvents->processVbaEvent(AUTO_OPEN, aArgs); break; default: break; } @@ -385,7 +385,7 @@ bool SwDocShell::PrepareClose( bool bUI ) { using namespace com::sun::star::script::vba::VBAEventId; uno::Sequence< uno::Any > aNoArgs; - xVbaEvents->processVbaEvent( DOCUMENT_CLOSE, aNoArgs ); + xVbaEvents->processVbaEvent(AUTO_CLOSE, aNoArgs); } } return bRet;