From ca3c70ec58dc240bc18f99d87f606a63f1f77c4a Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 10 Dec 2001 09:59:39 +0000 Subject: [PATCH] small cleanup git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3172 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 12 ++++++++++-- src/insets/insettext.C | 16 ++++++---------- src/insets/insettext.h | 4 ---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 4d52b67c00..264b1d5acb 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,11 @@ +2001-12-09 Jean-Marc Lasgouttes + + * insettext.C (draw): + (drawFrame): use insetWidth instead of last_width + + * insettext.h: remove variable last_width (insetWidth is exactly + the same) and last_height (computed but never used!) + 2001-12-10 Allan Rae * insettabular.C (localDispatch): cleanup unlockInsetInInset calls @@ -9,7 +17,7 @@ 2001-12-05 Juergen Vigna * insettext.C (insetAllowed): fixed for the case that we directly - ask the insettext from it's LyXText. + ask the insettext from its LyXText. (paragraph): fixed the crash when assigning the par->next() from the EmptyParagraphMechanism! @@ -825,7 +833,7 @@ 2001-07-18 Juergen Vigna * insetcollapsable.C (edit): fixed hopefully the y parameter which - is givven to the InsetText. + is given to the InsetText. (insetButtonPress): ditto (insetButtonRelease): ditto (insetMotionNotify): ditto diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 034f5f9872..f24cd8df44 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -179,8 +179,6 @@ void InsetText::init(InsetText const * ins, bool same_id) autoBreakRows = false; } top_y = 0; - last_width = 0; - last_height = 0; insetAscent = 0; insetDescent = 0; insetWidth = 0; @@ -398,9 +396,9 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, x += static_cast(scroll()); // if top_x differs we did it already - if (!cleared && (top_x == int(x)) && - ((need_update&(INIT|FULL)) || (top_baseline!=baseline) || - (last_drawn_width!=insetWidth))) { + if (!cleared && (top_x == int(x)) + && ((need_update&(INIT|FULL)) || (top_baseline != baseline) + ||(last_drawn_width != insetWidth))) { clearInset(bv, baseline, cleared); } @@ -417,8 +415,6 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, top_baseline = baseline; top_y = baseline - ascent(bv, f); - last_width = width(bv, f); - last_height = ascent(bv, f) + descent(bv, f); if (last_drawn_width != insetWidth) { if (!cleared) @@ -435,7 +431,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, if (!cleared && (need_update == CURSOR) && !getLyXText(bv)->selection.set()) { drawFrame(pain, cleared); - x += last_width; // was width(bv, f); + x += insetWidth; need_update = NONE; return; } @@ -498,7 +494,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, clearFrame(pain, cleared); } - x += last_width /* was width(bv, f) */ - TEXT_TO_INSET_OFFSET; + x += insetWidth - TEXT_TO_INSET_OFFSET; if (bv->text->status() == LyXText::CHANGED_IN_DRAW) { need_update |= FULL; @@ -517,7 +513,7 @@ void InsetText::drawFrame(Painter & pain, bool cleared) const if (!frame_is_visible || cleared) { frame_x = top_x + ttoD2; frame_y = top_baseline - insetAscent + ttoD2; - frame_w = last_width - TEXT_TO_INSET_OFFSET; + frame_w = insetWidth - TEXT_TO_INSET_OFFSET; frame_h = insetAscent + insetDescent - TEXT_TO_INSET_OFFSET; pain.rectangle(frame_x, frame_y, frame_w, frame_h, diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 0a7a0f99dd..9f862e4c04 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -339,10 +339,6 @@ private: /// mutable int insetWidth; /// - mutable int last_width; - /// - mutable int last_height; - /// mutable int top_y; /// Paragraph * inset_par; -- 2.39.2