From a5b01f8f96efc95633a8da1cf4748aa473a89f1a Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 2 Feb 2011 17:32:59 +0000 Subject: [PATCH] More related to #7224: It's OK for layouts not to provide a ListCommand 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 | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/TextClass.cpp b/src/TextClass.cpp index b90627cbf9..14c8189188 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -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); -- 2.39.2