STL-ification patch for wxMSW and wxGTK.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -271,7 +271,7 @@ void wxHtmlHelpController::AddGrabIfNeeded()
|
||||
|
||||
// Check if there are any modal windows present,
|
||||
// in which case we need to add a grab.
|
||||
for ( wxWindowList::Node * node = wxTopLevelWindows.GetFirst();
|
||||
for ( wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
|
||||
node;
|
||||
node = node->GetNext() )
|
||||
{
|
||||
|
@@ -1069,7 +1069,6 @@ BEGIN_EVENT_TABLE(wxHtmlHelpFrameOptionsDialog, wxDialog)
|
||||
EVT_SPINCTRL(-1, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
void wxHtmlHelpFrame::OptionsDialog()
|
||||
{
|
||||
wxHtmlHelpFrameOptionsDialog dlg(this);
|
||||
@@ -1081,7 +1080,7 @@ void wxHtmlHelpFrame::OptionsDialog()
|
||||
enu.EnumerateFacenames();
|
||||
m_NormalFonts = new wxArrayString;
|
||||
*m_NormalFonts = *enu.GetFacenames();
|
||||
m_NormalFonts->Sort();
|
||||
m_NormalFonts->Sort(wxStringSortAscending);
|
||||
}
|
||||
if (m_FixedFonts == NULL)
|
||||
{
|
||||
@@ -1089,7 +1088,7 @@ void wxHtmlHelpFrame::OptionsDialog()
|
||||
enu.EnumerateFacenames(wxFONTENCODING_SYSTEM, TRUE);
|
||||
m_FixedFonts = new wxArrayString;
|
||||
*m_FixedFonts = *enu.GetFacenames();
|
||||
m_FixedFonts->Sort();
|
||||
m_FixedFonts->Sort(wxStringSortAscending);
|
||||
}
|
||||
|
||||
// VS: We want to show the font that is actually used by wxHtmlWindow.
|
||||
|
@@ -82,11 +82,18 @@ wxHtmlParser::~wxHtmlParser()
|
||||
{
|
||||
while (RestoreState()) {}
|
||||
DestroyDOMTree();
|
||||
|
||||
|
||||
if (m_HandlersStack)
|
||||
{
|
||||
wxList& tmp = *m_HandlersStack;
|
||||
wxList::iterator it, en;
|
||||
for( it = tmp.begin(), en = tmp.end(); it != en; ++it )
|
||||
delete (wxHashTable*)*it;
|
||||
tmp.clear();
|
||||
}
|
||||
delete m_HandlersStack;
|
||||
m_HandlersHash.Clear();
|
||||
m_HandlersList.DeleteContents(TRUE);
|
||||
m_HandlersList.Clear();
|
||||
WX_CLEAR_LIST(wxList, m_HandlersList);
|
||||
delete m_entitiesParser;
|
||||
}
|
||||
|
||||
@@ -351,10 +358,9 @@ void wxHtmlParser::PushTagHandler(wxHtmlTagHandler *handler, wxString tags)
|
||||
if (m_HandlersStack == NULL)
|
||||
{
|
||||
m_HandlersStack = new wxList;
|
||||
m_HandlersStack->DeleteContents(TRUE);
|
||||
}
|
||||
|
||||
m_HandlersStack->Insert(new wxHashTable(m_HandlersHash));
|
||||
m_HandlersStack->Insert((wxObject*)new wxHashTable(m_HandlersHash));
|
||||
|
||||
while (tokenizer.HasMoreTokens())
|
||||
{
|
||||
@@ -366,16 +372,17 @@ void wxHtmlParser::PushTagHandler(wxHtmlTagHandler *handler, wxString tags)
|
||||
|
||||
void wxHtmlParser::PopTagHandler()
|
||||
{
|
||||
wxNode *first;
|
||||
wxList::compatibility_iterator first;
|
||||
|
||||
if (m_HandlersStack == NULL ||
|
||||
(first = m_HandlersStack->GetFirst()) == NULL)
|
||||
!(first = m_HandlersStack->GetFirst()))
|
||||
{
|
||||
wxLogWarning(_("Warning: attempt to remove HTML tag handler from empty stack."));
|
||||
return;
|
||||
}
|
||||
m_HandlersHash = *((wxHashTable*) first->GetData());
|
||||
m_HandlersStack->DeleteNode(first);
|
||||
delete (wxHashTable*) first->GetData();
|
||||
m_HandlersStack->Erase(first);
|
||||
}
|
||||
|
||||
void wxHtmlParser::SetSourceAndSaveState(const wxString& src)
|
||||
|
@@ -203,6 +203,8 @@ wxHtmlWindow::~wxHtmlWindow()
|
||||
|
||||
if (m_Cell) delete m_Cell;
|
||||
|
||||
WX_CLEAR_LIST(wxHtmlProcessorList, *m_Processors);
|
||||
|
||||
delete m_Parser;
|
||||
delete m_FS;
|
||||
delete m_History;
|
||||
@@ -248,11 +250,11 @@ bool wxHtmlWindow::SetPage(const wxString& source)
|
||||
// pass HTML through registered processors:
|
||||
if (m_Processors || m_GlobalProcessors)
|
||||
{
|
||||
wxHtmlProcessorList::Node *nodeL, *nodeG;
|
||||
wxHtmlProcessorList::compatibility_iterator nodeL, nodeG;
|
||||
int prL, prG;
|
||||
|
||||
nodeL = (m_Processors) ? m_Processors->GetFirst() : NULL;
|
||||
nodeG = (m_GlobalProcessors) ? m_GlobalProcessors->GetFirst() : NULL;
|
||||
nodeL = (m_Processors) ? m_Processors->GetFirst() : wxHtmlProcessorList::compatibility_iterator();
|
||||
nodeG = (m_GlobalProcessors) ? m_GlobalProcessors->GetFirst() : wxHtmlProcessorList::compatibility_iterator();
|
||||
|
||||
// VS: there are two lists, global and local, both of them sorted by
|
||||
// priority. Since we have to go through _both_ lists with
|
||||
@@ -374,7 +376,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
|
||||
|
||||
else
|
||||
{
|
||||
wxNode *node;
|
||||
wxList::compatibility_iterator node;
|
||||
wxString src = wxEmptyString;
|
||||
|
||||
if (m_RelatedStatusBar != -1)
|
||||
@@ -653,9 +655,8 @@ void wxHtmlWindow::AddProcessor(wxHtmlProcessor *processor)
|
||||
if (!m_Processors)
|
||||
{
|
||||
m_Processors = new wxHtmlProcessorList;
|
||||
m_Processors->DeleteContents(TRUE);
|
||||
}
|
||||
wxHtmlProcessorList::Node *node;
|
||||
wxHtmlProcessorList::compatibility_iterator node;
|
||||
|
||||
for (node = m_Processors->GetFirst(); node; node = node->GetNext())
|
||||
{
|
||||
@@ -673,9 +674,8 @@ void wxHtmlWindow::AddProcessor(wxHtmlProcessor *processor)
|
||||
if (!m_GlobalProcessors)
|
||||
{
|
||||
m_GlobalProcessors = new wxHtmlProcessorList;
|
||||
m_GlobalProcessors->DeleteContents(TRUE);
|
||||
}
|
||||
wxHtmlProcessorList::Node *node;
|
||||
wxHtmlProcessorList::compatibility_iterator node;
|
||||
|
||||
for (node = m_GlobalProcessors->GetFirst(); node; node = node->GetNext())
|
||||
{
|
||||
@@ -697,8 +697,9 @@ wxHtmlProcessorList *wxHtmlWindow::m_GlobalProcessors = NULL;
|
||||
void wxHtmlWindow::CleanUpStatics()
|
||||
{
|
||||
wxDELETE(m_DefaultFilter);
|
||||
m_Filters.DeleteContents(TRUE);
|
||||
m_Filters.Clear();
|
||||
WX_CLEAR_LIST(wxList, m_Filters);
|
||||
if (m_GlobalProcessors)
|
||||
WX_CLEAR_LIST(wxHtmlProcessorList, *m_GlobalProcessors);
|
||||
wxDELETE(m_GlobalProcessors);
|
||||
}
|
||||
|
||||
|
@@ -169,8 +169,7 @@ wxHtmlPrintout::~wxHtmlPrintout()
|
||||
|
||||
void wxHtmlPrintout::CleanUpStatics()
|
||||
{
|
||||
m_Filters.DeleteContents(TRUE);
|
||||
m_Filters.Clear();
|
||||
WX_CLEAR_LIST(wxList, m_Filters);
|
||||
}
|
||||
|
||||
// Adds input filter
|
||||
@@ -293,7 +292,7 @@ void wxHtmlPrintout::SetHtmlFile(const wxString& htmlfile)
|
||||
wxHtmlFilterHTML defaultFilter;
|
||||
wxString doc;
|
||||
|
||||
wxNode* node = m_Filters.GetFirst();
|
||||
wxList::compatibility_iterator node = m_Filters.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxHtmlFilter *h = (wxHtmlFilter*) node->GetData();
|
||||
|
@@ -74,7 +74,7 @@ wxHtmlWinParser::wxHtmlWinParser(wxHtmlWindow *wnd) : wxHtmlParser()
|
||||
}
|
||||
|
||||
// fill in wxHtmlParser's tables:
|
||||
wxNode *node = m_Modules.GetFirst();
|
||||
wxList::compatibility_iterator node = m_Modules.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxHtmlTagsModule *mod = (wxHtmlTagsModule*) node->GetData();
|
||||
|
Reference in New Issue
Block a user