* GuiCommandBuffer: Fix bad programming.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28794 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-03-15 13:20:15 +00:00
parent 53877ef28f
commit cdfc9575a9

View File

@ -172,7 +172,7 @@ void GuiCommandBuffer::complete()
{ {
string const input = fromqstr(edit_->text()); string const input = fromqstr(edit_->text());
string new_input; string new_input;
vector<string> comp = completions(input, new_input); vector<string> const & comp = completions(input, new_input);
if (comp.empty()) { if (comp.empty()) {
if (new_input != input) if (new_input != input)
@ -194,15 +194,14 @@ void GuiCommandBuffer::showList(vector<string> const & list,
// than the number of actual items... // than the number of actual items...
vector<string>::const_iterator cit = list.begin(); vector<string>::const_iterator cit = list.begin();
vector<string>::const_iterator end = list.end(); vector<string>::const_iterator end = list.end();
if (!reversed) { for (; cit != end; ++cit) {
for (; cit != end; ++cit) if (reversed)
listBox ->addItem(toqstr(*cit)); listBox->insertItem(0, toqstr(*cit));
} else { else
for (--end; end != cit; --end) listBox->addItem(toqstr(*cit));
listBox ->addItem(toqstr(*end));
} }
listBox->resize(listBox ->sizeHint()); listBox->resize(listBox->sizeHint());
int const y = max(0, pos.y() - listBox->height()); int const y = max(0, pos.y() - listBox->height());
listBox->move(pos.x(), y); listBox->move(pos.x(), y);