From ebb830ba9b49b96e9f7a4c241a6ebb8841fbbe0d Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 15 Apr 2010 17:14:59 +0000 Subject: [PATCH] Do not change the object that is returned by result(), this will have no effect because result() returned a copy. From now, it just returns a const & to prevent this from happening again. see r31969. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34143 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Cursor.cpp | 8 ++++---- src/Cursor.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 0e1a51e351..a28eded33b 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -335,13 +335,13 @@ void Cursor::dispatch(FuncRequest const & cmd0) // Is this a function that acts on inset at point? if (lyxaction.funcHasFlag(cmd.action(), LyXAction::AtPoint) && nextInset()) { - result().dispatched(true); - result().update(Update::FitCursor | Update::Force); + disp_.dispatched(true); + disp_.update(Update::FitCursor | Update::Force); FuncRequest tmpcmd = cmd; LYXERR(Debug::DEBUG, "Cursor::dispatch: (AtPoint) cmd: " << cmd0 << endl << *this); nextInset()->dispatch(*this, tmpcmd); - if (result().dispatched()) { + if (disp_.dispatched()) { buffer()->undo().endUndoGroup(); return; } @@ -391,7 +391,7 @@ void Cursor::dispatch(FuncRequest const & cmd0) } -DispatchResult Cursor::result() const +DispatchResult const & Cursor::result() const { return disp_; } diff --git a/src/Cursor.h b/src/Cursor.h index f1a8596620..ebb68b13f4 100644 --- a/src/Cursor.h +++ b/src/Cursor.h @@ -50,7 +50,7 @@ public: /// dispatch from innermost inset upwards void dispatch(FuncRequest const & cmd); /// get the resut of the last dispatch - DispatchResult result() const; + DispatchResult const & result() const; /// add a new cursor slice void push(Inset & inset); /// add a new cursor slice, place cursor at front (move backwards)