Martin's validate() patch (\pm\varepsilon\smile)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3417 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-01-18 14:27:54 +00:00
parent 42bf3b3fc0
commit c7c443e5e2
4 changed files with 23 additions and 10 deletions

View File

@ -14,6 +14,7 @@
#include "math_parser.h"
#include "debug.h"
#include "math_mathmlstream.h"
#include "LaTeXFeatures.h"
MathCharInset::MathCharInset(char c)
@ -121,6 +122,13 @@ void MathCharInset::handleFont(MathTextCodes t)
code_ = (code_ == t) ? LM_TC_VAR : t;
}
void MathCharInset::validate(LaTeXFeatures & features) const
{
// Make sure amssymb is put in preamble if Blackboard Bold or
// Fraktur used:
if ( (code_ == LM_TC_BB) || (code_ == LM_TC_EUFRAK) )
features.require("amssymb");
}
bool MathCharInset::match(MathInset * p) const
{

View File

@ -51,6 +51,8 @@ public:
///
bool isRelOp() const;
///
void validate(LaTeXFeatures & features) const;
///
void handleFont(MathTextCodes t);
///
bool match(MathInset *) const;

View File

@ -11,6 +11,7 @@
#include "Painter.h"
#include "math_support.h"
#include "math_parser.h"
#include "LaTeXFeatures.h"
#include "debug.h"
#include <cctype>
@ -48,6 +49,12 @@ int MathStringInset::width() const
return mathed_string_width(code_, mi_, str_);
}
void MathStringInset::validate(LaTeXFeatures & features) const
{
//lyxerr << "stringinset amssymb" << endl;
if (code_ == LM_TC_MSA || code_ == LM_TC_MSB)
features.require("amssymb");
}
void MathStringInset::metrics(MathMetricsInfo const & mi) const
{
@ -118,8 +125,3 @@ void MathStringInset::write(WriteStream & os) const
}
void MathStringInset::validate(LaTeXFeatures & features) const
{
// if (...)
// features.require("amssymb");
}

View File

@ -5,6 +5,7 @@
#include "math_streamstr.h"
#include "math_support.h"
#include "math_parser.h"
#include "LaTeXFeatures.h"
#include "debug.h"
@ -119,6 +120,11 @@ bool MathSymbolInset::takesLimits() const
return sym_->token == LM_TK_CMEX;
}
void MathSymbolInset::validate(LaTeXFeatures & features) const
{
if (sym_->token == LM_TK_MSA || sym_->token == LM_TK_MSB)
features.require("amssymb");
}
void MathSymbolInset::normalize(NormalStream & os) const
{
@ -183,8 +189,3 @@ void MathSymbolInset::infoize(std::ostream & os) const
}
void MathSymbolInset::validate(LaTeXFeatures & features) const
{
// if (...)
// features.require("amssymb");
}