On Wed, Jan 07, 2004 at 09:22:32AM +0100, Alfredo Braunstein wrote:
> Andre Poenitz wrote:
> 
> > On Wed, Jan 07, 2004 at 09:07:24AM +0100, Andre' Poenitz wrote:
> >> The reason is probably that the row cache is empty as the row was never
> >> drawn.
> >> 
> >> I am not sure how a proper solution would look like.
> > 
> > The attached patch paints over the problem...
> 
> ;-)
> 
> Note that rows are needed on setCursor only for setting the correct
> bv->x_target (I think). I wonder if we can simply avoid that somehow.

See attached.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)
Index: text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.512
diff -u -p -r1.512 text.C
--- text.C      18 Dec 2003 04:43:06 -0000      1.512
+++ text.C      7 Jan 2004 08:34:04 -0000
@@ -1870,6 +1870,8 @@ int LyXText::cursorY() const
 int LyXText::cursorX(LyXCursor const & cur) const
 {
        ParagraphList::iterator pit = getPar(cur);
+       if (pit->rows.empty())
+               return 0;
        Row const & row         = *pit->getRow(cur.pos());
        pos_type pos            = cur.pos();
        pos_type cursor_vpos    = 0;

Reply via email to