#include "insets/insetlatexaccent.h"
#include "insets/insettabular.h"
#include "insets/insethfill.h"
-#include "insets/inseterror.h"
#include "insets/insetnewline.h"
extern string bibitemWidest(Buffer const *);
tmp->setLabelWidthString(par->params().labelWidthString());
}
- bool const isempty = (par->layout()->keepempty && par->empty());
+ bool const isempty = (par->allowEmpty() && par->empty());
if (!isempty && (par->size() > pos || par->empty() || flag == 2)) {
tmp->layout(par->layout());
do {
par = TeXOnePar(buf, paragraphs, par, os, texrow, runparams);
- if (par != const_cast<ParagraphList&>(paragraphs).end()&& par->params().depth() > pit->params().depth()) {
+ if (par != const_cast<ParagraphList&>(paragraphs).end() && par->params().depth() > pit->params().depth()) {
if (par->layout()->isParagraph()) {
// Thinko!
InsetOptArg * optArgInset(Paragraph const & par)
{
// Find the entry.
- InsetList::iterator it = par.insetlist.begin();
- InsetList::iterator end = par.insetlist.end();
+ InsetList::const_iterator it = par.insetlist.begin();
+ InsetList::const_iterator end = par.insetlist.end();
for (; it != end; ++it) {
- Inset * ins = it.getInset();
+ Inset * ins = it->inset;
if (ins->lyxCode() == Inset::OPTARG_CODE) {
return static_cast<InsetOptArg *>(ins);
}
texrow.newline();
}
break;
- case LATEX_ENVIRONMENT:
+ case LATEX_ENVIRONMENT: {
// if its the last paragraph of the current environment
// skip it otherwise fall through
- if (boost::next(pit) != const_cast<ParagraphList&>(paragraphs).end()
- && (boost::next(pit)->layout() != pit->layout()
- || boost::next(pit)->params().depth() != pit->params().depth()))
+ ParagraphList::iterator next = boost::next(pit);
+
+ if (next != const_cast<ParagraphList&>(paragraphs).end()
+ && (next->layout() != pit->layout()
+ || next->params().depth() != pit->params().depth()))
break;
+ }
+
// fall through possible
default:
// we don't need it for the last paragraph!!!
lex.next();
font.setLyXColor(lex.getString());
} else if (token == "\\InsetSpace" || token == "\\SpecialChar") {
- LyXLayout_ptr const & layout = par.layout();
// Insets don't make sense in a free-spacing context! ---Kayvan
- if (layout->free_spacing || par.isFreeSpacing()) {
+ if (par.isFreeSpacing()) {
if (token == "\\InsetSpace")
par.insertChar(par.size(), ' ', font, change);
else if (lex.isOK()) {
lex.eatLine();
string const s = bformat(_("Unknown token: %1$s %2$s\n"),
token, lex.getString());
- // we can do this here this way because we're actually reading
- // the buffer and don't care about LyXText right now.
- par.insertInset(par.size(), new InsetError(s), font);
+
+ buf.parseError(ErrorItem(_("Unknown token"), s,
+ par.id(), 0, par.size()));
return 1;
}
return 0;