corrected the direction of comparisons between wxString and char/wxChar strings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -561,12 +561,20 @@ typedef int wxWindowID;
|
||||
#define wxFOR_ALL_COMPARISONS_3(m, x, y, z) \
|
||||
m(==,x,y,z) m(!=,x,y,z) m(>=,x,y,z) m(<=,x,y,z) m(>,x,y,z) m(<,x,y,z)
|
||||
|
||||
/*
|
||||
This is only used with wxDEFINE_COMPARISON_REV: it passes both the normal
|
||||
and the reversed comparison operators to the macro.
|
||||
*/
|
||||
#define wxFOR_ALL_COMPARISONS_3_REV(m, x, y, z) \
|
||||
m(==,x,y,z,==) m(!=,x,y,z,!=) m(>=,x,y,z,<=) \
|
||||
m(<=,x,y,z,>=) m(>,x,y,z,<) m(<,x,y,z,>)
|
||||
|
||||
|
||||
#define wxDEFINE_COMPARISON(op, T1, T2, cmp) \
|
||||
inline bool operator op(T1 x, T2 y) { return cmp(x, y, op); }
|
||||
|
||||
#define wxDEFINE_COMPARISON_REV(op, T1, T2, cmp) \
|
||||
inline bool operator op(T2 y, T1 x) { return cmp(x, y, op); }
|
||||
#define wxDEFINE_COMPARISON_REV(op, T1, T2, cmp, oprev) \
|
||||
inline bool operator op(T2 y, T1 x) { return cmp(x, y, oprev); }
|
||||
|
||||
/*
|
||||
Define all 6 comparison operators (==, !=, <, <=, >, >=) for the given
|
||||
@@ -586,7 +594,7 @@ typedef int wxWindowID;
|
||||
*/
|
||||
#define wxDEFINE_ALL_COMPARISONS(T1, T2, cmp) \
|
||||
wxFOR_ALL_COMPARISONS_3(wxDEFINE_COMPARISON, T1, T2, cmp) \
|
||||
wxFOR_ALL_COMPARISONS_3(wxDEFINE_COMPARISON_REV, T1, T2, cmp)
|
||||
wxFOR_ALL_COMPARISONS_3_REV(wxDEFINE_COMPARISON_REV, T1, T2, cmp)
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* macros to avoid compiler warnings */
|
||||
|
@@ -2427,7 +2427,7 @@ private:
|
||||
// wxString comparison functions: operator versions are always case sensitive
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#define wxCMP_WXCHAR_STRING(p, s, op) s.Cmp(p) op 0
|
||||
#define wxCMP_WXCHAR_STRING(p, s, op) 0 op s.Cmp(p)
|
||||
|
||||
wxDEFINE_ALL_COMPARISONS(const wxChar *, const wxString&, wxCMP_WXCHAR_STRING)
|
||||
|
||||
|
Reference in New Issue
Block a user