]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextstyles.cpp
Mention the PixelData classes
[wxWidgets.git] / src / richtext / richtextstyles.cpp
index e1dd06b17e704b9a3b0a765b23901771995f9145..6ecda90988977835ece3e1832f1d5e88062eb7ae 100644 (file)
@@ -1,10 +1,10 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        richtextstyles.cpp
+// Name:        src/richtext/richtextstyles.cpp
 // Purpose:     Style management for wxRichTextCtrl
 // Author:      Julian Smart
-// Modified by: 
+// Modified by:
 // Created:     2005-09-30
-// RCS-ID:      
+// RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
   #pragma hdrstop
 #endif
 
-#ifndef WX_PRECOMP
-  #include "wx/wx.h"
-#endif
+#if wxUSE_RICHTEXT
 
-#include "wx/image.h"
+#include "wx/richtext/richtextstyles.h"
 
-#if wxUSE_RICHTEXT
+#ifndef WX_PRECOMP
+    #include "wx/dcclient.h"
+#endif
 
 #include "wx/filename.h"
 #include "wx/clipbrd.h"
 #include "wx/wfstream.h"
 #include "wx/module.h"
 
-#include "wx/richtext/richtextstyles.h"
 #include "wx/richtext/richtextctrl.h"
 
 IMPLEMENT_CLASS(wxRichTextStyleDefinition, wxObject)
@@ -58,11 +57,11 @@ bool wxRichTextStyleSheet::AddStyle(wxList& list, wxRichTextStyleDefinition* def
 /// Remove a style
 bool wxRichTextStyleSheet::RemoveStyle(wxList& list, wxRichTextStyleDefinition* def, bool deleteStyle)
 {
-    wxNode* node = list.Find(def);
+    wxList::compatibility_iterator node = list.Find(def);
     if (node)
     {
         wxRichTextStyleDefinition* def = (wxRichTextStyleDefinition*) node->GetData();
-        delete node;
+        list.Erase(node);
         if (deleteStyle)
             delete def;
         return true;
@@ -74,13 +73,13 @@ bool wxRichTextStyleSheet::RemoveStyle(wxList& list, wxRichTextStyleDefinition*
 /// Find a definition by name
 wxRichTextStyleDefinition* wxRichTextStyleSheet::FindStyle(const wxList& list, const wxString& name) const
 {
-    for (wxNode* node = list.GetFirst(); node; node = node->GetNext())
+    for (wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext())
     {
         wxRichTextStyleDefinition* def = (wxRichTextStyleDefinition*) node->GetData();
         if (def->GetName().Lower() == name.Lower())
             return def;
     }
-    return NULL;        
+    return NULL;
 }
 
 /// Delete all styles
@@ -194,7 +193,7 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons
     int size = 5;
 
     // Standard size is 12, say
-    size += 12 - def->GetStyle().GetFontSize();    
+    size += 12 - def->GetStyle().GetFontSize();
 
     str += wxT("<font");
 
@@ -277,7 +276,7 @@ void wxRichTextStyleListBox::OnLeftDown(wxMouseEvent& event)
         if (def && GetRichTextCtrl())
         {
             wxRichTextRange range(m_richTextCtrl->GetInsertionPoint(), m_richTextCtrl->GetInsertionPoint());
-            
+
             // Flags are defined within each definition, so only certain
             // attributes are applied.
             wxRichTextAttr attr(def->GetStyle());
@@ -309,4 +308,3 @@ wxColour wxRichTextStyleListBox::GetSelectedTextBgColour(const wxColour& colBg)
 
 #endif
     // wxUSE_RICHTEXT
-