summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2010-10-20 12:19:56 +0200
committerKai Sommerfeld <kso@openoffice.org>2010-10-20 12:19:56 +0200
commitb7a83f057a3b3b9b7c256a6ecfb0eb9b4ea1ec74 (patch)
tree8737845ca8f7cd979c2334c654c939e13d0ed264 /l10ntools
parentd4202f9887e5eaf0de0acc59e5e7f7b961ed58a8 (diff)
#i111756# - optimized compileExtensionHelp() (patch contributed by dtardon).
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/help/HelpLinker.cxx23
1 files changed, 6 insertions, 17 deletions
diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx
index 739350e21bd3..348ca046d16c 100644
--- a/l10ntools/source/help/HelpLinker.cxx
+++ b/l10ntools/source/help/HelpLinker.cxx
@@ -696,7 +696,7 @@ void HelpLinker::link() throw( HelpProcessingException )
std::cout << std::endl;
} // try
- catch( HelpProcessingException& )
+ catch( const HelpProcessingException& )
{
// catch HelpProcessingException to avoid locking data bases
#ifndef DBHELP_ONLY
@@ -1153,31 +1153,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;