mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
prepare hanling of chars the nee a backslash when written...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2624 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
70479c5282
commit
11c5864fdb
@ -14,14 +14,21 @@
|
|||||||
|
|
||||||
|
|
||||||
MathCharInset::MathCharInset(char c)
|
MathCharInset::MathCharInset(char c)
|
||||||
: char_(c), code_(nativeCode(c))
|
: char_(c), code_(nativeCode(c)), needbs_(false)
|
||||||
{
|
{
|
||||||
//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
|
//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MathCharInset::MathCharInset(char c, MathTextCodes t)
|
MathCharInset::MathCharInset(char c, MathTextCodes t)
|
||||||
: char_(c), code_((t == LM_TC_MIN) ? nativeCode(c) : t)
|
: char_(c), code_((t == LM_TC_MIN) ? nativeCode(c) : t), needbs_(false)
|
||||||
|
{
|
||||||
|
//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MathCharInset::MathCharInset(char c, MathTextCodes t, bool needbs)
|
||||||
|
: char_(c), code_((t == LM_TC_MIN) ? nativeCode(c) : t), needbs_(needbs)
|
||||||
{
|
{
|
||||||
//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
|
//lyxerr << "creating char '" << char_ << "' with code " << int(code_) << endl;
|
||||||
}
|
}
|
||||||
@ -93,6 +100,8 @@ void MathCharInset::writeTrailer(std::ostream & os) const
|
|||||||
|
|
||||||
void MathCharInset::writeRaw(std::ostream & os) const
|
void MathCharInset::writeRaw(std::ostream & os) const
|
||||||
{
|
{
|
||||||
|
if (needbs_)
|
||||||
|
os << "\\";
|
||||||
os << char_;
|
os << char_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,6 +116,8 @@ void MathCharInset::write(std::ostream & os, bool) const
|
|||||||
|
|
||||||
void MathCharInset::writeNormal(std::ostream & os) const
|
void MathCharInset::writeNormal(std::ostream & os) const
|
||||||
{
|
{
|
||||||
|
if (needbs_)
|
||||||
|
os << "\\";
|
||||||
os << char_;
|
os << char_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,8 @@ public:
|
|||||||
///
|
///
|
||||||
MathCharInset(char c, MathTextCodes t);
|
MathCharInset(char c, MathTextCodes t);
|
||||||
///
|
///
|
||||||
|
MathCharInset(char c, MathTextCodes t, bool needbs);
|
||||||
|
///
|
||||||
MathInset * clone() const;
|
MathInset * clone() const;
|
||||||
///
|
///
|
||||||
MathTextCodes nativeCode(char c) const;
|
MathTextCodes nativeCode(char c) const;
|
||||||
@ -56,7 +58,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
/// the character
|
/// the character
|
||||||
char char_;
|
char char_;
|
||||||
///
|
/// the font to be used on screen
|
||||||
MathTextCodes code_;
|
MathTextCodes code_;
|
||||||
|
/// do wee need a backslash when writing LaTeX?
|
||||||
|
bool needbs_;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user