| 435 | } |
| 436 | |
| 437 | bool EditorState::save() |
| 438 | { |
| 439 | pugi::xml_document doc; |
| 440 | pugi::xml_node decl = doc.prepend_child(pugi::node_declaration); |
| 441 | decl.append_attribute("version") = "1.0"; |
| 442 | decl.append_attribute("encoding") = "UTF-8"; |
| 443 | |
| 444 | ExportManager::getInstance().serialization(doc); |
| 445 | |
| 446 | bool result = doc.save_file( |
| 447 | mFileName.asWStr_c_str(), |
| 448 | "\t", |
| 449 | (pugi::format_indent | pugi::format_write_bom | pugi::format_win_new_line) & |
| 450 | (~pugi::format_space_before_slash)); |
| 451 | |
| 452 | if (result) |
| 453 | { |
| 454 | if (mFileName != mDefaultFileName) |
| 455 | RecentFilesManager::getInstance().addRecentFile(mFileName); |
| 456 | |
| 457 | ActionManager::getInstance().saveChanges(); |
| 458 | return true; |
| 459 | } |
| 460 | |
| 461 | /*MyGUI::Message* message =*/MessageBoxManager::getInstance().create( |
| 462 | replaceTags("Error"), |
| 463 | "Error save file", |
| 464 | MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Yes); |
| 465 | |
| 466 | return false; |
| 467 | } |
| 468 | |
| 469 | void EditorState::commandRecentFiles(const MyGUI::UString& _commandName, bool& _result) |
| 470 | { |
nothing calls this directly
no test coverage detected