#if wxRICHTEXT_HAVE_DIRECT_OUTPUT
 
-static inline void AddAttribute(wxString& str, const wxChar* name, const int& v)
+static inline void AddAttribute(wxString& str, const wxString& name, const int& v)
 {
     str << wxT(" ") << name << wxT("=\"") << wxString::Format(wxT("%d"), v) << wxT("\"");
 }
 
-static inline void AddAttribute(wxString& str, const wxChar* name, const long& v)
+static inline void AddAttribute(wxString& str, const wxString& name, const long& v)
 {
     str << wxT(" ") << name << wxT("=\"") << wxString::Format(wxT("%ld"), v) << wxT("\"");
 }
 
-static inline void AddAttribute(wxString& str, const wxChar* name, const double& v)
+static inline void AddAttribute(wxString& str, const wxString& name, const double& v)
 {
     str << wxT(" ") << name << wxT("=\"") << wxString::Format(wxT("%.2f"), (float) v) << wxT("\"");
 }
 
-static inline void AddAttribute(wxString& str, const wxChar* name, const wxChar* s)
+static inline void AddAttribute(wxString& str, const wxString& name, const wxChar* s)
 {
     str << wxT(" ") << name << wxT("=\"") << s << wxT("\"");
 }
 
-static inline void AddAttribute(wxString& str, const wxChar* name, const wxString& s)
+static inline void AddAttribute(wxString& str, const wxString& name, const wxString& s)
 {
     str << wxT(" ") << name << wxT("=\"") << s << wxT("\"");
 }
 
-static inline void AddAttribute(wxString& str, const wxChar* name, const wxColour& col)
+static inline void AddAttribute(wxString& str, const wxString& name, const wxColour& col)
 {
     str << wxT(" ") << name << wxT("=\"") << wxT("#") << ColourToHexString(col) << wxT("\"");
 }
 
-static inline void AddAttribute(wxString& str, const wxChar* name, const wxTextAttrDimension& dim)
+static inline void AddAttribute(wxString& str, const wxString& name, const wxTextAttrDimension& dim)
 {
     if (dim.IsPresent())
     {
     }
 }
 
-static inline void AddAttribute(wxString& str, const wxString& name, const wxTextAttrDimension& dim)
-{
-    AddAttribute(str, name.c_str(), dim);
-}
-
-static inline void AddAttribute(wxString& str, const wxChar* rootName, const wxTextAttrDimensions& dims)
+static inline void AddAttribute(wxString& str, const wxString& rootName, const wxTextAttrDimensions& dims)
 {
     if (dims.GetLeft().IsPresent())
         AddAttribute(str, rootName + wxString(wxT("-left")), dims.GetLeft());
         AddAttribute(str, rootName + wxString(wxT("-bottom")), dims.GetBottom());
 }
 
-static inline void AddAttribute(wxString& str, const wxChar* rootName, const wxTextAttrBorder& border)
+static inline void AddAttribute(wxString& str, const wxString& rootName, const wxTextAttrBorder& border)
 {
     if (border.HasStyle())
         AddAttribute(str, rootName + wxString(wxT("-style")), border.GetStyle());
         AddAttribute(str, rootName + wxString(wxT("-width")), border.GetWidth());
 }
 
-static inline void AddAttribute(wxString& str, const wxChar* rootName, const wxTextAttrBorders& borders)
+static inline void AddAttribute(wxString& str, const wxString& rootName, const wxTextAttrBorders& borders)
 {
     AddAttribute(str, rootName + wxString(wxT("-left")), borders.GetLeft());
     AddAttribute(str, rootName + wxString(wxT("-right")), borders.GetRight());
 
 #if wxRICHTEXT_HAVE_XMLDOCUMENT_OUTPUT
 
-static inline void AddAttribute(wxXmlNode* node, const wxChar* name, const int& v)
+static inline void AddAttribute(wxXmlNode* node, const wxString& name, const int& v)
 {
     node->AddAttribute(name, MakeString(v));
 }
 
-static inline void AddAttribute(wxXmlNode* node, const wxChar* name, const long& v)
+static inline void AddAttribute(wxXmlNode* node, const wxString& name, const long& v)
 {
     node->AddAttribute(name, MakeString(v));
 }
 
-static inline void AddAttribute(wxXmlNode* node, const wxChar* name, const double& v)
+static inline void AddAttribute(wxXmlNode* node, const wxString& name, const double& v)
 {
     node->AddAttribute(name, MakeString(v));
 }
 
-static inline void AddAttribute(wxXmlNode* node, const wxChar* name, const wxString& s)
+static inline void AddAttribute(wxXmlNode* node, const wxString& name, const wxString& s)
 {
     node->AddAttribute(name, s);
 }
 
-static inline void AddAttribute(wxXmlNode* node, const wxChar* name, const wxColour& col)
+static inline void AddAttribute(wxXmlNode* node, const wxString& name, const wxColour& col)
 {
     node->AddAttribute(name, MakeString(col));
 }
 
-static inline void AddAttribute(wxXmlNode* node, const wxChar* name, const wxTextAttrDimension& dim)
+static inline void AddAttribute(wxXmlNode* node, const wxString& name, const wxTextAttrDimension& dim)
 {
     if (dim.IsPresent())
     {
     }
 }
 
-static inline void AddAttribute(wxXmlNode* node, const wxChar* rootName, const wxTextAttrDimensions& dims)
+static inline void AddAttribute(wxXmlNode* node, const wxString& rootName, const wxTextAttrDimensions& dims)
 {
     if (dims.GetLeft().IsPresent())
         AddAttribute(node, rootName + wxString(wxT("-left")), dims.GetLeft());
         AddAttribute(node, rootName + wxString(wxT("-bottom")), dims.GetBottom());
 }
 
-static inline void AddAttribute(wxXmlNode* node, const wxChar* rootName, const wxTextAttrBorder& border)
+static inline void AddAttribute(wxXmlNode* node, const wxString& rootName, const wxTextAttrBorder& border)
 {
     if (border.HasStyle())
         AddAttribute(node, rootName + wxString(wxT("-style")), border.GetStyle());
         AddAttribute(node, rootName + wxString(wxT("-width")), border.GetWidth());
 }
 
-static inline void AddAttribute(wxXmlNode* node, const wxChar* rootName, const wxTextAttrBorders& borders)
+static inline void AddAttribute(wxXmlNode* node, const wxString& rootName, const wxTextAttrBorders& borders)
 {
     AddAttribute(node, rootName + wxString(wxT("-left")), borders.GetLeft());
     AddAttribute(node, rootName + wxString(wxT("-right")), borders.GetRight());
             if (stream.GetSize() > 0)
             {
                 int size = stream.GetSize();
+#ifdef __WXDEBUG__
                 int size2 = stream.GetOutputStreamBuffer()->GetIntPosition();
                 wxASSERT(size == size2);
-
+#endif
                 unsigned char* data = new unsigned char[size];
                 stream.CopyTo(data, size);
                 strData = wxString((const char*) data, wxConvUTF8, size);