* insets/insettext.[Ch] (cy, ciy, setUpdateStatus):

remove unused BufferView * argument


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7270 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-07-14 15:17:40 +00:00
parent cf319aa81c
commit 135e7dc8a8
8 changed files with 46 additions and 33 deletions

View File

@ -656,7 +656,7 @@ void BufferView::Pimpl::update(LyXText * text, BufferView::UpdateCodes f)
text->partialRebreak(); text->partialRebreak();
if (text->inset_owner) { if (text->inset_owner) {
text->inset_owner->setUpdateStatus(bv_, InsetText::NONE); text->inset_owner->setUpdateStatus(InsetText::NONE);
updateInset(text->inset_owner); updateInset(text->inset_owner);
} else { } else {
update(); update();
@ -675,7 +675,7 @@ void BufferView::Pimpl::update(BufferView::UpdateCodes f)
text->partialRebreak(); text->partialRebreak();
if (text->inset_owner) { if (text->inset_owner) {
text->inset_owner->setUpdateStatus(bv_, InsetText::NONE); text->inset_owner->setUpdateStatus(InsetText::NONE);
updateInset(text->inset_owner); updateInset(text->inset_owner);
} else { } else {
update(); update();

View File

@ -1,3 +1,9 @@
2003-07-14 André Pönitz <poenitz@gmx.net>
* BufferView_pimpl.C:
* text2.C: adjust after removing unused BufferView * argument
2003-07-14 Alfredo Braunstein <abraunst@libero.it> 2003-07-14 Alfredo Braunstein <abraunst@libero.it>
* text2.C (init): fix a crash fired on resize * text2.C (init): fix a crash fired on resize

View File

@ -1,4 +1,11 @@
2003-07-14 André Pönitz <poenitz@gmx.net>
* insets/insetcollapsable.C:
* insets/insetert.C:
* insets/insettext.[Ch] (cy, ciy, setUpdateStatus):
remove unused BufferView * argument
2003-07-14 André Pönitz <poenitz@gmx.net> 2003-07-14 André Pönitz <poenitz@gmx.net>
* insettext.[Ch]: used cached metrics a bit more * insettext.[Ch]: used cached metrics a bit more

View File

@ -236,7 +236,7 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
if (collapsed_ && cmd.button() != mouse_button::button3) { if (collapsed_ && cmd.button() != mouse_button::button3) {
collapsed_ = false; collapsed_ = false;
inset.setUpdateStatus(bv, InsetText::FULL); inset.setUpdateStatus(InsetText::FULL);
bv->updateInset(this); bv->updateInset(this);
bv->buffer()->markDirty(); bv->buffer()->markDirty();
return; return;
@ -247,7 +247,7 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
{ {
if (collapsed_) { if (collapsed_) {
collapsed_ = false; collapsed_ = false;
inset.setUpdateStatus(bv, InsetText::FULL); inset.setUpdateStatus(InsetText::FULL);
bv->updateInset(this); bv->updateInset(this);
bv->buffer()->markDirty(); bv->buffer()->markDirty();
} else { } else {
@ -317,7 +317,7 @@ Inset::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
if (collapsed_) { if (collapsed_) {
collapsed_ = false; collapsed_ = false;
if (bv->lockInset(this)) { if (bv->lockInset(this)) {
inset.setUpdateStatus(bv, InsetText::FULL); inset.setUpdateStatus(InsetText::FULL);
bv->updateInset(this); bv->updateInset(this);
bv->buffer()->markDirty(); bv->buffer()->markDirty();
inset.localDispatch(cmd); inset.localDispatch(cmd);

View File

@ -585,7 +585,7 @@ void InsetERT::status(BufferView * bv, ERTStatus const st) const
switch (st) { switch (st) {
case Inlined: case Inlined:
if (bv) if (bv)
inset.setUpdateStatus(bv, InsetText::INIT); inset.setUpdateStatus(InsetText::INIT);
break; break;
case Open: case Open:
collapsed_ = false; collapsed_ = false;

View File

@ -337,7 +337,7 @@ void InsetText::draw(PainterInfo & pi, int x, int baseline) const
if (the_locking_inset && cpar() == inset_par && cpos() == inset_pos) { if (the_locking_inset && cpar() == inset_par && cpos() == inset_pos) {
inset_x = cix(bv) - int(x) + drawTextXOffset; inset_x = cix(bv) - int(x) + drawTextXOffset;
inset_y = ciy(bv) + drawTextYOffset; inset_y = ciy() + drawTextYOffset;
} }
x += TEXT_TO_INSET_OFFSET; x += TEXT_TO_INSET_OFFSET;
@ -435,7 +435,7 @@ void InsetText::update(BufferView * bv, bool reinit)
if (the_locking_inset) { if (the_locking_inset) {
inset_x = cix(bv) - top_x + drawTextXOffset; inset_x = cix(bv) - top_x + drawTextXOffset;
inset_y = ciy(bv) + drawTextYOffset; inset_y = ciy() + drawTextYOffset;
the_locking_inset->update(bv, reinit); the_locking_inset->update(bv, reinit);
} }
@ -457,7 +457,7 @@ void InsetText::update(BufferView * bv, bool reinit)
} }
void InsetText::setUpdateStatus(BufferView *, int what) const void InsetText::setUpdateStatus(int what) const
{ {
need_update |= what; need_update |= what;
// we have to redraw us full if our LyXText REFRESH_AREA or // we have to redraw us full if our LyXText REFRESH_AREA or
@ -486,7 +486,7 @@ void InsetText::updateLocal(BufferView * bv, int what, bool mark_dirty)
collapseParagraphs(bv); collapseParagraphs(bv);
text_.partialRebreak(); text_.partialRebreak();
setUpdateStatus(bv, what); setUpdateStatus(what);
bool flag = mark_dirty || bool flag = mark_dirty ||
(((need_update != CURSOR) && (need_update != NONE)) || (((need_update != CURSOR) && (need_update != NONE)) ||
(text_.refreshStatus() != LyXText::REFRESH_NONE) || text_.selection.set()); (text_.refreshStatus() != LyXText::REFRESH_NONE) || text_.selection.set());
@ -548,7 +548,7 @@ void InsetText::insetUnlock(BufferView * bv)
updateLocal(bv, code, false); updateLocal(bv, code, false);
#else #else
if (code != NONE) if (code != NONE)
setUpdateStatus(bv, code); setUpdateStatus(code);
#endif #endif
} }
@ -575,7 +575,7 @@ void InsetText::lockInset(BufferView * bv)
int code = CURSOR; int code = CURSOR;
if (drawFrame_ == LOCKED) if (drawFrame_ == LOCKED)
code = CURSOR|DRAW_FRAME; code = CURSOR|DRAW_FRAME;
setUpdateStatus(bv, code); setUpdateStatus(code);
} }
@ -583,7 +583,7 @@ void InsetText::lockInset(BufferView * bv, UpdatableInset * inset)
{ {
the_locking_inset = inset; the_locking_inset = inset;
inset_x = cix(bv) - top_x + drawTextXOffset; inset_x = cix(bv) - top_x + drawTextXOffset;
inset_y = ciy(bv) + drawTextYOffset; inset_y = ciy() + drawTextYOffset;
inset_pos = cpos(); inset_pos = cpos();
inset_par = cpar(); inset_par = cpar();
inset_boundary = cboundary(); inset_boundary = cboundary();
@ -630,7 +630,7 @@ bool InsetText::lockInsetInInset(BufferView * bv, UpdatableInset * inset)
if (cpar() == inset_par && cpos() == inset_pos) { if (cpar() == inset_par && cpos() == inset_pos) {
lyxerr[Debug::INSETS] << "OK" << endl; lyxerr[Debug::INSETS] << "OK" << endl;
inset_x = cix(bv) - top_x + drawTextXOffset; inset_x = cix(bv) - top_x + drawTextXOffset;
inset_y = ciy(bv) + drawTextYOffset; inset_y = ciy() + drawTextYOffset;
} else { } else {
lyxerr[Debug::INSETS] << "cursor.pos != inset_pos" << endl; lyxerr[Debug::INSETS] << "cursor.pos != inset_pos" << endl;
} }
@ -691,17 +691,17 @@ bool InsetText::updateInsetInInset(BufferView * bv, Inset * inset)
if (found) if (found)
text_.updateInset(tl_inset); text_.updateInset(tl_inset);
if (found) if (found)
setUpdateStatus(bv, ustat); setUpdateStatus(ustat);
return found; return found;
} }
bool found = text_.updateInset(inset); bool found = text_.updateInset(inset);
if (found) { if (found) {
setUpdateStatus(bv, CURSOR_PAR); setUpdateStatus(CURSOR_PAR);
if (the_locking_inset && if (the_locking_inset &&
cpar() == inset_par && cpos() == inset_pos) cpar() == inset_par && cpos() == inset_pos)
{ {
inset_x = cix(bv) - top_x + drawTextXOffset; inset_x = cix(bv) - top_x + drawTextXOffset;
inset_y = ciy(bv) + drawTextYOffset; inset_y = ciy() + drawTextYOffset;
} }
} }
return found; return found;
@ -822,7 +822,7 @@ bool InsetText::lfunMouseRelease(FuncRequest const & cmd)
ret = inset->localDispatch(cmd1); ret = inset->localDispatch(cmd1);
else { else {
inset_x = cix(bv) - top_x + drawTextXOffset; inset_x = cix(bv) - top_x + drawTextXOffset;
inset_y = ciy(bv) + drawTextYOffset; inset_y = ciy() + drawTextYOffset;
cmd1.x = cmd.x - inset_x; cmd1.x = cmd.x - inset_x;
cmd1.y = cmd.x - inset_y; cmd1.y = cmd.x - inset_y;
inset->edit(bv, cmd1.x, cmd1.y, cmd.button()); inset->edit(bv, cmd1.x, cmd1.y, cmd.button());
@ -1534,7 +1534,7 @@ void InsetText::getCursor(BufferView & bv, int & x, int & y) const
return; return;
} }
x = cx(&bv); x = cx(&bv);
y = cy(&bv) + InsetText::y(); y = cy() + InsetText::y();
} }
@ -1545,7 +1545,7 @@ void InsetText::getCursorPos(BufferView * bv, int & x, int & y) const
return; return;
} }
x = cx(bv) - top_x - TEXT_TO_INSET_OFFSET; x = cx(bv) - top_x - TEXT_TO_INSET_OFFSET;
y = cy(bv) - TEXT_TO_INSET_OFFSET; y = cy() - TEXT_TO_INSET_OFFSET;
} }
@ -1570,7 +1570,7 @@ void InsetText::fitInsetCursor(BufferView * bv) const
int const asc = font_metrics::maxAscent(font); int const asc = font_metrics::maxAscent(font);
int const desc = font_metrics::maxDescent(font); int const desc = font_metrics::maxDescent(font);
if (bv->fitLockedInsetCursor(cx(bv), cy(bv), asc, desc)) if (bv->fitLockedInsetCursor(cx(bv), cy(), asc, desc))
need_update |= FULL; need_update |= FULL;
} }
@ -1801,7 +1801,7 @@ bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
if (y < 0) if (y < 0)
y = dim_.des; y = dim_.des;
inset_x = cix(bv) - top_x + drawTextXOffset; inset_x = cix(bv) - top_x + drawTextXOffset;
inset_y = ciy(bv) + drawTextYOffset; inset_y = ciy() + drawTextYOffset;
FuncRequest cmd(bv, LFUN_INSET_EDIT, x - inset_x, y - inset_y, button); FuncRequest cmd(bv, LFUN_INSET_EDIT, x - inset_x, y - inset_y, button);
inset->localDispatch(cmd); inset->localDispatch(cmd);
if (!the_locking_inset) if (!the_locking_inset)
@ -1936,13 +1936,13 @@ int InsetText::cix(BufferView * bv) const
} }
int InsetText::cy(BufferView * bv) const int InsetText::cy() const
{ {
return text_.cursor.y() - dim_.asc + TEXT_TO_INSET_OFFSET; return text_.cursor.y() - dim_.asc + TEXT_TO_INSET_OFFSET;
} }
int InsetText::ciy(BufferView * bv) const int InsetText::ciy() const
{ {
return text_.cursor.iy() - dim_.asc + TEXT_TO_INSET_OFFSET; return text_.cursor.iy() - dim_.asc + TEXT_TO_INSET_OFFSET;
} }
@ -2032,7 +2032,7 @@ void InsetText::resizeLyXText(BufferView * bv, bool force) const
if (the_locking_inset) { if (the_locking_inset) {
inset_x = cix(bv) - top_x + drawTextXOffset; inset_x = cix(bv) - top_x + drawTextXOffset;
inset_y = ciy(bv) + drawTextYOffset; inset_y = ciy() + drawTextYOffset;
} }
text_.top_y(bv->screen().topCursorVisible(&text_)); text_.top_y(bv->screen().topCursorVisible(&text_));
@ -2063,7 +2063,7 @@ void InsetText::reinitLyXText() const
restoreLyXTextState(); restoreLyXTextState();
if (the_locking_inset) { if (the_locking_inset) {
inset_x = cix(bv) - top_x + drawTextXOffset; inset_x = cix(bv) - top_x + drawTextXOffset;
inset_y = ciy(bv) + drawTextYOffset; inset_y = ciy() + drawTextYOffset;
} }
text_.top_y(bv->screen().topCursorVisible(&text_)); text_.top_y(bv->screen().topCursorVisible(&text_));
if (!owner()) { if (!owner()) {
@ -2192,7 +2192,7 @@ InsetText::selectNextWordToSpellcheck(BufferView * bv, float & value) const
if (the_locking_inset) { if (the_locking_inset) {
word = the_locking_inset->selectNextWordToSpellcheck(bv, value); word = the_locking_inset->selectNextWordToSpellcheck(bv, value);
if (!word.word().empty()) { if (!word.word().empty()) {
value += cy(bv); value += cy();
return word; return word;
} }
// we have to go on checking so move cursor to the next char // we have to go on checking so move cursor to the next char
@ -2202,7 +2202,7 @@ InsetText::selectNextWordToSpellcheck(BufferView * bv, float & value) const
if (word.word().empty()) if (word.word().empty())
bv->unlockInset(const_cast<InsetText *>(this)); bv->unlockInset(const_cast<InsetText *>(this));
else else
value = cy(bv); value = cy();
return word; return word;
} }

View File

@ -94,7 +94,7 @@ public:
/// ///
void update(BufferView *, bool = false); void update(BufferView *, bool = false);
/// ///
void setUpdateStatus(BufferView *, int what) const; void setUpdateStatus(int what) const;
/// ///
string const editMessage() const; string const editMessage() const;
/// ///
@ -306,9 +306,9 @@ private:
/// ///
int cix(BufferView *) const; int cix(BufferView *) const;
/// ///
int cy(BufferView *) const; int cy() const;
/// ///
int ciy(BufferView *) const; int ciy() const;
/// ///
lyx::pos_type cpos() const; lyx::pos_type cpos() const;
/// ///

View File

@ -764,7 +764,7 @@ void LyXText::setSelection()
bool const lsel = TextCursor::setSelection(); bool const lsel = TextCursor::setSelection();
if (inset_owner && (selection.set() || lsel)) if (inset_owner && (selection.set() || lsel))
inset_owner->setUpdateStatus(bv(), InsetText::SELECTION); inset_owner->setUpdateStatus(InsetText::SELECTION);
} }
@ -851,7 +851,7 @@ void LyXText::toggleFree(LyXFont const & font, bool toggleall)
selection.cursor = cursor; selection.cursor = cursor;
} }
if (inset_owner) if (inset_owner)
inset_owner->setUpdateStatus(bv(), InsetText::CURSOR_PAR); inset_owner->setUpdateStatus(InsetText::CURSOR_PAR);
} }