summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosemary <rosemaryseb8@gmail.com>2015-08-27 13:39:37 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-09-10 04:14:49 +0200
commitc5aeca430288057a721688975173ed764860d8b8 (patch)
tree2a2fb888ecf04241d7b6ee91863808e728d61120
parent3d492e8f5d5062dd4f52f29e36047ea82f18bce4 (diff)
Write _VBA_PROJECT stream to a binary file
The stream is written according to the MS-OVBA specification. Conflicts: oox/source/ole/vbaexport.cxx Change-Id: Icc63c988435d9b3bed8fdd499b80a17713f3794f
-rw-r--r--oox/source/ole/vbaexport.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index c52c1b6243e1..d1ff3c7587cd 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -609,6 +609,14 @@ void exportDirStream(SvStream& rStrm)
aCompression.write();
}
+void exportVBAProjectStream(SvStream& rStrm)
+{
+ rStrm.WriteUInt16(0x61CC); // Reserved1
+ rStrm.WriteUInt16(0xFFFF); // Version
+ rStrm.WriteUInt8(0x00); // Reserved2
+ rStrm.WriteUInt16(0x0000); // Undefined
+}
+
}
void VbaExport::exportVBA(SotStorage* pRootStorage)
@@ -616,9 +624,12 @@ void VbaExport::exportVBA(SotStorage* pRootStorage)
// start here with the VBA export
SotStorage* pVBAStream = pRootStorage->OpenSotStorage("VBA", STREAM_READWRITE);
SotStorageStream* pDirStream = pVBAStream->OpenSotStream("dir", STREAM_READWRITE);
+ SotStorageStream* pVBAProjectStream = pVBAStream->OpenSotStream("_VBA_PROJECT", STREAM_READWRITE);
// export
exportDirStream(*pDirStream);
+ exportVBAProjectStream(*pVBAProjectStream);
+
css::uno::Reference<css::container::XNameContainer> xNameContainer = getBasicLibrary();
css::uno::Sequence<OUString> aElementNames = xNameContainer->getElementNames();
@@ -631,6 +642,7 @@ void VbaExport::exportVBA(SotStorage* pRootStorage)
css::script::ModuleInfo aModuleInfo = xModuleInfo->getModuleInfo(aElementNames[i]);
SAL_DEBUG(aModuleInfo.ModuleType);
}
+ pVBAProjectStream->Commit();
pDirStream->Commit();
pVBAStream->Commit();
pRootStorage->Commit();