Add guard clause needed...

...to prevent the code for preserving changed titles across a
set_resolution() call from damaging the editor display.
This commit is contained in:
Eric S. Raymond 2007-11-27 08:34:05 +00:00
parent a35eef9135
commit 0fa7406fc0

View file

@ -535,7 +535,7 @@ bool theme::set_resolution(const SDL_Rect& screen)
std::map<std::string,std::string> title_stash;
for (std::vector<theme::menu>::iterator m = menus_.begin(); m != menus_.end(); ++m) {
if (!m->title().empty())
if (!m->title().empty() && !m->get_id().empty())
title_stash[m->get_id()] = m->title();
}
@ -655,7 +655,7 @@ void theme::set_object_location(theme::object& element, std::string rect_str, st
void theme::modify(const config* cfg){
std::map<std::string,std::string> title_stash;
for (std::vector<theme::menu>::iterator m = menus_.begin(); m != menus_.end(); ++m) {
if (!m->title().empty())
if (!m->title().empty() && !m->get_id().empty())
title_stash[m->get_id()] = m->title();
}