bool BufferView::Pimpl::available() const
{
- if (buffer_ && bv_->text) return true;
+ if (buffer_ && bv_->text)
+ return true;
return false;
}
void BufferView::Pimpl::updateInset(Inset * inset, bool mark_dirty)
{
- if (!inset)
+ if (!inset || !available())
return;
// first check for locking insets
}
}
- // then check the current buffer
- if (available()) {
- hideCursor();
+ // then check if the inset is a top_level inset (has no owner)
+ // if yes do the update as always otherwise we have to update the
+ // toplevel inset where this inset is inside
+ Inset * tl_inset = inset;
+ while(tl_inset->owner())
+ tl_inset = tl_inset->owner();
+ hideCursor();
+ if (tl_inset == inset) {
update(bv_->text, BufferView::UPDATE);
if (bv_->text->updateInset(bv_, inset)) {
if (mark_dirty) {
}
return;
}
+ } else if (static_cast<UpdatableInset *>(tl_inset)
+ ->updateInsetInInset(bv_, inset))
+ {
+ if (bv_->text->updateInset(bv_, tl_inset)) {
+ update();
+ updateScrollbar();
+ }
}
}
+2002-03-08 Juergen Vigna <jug@sad.it>
+
+ * BufferView_pimpl.C (updateInset): update inset inside inset also
+ if it isn't inside theLockingInset().
+
2002-03-07 Lars Gullik Bjønnes <larsbj@birdstep.com>
* buffer.C (asciiParagraph): redo some of the word and line length
+2002-03-08 Juergen Vigna <jug@sad.it>
+
+ * insettabular.C (updateLocal): do a FULL update if we're not locked
+ and only a CELL update is asked.
+
+ * insettext.C (updateInsetInInset): update insets inside inset also
+ if it isn't inside the_locking_inset.
+
+ * insettabular.C (updateInsetInInset): ditto.
+
2002-03-06 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* insetexternal.C (doSubstitution): check whether we are using a
LyXFont font;
calculate_dimensions_of_cells(bv, font, true);
}
+ if (!locked && what == CELL)
+ what = FULL;
if (need_update < what) // only set this if it has greater update
need_update = what;
#if 0 // maybe this should not be done!
bool InsetTabular::updateInsetInInset(BufferView * bv, Inset * inset)
{
- if (!the_locking_inset)
+ Inset * tl_inset = inset;
+ // look if this inset is really inside myself!
+ while(tl_inset->owner() && tl_inset->owner() != this)
+ tl_inset = tl_inset->owner();
+ // if we enter here it's not ower inset
+ if (!tl_inset->owner())
return false;
- if (the_locking_inset != inset) {
- if (!the_locking_inset->updateInsetInInset(bv, inset))
+ // we only have to do this if this is a subinset of our cells
+ if (tl_inset != inset) {
+ if (!static_cast<InsetText *>(tl_inset)->updateInsetInInset(bv, inset))
return false;
}
updateLocal(bv, CELL, false);
lt = getLyXText(bv);
clear = true;
}
- if (!the_locking_inset) {
- bool found = lt->updateInset(bv, inset);
- if (clear)
- lt = 0;
- if (found)
- setUpdateStatus(bv, NONE);
- return found;
- }
- if (the_locking_inset != inset) {
+ if (inset->owner() != this) {
bool found = the_locking_inset->updateInsetInInset(bv, inset);
if (clear)
lt = 0;
lt = 0;
if (found) {
setUpdateStatus(bv, CURSOR_PAR);
- if (cpar(bv) == inset_par && cpos(bv) == inset_pos) {
+ if (the_locking_inset &&
+ cpar(bv) == inset_par && cpos(bv) == inset_pos)
+ {
inset_x = cx(bv) - top_x + drawTextXOffset;
inset_y = cy(bv) + drawTextYOffset;
}