[Libreoffice-commits] core.git: Branch 'feature/vba-export' - 6 commits - oox/source
Rosemary
rosemaryseb8 at gmail.com
Mon Aug 10 08:04:16 PDT 2015
oox/source/ole/vbaexport.cxx | 70 ++++++++++++++++++++++++++++++++++++++++---
1 file changed, 66 insertions(+), 4 deletions(-)
New commits:
commit 9007214d68f295c38f64f93212d2391bd5cc7001
Author: Rosemary <rosemaryseb8 at gmail.com>
Date: Sun Aug 9 17:18:10 2015 +0530
PROJECT CONSTANTS record
Change-Id: I569aac676764c356a5ffc8d47153e70cb3224af9
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 4f6bc1b..6a5365b 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -45,6 +45,15 @@ VbaExport::VbaExport(css::uno::Reference<css::frame::XModel> xModel):
namespace {
+//section 2.3.4.2.1.11
+void writePROJECTCONSTANTS(SvStream& rStrm)
+{
+ rStrm.WriteUInt16(0x000C); // id
+ rStrm.WriteUInt32(0x00000000); // sizeOfConstants
+ rStrm.WriteUInt16(0x003C); // Reserved
+ rStrm.WriteUInt32(0x00000000); // sizeOfConstantsUnicode
+}
+
//section 2.3.4.2.1.10
void writePROJECTVERSION(SvStream& rStrm)
{
@@ -143,6 +152,7 @@ void writePROJECTINFORMATION(SvStream& rStrm)
writePROJECTHELPCONTEXT(rStrm);
writePROJECTLIBFLAGS(rStrm);
writePROJECTVERSION(rStrm);
+ writePROJECTCONSTANTS(rStrm);
}
// section 2.3.4.2
commit 2145b1cdf0aabc3ac45361c0853e2669ece9edad
Author: Rosemary <rosemaryseb8 at gmail.com>
Date: Sun Aug 9 17:04:48 2015 +0530
PROJECT VERSION record
Conflicts:
oox/source/ole/vbaexport.cxx
Change-Id: Id0206e4a9495bcf92e8ece0e2ea1e1bd4ef9233b
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index c6417e2..4f6bc1b 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -27,12 +27,6 @@
#define CODEPAGE RTL_TEXTENCODING_MS_1252
#endif
-VbaExport::VbaExport(css::uno::Reference<css::frame::XModel> xModel):
- mxModel(xModel)
-{
- maProjectName = "How to get the correct project name?";
-}
-
namespace {
void exportString(SvStream& rStrm, const OUString& rString)
@@ -43,8 +37,23 @@ void exportString(SvStream& rStrm, const OUString& rString)
}
+VbaExport::VbaExport(css::uno::Reference<css::frame::XModel> xModel):
+ mxModel(xModel)
+{
+ maProjectName = "How to get the correct project name?";
+}
+
namespace {
+//section 2.3.4.2.1.10
+void writePROJECTVERSION(SvStream& rStrm)
+{
+ rStrm.WriteUInt16(0x0009); // id
+ rStrm.WriteUInt32(0x00000004); // Reserved
+ rStrm.WriteUInt32(1467127224); // VersionMajor // TODO: where is this magic number comming from
+ rStrm.WriteUInt16(5); // VersionMinor // TODO: where is this magic number coming from
+}
+
//section 2.3.4.2.1.9
void writePROJECTLIBFLAGS(SvStream& rStrm)
{
@@ -133,6 +142,7 @@ void writePROJECTINFORMATION(SvStream& rStrm)
writePROJECTHELPFILEPATH(rStrm);
writePROJECTHELPCONTEXT(rStrm);
writePROJECTLIBFLAGS(rStrm);
+ writePROJECTVERSION(rStrm);
}
// section 2.3.4.2
commit d3ee7ae620235c94701f01b574b4d0487df04b78
Author: Rosemary <rosemaryseb8 at gmail.com>
Date: Sun Aug 9 16:52:12 2015 +0530
PROJECT LIBFLAGS record
Conflicts:
oox/source/ole/vbaexport.cxx
Change-Id: Ie52ca9f20146d8a30dfd656e43f26e754f9b4c79
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 3e6516a..c6417e2 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -45,6 +45,14 @@ void exportString(SvStream& rStrm, const OUString& rString)
namespace {
+//section 2.3.4.2.1.9
+void writePROJECTLIBFLAGS(SvStream& rStrm)
+{
+ rStrm.WriteUInt16(0x0008); // id
+ rStrm.WriteUInt32(0x00000004); // size
+ rStrm.WriteUInt32(0x00000000); // ProjectLibFlags
+}
+
//section 2.3.4.2.1.8
void writePROJECTHELPCONTEXT(SvStream& rStrm)
{
@@ -124,6 +132,7 @@ void writePROJECTINFORMATION(SvStream& rStrm)
writePROJECTDOCSTRING(rStrm);
writePROJECTHELPFILEPATH(rStrm);
writePROJECTHELPCONTEXT(rStrm);
+ writePROJECTLIBFLAGS(rStrm);
}
// section 2.3.4.2
commit aa7c0454c0818acd7a738e2bdd57e1ce1d82cf28
Author: Rosemary <rosemaryseb8 at gmail.com>
Date: Sun Aug 9 16:43:59 2015 +0530
PROJECT HELP CONTEXT record
Conflicts:
oox/source/ole/vbaexport.cxx
Change-Id: I2d635df9e562970ff92777ab05a0b1a8f7baf188
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 548bd58..3e6516a 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -45,6 +45,14 @@ void exportString(SvStream& rStrm, const OUString& rString)
namespace {
+//section 2.3.4.2.1.8
+void writePROJECTHELPCONTEXT(SvStream& rStrm)
+{
+ rStrm.WriteUInt16(0x0007); // id
+ rStrm.WriteUInt32(0x00000004); // size
+ rStrm.WriteUInt32(0x00000000); // HelpContext
+}
+
//section 2.3.4.2.1.7
void writePROJECTHELPFILEPATH(SvStream& rStrm)
{
@@ -115,6 +123,7 @@ void writePROJECTINFORMATION(SvStream& rStrm)
writePROJECTNAME(rStrm);
writePROJECTDOCSTRING(rStrm);
writePROJECTHELPFILEPATH(rStrm);
+ writePROJECTHELPCONTEXT(rStrm);
}
// section 2.3.4.2
commit 1b2d7920ef77b28120e6df25c79031eef37d1b3c
Author: Rosemary <rosemaryseb8 at gmail.com>
Date: Sun Aug 9 16:36:28 2015 +0530
PROJECT HELP FILE PATH record
Conflicts:
oox/source/ole/vbaexport.cxx
Change-Id: I2f76089170e818b2fe311817b64b54dbb49c7e24
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 66522db..548bd58 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -41,6 +41,19 @@ void exportString(SvStream& rStrm, const OUString& rString)
rStrm.WriteOString(aStringCorrectCodepage);
}
+}
+
+namespace {
+
+//section 2.3.4.2.1.7
+void writePROJECTHELPFILEPATH(SvStream& rStrm)
+{
+ rStrm.WriteUInt16(0x0006); // id
+ rStrm.WriteUInt32(0x00000000); // sizeOfHelpFile1
+ rStrm.WriteUInt16(0x003D); // Reserved
+ rStrm.WriteUInt32(0x00000000); // sizeOfHelpFile2
+}
+
//section 2.3.4.2.1.6
void writePROJECTDOCSTRING(SvStream& rStrm)
{
@@ -101,6 +114,7 @@ void writePROJECTINFORMATION(SvStream& rStrm)
writePROJECTCODEPAGE(rStrm);
writePROJECTNAME(rStrm);
writePROJECTDOCSTRING(rStrm);
+ writePROJECTHELPFILEPATH(rStrm);
}
// section 2.3.4.2
commit ab9e487632fd7aece28fe421da06cec4faf2ed68
Author: Rosemary <rosemaryseb8 at gmail.com>
Date: Sun Aug 9 16:20:37 2015 +0530
PROJECTDOCSTRING record
Conflicts:
oox/source/ole/vbaexport.cxx
Change-Id: Id315749fbc5d72f3af4dc5bcd876060e369247b0
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index f8752ac..66522db 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -41,13 +41,22 @@ void exportString(SvStream& rStrm, const OUString& rString)
rStrm.WriteOString(aStringCorrectCodepage);
}
+//section 2.3.4.2.1.6
+void writePROJECTDOCSTRING(SvStream& rStrm)
+{
+ rStrm.WriteUInt16(0x0005); // id
+ rStrm.WriteUInt32(0x00000000); // sizeOfDocString
+ rStrm.WriteUInt16(0x0040); // Reserved
+ rStrm.WriteUInt32(0x00000000); // sizeOfDocStringUnicode, MUST be even
+}
+
//section 2.3.4.2.1.5
void writePROJECTNAME(SvStream& rStrm)
{
rStrm.WriteUInt16(0x0004); // id
sal_uInt32 sizeOfProjectName = 0x0000000a; // for project name "VBAProject"
rStrm.WriteUInt32(sizeOfProjectName); // sizeOfProjectName
- //characters of "VBAProject"
+ //characters of "VBAProject" in MBCS character encodings
exportString(rStrm, "VBAProject");
}
@@ -91,6 +100,7 @@ void writePROJECTINFORMATION(SvStream& rStrm)
writePROJECTLCIDINVOKE(rStrm);
writePROJECTCODEPAGE(rStrm);
writePROJECTNAME(rStrm);
+ writePROJECTDOCSTRING(rStrm);
}
// section 2.3.4.2
More information about the Libreoffice-commits
mailing list