fixed last commit to not break ToString() for negative numbers but still fix it for wxLongLong(LONG_MIN, 0) for which Negate() doesn't work
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1092,24 +1092,24 @@ void *wxULongLongWx::asArray(void) const
|
|||||||
\
|
\
|
||||||
name ll = *this; \
|
name ll = *this; \
|
||||||
\
|
\
|
||||||
bool neg; \
|
bool neg = ll < 0; \
|
||||||
if ( ll < 0 ) \
|
if ( neg ) \
|
||||||
{ \
|
{ \
|
||||||
ll.Negate(); \
|
while ( ll != 0 ) \
|
||||||
neg = true; \
|
{ \
|
||||||
|
long digit = (ll % 10).ToLong(); \
|
||||||
|
result.Prepend((wxChar)(_T('0') - digit)); \
|
||||||
|
ll /= 10; \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
neg = false; \
|
while ( ll != 0 ) \
|
||||||
} \
|
{ \
|
||||||
\
|
long digit = (ll % 10).ToLong(); \
|
||||||
while ( ll != 0 ) \
|
result.Prepend((wxChar)(_T('0') + digit)); \
|
||||||
{ \
|
ll /= 10; \
|
||||||
long digit = (ll % 10).ToLong(); \
|
} \
|
||||||
if ( neg ) \
|
|
||||||
digit = -digit; \
|
|
||||||
result.Prepend((wxChar)(_T('0') + digit)); \
|
|
||||||
ll /= 10; \
|
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
if ( result.empty() ) \
|
if ( result.empty() ) \
|
||||||
|
|||||||
Reference in New Issue
Block a user