From b6ed783b0b81d0af845744e991a8f729bbf23ccd Mon Sep 17 00:00:00 2001 From: kyokomi Date: Tue, 17 Jun 2014 17:05:44 +0900 Subject: [PATCH] fix use raw char* to represent string. --- .../cocostudio/WidgetReader/TextReader/TextReader.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp index c76f562f19..9877354a8a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -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");