office-gobmx/sw/util/vbaswobj.component
Justin Luth acc71c3e50 tdf#148806 sw vba: fix GetVbaEventProcessor
I've decided this is not an API change because there exists
offapi/com/sun/star/script/vba/VBATextEventProcessor.idl

This patch allows New, Open, and Close events to be
sent to VBA macro event handlers.

I tested with DOCUMENT_OPEN.

Amazing - all this stuff is here in place,
but isn't properly wired up. How can so much
ground-work be done without it ever being functional?

I don't think this has ever worked,
and the same problem/code is seen in OpenOffice.

The service names were already mismatched in the initial patch:
commit fc135411fa
Author: Daniel Rentz on Tue Jul 6 19:34:53 2010 +0200
    mib17: #i112634# add VBA sheet event handling,
           based on a patch from Noel Power

https://bz.apache.org/ooo/show_bug.cgi?id=112634
says "Additionally I added the hooks for vba for word
( but they are compiled out for now )"

Enabling this will open up the doors to a lot of
untested code I think.
I had to move initialization of mxVbaEvents
because it was being set without a VBA project,
but it didn't work to put it in VbaGlobals like Calc does.

Change-Id: I08cc0e33444dc7dfaac82cf6cebb1a89dbb69faa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140801
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-10-01 08:56:13 +02:00

35 lines
1.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="SwVbaDocument" constructor="Writer_SwVbaDocument_get_implementation">
<service name="ooo.vba.word.Document"/>
</implementation>
<implementation name="SwVbaEventsHelper" constructor="Writer_SwVbaEventsHelper_get_implementation">
<service name="com.sun.star.script.vba.VBATextEventProcessor"/>
</implementation>
<implementation name="SwVbaGlobals" constructor="Writer_SwVbaGlobals_get_implementation">
<service name="ooo.vba.word.Globals"/>
</implementation>
<implementation name="SwVbaWrapFormat"
constructor="Writer_SwVbaWrapFormat_get_implementation">
<service name="ooo.vba.word.WrapFormat"/>
</implementation>
</component>