}
-docstring Cursor::currentState()
+docstring Cursor::currentState() const
{
if (inMathed()) {
odocstringstream os;
}
-docstring Cursor::getPossibleLabel()
+docstring Cursor::getPossibleLabel() const
{
return inMathed() ? from_ascii("eq:") : text()->getPossibleLabel(*this);
}
}
-void Cursor::finishUndo()
+void Cursor::finishUndo() const
{
bv_->buffer().undo().finishUndo();
}
-void Cursor::recordUndo(UndoKind kind, pit_type from, pit_type to)
+void Cursor::recordUndo(UndoKind kind, pit_type from, pit_type to) const
{
bv_->buffer().undo().recordUndo(*this, kind, from, to);
}
-void Cursor::recordUndo(UndoKind kind, pit_type from)
+void Cursor::recordUndo(UndoKind kind, pit_type from) const
{
bv_->buffer().undo().recordUndo(*this, kind, from);
}
-void Cursor::recordUndo(UndoKind kind)
+void Cursor::recordUndo(UndoKind kind) const
{
bv_->buffer().undo().recordUndo(*this, kind);
}
-void Cursor::recordUndoInset(UndoKind kind)
+void Cursor::recordUndoInset(UndoKind kind) const
{
bv_->buffer().undo().recordUndoInset(*this, kind);
}
-void Cursor::recordUndoFullDocument()
+void Cursor::recordUndoFullDocument() const
{
bv_->buffer().undo().recordUndoFullDocument(*this);
}
-void Cursor::recordUndoSelection()
+void Cursor::recordUndoSelection() const
{
if (inMathed()) {
if (cap::multipleCellsSelected(*this))
///
docstring selectionAsString(bool label) const;
///
- docstring currentState();
+ docstring currentState() const;
/// auto-correct mode
bool autocorrect() const { return autocorrect_; }
bool textRedo();
/// makes sure the next operation will be stored
- void finishUndo();
+ void finishUndo() const;
/// The general case: prepare undo for an arbitrary range.
- void recordUndo(UndoKind kind, pit_type from, pit_type to);
+ void recordUndo(UndoKind kind, pit_type from, pit_type to) const;
/// Convenience: prepare undo for the range between 'from' and cursor.
- void recordUndo(UndoKind kind, pit_type from);
+ void recordUndo(UndoKind kind, pit_type from) const;
/// Convenience: prepare undo for the single paragraph or cell
/// containing the cursor
- void recordUndo(UndoKind kind = ATOMIC_UNDO);
+ void recordUndo(UndoKind kind = ATOMIC_UNDO) const;
/// Convenience: prepare undo for the inset containing the cursor
- void recordUndoInset(UndoKind kind = ATOMIC_UNDO);
+ void recordUndoInset(UndoKind kind = ATOMIC_UNDO) const;
/// Convenience: prepare undo for the whole buffer
- void recordUndoFullDocument();
+ void recordUndoFullDocument() const;
/// Convenience: prepare undo for the selected paragraphs or cells
- void recordUndoSelection();
+ void recordUndoSelection() const;
///
void checkBufferStructure();
/// display an error message
void errorMessage(docstring const & msg) const;
///
- docstring getPossibleLabel();
+ docstring getPossibleLabel() const;
/// the name of the macro we are currently inputting
docstring macroName();
}
-void copySelectionHelper(Buffer const & buf, ParagraphList & pars,
+void copySelectionHelper(Buffer const & buf, ParagraphList const & pars,
pit_type startpit, pit_type endpit,
int start, int end, DocumentClass const * const dc, CutStack & cutstack)
{
}
-void copySelection(Cursor & cur)
+void copySelection(Cursor const & cur)
{
copySelection(cur, cur.selectionAsString(true));
}
namespace {
-void copySelectionToStack(Cursor & cur, CutStack & cutstack)
+void copySelectionToStack(Cursor const & cur, CutStack & cutstack)
{
// this doesn't make sense, if there is no selection
if (!cur.selection())
}
-void copySelection(Cursor & cur, docstring const & plaintext)
+void copySelection(Cursor const & cur, docstring const & plaintext)
{
// In tablemode, because copy and paste actually use special table stack
// we do not attempt to get selected paragraphs under cursor. Instead, a
}
-void saveSelection(Cursor & cur)
+void saveSelection(Cursor const & cur)
{
// This function is called, not when a selection is formed, but when
// a selection is cleared. Therefore, multiple keyboard selection
*/
void cutSelection(Cursor & cur, bool doclear = true, bool realcut = true);
/// Push the current selection to the cut buffer and the system clipboard.
-void copySelection(Cursor & cur);
+void copySelection(Cursor const & cur);
/**
* Push the current selection to the cut buffer and the system clipboard.
* \param plaintext plain text version of the selection for the system
* clipboard
*/
-void copySelection(Cursor & cur, docstring const & plaintext);
+void copySelection(Cursor const & cur, docstring const & plaintext);
/// Push the selection buffer to the cut buffer.
void copySelectionToStack();
/// Store the current selection in the internal selection buffer
-void saveSelection(Cursor & cur);
+void saveSelection(Cursor const & cur);
/// Is a selection available in our selection buffer?
bool selection();
/// Clear our selection buffer
}
// Returns the current font and depth as a message.
-docstring Text::currentState(Cursor & cur)
+docstring Text::currentState(Cursor const & cur) const
{
LASSERT(this == cur.text(), /**/);
Buffer & buf = cur.buffer();
}
-docstring Text::getPossibleLabel(Cursor & cur) const
+docstring Text::getPossibleLabel(Cursor const & cur) const
{
pit_type pit = cur.pit();
Paragraph & getPar(pit_type pit) { return pars_[pit]; }
// Returns the current font and depth as a message.
/// FIXME: replace Cursor with DocIterator.
- docstring currentState(Cursor & cur);
+ docstring currentState(Cursor const & cur) const;
/** Find the word under \c from in the relative location
* defined by \c word_location.
double spacing(Buffer const & buffer, Paragraph const & par) const;
/// make a suggestion for a label
/// FIXME: replace Cursor with DocIterator.
- docstring getPossibleLabel(Cursor & cur) const;
+ docstring getPossibleLabel(Cursor const & cur) const;
/// is this paragraph right-to-left?
bool isRTL(Buffer const &, Paragraph const & par) const;
///
void recordUndo(UndoKind kind,
- DocIterator & cur,
+ DocIterator const & cur,
pit_type first_pit,
pit_type last_pit);
}
-void Undo::Private::recordUndo(UndoKind kind, DocIterator & cur,
+void Undo::Private::recordUndo(UndoKind kind, DocIterator const & cur,
pit_type first_pit, pit_type last_pit)
{
LASSERT(first_pit <= cur.lastpit(), /**/);
}
-void Undo::recordUndo(DocIterator & cur, UndoKind kind)
+void Undo::recordUndo(DocIterator const & cur, UndoKind kind)
{
d->recordUndo(kind, cur, cur.pit(), cur.pit());
}
-void Undo::recordUndoInset(DocIterator & cur, UndoKind kind)
+void Undo::recordUndoInset(DocIterator const & cur, UndoKind kind)
{
DocIterator c = cur;
c.pop_back();
}
-void Undo::recordUndo(DocIterator & cur, UndoKind kind, pit_type from)
+void Undo::recordUndo(DocIterator const & cur, UndoKind kind, pit_type from)
{
d->recordUndo(kind, cur, cur.pit(), from);
}
-void Undo::recordUndo(DocIterator & cur, UndoKind kind,
+void Undo::recordUndo(DocIterator const & cur, UndoKind kind,
pit_type from, pit_type to)
{
d->recordUndo(kind, cur, from, to);
}
-void Undo::recordUndoFullDocument(DocIterator & cur)
+void Undo::recordUndoFullDocument(DocIterator const & cur)
{
d->doRecordUndo(
ATOMIC_UNDO,
bool hasRedoStack() const;
/// The general case: prepare undo for an arbitrary range.
- void recordUndo(DocIterator & cur, UndoKind kind,
+ void recordUndo(DocIterator const & cur, UndoKind kind,
pit_type from, pit_type to);
/// Convenience: prepare undo for the range between 'from' and cursor.
- void recordUndo(DocIterator & cur, UndoKind kind, pit_type from);
+ void recordUndo(DocIterator const & cur, UndoKind kind, pit_type from);
/// Convenience: prepare undo for the single paragraph or cell
/// containing the cursor
- void recordUndo(DocIterator & cur, UndoKind kind = ATOMIC_UNDO);
+ void recordUndo(DocIterator const & cur, UndoKind kind = ATOMIC_UNDO);
/// Convenience: prepare undo for the inset containing the cursor
- void recordUndoInset(DocIterator & cur, UndoKind kind = ATOMIC_UNDO);
+ void recordUndoInset(DocIterator const & cur, UndoKind kind = ATOMIC_UNDO);
/// Convenience: prepare undo for the whole buffer
- void recordUndoFullDocument(DocIterator & cur);
+ void recordUndoFullDocument(DocIterator const & cur);
private:
struct Private;