]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1339882 ] richtext misc cleanup
authorJulian Smart <julian@anthemion.co.uk>
Fri, 28 Oct 2005 14:24:04 +0000 (14:24 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 28 Oct 2005 14:24:04 +0000 (14:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/richtext/richtextbuffer.h
include/wx/richtext/richtextctrl.h
include/wx/richtext/richtextstyles.h
include/wx/richtext/richtextxml.h
src/richtext/richtextbuffer.cpp
src/richtext/richtextctrl.cpp
src/richtext/richtextstyles.cpp
src/richtext/richtextxml.cpp

index 3a5e25f8e1600e1680da9149830d879dcaa0602d..ec08ad73766a6e96a2e08121bb5b4b9358c9cd4b 100644 (file)
@@ -9,6 +9,9 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+#ifndef _WX_RICHTEXTBUFFER_H_
+#define _WX_RICHTEXTBUFFER_H_
+
 /*
 
   Data structures
 
  */
 
-#ifndef _WX_RICHTEXTBUFFER_H_
-#define _WX_RICHTEXTBUFFER_H_
-
 /*!
  * Includes
  */
 
-#include "wx/list.h"
+#include "wx/defs.h"
 
 #if wxUSE_RICHTEXT
 
+#include "wx/list.h"
+#include "wx/textctrl.h"
+#include "wx/bitmap.h"
 #include "wx/image.h"
 #include "wx/cmdproc.h"
 #include "wx/txtstrm.h"
@@ -489,13 +492,13 @@ private:
     wxString            m_paragraphStyleName;
 };
 
-#define wxTEXT_ATTR_CHARACTER (wxTEXT_ATTR_FONT) | wxTEXT_ATTR_BACKGROUND_COLOUR | wxTEXT_ATTR_TEXT_COLOUR
+#define wxTEXT_ATTR_CHARACTER (wxTEXT_ATTR_FONT | wxTEXT_ATTR_BACKGROUND_COLOUR | wxTEXT_ATTR_TEXT_COLOUR)
 
-#define wxTEXT_ATTR_PARAGRAPH  wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\
+#define wxTEXT_ATTR_PARAGRAPH (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\
     wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\
-    wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_SYMBOL
+    wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_SYMBOL)
 
-#define wxTEXT_ATTR_ALL wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH
+#define wxTEXT_ATTR_ALL (wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH)
 
 /*!
  * wxRichTextObject class declaration
index fcb43628099e7ce6ed702384d46cb20855314c7b..a0f5aefdf42e0acc6d54552f3d14f2cea5656e64 100644 (file)
 #ifndef _WX_RICHTEXTCTRL_H_
 #define _WX_RICHTEXTCTRL_H_
 
-#include "wx/textctrl.h"
+#include "wx/richtext/richtextbuffer.h"
 
 #if wxUSE_RICHTEXT
 
 #include "wx/scrolwin.h"
 #include "wx/caret.h"
 
-#include "wx/richtext/richtextbuffer.h"
-
 #if wxCHECK_VERSION(2,7,0)
 #define wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE 0
 #else
 #define wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE 0
 #endif
 
+#if wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE
+#include "wx/textctrl.h"
+#endif
+
 /*!
  * Styles and flags
  */
index 6993808ee63200ab16836875c3199a18156d0c20..9c91a508301a739e9520830232deae27135848da 100644 (file)
  * Includes
  */
 
-#include "wx/defs.h"
+#include "wx/richtext/richtextbuffer.h"
 
 #if wxUSE_RICHTEXT
 
-#include "wx/richtext/richtextbuffer.h"
-
 #if wxUSE_HTML
 #include "wx/htmllbox.h"
 #endif
index c83df661461c05922dec67611ff72902eca7fe8f..175c51a31d9053a6ea9dc357a6b30d7c7d6fdd4b 100644 (file)
  * Includes
  */
 
-#include "wx/defs.h"
+#include "wx/richtext/richtextbuffer.h"
 
 #if wxUSE_RICHTEXT
 
-#include "wx/richtext/richtextbuffer.h"
-
 /*!
  * wxRichTextXMLHandler
  */
index 3fb3820859fff842daf81aabb0a0a78f33bbc47b..a42bdfacb342313bd567d82d18c2fdf2c84acabb 100644 (file)
   #pragma hdrstop
 #endif
 
+#if wxUSE_RICHTEXT
+
+#include "wx/richtext/richtextbuffer.h"
+
 #ifndef WX_PRECOMP
   #include "wx/wx.h"
 #endif
 
-#include "wx/image.h"
-
-#if wxUSE_RICHTEXT
-
 #include "wx/filename.h"
 #include "wx/clipbrd.h"
 #include "wx/dataobj.h"
@@ -32,7 +32,6 @@
 #include "wx/mstream.h"
 #include "wx/sstream.h"
 
-#include "wx/richtext/richtextbuffer.h"
 #include "wx/richtext/richtextctrl.h"
 #include "wx/richtext/richtextstyles.h"
 
@@ -4980,8 +4979,7 @@ void wxRichTextImageBlock::Init()
 
 void wxRichTextImageBlock::Clear()
 {
-    if (m_data)
-        delete m_data;
+    delete[] m_data;
     m_data = NULL;
     m_dataSize = 0;
     m_imageType = -1;
index ea7c33ba18ed3df3e9760f7a3b3a40dcf4cb6aa5..e4ec1418d0a0ce0cd1945beeaafddbd36725e1b9 100644 (file)
   #pragma hdrstop
 #endif
 
+#if wxUSE_RICHTEXT
+
+#include "wx/richtext/richtextctrl.h"
+
 #ifndef WX_PRECOMP
   #include "wx/wx.h"
 #endif
 
-#include "wx/image.h"
-
-#if wxUSE_RICHTEXT
-
 #include "wx/textfile.h"
 #include "wx/ffile.h"
 #include "wx/settings.h"
 #include "wx/filename.h"
 #include "wx/dcbuffer.h"
-
-#include "wx/richtext/richtextctrl.h"
 #include "wx/arrimpl.cpp"
 
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_ITEM_SELECTED)
index fe53d08e74586d6a1901db17a909546e95bac2f2..1a4d342fca69e834e558747db8019c3901b86b26 100644 (file)
   #pragma hdrstop
 #endif
 
+#if wxUSE_RICHTEXT
+
+#include "wx/richtext/richtextstyles.h"
+
 #ifndef WX_PRECOMP
   #include "wx/wx.h"
 #endif
 
-#include "wx/image.h"
-
-#if wxUSE_RICHTEXT
-
 #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)
index d26c3dde63f6a8f826b98415ad23de187b81e73f..fec4b97f10c0f5c46418fd445cc4aaf02d2b59b5 100644 (file)
   #pragma hdrstop
 #endif
 
+#if wxUSE_RICHTEXT
+
+#include "wx/richtext/richtextxml.h"
+
 #ifndef WX_PRECOMP
   #include "wx/wx.h"
 #endif
 
-#include "wx/image.h"
-
-#if wxUSE_RICHTEXT
-
 #include "wx/filename.h"
 #include "wx/clipbrd.h"
 #include "wx/wfstream.h"
@@ -32,8 +32,6 @@
 #include "wx/txtstrm.h"
 #include "wx/xml/xml.h"
 
-#include "wx/richtext/richtextxml.h"
-
 IMPLEMENT_DYNAMIC_CLASS(wxRichTextXMLHandler, wxRichTextFileHandler)
 
 #if wxUSE_STREAMS