]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
reduce number of calls to LyXText::getFont
[lyx.git] / src / text.C
index 18c6df2476fc9f6cdb6fb1d6e29e4684bd6774f5..cd8b3c2f5d9ad2382936c246985f1711e173a0f4 100644 (file)
@@ -1649,7 +1649,7 @@ Row const & LyXText::firstRow() const
 }
 
 
-void LyXText::redoParagraph(pit_type const pit)
+bool LyXText::redoParagraph(pit_type const pit)
 {
        // remove rows of paragraph, keep track of height changes
        Paragraph & par = pars_[pit];
@@ -1657,7 +1657,7 @@ void LyXText::redoParagraph(pit_type const pit)
        // Add bibitem insets if necessary
        if (par.layout()->labeltype == LABEL_BIBLIO) {
                bool hasbibitem(false);
-               if (!par.insetlist.empty() 
+               if (!par.insetlist.empty()
                        // Insist on it being in pos 0
                        && par.getChar(0) == Paragraph::META_INSET) {
                        InsetBase * inset = par.insetlist.begin()->inset;
@@ -1668,6 +1668,7 @@ void LyXText::redoParagraph(pit_type const pit)
                        InsetBibitem * inset(new
                                InsetBibitem(InsetCommandParams("bibitem")));
                        par.insertInset(0, static_cast<InsetBase *>(inset));
+                       bv()->cursor().posRight();
                }
        }
 
@@ -1700,8 +1701,13 @@ void LyXText::redoParagraph(pit_type const pit)
 
        dim.asc += par.rows()[0].ascent();
        dim.des -= par.rows()[0].ascent();
+
+       bool const same = dim == par.dim();
+
        par.dim() = dim;
        //lyxerr << "redoParagraph: " << par.rows().size() << " rows\n";
+
+       return !same;
 }