Just some renaming, preparatory to disentangling two jobs the current

NeedsFloatPkg tag does.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37429 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-02-02 22:15:52 +00:00
parent 64c4ccbeed
commit 57deff6c3d
6 changed files with 16 additions and 15 deletions

View File

@ -36,7 +36,7 @@ Floating::Floating(string const & type, string const & placement,
string const & htmlStyle, bool needsfloat) string const & htmlStyle, bool needsfloat)
: floattype_(type), placement_(placement), ext_(ext), within_(within), : floattype_(type), placement_(placement), ext_(ext), within_(within),
style_(style), name_(name), listname_(listName), listcommand_(listCmd), style_(style), name_(name), listname_(listName), listcommand_(listCmd),
refprefix_(refPrefix), needsfloatpkg_(needsfloat), html_tag_(htmlTag), refprefix_(refPrefix), usesfloatpkg_(needsfloat), html_tag_(htmlTag),
html_attrib_(htmlAttrib), html_style_(htmlStyle) html_attrib_(htmlAttrib), html_style_(htmlStyle)
{} {}

View File

@ -50,13 +50,14 @@ public:
/// the title of a list of this kind of float /// the title of a list of this kind of float
std::string const & listName() const { return listname_; } std::string const & listName() const { return listname_; }
/// the command used to generate that list. this has to be given /// the command used to generate that list. this has to be given
/// if needsFloatPkg() is false. note that this should not contain /// if usesFloatPkg() is false, unless this float uses the same
/// auxfile as another defined previously. this should not contain
/// the leading "\". /// the leading "\".
std::string const & listCommand() const { return listcommand_; } std::string const & listCommand() const { return listcommand_; }
/// prefix to use for formatted references to such floats /// prefix to use for formatted references to such floats
std::string const & refPrefix() const { return refprefix_; } std::string const & refPrefix() const { return refprefix_; }
/// ///
bool needsFloatPkg() const { return needsfloatpkg_; } bool usesFloatPkg() const { return usesfloatpkg_; }
/// style information, for preamble /// style information, for preamble
std::string const & htmlStyle() const { return html_style_; } std::string const & htmlStyle() const { return html_style_; }
/// class, for css, defaults to "float-" + type() /// class, for css, defaults to "float-" + type()
@ -85,7 +86,7 @@ private:
/// ///
std::string refprefix_; std::string refprefix_;
/// ///
bool needsfloatpkg_; bool usesfloatpkg_;
/// ///
mutable std::string html_tag_; mutable std::string html_tag_;
/// ///

View File

@ -459,7 +459,7 @@ void LaTeXFeatures::useFloat(string const & name, bool subfloat)
// use the "H" modifier. This includes modified table and // use the "H" modifier. This includes modified table and
// figure floats. (Lgb) // figure floats. (Lgb)
Floating const & fl = params_.documentClass().floats().getType(name); Floating const & fl = params_.documentClass().floats().getType(name);
if (!fl.floattype().empty() && fl.needsFloatPkg()) { if (!fl.floattype().empty() && fl.usesFloatPkg()) {
require("float"); require("float");
} }
} }
@ -1297,7 +1297,7 @@ void LaTeXFeatures::getFloatDefinitions(odocstream & os) const
Floating const & fl = floats.getType(cit->first); Floating const & fl = floats.getType(cit->first);
// For builtin floats we do nothing. // For builtin floats we do nothing.
if (!fl.needsFloatPkg()) if (!fl.usesFloatPkg())
continue; continue;
// We have to special case "table" and "figure" // We have to special case "table" and "figure"

View File

@ -2375,7 +2375,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
// make sure we know about such floats // make sure we know about such floats
if (cit == floats.end() || if (cit == floats.end() ||
// and that we know how to generate a list of them // and that we know how to generate a list of them
(!cit->second.needsFloatPkg() && cit->second.listCommand().empty())) { (!cit->second.usesFloatPkg() && cit->second.listCommand().empty())) {
flag.setUnknown(true); flag.setUnknown(true);
// probably not necessary, but... // probably not necessary, but...
enable = false; enable = false;

View File

@ -951,7 +951,7 @@ bool TextClass::readFloat(Lexer & lexrc)
string style; string style;
string type; string type;
string within; string within;
bool needsfloat = true; bool usesfloat = true;
bool getout = false; bool getout = false;
while (!getout && lexrc.isOK()) { while (!getout && lexrc.isOK()) {
@ -975,7 +975,7 @@ bool TextClass::readFloat(Lexer & lexrc)
style = fl.style(); style = fl.style();
name = fl.name(); name = fl.name();
listname = fl.listName(); listname = fl.listName();
needsfloat = fl.needsFloatPkg(); usesfloat = fl.usesFloatPkg();
listcommand = fl.listCommand(); listcommand = fl.listCommand();
refprefix = fl.refPrefix(); refprefix = fl.refPrefix();
} }
@ -1016,7 +1016,7 @@ bool TextClass::readFloat(Lexer & lexrc)
break; break;
case FT_NEEDSFLOAT: case FT_NEEDSFLOAT:
lexrc.next(); lexrc.next();
needsfloat = lexrc.getBool(); usesfloat = lexrc.getBool();
break; break;
case FT_HTMLATTR: case FT_HTMLATTR:
lexrc.next(); lexrc.next();
@ -1040,7 +1040,7 @@ bool TextClass::readFloat(Lexer & lexrc)
// Here we have a full float if getout == true // Here we have a full float if getout == true
if (getout) { if (getout) {
if (!needsfloat && listcommand.empty()) { if (!usesfloat && listcommand.empty()) {
// if this float uses the same auxfile as an existing one, // if this float uses the same auxfile as an existing one,
// there is no need for it to provide a list command. // there is no need for it to provide a list command.
FloatList::const_iterator it = floatlist_.begin(); FloatList::const_iterator it = floatlist_.begin();
@ -1054,12 +1054,12 @@ bool TextClass::readFloat(Lexer & lexrc)
} }
if (!found_ext) if (!found_ext)
LYXERR0("The layout does not provide a list command " << LYXERR0("The layout does not provide a list command " <<
"for the builtin float `" << type << "'. LyX will " << "for the float `" << type << "'. LyX will " <<
"not be able to produce a float list."); "not be able to produce a float list.");
} }
Floating fl(type, placement, ext, within, style, name, Floating fl(type, placement, ext, within, style, name,
listname, listcommand, refprefix, listname, listcommand, refprefix,
htmltag, htmlattr, htmlstyle, needsfloat); htmltag, htmlattr, htmlstyle, usesfloat);
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),

View File

@ -120,7 +120,7 @@ int InsetFloatList::latex(otexstream & os, OutputParams const &) const
if (cit != floats.end()) { if (cit != floats.end()) {
Floating const & fl = cit->second; Floating const & fl = cit->second;
if (fl.needsFloatPkg()) if (fl.usesFloatPkg())
os << "\\listof{" << getParam("type") << "}{" os << "\\listof{" << getParam("type") << "}{"
<< buffer().B_(fl.listName()) << "}\n"; << buffer().B_(fl.listName()) << "}\n";
else { else {
@ -167,7 +167,7 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const &) const {
// If so, then they should define ListName, as non-builtin floats do, and // If so, then they should define ListName, as non-builtin floats do, and
// then we can use that. // then we can use that.
// Really, all floats should define that. // Really, all floats should define that.
if (!cit->second.needsFloatPkg()) { if (!cit->second.usesFloatPkg()) {
// Only two different types allowed here: // Only two different types allowed here:
string const type = cit->second.floattype(); string const type = cit->second.floattype();
if (type == "table") { if (type == "table") {