summaryrefslogtreecommitdiff
path: root/l10ntools/source
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2010-10-11 12:27:45 +0200
committerDavid Tardon <dtardon@redhat.com>2010-10-11 12:27:45 +0200
commit6f21189b2578d8b899132226e5a8b0d2e7246089 (patch)
tree089c8c7c844356f0ab350a7fa20f9e9c0c75cfb9 /l10ntools/source
parente428247f681413bf7a2529fa98b17ccde9598ab9 (diff)
#i111756# copy arguments directly to vector
Diffstat (limited to 'l10ntools/source')
-rw-r--r--l10ntools/source/help/HelpLinker.cxx21
1 files changed, 5 insertions, 16 deletions
diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx
index 411859bfe994..5b22c3bc7f4b 100644
--- a/l10ntools/source/help/HelpLinker.cxx
+++ b/l10ntools/source/help/HelpLinker.cxx
@@ -1155,31 +1155,20 @@ HELPLINKER_DLLPUBLIC bool compileExtensionHelp
{
bool bSuccess = true;
- sal_Int32 argc = nXhpFileCount + 3;
- const char** argv = new const char*[argc];
- argv[0] = "";
- argv[1] = "-mod";
+ std::vector<std::string> args;
+ args.reserve(nXhpFileCount + 2);
+ args.push_back(std::string("-mod"));
rtl::OString aOExtensionName = rtl::OUStringToOString( aExtensionName, fs::getThreadTextEncoding() );
- argv[2] = aOExtensionName.getStr();
+ args.push_back(std::string(aOExtensionName.getStr()));
for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
{
rtl::OUString aXhpFile = pXhpFiles[iXhp];
rtl::OString aOXhpFile = rtl::OUStringToOString( aXhpFile, fs::getThreadTextEncoding() );
- char* pArgStr = new char[aOXhpFile.getLength() + 1];
- strcpy( pArgStr, aOXhpFile.getStr() );
- argv[iXhp + 3] = pArgStr;
+ args.push_back(std::string(aOXhpFile.getStr()));
}
- std::vector<std::string> args;
- for( sal_Int32 i = 1; i < argc; ++i )
- args.push_back(std::string( argv[i]) );
-
- for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
- delete[] argv[iXhp + 3];
- delete[] argv;
-
rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() );
const char* pExtensionPath = aOExtensionLanguageRoot.getStr();
std::string aStdStrExtensionPath = pExtensionPath;