From: André Pönitz Date: Sat, 8 Jan 2005 20:28:29 +0000 (+0000) Subject: correct a wrong nod X-Git-Tag: 1.6.10~14676 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=cf913ce651eed8030ed616c147cebbd893d819d0;p=features.git correct a wrong nod git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9458 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/math_decorationinset.C b/src/mathed/math_decorationinset.C index 2d404421c8..16c6d27018 100644 --- a/src/mathed/math_decorationinset.C +++ b/src/mathed/math_decorationinset.C @@ -11,7 +11,6 @@ #include -#include "LaTeXFeatures.h" #include "math_decorationinset.h" #include "math_data.h" #include "math_support.h" @@ -19,12 +18,11 @@ #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 MathDecorationInset::doClone() const +std::auto_ptr MathDecorationInset::doClone() const { - return auto_ptr(new MathDecorationInset(*this)); + return std::auto_ptr(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); +} diff --git a/src/mathed/math_decorationinset.h b/src/mathed/math_decorationinset.h index ca188d1236..2878523e2e 100644 --- a/src/mathed/math_decorationinset.h +++ b/src/mathed/math_decorationinset.h @@ -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 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; ///