CHANGED: #1471 Squashed a bug that prevented text to be displayed when hardtextformat was specified as an empty string. A.K.A hidden mines in the code. There are some more :(

This commit is contained in:
dfighter1985 2012-08-18 01:30:52 +02:00
parent 27a6716db6
commit 8fa283ca14

View file

@ -544,7 +544,10 @@ namespace NLGUI
xmlSetProp( node, BAD_CAST "clamp_right", BAD_CAST toString( _ClampRight ).c_str() ); xmlSetProp( node, BAD_CAST "clamp_right", BAD_CAST toString( _ClampRight ).c_str() );
xmlSetProp( node, BAD_CAST "auto_clamp_offset", BAD_CAST toString( _AutoClampOffset ).c_str() ); xmlSetProp( node, BAD_CAST "auto_clamp_offset", BAD_CAST toString( _AutoClampOffset ).c_str() );
xmlSetProp( node, BAD_CAST "continuous_update", BAD_CAST toString( _ContinuousUpdate ).c_str() ); xmlSetProp( node, BAD_CAST "continuous_update", BAD_CAST toString( _ContinuousUpdate ).c_str() );
xmlSetProp( node, BAD_CAST "hardtext", BAD_CAST _Text.toString().c_str() );
std::string hs = _Text.toString();
xmlSetProp( node, BAD_CAST "hardtext", BAD_CAST hs.c_str() );
xmlSetProp( node, BAD_CAST "hardtext_format", BAD_CAST _HardtextFormat.c_str() ); xmlSetProp( node, BAD_CAST "hardtext_format", BAD_CAST _HardtextFormat.c_str() );
return node; return node;
@ -2708,6 +2711,8 @@ namespace NLGUI
// *************************************************************************** // ***************************************************************************
void CViewText::setTextFormatTaged(const ucstring &text) void CViewText::setTextFormatTaged(const ucstring &text)
{ {
if( text.empty() )
return;
// to allow cache (avoid infinite recurse in updateCoords() in some case), compute in temp // to allow cache (avoid infinite recurse in updateCoords() in some case), compute in temp
ucstring tempText; ucstring tempText;
@ -2794,6 +2799,9 @@ namespace NLGUI
void CViewText::setSingleLineTextFormatTaged(const ucstring &text) void CViewText::setSingleLineTextFormatTaged(const ucstring &text)
{ {
if( text.empty() )
return;
// to allow cache (avoid infinite recurse in updateCoords() in some case), compute in temp // to allow cache (avoid infinite recurse in updateCoords() in some case), compute in temp
ucstring tempText; ucstring tempText;
static std::vector<CFormatTag> tempLetterColors; static std::vector<CFormatTag> tempLetterColors;