[Libreoffice-commits] core.git: oox/source

Caolán McNamara caolanm at redhat.com
Thu Sep 10 02:23:38 PDT 2015


 oox/source/ole/vbaexport.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit f19402658dce6944e82a9058a6888e488b37b336
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 10 10:22:59 2015 +0100

    fix windows build
    
    Change-Id: Ibd768bef633de63ad3f7e826eb8044e04c1159ae

diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index b9c9676..904056d 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();


More information about the Libreoffice-commits mailing list