Add latexparam to CharStyle inset

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8171 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2003-12-01 16:01:50 +00:00
parent c04e54dd4f
commit 918a4067b5
6 changed files with 32 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2003-12-01 Martin Vermeer <martin.vermeer@hut.fi>
* lyxtextclass.[Ch]: add latexparam to CharStyle inset
2003-12-01 Michael Schmitt <michael.schmitt@teststep.org>
* vspace.[Ch]: remove VSpace::NONE

View File

@ -1,4 +1,8 @@
2003-12-01 Martin Vermeer <martin.vermeer@hut.fi>
* insetcharstyle.[Ch]: add latexparam to CharStyle inset
2003-12-01 Martin Vermeer <martin.vermeer@hut.fi>
* insetcollapsable.[Ch]:

View File

@ -49,6 +49,7 @@ InsetCharStyle::InsetCharStyle(BufferParams const & bp,
params_.type = cs->name;
params_.latextype = cs->latextype;
params_.latexname = cs->latexname;
params_.latexparam = cs->latexparam;
params_.font = cs->font;
params_.labelfont = cs->labelfont;
init();
@ -153,7 +154,10 @@ int outputVerbatim(std::ostream & os, InsetText inset)
int InsetCharStyle::latex(Buffer const &, ostream & os,
OutputParams const &) const
{
os << "%\n\\" << params_.latexname << "{";
os << "%\n\\" << params_.latexname;
if (!params_.latexparam.empty())
os << params_.latexparam;
os << "{";
int i = outputVerbatim(os, inset);
os << "}%\n";
i += 2;
@ -164,7 +168,10 @@ int InsetCharStyle::latex(Buffer const &, ostream & os,
int InsetCharStyle::linuxdoc(Buffer const &, std::ostream & os,
OutputParams const &) const
{
os << "<" << params_.latexname << ">";
os << "<" << params_.latexname;
if (!params_.latexparam.empty())
os << " " << params_.latexparam;
os << ">";
int const i = outputVerbatim(os, inset);
os << "</" << params_.latexname << ">";
return i;
@ -174,7 +181,10 @@ int InsetCharStyle::linuxdoc(Buffer const &, std::ostream & os,
int InsetCharStyle::docbook(Buffer const &, std::ostream & os,
OutputParams const &) const
{
os << "<" << params_.latexname << ">";
os << "<" << params_.latexname;
if (!params_.latexparam.empty())
os << " " << params_.latexparam;
os << ">";
int const i = outputVerbatim(os, inset);
os << "</" << params_.latexname << ">";
return i;

View File

@ -30,6 +30,8 @@
///
std::string latexname;
///
std::string latexparam;
///
LyXFont font;
///
LyXFont labelfont;

View File

@ -525,6 +525,7 @@ enum CharStyleTags {
CS_LABELFONT,
CS_LATEXTYPE,
CS_LATEXNAME,
CS_LATEXPARAM,
CS_PREAMBLE,
CS_END
};
@ -537,6 +538,7 @@ void LyXTextClass::readCharStyle(LyXLex & lexrc, string const & name)
{ "font", CS_FONT },
{ "labelfont", CS_LABELFONT },
{ "latexname", CS_LATEXNAME },
{ "latexparam", CS_LATEXPARAM },
{ "latextype", CS_LATEXTYPE },
{ "preamble", CS_PREAMBLE}
};
@ -545,6 +547,7 @@ void LyXTextClass::readCharStyle(LyXLex & lexrc, string const & name)
string latextype;
string latexname;
string latexparam;
LyXFont font(LyXFont::ALL_INHERIT);
LyXFont labelfont(LyXFont::ALL_INHERIT);
string preamble;
@ -567,6 +570,10 @@ void LyXTextClass::readCharStyle(LyXLex & lexrc, string const & name)
lexrc.next();
latexname = lexrc.getString();
break;
case CS_LATEXPARAM:
lexrc.next();
latexparam = subst(lexrc.getString(), "&quot;", "\"");
break;
case CS_LABELFONT:
labelfont.lyxRead(lexrc);
break;
@ -590,6 +597,7 @@ void LyXTextClass::readCharStyle(LyXLex & lexrc, string const & name)
cs.name = name;
cs.latextype = latextype;
cs.latexname = latexname;
cs.latexparam = latexparam;
cs.font = font;
cs.labelfont = labelfont;
cs.preamble = preamble;

View File

@ -27,6 +27,7 @@ struct CharStyle {
std::string name;
std::string latextype;
std::string latexname;
std::string latexparam;
LyXFont font;
LyXFont labelfont;
std::string preamble;