correct a wrong nod

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9458 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2005-01-08 20:28:29 +00:00
parent abe485494e
commit cf913ce651
2 changed files with 17 additions and 16 deletions

View File

@ -11,7 +11,6 @@
#include <config.h>
#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<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);
}

View 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;
///