redocursor removal

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8263 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Alfredo Braunstein 2003-12-18 04:43:08 +00:00
parent 17b31b1764
commit 5513c27876
6 changed files with 8 additions and 38 deletions

View 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_);

View 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.

View 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

View File

@ -1602,7 +1602,6 @@ void LyXText::redoParagraph(ParagraphList::iterator pit)
void LyXText::fullRebreak()
{
redoParagraphs(paragraphs().begin(), paragraphs().end());
redoCursor();
selection.cursor = cursor;
}

View 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;

View 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;
}