]> git.lyx.org Git - lyx.git/commitdiff
constification without any code change. This is part of and effort to see whether...
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 13 Aug 2008 13:46:19 +0000 (13:46 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 13 Aug 2008 13:46:19 +0000 (13:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26141 a592a061-630c-0410-9148-cb99ea01b6c8

src/Cursor.cpp
src/Cursor.h
src/CutAndPaste.cpp
src/CutAndPaste.h
src/Text.cpp
src/Text.h
src/Undo.cpp
src/Undo.h

index ad98883954a785e41cf3ed383eadb4d4074f691a..98d18fa125938792818e34e4aa3bd93196acf7f6 100644 (file)
@@ -1903,7 +1903,7 @@ docstring Cursor::selectionAsString(bool with_label) const
 }
 
 
-docstring Cursor::currentState()
+docstring Cursor::currentState() const
 {
        if (inMathed()) {
                odocstringstream os;
@@ -1918,7 +1918,7 @@ docstring Cursor::currentState()
 }
 
 
-docstring Cursor::getPossibleLabel()
+docstring Cursor::getPossibleLabel() const
 {
        return inMathed() ? from_ascii("eq:") : text()->getPossibleLabel(*this);
 }
@@ -2112,43 +2112,43 @@ bool Cursor::textRedo()
 }
 
 
-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))
index edb2f862ccccdce67427295326ce405639f80d8b..c5277927c84c0264686a4672f8b193937177d50f 100644 (file)
@@ -100,7 +100,7 @@ public:
        ///
        docstring selectionAsString(bool label) const;
        ///
-       docstring currentState();
+       docstring currentState() const;
 
        /// auto-correct mode
        bool autocorrect() const { return autocorrect_; }
@@ -240,26 +240,26 @@ public:
        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();
@@ -400,7 +400,7 @@ public:
        /// 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();
index 2cadd1deebf39073d75ede41c749179f9b13f9f1..813d28a2e350787f0c918c8ea6f49f479dadf764 100644 (file)
@@ -387,7 +387,7 @@ void putClipboard(ParagraphList const & paragraphs,
 }
 
 
-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)
 {
@@ -675,7 +675,7 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut)
 }
 
 
-void copySelection(Cursor & cur)
+void copySelection(Cursor const & cur)
 {
        copySelection(cur, cur.selectionAsString(true));
 }
@@ -683,7 +683,7 @@ void copySelection(Cursor & cur)
 
 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())
@@ -737,7 +737,7 @@ void copySelectionToStack()
 }
 
 
-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
@@ -760,7 +760,7 @@ void copySelection(Cursor & cur, docstring const & plaintext)
 }
 
 
-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
index 3d6e3808f6f84b9617be3298dc3bcf5fd2f4fbad..fb6ba8f5760abca6538313129f8b730b25cdcafd 100644 (file)
@@ -63,17 +63,17 @@ void replaceSelection(Cursor & cur);
  */
 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
index c149ad7973a26214e48aaf9f34bc8e2feab9addb..77a668f901f45df6f6916f57f17bef68517bb080 100644 (file)
@@ -1332,7 +1332,7 @@ bool Text::read(Buffer const & buf, Lexer & lex,
 }
 
 // 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();
@@ -1411,7 +1411,7 @@ docstring Text::currentState(Cursor & cur)
 }
 
 
-docstring Text::getPossibleLabel(Cursor & cur) const
+docstring Text::getPossibleLabel(Cursor const & cur) const
 {
        pit_type pit = cur.pit();
 
index 34977dab015b563e6ce725cfad17c8e7d172a57b..72f8b89902350ecbbc6efca746e98a8d0ff7b8c8 100644 (file)
@@ -128,7 +128,7 @@ public:
        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.
@@ -254,7 +254,7 @@ public:
        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;
 
index 4e2ac02c88d59b5280110ce320fc3adeb2f111df..1e4b19980662780b5bdb2a0a47ef06edd4914188 100644 (file)
@@ -181,7 +181,7 @@ struct Undo::Private
 
        ///
        void recordUndo(UndoKind kind,
-               DocIterator & cur,
+               DocIterator const & cur,
                pit_type first_pit,
                pit_type last_pit);
 
@@ -297,7 +297,7 @@ void Undo::Private::doRecordUndo(UndoKind kind,
 }
 
 
-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(), /**/);
@@ -419,13 +419,13 @@ bool Undo::textRedo(DocIterator & cur)
 }
 
 
-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();
@@ -433,20 +433,20 @@ void Undo::recordUndoInset(DocIterator & cur, UndoKind kind)
 }
 
 
-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,
index 160f3ac40e6a24e0a3ac1d03e4d036aa26e6f5af..dbb7a17649b300df94f42dcc1d8ddf2b1044990e 100644 (file)
@@ -80,20 +80,20 @@ public:
        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;