#include <config.h>
#include <algorithm>
+#include <functional>
+
#include "InsetCommandParams.h"
void InsetCommandParams::read(Lexer & lex)
+{
+ Read(lex, 0);
+}
+
+
+void InsetCommandParams::Read(Lexer & lex, Buffer const * buffer)
{
lex.setContext("InsetCommandParams::read");
lex >> insetName(insetCode_).c_str();
}
if (info_.hasParam(token)) {
lex.next(true);
- params_[token] = lex.getDocString();
+ docstring data = lex.getDocString();
+ if (buffer && token == "filename") {
+ data = from_utf8(buffer->includedFilePath(to_utf8(data)));
+ } else if (buffer && token == "bibfiles") {
+ int i = 0;
+ docstring newdata;
+ docstring bib = support::token(data, ',', i);
+ while (!bib.empty()) {
+ bib = from_utf8(buffer->includedFilePath(to_utf8(bib), "bib"));
+ if (!newdata.empty())
+ newdata.append(1, ',');
+ newdata.append(bib);
+ bib = support::token(data, ',', ++i);
+ }
+ data = newdata;
+ } else if (buffer && token == "options") {
+ data = from_utf8(buffer->includedFilePath(to_utf8(data), "bst"));
+ }
+ params_[token] = data;
} else {
lex.printError("Unknown parameter name `$$Token' for command " + cmdName_);
throw ExceptionMessage(WarningException,
bib = token(data, ',', ++i);
}
data = newdata;
+ } else if (buffer && name == "options") {
+ data = buffer->includedFilePath(data, "bst");
}
os << name << ' '
<< Lexer::quoteString(data)