Added wxRichTextXMLHandler::RegisterNodeName so custom content classes can be added without

breaking XML loading


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2012-05-10 11:59:59 +00:00
parent 1e58c8b944
commit 1aca9fcdfc
4 changed files with 46 additions and 18 deletions

View File

@@ -53,7 +53,7 @@ public:
Recursively exports an object to the stream.
*/
bool ExportXML(wxOutputStream& stream, wxRichTextObject& obj, int level);
/**
Helper function: gets node context.
*/
@@ -86,6 +86,17 @@ public:
*/
bool ImportXML(wxRichTextBuffer* buffer, wxRichTextObject* obj, wxXmlNode* node);
/**
Call with XML node name, C++ class name so that wxRTC can read in the node.
If you add a custom object, call this.
*/
static void RegisterNodeName(const wxString& nodeName, const wxString& className) { sm_nodeNameToClassMap[nodeName] = className; }
/**
Cleans up the mapping between node name and C++ class.
*/
static void ClearNodeToClassMap() { sm_nodeNameToClassMap.clear(); }
protected:
/**