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)
: floattype_(type), placement_(placement), ext_(ext), within_(within),
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)
{}

View File

@ -50,13 +50,14 @@ public:
/// the title of a list of this kind of float
std::string const & listName() const { return listname_; }
/// 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 "\".
std::string const & listCommand() const { return listcommand_; }
/// prefix to use for formatted references to such floats
std::string const & refPrefix() const { return refprefix_; }
///
bool needsFloatPkg() const { return needsfloatpkg_; }
bool usesFloatPkg() const { return usesfloatpkg_; }
/// style information, for preamble
std::string const & htmlStyle() const { return html_style_; }
/// class, for css, defaults to "float-" + type()
@ -85,7 +86,7 @@ private:
///
std::string refprefix_;
///
bool needsfloatpkg_;
bool usesfloatpkg_;
///
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
// figure floats. (Lgb)
Floating const & fl = params_.documentClass().floats().getType(name);
if (!fl.floattype().empty() && fl.needsFloatPkg()) {
if (!fl.floattype().empty() && fl.usesFloatPkg()) {
require("float");
}
}
@ -1297,7 +1297,7 @@ void LaTeXFeatures::getFloatDefinitions(odocstream & os) const
Floating const & fl = floats.getType(cit->first);
// For builtin floats we do nothing.
if (!fl.needsFloatPkg())
if (!fl.usesFloatPkg())
continue;
// 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
if (cit == floats.end() ||
// 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);
// probably not necessary, but...
enable = false;

View File

@ -951,7 +951,7 @@ bool TextClass::readFloat(Lexer & lexrc)
string style;
string type;
string within;
bool needsfloat = true;
bool usesfloat = true;
bool getout = false;
while (!getout && lexrc.isOK()) {
@ -975,7 +975,7 @@ bool TextClass::readFloat(Lexer & lexrc)
style = fl.style();
name = fl.name();
listname = fl.listName();
needsfloat = fl.needsFloatPkg();
usesfloat = fl.usesFloatPkg();
listcommand = fl.listCommand();
refprefix = fl.refPrefix();
}
@ -1016,7 +1016,7 @@ bool TextClass::readFloat(Lexer & lexrc)
break;
case FT_NEEDSFLOAT:
lexrc.next();
needsfloat = lexrc.getBool();
usesfloat = lexrc.getBool();
break;
case FT_HTMLATTR:
lexrc.next();
@ -1040,7 +1040,7 @@ bool TextClass::readFloat(Lexer & lexrc)
// Here we have a full float if getout == true
if (getout) {
if (!needsfloat && listcommand.empty()) {
if (!usesfloat && listcommand.empty()) {
// if this float uses the same auxfile as an existing one,
// there is no need for it to provide a list command.
FloatList::const_iterator it = floatlist_.begin();
@ -1054,12 +1054,12 @@ bool TextClass::readFloat(Lexer & lexrc)
}
if (!found_ext)
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.");
}
Floating fl(type, placement, ext, within, style, name,
listname, listcommand, refprefix,
htmltag, htmlattr, htmlstyle, needsfloat);
htmltag, htmlattr, htmlstyle, usesfloat);
floatlist_.newFloat(fl);
// each float has its own counter
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()) {
Floating const & fl = cit->second;
if (fl.needsFloatPkg())
if (fl.usesFloatPkg())
os << "\\listof{" << getParam("type") << "}{"
<< buffer().B_(fl.listName()) << "}\n";
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
// then we can use that.
// Really, all floats should define that.
if (!cit->second.needsFloatPkg()) {
if (!cit->second.usesFloatPkg()) {
// Only two different types allowed here:
string const type = cit->second.floattype();
if (type == "table") {