]> git.lyx.org Git - features.git/commitdiff
Fix the multiple window rows() availability bug
authorBo Peng <bpeng@lyx.org>
Thu, 14 Dec 2006 03:41:32 +0000 (03:41 +0000)
committerBo Peng <bpeng@lyx.org>
Thu, 14 Dec 2006 03:41:32 +0000 (03:41 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16273 a592a061-630c-0410-9148-cb99ea01b6c8

Status.15x
src/text2.C

index bc4ed86000f23e0fbed7be72a8a02ab777a83e65..67c152c96b7c49fc7086ddbeac9978b03481c9de 100644 (file)
@@ -577,3 +577,8 @@ CREDITS:
 * LyX tries to delete /tmp if it is called with invalid arguments
   FIXED (Enrico 2006-12-13)
 
+* Start lyx, open a document, scroll down, open a new window, move 
+  the cursor back, lyx crashes because par::rows() is cleared when the
+  new window is created.
+  FIXED (Bo 2006-12-13)
+
index 0947c0303bfd62aa3b3458d2f19deec71822c39f..0670e616e69f14f946145a33e6a995ce2350291d 100644 (file)
@@ -999,6 +999,12 @@ InsetBase * LyXText::editXY(LCursor & cur, int x, int y)
        }
        pit_type pit = getPitNearY(cur.bv(), y);
        BOOST_ASSERT(pit != -1);
+       // When another window is opened with the same document, rows()
+       // will be cleared so pars_[pit].rows() might be empty when switching
+       // between windwos. A better solution is that each buffer view
+       // has its own rows() for the same buffer.
+       if (pars_[pit].rows().empty())
+               redoParagraph(cur.bv(), pit);
        Row const & row = getRowNearY(cur.bv(), y, pit);
        bool bound = false;