summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/ole/vbaexport.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index b9c9676b5d38..904056d6a18d 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -778,10 +778,11 @@ void VbaExport::exportVBA(SotStorage* pRootStorage)
// start here with the VBA export
SotStorage* pVBAStream = pRootStorage->OpenSotStorage("VBA", STREAM_READWRITE);
SotStorageStream* pDirStream = pVBAStream->OpenSotStream("dir", STREAM_READWRITE);
- SotStorageStream* pModuleStream[n];
+ std::vector<SotStorageStream*> aModuleStreams;
+ aModuleStreams.reserve(n);
for (sal_Int32 i = 0; i < n; ++i)
{
- pModuleStream[i] = pVBAStream->OpenSotStream(aElementNames[i], STREAM_READWRITE);
+ aModuleStreams.push_back(pVBAStream->OpenSotStream(aElementNames[i], STREAM_READWRITE));
}
SotStorageStream* pVBAProjectStream = pVBAStream->OpenSotStream("_VBA_PROJECT", STREAM_READWRITE);
SotStorageStream* pPROJECTStream = pRootStorage->OpenSotStream("PROJECT", STREAM_READWRITE);
@@ -795,7 +796,7 @@ void VbaExport::exportVBA(SotStorage* pRootStorage)
css::uno::Any aCode = xNameContainer->getByName(aElementNames[i]);
OUString aSourceCode;
aCode >>= aSourceCode;
- exportModuleStream(*pModuleStream[i], aSourceCode, aElementNames[i]);
+ exportModuleStream(*aModuleStreams[i], aSourceCode, aElementNames[i]);
}
exportVBAProjectStream(*pVBAProjectStream);
exportPROJECTStream(*pPROJECTStream, xNameContainer, getProjectName());
@@ -804,7 +805,7 @@ void VbaExport::exportVBA(SotStorage* pRootStorage)
pVBAProjectStream->Commit();
for(sal_Int32 i = 0; i < n; i++)
{
- pModuleStream[i]->Commit();
+ aModuleStreams[i]->Commit();
}
pDirStream->Commit();
pVBAStream->Commit();