X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiCommandBuffer.cpp;h=b66860439b69ad3681032c9ad48519da7c663063;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=0ce6cc7749831229938012dd5df6fd0d54c13d12;hpb=079ef62651e0422c45f00968b8814aeaae858d3b;p=lyx.git diff --git a/src/frontends/qt4/GuiCommandBuffer.cpp b/src/frontends/qt4/GuiCommandBuffer.cpp index 0ce6cc7749..b66860439b 100644 --- a/src/frontends/qt4/GuiCommandBuffer.cpp +++ b/src/frontends/qt4/GuiCommandBuffer.cpp @@ -248,7 +248,8 @@ void GuiCommandBuffer::down() 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()); } @@ -296,14 +297,13 @@ string const GuiCommandBuffer::historyDown() docstring const GuiCommandBuffer::getCurrentState() const { - return view_->view()->cursor().currentState(); + return view_->currentBufferView()->cursor().currentState(); } void GuiCommandBuffer::hide() const { FuncRequest cmd(LFUN_COMMAND_EXECUTE, "off"); - theLyXFunc().setLyXView(view_); lyx::dispatch(cmd); } @@ -358,7 +358,6 @@ void GuiCommandBuffer::dispatch(string const & str) downPB->setEnabled(history_pos_ != history_.end()); FuncRequest func = lyxaction.lookupFunc(str); func.origin = FuncRequest::COMMANDBUFFER; - theLyXFunc().setLyXView(view_); lyx::dispatch(func); }