]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtexthtml.cpp
Don't assert in wxDataViewCtrl::ItemDeleted() if item doesn't exist.
[wxWidgets.git] / src / richtext / richtexthtml.cpp
index 6af5ab0ae59d2fe604a3bbd23c675fa19fc14e55..c5df3087979521a94c9ca22fc0b6890f2319064d 100644 (file)
@@ -85,8 +85,7 @@ bool wxRichTextHTMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream&
         customEncoding = new wxCSConv(GetEncoding());
         if (!customEncoding->IsOk())
         {
-            delete customEncoding;
-            customEncoding = NULL;
+            wxDELETE(customEncoding);
         }
     }
     if (customEncoding)
@@ -331,8 +330,6 @@ void wxRichTextHTMLHandler::BeginParagraphFormatting(const wxTextAttr& WXUNUSED(
                 m_inTable = true;
             }
 
-            OutputFont(thisStyle, str);
-
             if (((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) == 0) && (thisStyle.GetLeftSubIndent() < 0))
             {
                 str << SymbolicIndent( - thisStyle.GetLeftSubIndent());
@@ -366,16 +363,17 @@ void wxRichTextHTMLHandler::BeginParagraphFormatting(const wxTextAttr& WXUNUSED(
 
         str << wxT(">");
     }
+    OutputFont(thisStyle, str);
 }
 
 /// End paragraph formatting
 void wxRichTextHTMLHandler::EndParagraphFormatting(const wxTextAttr& WXUNUSED(currentStyle), const wxTextAttr& thisStyle, wxTextOutputStream& stream)
 {
+    if (thisStyle.HasFont())
+        stream << wxT("</font>");
+
     if (m_inTable)
     {
-        if (thisStyle.HasFont())
-            stream << wxT("</font>");
-
         stream << wxT("</td></tr></table></p>\n");
         m_inTable = false;
     }