]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
refrain from computing width in setHeightOfRow as this happens already
[lyx.git] / src / paragraph.C
index 351c8e4434abe4ee3ccd45459354448ebb3aac6b..8c640b6d6277b22f9e39b896d7357106507d54e6 100644 (file)
@@ -374,12 +374,12 @@ LyXFont const Paragraph::getFont(BufferParams const & bparams, pos_type pos,
        else
                layoutfont = lout->font;
 
-       LyXFont tmpfont = getFontSettings(bparams, pos);
-       tmpfont.realize(layoutfont);
-       tmpfont.realize(outerfont);
-       tmpfont.realize(bparams.getLyXTextClass().defaultfont());
+       LyXFont font = getFontSettings(bparams, pos);
+       font.realize(layoutfont);
+       font.realize(outerfont);
+       font.realize(bparams.getLyXTextClass().defaultfont());
 
-       return tmpfont;
+       return font;
 }
 
 
@@ -637,7 +637,7 @@ int Paragraph::beginningOfBody() const
 
        // Unroll the first two cycles of the loop
        // and remember the previous character to
-       // remove unnecessary GetChar() calls
+       // remove unnecessary getChar() calls
        pos_type i = 0;
        if (i < size() && !isNewline(i)) {
                ++i;
@@ -1420,3 +1420,15 @@ bool Paragraph::allowEmpty() const
                return pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE;
        return false;
 }
+
+
+RowList::iterator Paragraph::getRow(pos_type pos)
+{
+       RowList::iterator rit = rows.end();
+       RowList::iterator const begin = rows.begin();
+
+       for (--rit; rit != begin && rit->pos() > pos; --rit)
+               ;
+
+       return rit;
+}