]> git.lyx.org Git - features.git/commitdiff
mathed89.diff - fix "random" crashes
authorAndré Pönitz <poenitz@gmx.net>
Tue, 3 Jul 2001 15:04:59 +0000 (15:04 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 3 Jul 2001 15:04:59 +0000 (15:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2174 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/array.C

index 7bda17ac372b4cbbf3bd34471d6e277f5ece21c9..0d99b5727b618e9f4f1a5a308220b16e46641bc6 100644 (file)
@@ -6,6 +6,9 @@
 
        * several files: subsequent changes
 
+       * array.C: fix bug when insets have not been cloned properly
+       This should fix quite a few "random" crashes...
+
 2001-06-29  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * formulabase.C (localDispatch): use .c_str() on istringstream
index a1e7063a4bf0b0e135862160d1313fef5af9eeea..ba0e1be587c173f6fb8819b16f46994212229b14 100644 (file)
@@ -139,11 +139,10 @@ void MathArray::insert(int pos, byte b, MathTextCodes t)
 
 void MathArray::insert(int pos, MathArray const & array)
 {
-#ifdef WITH_WARNINGS
-#warning quick and really dirty: make sure that we really own our insets
-#endif
-       MathArray a = array;
-       bf_.insert(bf_.begin() + pos, a.bf_.begin(), a.bf_.end());
+       bf_.insert(bf_.begin() + pos, array.bf_.begin(), array.bf_.end());
+       for (int p = pos; p < pos + array.size(); next(p)) 
+               if (isInset(p)) 
+                       replace(p, GetInset(p)->clone());
 }