pit_type & pit, otexstream & os)
{
ParagraphList const & paragraphs = text.paragraphs();
- ParagraphList::const_iterator ipar = paragraphs.constIterator(pit);
+ ParagraphList::const_iterator ipar = paragraphs.iterator_at(pit);
LYXERR(Debug::LATEX, "TeXEnvironment for paragraph " << pit);
Layout const & current_layout = ipar->layout();
// This is for debugging purpose at the end.
pit_type const par_begin = pit;
for (; pit < runparams.par_end; ++pit) {
- ParagraphList::const_iterator par = paragraphs.constIterator(pit);
+ ParagraphList::const_iterator par = paragraphs.iterator_at(pit);
// check first if this is an higher depth paragraph.
bool go_out = (par->params().depth() < current_depth);
// Do not output empty environments if the whole paragraph has
// been deleted with ct and changes are not output.
if (size_t(pit + 1) < paragraphs.size()) {
- ParagraphList::const_iterator nextpar = paragraphs.constIterator(pit + 1);
+ ParagraphList::const_iterator nextpar = paragraphs.iterator_at(pit + 1);
Paragraph const & cpar = paragraphs.at(pit);
if ((par->layout() != nextpar->layout()
|| par->params().depth() == nextpar->params().depth()
// other arguments, consider this.
for (auto const & larg : latexargs) {
Layout::latexarg const & arg = larg.second;
- if ((!arg.presetarg.empty() || !arg.defaultarg.empty()) && !arg.requires.empty()) {
- vector<string> req = getVectorFromString(arg.requires);
+ if ((!arg.presetarg.empty() || !arg.defaultarg.empty()) && !arg.required.empty()) {
+ vector<string> req = getVectorFromString(arg.required);
required.insert(required.end(), req.begin(), req.end());
}
}
latexargs.find(arg->name());
if (lit != latexargs.end()) {
Layout::latexarg const & larg = lit->second;
- vector<string> req = getVectorFromString(larg.requires);
+ vector<string> req = getVectorFromString(larg.required);
move(req.begin(), req.end(), back_inserter(required));
}
}
Layout const current_layout = pit->layout();
// get the first paragraph in sequence with this layout and depth
- pit_type offset = 0;
+ ptrdiff_t offset = 0;
while (true) {
- if (lyx::prev(pit, offset) == pars.begin())
+ if (prev(pit, offset) == pars.begin())
break;
- ParagraphList::const_iterator priorpit = lyx::prev(pit, offset + 1);
+ ParagraphList::const_iterator priorpit = prev(pit, offset + 1);
if (priorpit->layout() == current_layout
&& priorpit->params().depth() == current_depth)
++offset;
break;
}
- ParagraphList::const_iterator spit = lyx::prev(pit, offset);
+ ParagraphList::const_iterator spit = prev(pit, offset);
for (; spit != pars.end(); ++spit) {
if (spit->layout() != current_layout ||
// lastpit is for the language check after the loop.
pit_type lastpit = pit;
// variables used in the loop:
+ bool was_title = false;
+ bool already_title = false;
DocumentClass const & tclass = bparams.documentClass();
// Did we already warn about inTitle layout mixing? (we only warn once)
bool gave_layout_warning = false;
for (; pit < runparams.par_end; ++pit) {
lastpit = pit;
- ParagraphList::const_iterator par = paragraphs.constIterator(pit);
+ ParagraphList::const_iterator par = paragraphs.iterator_at(pit);
// FIXME This check should not be needed. We should
// perhaps issue an error if it is.
tclass.plainLayout() : par->layout();
if (layout.intitle) {
- if (runparams.already_title) {
+ if (already_title) {
if (!gave_layout_warning && !runparams.dryrun) {
gave_layout_warning = true;
frontend::Alert::warning(_("Error in latexParagraphs"),
"could lead to missing or incorrect output."
), layout.name()));
}
- } else if (!runparams.issued_title_cmd) {
- runparams.issued_title_cmd = true;
+ } else if (!was_title) {
+ was_title = true;
if (tclass.titletype() == TITLE_ENVIRONMENT) {
os << "\\begin{"
<< from_ascii(tclass.titlename())
<< "}\n";
}
}
- } else if (runparams.issued_title_cmd &&
- !runparams.already_title && !layout.inpreamble) {
+ } else if (was_title && !already_title && !layout.inpreamble) {
if (tclass.titletype() == TITLE_ENVIRONMENT) {
os << "\\end{" << from_ascii(tclass.titlename())
<< "}\n";
os << "\\" << from_ascii(tclass.titlename())
<< "\n";
}
- runparams.already_title = true;
- runparams.issued_title_cmd = false;
+ already_title = true;
+ was_title = false;
}
if (layout.isCommand() && !layout.latexname().empty()
// Do not output empty environments if the whole paragraph has
// been deleted with ct and changes are not output.
if (size_t(pit + 1) < paragraphs.size()) {
- ParagraphList::const_iterator nextpar = paragraphs.constIterator(pit + 1);
+ ParagraphList::const_iterator nextpar = paragraphs.iterator_at(pit + 1);
Paragraph const & cpar = paragraphs.at(pit);
if ((par->layout() != nextpar->layout()
|| par->params().depth() == nextpar->params().depth()
// But if we're in a branch, this is not the end of
// the document. (There may be some other checks of this
// kind that are needed.)
- if (runparams.issued_title_cmd &&
- !runparams.already_title && !runparams.inbranch) {
+ if (was_title && !already_title && !runparams.inbranch) {
if (tclass.titletype() == TITLE_ENVIRONMENT) {
os << "\\end{" << from_ascii(tclass.titlename())
<< "}\n";
- runparams.issued_title_cmd = false;
} else {
os << "\\" << from_ascii(tclass.titlename())
<< "\n";
}
- runparams.already_title = true;
}
if (maintext && !is_child && runparams.openbtUnit)