Add constness in several places.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40338 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-12-02 22:41:33 +00:00
parent 8b6d6eecfd
commit 8c69aca339
4 changed files with 17 additions and 17 deletions

View File

@ -3027,7 +3027,7 @@ bool samePar(DocIterator const & a, DocIterator const & b)
} }
void BufferView::setInlineCompletion(Cursor & cur, DocIterator const & pos, void BufferView::setInlineCompletion(Cursor const & cur, DocIterator const & pos,
docstring const & completion, size_t uniqueChars) docstring const & completion, size_t uniqueChars)
{ {
uniqueChars = min(completion.size(), uniqueChars); uniqueChars = min(completion.size(), uniqueChars);

View File

@ -194,7 +194,7 @@ public:
void resetInlineCompletionPos(); void resetInlineCompletionPos();
/// set the inline completion postfix and its position in the buffer. /// set the inline completion postfix and its position in the buffer.
/// Updates the updateFlags in \c cur. /// Updates the updateFlags in \c cur.
void setInlineCompletion(Cursor & cur, DocIterator const & pos, void setInlineCompletion(Cursor const & cur, DocIterator const & pos,
docstring const & completion, size_t uniqueChars = 0); docstring const & completion, size_t uniqueChars = 0);
/// translate and insert a character, using the correct keymap. /// translate and insert a character, using the correct keymap.

View File

@ -341,7 +341,7 @@ void GuiCompleter::updateVisibility(bool start, bool keep)
} }
void GuiCompleter::updatePrefix(Cursor & cur) void GuiCompleter::updatePrefix(Cursor const & cur)
{ {
// get new prefix. Do nothing if unchanged // get new prefix. Do nothing if unchanged
QString newPrefix = toqstr(cur.inset().completionPrefix(cur)); QString newPrefix = toqstr(cur.inset().completionPrefix(cur));
@ -380,7 +380,7 @@ void GuiCompleter::updatePrefix(Cursor & cur)
} }
void GuiCompleter::updateInline(Cursor & cur, QString const & completion) void GuiCompleter::updateInline(Cursor const & cur, QString const & completion)
{ {
if (!cur.inset().inlineCompletionSupported(cur)) if (!cur.inset().inlineCompletionSupported(cur))
return; return;
@ -401,7 +401,7 @@ void GuiCompleter::updateInline(Cursor & cur, QString const & completion)
} }
void GuiCompleter::updatePopup(Cursor & cur) void GuiCompleter::updatePopup(Cursor const & cur)
{ {
if (!cur.inset().completionSupported(cur)) if (!cur.inset().completionSupported(cur))
return; return;
@ -459,7 +459,7 @@ void GuiCompleter::updateAvailability()
// visible yet, i.e. especially if automatic completion is disabled. // visible yet, i.e. especially if automatic completion is disabled.
if (inlineVisible() || popupVisible()) if (inlineVisible() || popupVisible())
return; return;
Cursor & cur = gui_->bufferView().cursor(); Cursor const & cur = gui_->bufferView().cursor();
if (!popupPossible(cur) && !inlinePossible(cur)) if (!popupPossible(cur) && !inlinePossible(cur))
return; return;
@ -467,7 +467,7 @@ void GuiCompleter::updateAvailability()
} }
void GuiCompleter::updateModel(Cursor & cur, bool popupUpdate, bool inlineUpdate) void GuiCompleter::updateModel(Cursor const & cur, bool popupUpdate, bool inlineUpdate)
{ {
// value which should be kept selected // value which should be kept selected
QString old = currentCompletion(); QString old = currentCompletion();
@ -521,7 +521,7 @@ void GuiCompleter::updateModel(Cursor & cur, bool popupUpdate, bool inlineUpdate
} }
void GuiCompleter::showPopup(Cursor & cur) void GuiCompleter::showPopup(Cursor const & cur)
{ {
if (!popupPossible(cur)) if (!popupPossible(cur))
return; return;
@ -558,7 +558,7 @@ void GuiCompleter::asyncHidePopup()
} }
void GuiCompleter::showInline(Cursor & cur) void GuiCompleter::showInline(Cursor const & cur)
{ {
if (!inlinePossible(cur)) if (!inlinePossible(cur))
return; return;
@ -567,7 +567,7 @@ void GuiCompleter::showInline(Cursor & cur)
} }
void GuiCompleter::hideInline(Cursor & cur) void GuiCompleter::hideInline(Cursor const & cur)
{ {
gui_->bufferView().setInlineCompletion(cur, DocIterator(cur.buffer()), docstring()); gui_->bufferView().setInlineCompletion(cur, DocIterator(cur.buffer()), docstring());
inlineVisible_ = false; inlineVisible_ = false;

View File

@ -101,21 +101,21 @@ private:
/// ///
void setCurrentCompletion(QString const & s); void setCurrentCompletion(QString const & s);
/// ///
void showPopup(Cursor & cur); void showPopup(Cursor const & cur);
/// ///
void showInline(Cursor & cur); void showInline(Cursor const & cur);
/// ///
void hidePopup(Cursor & cur); void hidePopup(Cursor & cur);
/// ///
void hideInline(Cursor & cur); void hideInline(Cursor const & cur);
/// ///
void updatePopup(Cursor & cur); void updatePopup(Cursor const & cur);
/// ///
void updateInline(Cursor & cur, QString const & completion); void updateInline(Cursor const & cur, QString const & completion);
/// ///
void updatePrefix(Cursor & cur); void updatePrefix(Cursor const & cur);
/// ///
void updateModel(Cursor & cur, bool popupUpdate, bool inlineUpdate); void updateModel(Cursor const & cur, bool popupUpdate, bool inlineUpdate);
/// ///
bool eventFilter(QObject * watched, QEvent * event); bool eventFilter(QObject * watched, QEvent * event);