mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
- 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
This commit is contained in:
parent
262a4c7385
commit
2a9abde507
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 &&
|
||||
|
Loading…
Reference in New Issue
Block a user