last try for this one ...

john

-- 
"Way back at the beginning of time around 1970 the first man page was
 handed down from on high. Every one since is an edited copy."
        - John Hasler <[EMAIL PROTECTED]>
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.635
diff -u -r1.635 ChangeLog
--- src/ChangeLog       19 Mar 2002 15:27:34 -0000      1.635
+++ src/ChangeLog       19 Mar 2002 16:13:13 -0000
@@ -1,3 +1,8 @@
+2002-03-19  John Levon  <[EMAIL PROTECTED]>
+
+       * CutAndPaste.C: change layouts earlier on paste
+         to avoid crashing when calling getFont()
+ 
 2002-03-19  André Pönitz <[EMAIL PROTECTED]>
 
        * lyxfunc.C: tiny whitespace change
Index: src/CutAndPaste.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/CutAndPaste.C,v
retrieving revision 1.55
diff -u -r1.55 CutAndPaste.C
--- src/CutAndPaste.C   15 Mar 2002 15:28:23 -0000      1.55
+++ src/CutAndPaste.C   19 Mar 2002 16:13:14 -0000
@@ -283,7 +283,13 @@
                // temporary set *par as previous of tmpbuf as we might have to realize
                // the font.
                tmpbuf->previous(*par);
+ 
+               // make sure there is no class difference
+               SwitchLayoutsBetweenClasses(textclass, tc, tmpbuf,
+                                           current_view->buffer()->params);
+               
                Paragraph::depth_type max_depth = 
(*par)->getMaxDepthAfter(current_view->buffer());
+ 
                while(tmpbuf) {
                        // if we have a negative jump so that the depth would go below
                        // 0 depth then we have to redo the delta to this new max depth
@@ -321,10 +327,6 @@
                }
                // now reset it to 0
                buf->previous(0);
-               
-               // make sure there is no class difference
-               SwitchLayoutsBetweenClasses(textclass, tc, buf,
-                                           current_view->buffer()->params);
                
                // make the buf exactly the same layout than
                // the cursor paragraph

Reply via email to