]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wxchar.cpp
fixes for page positioning for notebooks with wxNB_MULTILINE style (closes bugs 70909...
[wxWidgets.git] / src / common / wxchar.cpp
index 11233ff4fd70fe9215b75ab884b0d2b2d3f57ac3..edbe661e7572ec6be452d9dc82bc04bf04891c33 100644 (file)
@@ -599,7 +599,7 @@ int vfwprintf(FILE *stream, const wxChar *format, va_list argptr)
     if ( rc != -1 )
     {
         // we can't do much better without Unicode support in libc...
-        if ( fprintf(stream, "%s", s.mb_str()) == -1 )
+        if ( fprintf(stream, "%s", (const char*)s.mb_str() ) == -1 )
             return -1;
     }
 
@@ -752,7 +752,11 @@ wxFormatConverter::wxFormatConverter(const wxChar *format)
             // precision?
             if ( *format == _T('.') )
             {
-                SkipDigits(&format);
+                CopyFmtChar(*format++);
+                if ( *format == _T('*') )
+                    CopyFmtChar(*format++);
+                else
+                    SkipDigits(&format);
             }
 
             // next we can have a size modifier
@@ -799,23 +803,14 @@ wxFormatConverter::wxFormatConverter(const wxChar *format)
                 case _T('c'):
                 case _T('s'):
                     // %c -> %lc but %hc stays %hc and %lc is still %lc
-                    switch ( size )
-                    {
-                        case Default:
-                            InsertFmtChar(_T('l'));
-                            break;
-
-                        case Short:
-                            CopyFmtChar(_T('h'));
-                            break;
-
-                        case Long:
-                            ;
-                    }
+                    if ( size == Default)
+                        InsertFmtChar(_T('l'));
                     // fall through
 
                 default:
                     // nothing special to do
+                    if ( size != Default )
+                        CopyFmtChar(*(format - 1));
                     CopyFmtChar(*format++);
             }
         }
@@ -827,6 +822,14 @@ wxFormatConverter::wxFormatConverter(const wxChar *format)
     #define wxFormatConverter(x) (x)
 #endif // wxNEED_PRINTF_CONVERSION/!wxNEED_PRINTF_CONVERSION
 
+#ifdef __WXDEBUG__
+// For testing the format converter
+wxString wxConvertFormat(const wxChar *format)
+{
+    return wxString(wxFormatConverter(format));
+}
+#endif
+
 // ----------------------------------------------------------------------------
 // wxPrintf(), wxScanf() and relatives
 // ----------------------------------------------------------------------------
@@ -1389,19 +1392,20 @@ int isascii( int c )
 }
 #endif
 
-#if defined(__WXWINCE__)
+#if defined(__WXWINCE__) && (_WIN32_WCE <= 211)
+#if (_WIN32_WCE < 300)
 void *calloc( size_t num, size_t size )
 {
     void** ptr = (void **)malloc(num * size);
     memset( ptr, 0, num * size);
     return ptr;
 }
+#endif
 
-#if (_WIN32_WCE <= 211)
 int isspace(int c)
 {
     return (c == ' ');
 }
-#endif
 
 #endif
+