]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCaption.cpp
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetCaption.cpp
index e97c3b88a5677d141a3f4be5a1dedea37692815f..5c14efac0a84586daaa750a66951e9448979a14e 100644 (file)
@@ -125,8 +125,10 @@ void InsetCaption::addToToc(TocList & toclist, Buffer const & buf, ParConstItera
 }
 
 
-bool InsetCaption::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetCaption::metrics(MetricsInfo & mi, Dimension & dim) const
 {
+       Font tmpfont = mi.base.font;
+       mi.base.font = mi.base.bv->buffer().params().getFont();
        labelwidth_ = theFontMetrics(mi.base.font).width(full_label_);
        // add some space to separate the label from the inset text
        labelwidth_ += 2 * TEXT_TO_INSET_OFFSET;
@@ -135,13 +137,11 @@ bool InsetCaption::metrics(MetricsInfo & mi, Dimension & dim) const
        // Correct for button and label width
        mi.base.textwidth -= dim.wid;
        InsetText::metrics(mi, textdim);
+       mi.base.font = tmpfont;
        mi.base.textwidth += dim.wid;
        dim.des = std::max(dim.des - textdim.asc + dim.asc, textdim.des);
        dim.asc = textdim.asc;
        dim.wid += textdim.wid;
-       bool const changed = dim_ != dim;
-       dim_ = dim;
-       return changed;
 }
 
 
@@ -155,14 +155,11 @@ void InsetCaption::draw(PainterInfo & pi, int x, int y) const
 
        // Answer: the text inset (in buffer_funcs.cpp: setCaption).
 
+       Font tmpfont = pi.base.font;
+       pi.base.font = pi.base.bv->buffer().params().getFont();
        pi.pain.text(x, y, full_label_, pi.base.font);
        InsetText::draw(pi, x + labelwidth_, y);
-}
-
-
-void InsetCaption::drawSelection(PainterInfo & pi, int x, int y) const
-{
-       InsetText::drawSelection(pi, x + labelwidth_, y);
+       pi.base.font = tmpfont;
 }
 
 
@@ -201,7 +198,6 @@ bool InsetCaption::getStatus(Cursor & cur, FuncRequest const & cmd,
        switch (cmd.action) {
 
        case LFUN_BREAK_PARAGRAPH:
-       case LFUN_BREAK_PARAGRAPH_KEEP_LAYOUT:
        case LFUN_BREAK_PARAGRAPH_SKIP:
                status.enabled(false);
                return true;