.. by assuming  what == FULL everywhere (unless INIT).

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)
Index: insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.464
diff -u -p -r1.464 insettext.C
--- insettext.C 2 Aug 2003 11:30:27 -0000       1.464
+++ insettext.C 4 Aug 2003 15:09:58 -0000
@@ -395,7 +395,7 @@ void InsetText::setUpdateStatus(int what
 }
 
 
-void InsetText::updateLocal(BufferView * bv, int what, bool mark_dirty)
+void InsetText::updateLocal(BufferView * bv, bool mark_dirty)
 {
        if (!bv)
                return;
@@ -404,7 +404,7 @@ void InsetText::updateLocal(BufferView *
                collapseParagraphs(bv);
 
        text_.partialRebreak();
-       setUpdateStatus(what);
+       setUpdateStatus(FULL);
        bool flag = mark_dirty ||
                (need_update != CURSOR && need_update != NONE) ||
                text_.selection.set();
@@ -439,7 +439,7 @@ void InsetText::insetUnlock(BufferView *
        if (the_locking_inset) {
                the_locking_inset->insetUnlock(bv);
                the_locking_inset = 0;
-               updateLocal(bv, CURSOR_PAR, false);
+               updateLocal(bv, false);
        }
        no_selection = true;
        locked = false;
@@ -460,12 +460,8 @@ void InsetText::insetUnlock(BufferView *
        } else if (paragraphs.size() > 1) {
                text_.setCursor(boost::next(first_par), 0);
        }
-#if 0
-       updateLocal(bv, code, false);
-#else
        if (code != NONE)
                setUpdateStatus(code);
-#endif
 }
 
 
@@ -503,7 +499,6 @@ void InsetText::lockInset(BufferView * /
        inset_pos = cpos();
        inset_par = cpar();
        inset_boundary = cboundary();
-       //updateLocal(bv, CURSOR, false);
 }
 
 
@@ -580,7 +575,7 @@ bool InsetText::unlockInsetInInset(Buffe
                if (scroll())
                        scroll(bv, 0.0F);
                else
-                       updateLocal(bv, CURSOR, false);
+                       updateLocal(bv, false);
                return true;
        }
        return the_locking_inset->unlockInsetInInset(bv, inset, lr);
@@ -670,7 +665,7 @@ void InsetText::lfunMousePress(FuncReque
                        }
                        inset->localDispatch(cmd1);
                        if (the_locking_inset)
-                               updateLocal(bv, CURSOR, false);
+                               updateLocal(bv, false);
                        return;
                }
        }
@@ -688,13 +683,8 @@ void InsetText::lfunMousePress(FuncReque
                text_.selection.cursor = text_.cursor;
                text_.cursor.x_fix(text_.cursor.x());
 
-               if (text_.selection.set()) {
-                       text_.clearSelection();
-                       updateLocal(bv, FULL, false);
-               } else {
-                       text_.clearSelection();
-                       updateLocal(bv, CURSOR, false);
-               }
+               text_.clearSelection();
+               updateLocal(bv, false);
 
                bv->owner()->setLayout(cpar()->layout()->name());
 
@@ -751,7 +741,7 @@ bool InsetText::lfunMouseRelease(FuncReq
                }
 #endif
                ret = inset->localDispatch(cmd1);
-               updateLocal(bv, CURSOR_PAR, false);
+               updateLocal(bv, false);
 
        }
        return ret;
@@ -780,7 +770,7 @@ void InsetText::lfunMouseMotion(FuncRequ
        if (cur == text_.cursor)
                return;
        text_.setSelection();
-       updateLocal(bv, SELECTION, false);
+       updateLocal(bv, false);
 }
 
 
@@ -846,7 +836,7 @@ InsetOld::RESULT InsetText::localDispatc
                if (drawFrame_ == LOCKED)
                        code = CURSOR | DRAW_FRAME;
 
-               updateLocal(bv, code, false);
+               updateLocal(bv, false);
                // Tell the paragraph dialog that we've entered an insettext.
                bv->dispatch(FuncRequest(LFUN_PARAGRAPH_UPDATE));
                return DISPATCHED;
@@ -884,7 +874,7 @@ InsetOld::RESULT InsetText::localDispatc
                if (result == DISPATCHED_NOUPDATE)
                        return result;
                else if (result == DISPATCHED) {
-                       updateLocal(bv, CURSOR_PAR, false);
+                       updateLocal(bv, false);
                        return result;
                } else if (result >= FINISHED) {
                        switch (result) {
@@ -894,13 +884,13 @@ InsetOld::RESULT InsetText::localDispatc
                                break;
                        case FINISHED_UP:
                                if ((result = moveUp(bv)) >= FINISHED) {
-                                       updateLocal(bv, CURSOR, false);
+                                       updateLocal(bv, false);
                                        bv->unlockInset(this);
                                }
                                break;
                        case FINISHED_DOWN:
                                if ((result = moveDown(bv)) >= FINISHED) {
-                                       updateLocal(bv, CURSOR, false);
+                                       updateLocal(bv, false);
                                        bv->unlockInset(this);
                                }
                                break;
@@ -909,7 +899,7 @@ InsetOld::RESULT InsetText::localDispatc
                                break;
                        }
                        the_locking_inset = 0;
-                       updateLocal(bv, CURSOR, false);
+                       updateLocal(bv, false);
                        // make sure status gets reset immediately
                        bv->owner()->clearMessage();
                        return result;
@@ -1242,7 +1232,7 @@ InsetOld::RESULT InsetText::localDispatc
        }
 
        if (updwhat > 0)
-               updateLocal(bv, updwhat, updflag);
+               updateLocal(bv, updflag);
        /// If the action has deleted all text in the inset, we need to change the
        // language to the language of the surronding text.
        if (!was_empty && paragraphs.begin()->empty() &&
@@ -1598,7 +1588,7 @@ bool InsetText::insertInset(BufferView *
        inset->setOwner(this);
        text_.insertInset(inset);
        bv->fitCursor();
-       updateLocal(bv, CURSOR_PAR|CURSOR, true);
+       updateLocal(bv, true);
        return true;
 }
 
@@ -1691,13 +1681,7 @@ void InsetText::setFont(BufferView * bv,
                text_.clearSelection();
 
        bv->fitCursor();
-
-       bool flag = (selectall || text_.selection.set());
-
-       if (flag)
-               updateLocal(bv, FULL, true);
-       else
-               updateLocal(bv, CURSOR_PAR, true);
+       updateLocal(bv, true);
 }
 
 
@@ -1710,7 +1694,7 @@ bool InsetText::checkAndActivateInset(Bu
        inset->localDispatch(cmd);
        if (!the_locking_inset)
                return false;
-       updateLocal(bv, CURSOR, false);
+       updateLocal(bv, false);
        return true;
 }
 
@@ -1742,7 +1726,7 @@ bool InsetText::checkAndActivateInset(Bu
        inset->localDispatch(cmd);
        if (!the_locking_inset)
                return false;
-       updateLocal(bv, CURSOR, false);
+       updateLocal(bv, false);
        return true;
 }
 
@@ -1809,7 +1793,7 @@ void InsetText::setDrawFrame(BufferView 
        if (how != drawFrame_) {
                drawFrame_ = how;
                if (bv)
-                       updateLocal(bv, DRAW_FRAME, false);
+                       updateLocal(bv, false);
        }
 }
 
@@ -1819,7 +1803,7 @@ void InsetText::setFrameColor(BufferView
        if (frame_color != col) {
                frame_color = col;
                if (bv)
-                       updateLocal(bv, DRAW_FRAME, false);
+                       updateLocal(bv, false);
        }
 }
 
@@ -1940,7 +1924,7 @@ void InsetText::resizeLyXText(BufferView
 
        text_.top_y(bv->screen().topCursorVisible(&text_));
        if (!owner()) {
-               const_cast<InsetText*>(this)->updateLocal(bv, FULL, false);
+               const_cast<InsetText*>(this)->updateLocal(bv, false);
                // this will scroll the screen such that the cursor becomes visible
                bv->updateScrollbar();
        } else {
@@ -2100,7 +2084,7 @@ void InsetText::selectSelectedWord(Buffe
                return;
        }
        getLyXText(bv)->selectSelectedWord();
-       updateLocal(bv, SELECTION, false);
+       updateLocal(bv, false);
 }
 
 
@@ -2121,7 +2105,7 @@ bool InsetText::nextChange(BufferView * 
                        locked = true;
                text_.cursor = cur;
                text_.setSelectionRange(length);
-               updateLocal(bv, SELECTION, false);
+               updateLocal(bv, false);
        }
        return result != lyx::find::SR_NOT_FOUND;
 }
@@ -2145,7 +2129,7 @@ bool InsetText::searchForward(BufferView
                        locked = true;
                text_.cursor = cur;
                text_.setSelectionRange(str.length());
-               updateLocal(bv, SELECTION, false);
+               updateLocal(bv, false);
        }
        return result != lyx::find::SR_NOT_FOUND;
 }
@@ -2177,7 +2161,7 @@ bool InsetText::searchBackward(BufferVie
                        locked = true;
                text_.cursor = cur;
                text_.setSelectionRange(str.length());
-               updateLocal(bv, SELECTION, false);
+               updateLocal(bv, false);
        }
        return result != lyx::find::SR_NOT_FOUND;
 }
Index: insettext.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.h,v
retrieving revision 1.188
diff -u -p -r1.188 insettext.h
--- insettext.h 31 Jul 2003 10:48:50 -0000      1.188
+++ insettext.h 4 Aug 2003 15:09:58 -0000
@@ -237,7 +237,7 @@ public:
        ParagraphList paragraphs;
 protected:
        ///
-       void updateLocal(BufferView *, int what, bool mark_dirty);
+       void updateLocal(BufferView *, bool mark_dirty);
        /// set parameters for an initial lock of this inset
        void lockInset(BufferView *);
        /// lock an inset inside this one

Reply via email to