[Libreoffice-commits] core.git: Branch 'feature/vba-export' - oox/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Wed Sep 9 09:47:46 PDT 2015
oox/source/ole/vbaexport.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit e9246530f37f7d911096bf769359d04801afa87c
Author: Markus Mohrhard <markus.mohrhard at 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);
More information about the Libreoffice-commits
mailing list