]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlwin.cpp
use type safe list instead of wxList for m_columns
[wxWidgets.git] / src / html / htmlwin.cpp
index 9db304ff227e1b7d41951b8f0a2b501c2edaa1d9..00c0fb737722a084120d2388daee919a652ef227 100644 (file)
@@ -306,10 +306,15 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
     {
         int c = m_History->GetCount() - (m_HistoryPos + 1);
 
     {
         int c = m_History->GetCount() - (m_HistoryPos + 1);
 
-        m_HistoryPos++;
-        for (int i = 0; i < c; i++)
-            m_History->Remove(m_HistoryPos);
-        m_History->Add(new wxHtmlHistoryItem(m_OpenedPage, m_OpenedAnchor));
+        if (m_HistoryPos < 0 || 
+            (*m_History)[m_HistoryPos].GetPage() != m_OpenedPage ||
+            (*m_History)[m_HistoryPos].GetAnchor() != m_OpenedAnchor)
+        {
+            m_HistoryPos++;
+            for (int i = 0; i < c; i++)
+                m_History->Remove(m_HistoryPos);
+            m_History->Add(new wxHtmlHistoryItem(m_OpenedPage, m_OpenedAnchor));
+        }
     }
 
     if (m_OpenedPageTitle == wxEmptyString)
     }
 
     if (m_OpenedPageTitle == wxEmptyString)