1
0
forked from mirrors/0ad

Fix tooltip crash/corruption, caused by inconsistently changing types.

This was SVN commit r8931.
This commit is contained in:
Ykkrosh
2011-02-18 22:36:39 +00:00
parent a9e920a467
commit 387b801aed
9 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ CButton::CButton()
AddSetting(GUIST_CColor, "textcolor_over");
AddSetting(GUIST_CColor, "textcolor_pressed");
AddSetting(GUIST_CColor, "textcolor_disabled");
AddSetting(GUIST_CStr, "tooltip");
AddSetting(GUIST_CStrW, "tooltip");
AddSetting(GUIST_CStr, "tooltip_style");
// Add text
+1 -1
View File
@@ -50,7 +50,7 @@ CCheckBox::CCheckBox()
AddSetting(GUIST_CColor, "textcolor_over");
AddSetting(GUIST_CColor, "textcolor_pressed");
AddSetting(GUIST_CColor, "textcolor_disabled");
AddSetting(GUIST_CStr, "tooltip");
AddSetting(GUIST_CStrW, "tooltip");
AddSetting(GUIST_CStr, "tooltip_style");
// Add text
+1 -1
View File
@@ -33,7 +33,7 @@ CImage::CImage()
{
AddSetting(GUIST_CGUISpriteInstance, "sprite");
AddSetting(GUIST_int, "cell_id");
AddSetting(GUIST_CStr, "tooltip");
AddSetting(GUIST_CStrW, "tooltip");
AddSetting(GUIST_CStr, "tooltip_style");
}
+1 -1
View File
@@ -52,7 +52,7 @@ CInput::CInput() : m_iBufferPos(-1), m_iBufferPos_Tail(-1), m_SelectingText(fals
AddSetting(GUIST_CGUISpriteInstance, "sprite_selectarea");
AddSetting(GUIST_CColor, "textcolor");
AddSetting(GUIST_CColor, "textcolor_selected");
AddSetting(GUIST_CStr, "tooltip");
AddSetting(GUIST_CStrW, "tooltip");
AddSetting(GUIST_CStr, "tooltip_style");
// Add scroll-bar
+1 -1
View File
@@ -47,7 +47,7 @@ CList::CList()
AddSetting(GUIST_CColor, "textcolor");
AddSetting(GUIST_CColor, "textcolor_selected");
AddSetting(GUIST_int, "selected"); // Index selected. -1 is none.
AddSetting(GUIST_CStr, "tooltip");
AddSetting(GUIST_CStrW, "tooltip");
AddSetting(GUIST_CStr, "tooltip_style");
// Each list item has both a name (in 'list') and an associated data string (in 'list_data')
AddSetting(GUIST_CGUIList, "list");
+1 -1
View File
@@ -34,7 +34,7 @@ CProgressBar::CProgressBar()
AddSetting(GUIST_CGUISpriteInstance, "sprite_background");
AddSetting(GUIST_CGUISpriteInstance, "sprite_bar");
AddSetting(GUIST_float, "caption"); // aka value from 0 to 100
AddSetting(GUIST_CStr, "tooltip");
AddSetting(GUIST_CStrW, "tooltip");
AddSetting(GUIST_CStr, "tooltip_style");
}
+3 -3
View File
@@ -44,11 +44,11 @@ CText::CText()
AddSetting(GUIST_EAlign, "text_align");
AddSetting(GUIST_EVAlign, "text_valign");
AddSetting(GUIST_CColor, "textcolor");
AddSetting(GUIST_CStr, "tooltip");
AddSetting(GUIST_CStrW, "tooltip");
AddSetting(GUIST_CStr, "tooltip_style");
//Private settings
AddSetting(GUIST_CStr, "_icon_tooltip");
// Private settings
AddSetting(GUIST_CStrW, "_icon_tooltip");
AddSetting(GUIST_CStr, "_icon_tooltip_style");
//GUI<bool>::SetSetting(this, "ghost", true);
+4 -4
View File
@@ -90,8 +90,8 @@ bool GUITooltip::GetTooltip(IGUIObject* obj, CStr& style)
if (GUI<CStr>::GetSetting(obj, "_icon_tooltip_style", style) == PSRETURN_OK)
{
// Check if icon tooltip text exists
CStr text;
if (GUI<CStr>::GetSetting(obj, "_icon_tooltip", text) == PSRETURN_OK)
CStrW text;
if (GUI<CStrW>::GetSetting(obj, "_icon_tooltip", text) == PSRETURN_OK)
{
if (text.empty())
{
@@ -113,8 +113,8 @@ bool GUITooltip::GetTooltip(IGUIObject* obj, CStr& style)
else if (obj && obj->SettingExists("tooltip_style")
&& GUI<CStr>::GetSetting(obj, "tooltip_style", style) == PSRETURN_OK)
{
CStr text;
if (GUI<CStr>::GetSetting(obj, "tooltip", text) == PSRETURN_OK)
CStrW text;
if (GUI<CStrW>::GetSetting(obj, "tooltip", text) == PSRETURN_OK)
{
if (text.empty())
{
+1 -1
View File
@@ -55,7 +55,7 @@ CMiniMap::CMiniMap() :
{
AddSetting(GUIST_CColor, "fov_wedge_color");
AddSetting(GUIST_bool, "circular");
AddSetting(GUIST_CStr, "tooltip");
AddSetting(GUIST_CStrW, "tooltip");
AddSetting(GUIST_CStr, "tooltip_style");
m_Clicking = false;
m_Hovering = false;