LibreOffice Module oox (master) 1
|
Base class for objects that attach a macro to a specific action. More...
#include <vbaproject.hxx>
Public Member Functions | |
VbaMacroAttacherBase (OUString aMacroName) | |
virtual | ~VbaMacroAttacherBase () |
void | resolveAndAttachMacro (const css::uno::Reference< css::script::vba::XVBAMacroResolver > &rxResolver) |
Resolves the internal macro name to the related macro URL, and attaches the macro to the object. More... | |
Private Member Functions | |
virtual void | attachMacro (const OUString &rScriptUrl)=0 |
Called after the VBA project has been imported. More... | |
Private Attributes | |
OUString | maMacroName |
Base class for objects that attach a macro to a specific action.
Purpose is to collect objects that need to attach a VBA macro to an action. The VBA project will be loaded at a very late point of the document import process, because it depends on an initialized core document model (e.g. spreadsheet codenames). Some objects that want to attach a VBA macro to an action (e.g. mouse click action for drawing shapes) are loaded long before the VBA project. The drawback is that in most cases macros are specified without module name, or the VBA project name is part of the macro name. In the former case, all code modules have to be scanned for the macro to be able to create a valid script URL.
The import code will register these requests to attach a VBA macro with an instance of a class derived from this base class. The derived class will store all information needed to finally attach the macro to the action, once the VBA project has been imported.
Definition at line 91 of file vbaproject.hxx.
|
explicit |
Definition at line 119 of file vbaproject.cxx.
References maMacroName.
|
virtual |
Definition at line 125 of file vbaproject.cxx.
|
privatepure virtual |
Called after the VBA project has been imported.
Derived classes will attach the passed script to the object represented by this instance.
Referenced by resolveAndAttachMacro().
void oox::ole::VbaMacroAttacherBase::resolveAndAttachMacro | ( | const css::uno::Reference< css::script::vba::XVBAMacroResolver > & | rxResolver | ) |
Resolves the internal macro name to the related macro URL, and attaches the macro to the object.
Definition at line 129 of file vbaproject.cxx.
References attachMacro(), Exception, maMacroName, and TOOLS_WARN_EXCEPTION.
Referenced by oox::ole::VbaProject::attachMacros().
|
private |
Definition at line 108 of file vbaproject.hxx.
Referenced by resolveAndAttachMacro(), and VbaMacroAttacherBase().