summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/oox/ole/vbaexport.hxx69
1 files changed, 69 insertions, 0 deletions
diff --git a/include/oox/ole/vbaexport.hxx b/include/oox/ole/vbaexport.hxx
index 88a0561a8717..6993fe51284d 100644
--- a/include/oox/ole/vbaexport.hxx
+++ b/include/oox/ole/vbaexport.hxx
@@ -11,6 +11,9 @@
#define __INCLUDED_INCLUDE_OOX_OLE_VBAEXPORT_HXX__
#include <com/sun/star/uno/XInterface.hpp>
+
+#include <tools/stream.hxx>
+
#include <oox/dllapi.h>
namespace com { namespace sun { namespace star {
@@ -35,6 +38,72 @@ private:
OUString maProjectName;
};
+class VBACompressionChunk
+{
+public:
+
+ VBACompressionChunk(SvStream& rCompressedStream, const sal_uInt8* pData, sal_Size nChunkSize);
+
+ void write();
+
+private:
+ SvStream& mrCompressedStream;
+ const sal_uInt8* mpUncompressedData;
+ sal_uInt8* mpCompressedChunkStream;
+
+ // same as DecompressedChunkEnd in the spec
+ sal_Size mnChunkSize;
+
+ // CompressedCurrent according to the spec
+ sal_uInt64 mnCompressedCurrent;
+
+ // CompressedEnd according to the spec
+ sal_uInt64 mnCompressedEnd;
+
+ // DecompressedCurrent according to the spec
+ sal_uInt64 mnDecompressedCurrent;
+
+ // DecompressedEnd according to the spec
+ sal_uInt64 mnDecompressedEnd;
+
+ // Start of the current decompressed chunk
+ sal_uInt64 mnChunkStart;
+
+ void PackCompressedChunkSize(size_t nSize, sal_uInt16& rHeader);
+
+ void PackCompressedChunkFlag(bool bCompressed, sal_uInt16& rHeader);
+
+ void PackCompressedChunkSignature(sal_uInt16& rHeader);
+
+ void compressTokenSequence();
+
+ void compressToken(size_t index, sal_uInt8& nFlagByte);
+
+ void SetFlagBit(size_t index, bool bVal, sal_uInt8& rFlag);
+
+ sal_uInt16 CopyToken(size_t nLength, size_t nOffset);
+
+ void match(size_t& rLength, size_t& rOffset);
+
+ void CopyTokenHelp(sal_uInt16& rLengthMask, sal_uInt16& rOffsetMask,
+ sal_uInt16& rBitCount, sal_uInt16& rMaximumLength);
+
+ void writeRawChunk();
+};
+
+class VBACompression
+{
+public:
+ VBACompression(SvStream& rCompressedStream,
+ SvMemoryStream& rUncompressedStream);
+
+ void write();
+
+private:
+ SvStream& mrCompressedStream;
+ SvMemoryStream& mrUncompressedStream;
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */