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

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Aug 10 07:09:57 PDT 2015


 oox/source/ole/vbaexport.cxx |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit c04be764b851cd04d6e27430a594bb9a51c332a2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Aug 10 16:08:42 2015 +0200

    better string export
    
    Change-Id: I85a4f0aaaa51a473214c3b7f1f5463a268973f0f

diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 35ebdd5..f8752ac 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -35,6 +35,12 @@ VbaExport::VbaExport(css::uno::Reference<css::frame::XModel> xModel):
 
 namespace {
 
+void exportString(SvStream& rStrm, const OUString& rString)
+{
+    OString aStringCorrectCodepage = OUStringToOString(rString, CODEPAGE);
+    rStrm.WriteOString(aStringCorrectCodepage);
+}
+
 //section 2.3.4.2.1.5
 void writePROJECTNAME(SvStream& rStrm)
 {
@@ -42,16 +48,7 @@ void writePROJECTNAME(SvStream& rStrm)
     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');
+    exportString(rStrm, "VBAProject");
 }
 
 // section 2.3.4.2.1.4


More information about the Libreoffice-commits mailing list