LibreOffice Module oox (master) 1
|
#include <vbamodule.hxx>
Public Member Functions | |
VbaModule (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XModel > &rxDocModel, OUString aName, rtl_TextEncoding eTextEnc, bool bExecutable) | |
sal_Int32 | getType () const |
Returns the module type (com.sun.star.script.ModuleType constant). More... | |
void | setType (sal_Int32 nType) |
Sets the passed module type. More... | |
const OUString & | getName () const |
Returns the name of the module. More... | |
const OUString & | getStreamName () const |
Returns the stream name of the module. More... | |
void | importDirRecords (BinaryInputStream &rDirStrm) |
Imports all records for this module until the MODULEEND record. More... | |
void | createAndImportModule (StorageBase &rVbaStrg, const css::uno::Reference< css::container::XNameContainer > &rxBasicLib, const css::uno::Reference< css::container::XNameAccess > &rxDocObjectNA) |
Imports the VBA source code into the passed Basic library. More... | |
void | createEmptyModule (const css::uno::Reference< css::container::XNameContainer > &rxBasicLib, const css::uno::Reference< css::container::XNameAccess > &rxDocObjectNA) const |
Creates an empty Basic module in the passed Basic library. More... | |
void | registerShortcutKeys () |
Private Member Functions | |
OUString | readSourceCode (StorageBase &rVbaStrg) |
Reads and returns the VBA source code from the passed storage. More... | |
void | createModule (std::u16string_view rVBASourceCode, const css::uno::Reference< css::container::XNameContainer > &rxBasicLib, const css::uno::Reference< css::container::XNameAccess > &rxDocObjectNA) const |
Creates a new Basic module and inserts it into the passed Basic library. More... | |
Private Attributes | |
css::uno::Reference< css::uno::XComponentContext > | mxContext |
Component context with service manager. More... | |
css::uno::Reference< css::frame::XModel > | mxDocModel |
Document model used to import/export the VBA project. More... | |
OUString | maName |
OUString | maStreamName |
OUString | maDocString |
rtl_TextEncoding | meTextEnc |
sal_Int32 | mnType |
sal_uInt32 | mnOffset |
bool | mbReadOnly |
bool | mbPrivate |
bool | mbExecutable |
std::vector< VbaMacroKeyAndMethodBinding > | maKeyBindings |
Keys and VBA macro method bindings. More... | |
Definition at line 54 of file vbamodule.hxx.
|
explicit |
Definition at line 46 of file vbamodule.cxx.
References aName, mnType, mxContext, SAL_MAX_UINT32, script, and UNKNOWN.
void oox::ole::VbaModule::createAndImportModule | ( | StorageBase & | rVbaStrg, |
const css::uno::Reference< css::container::XNameContainer > & | rxBasicLib, | ||
const css::uno::Reference< css::container::XNameAccess > & | rxDocObjectNA | ||
) |
Imports the VBA source code into the passed Basic library.
Definition at line 130 of file vbamodule.cxx.
References createModule(), readSourceCode(), and registerShortcutKeys().
Referenced by oox::ole::VbaProject::importModulesAndForms().
void oox::ole::VbaModule::createEmptyModule | ( | const css::uno::Reference< css::container::XNameContainer > & | rxBasicLib, |
const css::uno::Reference< css::container::XNameAccess > & | rxDocObjectNA | ||
) | const |
Creates an empty Basic module in the passed Basic library.
Definition at line 154 of file vbamodule.cxx.
References createModule(), and u.
Referenced by oox::ole::VbaProject::importModulesAndForms().
|
private |
Creates a new Basic module and inserts it into the passed Basic library.
Definition at line 266 of file vbamodule.cxx.
References Any, Exception, maName, mbExecutable, mnType, and mxDocModel.
Referenced by createAndImportModule(), and createEmptyModule().
|
inline |
Returns the name of the module.
Definition at line 70 of file vbamodule.hxx.
References maName.
Referenced by oox::ole::VbaProject::importModulesAndForms().
|
inline |
Returns the stream name of the module.
Definition at line 72 of file vbamodule.hxx.
References maStreamName.
|
inline |
Returns the module type (com.sun.star.script.ModuleType constant).
Definition at line 65 of file vbamodule.hxx.
References mnType.
Referenced by oox::ole::VbaProject::importModulesAndForms().
void oox::ole::VbaModule::importDirRecords | ( | BinaryInputStream & | rDirStrm | ) |
Imports all records for this module until the MODULEEND record.
Definition at line 61 of file vbamodule.cxx.
References maDocString, maName, maStreamName, mbPrivate, mbReadOnly, meTextEnc, mnOffset, mnType, OOX_ENSURE_RECORDSIZE, oox::BinaryInputStream::readCharArrayUC(), oox::ole::VbaHelper::readDirRecord(), oox::BinaryInputStream::readuInt32(), SAL_MAX_UINT32, oox::ole::VBA_ID_MODULECOOKIE, oox::ole::VBA_ID_MODULEDOCSTRING, oox::ole::VBA_ID_MODULEDOCSTRINGUNICODE, oox::ole::VBA_ID_MODULEEND, oox::ole::VBA_ID_MODULEHELPCONTEXT, oox::ole::VBA_ID_MODULENAME, oox::ole::VBA_ID_MODULENAMEUNICODE, oox::ole::VBA_ID_MODULEOFFSET, oox::ole::VBA_ID_MODULEPRIVATE, oox::ole::VBA_ID_MODULEREADONLY, oox::ole::VBA_ID_MODULESTREAMNAME, oox::ole::VBA_ID_MODULESTREAMNAMEUNICODE, oox::ole::VBA_ID_MODULETYPEDOCUMENT, and oox::ole::VBA_ID_MODULETYPEPROCEDURAL.
|
private |
Reads and returns the VBA source code from the passed storage.
Definition at line 160 of file vbamodule.cxx.
References index, oox::BinaryStreamBase::isEof(), oox::TextInputStream::isEof(), maKeyBindings, maStreamName, mbExecutable, meTextEnc, mnOffset, mxContext, nPos, oox::StorageBase::openInputStream(), oox::TextInputStream::readLine(), SAL_MAX_UINT32, oox::BinaryXSeekableStream::seek(), o3tl::starts_with(), o3tl::trim(), and u.
Referenced by createAndImportModule().
void oox::ole::VbaModule::registerShortcutKeys | ( | ) |
Definition at line 139 of file vbamodule.cxx.
References ooo::vba::applyShortCutKeyBinding(), Exception, maKeyBindings, mxDocModel, and ooo::vba::parseKeyEvent().
Referenced by createAndImportModule().
|
inline |
Sets the passed module type.
Definition at line 67 of file vbamodule.hxx.
|
private |
Definition at line 106 of file vbamodule.hxx.
Referenced by importDirRecords().
|
private |
Keys and VBA macro method bindings.
Definition at line 115 of file vbamodule.hxx.
Referenced by readSourceCode(), and registerShortcutKeys().
|
private |
Definition at line 104 of file vbamodule.hxx.
Referenced by createModule(), getName(), and importDirRecords().
|
private |
Definition at line 105 of file vbamodule.hxx.
Referenced by getStreamName(), importDirRecords(), and readSourceCode().
|
private |
Definition at line 112 of file vbamodule.hxx.
Referenced by createModule(), and readSourceCode().
|
private |
Definition at line 111 of file vbamodule.hxx.
Referenced by importDirRecords().
|
private |
Definition at line 110 of file vbamodule.hxx.
Referenced by importDirRecords().
|
private |
Definition at line 107 of file vbamodule.hxx.
Referenced by importDirRecords(), and readSourceCode().
|
private |
Definition at line 109 of file vbamodule.hxx.
Referenced by importDirRecords(), and readSourceCode().
|
private |
Definition at line 108 of file vbamodule.hxx.
Referenced by createModule(), getType(), importDirRecords(), and setType().
|
private |
Component context with service manager.
Definition at line 101 of file vbamodule.hxx.
Referenced by readSourceCode().
|
private |
Document model used to import/export the VBA project.
Definition at line 103 of file vbamodule.hxx.
Referenced by createModule(), and registerShortcutKeys().