]> git.lyx.org Git - lyx.git/blobdiff - src/text3.C
reduce number of calls to LyXText::getFont
[lyx.git] / src / text3.C
index 5bb93fc65f31603acebe716b75fbc4e49d060fbc..4f99c9cee6a8d0474ce337d147ccd254ab85647e 100644 (file)
@@ -263,7 +263,7 @@ void update(LCursor & cur)
 {
        //we don't call update(true, false) directly to save a metrics call
        if (cur.bv().fitCursor())
-               cur.bv().update(false, true);
+               cur.bv().update(Update::Force);
 }
 
 
@@ -1130,9 +1130,12 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                cur.resetAnchor();
                moveCursor(cur, false);
 
-               // real_current_font.number can change so we need to
-               // update the minibuffer
-               if (old_font != real_current_font)
+               needsUpdate = redoParagraph(cur.pit());
+               if (!needsUpdate) {
+                       // update only this paragraph
+                       cur.bv().update(Update::SinglePar | Update::Force);
+               }
+
                bv->updateScrollbar();
                break;
        }
@@ -1564,6 +1567,10 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
                flag.setOnOff(cur.paragraph().params().startOfAppendix());
                return true;
 
+       case LFUN_INSERT_BIBITEM:
+               enable = (cur.paragraph().layout()->labeltype == LABEL_BIBLIO);
+               break;
+
 #if 0
        // the functions which insert insets
        InsetBase::Code code = InsetBase::NO_CODE;
@@ -1828,7 +1835,6 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
        case LFUN_INSERT_LABEL:
        case LFUN_INSERT_NOTE:
        case LFUN_INSERT_CHARSTYLE:
-       case LFUN_INSERT_BIBITEM:
        case LFUN_INSET_FLOAT:
        case LFUN_INSET_FOOTNOTE:
        case LFUN_INSET_MARGINAL: