From 135e7dc8a8d0c14fce10df63f59a0f74cbb84dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 14 Jul 2003 15:17:40 +0000 Subject: [PATCH] * 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 --- src/BufferView_pimpl.C | 4 ++-- src/ChangeLog | 6 +++++ src/insets/ChangeLog | 7 ++++++ src/insets/insetcollapsable.C | 6 ++--- src/insets/insetert.C | 2 +- src/insets/insettext.C | 44 +++++++++++++++++------------------ src/insets/insettext.h | 6 ++--- src/text2.C | 4 ++-- 8 files changed, 46 insertions(+), 33 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 3d89894972..eb8b893a4b 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -656,7 +656,7 @@ void BufferView::Pimpl::update(LyXText * text, BufferView::UpdateCodes f) text->partialRebreak(); if (text->inset_owner) { - text->inset_owner->setUpdateStatus(bv_, InsetText::NONE); + text->inset_owner->setUpdateStatus(InsetText::NONE); updateInset(text->inset_owner); } else { update(); @@ -675,7 +675,7 @@ void BufferView::Pimpl::update(BufferView::UpdateCodes f) text->partialRebreak(); if (text->inset_owner) { - text->inset_owner->setUpdateStatus(bv_, InsetText::NONE); + text->inset_owner->setUpdateStatus(InsetText::NONE); updateInset(text->inset_owner); } else { update(); diff --git a/src/ChangeLog b/src/ChangeLog index a60d8d15b2..2e86ed7ed0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ + +2003-07-14 André Pönitz + + * BufferView_pimpl.C: + * text2.C: adjust after removing unused BufferView * argument + 2003-07-14 Alfredo Braunstein * text2.C (init): fix a crash fired on resize diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index c9371651d0..28abbb4c7c 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,4 +1,11 @@ +2003-07-14 André Pönitz + + * insets/insetcollapsable.C: + * insets/insetert.C: + * insets/insettext.[Ch] (cy, ciy, setUpdateStatus): + remove unused BufferView * argument + 2003-07-14 André Pönitz * insettext.[Ch]: used cached metrics a bit more diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index d57f809711..7f24b59882 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -236,7 +236,7 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd) if (collapsed_ && cmd.button() != mouse_button::button3) { collapsed_ = false; - inset.setUpdateStatus(bv, InsetText::FULL); + inset.setUpdateStatus(InsetText::FULL); bv->updateInset(this); bv->buffer()->markDirty(); return; @@ -247,7 +247,7 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd) { if (collapsed_) { collapsed_ = false; - inset.setUpdateStatus(bv, InsetText::FULL); + inset.setUpdateStatus(InsetText::FULL); bv->updateInset(this); bv->buffer()->markDirty(); } else { @@ -317,7 +317,7 @@ Inset::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd) if (collapsed_) { collapsed_ = false; if (bv->lockInset(this)) { - inset.setUpdateStatus(bv, InsetText::FULL); + inset.setUpdateStatus(InsetText::FULL); bv->updateInset(this); bv->buffer()->markDirty(); inset.localDispatch(cmd); diff --git a/src/insets/insetert.C b/src/insets/insetert.C index 4e0e832f63..f88b46bf98 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -585,7 +585,7 @@ void InsetERT::status(BufferView * bv, ERTStatus const st) const switch (st) { case Inlined: if (bv) - inset.setUpdateStatus(bv, InsetText::INIT); + inset.setUpdateStatus(InsetText::INIT); break; case Open: collapsed_ = false; diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 608a1888d8..9618b091f9 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -337,7 +337,7 @@ void InsetText::draw(PainterInfo & pi, int x, int baseline) const if (the_locking_inset && cpar() == inset_par && cpos() == inset_pos) { inset_x = cix(bv) - int(x) + drawTextXOffset; - inset_y = ciy(bv) + drawTextYOffset; + inset_y = ciy() + drawTextYOffset; } x += TEXT_TO_INSET_OFFSET; @@ -435,7 +435,7 @@ void InsetText::update(BufferView * bv, bool reinit) if (the_locking_inset) { inset_x = cix(bv) - top_x + drawTextXOffset; - inset_y = ciy(bv) + drawTextYOffset; + inset_y = ciy() + drawTextYOffset; 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; // 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); text_.partialRebreak(); - setUpdateStatus(bv, what); + setUpdateStatus(what); bool flag = mark_dirty || (((need_update != CURSOR) && (need_update != NONE)) || (text_.refreshStatus() != LyXText::REFRESH_NONE) || text_.selection.set()); @@ -548,7 +548,7 @@ void InsetText::insetUnlock(BufferView * bv) updateLocal(bv, code, false); #else if (code != NONE) - setUpdateStatus(bv, code); + setUpdateStatus(code); #endif } @@ -575,7 +575,7 @@ void InsetText::lockInset(BufferView * bv) int code = CURSOR; if (drawFrame_ == LOCKED) code = CURSOR|DRAW_FRAME; - setUpdateStatus(bv, code); + setUpdateStatus(code); } @@ -583,7 +583,7 @@ void InsetText::lockInset(BufferView * bv, UpdatableInset * inset) { the_locking_inset = inset; inset_x = cix(bv) - top_x + drawTextXOffset; - inset_y = ciy(bv) + drawTextYOffset; + inset_y = ciy() + drawTextYOffset; inset_pos = cpos(); inset_par = cpar(); inset_boundary = cboundary(); @@ -630,7 +630,7 @@ bool InsetText::lockInsetInInset(BufferView * bv, UpdatableInset * inset) if (cpar() == inset_par && cpos() == inset_pos) { lyxerr[Debug::INSETS] << "OK" << endl; inset_x = cix(bv) - top_x + drawTextXOffset; - inset_y = ciy(bv) + drawTextYOffset; + inset_y = ciy() + drawTextYOffset; } else { lyxerr[Debug::INSETS] << "cursor.pos != inset_pos" << endl; } @@ -691,17 +691,17 @@ bool InsetText::updateInsetInInset(BufferView * bv, Inset * inset) if (found) text_.updateInset(tl_inset); if (found) - setUpdateStatus(bv, ustat); + setUpdateStatus(ustat); return found; } bool found = text_.updateInset(inset); if (found) { - setUpdateStatus(bv, CURSOR_PAR); + setUpdateStatus(CURSOR_PAR); if (the_locking_inset && cpar() == inset_par && cpos() == inset_pos) { inset_x = cix(bv) - top_x + drawTextXOffset; - inset_y = ciy(bv) + drawTextYOffset; + inset_y = ciy() + drawTextYOffset; } } return found; @@ -822,7 +822,7 @@ bool InsetText::lfunMouseRelease(FuncRequest const & cmd) ret = inset->localDispatch(cmd1); else { inset_x = cix(bv) - top_x + drawTextXOffset; - inset_y = ciy(bv) + drawTextYOffset; + inset_y = ciy() + drawTextYOffset; cmd1.x = cmd.x - inset_x; cmd1.y = cmd.x - inset_y; inset->edit(bv, cmd1.x, cmd1.y, cmd.button()); @@ -1534,7 +1534,7 @@ void InsetText::getCursor(BufferView & bv, int & x, int & y) const return; } 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; } 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 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; } @@ -1801,7 +1801,7 @@ bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y, if (y < 0) y = dim_.des; 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); inset->localDispatch(cmd); 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; } -int InsetText::ciy(BufferView * bv) const +int InsetText::ciy() const { 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) { inset_x = cix(bv) - top_x + drawTextXOffset; - inset_y = ciy(bv) + drawTextYOffset; + inset_y = ciy() + drawTextYOffset; } text_.top_y(bv->screen().topCursorVisible(&text_)); @@ -2063,7 +2063,7 @@ void InsetText::reinitLyXText() const restoreLyXTextState(); if (the_locking_inset) { inset_x = cix(bv) - top_x + drawTextXOffset; - inset_y = ciy(bv) + drawTextYOffset; + inset_y = ciy() + drawTextYOffset; } text_.top_y(bv->screen().topCursorVisible(&text_)); if (!owner()) { @@ -2192,7 +2192,7 @@ InsetText::selectNextWordToSpellcheck(BufferView * bv, float & value) const if (the_locking_inset) { word = the_locking_inset->selectNextWordToSpellcheck(bv, value); if (!word.word().empty()) { - value += cy(bv); + value += cy(); return word; } // 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()) bv->unlockInset(const_cast(this)); else - value = cy(bv); + value = cy(); return word; } diff --git a/src/insets/insettext.h b/src/insets/insettext.h index e598c21536..623123c966 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -94,7 +94,7 @@ public: /// void update(BufferView *, bool = false); /// - void setUpdateStatus(BufferView *, int what) const; + void setUpdateStatus(int what) const; /// string const editMessage() const; /// @@ -306,9 +306,9 @@ private: /// int cix(BufferView *) const; /// - int cy(BufferView *) const; + int cy() const; /// - int ciy(BufferView *) const; + int ciy() const; /// lyx::pos_type cpos() const; /// diff --git a/src/text2.C b/src/text2.C index f0bb99e35a..08cf07eea0 100644 --- a/src/text2.C +++ b/src/text2.C @@ -764,7 +764,7 @@ void LyXText::setSelection() bool const lsel = TextCursor::setSelection(); 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; } if (inset_owner) - inset_owner->setUpdateStatus(bv(), InsetText::CURSOR_PAR); + inset_owner->setUpdateStatus(InsetText::CURSOR_PAR); }