]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlToc.C
The reference dialog now disconnects from the inset on Apply. Its behaviour
[lyx.git] / src / frontends / controllers / ControlToc.C
index 855c13d7ea2c220987df32d5f8b694038e64e489..9498787396c0e7eb285e89d70b953ad3fe2bfec6 100644 (file)
@@ -26,6 +26,7 @@
 #include "lyxfunc.h"
 #include "support/lstrings.h" // tostr
 #include "gettext.h"
+#include "BufferView.h"
 
 using std::vector;
 using SigC::slot;
@@ -41,7 +42,7 @@ ControlToc::ControlToc(LyXView & lv, Dialogs & d)
 void ControlToc::Goto(int const & id) const
 {
        string const tmp = tostr(id);
-       lv_.getLyXFunc()->Dispatch(LFUN_GOTO_PARAGRAPH, tmp);
+       lv_.getLyXFunc()->dispatch(LFUN_GOTO_PARAGRAPH, tmp);
 }
 
 
@@ -64,15 +65,11 @@ vector<string> const ControlToc::getTypes() const
 
 Buffer::SingleList const ControlToc::getContents(string const & type) const
 {
-       Buffer::SingleList contents;
-       
-       Buffer::TocItem noContent(0, 0, string());
+       Buffer::SingleList empty_list;
 
        // This shouldn't be possible...
        if (!lv_.view()->available()) {
-               noContent.str = _("*** No Document ***");
-               contents.push_back(noContent);
-               return contents;
+               return empty_list;
        }
 
        Buffer::Lists tmp = lv_.view()->buffer()->getLists();
@@ -80,9 +77,7 @@ Buffer::SingleList const ControlToc::getContents(string const & type) const
        Buffer::Lists::iterator it = tmp.find(type);
 
        if (it == tmp.end()) {
-               noContent.str = _("*** No Lists ***");
-               contents.push_back(noContent);
-               return contents;
+               return empty_list;
        }
 
        return it->second;