Le 15/06/2009 11:08, [email protected] a écrit :
Author: lasgouttes
Date: Mon Jun 15 11:08:18 2009
New Revision: 30107
URL: http://www.lyx.org/trac/changeset/30107

Log:
fix crash when pressing Down in command buffer and the history is empty
(reported by John McCabe-Dansted's monkey test)

Juergen, OK in branch?

Modified:
    lyx-devel/trunk/src/frontends/qt4/GuiCommandBuffer.cpp

Modified: lyx-devel/trunk/src/frontends/qt4/GuiCommandBuffer.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiCommandBuffer.cpp      Mon Jun 15 
02:33:54 2009        (r30106)
+++ lyx-devel/trunk/src/frontends/qt4/GuiCommandBuffer.cpp      Mon Jun 15 
11:08:18 2009        (r30107)
@@ -248,7 +248,8 @@
        if (!h.empty())
                edit_->setText(toqstr(h));

-       downPB->setEnabled(history_pos_ != history_.end()-1);
+       downPB->setEnabled(!history_.empty()
+                       &&  history_pos_ != history_.end() - 1);
        upPB->setEnabled(history_pos_ != history_.begin());
  }
        

Reply via email to