summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosemary <rosemaryseb8@gmail.com>2015-09-27 13:58:07 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-09-29 08:02:52 +0200
commitd35adb0835eb57ca6ef0576781a87d829c2689d0 (patch)
treee08f717941af453d02fe29cf4e924ba6c1cc746c
parentc665002bf194c0cbe180aef3f5c41c1872d4e3cd (diff)
Retain the original project name
Only the default project name is VBAProject. Change-Id: I11bfee4d395b79b86a944bf9b6809ef2215eb9c1
-rw-r--r--oox/source/ole/vbaexport.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/oox/source/ole/vbaexport.cxx b/oox/source/ole/vbaexport.cxx
index 9f8a5dc1a0c0..83b23245c701 100644
--- a/oox/source/ole/vbaexport.cxx
+++ b/oox/source/ole/vbaexport.cxx
@@ -376,12 +376,12 @@ void writePROJECTCODEPAGE(SvStream& rStrm)
}
//section 2.3.4.2.1.5
-void writePROJECTNAME(SvStream& rStrm)
+void writePROJECTNAME(SvStream& rStrm, const OUString& name)
{
rStrm.WriteUInt16(0x0004); // id
- sal_uInt32 sizeOfProjectName = 0x0000000a; // for project name "VBAProject"
+ sal_uInt32 sizeOfProjectName = name.getLength(); // for project name "VBAProject"
rStrm.WriteUInt32(sizeOfProjectName); // sizeOfProjectName
- exportString(rStrm, "VBAProject"); // ProjectName
+ exportString(rStrm, name); // ProjectName
}
//section 2.3.4.2.1.6
@@ -437,13 +437,13 @@ void writePROJECTCONSTANTS(SvStream& rStrm)
}
// section 2.3.4.2.1
-void writePROJECTINFORMATION(SvStream& rStrm)
+void writePROJECTINFORMATION(SvStream& rStrm, const OUString& projectName)
{
writePROJECTSYSKIND(rStrm);
writePROJECTLCID(rStrm);
writePROJECTLCIDINVOKE(rStrm);
writePROJECTCODEPAGE(rStrm);
- writePROJECTNAME(rStrm);
+ writePROJECTNAME(rStrm, projectName);
writePROJECTDOCSTRING(rStrm);
writePROJECTHELPFILEPATH(rStrm);
writePROJECTHELPCONTEXT(rStrm);
@@ -613,11 +613,11 @@ void writePROJECTMODULES(SvStream& rStrm, css::uno::Reference<css::container::XN
}
// section 2.3.4.2
-void exportDirStream(SvStream& rStrm, css::uno::Reference<css::container::XNameContainer> xNameContainer, const std::vector<sal_Int32>& rLibraryMap)
+void exportDirStream(SvStream& rStrm, css::uno::Reference<css::container::XNameContainer> xNameContainer, const std::vector<sal_Int32>& rLibraryMap, const OUString& projectName)
{
SvMemoryStream aDirStream(4096, 4096);
- writePROJECTINFORMATION(aDirStream);
+ writePROJECTINFORMATION(aDirStream, projectName);
writePROJECTREFERENCES(aDirStream);
writePROJECTMODULES(aDirStream, xNameContainer, rLibraryMap);
aDirStream.WriteUInt16(0x0010); // terminator
@@ -912,7 +912,7 @@ void VbaExport::exportVBA(SotStorage* pRootStorage)
OUString aDirPath = "/home/moggi/Documents/testfiles/vba/VBA/dir";
addFileStreamToSotStream(aDirPath, pDirStream);
#else
- exportDirStream(*pDirStream, xNameContainer, aLibraryMap);
+ exportDirStream(*pDirStream, xNameContainer, aLibraryMap, getProjectName());
#endif
#if VBA_USE_ORIGINAL_PROJECT_STREAM