#pragma implementation
#endif
+#include "ViewBase.h"
+#include "ButtonControllerBase.h"
#include "ControlToc.h"
#include "buffer.h"
#include "Dialogs.h"
#include "LyXView.h"
#include "lyxfunc.h"
#include "support/lstrings.h" // tostr
+#include "gettext.h"
+#include "BufferView.h"
using std::vector;
using SigC::slot;
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);
}
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();
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;
namespace toc
{
-string getType(string const & cmdName)
+string const getType(string const & cmdName)
{
string type;
if (cmdName == "tableofcontents" )
type = "TOC";
- else if (cmdName == "listofalgorithms" )
- type = "algorithm";
-
- else if (cmdName == "listoffigures" )
- type = "figure";
-
- else
- type = "table";
-
- return type;
+ return cmdName;
}
} // namespace toc