namespace {
-int const LYX_FORMAT = 261;
+int const LYX_FORMAT = 263;
} // namespace anon
Buffer::Buffer(string const & file, bool readonly)
: pimpl_(new Impl(*this, FileName(file), readonly))
{
- lyxerr[Debug::INFO] << "Buffer::Buffer()" << endl;
+ LYXERR(Debug::INFO) << "Buffer::Buffer()" << endl;
}
Buffer::~Buffer()
{
- lyxerr[Debug::INFO] << "Buffer::~Buffer()" << endl;
+ LYXERR(Debug::INFO) << "Buffer::~Buffer()" << endl;
// here the buffer should take care that it is
// saved properly, before it goes into the void.
if (fs::exists(bname.toFilesystemEncoding()) &&
(!fs::exists(fname.toFilesystemEncoding()) ||
fs::last_write_time(fname.toFilesystemEncoding()) < fs::last_write_time(bname.toFilesystemEncoding()))) {
- lyxerr[Debug::FILES] << "Log name calculated as: " << bname << endl;
+ LYXERR(Debug::FILES) << "Log name calculated as: " << bname << endl;
return make_pair(Buffer::buildlog, bname.absFilename());
}
- lyxerr[Debug::FILES] << "Log name calculated as: " << fname << endl;
+ LYXERR(Debug::FILES) << "Log name calculated as: " << fname << endl;
return make_pair(Buffer::latexlog, fname.absFilename());
}
params().headheight.erase();
params().headsep.erase();
params().footskip.erase();
+ for (int i = 0; i < 4; ++i) {
+ params().user_defined_bullet(i) = ITEMIZE_DEFAULTS[i];
+ params().temp_bullet(i) = ITEMIZE_DEFAULTS[i];
+ }
ErrorList & errorList = errorLists_["Parse"];
continue;
}
- lyxerr[Debug::PARSER] << "Handling document header token: `"
+ LYXERR(Debug::PARSER) << "Handling document header token: `"
<< token << '\'' << endl;
string unknown = params().readToken(lex, token);
lex.next();
string const token(lex.getString());
- if (!lex.isOK()) {
+ if (!lex) {
Alert::error(_("Document could not be read"),
bformat(_("%1$s could not be read."), from_utf8(filename.absFilename())));
return failure;
<< ' ' << quoteName(filename.toFilesystemEncoding());
string const command_str = command.str();
- lyxerr[Debug::INFO] << "Running '"
+ LYXERR(Debug::INFO) << "Running '"
<< command_str << '\''
<< endl;
bformat(_("Cannot create backup file %1$s.\n"
"Please check whether the directory exists and is writeable."),
from_utf8(backupName.absFilename())));
- lyxerr[Debug::DEBUG] << "Fs error: " << fe.what() << endl;
+ LYXERR(Debug::DEBUG) << "Fs error: " << fe.what() << endl;
}
}
OutputParams const & runparams,
bool output_preamble, bool output_body)
{
- string const encoding = params().encoding().iconvName();
- lyxerr[Debug::LATEX] << "makeLaTeXFile encoding: "
+ string const encoding = runparams.encoding->iconvName();
+ LYXERR(Debug::LATEX) << "makeLaTeXFile encoding: "
<< encoding << "..." << endl;
odocfstream ofs(encoding);
OutputParams runparams = runparams_in;
// validate the buffer.
- lyxerr[Debug::LATEX] << " Validating buffer..." << endl;
+ LYXERR(Debug::LATEX) << " Validating buffer..." << endl;
LaTeXFeatures features(*this, params(), runparams);
validate(features);
- lyxerr[Debug::LATEX] << " Buffer validation done." << endl;
+ LYXERR(Debug::LATEX) << " Buffer validation done." << endl;
texrow().reset();
texrow().newline();
texrow().newline();
}
- lyxerr[Debug::INFO] << "lyx document header finished" << endl;
+ LYXERR(Debug::INFO) << "lyx document header finished" << endl;
// There are a few differences between nice LaTeX and usual files:
// usual is \batchmode and has a
// special input@path to allow the including of figures
os << "\\begin{document}\n";
texrow().newline();
} // output_preamble
- lyxerr[Debug::INFO] << "preamble finished, now the body." << endl;
+ LYXERR(Debug::INFO) << "preamble finished, now the body." << endl;
if (!lyxrc.language_auto_begin) {
// FIXME UNICODE
os << "\\end{document}\n";
texrow().newline();
- lyxerr[Debug::LATEX] << "makeLaTeXFile...done" << endl;
+ LYXERR(Debug::LATEX) << "makeLaTeXFile...done" << endl;
} else {
- lyxerr[Debug::LATEX] << "LaTeXFile for inclusion made."
+ LYXERR(Debug::LATEX) << "LaTeXFile for inclusion made."
<< endl;
}
+ runparams_in.encoding = runparams.encoding;
// Just to be sure. (Asger)
texrow().newline();
- lyxerr[Debug::INFO] << "Finished making LaTeX file." << endl;
- lyxerr[Debug::INFO] << "Row count was " << texrow().rows() - 1
+ LYXERR(Debug::INFO) << "Finished making LaTeX file." << endl;
+ LYXERR(Debug::INFO) << "Row count was " << texrow().rows() - 1
<< '.' << endl;
}
OutputParams const & runparams,
bool const body_only)
{
- lyxerr[Debug::LATEX] << "makeDocBookFile..." << endl;
+ LYXERR(Debug::LATEX) << "makeDocBookFile..." << endl;
//ofstream ofs;
odocfstream ofs;
message(_("Running chktex..."));
// Generate the LaTeX file if neccessary
- OutputParams runparams;
+ OutputParams runparams(¶ms().encoding());
runparams.flavor = OutputParams::LATEX;
runparams.nice = false;
makeLaTeXFile(FileName(name), org_path, runparams);
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
if (it->lyxCode() == InsetBase::BIBTEX_CODE) {
InsetBibtex const & inset =
- dynamic_cast<InsetBibtex const &>(*it);
+ static_cast<InsetBibtex const &>(*it);
inset.fillWithBibKeys(*this, keys);
} else if (it->lyxCode() == InsetBase::INCLUDE_CODE) {
InsetInclude const & inset =
- dynamic_cast<InsetInclude const &>(*it);
+ static_cast<InsetInclude const &>(*it);
inset.fillWithBibKeys(*this, keys);
} else if (it->lyxCode() == InsetBase::BIBITEM_CODE) {
InsetBibitem const & inset =
- dynamic_cast<InsetBibitem const &>(*it);
+ static_cast<InsetBibitem const &>(*it);
// FIXME UNICODE
string const key = to_utf8(inset.getParam("key"));
docstring const label = inset.getParam("label");
- docstring const ref; // = pit->asString(this, false);
+ DocIterator doc_it(it); doc_it.forwardPos();
+ docstring const ref = doc_it.paragraph().asString(*this, false);
docstring const info = label + "TheBibliographyRef" + ref;
keys.push_back(pair<string, docstring>(key, info));
}
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
if (it->lyxCode() == InsetBase::BIBTEX_CODE) {
InsetBibtex const & inset =
- dynamic_cast<InsetBibtex const &>(*it);
+ static_cast<InsetBibtex const &>(*it);
vector<FileName> const bibfiles = inset.getFiles(*this);
bibfilesCache_.insert(bibfilesCache_.end(),
bibfiles.begin(),
bibfiles.end());
} else if (it->lyxCode() == InsetBase::INCLUDE_CODE) {
InsetInclude & inset =
- dynamic_cast<InsetInclude &>(*it);
+ static_cast<InsetInclude &>(*it);
inset.updateBibfilesCache(*this);
vector<FileName> const & bibfiles =
inset.getBibfilesCache(*this);
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
if (it->lyxCode() == code) {
- InsetCommand & inset = dynamic_cast<InsetCommand &>(*it);
+ InsetCommand & inset = static_cast<InsetCommand &>(*it);
inset.replaceContents(to_utf8(from), to_utf8(to));
}
}
void Buffer::getSourceCode(odocstream & os, pit_type par_begin,
pit_type par_end, bool full_source)
{
- OutputParams runparams;
+ OutputParams runparams(¶ms().encoding());
runparams.nice = true;
runparams.flavor = OutputParams::LATEX;
runparams.linelen = lyxrc.plaintext_linelen;