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:
@@ -76,13 +76,23 @@ public:
|
||||
|
||||
wxPGChoices m_boolChoices;
|
||||
|
||||
// Some shared variants
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
wxVariant m_vEmptyString;
|
||||
wxVariant m_vZero;
|
||||
wxVariant m_vMinusOne;
|
||||
wxVariant m_vTrue;
|
||||
wxVariant m_vFalse;
|
||||
#else
|
||||
const wxVariant m_vEmptyString;
|
||||
const wxVariant m_vZero;
|
||||
const wxVariant m_vMinusOne;
|
||||
const wxVariant m_vTrue;
|
||||
const wxVariant m_vFalse;
|
||||
#endif // WXWIN_COMPATIBILITY_3_0
|
||||
|
||||
// Cached constant strings
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
wxPGCachedString m_strstring;
|
||||
wxPGCachedString m_strlong;
|
||||
wxPGCachedString m_strbool;
|
||||
@@ -93,6 +103,19 @@ public:
|
||||
wxPGCachedString m_strMax;
|
||||
wxPGCachedString m_strUnits;
|
||||
wxPGCachedString m_strHint;
|
||||
#else
|
||||
const wxString m_strstring;
|
||||
const wxString m_strlong;
|
||||
const wxString m_strbool;
|
||||
const wxString m_strlist;
|
||||
|
||||
const wxString m_strDefaultValue;
|
||||
const wxString m_strMin;
|
||||
const wxString m_strMax;
|
||||
const wxString m_strUnits;
|
||||
const wxString m_strHint;
|
||||
#endif // WXWIN_COMPATIBILITY_3_0
|
||||
|
||||
#if wxPG_COMPATIBILITY_1_4
|
||||
wxPGCachedString m_strInlineHelp;
|
||||
#endif
|
||||
|
@@ -279,8 +279,9 @@ typedef int (*wxPGSortCallback)(wxPropertyGrid* propGrid,
|
||||
wxPGProperty* p2);
|
||||
|
||||
|
||||
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
typedef wxString wxPGCachedString;
|
||||
#endif
|
||||
|
||||
/** @}
|
||||
*/
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user