From cdfc9575a99cdebf03845ae85ca9b42e6152ca34 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sun, 15 Mar 2009 13:20:15 +0000 Subject: [PATCH] * GuiCommandBuffer: Fix bad programming. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28794 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiCommandBuffer.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/frontends/qt4/GuiCommandBuffer.cpp b/src/frontends/qt4/GuiCommandBuffer.cpp index dffe69bbe5..5f48010d76 100644 --- a/src/frontends/qt4/GuiCommandBuffer.cpp +++ b/src/frontends/qt4/GuiCommandBuffer.cpp @@ -172,7 +172,7 @@ void GuiCommandBuffer::complete() { string const input = fromqstr(edit_->text()); string new_input; - vector comp = completions(input, new_input); + vector const & comp = completions(input, new_input); if (comp.empty()) { if (new_input != input) @@ -194,15 +194,14 @@ void GuiCommandBuffer::showList(vector const & list, // than the number of actual items... vector::const_iterator cit = list.begin(); vector::const_iterator end = list.end(); - if (!reversed) { - for (; cit != end; ++cit) - listBox ->addItem(toqstr(*cit)); - } else { - for (--end; end != cit; --end) - listBox ->addItem(toqstr(*end)); + for (; cit != end; ++cit) { + if (reversed) + listBox->insertItem(0, toqstr(*cit)); + else + listBox->addItem(toqstr(*cit)); } - listBox->resize(listBox ->sizeHint()); + listBox->resize(listBox->sizeHint()); int const y = max(0, pos.y() - listBox->height()); listBox->move(pos.x(), y); -- 2.39.2