]> git.saurik.com Git - wxWidgets.git/commitdiff
made LogLastRepetitionCountIfNeeded() non static to avoid recreating the log target...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 1 Nov 2007 20:22:06 +0000 (20:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 1 Nov 2007 20:22:06 +0000 (20:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/log.h
src/common/log.cpp
src/generic/logg.cpp

index 98dbd4938bde3b6a278058662748e5b8ea407daf..a3cf858c4fa98be288b0c1693e29ef18ec11c228 100644 (file)
@@ -306,7 +306,7 @@ protected:
     // log a message indicating the number of times the previous message was
     // repeated if ms_prevCounter > 0, does nothing otherwise; return the old
     // value of ms_prevCounter
-    static unsigned LogLastRepetitionCountIfNeeded();
+    unsigned LogLastRepetitionCountIfNeeded();
 
 private:
     // static variables
index a3214b86307dd546eb8b609cc4725ee215b66272..c2a69b67142604a141ed6fd285c880bfade31390 100644 (file)
@@ -457,15 +457,13 @@ void WXDLLEXPORT wxVLogSysError(unsigned long err, const wxString& format, va_li
 // wxLog class implementation
 // ----------------------------------------------------------------------------
 
-/* static */
 unsigned wxLog::LogLastRepetitionCountIfNeeded()
 {
     wxCRIT_SECT_LOCKER(lock, ms_prevCS);
 
     const unsigned count = ms_prevCounter;
 
-    wxLog *pLogger = GetActiveTarget();
-    if ( pLogger && ms_prevCounter )
+    if ( ms_prevCounter )
     {
         wxString msg;
 #if wxUSE_INTL
@@ -479,7 +477,7 @@ unsigned wxLog::LogLastRepetitionCountIfNeeded()
 #endif
         ms_prevCounter = 0;
         ms_prevString.clear();
-        pLogger->DoLog(ms_prevLevel, msg, ms_prevTimeStamp);
+        DoLog(ms_prevLevel, msg, ms_prevTimeStamp);
     }
 
     return count;
@@ -511,7 +509,7 @@ void wxLog::OnLog(wxLogLevel level, const wxString& szString, time_t t)
                     return;
                 }
 
-                LogLastRepetitionCountIfNeeded();
+                pLogger->LogLastRepetitionCountIfNeeded();
 
                 // reset repetition counter for a new message
                 ms_prevString = szString;
index bd345d856fcea1fc8cd7e830fadc6d083d7c411d..235e067769a58e04b624eaa762ce6664726827bd 100644 (file)
@@ -275,7 +275,7 @@ void wxLogGui::Flush()
     // do it right now to block any new calls to Flush() while we're here
     m_bHasMessages = false;
 
-    const unsigned repeatCount = wxLog::LogLastRepetitionCountIfNeeded();
+    const unsigned repeatCount = LogLastRepetitionCountIfNeeded();
 
     wxString appName = wxTheApp->GetAppDisplayName();