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

#include <vbamodule.hxx>

Public Member Functions

 VbaModule (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XModel > &rxDocModel, const OUString &rName, 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) const
 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...
 

Private Member Functions

OUString readSourceCode (StorageBase &rVbaStrg) const
 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
 

Detailed Description

Definition at line 43 of file vbamodule.hxx.

Constructor & Destructor Documentation

oox::ole::VbaModule::VbaModule ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::uno::Reference< css::frame::XModel > &  rxDocModel,
const OUString &  rName,
rtl_TextEncoding  eTextEnc,
bool  bExecutable 
)
explicit

Definition at line 44 of file vbamodule.cxx.

References mnType, mxContext, SAL_MAX_UINT32, script, and UNKNOWN.

Member Function Documentation

void oox::ole::VbaModule::createAndImportModule ( StorageBase rVbaStrg,
const css::uno::Reference< css::container::XNameContainer > &  rxBasicLib,
const css::uno::Reference< css::container::XNameAccess > &  rxDocObjectNA 
) const

Imports the VBA source code into the passed Basic library.

Definition at line 128 of file vbamodule.cxx.

References createModule(), and readSourceCode().

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 136 of file vbamodule.cxx.

References createModule(), and u.

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

void oox::ole::VbaModule::createModule ( std::u16string_view  rVBASourceCode,
const css::uno::Reference< css::container::XNameContainer > &  rxBasicLib,
const css::uno::Reference< css::container::XNameAccess > &  rxDocObjectNA 
) const
private

Creates a new Basic module and inserts it into the passed Basic library.

Definition at line 255 of file vbamodule.cxx.

References Any, Exception, maName, mbExecutable, mnType, and mxDocModel.

Referenced by createAndImportModule(), and createEmptyModule().

const OUString& oox::ole::VbaModule::getName ( ) const
inline

Returns the name of the module.

Definition at line 59 of file vbamodule.hxx.

References maName.

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

const OUString& oox::ole::VbaModule::getStreamName ( ) const
inline

Returns the stream name of the module.

Definition at line 61 of file vbamodule.hxx.

References maStreamName.

sal_Int32 oox::ole::VbaModule::getType ( ) const
inline

Returns the module type (com.sun.star.script.ModuleType constant).

Definition at line 54 of file vbamodule.hxx.

References mnType.

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

void oox::ole::VbaModule::importDirRecords ( BinaryInputStream rDirStrm)
OUString oox::ole::VbaModule::readSourceCode ( StorageBase rVbaStrg) const
private
void oox::ole::VbaModule::setType ( sal_Int32  nType)
inline

Sets the passed module type.

Definition at line 56 of file vbamodule.hxx.

References mnType.

Member Data Documentation

OUString oox::ole::VbaModule::maDocString
private

Definition at line 93 of file vbamodule.hxx.

Referenced by importDirRecords().

OUString oox::ole::VbaModule::maName
private

Definition at line 91 of file vbamodule.hxx.

Referenced by createModule(), getName(), and importDirRecords().

OUString oox::ole::VbaModule::maStreamName
private

Definition at line 92 of file vbamodule.hxx.

Referenced by getStreamName(), importDirRecords(), and readSourceCode().

bool oox::ole::VbaModule::mbExecutable
private

Definition at line 99 of file vbamodule.hxx.

Referenced by createModule(), and readSourceCode().

bool oox::ole::VbaModule::mbPrivate
private

Definition at line 98 of file vbamodule.hxx.

Referenced by importDirRecords().

bool oox::ole::VbaModule::mbReadOnly
private

Definition at line 97 of file vbamodule.hxx.

Referenced by importDirRecords().

rtl_TextEncoding oox::ole::VbaModule::meTextEnc
private

Definition at line 94 of file vbamodule.hxx.

Referenced by importDirRecords(), and readSourceCode().

sal_uInt32 oox::ole::VbaModule::mnOffset
private

Definition at line 96 of file vbamodule.hxx.

Referenced by importDirRecords(), and readSourceCode().

sal_Int32 oox::ole::VbaModule::mnType
private

Definition at line 95 of file vbamodule.hxx.

Referenced by createModule(), getType(), importDirRecords(), and setType().

css::uno::Reference< css::uno::XComponentContext > oox::ole::VbaModule::mxContext
private

Component context with service manager.

Definition at line 88 of file vbamodule.hxx.

Referenced by readSourceCode().

css::uno::Reference< css::frame::XModel > oox::ole::VbaModule::mxDocModel
private

Document model used to import/export the VBA project.

Definition at line 90 of file vbamodule.hxx.

Referenced by createModule(), and readSourceCode().


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