]> git.lyx.org Git - features.git/commitdiff
Finally, disentangle IsPredefined and UsesFloatPkg. Now achemso gives us
authorRichard Heck <rgheck@comcast.net>
Wed, 2 Feb 2011 22:57:00 +0000 (22:57 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 2 Feb 2011 22:57:00 +0000 (22:57 +0000)
the option to insert a List of Schemes, etc.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37436 a592a061-630c-0410-9148-cb99ea01b6c8

lib/layouts/achemso.layout
src/LaTeXFeatures.cpp
src/frontends/qt4/Menus.cpp
src/insets/InsetFloatList.cpp

index c6cffb932d935e2ae8dc4cc3a2bcf8caa75fc1da..b854318bfddeda6f0b997608db88226632fa25fc 100644 (file)
@@ -61,7 +61,7 @@ Float
        Style                   plain
        ListName                "List of Schemes"
        IsPredefined true
-       UsesFloatPkg false
+       UsesFloatPkg true
 End
 
 InsetLayout scheme
@@ -83,7 +83,7 @@ Float
        Style                   plain
        ListName                "List of Charts"
        IsPredefined true
-       UsesFloatPkg false
+       UsesFloatPkg true
 End
 
 InsetLayout chart
@@ -105,7 +105,7 @@ Float
        Style                   plain
        ListName                "List of Graphs"
        IsPredefined true
-       UsesFloatPkg false
+       UsesFloatPkg true
 End
 
 InsetLayout graph
index bcbe4f027874225f4c12551a5ead4dce26fd1e5f..ac9c1ca4a4ce240f4622ab34db027f82a25b741e 100644 (file)
@@ -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.usesFloatPkg())
+               if (fl.isPredefined())
                        continue;
 
                // We have to special case "table" and "figure"
index 70379d9582e4aa8432e959311a6dce856788da10..b3ec59ff0ee67efb8c194a821995c5dfa1b54c65 100644 (file)
@@ -1096,16 +1096,21 @@ void MenuDefinition::expandFloatListInsert(Buffer const * buf)
        FloatList::const_iterator end = floats.end();
        set<string> seen;
        for (; cit != end; ++cit) {
-               // Different floats could declare the same ListCommand. We only
-               // want it on the list once, though.
-               string const & list_cmd = cit->second.listCommand();
-               // This form of insert returns an iterator pointing to the newly
-               // inserted element OR the existing element with that value, and
-               // a bool indicating whether we inserted a new element. So we can
-               // see if one is there and insert it if not all at once.
-               pair<set<string>::iterator, bool> ret = seen.insert(list_cmd);
-               if (!ret.second)
-                       continue;
+               if (!cit->second.usesFloatPkg()) {
+                       // Different floats could declare the same ListCommand. We only
+                       // want it on the list once, though.
+                       string const & list_cmd = cit->second.listCommand();
+                       if (list_cmd.empty())
+                               // we do not know how to generate such a list
+                               continue;
+                       // This form of insert returns an iterator pointing to the newly
+                       // inserted element OR the existing element with that value, and
+                       // a bool indicating whether we inserted a new element. So we can
+                       // see if one is there and insert it if not all at once.
+                       pair<set<string>::iterator, bool> ret = seen.insert(list_cmd);
+                       if (!ret.second)
+                               continue;
+               }
                string const & list_name = cit->second.listName();
                addWithStatusCheck(MenuItem(MenuItem::Command, qt_(list_name),
                        FuncRequest(LFUN_FLOAT_LIST_INSERT, cit->second.floattype())));
index 70224f842748c3d1c1387cb70c7f5f6cc4cd6aba..b5cdb616c4ae43e6c893de3091785da94e1e8a82 100644 (file)
@@ -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.usesFloatPkg()) {
+       if (cit->second.isPredefined()) {
                // Only two different types allowed here:
                string const type = cit->second.floattype();
                if (type == "table") {