}
+void InsetText::setOuterFont(BufferView & bv, FontInfo const & outer) const
+{
+ TextMetrics & tm = bv.textMetrics(&text_);
+ FontInfo tmpfont = getFont();
+ tmpfont.realize(outer);
+ tm.font_.fontInfo() = tmpfont;
+}
+
+
void InsetText::metrics(MetricsInfo & mi, Dimension & dim) const
{
TextMetrics & tm = mi.base.bv->textMetrics(&text_);
//lyxerr << "InsetText::metrics: width: " << mi.base.textwidth << endl;
int const horiz_offset = leftOffset(mi.base.bv) + rightOffset(mi.base.bv);
-
- // Hand font through to contained lyxtext:
- tm.font_.fontInfo() = mi.base.font;
mi.base.textwidth -= horiz_offset;
+ // Remember the full outer font
+ setOuterFont(*mi.base.bv, mi.base.font);
+ // and use it in these metrics computation.
+ mi.base.font = tm.font_.fontInfo();
+
// This can happen when a layout has a left and right margin,
// and the view is made very narrow. We can't do better than
// to draw it partly out of view (bug 5890).
|| cmd.getArg(0) == insetName(lyxCode());
if (!main_inset && target_inset) {
+ UndoGroupHelper ugh(&buffer());
// Text::dissolveInset assumes that the cursor
// is inside the Inset.
- if (&cur.inset() != this)
+ if (&cur.inset() != this) {
+ cur.recordUndo();
cur.pushBackward(*this);
- cur.beginUndoGroup();
+ }
text_.dispatch(cur, cmd);
- cur.endUndoGroup();
} else
cur.undispatched();
break;
// No need for labels that are generated from counters. They should be handled by the external DocBook processor.
// With respect to XHTML, paragraphs are still allowed here.
- if (!allowMultiPar())
+ if (runparams.docbook_consider_allow_multi_par && !allowMultiPar())
runparams.docbook_make_pars = false;
if (il.isPassThru())
runparams.pass_thru = true;
bool InsetText::insetAllowed(InsetCode code) const
{
switch (code) {
- // Arguments and (plain) quotes are also allowed in PassThru insets
+ // Arguments, (plain) quotes and counter insets
+ // are also allowed in PassThru insets
case ARG_CODE:
case QUOTE_CODE:
+ case COUNTER_CODE:
return true;
default:
return !isPassThru();