* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Jürgen Vigna
+ * \author Jürgen Vigna
*
* Full author contact details are available in file CREDITS.
*/
InsetText::InsetText(Buffer const & buf)
: drawFrame_(false), frame_color_(Color_insetframe)
{
- initParagraphs(buf.params());
setBuffer(const_cast<Buffer &>(buf));
+ initParagraphs();
}
}
-void InsetText::initParagraphs(BufferParams const & bparams)
+void InsetText::initParagraphs()
{
LASSERT(paragraphs().empty(), /**/);
paragraphs().push_back(Paragraph());
Paragraph & ourpar = paragraphs().back();
ourpar.setInsetOwner(this);
- ourpar.setPlainOrDefaultLayout(bparams.documentClass());
+ ourpar.setDefaultLayout(buffer_->params().documentClass());
}
int const h = tm.height() + 2 * TEXT_TO_INSET_OFFSET;
int const xframe = x + TEXT_TO_INSET_OFFSET / 2;
if (pi.full_repaint)
- pi.pain.fillRectangle(xframe, yframe, w, h, backgroundColor());
+ pi.pain.fillRectangle(xframe, yframe, w, h,
+ pi.backgroundColor(this));
+
if (drawFrame_)
pi.pain.rectangle(xframe, yframe, w, h, frameColor());
}
+ ColorCode const old_color = pi.background_color;
+ pi.background_color = pi.backgroundColor(this, false);
+
tm.draw(pi, x + TEXT_TO_INSET_OFFSET, y);
+
+ pi.background_color = old_color;
}
{
ParIterator it2 = it;
it2.forwardPos();
- LASSERT(&it2.inset() == this && it2.pit() == 0, /**/);
- if (producesOutput())
- lyx::updateLabels(buffer(), it2);
- else {
- DocumentClass const & tclass = buffer().params().documentClass();
+ LASSERT(&it2.inset() == this && it2.pit() == 0, return);
+ if (producesOutput()) {
+ buffer().updateLabels(it2);
+ } else {
+ DocumentClass const & tclass = buffer().masterBuffer()->params().documentClass();
Counters const savecnt = tclass.counters();
- lyx::updateLabels(buffer(), it2);
+ buffer().updateLabels(it2);
tclass.counters() = savecnt;
}
}
*static_cast<InsetOptArg&>(inset).paragraphs().begin();
if (!par.labelString().empty())
tocstring = par.labelString() + ' ';
- tocstring += insetpar.asString();
+ tocstring += insetpar.asString(AS_STR_INSETS);
break;
}
default:
dit.pos() = 0;
// insert this into the table of contents
if (tocstring.empty())
- tocstring = par.asString(AS_STR_LABEL);
+ tocstring = par.asString(AS_STR_LABEL | AS_STR_INSETS);
toc.push_back(TocItem(dit, toclevel - min_toclevel, tocstring));
}