Use constant variables to store cached constants in wxPGGlobalVarsClass.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek
2015-01-22 17:32:48 +00:00
parent 5699e20e4e
commit cafff4405a
3 changed files with 44 additions and 24 deletions

View File

@@ -182,6 +182,25 @@ wxPGGlobalVarsClass* wxPGGlobalVars = NULL;
wxPGGlobalVarsClass::wxPGGlobalVarsClass()
// Prepare some shared variants
: m_vEmptyString(wxString())
, m_vZero((long)0)
, m_vMinusOne((long)-1)
, m_vTrue(true)
, m_vFalse(false)
// Prepare cached string constants
, m_strstring(wxS("string"))
, m_strlong(wxS("long"))
, m_strbool(wxS("bool"))
, m_strlist(wxS("list"))
, m_strDefaultValue(wxS("DefaultValue"))
, m_strMin(wxS("Min"))
, m_strMax(wxS("Max"))
, m_strUnits(wxS("Units"))
, m_strHint(wxS("Hint"))
#if wxPG_COMPATIBILITY_1_4
, m_strInlineHelp(wxS("InlineHelp"))
#endif
{
wxPGProperty::sm_wxPG_LABEL = new wxString(wxPG_LABEL_STRING);
@@ -198,29 +217,6 @@ wxPGGlobalVarsClass::wxPGGlobalVarsClass()
m_extraStyle = 0;
wxVariant v;
// Prepare some shared variants
m_vEmptyString = wxString();
m_vZero = (long) 0;
m_vMinusOne = (long) -1;
m_vTrue = true;
m_vFalse = false;
// Prepare cached string constants
m_strstring = wxS("string");
m_strlong = wxS("long");
m_strbool = wxS("bool");
m_strlist = wxS("list");
m_strDefaultValue = wxS("DefaultValue");
m_strMin = wxS("Min");
m_strMax = wxS("Max");
m_strUnits = wxS("Units");
m_strHint = wxS("Hint");
#if wxPG_COMPATIBILITY_1_4
m_strInlineHelp = wxS("InlineHelp");
#endif
m_warnings = 0;
}