]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/private/wxprintf.h
Don't create multiple parent-less top level frames in layout sample.
[wxWidgets.git] / include / wx / private / wxprintf.h
index f60d9e8ea99da61c68647e87cf3e359ffcf8ef60..682adfbc50ff72667b28cb602971fdff80ac2c25 100644 (file)
 
 #include <string.h>
 
-#if defined(__MWERKS__) && __MSL__ >= 0x6000
-namespace std {}
-using namespace std ;
-#endif
-
 // prefer snprintf over sprintf
 #if defined(__VISUALC__) || \
         (defined(__BORLANDC__) && __BORLANDC__ >= 0x540)
@@ -289,7 +284,7 @@ bool wxPrintfConvSpec<CharType>::Parse(const CharType *format)
                 CHECK_PREC
                 m_szFlags[flagofs++] = char(ch);
                 break;
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
             // under Windows we support the special '%I64' notation as longlong
             // integer conversion specifier for MSVC compatibility
             // (it behaves exactly as '%lli' or '%Li' or '%qi')
@@ -308,7 +303,7 @@ bool wxPrintfConvSpec<CharType>::Parse(const CharType *format)
                     break;
                 }
                 // else: fall-through, 'I' is MSVC equivalent of C99 'z'
-#endif      // __WXMSW__
+#endif      // __WINDOWS__
 
             case wxT('z'):
             case wxT('Z'):
@@ -700,11 +695,16 @@ int wxPrintfConvSpec<CharType>::Process(CharType *buf, size_t lenMax, wxPrintfAr
         case wxPAT_PCHAR:
         case wxPAT_PWCHAR:
             {
-                wxArgNormalizedString arg(p->pad_str);
-                wxString s = arg;
-
-                if ( !arg.IsValid() && m_nMaxWidth >= 6 )
-                    s = wxT("(null)");
+                wxString s;
+                if ( !p->pad_str )
+                {
+                    if ( m_nMaxWidth >= 6 )
+                        s = wxT("(null)");
+                }
+                else if (m_type == wxPAT_PCHAR)
+                    s.assign(static_cast<const char *>(p->pad_str));
+                else // m_type == wxPAT_PWCHAR
+                    s.assign(static_cast<const wchar_t *>(p->pad_str));
 
                 typename wxPrintfStringHelper<CharType>::ConvertedType strbuf(
                         wxPrintfStringHelper<CharType>::Convert(s));