]> git.lyx.org Git - features.git/commitdiff
small cleanup
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 10 Dec 2001 09:59:39 +0000 (09:59 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 10 Dec 2001 09:59:39 +0000 (09:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3172 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insettext.C
src/insets/insettext.h

index 4d52b67c00ca556e8d52eceb868875dccfb26b0c..264b1d5acbdd5e4a85b07c33df2eb3de993e1c68 100644 (file)
@@ -1,3 +1,11 @@
+2001-12-09  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * 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  <rae@lyx.org>
 
        * insettabular.C (localDispatch): cleanup unlockInsetInInset calls
@@ -9,7 +17,7 @@
 2001-12-05  Juergen Vigna  <jug@sad.it>
 
        * 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!
 
 2001-07-18  Juergen Vigna  <jug@sad.it>
 
        * 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
index 034f5f98728b0403e8686e6b790aa8a6b2208869..f24cd8df447cbfa95d6097e20badec1414b9443e 100644 (file)
@@ -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<float>(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,
index 0a7a0f99ddc0f77bdb4db23662e44f219717bff6..9f862e4c0409372ffb3db5254860792c2b2bca12 100644 (file)
@@ -339,10 +339,6 @@ private:
        ///
        mutable int insetWidth;
        ///
-       mutable int last_width;
-       ///
-       mutable int last_height;
-       ///
        mutable int top_y;
        ///
        Paragraph * inset_par;