// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "docview.h"
#endif
bool wxDocument::DeleteAllViews()
{
wxDocManager* manager = GetDocumentManager();
+ wxList::iterator it, en;
- wxNode *node = m_documentViews.GetFirst();
- while (node)
+ for ( it = m_documentViews.begin(), en = m_documentViews.end();
+ it != en;
+ )
{
- wxView *view = (wxView *)node->GetData();
+ wxView *view = (wxView *)*it;
if (!view->Close())
return FALSE;
- wxNode *next = node->GetNext();
+ wxList::iterator next = it; ++next;
delete view; // Deletes node implicitly
- node = next;
+ it = next;
}
// If we haven't yet deleted the document (for example
// if there were no views) then delete it.
SetTitle(wxFileNameFromPath(fileName));
// Notify the views that the filename has changed
- wxNode *node = m_documentViews.GetFirst();
+ wxList::compatibility_iterator node = m_documentViews.GetFirst();
while (node)
{
wxView *view = (wxView *)node->GetData();
void wxDocument::UpdateAllViews(wxView *sender, wxObject *hint)
{
- wxNode *node = m_documentViews.GetFirst();
+ wxList::compatibility_iterator node = m_documentViews.GetFirst();
while (node)
{
wxView *view = (wxView *)node->GetData();
void wxDocument::NotifyClosing()
{
- wxNode *node = m_documentViews.GetFirst();
+ wxList::compatibility_iterator node = m_documentViews.GetFirst();
while (node)
{
wxView *view = (wxView *)node->GetData();
if ( notifyViews )
{
// Notify the views that the filename has changed
- wxNode *node = m_documentViews.GetFirst();
+ wxList::compatibility_iterator node = m_documentViews.GetFirst();
while (node)
{
wxView *view = (wxView *)node->GetData();
bool wxDocManager::CloseDocuments(bool force)
{
- wxNode *node = m_docs.GetFirst();
+ wxList::compatibility_iterator node = m_docs.GetFirst();
while (node)
{
wxDocument *doc = (wxDocument *)node->GetData();
- wxNode *next = node->GetNext();
-
+ wxList::compatibility_iterator next = node->GetNext();
+
if (!CloseDocument(doc, force))
return FALSE;
if (!CloseDocuments(force))
return FALSE;
- wxNode *node = m_templates.GetFirst();
+ wxList::compatibility_iterator node = m_templates.GetFirst();
while (node)
{
wxDocTemplate *templ = (wxDocTemplate*) node->GetData();
- wxNode* next = node->GetNext();
+ wxList::compatibility_iterator next = node->GetNext();
delete templ;
node = next;
}
wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates,
int noTemplates, bool sort)
{
- wxArrayString strings(sort);
+ wxArrayString strings;
wxDocTemplate **data = new wxDocTemplate *[noTemplates];
int i;
int n = 0;
if (sort)
{
+ strings.Sort(wxStringSortAscending);
// Yes, this will be slow, but template lists
// are typically short.
int j;
wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates,
int noTemplates, bool sort)
{
- wxArrayString strings(sort);
+ wxArrayString strings;
wxDocTemplate **data = new wxDocTemplate *[noTemplates];
int i;
int n = 0;
if (sort)
{
+ strings.Sort(wxStringSortAscending);
// Yes, this will be slow, but template lists
// are typically short.
int j;
// Move existing files (if any) down so we can insert file at beginning.
if (m_fileHistoryN < m_fileMaxFiles)
{
- wxNode* node = m_fileMenus.GetFirst();
+ wxList::compatibility_iterator node = m_fileMenus.GetFirst();
while (node)
{
wxMenu* menu = (wxMenu*) node->GetData();
wxString buf;
buf.Printf(s_MRUEntryFormat, i + 1, pathInMenu.c_str());
- wxNode* node = m_fileMenus.GetFirst();
+ wxList::compatibility_iterator node = m_fileMenus.GetFirst();
while (node)
{
wxMenu* menu = (wxMenu*) node->GetData();
m_fileHistory[j] = m_fileHistory[j + 1];
}
- wxNode* node = m_fileMenus.GetFirst();
+ wxList::compatibility_iterator node = m_fileMenus.GetFirst();
while ( node )
{
wxMenu* menu = (wxMenu*) node->GetData();
// delete the last separator too if no more files are left
if ( m_fileHistoryN == 1 )
{
- wxMenuItemList::Node *node = menu->GetMenuItems().GetLast();
+ wxMenuItemList::compatibility_iterator node = menu->GetMenuItems().GetLast();
if ( node )
{
wxMenuItem *menuItem = node->GetData();
{
if (m_fileHistoryN > 0)
{
- wxNode* node = m_fileMenus.GetFirst();
+ wxList::compatibility_iterator node = m_fileMenus.GetFirst();
while (node)
{
wxMenu* menu = (wxMenu*) node->GetData();