From 57deff6c3d1b6751248f9764e6649d1e4e400f14 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 2 Feb 2011 22:15:52 +0000 Subject: [PATCH] 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 --- src/Floating.cpp | 2 +- src/Floating.h | 7 ++++--- src/LaTeXFeatures.cpp | 4 ++-- src/Text3.cpp | 2 +- src/TextClass.cpp | 12 ++++++------ src/insets/InsetFloatList.cpp | 4 ++-- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Floating.cpp b/src/Floating.cpp index cf48630f69..36b70a2b8d 100644 --- a/src/Floating.cpp +++ b/src/Floating.cpp @@ -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) {} diff --git a/src/Floating.h b/src/Floating.h index d50fa90870..cde5c91c2e 100644 --- a/src/Floating.h +++ b/src/Floating.h @@ -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_; /// diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index bdf264f972..bcbe4f0278 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -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" diff --git a/src/Text3.cpp b/src/Text3.cpp index f4aca5b3ee..aec29086af 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -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; diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 14c8189188..f43fe7d365 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -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), diff --git a/src/insets/InsetFloatList.cpp b/src/insets/InsetFloatList.cpp index e52f416aa5..70224f8427 100644 --- a/src/insets/InsetFloatList.cpp +++ b/src/insets/InsetFloatList.cpp @@ -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") {