diff --git a/src/fileio/xml-parser/ticpp.h b/src/fileio/xml-parser/ticpp.h index ebc21338..5dfd113f 100644 --- a/src/fileio/xml-parser/ticpp.h +++ b/src/fileio/xml-parser/ticpp.h @@ -1333,6 +1333,11 @@ namespace ticpp { m_impRC->InitRef(); } + + /// Queries whether this represents text using a CDATA section. + bool CDATA() const { return m_tiXmlPointer->CDATA(); } + /// Turns on or off a CDATA representation of text. + void SetCDATA( bool _cdata ) { m_tiXmlPointer->SetCDATA(_cdata); } }; /** Wrapper around TiXmlDocument */ diff --git a/src/tools/prefs.mac.mm b/src/tools/prefs.mac.mm index 419b2635..978039f6 100644 --- a/src/tools/prefs.mac.mm +++ b/src/tools/prefs.mac.mm @@ -206,7 +206,7 @@ bool sync_prefs() { prefs_recording << std::endl; } } - record_action("load_prefs", prefs_recording.str()); + record_action("load_prefs", prefs_recording.str(), true); prefsLoaded = true; }else if(replaying && !prefsLoaded){ replayUserDefaults = [[NSUserDefaults alloc] init]; diff --git a/src/tools/prefs.win.cpp b/src/tools/prefs.win.cpp index 39caa33b..e0f10905 100644 --- a/src/tools/prefs.win.cpp +++ b/src/tools/prefs.win.cpp @@ -150,7 +150,7 @@ static bool load_prefs(std::istream& in) { prefs.swap(temp_prefs); if (recording) { - record_action("load_prefs", prefs_recording.str()); + record_action("load_prefs", prefs_recording.str(), true); } return prefsLoaded = true; diff --git a/src/tools/replay.cpp b/src/tools/replay.cpp index b3ff997c..6f05a17c 100644 --- a/src/tools/replay.cpp +++ b/src/tools/replay.cpp @@ -60,10 +60,11 @@ bool init_action_log(std::string command, std::string file) { return false; } -void record_action(std::string action_type, std::string inner_text) { +void record_action(std::string action_type, std::string inner_text, bool cdata) { Element* root = log_document.FirstChildElement(); Element next_action(action_type); Text action_text(inner_text); + action_text.SetCDATA(cdata); next_action.InsertEndChild(action_text); root->InsertEndChild(next_action); log_document.SaveFile(log_file); @@ -151,4 +152,4 @@ short short_from_action(Element& action) { std::istringstream sstr(action.GetText()); sstr >> s; return s; -} \ No newline at end of file +} diff --git a/src/tools/replay.hpp b/src/tools/replay.hpp index 5191614a..bdeb3c35 100644 --- a/src/tools/replay.hpp +++ b/src/tools/replay.hpp @@ -15,7 +15,7 @@ extern bool recording; extern bool replaying; extern bool init_action_log(std::string command, std::string file); -extern void record_action(std::string action_type, std::string inner_text); +extern void record_action(std::string action_type, std::string inner_text, bool cdata = false); extern void record_action(std::string action_type, std::map info); extern bool has_next_action(); extern std::string next_action_type();