/// This method uses the BufferView CoordCache to locate the
/// paragraph. The y-coodinate is allowed to be off-screen and
/// the CoordCache will be automatically updated if needed. This is
- /// the reason why we need a non const BufferView and why this
- /// method is non-const.
+ /// the reason why we need a non const BufferView.
/// FIXME: move to TextMetrics.
- pit_type getPitNearY(BufferView & bv, int y);
+ pit_type getPitNearY(BufferView & bv, int y) const;
/** Find the word under \c from in the relative location
* defined by \c word_location.
REJECT
};
/// accept or reject the selected change
- void acceptOrRejectChange(LCursor & cur, ChangeOp op);
+ void acceptOrRejectChanges(LCursor & cur, ChangeOp op);
+ /// accept the changes within the complete LyXText
+ void acceptChanges(BufferParams const & bparams);
+ /// reject the changes within the complete LyXText
+ void rejectChanges(BufferParams const & bparams);
/// returns true if par was empty and was removed
bool setCursor(LCursor & cur, pit_type par, pos_type pos,
\retval inset is non-null if the cursor is positionned inside
*/
/// FIXME: move to TextMetrics.
+ /// FIXME: cleanup to use BufferView::getCoveringInset() and
+ /// setCursorFromCoordinates() instead of checkInsetHit().
InsetBase * editXY(LCursor & cur, int x, int y);
/// Move cursor one line up.
void insertStringAsParagraphs(LCursor & cur, docstring const & str);
/// Returns an inset if inset was hit, or 0 if not.
+ /// \warning This method is not recursive! It will return the
+ /// outermost inset within this LyXText.
+ /// \sa BufferView::getCoveringInset() to get the innermost inset.
InsetBase * checkInsetHit(BufferView &, int x, int y);
///
/// \retval true if a change has happened and we need a redraw.
/// FIXME: replace LCursor with DocIterator. This is not possible right
/// now because recordUndo() is called which needs a LCursor.
- bool deleteEmptyParagraphMechanism(LCursor & cur,
+ static bool deleteEmptyParagraphMechanism(LCursor & cur,
LCursor & old, bool & need_anchor_change);
/// delete double spaces, leading spaces, and empty paragraphs
// fix the cursor `cur' after a characters has been deleted at `where'
// position. Called by deleteEmptyParagraphMechanism
- void fixCursorAfterDelete(CursorSlice & cur, CursorSlice const & where);
+ static void fixCursorAfterDelete(CursorSlice & cur, CursorSlice const & where);
// At cursor position 0, try to merge the paragraph with the one before it.
// Ignore change tracking, i.e., physically remove the end-of-par character