mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
At metrics time, store paragraph id too
Instead of actually fixing the messiness of InsetInfo, let's just fix the symptom and avoid the access to Paragraph::id() that was crashing LyX every time updateBuffer/validate/metrics/draw did not happen in the right order. Fixes bug #12639.
This commit is contained in:
parent
190d2ba2c3
commit
00c39208ac
@ -42,7 +42,7 @@ namespace lyx {
|
||||
|
||||
|
||||
ParagraphMetrics::ParagraphMetrics(Paragraph const & par) :
|
||||
position_(-1), par_(&par)
|
||||
position_(-1), id_(par.id()), par_(&par)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -72,11 +72,15 @@ public:
|
||||
///
|
||||
int position() const { return position_; }
|
||||
void setPosition(int position);
|
||||
///
|
||||
int id() const { return id_; }
|
||||
|
||||
private:
|
||||
///
|
||||
int position_;
|
||||
///
|
||||
int id_;
|
||||
///
|
||||
mutable RowList rows_;
|
||||
/// cached dimensions of paragraph
|
||||
Dimension dim_;
|
||||
|
@ -1986,7 +1986,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const
|
||||
swap(pi.leftx, pi.rightx);
|
||||
|
||||
BookmarksSection::BookmarkPosList bpl =
|
||||
theSession().bookmarks().bookmarksInPar(bv_->buffer().fileName(), pm.par().id());
|
||||
theSession().bookmarks().bookmarksInPar(bv_->buffer().fileName(), pm.id());
|
||||
|
||||
for (size_t i = 0; i != nrows; ++i) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user