Some more small fixes. Hopefully we'll get there soon!

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2412 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2001-08-03 13:09:59 +00:00
parent 757e2c55d8
commit 0e9af0297f
5 changed files with 29 additions and 9 deletions

View File

@ -981,6 +981,9 @@ void BufferView::Pimpl::update()
bv_->text->status(bv_, st);
screen_->update(bv_->text, bv_);
}
// do this here instead of in the screen::update because of
// the above loop!
bv_->text->status(bv_, LyXText::UNCHANGED);
if (fitc)
fitCursor();
}

View File

@ -1,3 +1,8 @@
2001-08-03 Juergen Vigna <jug@sad.it>
* insettext.C (setFont): don't call for a draw update if we're just
changing the cursor font!
2001-08-02 Juergen Vigna <jug@sad.it>
* insettext.C (draw): clear the background with the right color if

View File

@ -1579,6 +1579,10 @@ void InsetText::setFont(BufferView * bv, LyXFont const & font, bool toggleall,
the_locking_inset->setFont(bv, font, toggleall, selectall);
return;
}
if ((!par->next() && !par->size()) || !cpar(bv)->size()) {
getLyXText(bv)->setFont(bv, font, toggleall);
return;
}
bool clear = false;
if (!lt) {
lt = getLyXText(bv);

View File

@ -432,7 +432,7 @@ bool LyXScreen::fitCursor(LyXText * text, BufferView * bv)
void LyXScreen::update(LyXText * text, BufferView * bv,
int y_offset, int x_offset)
int y_offset, int x_offset)
{
switch (text->status()) {
case LyXText::NEED_MORE_REFRESH:
@ -440,7 +440,10 @@ void LyXScreen::update(LyXText * text, BufferView * bv,
int const y = max(int(text->refresh_y - text->first), 0);
drawFromTo(text, bv, y, owner.height(), y_offset, x_offset);
text->refresh_y = 0;
text->status(bv, LyXText::UNCHANGED);
// otherwise this is called ONLY from BufferView_pimpl(update)
// or we should see to set this flag accordingly
if (text != bv->text)
text->status(bv, LyXText::UNCHANGED);
expose(0, y, owner.workWidth(), owner.height() - y);
}
break;
@ -452,7 +455,10 @@ void LyXScreen::update(LyXText * text, BufferView * bv,
// this because if we had a major update the refresh_row could
// have been set to 0!
if (text->refresh_row) {
text->status(bv, LyXText::UNCHANGED);
// otherwise this is called ONLY from BufferView_pimpl(update)
// or we should see to set this flag accordingly
if (text != bv->text)
text->status(bv, LyXText::UNCHANGED);
expose(0, text->refresh_y - text->first + y_offset,
owner.workWidth(), text->refresh_row->height());
}

View File

@ -675,10 +675,12 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
// Determine basis font
LyXFont layoutfont;
if (cursor.pos() < beginningOfMainBody(bview->buffer(),
cursor.par()))
cursor.par()))
{
layoutfont = getFont(bview->buffer(), cursor.par(),-2);
else
} else {
layoutfont = getFont(bview->buffer(), cursor.par(),-1);
}
// Update current font
real_current_font.update(font, toggleall);
@ -697,12 +699,12 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
// and sel_end cursor
setUndo(bview, Undo::EDIT,
selection.start.par(),
selection.end.par()->next());
selection.start.par(), selection.end.par()->next());
freezeUndo();
cursor = selection.start;
while (cursor.par() != selection.end.par() ||
(cursor.pos() < selection.end.pos())) {
(cursor.pos() < selection.end.pos()))
{
if (cursor.pos() < cursor.par()->size()) {
// an open footnote should behave
// like a closed one
@ -726,7 +728,7 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
clearSelection();
setSelection(bview);
setCursor(bview, tmpcursor.par(), tmpcursor.pos(), true,
tmpcursor.boundary());
tmpcursor.boundary());
}