X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fcontrollers%2FControlRef.C;h=8d641e393fca1a01dbfd6324c5d4548f2be0b30a;hb=c265d16ed06149b478c2d2c9b9b8e69cdb1bcf3d;hp=4f98837756d1a969c2e7fd4137d7115ea7cfe861;hpb=435d527581277fab8b1aa67888f17d8439d07693;p=lyx.git diff --git a/src/frontends/controllers/ControlRef.C b/src/frontends/controllers/ControlRef.C index 4f98837756..8d641e393f 100644 --- a/src/frontends/controllers/ControlRef.C +++ b/src/frontends/controllers/ControlRef.C @@ -8,66 +8,57 @@ * ====================================================== * * \file ControlRef.C - * \author Angus Leeming + * \author Angus Leeming */ #include -#include #ifdef __GNUG__ #pragma implementation #endif -#include "ViewBase.h" -#include "ButtonControllerBase.h" #include "ControlRef.h" -#include "Dialogs.h" -#include "frontends/LyXView.h" -#include "buffer.h" #include "lyxfunc.h" +#include "buffer.h" #include "bufferlist.h" +#include "funcrequest.h" + #include "support/filetools.h" // MakeAbsPath, MakeDisplayPath -#include "debug.h" -using SigC::slot; using std::vector; -using std::find; extern BufferList bufferlist; + ControlRef::ControlRef(LyXView & lv, Dialogs & d) : ControlCommand(lv, d, LFUN_REF_INSERT) -{ - d_.showRef.connect(slot(this, &ControlRef::showInset)); - d_.createRef.connect(slot(this, &ControlRef::createInset)); -} +{} vector const ControlRef::getLabelList(string const & name) const { - Buffer * buffer = bufferlist.getBuffer(MakeAbsPath(name)); - if (!buffer) - buffer = lv_.buffer(); - return buffer->getLabelList(); + Buffer const * buf = bufferlist.getBuffer(MakeAbsPath(name)); + if (!buf) + buf = buffer(); + return buf->getLabelList(); } -void ControlRef::gotoRef(string const & ref) const +void ControlRef::gotoRef(string const & ref) { - lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_SAVE, "0"); - lv_.getLyXFunc()->dispatch(LFUN_REF_GOTO, ref); + lyxfunc().dispatch(FuncRequest(LFUN_BOOKMARK_SAVE, "0"), false); + lyxfunc().dispatch(FuncRequest(LFUN_REF_GOTO, ref)); } -void ControlRef::gotoBookmark() const +void ControlRef::gotoBookmark() { - lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_GOTO, "0"); + lyxfunc().dispatch(FuncRequest(LFUN_BOOKMARK_GOTO, "0"), false); } vector const ControlRef::getBufferList() const { - vector buffers = bufferlist.getFileNames(); for (vector::iterator it = buffers.begin(); it != buffers.end(); ++it) { @@ -81,7 +72,7 @@ vector const ControlRef::getBufferList() const int ControlRef::getBufferNum() const { vector buffers = bufferlist.getFileNames(); - string const name = lv_.buffer()->fileName(); + string const name = buffer()->fileName(); vector::const_iterator cit = find(buffers.begin(), buffers.end(), name); if (cit == buffers.end())