fix crash on doc settings for non-branched doc (reported Kayvan)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7629 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2003-08-29 12:18:40 +00:00
parent fb7298145a
commit e86b42f524
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2003-08-17 Martin Vermeer <martin.vermeer@hut.fi>
* FormDocument.C: fix crash on doc settings for non-branched doc
2003-08-28 Angus Leeming <leeming@lyx.org>
* RadioButtonGroup.[Ch] (unset, setEnabled): new functions extending

View File

@ -1319,8 +1319,11 @@ void FormDocument::branch_update(BufferParams const & params)
fl_addto_browser(branch_->browser_all_branches, vec[i].c_str());
}
fl_select_browser_line(branch_->browser_all_branches, 1);
current_branch =
fl_get_browser_line(branch_->browser_all_branches, 1);
if (!vec.empty())
current_branch =
fl_get_browser_line(branch_->browser_all_branches, 1);
else
current_branch = "none";
}
// display proper selection...
@ -1334,7 +1337,11 @@ void FormDocument::branch_update(BufferParams const & params)
}
// display proper colour...
RGBColor rgb;
string x11hexname = params.branchlist.getColor(current_branch);
string x11hexname;
if (current_branch == "none")
x11hexname = "none";
else
x11hexname = params.branchlist.getColor(current_branch);
if (x11hexname[0] == '#') {
rgb = RGBColor(x11hexname);
} else {