fix use raw char* to represent string.

This commit is contained in:
kyokomi 2014-06-17 17:05:44 +09:00
parent d7199204bd
commit b6ed783b0b
1 changed files with 3 additions and 4 deletions

View File

@ -51,10 +51,9 @@ namespace cocostudio
bool fn = DICTOOL->checkObjectExist_json(options, "fontName");
if (fn)
{
std::string tp_c = jsonPath;
const char* cmfPath = DICTOOL->getStringValue_json(options, "fontName");
const char* cmf_tp = tp_c.append(cmfPath).c_str();
label->setFontName(cmf_tp);
std::string fontName = DICTOOL->getStringValue_json(options, "fontName");
std::string fontFilePath = jsonPath.append(fontName);
label->setFontName(fontFilePath);
}
bool aw = DICTOOL->checkObjectExist_json(options, "areaWidth");
bool ah = DICTOOL->checkObjectExist_json(options, "areaHeight");