mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
Fix another part of 5403, again to do with case sensitivity.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27109 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e171ec6929
commit
976a59af1b
@ -785,7 +785,7 @@ int InsetCollapsable::latex(odocstream & os,
|
||||
// collapsable insets should not redefine this, non-standard ones may
|
||||
// call this.
|
||||
if (!layout_->latexname().empty()) {
|
||||
if (layout_->latextype() == "command") {
|
||||
if (layout_->latextype() == InsetLayout::COMMAND) {
|
||||
// FIXME UNICODE
|
||||
if (runparams.moving_arg)
|
||||
os << "\\protect";
|
||||
@ -793,7 +793,7 @@ int InsetCollapsable::latex(odocstream & os,
|
||||
if (!layout_->latexparam().empty())
|
||||
os << from_utf8(layout_->latexparam());
|
||||
os << '{';
|
||||
} else if (layout_->latextype() == "environment") {
|
||||
} else if (layout_->latextype() == InsetLayout::ENVIRONMENT) {
|
||||
os << "%\n\\begin{" << from_utf8(layout_->latexname()) << "}\n";
|
||||
if (!layout_->latexparam().empty())
|
||||
os << from_utf8(layout_->latexparam());
|
||||
@ -806,9 +806,9 @@ int InsetCollapsable::latex(odocstream & os,
|
||||
rp.moving_arg = true;
|
||||
int i = InsetText::latex(os, rp);
|
||||
if (!layout_->latexname().empty()) {
|
||||
if (layout_->latextype() == "command") {
|
||||
if (layout_->latextype() == InsetLayout::COMMAND) {
|
||||
os << "}";
|
||||
} else if (layout_->latextype() == "environment") {
|
||||
} else if (layout_->latextype() == InsetLayout::ENVIRONMENT) {
|
||||
os << "\n\\end{" << from_utf8(layout_->latexname()) << "}\n";
|
||||
i += 4;
|
||||
}
|
||||
|
@ -32,8 +32,9 @@ namespace lyx {
|
||||
|
||||
InsetLayout::InsetLayout() :
|
||||
name_(from_ascii("undefined")), lyxtype_(STANDARD),
|
||||
labelstring_(from_ascii("UNDEFINED")), decoration_(InsetLayout::DEFAULT),
|
||||
font_(sane_font), labelfont_(sane_font), bgcolor_(Color_error),
|
||||
labelstring_(from_ascii("UNDEFINED")), decoration_(DEFAULT),
|
||||
latextype_(NOLATEXTYPE), font_(sane_font),
|
||||
labelfont_(sane_font), bgcolor_(Color_error),
|
||||
multipar_(false), custompars_(false), forceplain_(true),
|
||||
passthru_(false), needprotect_(false), freespacing_(false),
|
||||
keepempty_(false), forceltr_(false)
|
||||
@ -55,6 +56,17 @@ InsetLayout::InsetDecoration translateDecoration(std::string const & str)
|
||||
return InsetLayout::DEFAULT;
|
||||
}
|
||||
|
||||
InsetLayout::InsetLaTeXType translateLaTeXType(std::string const & str)
|
||||
{
|
||||
if (support::compare_ascii_no_case(str, "command") == 0)
|
||||
return InsetLayout::COMMAND;
|
||||
if (support::compare_ascii_no_case(str, "environment") == 0)
|
||||
return InsetLayout::ENVIRONMENT;
|
||||
if (support::compare_ascii_no_case(str, "none") == 0)
|
||||
return InsetLayout::NOLATEXTYPE;
|
||||
return InsetLayout::ILT_ERROR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -144,9 +156,14 @@ bool InsetLayout::read(Lexer & lex, TextClass & tclass)
|
||||
LYXERR0("Unknown LyXType `" << lt << "'.");
|
||||
break;
|
||||
}
|
||||
case IL_LATEXTYPE:
|
||||
lex >> latextype_;
|
||||
case IL_LATEXTYPE: {
|
||||
string lt;
|
||||
lex >> lt;
|
||||
latextype_ = translateLaTeXType(lt);
|
||||
if (latextype_ == ILT_ERROR)
|
||||
LYXERR0("Unknown LaTeXType `" << lt << "'.");
|
||||
break;
|
||||
}
|
||||
case IL_LABELSTRING:
|
||||
lex >> labelstring_;
|
||||
break;
|
||||
|
@ -46,6 +46,12 @@ public:
|
||||
END,
|
||||
STANDARD
|
||||
};
|
||||
enum InsetLaTeXType {
|
||||
NOLATEXTYPE,
|
||||
COMMAND,
|
||||
ENVIRONMENT,
|
||||
ILT_ERROR
|
||||
};
|
||||
///
|
||||
bool read(Lexer & lexrc, TextClass & tclass);
|
||||
///
|
||||
@ -57,7 +63,7 @@ public:
|
||||
///
|
||||
InsetDecoration decoration() const { return decoration_; };
|
||||
///
|
||||
std::string latextype() const { return latextype_; };
|
||||
InsetLaTeXType latextype() const { return latextype_; };
|
||||
///
|
||||
std::string latexname() const { return latexname_; };
|
||||
///
|
||||
@ -102,7 +108,7 @@ private:
|
||||
///
|
||||
InsetDecoration decoration_;
|
||||
///
|
||||
std::string latextype_;
|
||||
InsetLaTeXType latextype_;
|
||||
///
|
||||
std::string latexname_;
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user