]> git.lyx.org Git - features.git/commitdiff
- InsetQuotes updates the inset cache
authorAsger Ottar Alstrup <alstrup@lyx.org>
Sat, 21 Oct 2006 16:03:53 +0000 (16:03 +0000)
committerAsger Ottar Alstrup <alstrup@lyx.org>
Sat, 21 Oct 2006 16:03:53 +0000 (16:03 +0000)
- 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

src/insets/insetquotes.C
src/rowpainter.C

index 1308c0543a95a0264b276e611da4bc045c7a1a1d..fa201e98504c18984684ba71dc8388516ea13171 100644 (file)
@@ -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);
 }
 
 
index 3ca696147f7723f4431a8fe42705388857c592fd..899e86d0fcb2fca8475cfc6f22feac2e97d894a8 100644 (file)
@@ -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 &&