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

New commits:
commit e9246530f37f7d911096bf769359d04801afa87c
Author: Markus Mohrhard <markus.mohrh...@googlemail.com>
Date:   Wed Sep 9 18:46:47 2015 +0200

    remove vba header from source code
    
    We add the header during import but should not export it.
    
    Change-Id: I2bab6b9dda50dab396fb8023212b1c6f0f035401

diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index a0434cb..517a455 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -620,11 +620,15 @@ void exportDirStream(SvStream& rStrm, 
css::uno::Reference<css::container::XNameC
 }
 
 // section 2.3.4.3 Module Stream
-void exportModuleStream(SvStream& rStrm, const OUString& aSourceCode, const 
OUString& aElementName)
+void exportModuleStream(SvStream& rStrm, const OUString& rSourceCode, const 
OUString& aElementName)
 {
     SvMemoryStream aModuleStream(4096, 4096);
 
     exportString(aModuleStream, "Attribute VB_Name = \"" + aElementName + 
"\"\r\n");
+    OUString aSourceCode = rSourceCode.replaceFirst("Option VBASupport 1\n", 
"");
+    sal_Int32 nPos = aSourceCode.indexOf("Rem Attribute VBA_ModuleType=");
+    sal_Int32 nEndPos = aSourceCode.indexOf("\n", nPos);
+    aSourceCode = aSourceCode.replaceAt(nPos, nEndPos - nPos, "");
     exportString(aModuleStream, aSourceCode);
     aModuleStream.Seek(0);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to