gui1: Escape filenames in the file_menu menu that may contain WML formatting

This prepends font::NULL_MARKUP to file_menu menu entries so that any
WML formatting characters at the start of filenames such as "#foo.map"
('#' -> red font format specifier) are ignored.
This commit is contained in:
Ignacio R. Morelle 2013-12-21 11:49:17 -03:00
parent cd8c83532b
commit 41b666fbfe
2 changed files with 5 additions and 2 deletions

View File

@ -105,6 +105,9 @@ Version 1.11.7+dev:
* Added wmllint code for recognizing unit id fields in macros.
* Refactored code in wmltools to create a macro-parsing function.
* Added era descriptions.
* Fixed file chooser dialog (used in the map editor and for locating the
wesnothd executable) interpreting special markup at the beginning of file
names such as "#foo.map".
Version 1.11.7:
* Add-ons client:

View File

@ -61,11 +61,11 @@ void file_menu::display_current_files() {
for (it = dirs_in_current_dir_.begin(); it != dirs_in_current_dir_.end(); ++it) {
// Add an image to show that these are directories.
std::stringstream ss;
ss << font::IMAGE << dir_picture << COLUMN_SEPARATOR << *it;
ss << font::IMAGE << dir_picture << COLUMN_SEPARATOR << font::NULL_MARKUP << *it;
to_show.push_back(ss.str());
}
for (it = files_in_current_dir_.begin(); it != files_in_current_dir_.end(); ++it) {
const std::string display_string = COLUMN_SEPARATOR + *it;
const std::string display_string = COLUMN_SEPARATOR + std::string(1, font::NULL_MARKUP) + *it;
to_show.push_back(display_string);
}
const int menu_font_size = font::SIZE_NORMAL; // Known from menu.cpp.