mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
A bit of renaming, plus default values for htmlTag() and htmlClass().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32244 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6eb15ce722
commit
d88e9655be
@ -27,11 +27,11 @@ Floating::Floating()
|
|||||||
Floating::Floating(string const & type, string const & placement,
|
Floating::Floating(string const & type, string const & placement,
|
||||||
string const & ext, string const & within,
|
string const & ext, string const & within,
|
||||||
string const & style, string const & name,
|
string const & style, string const & name,
|
||||||
string const & listName, string const & htmlType,
|
string const & listName, string const & htmlTag,
|
||||||
string const & htmlClass, string const & htmlStyle,
|
string const & htmlClass, string const & htmlStyle,
|
||||||
bool builtin)
|
bool builtin)
|
||||||
: type_(type), placement_(placement), ext_(ext), within_(within),
|
: type_(type), placement_(placement), ext_(ext), within_(within),
|
||||||
style_(style), name_(name), listName_(listName), htmlType_(htmlType),
|
style_(style), name_(name), listName_(listName), htmlTag_(htmlTag),
|
||||||
htmlClass_(htmlClass), htmlStyle_(htmlStyle), builtin_(builtin)
|
htmlClass_(htmlClass), htmlStyle_(htmlStyle), builtin_(builtin)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -86,13 +86,17 @@ string const & Floating::htmlStyle() const
|
|||||||
|
|
||||||
string const & Floating::htmlClass() const
|
string const & Floating::htmlClass() const
|
||||||
{
|
{
|
||||||
|
if (htmlClass_.empty())
|
||||||
|
htmlClass_ = "float-" + type_;
|
||||||
return htmlClass_;
|
return htmlClass_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const & Floating::htmlType() const
|
string const & Floating::htmlTag() const
|
||||||
{
|
{
|
||||||
return htmlType_;
|
if (htmlTag_.empty())
|
||||||
|
htmlTag_ = "div";
|
||||||
|
return htmlTag_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,10 +50,10 @@ public:
|
|||||||
std::string const & listName() const;
|
std::string const & listName() const;
|
||||||
/// style information, for preamble
|
/// style information, for preamble
|
||||||
std::string const & htmlStyle() const;
|
std::string const & htmlStyle() const;
|
||||||
/// class, for css
|
/// class, for css, defaults to "float-" + type()
|
||||||
std::string const & htmlClass() const;
|
std::string const & htmlClass() const;
|
||||||
/// tag type
|
/// tag type, defaults to "div"
|
||||||
std::string const & htmlType() const;
|
std::string const & htmlTag() const;
|
||||||
///
|
///
|
||||||
bool builtin() const;
|
bool builtin() const;
|
||||||
private:
|
private:
|
||||||
@ -71,11 +71,11 @@ private:
|
|||||||
std::string name_;
|
std::string name_;
|
||||||
///
|
///
|
||||||
std::string listName_;
|
std::string listName_;
|
||||||
/// HTML Element type, usually div
|
///
|
||||||
std::string htmlType_;
|
mutable std::string htmlTag_;
|
||||||
/// class attribute, e.g., float-table, for CSS
|
///
|
||||||
std::string htmlClass_;
|
mutable std::string htmlClass_;
|
||||||
/// CSS information for this element
|
///
|
||||||
std::string htmlStyle_;
|
std::string htmlStyle_;
|
||||||
///
|
///
|
||||||
bool builtin_;
|
bool builtin_;
|
||||||
|
@ -853,7 +853,7 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
FT_BUILTIN,
|
FT_BUILTIN,
|
||||||
FT_HTMLSTYLE,
|
FT_HTMLSTYLE,
|
||||||
FT_HTMLCLASS,
|
FT_HTMLCLASS,
|
||||||
FT_HTMLTYPE,
|
FT_HTMLTAG,
|
||||||
FT_END
|
FT_END
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -863,7 +863,7 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
{ "guiname", FT_NAME },
|
{ "guiname", FT_NAME },
|
||||||
{ "htmlclass", FT_HTMLCLASS },
|
{ "htmlclass", FT_HTMLCLASS },
|
||||||
{ "htmlstyle", FT_HTMLSTYLE },
|
{ "htmlstyle", FT_HTMLSTYLE },
|
||||||
{ "htmltype", FT_HTMLTYPE },
|
{ "htmltag", FT_HTMLTAG },
|
||||||
{ "latexbuiltin", FT_BUILTIN },
|
{ "latexbuiltin", FT_BUILTIN },
|
||||||
{ "listname", FT_LISTNAME },
|
{ "listname", FT_LISTNAME },
|
||||||
{ "numberwithin", FT_WITHIN },
|
{ "numberwithin", FT_WITHIN },
|
||||||
@ -877,7 +877,7 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
string ext;
|
string ext;
|
||||||
string htmlclass;
|
string htmlclass;
|
||||||
string htmlstyle;
|
string htmlstyle;
|
||||||
string htmltype;
|
string htmltag;
|
||||||
string listName;
|
string listName;
|
||||||
string name;
|
string name;
|
||||||
string placement;
|
string placement;
|
||||||
@ -948,9 +948,9 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
lexrc.next();
|
lexrc.next();
|
||||||
htmlstyle = lexrc.getLongString("EndHTMLStyle");
|
htmlstyle = lexrc.getLongString("EndHTMLStyle");
|
||||||
break;
|
break;
|
||||||
case FT_HTMLTYPE:
|
case FT_HTMLTAG:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
htmltype = lexrc.getString();
|
htmltag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case FT_END:
|
case FT_END:
|
||||||
getout = true;
|
getout = true;
|
||||||
@ -961,7 +961,7 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
// Here if have a full float if getout == true
|
// Here if have a full float if getout == true
|
||||||
if (getout) {
|
if (getout) {
|
||||||
Floating fl(type, placement, ext, within, style, name,
|
Floating fl(type, placement, ext, within, style, name,
|
||||||
listName, htmltype, htmlclass, htmlstyle, builtin);
|
listName, htmltag, htmlclass, htmlstyle, builtin);
|
||||||
floatlist_.newFloat(fl);
|
floatlist_.newFloat(fl);
|
||||||
// each float has its own counter
|
// each float has its own counter
|
||||||
counters_.newCounter(from_ascii(type), from_ascii(within),
|
counters_.newCounter(from_ascii(type), from_ascii(within),
|
||||||
|
@ -285,10 +285,8 @@ docstring InsetFloat::xhtml(odocstream & os, OutputParams const & rp) const
|
|||||||
{
|
{
|
||||||
FloatList const & floats = buffer().params().documentClass().floats();
|
FloatList const & floats = buffer().params().documentClass().floats();
|
||||||
Floating const & ftype = floats.getType(params_.type);
|
Floating const & ftype = floats.getType(params_.type);
|
||||||
string const htmltype = ftype.htmlType().empty() ?
|
string const & htmltype = ftype.htmlTag();
|
||||||
"div" : ftype.htmlType();
|
string const & htmlclass = ftype.htmlClass();
|
||||||
string const htmlclass = ftype.htmlClass().empty() ?
|
|
||||||
"float-" + params_.type : ftype.htmlClass();
|
|
||||||
docstring const otag =
|
docstring const otag =
|
||||||
from_ascii("<" + htmltype + " class='float " + htmlclass + "'>\n");
|
from_ascii("<" + htmltype + " class='float " + htmlclass + "'>\n");
|
||||||
docstring const ctag = from_ascii("</" + htmltype + ">\n");
|
docstring const ctag = from_ascii("</" + htmltype + ">\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user