LibreOffice Module oox (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
oox::ole::VbaMacroAttacherBase Class Referenceabstract

Base class for objects that attach a macro to a specific action. More...

#include <vbaproject.hxx>

Public Member Functions

 VbaMacroAttacherBase (const OUString &rMacroName)
 
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
 

Detailed Description

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.

Constructor & Destructor Documentation

oox::ole::VbaMacroAttacherBase::VbaMacroAttacherBase ( const OUString &  rMacroName)
explicit

Definition at line 116 of file vbaproject.cxx.

References maMacroName.

oox::ole::VbaMacroAttacherBase::~VbaMacroAttacherBase ( )
virtual

Definition at line 122 of file vbaproject.cxx.

Member Function Documentation

virtual void oox::ole::VbaMacroAttacherBase::attachMacro ( const OUString &  rScriptUrl)
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 126 of file vbaproject.cxx.

References attachMacro(), Exception, and maMacroName.

Referenced by oox::ole::VbaProject::attachMacros().

Member Data Documentation

OUString oox::ole::VbaMacroAttacherBase::maMacroName
private

Definition at line 108 of file vbaproject.hxx.

Referenced by resolveAndAttachMacro(), and VbaMacroAttacherBase().


The documentation for this class was generated from the following files: