]> git.lyx.org Git - lyx.git/commitdiff
More related to #7224: It's OK for layouts not to provide a ListCommand
authorRichard Heck <rgheck@comcast.net>
Wed, 2 Feb 2011 17:32:59 +0000 (17:32 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 2 Feb 2011 17:32:59 +0000 (17:32 +0000)
if a float writes to the same auxfile as an existing float. E.g., in the
aguplus classes, we have a plate float that writes to lof and so is just
treated as a figure, for TOC purposes.

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

src/TextClass.cpp

index b90627cbf9ef3391f96b98efeb00628274ca7823..14c8189188899ae612fe468f9e8d7c89f0c953d9 100644 (file)
@@ -1040,10 +1040,23 @@ bool TextClass::readFloat(Lexer & lexrc)
 
        // Here we have a full float if getout == true
        if (getout) {
-               if (!needsfloat && listcommand.empty())
-                       LYXERR0("The layout does not provide a list command " <<
-                               "for the builtin float `" << type << "'. LyX will " <<
-                               "not be able to produce a float list.");
+               if (!needsfloat && 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();
+                       FloatList::const_iterator en = floatlist_.end();
+                       bool found_ext = false;
+                       for (; it != en; ++it) {
+                               if (it->second.ext() == ext) {
+                                       found_ext = true;
+                                       break;
+                               }
+                       }
+                       if (!found_ext)
+                               LYXERR0("The layout does not provide a list command " <<
+                                 "for the builtin 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);