[Libreoffice-commits] core.git: Branch 'feature/vba-export' - oox/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Sat Aug 1 17:21:21 PDT 2015
oox/source/ole/vbaexport.cxx | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
New commits:
commit 1ea76b16551b6aa4aa5f7468e3d70da42f37e6b5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Aug 2 02:19:17 2015 +0200
export first vba records
Change-Id: I840b253e3622e783dee797b9e0b4b39559f0e74d
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 4b94a89..b5141b1 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -9,9 +9,12 @@
#include <oox/ole/vbaexport.hxx>
+#include <tools/stream.hxx>
+
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <com/sun/star/frame/XModel.hpp>
+#include <oox/helper/binaryoutputstream.hxx>
#include "oox/helper/propertyset.hxx"
#include "oox/token/properties.hxx"
@@ -21,9 +24,38 @@ VbaExport::VbaExport(css::uno::Reference<css::frame::XModel> xModel):
maProjectName = "How to get the correct project name?";
}
+namespace {
+
+// section 2.3.4.2.1.1
+void writePROJECTSYSKIND(SvStream& rStrm)
+{
+ rStrm.WriteUInt16(0x0001); // id
+ rStrm.WriteUInt32(0x00000004); // size
+ rStrm.WriteUInt32(0x00000002); // SysKind, hard coded to 32-bin windows for now
+}
+
+// section 2.3.4.2.1
+void writePROJECTINFORMATION(SvStream& rStrm)
+{
+ writePROJECTSYSKIND(rStrm);
+}
+
+// section 2.3.4.2
+void exportDirStream(SvStream& rStrm)
+{
+ writePROJECTINFORMATION(rStrm);
+}
+
+}
+
void VbaExport::exportVBA()
{
// start here with the VBA export
+ const OUString aDirFileName("/home/moggi/Documents/temp/vba_dir_out.bin");
+ SvFileStream aDirStream(aDirFileName, StreamMode::WRITE);
+
+ // export
+ exportDirStream(aDirStream);
}
css::uno::Reference<css::container::XNameContainer> VbaExport::getBasicLibrary()
More information about the Libreoffice-commits
mailing list