mirror of https://github.com/axmolengine/axmol.git
Merge pull request #866 from dumganhar/iss1187_xml
fixed #1187: spanish(Buen día) cannot be shown completely in CCLabelBMFont unicode test.
This commit is contained in:
commit
7c5c583b58
|
@ -68,7 +68,8 @@ public:
|
||||||
CCDictionary *m_pRootDict;
|
CCDictionary *m_pRootDict;
|
||||||
CCDictionary *m_pCurDict;
|
CCDictionary *m_pCurDict;
|
||||||
std::stack<CCDictionary*> m_tDictStack;
|
std::stack<CCDictionary*> m_tDictStack;
|
||||||
std::string m_sCurKey;///< parsed key
|
std::string m_sCurKey; ///< parsed key
|
||||||
|
std::string m_sCurValue; // parsed value
|
||||||
CCSAXState m_tState;
|
CCSAXState m_tState;
|
||||||
CCArray* m_pArray;
|
CCArray* m_pArray;
|
||||||
|
|
||||||
|
@ -128,7 +129,7 @@ public:
|
||||||
if( sName == "dict" )
|
if( sName == "dict" )
|
||||||
{
|
{
|
||||||
m_pCurDict = new CCDictionary();
|
m_pCurDict = new CCDictionary();
|
||||||
if(! m_pRootDict)
|
if(m_eResultType == SAX_RESULT_DICT && m_pRootDict == NULL)
|
||||||
{
|
{
|
||||||
// Because it will call m_pCurDict->release() later, so retain here.
|
// Because it will call m_pCurDict->release() later, so retain here.
|
||||||
m_pRootDict = m_pCurDict;
|
m_pRootDict = m_pCurDict;
|
||||||
|
@ -262,6 +263,23 @@ public:
|
||||||
}
|
}
|
||||||
str->release();
|
str->release();
|
||||||
}
|
}
|
||||||
|
else if (sName == "string" || sName == "integer" || sName == "real")
|
||||||
|
{
|
||||||
|
CCString* pStrValue = new CCString(m_sCurValue);
|
||||||
|
|
||||||
|
if (SAX_ARRAY == curState)
|
||||||
|
{
|
||||||
|
m_pArray->addObject(pStrValue);
|
||||||
|
}
|
||||||
|
else if (SAX_DICT == curState)
|
||||||
|
{
|
||||||
|
m_pCurDict->setObject(pStrValue, m_sCurKey.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
pStrValue->release();
|
||||||
|
m_sCurValue.clear();
|
||||||
|
}
|
||||||
|
|
||||||
m_tState = SAX_NONE;
|
m_tState = SAX_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,18 +303,14 @@ public:
|
||||||
case SAX_REAL:
|
case SAX_REAL:
|
||||||
case SAX_STRING:
|
case SAX_STRING:
|
||||||
{
|
{
|
||||||
CCAssert(!m_sCurKey.empty(), "not found key : <integet/real>");
|
if (curState == SAX_DICT)
|
||||||
|
{
|
||||||
|
CCAssert(!m_sCurKey.empty(), "not found key : <integet/real>");
|
||||||
|
}
|
||||||
|
|
||||||
if (SAX_ARRAY == curState)
|
m_sCurValue.append(pText->getCString());
|
||||||
{
|
|
||||||
m_pArray->addObject(pText);
|
|
||||||
}
|
|
||||||
else if (SAX_DICT == curState)
|
|
||||||
{
|
|
||||||
m_pCurDict->setObject(pText, m_sCurKey.c_str());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue