]> git.lyx.org Git - features.git/commitdiff
redocursor removal
authorAlfredo Braunstein <abraunst@lyx.org>
Thu, 18 Dec 2003 04:43:08 +0000 (04:43 +0000)
committerAlfredo Braunstein <abraunst@lyx.org>
Thu, 18 Dec 2003 04:43:08 +0000 (04:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8263 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog
src/lyxtext.h
src/text.C
src/text2.C
src/text3.C

index df3527e97dd4f5a05a40c3e61f70d8dabfbb4e20..66a1cc89287f632e18e92a38f34e9b899b395f56 100644 (file)
@@ -599,7 +599,6 @@ void BufferView::Pimpl::update()
                               top_y(), top_y() + workarea().workHeight(),
                               beg, end);
                bv_->text()->redoParagraphs(beg, end);
-               bv_->getLyXText()->redoCursor();
                updateScrollbar();
        }
        screen().redraw(*bv_);
index 273a5cd436ca168579e5de443f4d1a4c14dca4af..bd85f085e8b7838209b84e280c89d5450546ad27 100644 (file)
@@ -1,3 +1,11 @@
+2003-12-17  Alfredo Braunstein  <abraunst@lyx.org>
+
+       * text2.C (redoCursor): remove
+       * text.C:
+       * text3.C:
+       * BufferView_pimpl.C: remove calls to redoCursor and
+       setCursor(cursor.par(), cursor.pos()) all around
+
 2003-12-15  Angus Leeming  <leeming@lyx.org>
 
        * buffer.C: up the format to 228.
index 9908728ac99290035a9ff990b4602598cf32db72..fdd54a0cd4ca36ee0979fe4a8fbc542b5bc49078 100644 (file)
@@ -182,8 +182,6 @@ public:
        /// reject selected change
        void rejectChange();
 
-       /// re-computes the cached coordinates in the cursor
-       void redoCursor();
        ///
        void setCursor(ParagraphList::iterator pit, lyx::pos_type pos);
        /// returns true if par was empty and was removed
index 1d8b7ced7cb4eeb7dceb3dba59ac9a2aafad9c66..f7bb174469445ea0859dfa76f0a9c1433a7cbdd1 100644 (file)
@@ -1602,7 +1602,6 @@ void LyXText::redoParagraph(ParagraphList::iterator pit)
 void LyXText::fullRebreak()
 {
        redoParagraphs(paragraphs().begin(), paragraphs().end());
-       redoCursor();
        selection.cursor = cursor;
 }
 
index a1d0b531dc97a449cff9921cc792a27025849b0c..576f7670520f324fe85f4b4caa821652369753fe 100644 (file)
@@ -325,7 +325,6 @@ void LyXText::setLayout(string const & layout)
 
        redoParagraphs(start, endpit);
        updateCounters();
-       redoCursor();
 }
 
 
@@ -405,7 +404,6 @@ void LyXText::changeDepth(bv_funcs::DEPTH_CHANGE type)
        // this handles the counter labels, and also fixes up
        // depth values for follow-on (child) paragraphs
        updateCounters();
-       redoCursor();
 }
 
 
@@ -456,7 +454,6 @@ void LyXText::setFont(LyXFont const & font, bool toggleall)
        unFreezeUndo();
 
        redoParagraphs(beg, ++end);
-       redoCursor();
 }
 
 
@@ -541,7 +538,6 @@ void LyXText::toggleFree(LyXFont const & font, bool toggleall)
        if (implicitSelection) {
                clearSelection();
                cursor = resetCursor;
-               setCursor(cursorPar(), cursor.pos());
                selection.cursor = cursor;
        }
 }
@@ -566,7 +562,6 @@ string LyXText::getStringToIndex()
 
        // Reset cursors to their original position.
        cursor = reset_cursor;
-       setCursor(cursorPar(), cursor.pos());
        selection.cursor = cursor;
 
        // Clear the implicit selection.
@@ -621,7 +616,6 @@ void LyXText::setParagraph(Spacing const & spacing, LyXAlignment align,
        }
 
        redoParagraphs(getPar(selStart()), endpit);
-       redoCursor();
 }
 
 
@@ -996,7 +990,6 @@ void LyXText::cutSelection(bool doclear, bool realcut)
 
        // need a valid cursor. (Lgb)
        clearSelection();
-       redoCursor();
        updateCounters();
 }
 
@@ -1052,7 +1045,6 @@ void LyXText::pasteSelection(size_t sel_index)
 
        redoParagraphs(cursorPar(), endpit);
 
-       setCursor(cursor.par(), cursor.pos());
        clearSelection();
 
        selection.cursor = cursor;
@@ -1116,7 +1108,6 @@ void LyXText::insertStringAsLines(string const & str)
        bv()->buffer()->insertStringAsLines(pit, pos, current_font, str);
 
        redoParagraphs(cursorPar(), endpit);
-       setCursor(cursorPar(), cursor.pos());
        selection.cursor = cursor;
        setCursor(pit, pos);
        setSelection();
@@ -1166,21 +1157,6 @@ bool LyXText::setCursor(paroffset_type par, pos_type pos, bool setfont,
 }
 
 
-void LyXText::redoCursor()
-{
-       setCursor(cursor, cursor.par(), cursor.pos(), cursor.boundary());
-
-       if (!selection.set())
-               return;
-
-       LyXCursor tmpcursor = cursor;
-       setCursor(selection.cursor.par(), selection.cursor.pos());
-       selection.cursor = cursor;
-       setCursor(tmpcursor.par(), tmpcursor.pos());
-       setSelection();
-}
-
-
 void LyXText::setCursor(LyXCursor & cur, paroffset_type par,
        pos_type pos, bool boundary)
 {
@@ -1603,9 +1579,6 @@ void LyXText::fixCursorAfterDelete(LyXCursor & cur, LyXCursor const & where)
        // pagragraph because we erased the last character.
        if (cur.pos() > getPar(cur)->size())
                cur.pos(getPar(cur)->size());
-
-       // recompute row et al. for this cursor
-       setCursor(cur, cur.par(), cur.pos(), cur.boundary());
 }
 
 
@@ -1719,9 +1692,6 @@ bool LyXText::deleteEmptyParagraphMechanism(LyXCursor const & old_cursor)
                cursor.par(parOffset(tmppit));
                redoParagraph();
 
-               // correct cursor y
-               setCursorIntern(cursor.par(), cursor.pos());
-
                if (selection_position_was_oldcursor_position) {
                        // correct selection
                        selection.cursor = cursor;
@@ -1733,8 +1703,6 @@ bool LyXText::deleteEmptyParagraphMechanism(LyXCursor const & old_cursor)
 
        if (old_pit->stripLeadingSpaces()) {
                redoParagraph(old_pit);
-               // correct cursor y
-               setCursorIntern(cursor.par(), cursor.pos());
                selection.cursor = cursor;
        }
        return false;
index 4a83b7d8fa6cd4d22156ca57e87e4b2eaec3165b..05148e2f5c79598c7d635e0e1221b9151790a28f 100644 (file)
@@ -485,7 +485,6 @@ DispatchResult LyXText::dispatch(FuncRequest const & cmd)
                // we can set the refreshing parameters now
                updateCounters();
                redoParagraph(cursorPar());
-               setCursor(cursorPar(), cursor.pos());
                bv->update();
                break;
        }
@@ -716,7 +715,6 @@ DispatchResult LyXText::dispatch(FuncRequest const & cmd)
 
                replaceSelection(bv->getLyXText());
                insertInset(new InsetNewline);
-               setCursor(cursorPar(), cursor.pos());
                moveCursor(bv, false);
                break;
        }