Re: r31969 - lyx-devel/trunk/src

2010-04-16 Thread Jean-Marc Lasgouttes
"Vincent van Ravesteijn - TNW" writes: > Because there is no reason to make it non-const. I can't think of a > reason to allow code from outside the Cursor class to change the result > of the Cursor dispatching machinery. > > If something can be const, it's better to make it a const, right ? The

Re: r31969 - lyx-devel/trunk/src

2010-04-16 Thread Abdelrazak Younes
On 04/16/2010 10:22 AM, Jean-Marc Lasgouttes wrote: Vincent van Ravesteijn writes: One less copy than returning a "DispatchResult const&" ? I think we think the same.. ;) No, I am wondering why it has to be const. Because it is dangerous otherwise. DispatchResult is not big so

RE: r31969 - lyx-devel/trunk/src

2010-04-16 Thread Vincent van Ravesteijn - TNW
>> One less copy than returning a "DispatchResult const &" ? >> >> I think we think the same.. ;) > >No, I am wondering why it has to be const. > Because there is no reason to make it non-const. I can't think of a reason to allow code from outside the Cursor class to change the result of the Curs

Re: r31969 - lyx-devel/trunk/src

2010-04-16 Thread Jean-Marc Lasgouttes
Vincent van Ravesteijn writes: > One less copy than returning a "DispatchResult const &" ? > > I think we think the same.. ;) No, I am wondering why it has to be const. JMarc

Re: r31969 - lyx-devel/trunk/src

2010-04-15 Thread Vincent van Ravesteijn
Jean-Marc Lasgouttes schreef: Le 15 avr. 10 à 23:23, Vincent van Ravesteijn a écrit : Why not return a DispatchResult& ? I think that was the intent anyway. Why would we. The only place from where the DispatchResult is changed is within the Cursor class, so direct access to the private member.

Re: r31969 - lyx-devel/trunk/src

2010-04-15 Thread Jean-Marc Lasgouttes
Le 15 avr. 10 à 23:23, Vincent van Ravesteijn a écrit : Why not return a DispatchResult& ? I think that was the intent anyway. Why would we. The only place from where the DispatchResult is changed is within the Cursor class, so direct access to the private member. Beacuse it is one less

Re: r31969 - lyx-devel/trunk/src

2010-04-15 Thread Vincent van Ravesteijn
I made result() return a const & in order not to have anyone trying to do this again. Why not return a DispatchResult& ? I think that was the intent anyway. Why would we. The only place from where the DispatchResult is changed is within the Cursor class, so direct access to the private membe

Re: r31969 - lyx-devel/trunk/src

2010-04-15 Thread Jean-Marc Lasgouttes
Le 15 avr. 10 à 19:15, Vincent van Ravesteijn - TNW a écrit : Author: lasgouttes Date: Fri Nov 13 15:32:51 2009 New Revision: 31969 URL: http://www.lyx.org/trac/changeset/31969 + // Is this a function that acts on inset at point? + if (lyxaction.funcHasFlag(cmd.action, LyXAct

RE: r31969 - lyx-devel/trunk/src

2010-04-15 Thread Vincent van Ravesteijn - TNW
>Author: lasgouttes >Date: Fri Nov 13 15:32:51 2009 >New Revision: 31969 >URL: http://www.lyx.org/trac/changeset/31969 > >+ // Is this a function that acts on inset at point? >+ if (lyxaction.funcHasFlag(cmd.action, LyXAction::AtPoint) >+ && nextInset()) { >+