if (token == "\\layout") {
lex.pushToken(token);
- Paragraph * par = new Paragraph();
- par->params().depth(depth);
+ Paragraph par;
+ par.owningBuffer(*this);
+ par.params().depth(depth);
if (params.tracking_changes)
- par->trackChanges();
+ par.trackChanges();
LyXFont f(LyXFont::ALL_INHERIT, params.language);
- par->setFont(0, f);
+ par.setFont(0, f);
// FIXME: goddamn InsetTabular makes us pass a Buffer
// not BufferParams
- unknown += ::readParagraph(*this, *par, lex);
+ unknown += ::readParagraph(*this, par, lex);
// insert after
if (pit != pars.end())
// this will write out all the paragraphs
// using recursive descent.
- ParagraphList::iterator pit = paragraphs.begin();
- ParagraphList::iterator pend = paragraphs.end();
+ ParagraphList::const_iterator pit = paragraphs.begin();
+ ParagraphList::const_iterator pend = paragraphs.end();
for (; pit != pend; ++pit)
pit->write(this, ofs, params, depth);
}
// Write the preamble
- params.writeLaTeX(os, features, texrow);
+ runparams.use_babel = params.writeLaTeX(os, features, texrow);
if (only_preamble)
return;
texrow.newline();
}
- latexParagraphs(this, paragraphs, os, texrow, runparams, false);
+ latexParagraphs(this, paragraphs, os, texrow, runparams);
// add this just in case after all the paragraphs
os << endl;
Path p(path); // path to LaTeX file
users->owner()->message(_("Running chktex..."));
- // Remove all error insets
- bool const removedErrorInsets = users->removeAutoInsets();
-
// Generate the LaTeX file if neccessary
LatexRunParams runparams;
runparams.flavor = LatexRunParams::LATEX;
users->showErrorList(_("ChkTeX"));
}
- // if we removed error insets before we ran chktex or if we inserted
- // error insets after we ran chktex, this must be run:
- if (removedErrorInsets || res) {
-#warning repaint needed here, or do you mean update() ?
- users->repaint();
- users->fitCursor();
- }
users->owner()->busy(false);
return res;
ParIterator Buffer::getParFromID(int id) const
{
#warning FIXME: const correctness! (Andre)
- ParIterator it(const_cast<Buffer*>(this)->par_iterator_begin());
- ParIterator end(const_cast<Buffer*>(this)->par_iterator_end());
+ ParIterator it = const_cast<Buffer*>(this)->par_iterator_begin();
+ ParIterator end = const_cast<Buffer*>(this)->par_iterator_end();
#warning FIXME, perhaps this func should return a ParIterator? (Lgb)
if (id < 0) {
ParConstIterator Buffer::par_iterator_begin() const
{
- return ParConstIterator(paragraphs.begin(), paragraphs);
+ return ParConstIterator(const_cast<ParagraphList&>(paragraphs).begin(), paragraphs);
}
ParConstIterator Buffer::par_iterator_end() const
{
- return ParConstIterator(paragraphs.end(), paragraphs);
+ return ParConstIterator(const_cast<ParagraphList&>(paragraphs).end(), paragraphs);
}
Buffer::inset_iterator::inset_iterator()
- : pit(0), pend(0)
+ : pit(), pend()
{}