From: André Pönitz Date: Tue, 3 Jul 2001 15:04:59 +0000 (+0000) Subject: mathed89.diff - fix "random" crashes X-Git-Tag: 1.6.10~21144 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e546fb9b37715309b3218f3cea7b0da9d4730fa9;p=features.git mathed89.diff - fix "random" crashes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2174 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 7bda17ac37..0d99b5727b 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -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 * formulabase.C (localDispatch): use .c_str() on istringstream diff --git a/src/mathed/array.C b/src/mathed/array.C index a1e7063a4b..ba0e1be587 100644 --- a/src/mathed/array.C +++ b/src/mathed/array.C @@ -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()); }