From 152aacc41e3fe21f69930863a39cdf63835e47f6 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 18 Aug 2012 01:30:52 +0200 Subject: [PATCH] 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 :( --HG-- branch : gsoc2012-gui-editor --- code/nel/src/gui/view_text.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index 818ca8c35..0b082262e 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -544,7 +544,10 @@ namespace NLGUI 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 "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() ); return node; @@ -2708,6 +2711,8 @@ namespace NLGUI // *************************************************************************** void CViewText::setTextFormatTaged(const ucstring &text) { + if( text.empty() ) + return; // to allow cache (avoid infinite recurse in updateCoords() in some case), compute in temp ucstring tempText; @@ -2794,6 +2799,9 @@ namespace NLGUI void CViewText::setSingleLineTextFormatTaged(const ucstring &text) { + if( text.empty() ) + return; + // to allow cache (avoid infinite recurse in updateCoords() in some case), compute in temp ucstring tempText; static std::vector tempLetterColors;