From 82910986f71088603dca344c62aca9693678b62e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 5 Aug 2003 11:29:58 +0000 Subject: [PATCH] * insettext.C (frame_x,y,w,h): replace member with automatic variables git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7505 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 2 ++ src/insets/insettext.C | 22 +++++++--------------- src/insets/insettext.h | 6 ------ 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index b6bcf34fdc..fc6ab2a71d 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -19,6 +19,8 @@ * insettext.C (localDispatch): merge cases with default branch + * insettext.C (frame_x,y,w,h): replace member with automatic variables + 2003-08-04 André Pönitz * insettext.[Ch] (updateLocal): remove 'what' argument by assuimng it diff --git a/src/insets/insettext.C b/src/insets/insettext.C index ef47ea9f35..09666a83b6 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -173,7 +173,6 @@ void InsetText::init(InsetText const * ins) drawTextYOffset = 0; locked = false; old_par = paragraphs.end(); - last_drawn_width = -1; sstate.cursor.par(paragraphs.end()); in_insetAllowed = false; } @@ -321,9 +320,6 @@ void InsetText::draw(PainterInfo & pi, int x, int baseline) const top_baseline = baseline; top_y = baseline - dim_.asc; - if (last_drawn_width != dim_.wid) - last_drawn_width = dim_.wid; - if (the_locking_inset && cpar() == inset_par && cpos() == inset_pos) { inset_x = cix() - x + drawTextXOffset; inset_y = ciy() + drawTextYOffset; @@ -363,16 +359,16 @@ void InsetText::draw(PainterInfo & pi, int x, int baseline) const void InsetText::drawFrame(Painter & pain, int x) const { - static int const ttoD2 = TEXT_TO_INSET_OFFSET / 2; - frame_x = x + ttoD2; - frame_y = top_baseline - dim_.asc + ttoD2; - frame_w = dim_.wid - TEXT_TO_INSET_OFFSET; - frame_h = dim_.asc + dim_.des - TEXT_TO_INSET_OFFSET; + int const ttoD2 = TEXT_TO_INSET_OFFSET / 2; + int const frame_x = x + ttoD2; + int const frame_y = top_baseline - dim_.asc + ttoD2; + int const frame_w = dim_.wid - TEXT_TO_INSET_OFFSET; + int const frame_h = dim_.asc + dim_.des - TEXT_TO_INSET_OFFSET; pain.rectangle(frame_x, frame_y, frame_w, frame_h, frame_color); } -void InsetText::updateLocal(BufferView * bv, bool mark_dirty) +void InsetText::updateLocal(BufferView * bv, bool /*mark_dirty*/) { if (!bv) return; @@ -381,15 +377,11 @@ void InsetText::updateLocal(BufferView * bv, bool mark_dirty) collapseParagraphs(bv); text_.partialRebreak(); - bool flag = mark_dirty || text_.selection.set(); if (!text_.selection.set()) text_.selection.cursor = text_.cursor; bv->fitCursor(); - - if (flag) - bv->updateInset(); - + bv->updateInset(); bv->owner()->view_state_changed(); bv->owner()->updateMenubar(); bv->owner()->updateToolbar(); diff --git a/src/insets/insettext.h b/src/insets/insettext.h index f567eba2ab..bf32fea0b1 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -308,8 +308,6 @@ private: UpdatableInset * the_locking_inset; /// mutable ParagraphList::iterator old_par; - /// - mutable int last_drawn_width; /// some funny 'temporarily saved state' mutable TextCursor sstate; @@ -317,10 +315,6 @@ private: /// // to remember old painted frame dimensions to clear it on the right spot! /// - mutable int frame_x; - mutable int frame_y; - mutable int frame_w; - mutable int frame_h; mutable bool in_insetAllowed; /// // these are used to check for mouse movement in Motion selection code