| 462 | } |
| 463 | |
| 464 | bool EditorState::save() |
| 465 | { |
| 466 | pugi::xml_document doc; |
| 467 | pugi::xml_node decl = doc.prepend_child(pugi::node_declaration); |
| 468 | decl.append_attribute("version") = "1.0"; |
| 469 | decl.append_attribute("encoding") = "UTF-8"; |
| 470 | |
| 471 | ExportManager::getInstance().serialization(doc); |
| 472 | |
| 473 | bool result = doc.save_file( |
| 474 | mFileName.asWStr_c_str(), |
| 475 | "\t", |
| 476 | (pugi::format_indent | pugi::format_write_bom | pugi::format_win_new_line) & |
| 477 | (~pugi::format_space_before_slash)); |
| 478 | |
| 479 | if (result) |
| 480 | { |
| 481 | if (mFileName != mDefaultFileName) |
| 482 | RecentFilesManager::getInstance().addRecentFile(mFileName); |
| 483 | |
| 484 | ActionManager::getInstance().saveChanges(); |
| 485 | return true; |
| 486 | } |
| 487 | |
| 488 | /*MyGUI::Message* message =*/MessageBoxManager::getInstance().create( |
| 489 | replaceTags("Error"), |
| 490 | "Error save file", |
| 491 | MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Yes); |
| 492 | |
| 493 | return false; |
| 494 | } |
| 495 | |
| 496 | void EditorState::commandRecentFiles(const MyGUI::UString& _commandName, bool& _result) |
| 497 | { |
no test coverage detected