On 01/05/2010 09:12 AM, Tommaso Cucinotta wrote:
Tommaso Cucinotta wrote:
3) let the LFUN dispatch in lyxfind.cpp return the required information
   (match position and length) to the caller; for example, by means of
   a DispatchResult sub-class (any strong objection to adding a
   "DispatchResult &" to some of the existing ::dispatch() methods ?
   (I suspect this would allow for removing the cursor().disp_ field
   and related methods)
Or, adding a "DispatchResult &" field to the FuncRequest class itself ?
Like in the attached patch, for example (just a quick hack, needs some more design effort). Once the FuncRequest itself has a result() element, insets might drop there whatever they need,
instead of using cursor().result() [ but this is an orthogonal issue ].

This particular version seems unnecessarily complex. FuncRequest should just have a DispatchResult member. The pointer member is asking for trouble, I think.

I'd also want to figure out some way to allow just the DispatchResult member to be modified, even when FuncRequest is const. We don't want to allow arbitrary modification of the FuncRequest object during the dispatch() process, I don't think.

rh

Reply via email to