]> 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 4f98837756d1a969c2e7fd4137d7115ea7cfe861..8d641e393fca1a01dbfd6324c5d4548f2be0b30a 100644 (file)
@@ -8,66 +8,57 @@
  * ======================================================
  *
  * \file ControlRef.C
- * \author Angus Leeming <a.leeming@ic.ac.uk>
+ * \author Angus Leeming <leeming@lyx.org>
  */
 
 #include <config.h>
-#include <algorithm>
 
 #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<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, "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<string> const ControlRef::getBufferList() const
 {
-
        vector<string> buffers = bufferlist.getFileNames();
        for (vector<string>::iterator it = buffers.begin();
             it != buffers.end(); ++it) {
@@ -81,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())