]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/longlong.cpp
Applied [ 1223122 ] [wxMSW] Proper repainting when resizing - take 2
[wxWidgets.git] / src / common / longlong.cpp
index aa40465563c3c8b3e3972acc09dcbb0ff25c5977..9334dcc3f478e2c0c80987423337e63326d5847b 100644 (file)
@@ -35,6 +35,8 @@
 #include <memory.h>     // for memset()
 #endif
 
+#include "wx/ioswrap.h"
+
 // ============================================================================
 // implementation
 // ============================================================================
@@ -1092,24 +1094,24 @@ void *wxULongLongWx::asArray(void) const
                                                                      \
         name ll = *this;                                             \
                                                                      \
-        bool neg;                                                    \
-        if ( ll < 0 )                                                \
+        bool neg = ll < 0;                                           \
+        if ( neg )                                                   \
         {                                                            \
-            ll.Negate();                                             \
-            neg = true;                                              \
+            while ( ll != 0 )                                        \
+            {                                                        \
+                long digit = (ll % 10).ToLong();                     \
+                result.Prepend((wxChar)(_T('0') - digit));           \
+                ll /= 10;                                            \
+            }                                                        \
         }                                                            \
         else                                                         \
         {                                                            \
-            neg = false;                                             \
-        }                                                            \
-                                                                     \
-        while ( ll != 0 )                                            \
-        {                                                            \
-            long digit = (ll % 10).ToLong();                         \
-            if ( neg )                                               \
-                digit = -digit;                                      \
-            result.Prepend((wxChar)(_T('0') + digit));               \
-            ll /= 10;                                                \
+            while ( ll != 0 )                                        \
+            {                                                        \
+                long digit = (ll % 10).ToLong();                     \
+                result.Prepend((wxChar)(_T('0') + digit));           \
+                ll /= 10;                                            \
+            }                                                        \
         }                                                            \
                                                                      \
         if ( result.empty() )                                        \