Merge pull request #15690 from halx99/patch-2

change if (fontName.c_str()) to if(!fontName.empty())
This commit is contained in:
minggo 2016-05-23 16:04:14 +08:00
commit 16a1605927
1 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ public:
} }
bool setFont(const char * pFontName = nullptr, int nSize = 0) bool setFont(const char * pFontName = "", int nSize = 0)
{ {
bool bRet = false; bool bRet = false;
do do
@ -110,7 +110,7 @@ public:
LOGFONTA tNewFont = {0}; LOGFONTA tNewFont = {0};
LOGFONTA tOldFont = {0}; LOGFONTA tOldFont = {0};
GetObjectA(hDefFont, sizeof(tNewFont), &tNewFont); GetObjectA(hDefFont, sizeof(tNewFont), &tNewFont);
if (fontName.c_str()) if (!fontName.empty())
{ {
// create font from ttf file // create font from ttf file
if (FileUtils::getInstance()->getFileExtension(fontName) == ".ttf") if (FileUtils::getInstance()->getFileExtension(fontName) == ".ttf")