]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlRef.C
Nothing but a changed email address (trying to factor my tree in in small steps)
[lyx.git] / src / frontends / controllers / ControlRef.C
index 6c0f6a604b41fae6aff6f55a668b272645e07f29..8d641e393fca1a01dbfd6324c5d4548f2be0b30a 100644 (file)
@@ -8,7 +8,7 @@
  * ======================================================
  *
  * \file ControlRef.C
- * \author Angus Leeming <a.leeming@ic.ac.uk>
+ * \author Angus Leeming <leeming@lyx.org>
  */
 
 #include <config.h>
@@ -19,7 +19,9 @@
 
 #include "ControlRef.h"
 #include "lyxfunc.h"
+#include "buffer.h"
 #include "bufferlist.h"
+#include "funcrequest.h"
 
 #include "support/filetools.h" // MakeAbsPath, MakeDisplayPath
 
@@ -35,29 +37,28 @@ ControlRef::ControlRef(LyXView & lv, Dialogs & d)
 
 vector<string> 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, string("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, string("0"));
+       lyxfunc().dispatch(FuncRequest(LFUN_BOOKMARK_GOTO, "0"), false);
 }
 
 
 vector<string> const ControlRef::getBufferList() const
 {
-
        vector<string> buffers = bufferlist.getFileNames();
        for (vector<string>::iterator it = buffers.begin();
             it != buffers.end(); ++it) {
@@ -71,7 +72,7 @@ vector<string> const ControlRef::getBufferList() const
 int ControlRef::getBufferNum() const
 {
        vector<string> buffers = bufferlist.getFileNames();
-       string const name = lv_.buffer()->fileName();
+       string const name = buffer()->fileName();
        vector<string>::const_iterator cit =
                find(buffers.begin(), buffers.end(), name);
        if (cit == buffers.end())