From 8156884090519114b3e38f022c55bca0dff9ebfd Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 15 Apr 2010 17:34:34 +0000 Subject: [PATCH] Make Cursor::disp_ private as it should be. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34144 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.cpp | 6 ++--- src/Cursor.h | 4 ++-- src/Text.cpp | 4 ++-- src/frontends/qt4/GuiCompleter.cpp | 36 +++++++++++++++--------------- src/mathed/InsetMathScript.cpp | 6 ++--- src/mathed/MathMacro.cpp | 2 +- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 3bbb23cfc2..4afcda8158 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -2838,10 +2838,10 @@ void BufferView::setInlineCompletion(Cursor & cur, DocIterator const & pos, // set update flags if (changed) { - if (singlePar && !(cur.disp_.update() & Update::Force)) - cur.updateFlags(cur.disp_.update() | Update::SinglePar); + if (singlePar && !(cur.result().update() & Update::Force)) + cur.updateFlags(cur.result().update() | Update::SinglePar); else - cur.updateFlags(cur.disp_.update() | Update::Force); + cur.updateFlags(cur.result().update() | Update::Force); } } diff --git a/src/Cursor.h b/src/Cursor.h index ebb68b13f4..134c95cd91 100644 --- a/src/Cursor.h +++ b/src/Cursor.h @@ -291,14 +291,14 @@ public: /// the anchor position DocIterator anchor_; - /// - mutable DispatchResult disp_; /// DocIterator const & beforeDispatchCursor() const { return beforeDispatchCursor_; } /// void saveBeforeDispatchPosXY(); private: + /// + mutable DispatchResult disp_; /** * The target x position of the cursor. This is used for when * we have text like : diff --git a/src/Text.cpp b/src/Text.cpp index 33932d4e9f..6cc354dfd7 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -2020,8 +2020,8 @@ bool Text::insertCompletion(Cursor & cur, docstring const & s, bool /*finished*/ LASSERT(cur.bv().cursor() == cur, /**/); cur.insert(s); cur.bv().cursor() = cur; - if (!(cur.disp_.update() & Update::Force)) - cur.updateFlags(cur.disp_.update() | Update::SinglePar); + if (!(cur.result().update() & Update::Force)) + cur.updateFlags(cur.result().update() | Update::SinglePar); return true; } diff --git a/src/frontends/qt4/GuiCompleter.cpp b/src/frontends/qt4/GuiCompleter.cpp index 0c51b6da41..d061aefcb4 100644 --- a/src/frontends/qt4/GuiCompleter.cpp +++ b/src/frontends/qt4/GuiCompleter.cpp @@ -316,8 +316,8 @@ void GuiCompleter::updateVisibility(Cursor & cur, bool start, bool keep, bool cu inline_timer_.start(int(lyxrc.completion_inline_delay * 1000)); else { // no inline completion, hence a metrics update is needed - if (!(cur.disp_.update() & Update::Force)) - cur.updateFlags(cur.disp_.update() | Update::SinglePar); + if (!(cur.result().update() & Update::Force)) + cur.updateFlags(cur.result().update() | Update::SinglePar); } // update prefix if any completion is possible @@ -338,8 +338,8 @@ void GuiCompleter::updateVisibility(bool start, bool keep) updateVisibility(cur, start, keep); - if (cur.disp_.update()) - gui_->bufferView().processUpdateFlags(cur.disp_.update()); + if (cur.result().update()) + gui_->bufferView().processUpdateFlags(cur.result().update()); } @@ -603,8 +603,8 @@ void GuiCompleter::showPopup() showPopup(cur); // redraw if needed - if (cur.disp_.update()) - gui_->bufferView().processUpdateFlags(cur.disp_.update()); + if (cur.result().update()) + gui_->bufferView().processUpdateFlags(cur.result().update()); } @@ -616,8 +616,8 @@ void GuiCompleter::showInline() showInline(cur); // redraw if needed - if (cur.disp_.update()) - gui_->bufferView().processUpdateFlags(cur.disp_.update()); + if (cur.result().update()) + gui_->bufferView().processUpdateFlags(cur.result().update()); } @@ -629,8 +629,8 @@ void GuiCompleter::hidePopup() hidePopup(cur); // redraw if needed - if (cur.disp_.update()) - gui_->bufferView().processUpdateFlags(cur.disp_.update()); + if (cur.result().update()) + gui_->bufferView().processUpdateFlags(cur.result().update()); } @@ -642,8 +642,8 @@ void GuiCompleter::hideInline() hideInline(cur); // redraw if needed - if (cur.disp_.update()) - gui_->bufferView().processUpdateFlags(cur.disp_.update()); + if (cur.result().update()) + gui_->bufferView().processUpdateFlags(cur.result().update()); } @@ -721,8 +721,8 @@ void GuiCompleter::tab() popup_timer_.start(0); // redraw if needed - if (cur.disp_.update()) - gui_->bufferView().processUpdateFlags(cur.disp_.update()); + if (cur.result().update()) + gui_->bufferView().processUpdateFlags(cur.result().update()); } @@ -887,8 +887,8 @@ void GuiCompleter::popupActivated(const QString & completion) hidePopup(cur); hideInline(cur); - if (cur.disp_.update()) - gui_->bufferView().processUpdateFlags(cur.disp_.update()); + if (cur.result().update()) + gui_->bufferView().processUpdateFlags(cur.result().update()); } @@ -903,8 +903,8 @@ void GuiCompleter::popupHighlighted(const QString & completion) if (inlineVisible()) updateInline(cur, completion); - if (cur.disp_.update()) - gui_->bufferView().processUpdateFlags(cur.disp_.update()); + if (cur.result().update()) + gui_->bufferView().processUpdateFlags(cur.result().update()); } } // namespace frontend diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp index 8cefaa6984..0b6a4d86cb 100644 --- a/src/mathed/InsetMathScript.cpp +++ b/src/mathed/InsetMathScript.cpp @@ -704,13 +704,13 @@ bool InsetMathScript::notifyCursorLeaves(Cursor const & old, Cursor & cur) // must be a subscript... old.recordUndoInset(); removeScript(false); - cur.updateFlags(cur.disp_.update() | Update::SinglePar); + cur.updateFlags(cur.result().update() | Update::SinglePar); return true; } else if (cell(1).empty()) { // must be a superscript... old.recordUndoInset(); removeScript(true); - cur.updateFlags(cur.disp_.update() | Update::SinglePar); + cur.updateFlags(cur.result().update() | Update::SinglePar); return true; } } @@ -740,7 +740,7 @@ bool InsetMathScript::notifyCursorLeaves(Cursor const & old, Cursor & cur) insetCur.cell().insert(insetCur.pos(), ar); // redraw - cur.updateFlags(cur.disp_.update() | Update::SinglePar); + cur.updateFlags(cur.result().update() | Update::SinglePar); return true; } diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index 3eedbee531..d458f76ebb 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -641,7 +641,7 @@ bool MathMacro::notifyCursorLeaves(Cursor const & old, Cursor & cur) inset_cursor.cell().erase(inset_cursor.pos()); inset_cursor.cell().insert(inset_cursor.pos(), createInsetMath(unfolded_name, cur.buffer())); - cur.updateFlags(cur.disp_.update() | Update::SinglePar); + cur.updateFlags(cur.result().update() | Update::SinglePar); return true; } }