InsetIPA::InsetIPA(Buffer * buf)
: InsetText(buf),
- preview_(new RenderPreview(this)), use_preview_(true)
+ preview_(new RenderPreview(this))
{
- setAutoBreakRows(true);
setDrawFrame(true);
setFrameColor(Color_insetframe);
}
}
+InsetIPA & InsetIPA::operator=(InsetIPA const & other)
+{
+ if (&other == this)
+ return *this;
+
+ InsetText::operator=(other);
+ preview_.reset(new RenderPreview(*other.preview_, this));
+
+ return *this;
+}
+
+
void InsetIPA::write(ostream & os) const
{
os << "IPA" << "\n";
void InsetIPA::draw(PainterInfo & pi, int x, int y) const
{
- use_preview_ = previewState(pi.base.bv);
-
- if (use_preview_) {
+ if (previewState(pi.base.bv)) {
preview_->draw(pi, x + TEXT_TO_INSET_OFFSET, y);
setPosCache(pi, x, y);
return;
Inset * InsetIPA::editXY(Cursor & cur, int x, int y)
{
- if (use_preview_) {
+ if (previewState(&cur.bv())) {
edit(cur, true, ENTRY_DIRECTION_IGNORE);
return this;
}
dim.asc += TEXT_TO_INSET_OFFSET;
dim.des += TEXT_TO_INSET_OFFSET;
dim.wid += TEXT_TO_INSET_OFFSET;
- dim_ = dim;
dim.wid += TEXT_TO_INSET_OFFSET;
// insert a one pixel gap
dim.wid += 1;
}
+docstring InsetIPA::xhtml(XHTMLStream & xs, OutputParams const & runparams_in) const
+{
+ OutputParams runparams(runparams_in);
+ runparams.inIPA = true;
+ return InsetText::xhtml(xs, runparams);
+}
+
+
bool InsetIPA::insetAllowed(InsetCode code) const
{
switch (code) {