From: Asger Ottar Alstrup Date: Sat, 21 Oct 2006 16:03:53 +0000 (+0000) Subject: - InsetQuotes updates the inset cache X-Git-Tag: 1.6.10~12267 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2a9abde507ed5b15e444a3ccbf0b397821595c35;p=features.git - InsetQuotes updates the inset cache - Do not use the nullpainter for the rows outside the screen, because the nullpainter does not calculate the width of text, and thus the metric entries in the inset cache are completely wrong, causing assertions when using for instance page up or page down into an inset. This fixes the dreading assertion on navigation in the user guide, and elsewhere git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15455 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/insetquotes.C b/src/insets/insetquotes.C index 1308c0543a..fa201e9850 100644 --- a/src/insets/insetquotes.C +++ b/src/insets/insetquotes.C @@ -85,18 +85,22 @@ char const * const latex_quote_babel[2][5] = InsetQuotes::InsetQuotes(string const & str) { parseString(str); + setInsetName("InsetQuotes"); } InsetQuotes::InsetQuotes(quote_language l, quote_side s, quote_times t) : language_(l), side_(s), times_(t) -{} +{ + setInsetName("InsetQuotes"); +} InsetQuotes::InsetQuotes(char_type c, BufferParams const & params) : language_(params.quotes_language), times_(params.quotes_times) { getPosition(c); + setInsetName("InsetQuotes"); } @@ -104,6 +108,7 @@ InsetQuotes::InsetQuotes(char_type c, quote_language l, quote_times t) : language_(l), times_(t) { getPosition(c); + setInsetName("InsetQuotes"); } @@ -245,6 +250,7 @@ void InsetQuotes::draw(PainterInfo & pi, int x, int y) const docstring dtext(text.begin(), text.end()); pi.pain.text(x, y, dtext, pi.base.font); } + setPosCache(pi, x, y); } diff --git a/src/rowpainter.C b/src/rowpainter.C index 3ca696147f..899e86d0fc 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -32,7 +32,6 @@ #include "vspace.h" #include "frontends/FontMetrics.h" -#include "frontends/nullpainter.h" #include "frontends/Painter.h" #include "insets/insettext.h" @@ -45,7 +44,6 @@ namespace lyx { using frontend::Painter; -using frontend::NullPainter; using frontend::FontMetrics; using std::endl; @@ -819,8 +817,6 @@ void paintPar bool repaintAll) { // lyxerr << " paintPar: pit: " << pit << " at y: " << y << endl; - static NullPainter nop; - static PainterInfo nullpi(pi.base.bv, nop); int const ww = pi.base.bv->workHeight(); pi.base.bv->coordCache().parPos()[&text][pit] = Point(x, y); @@ -867,7 +863,7 @@ void paintPar bool const inside = (y + rit->descent() >= 0 && y - rit->ascent() < ww); - RowPainter rp(inside ? pi : nullpi, text, pit, *rit, x, y); + RowPainter rp(pi, text, pit, *rit, x, y); // Clear background of this row // (if paragraph background was not cleared) if (!repaintAll &&