[EMAIL PROTECTED] writes:

| Author: sts
| Date: Mon May 21 08:27:32 2007
| New Revision: 18435
| 
| URL: http://www.lyx.org/trac/changeset/18435
| Log:
| * cloned macros need an update because the argument proxies point to the old 
macro
| 
| Modified:
|     lyx-devel/branches/personal/sts/dynmacro/src/mathed/MathMacro.cpp
| 
| Modified: lyx-devel/branches/personal/sts/dynmacro/src/mathed/MathMacro.cpp
| URL: 
http://www.lyx.org/trac/file/lyx-devel/branches/personal/sts/dynmacro/src/mathed/MathMacro.cpp?rev=18435
| ==============================================================================
| --- lyx-devel/branches/personal/sts/dynmacro/src/mathed/MathMacro.cpp 
(original)
| +++ lyx-devel/branches/personal/sts/dynmacro/src/mathed/MathMacro.cpp Mon May 
21 08:27:32 2007
| @@ -88,7 +88,10 @@
|  
|  auto_ptr<Inset> MathMacro::doClone() const
|  {
| -     return auto_ptr<Inset>(new MathMacro(*this));
| +     MathMacro * copy = new MathMacro(*this);
| +     copy->needsUpdate_ = true;
| +     copy->expanded_.cell(0).clear();
| +     return auto_ptr<Inset>(copy);
|  }

Why not:

        auto_ptr<Inset> tmpInset(new MathMacro(*this));
        tmpInset->needsUpdate_ = true;
        tmpInset->expanded_.cell(0).clear();
        return tmpInset;
?

A bit safer if it works.

-- 
        Lgb

Reply via email to