mathed89.diff - fix "random" crashes

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2174 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-07-03 15:04:59 +00:00
parent e40120ce1c
commit e546fb9b37
2 changed files with 7 additions and 5 deletions

View 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

View 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());
}