]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/log.cpp
Partially applied patch [ 763900 ] fix for vertical toolbar
[wxWidgets.git] / src / common / log.cpp
index 53de91f0468de6fd0058ebe7643ca95f0e00ef91..897ee542a51cd7bb287f37f0ca43c1804344e079 100644 (file)
@@ -33,6 +33,7 @@
 // wxWindows
 #ifndef WX_PRECOMP
     #include "wx/app.h"
+    #include "wx/arrstr.h"
     #include "wx/intl.h"
     #include "wx/string.h"
 #endif //WX_PRECOMP
 #include <stdlib.h>
 #include <time.h>
 
+#if defined(__WINDOWS__)
+    #include "wx/msw/private.h" // includes windows.h
+#endif
+
 // ----------------------------------------------------------------------------
 // non member functions
 // ----------------------------------------------------------------------------
@@ -380,7 +385,7 @@ wxLog *wxLog::GetActiveTarget()
 
             // ask the application to create a log target for us
             if ( wxTheApp != NULL )
-                ms_pLogger = wxTheApp->CreateLogTarget();
+                ms_pLogger = wxTheApp->GetTraits()->CreateLogTarget();
             else
                 ms_pLogger = new wxLogStderr;
 
@@ -421,7 +426,7 @@ void wxLog::RemoveTraceMask(const wxString& str)
 {
     int index = ms_aTraceMasks.Index(str);
     if ( index != wxNOT_FOUND )
-        ms_aTraceMasks.Remove((size_t)index);
+        ms_aTraceMasks.RemoveAt((size_t)index);
 }
 
 void wxLog::ClearTraceMasks()
@@ -493,6 +498,16 @@ void wxLog::Flush()
     // nothing to do here
 }
 
+/*static*/ bool wxLog::IsAllowedTraceMask(const wxChar *mask)
+{
+    for ( wxArrayString::iterator it = ms_aTraceMasks.begin(),
+                                  en = ms_aTraceMasks.end();
+         it != en; ++it )
+        if ( *it == mask)
+            return true;
+    return false;
+}
+
 // ----------------------------------------------------------------------------
 // wxLogStderr class implementation
 // ----------------------------------------------------------------------------