On Sat, Nov 05, 2005 at 11:03:08AM +0100, Jean-Marc Lasgouttes wrote:
> >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> Martin> On Fri, Nov 04, 2005 at 11:11:06PM +0100, Jean-Marc Lasgouttes
> Martin> wrote:
> >> >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> >> 
> Martin> I don't understand this at all.
> >>  You mean what I wrote above?
> 
> Martin> I mean especially "Aren't you supposed to play similar ++
> Martin> tricks like that?"
> 
> If selectionEnd is resize to go oustside an inset, the pos at top
> level has to be incremented, so that the inset is in the selection.
> Look at the comment in the anchor() method.

OK, point taken. Better patch attached.

- Martin
 
Index: cursor.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v
retrieving revision 1.138
diff -u -p -r1.138 cursor.C
--- cursor.C    12 Oct 2005 18:44:52 -0000      1.138
+++ cursor.C    6 Nov 2005 15:22:08 -0000
@@ -438,7 +438,9 @@ DocIterator LCursor::selectionBegin() co
 {
        if (!selection())
                return *this;
-       return anchor() < top() ? anchor_ : *this;
+       DocIterator di = (anchor() < top() ? anchor_ : *this);
+       di.resize(depth());
+       return di;
 }
 
 
@@ -446,7 +448,12 @@ DocIterator LCursor::selectionEnd() cons
 {
        if (!selection())
                return *this;
-       return anchor() > top() ? anchor_ : *this;
+       DocIterator di = (anchor() > top() ? anchor_ : *this);
+       if (di.depth() > depth()) {
+               di.resize(depth());
+               ++di.pos();
+       }
+       return di;
 }
 
 

Attachment: pgpiLyeCEh0eT.pgp
Description: PGP signature

Reply via email to