]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/longlong.cpp
fixed refresh problem with holidays in wxCalendarCtrl
[wxWidgets.git] / src / common / longlong.cpp
index 6a0cc8e315a4c91eddd175f102fe634fb649dfa3..5fd1016b5f3b0801fe2330aeebb14c156c1f30a3 100644 (file)
@@ -91,34 +91,26 @@ wxLongLongWx& wxLongLongWx::Assign(double d)
 {
     bool positive = d >= 0;
     d = fabs(d);
-    if ( d <= LONG_MAX )
+    if ( d <= ULONG_MAX )
     {
         m_hi = 0;
         m_lo = (long)d;
     }
     else
     {
-#if 0
-        m_lo = (long)d;
-        d -= m_lo;
-        d /=  0x1000;
-        d /=  0x1000;
-        d /=  0x100;
-        m_hi = (long)d;
-#else
-        wxFAIL_MSG(_T("TODO"));
-#endif
+        m_hi = (unsigned long)(d / (1.0 + (double)ULONG_MAX));
+        m_lo = (unsigned long)(d - ((double)m_hi * (1.0 + (double)ULONG_MAX)));
     }
 
-    if ( !positive )
-        m_hi = -m_hi;
-
 #ifdef wxLONGLONG_TEST_MODE
     m_ll = (wxLongLong_t)d;
 
     Check();
 #endif // wxLONGLONG_TEST_MODE
 
+    if ( !positive )
+        Negate();
+
     return *this;
 }