]> git.lyx.org Git - features.git/commitdiff
correct a wrong nod
authorAndré Pönitz <poenitz@gmx.net>
Sat, 8 Jan 2005 20:28:29 +0000 (20:28 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sat, 8 Jan 2005 20:28:29 +0000 (20:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9458 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_decorationinset.C
src/mathed/math_decorationinset.h

index 2d404421c85f4c71979670d866c55a2b3b71af44..16c6d27018e2412a4b5e37f9ef01a567403c1684 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <config.h>
 
-#include "LaTeXFeatures.h"
 #include "math_decorationinset.h"
 #include "math_data.h"
 #include "math_support.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
 
+#include "LaTeXFeatures.h"
 #include "debug.h"
 
 #include "support/std_ostream.h"
 
-using std::auto_ptr;
-
 
 MathDecorationInset::MathDecorationInset(latexkeys const * key)
        : MathNestInset(1), key_(key)
@@ -33,9 +31,9 @@ MathDecorationInset::MathDecorationInset(latexkeys const * key)
 }
 
 
-auto_ptr<InsetBase> MathDecorationInset::doClone() const
+std::auto_ptr<InsetBase> MathDecorationInset::doClone() const
 {
-       return auto_ptr<InsetBase>(new MathDecorationInset(*this));
+       return std::auto_ptr<InsetBase>(new MathDecorationInset(*this));
 }
 
 
@@ -93,7 +91,9 @@ bool MathDecorationInset::wide() const
 
 bool MathDecorationInset::ams() const
 {
-       return  
+       return
+                       key_->name == "overleftarrow" ||
+                       key_->name == "overrightarrow" ||
                        key_->name == "overleftrightarrow" ||
                        key_->name == "underleftarrow" ||
                        key_->name == "underrightarrow" ||
@@ -133,13 +133,6 @@ void MathDecorationInset::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-void MathDecorationInset::validate(LaTeXFeatures & features) const
-{
-       if (ams())
-               features.require("amsmath");
-}
-
-
 void MathDecorationInset::write(WriteStream & os) const
 {
        if (os.fragile() && protect())
@@ -158,3 +151,11 @@ void MathDecorationInset::infoize(std::ostream & os) const
 {
        os << "Deco: " << key_->name;
 }
+
+
+void MathDecorationInset::validate(LaTeXFeatures & features) const
+{
+       if (ams())
+               features.require("amsmath");
+       MathNestInset::validate(features);
+}
index ca188d12367b36c1983f7fb3be120bdd1a366017..2878523e2e6342b63febe04f9f98cf69c920d580 100644 (file)
@@ -30,13 +30,13 @@ public:
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
-       void validate(LaTeXFeatures & features) const;
-       ///
        void normalize(NormalStream & os) const;
        ///
        void infoize(std::ostream & os) const;
        ///
        bool isScriptable() const;
+       ///
+       void validate(LaTeXFeatures & features) const;
 
 private:
        virtual std::auto_ptr<InsetBase> doClone() const;
@@ -46,7 +46,7 @@ private:
        bool protect() const;
        /// is it a wide decoration?
        bool wide() const;
-       /// does this need the amsmath package?
+       /// does this need AMS
        bool ams() const;
 
        ///