More temporary strings cleaned up.
This commit is contained in:
@ -120,22 +120,15 @@ Hyphenator *Hyphenator::getHyphenator (const char *lang)
|
|||||||
if (hyphenator)
|
if (hyphenator)
|
||||||
delete langString;
|
delete langString;
|
||||||
else {
|
else {
|
||||||
int patFileLen = strlen (DILLO_LIBDIR) + 13 + strlen (lang) + 4 + 1;
|
using namespace std::literals::string_literals;
|
||||||
char *patFile = new char[patFileLen];
|
std::string patFile= DILLO_LIBDIR + "/hyphenation/"s + lang + ".pat";
|
||||||
snprintf (patFile, patFileLen, "%s/hyphenation/%s.pat",
|
std::string excFile= DILLO_LIBDIR + "/hyphenation"s + lang + ".exc";
|
||||||
DILLO_LIBDIR, lang);
|
|
||||||
int excFileLen = strlen (DILLO_LIBDIR) + 13 + strlen (lang) + 4 + 1;
|
|
||||||
char *excFile = new char[excFileLen];
|
|
||||||
snprintf (excFile, excFileLen, "%s/hyphenation/%s.exc",
|
|
||||||
DILLO_LIBDIR, lang);
|
|
||||||
|
|
||||||
//printf ("Loading hyphenation patterns for language '%s' from '%s' and "
|
//printf ("Loading hyphenation patterns for language '%s' from '%s' and "
|
||||||
// "exceptions from '%s' ...\n", lang, patFile, excFile);
|
// "exceptions from '%s' ...\n", lang, patFile, excFile);
|
||||||
|
|
||||||
hyphenator = new Hyphenator (patFile, excFile);
|
hyphenator = new Hyphenator (patFile.c_str(), excFile.c_str());
|
||||||
hyphenators->put (langString, hyphenator);
|
hyphenators->put (langString, hyphenator);
|
||||||
delete[] patFile;
|
|
||||||
delete[] excFile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//lout::misc::StringBuffer sb;
|
//lout::misc::StringBuffer sb;
|
||||||
|
|||||||
Reference in New Issue
Block a user