#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)
}
-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));
}
bool MathDecorationInset::ams() const
{
- return
+ return
+ key_->name == "overleftarrow" ||
+ key_->name == "overrightarrow" ||
key_->name == "overleftrightarrow" ||
key_->name == "underleftarrow" ||
key_->name == "underrightarrow" ||
}
-void MathDecorationInset::validate(LaTeXFeatures & features) const
-{
- if (ams())
- features.require("amsmath");
-}
-
-
void MathDecorationInset::write(WriteStream & os) const
{
if (os.fragile() && protect())
{
os << "Deco: " << key_->name;
}
+
+
+void MathDecorationInset::validate(LaTeXFeatures & features) const
+{
+ if (ams())
+ features.require("amsmath");
+ MathNestInset::validate(features);
+}
///
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;
bool protect() const;
/// is it a wide decoration?
bool wide() const;
- /// does this need the amsmath package?
+ /// does this need AMS
bool ams() const;
///