#include <config.h>
-
#include "ControlBibtex.h"
+#include "Kernel.h"
+
#include "buffer.h"
-#include "BufferView.h"
#include "lyxrc.h"
#include "helper_funcs.h"
#include "tex_helpers.h"
#include "gettext.h"
-#include "support/lstrings.h"
-
-
-using std::pair;
-
-
-ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d)
- : ControlCommand(lv, d)
-{}
+#include "support/filetools.h"
+using namespace lyx::support;
-void ControlBibtex::applyParamsToInset()
-{
- if (params().getContents() != inset()->params().getContents())
- bufferview()->ChangeCitationsIfUnique(inset()->params().getContents(),
- params().getContents());
-
- inset()->setParams(params());
- bufferview()->updateInset(inset(), true);
-
- // We need to do a redraw because the maximum
- // InsetBibKey width could have changed
-#warning are you sure you need this repaint() ?
- bufferview()->repaint();
- bufferview()->fitCursor();
-}
+using std::pair;
+using std::vector;
-void ControlBibtex::applyParamsNoInset()
+ControlBibtex::ControlBibtex(Dialog & d)
+ : ControlCommand(d, "bibtex")
{}
{
pair<string, string> dir1(_("Documents|#o#O"),
string(lyxrc.document_path));
- return browseRelFile(in_name, buffer()->filePath(),
+ return browseRelFile(in_name, kernel().buffer()->filePath(),
title, pattern, false, dir1);
}
-string const ControlBibtex::getBibStyles() const
+void ControlBibtex::getBibStyles(vector<string> & data) const
{
- string list = getTexFileList("bstFiles.lst", false);
+ data.clear();
+
+ getTexFileList("bstFiles.lst", data);
// test, if we have a valid list, otherwise run rescan
- if (list.empty()) {
+ if (data.empty()) {
rescanBibStyles();
- list = getTexFileList("bstFiles.lst", false);
+ getTexFileList("bstFiles.lst", data);
+ }
+ vector<string>::iterator it = data.begin();
+ vector<string>::iterator end = data.end();
+ for (; it != end; ++it) {
+ *it = OnlyFilename(*it);
}
- return list;
}
-string const ControlBibtex::getBibFiles() const
+void ControlBibtex::getBibFiles(vector<string> & data) const
{
- string list = getTexFileList("bibFiles.lst", false);
+ data.clear();
+
+ getTexFileList("bibFiles.lst", data);
// test, if we have a valid list, otherwise run rescan
- if (list.empty()) {
+ if (data.empty()) {
rescanBibStyles();
- list = getTexFileList("bibFiles.lst", false);
+ getTexFileList("bibFiles.lst", data);
+ }
+ vector<string>::iterator it = data.begin();
+ vector<string>::iterator end = data.end();
+ for (; it != end; ++it) {
+ *it = OnlyFilename(*it);
}
- return list;
}