const wxString& name = wxWebViewNameStr);
virtual void LoadUrl(const wxString& url);
- virtual void LoadHistoryItem(wxWebHistoryItem* item);
+ virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item);
virtual bool CanGoForward();
virtual bool CanGoBack();
* Busy property is false but should be true.
*/
bool m_isBusy;
- //We manage our own history
+ //We manage our own history, the history list contains the history items
+ //which are added as documentcomplete events arrive, unless we are loading
+ //an item from the history. The position is stored as an int, and reflects
+ //where we are in the history list.
wxVector<wxSharedPtr<wxWebHistoryItem> > m_historyList;
int m_historyPosition;
bool m_historyLoadingFromList;
return false;
}
-void wxWebViewIE::LoadHistoryItem(wxWebHistoryItem* item)
+void wxWebViewIE::LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item)
{
int pos = -1;
for(unsigned int i = 0; i < m_historyList.size(); i++)
{
- if(m_historyList[i].get() == item)
+ //We compare the actual pointers to find the correct item
+ if(m_historyList[i].get() == item.get())
pos = i;
}
wxASSERT_MSG(pos != m_historyList.size(), "invalid history item");
void wxWebViewIE::GoBack()
{
- LoadHistoryItem(m_historyList[m_historyPosition - 1].get());
+ LoadHistoryItem(m_historyList[m_historyPosition - 1]);
}
void wxWebViewIE::GoForward()
{
- LoadHistoryItem(m_historyList[m_historyPosition + 1].get());
+ LoadHistoryItem(m_historyList[m_historyPosition + 1]);
}
void wxWebViewIE::Stop()