]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathMacroTemplate.cpp
* src/frontends/GuiDocument.{cpp,h}:
[lyx.git] / src / mathed / MathMacroTemplate.cpp
index 68926d47aef40849a248fe4a91224d20c6cc7589..b7ecb9bbc535511fec76a8662dddf88af316d60b 100644 (file)
@@ -137,8 +137,6 @@ void InsetLabelBox::metrics(MetricsInfo & mi, Dimension & dim) const
                if (!parent_.premetrics())
                        dim.des += maxasc + maxdes + 1;
        }
-
-       setDimCache(mi, dim);
 }
 
 
@@ -221,7 +219,6 @@ void DisplayLabelBox::metrics(MetricsInfo & mi, Dimension & dim) const
                dim.wid = 0;
                dim.asc = 0;
                dim.des = 0;
-               setDimCache(mi, dim);
        }
 }
 
@@ -396,7 +393,11 @@ MathMacroTemplate::MathMacroTemplate(docstring const & str)
 
 Inset * MathMacroTemplate::clone() const
 {
-       return new MathMacroTemplate(*this);
+       MathMacroTemplate * inset = new MathMacroTemplate(*this);
+       // the parent pointers of the proxy insets above will point to
+       // to the old template. Hence, the look must be updated.
+       inset->updateLook();
+       return inset;
 }
 
 
@@ -975,7 +976,7 @@ void MathMacroTemplate::write(WriteStream & os, bool overwriteRedefinition) cons
        if (os.latex() && optionals_ > 1)
                os << "\\newlyxcommand";
        else {
-               if (redefinition_)
+               if (redefinition_ && !overwriteRedefinition)
                        os << "\\renewcommand";
                else
                        os << "\\newcommand";