diff options
Diffstat (limited to 'oox/source/ole/vbamodule.cxx')
-rwxr-xr-x | oox/source/ole/vbamodule.cxx | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx index e9388e54215a..9886f2cc5968 100755 --- a/oox/source/ole/vbamodule.cxx +++ b/oox/source/ole/vbamodule.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/script/ModuleInfo.hpp> #include <com/sun/star/script/ModuleType.hpp> -#include <com/sun/star/script/XVBAModuleInfo.hpp> +#include <com/sun/star/script/vba/XVBAModuleInfo.hpp> #include "oox/helper/binaryinputstream.hxx" #include "oox/helper/storagebase.hxx" #include "oox/helper/textinputstream.hxx" @@ -38,18 +38,12 @@ using ::rtl::OUString; using ::rtl::OUStringBuffer; -using ::com::sun::star::container::XNameAccess; -using ::com::sun::star::container::XNameContainer; -using ::com::sun::star::frame::XModel; -using ::com::sun::star::script::ModuleInfo; -using ::com::sun::star::script::XVBAModuleInfo; -using ::com::sun::star::uno::Any; -using ::com::sun::star::uno::Exception; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::UNO_QUERY_THROW; - -namespace ApiModuleType = ::com::sun::star::script::ModuleType; + +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::script; +using namespace ::com::sun::star::script::vba; +using namespace ::com::sun::star::uno; namespace oox { namespace ole { @@ -60,7 +54,7 @@ VbaModule::VbaModule( const Reference< XModel >& rxDocModel, const OUString& rNa mxDocModel( rxDocModel ), maName( rName ), meTextEnc( eTextEnc ), - mnType( ApiModuleType::UNKNOWN ), + mnType( ModuleType::UNKNOWN ), mnOffset( SAL_MAX_UINT32 ), mbReadOnly( false ), mbPrivate( false ), @@ -107,13 +101,13 @@ void VbaModule::importDirRecords( BinaryInputStream& rDirStrm ) break; case VBA_ID_MODULETYPEPROCEDURAL: OOX_ENSURE_RECORDSIZE( nRecSize == 0 ); - OSL_ENSURE( mnType == ApiModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); - mnType = ApiModuleType::NORMAL; + OSL_ENSURE( mnType == ModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); + mnType = ModuleType::NORMAL; break; case VBA_ID_MODULETYPEDOCUMENT: OOX_ENSURE_RECORDSIZE( nRecSize == 0 ); - OSL_ENSURE( mnType == ApiModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); - mnType = ApiModuleType::DOCUMENT; + OSL_ENSURE( mnType == ModuleType::UNKNOWN, "VbaModule::importDirRecords - multiple module type records" ); + mnType = ModuleType::DOCUMENT; break; case VBA_ID_MODULEREADONLY: OOX_ENSURE_RECORDSIZE( nRecSize == 0 ); @@ -130,7 +124,7 @@ void VbaModule::importDirRecords( BinaryInputStream& rDirStrm ) } OSL_ENSURE( maName.getLength() > 0, "VbaModule::importDirRecords - missing module name" ); OSL_ENSURE( maStreamName.getLength() > 0, "VbaModule::importDirRecords - missing module stream name" ); - OSL_ENSURE( mnType != ApiModuleType::UNKNOWN, "VbaModule::importDirRecords - missing module type" ); + OSL_ENSURE( mnType != ModuleType::UNKNOWN, "VbaModule::importDirRecords - missing module type" ); OSL_ENSURE( mnOffset < SAL_MAX_UINT32, "VbaModule::importDirRecords - missing module stream offset" ); } @@ -155,18 +149,18 @@ void VbaModule::importSourceCode( StorageBase& rVbaStrg, aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Rem Attribute VBA_ModuleType=" ) ); switch( mnType ) { - case ApiModuleType::NORMAL: + case ModuleType::NORMAL: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBAModule" ) ); break; - case ApiModuleType::CLASS: + case ModuleType::CLASS: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBAClassModule" ) ); break; - case ApiModuleType::FORM: + case ModuleType::FORM: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBAFormModule" ) ); // hack from old filter, document Basic should know the XModel, but it doesn't aModuleInfo.ModuleObject.set( mxDocModel, UNO_QUERY ); break; - case ApiModuleType::DOCUMENT: + case ModuleType::DOCUMENT: aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "VBADocumentModule" ) ); // get the VBA object associated to the document module if( rxDocObjectNA.is() ) try @@ -184,7 +178,7 @@ void VbaModule::importSourceCode( StorageBase& rVbaStrg, if( mbExecutable ) { aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Option VBASupport 1\n" ) ); - if( mnType == ApiModuleType::CLASS ) + if( mnType == ModuleType::CLASS ) aSourceCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Option ClassModule\n" ) ); } else |