bool BufferView::lockInset(UpdatableInset * inset)
{
+ // don't relock if we're already locked
+ if (theLockingInset() == inset)
+ return true;
if (!theLockingInset() && inset) {
theLockingInset(inset);
return true;
+2001-11-29 Juergen Vigna <jug@sad.it>
+
+ * BufferView2.C (lockInset): don't relock if we're already locked!
+
+ * text2.C (deleteEmptyParagraphMechanism): don't do anything if it's
+ the only paragraph.
+ (removeRow): added Assert::(firstrow)
+
+ * debug.C: forgot to add INSETTEXT here.
+
2001-11-28 Juergen Vigna <jug@sad.it>
* sp_spell.C (initialize): changed error text to more general
{ Debug::INSETS, "insets", N_("LyX Insets")},
{ Debug::FILES, "files", N_("Files used by LyX")},
{ Debug::WORKAREA, "workarea", N_("Workarea events")},
- { Debug::ANY, "any", N_("All debugging messages")}
+ { Debug::INSETTEXT, "insettext", N_("Insettext/tabular messanges")},
+ { Debug::ANY, "any", N_("All debugging messages")}
};
+2001-11-29 Juergen Vigna <jug@sad.it>
+
+ * insettext.C: inserted a reinitLyXText function everywhere I delete
+ the paragraphs! This should fixe the crashes we had.
+
2001-11-28 André Pönitz <poenitz@gmx.net>
* insetnote.C: add pos initialization that I removed without
2001-11-28 Juergen Vigna <jug@sad.it>
+ * insettabular.C (resetPos): hack to not crash with infinite paints.
+
* insettabular.h: insert missing function allowSpellcheck()!
* insetcollapsable.C (draw): fixed wrong width of collapsed inset!
{
if (!locked || nodraw())
return;
+#warning This should be fixed in the right manner (20011128 Jug)
// fast hack to fix infinite repaintings!
if (in_reset_pos)
return;
par = tmp;
}
par = new Paragraph;
+ reinitLyXText();
need_update = INIT;
}
in_update = true;
if (reinit || need_update == INIT) {
need_update = FULL;
+ // we should put this call where we set need_update to INIT!
reinitLyXText();
if (owner())
owner()->update(bv, font, true);
np = np->next();
np->setInsetOwner(this);
}
+ reinitLyXText();
need_update = INIT;
}
LyXText * InsetText::getLyXText(BufferView const * lbv,
bool const recursive) const
{
- if (!recursive && (cached_bview == lbv))
+ if (!recursive && (cached_bview == lbv)) {
+ LyXText * lt = cached_text.get();
+ lyx::Assert(lt && lt->firstrow->par() == par);
return cached_text.get();
+ }
// Super UGLY! (Lgb)
BufferView * bv = const_cast<BufferView *>(lbv);
void InsetText::paragraph(Paragraph * p)
{
par = p;
-#if 0
- // we now have to update/redraw all instances
- for (Cache::iterator cit = cache.begin(); cit != cache.end(); ++cit) {
- delete cit->second;
- cit->second = 0;
- }
-#endif
+ reinitLyXText();
// redraw myself when asked for
need_update = INIT;
}
return bidi_start == -1 ||
(bidi_start <= pos && pos <= bidi_end);
}
-private:
+public:
///
mutable Row * firstrow;
+private:
///
mutable Row * lastrow;
row->next()->previous(row->previous());
if (!row->previous()) {
firstrow = row->next();
+ lyx::Assert(firstrow);
} else {
row->previous()->next(row->next());
}
void LyXText::deleteEmptyParagraphMechanism(BufferView * bview,
LyXCursor const & old_cursor) const
{
+ // don't delete anything if this is the ONLY paragraph!
+ if (!old_cursor.par()->next() && !old_cursor.par()->previous())
+ return;
+
// Would be wrong to delete anything if we have a selection.
if (selection.set()) return;