]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/statbar.cpp
wxHashMap does not take the key type as constructor argument.
[wxWidgets.git] / src / common / statbar.cpp
index 6780e01309fd1ecb188158eb2d86c84e07e1e1aa..984a9e127828edad75530babd3fb9060908c7c2c 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "statbar.h"
 #endif
 
@@ -234,7 +234,8 @@ void wxStatusBarBase::FreeStacks()
     {
         if(m_statusTextStacks[i])
         {
-            m_statusTextStacks[i]->Clear();
+            wxListString& t = *m_statusTextStacks[i];
+            WX_CLEAR_LIST(wxListString, t);
             delete m_statusTextStacks[i];
         }
     }
@@ -249,7 +250,11 @@ void wxStatusBarBase::FreeStacks()
 void wxStatusBarBase::PushStatusText(const wxString& text, int number)
 {
     wxListString* st = GetOrCreateStatusStack(number);
-    st->Insert(new wxString(GetStatusText(number)));
+    // This long-winded way around avoids an internal compiler error
+    // in VC++ 6 with RTTI enabled
+    wxString tmp1(GetStatusText(number));
+    wxString* tmp = new wxString(tmp1);
+    st->Insert(tmp);
     SetStatusText(text, number);
 }
 
@@ -257,10 +262,11 @@ void wxStatusBarBase::PopStatusText(int number)
 {
     wxListString *st = GetStatusStack(number);
     wxCHECK_RET( st, _T("Unbalanced PushStatusText/PopStatusText") );
-    wxListString::Node *top = st->GetFirst();
+    wxListString::compatibility_iterator top = st->GetFirst();
 
     SetStatusText(*top->GetData(), number);
-    st->DeleteNode(top);
+    delete top->GetData();
+    st->Erase(top);
     if(st->GetCount() == 0)
     {
         delete st;
@@ -288,7 +294,6 @@ wxListString *wxStatusBarBase::GetOrCreateStatusStack(int i)
     if(!m_statusTextStacks[i])
     {
         m_statusTextStacks[i] = new wxListString();
-        m_statusTextStacks[i]->DeleteContents(TRUE);
     }
 
     return m_statusTextStacks[i];