#include "OutputParams.h"
#include "Paragraph.h"
#include "ParagraphParameters.h"
+#include "texstream.h"
#include "TextClass.h"
#include "insets/InsetBibitem.h"
#include "insets/InsetArgument.h"
+#include "frontends/alert.h"
+
#include "support/lassert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/lstrings.h"
#include "support/lyxalgo.h"
#include "support/textutils.h"
+#include "support/gettext.h"
#include <QThreadStorage>
// get the first paragraph in sequence with this layout and depth
pit_type offset = 0;
while (true) {
- if (prev(pit, offset) == pars.begin())
+ if (lyx::prev(pit, offset) == pars.begin())
break;
- ParagraphList::const_iterator priorpit = prev(pit, offset + 1);
+ ParagraphList::const_iterator priorpit = lyx::prev(pit, offset + 1);
if (priorpit->layout() == current_layout
&& priorpit->params().depth() == current_depth)
++offset;
break;
}
- ParagraphList::const_iterator spit = prev(pit, offset);
+ ParagraphList::const_iterator spit = lyx::prev(pit, offset);
for (; spit != pars.end(); ++spit) {
if (spit->layout() != current_layout || spit->params().depth() < current_depth)
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);
if (layout.intitle) {
if (already_title) {
- LYXERR0("Error in latexParagraphs: You"
- " should not mix title layouts"
- " with normal ones.");
+ if (!gave_layout_warning) {
+ gave_layout_warning = true;
+ frontend::Alert::warning(_("Error in latexParagraphs"),
+ bformat(_("You are using at least one "
+ "layout (%1$s) intended for the title, "
+ "after using non-title layouts. This "
+ "could lead to missing or incorrect output."
+ ), layout.name()));
+ }
} else if (!was_title) {
was_title = true;
if (tclass.titletype() == TITLE_ENVIRONMENT) {