]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/configtool/src/property.cpp
Removal of first part of dsw files (as requested by Jamie Gadd).
[wxWidgets.git] / utils / configtool / src / property.cpp
index d8e3c9ab88e6b07a054f44e84f91538a583811e1..f00e73c35f302953659f6969a0e7f0186be00b59 100644 (file)
@@ -7,14 +7,15 @@
 // Created:     2003-06-03
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:    
+// Licence:
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "property.h"
-#endif
+// For compilers that support precompilation, includes "wx/wx.h".
+#include "wx/wxprec.h"
 
-#include "wx/wx.h"
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
 
 #include "property.h"
 
@@ -27,19 +28,23 @@ void ctProperties::AddProperty(ctProperty* property, const wxString& insertAfter
     if (oldProp)
         m_list.DeleteObject(oldProp);
 
-    wxNode* insertBeforeNode = NULL;
     if (insertAfter)
     {
         ctProperty* insertAfterProp = FindProperty(insertAfter);
         if (insertAfterProp)
         {
-            wxNode* node = m_list.Member(insertAfterProp);
+            wxObjectList::compatibility_iterator node = m_list.Member(insertAfterProp);
             if (node)
-                insertBeforeNode = node->GetNext();
+            {
+                wxObjectList::compatibility_iterator insertBeforeNode = node->GetNext();
+                m_list.Insert(insertBeforeNode, property);
+            }
+            else
+                m_list.Append(property);
         }
+        else
+            m_list.Append(property);
     }
-    if (insertBeforeNode)
-        m_list.Insert(insertBeforeNode, property);
     else
         m_list.Append(property);
 
@@ -68,7 +73,7 @@ void ctProperties::DeleteProperty(const wxString& name)
 
 ctProperty* ctProperties::FindProperty(const wxString& name) const
 {
-    wxNode* node = m_list.GetFirst();
+    wxObjectList::compatibility_iterator node = m_list.GetFirst();
     while (node)
     {
         ctProperty* prop = (ctProperty*) node->GetData();
@@ -111,14 +116,12 @@ ctProperty* ctProperties::FindOrCreateProperty(const wxString& name)
 
 void ctProperties::Clear()
 {
-    m_list.DeleteContents(TRUE);
-    m_list.Clear();
-    m_list.DeleteContents(FALSE);
+    WX_CLEAR_LIST(wxObjectList,m_list);
 }
 
 void ctProperties::Copy(const ctProperties& properties)
 {
-    wxNode* node = properties.m_list.GetFirst();
+    wxObjectList::compatibility_iterator node = properties.m_list.GetFirst();
     while (node)
     {
         ctProperty* prop = (ctProperty*) node->GetData();
@@ -144,7 +147,7 @@ void ctProperties::SetProperty(const wxString& name, long value)
 void ctProperties::SetProperty(const wxString& name, bool value)
 {
     ctProperty* prop = FindOrCreateProperty(name);
-    prop->GetVariant() = (bool) value;
+    prop->GetVariant() = value;
 }
 
 void ctProperties::SetProperty(const wxString& name, const wxVariant& value)
@@ -158,7 +161,7 @@ ctProperty* ctProperties::GetNth(int i) const
     wxASSERT( i < (int) GetCount() );
     if (i < (int) GetCount())
     {
-        wxNode* node = m_list.Item(i);
+        wxObjectList::compatibility_iterator node = m_list.Item(i);
         return (ctProperty*) node->GetData();
     }
     return NULL;