mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
rewrite ::status a bit so it's more obvious what's going on
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6497 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
872473c800
commit
9d693fbf05
@ -1,3 +1,7 @@
|
||||
2003-03-14 John Levon <levon@movementarian.org>
|
||||
|
||||
* text2.C: rewrite ::status() a bit
|
||||
|
||||
2003-03-13 John Levon <levon@movementarian.org>
|
||||
|
||||
* lyxtext.h: add some docs
|
||||
|
43
src/text2.C
43
src/text2.C
@ -2465,30 +2465,31 @@ LyXText::text_status LyXText::status() const
|
||||
}
|
||||
|
||||
|
||||
void LyXText::status(BufferView * bview, LyXText::text_status st) const
|
||||
void LyXText::status(BufferView * bview, LyXText::text_status new_status) const
|
||||
{
|
||||
// We should not lose information from previous status
|
||||
// sets, or we'll forget to repaint the other bits
|
||||
// covered by the NEED_MORE_REFRESH
|
||||
if (new_status == NEED_VERY_LITTLE_REFRESH
|
||||
&& status_ == NEED_MORE_REFRESH)
|
||||
return;
|
||||
|
||||
status_ = new_status;
|
||||
|
||||
if (new_status == UNCHANGED)
|
||||
return;
|
||||
|
||||
if (!inset_owner)
|
||||
return;
|
||||
|
||||
LyXText * t = bview->text;
|
||||
|
||||
// We should only go up with refreshing code so this means that if
|
||||
// we have a MORE refresh we should never set it to LITTLE if we still
|
||||
// didn't handle it (and then it will be UNCHANGED. Now as long as
|
||||
// we stay inside one LyXText this may work but we need to tell the
|
||||
// outermost LyXText that it should REALLY draw us if there is some
|
||||
// change in a Inset::LyXText. So you see that when we are inside a
|
||||
// inset's LyXText we give the LITTLE to the outermost LyXText to
|
||||
// tell'em that it should redraw the actual row (where the inset
|
||||
// resides! Capito?!
|
||||
|
||||
if (status_ != NEED_MORE_REFRESH || st != NEED_VERY_LITTLE_REFRESH) {
|
||||
status_ = st;
|
||||
if (inset_owner && st != UNCHANGED) {
|
||||
t->status(bview, NEED_VERY_LITTLE_REFRESH);
|
||||
if (!t->refresh_row) {
|
||||
t->refresh_row = t->cursor.row();
|
||||
t->refresh_y = t->cursor.y() -
|
||||
t->cursor.row()->baseline();
|
||||
}
|
||||
}
|
||||
// We are an inset's lyxtext. Tell the top-level lyxtext
|
||||
// it needs to update the row we're in.
|
||||
t->status(bview, NEED_VERY_LITTLE_REFRESH);
|
||||
if (!t->refresh_row) {
|
||||
t->refresh_row = t->cursor.row();
|
||||
t->refresh_y = t->cursor.y() - t->cursor.row()->baseline();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user