summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-09-09 03:54:51 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-09-10 04:14:54 +0200
commit86283974755da47aec47779c18ccddd794d5fc4f (patch)
tree1d46d1a512c281998469bd6781fed38ce8640942 /sc
parent0c6da7fb3eb951fcd0c8fb31dbff1562f75289e9 (diff)
copy the vba stream to the xlsx file
Change-Id: I48d4a37a35e047b6f26b7d1da03e2d423cab1241
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xestream.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 76da6b503e0b..1184cfeee468 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -59,6 +59,7 @@
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <memory>
+#include <comphelper/storagehelper.hxx>
#define DEBUG_XL_ENCRYPTION 0
@@ -1094,9 +1095,15 @@ bool XclExpXmlStream::exportDocument()
if (aExport.containsVBAProject())
{
const OUString aVbaStreamLocation("/tmp/vba_out.bin");
- SvFileStream aVbaStream(aVbaStreamLocation, STREAM_READWRITE);
+ SvMemoryStream aVbaStream(4096, 4096);
tools::SvRef<SotStorage> pVBAStorage(new SotStorage(aVbaStream));
aExport.exportVBA(pVBAStorage);
+ aVbaStream.Seek(0);
+ css::uno::Reference<css::io::XInputStream> xVBAStream(
+ new utl::OInputStreamWrapper(aVbaStream));
+ css::uno::Reference<css::io::XOutputStream> xVBAOutput =
+ openFragmentStream("xl/vbaProject.bin", "VBA");
+ comphelper::OStorageHelper::CopyInputToOutput(xVBAStream, xVBAOutput);
}
// destruct at the end of the block