git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43460
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// Save images as inline base64 data in HTML handler
#define wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_BASE64 0x0040
// Save images as inline base64 data in HTML handler
#define wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_BASE64 0x0040
+// Don't write header and footer (or BODY), so we can include the fragment
+// in a larger document
+#define wxRICHTEXT_HANDLER_NO_HEADER_FOOTER 0x0080
+
/*!
* wxRichTextFileHandler
* Base class for file handlers
/*!
* wxRichTextFileHandler
* Base class for file handlers
wxTextAttrEx currentParaStyle = buffer->GetAttributes();
wxTextAttrEx currentCharStyle = buffer->GetAttributes();
wxTextAttrEx currentParaStyle = buffer->GetAttributes();
wxTextAttrEx currentCharStyle = buffer->GetAttributes();
- str << wxT("<html><head></head><body>\n");
+ if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0)
+ str << wxT("<html><head></head><body>\n");
- str << wxT("<table border=0 cellpadding=0 cellspacing=0><tr><td width=\"100%\">");
+ str << wxT("<table border=0 cellpadding=0 cellspacing=0><tr><td width=\"100%\">\n");
str << wxString::Format(wxT("<font face=\"%s\" size=\"%ld\" color=\"%s\" >"),
currentParaStyle.GetFont().GetFaceName().c_str(), PtToSize(currentParaStyle.GetFont().GetPointSize()),
str << wxString::Format(wxT("<font face=\"%s\" size=\"%ld\" color=\"%s\" >"),
currentParaStyle.GetFont().GetFaceName().c_str(), PtToSize(currentParaStyle.GetFont().GetPointSize()),
node = node->GetNext();
}
node = node->GetNext();
}
- str << wxT("</font></td></tr></table></body></html>\n");
+ str << wxT("</font></td></tr></table>");
+
+ if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0)
+ str << wxT("</body></html>");
+
+ str << wxT("\n");
- // The item is not bulleted and there is a list what should be closed now.
+ // The item is not bulleted and there is a list that should be closed now.
// So close the list
str << (m_is_ul ? wxT("</ul>") : wxT("</ol>"));
// So close the list
str << (m_is_ul ? wxT("</ul>") : wxT("</ol>"));