On Fri, Nov 30, 2001 at 06:03:55PM +1000, Allan Rae wrote: > SO far it looks like BufferView::Pimpl::workAreaButtonPress doesn't > always see that a selection is set in: > > if (button == 2 > && bv_->text->selection.set()) { > owner_->getLyXFunc()->dispatch(LFUN_COPY); > paste_internally = true; > } > > as a result paste_internally isn't being set and as a result of that > we call LFUN_PASTESELECTION insetad of LFUN_PASTE when the selection > is inside an inset.
That looks wrong. using bv_->text means only a selection in the top-level is found. There might be an inset whose ->getLyXText() has a selection, but we won't find it like above. I don't see an alternative to iterating over every inset's lyxtext to look for a selection. What do people think (this is not the first code where an InsetIterator would come in useful) ? > What sets up the cursors/selection when a LMB is released? nothing, it is done "lazily". So the MotionNotify modifies the selection if the button is held. And a ButtonPress clears the current "soft" selection. regards john -- "Faced with the prospect of rereading this book, I would rather have my brains ripped out by a plastic fork." - Charles Cooper on "Business at the Speed of Thought"