From: Alfredo Braunstein Date: Thu, 18 Dec 2003 04:43:08 +0000 (+0000) Subject: redocursor removal X-Git-Tag: 1.6.10~15636 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5513c278769c0faae9003e05c2d306f3b72300b6;p=features.git redocursor removal git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8263 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index df3527e97d..66a1cc8928 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -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_); diff --git a/src/ChangeLog b/src/ChangeLog index 273a5cd436..bd85f085e8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2003-12-17 Alfredo Braunstein + + * 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 * buffer.C: up the format to 228. diff --git a/src/lyxtext.h b/src/lyxtext.h index 9908728ac9..fdd54a0cd4 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -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 diff --git a/src/text.C b/src/text.C index 1d8b7ced7c..f7bb174469 100644 --- a/src/text.C +++ b/src/text.C @@ -1602,7 +1602,6 @@ void LyXText::redoParagraph(ParagraphList::iterator pit) void LyXText::fullRebreak() { redoParagraphs(paragraphs().begin(), paragraphs().end()); - redoCursor(); selection.cursor = cursor; } diff --git a/src/text2.C b/src/text2.C index a1d0b531dc..576f767052 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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; diff --git a/src/text3.C b/src/text3.C index 4a83b7d8fa..05148e2f5c 100644 --- a/src/text3.C +++ b/src/text3.C @@ -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; }