bool wxRichTextHTMLHandler::CanHandle(const wxString& filename) const
{
wxString path, file, ext;
bool wxRichTextHTMLHandler::CanHandle(const wxString& filename) const
{
wxString path, file, ext;
- wxSplitPath(filename, & path, & file, & ext);
+ wxFileName::SplitPath(filename, & path, & file, & ext);
- wxTextAttrEx currentParaStyle = buffer->GetAttributes();
- wxTextAttrEx currentCharStyle = buffer->GetAttributes();
+ wxTextAttr currentParaStyle = buffer->GetAttributes();
+ wxTextAttr currentCharStyle = buffer->GetAttributes();
if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0)
str << wxT("<html><head></head><body>\n");
if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0)
str << wxT("<html><head></head><body>\n");
wxRichTextPlainText* textObj = wxDynamicCast(obj, wxRichTextPlainText);
if (textObj && !textObj->IsEmpty())
{
wxRichTextPlainText* textObj = wxDynamicCast(obj, wxRichTextPlainText);
if (textObj && !textObj->IsEmpty())
{
BeginCharacterFormatting(currentCharStyle, charStyle, paraStyle, str);
wxString text = textObj->GetText();
BeginCharacterFormatting(currentCharStyle, charStyle, paraStyle, str);
wxString text = textObj->GetText();
WriteImage( image, stream );
node2 = node2->GetNext();
WriteImage( image, stream );
node2 = node2->GetNext();
-void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, const wxTextAttrEx& WXUNUSED(paraStyle), wxTextOutputStream& str)
+void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxTextAttr& currentStyle, const wxTextAttr& thisStyle, const wxTextAttr& WXUNUSED(paraStyle), wxTextOutputStream& str)
- if (thisStyle.GetFont().GetPointSize() != currentStyle.GetFont().GetPointSize())
- style += wxString::Format(wxT(" size=\"%ld\""), PtToSize(thisStyle.GetFont().GetPointSize()));
+ if (thisStyle.GetFontSize() != currentStyle.GetFontSize())
+ style += wxString::Format(wxT(" size=\"%ld\""), PtToSize(thisStyle.GetFontSize()));
if (thisStyle.GetTextColour() != currentStyle.GetTextColour() )
{
wxString color(thisStyle.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX));
if (thisStyle.GetTextColour() != currentStyle.GetTextColour() )
{
wxString color(thisStyle.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX));
-void wxRichTextHTMLHandler::EndCharacterFormatting(const wxTextAttrEx& WXUNUSED(currentStyle), const wxTextAttrEx& thisStyle, const wxTextAttrEx& WXUNUSED(paraStyle), wxTextOutputStream& stream)
+void wxRichTextHTMLHandler::EndCharacterFormatting(const wxTextAttr& WXUNUSED(currentStyle), const wxTextAttr& thisStyle, const wxTextAttr& WXUNUSED(paraStyle), wxTextOutputStream& stream)
-void wxRichTextHTMLHandler::BeginParagraphFormatting(const wxTextAttrEx& WXUNUSED(currentStyle), const wxTextAttrEx& thisStyle, wxTextOutputStream& str)
+void wxRichTextHTMLHandler::BeginParagraphFormatting(const wxTextAttr& WXUNUSED(currentStyle), const wxTextAttr& thisStyle, wxTextOutputStream& str)
int listType = TypeOfList(thisStyle, tag);
m_listTypes.Add(listType);
int listType = TypeOfList(thisStyle, tag);
m_listTypes.Add(listType);
- wxString align = GetAlignment(thisStyle);
- str << wxString::Format(wxT("<p align=\"%s\">"), align.c_str());
+ // wxHTML needs an extra <p> before a list when using <p> ... </p> in previous paragraphs.
+ // TODO: pass a flag that indicates we're using wxHTML.
+ str << wxT("<p>\n");
-void wxRichTextHTMLHandler::EndParagraphFormatting(const wxTextAttrEx& WXUNUSED(currentStyle), const wxTextAttrEx& thisStyle, wxTextOutputStream& stream)
+void wxRichTextHTMLHandler::EndParagraphFormatting(const wxTextAttr& WXUNUSED(currentStyle), const wxTextAttr& thisStyle, wxTextOutputStream& stream)
- stream << wxString::Format(wxT("<font face=\"%s\" size=\"%ld\""), style.GetFont().GetFaceName().c_str(), PtToSize(style.GetFont().GetPointSize()));
+ stream << wxString::Format(wxT("<font face=\"%s\" size=\"%ld\""), style.GetFontFaceName().c_str(), PtToSize(style.GetFontSize()));
if (style.HasTextColour())
stream << wxString::Format(wxT(" color=\"%s\""), style.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX).c_str());
stream << wxT(" >");
}
}
if (style.HasTextColour())
stream << wxString::Format(wxT(" color=\"%s\""), style.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX).c_str());
stream << wxT(" >");
}
}
{
// We can use number attribute of li tag but not all the browsers support it.
// also wxHtmlWindow doesn't support type attribute.
{
// We can use number attribute of li tag but not all the browsers support it.
// also wxHtmlWindow doesn't support type attribute.