[Libreoffice-commits] core.git: Branch 'feature/vba-export' - 4 commits - oox/source

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Aug 10 07:03:49 PDT 2015


 oox/source/ole/vbaexport.cxx |   40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

New commits:
commit 262e5046ddf190bb105f2d2592f3766349a9f385
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Aug 10 15:47:14 2015 +0200

    0x02 is OSX, 32bit Windows is 0x01
    
    Change-Id: Ic37ed1ee67727bfad16666b76095fea71e2f4a6f

diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 46c8fe7..35ebdd5 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -83,7 +83,7 @@ void writePROJECTSYSKIND(SvStream& rStrm)
 {
     rStrm.WriteUInt16(0x0001); // id
     rStrm.WriteUInt32(0x00000004); // size
-    rStrm.WriteUInt32(0x00000002); // SysKind, hard coded to 32-bin windows for now
+    rStrm.WriteUInt32(0x00000001); // SysKind, hard coded to 32-bin windows for now
 }
 
 // section 2.3.4.2.1
commit 26485d3f7dac2df8df458a98b35f0c7409cffda9
Author: Rosemary <rosemaryseb8 at gmail.com>
Date:   Sun Aug 9 15:43:56 2015 +0530

    PROJECTNAME record
    
    Change-Id: I0a54cf38ca9b94064881e8d527d5cd4637736050

diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index bfc1060..46c8fe7 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -35,6 +35,25 @@ VbaExport::VbaExport(css::uno::Reference<css::frame::XModel> xModel):
 
 namespace {
 
+//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"
+    rStrm.WriteUChar('V');
+    rStrm.WriteUChar('B');
+    rStrm.WriteUChar('A');
+    rStrm.WriteUChar('P');
+    rStrm.WriteUChar('r');
+    rStrm.WriteUChar('o');
+    rStrm.WriteUChar('j');
+    rStrm.WriteUChar('e');
+    rStrm.WriteUChar('c');
+    rStrm.WriteUChar('t');
+}
+
 // section 2.3.4.2.1.4
 void writePROJECTCODEPAGE(SvStream& rStrm)
 {
@@ -74,6 +93,7 @@ void writePROJECTINFORMATION(SvStream& rStrm)
     writePROJECTLCID(rStrm);
     writePROJECTLCIDINVOKE(rStrm);
     writePROJECTCODEPAGE(rStrm);
+    writePROJECTNAME(rStrm);
 }
 
 // section 2.3.4.2
commit e1e292834715ed9bf0b7d99cb66d4cdf094772dd
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Aug 10 14:47:36 2015 +0200

    work on correct codepage handling
    
    Change-Id: I9daa2ee90f3f6bd284a1bfd27b648f2e41bb4e0f

diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 4533b12..bfc1060 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -18,6 +18,15 @@
 #include "oox/helper/propertyset.hxx"
 #include "oox/token/properties.hxx"
 
+#define USE_UTF8_CODEPAGE 0
+#if USE_UTF8_CODEPAGE
+#define CODEPAGE_MS 65001
+#define CODEPAGE RTL_TEXTENCODING_UTF8
+#else
+#define CODEPAGE_MS 1252
+#define CODEPAGE RTL_TEXTENCODING_MS_1252
+#endif
+
 VbaExport::VbaExport(css::uno::Reference<css::frame::XModel> xModel):
     mxModel(xModel)
 {
@@ -31,7 +40,7 @@ void writePROJECTCODEPAGE(SvStream& rStrm)
 {
     rStrm.WriteUInt16(0x0003); // id
     rStrm.WriteUInt32(0x00000002); // size
-    rStrm.WriteUInt16(1252); // CodePage
+    rStrm.WriteUInt16(CODEPAGE_MS); // CodePage
 }
 
 // section 2.3.4.2.1.3
commit c7315f58a3f86df7e93252d759428b5c0e9687a9
Author: Rosemary <rosemaryseb8 at gmail.com>
Date:   Sun Aug 9 15:29:30 2015 +0530

    PROJECT CODE PAGE record
    
    Change-Id: I4ee0a1481335a9337ba2e20b59af4e332a532174

diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 30fe32f..4533b12 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -26,6 +26,14 @@ VbaExport::VbaExport(css::uno::Reference<css::frame::XModel> xModel):
 
 namespace {
 
+// section 2.3.4.2.1.4
+void writePROJECTCODEPAGE(SvStream& rStrm)
+{
+    rStrm.WriteUInt16(0x0003); // id
+    rStrm.WriteUInt32(0x00000002); // size
+    rStrm.WriteUInt16(1252); // CodePage
+}
+
 // section 2.3.4.2.1.3
 void writePROJECTLCIDINVOKE(SvStream& rStrm)
 {
@@ -56,6 +64,7 @@ void writePROJECTINFORMATION(SvStream& rStrm)
     writePROJECTSYSKIND(rStrm);
     writePROJECTLCID(rStrm);
     writePROJECTLCIDINVOKE(rStrm);
+    writePROJECTCODEPAGE(rStrm);
 }
 
 // section 2.3.4.2


More information about the Libreoffice-commits mailing list