noticed that article, for example, still has a counter "chapter". This
surprised me.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37193
a592a061-630c-0410-9148-
cb99ea01b6c8
# Incremented to format 30, 13 August 2010 by rgh
# Introduced ResetsFont tag for InsetLayout.
+# Incremented to format 31, 12 January 2011 by rgh
+# Introducted NoCounter tag.
+
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
# development/tools/updatelayouts.sh script to update all
# layout files to the new format.
-currentFormat = 30
+currentFormat = 31
def usage(prog_name):
continue
# Only new features
- if format == 29:
+ if format == 29 or format == 30:
i += 1
continue
}
+bool Counters::remove(docstring const & cnt)
+{
+ return counterList_.erase(cnt);
+}
+
+
void Counters::copy(Counters & from, Counters & to, docstring const & match)
{
CounterList::iterator it = counterList_.begin();
void reset();
/// Reset counters matched by match string.
void reset(docstring const & match);
+ /// Remove counter \p cnt.
+ bool remove(docstring const & cnt);
/// Copy counters whose name matches match from the &from to
/// the &to array of counters. Empty string matches all.
void copy(Counters & from, Counters & to,
// development/updatelayouts.sh script, to update the format of
// all of our layout files.
//
-int const LAYOUT_FORMAT = 30;
+int const LAYOUT_FORMAT = 31;
namespace {
TC_RIGHTMARGIN,
TC_FLOAT,
TC_COUNTER,
+ TC_NOCOUNTER,
TC_IFCOUNTER,
TC_NOFLOAT,
TC_TITLELATEXNAME,
{ "input", TC_INPUT },
{ "insetlayout", TC_INSETLAYOUT },
{ "leftmargin", TC_LEFTMARGIN },
+ { "nocounter", TC_NOCOUNTER },
{ "nofloat", TC_NOFLOAT },
{ "nostyle", TC_NOSTYLE },
{ "outputformat", TC_OUTPUTFORMAT },
readCiteFormat(lexrc);
break;
+ case TC_NOCOUNTER:
+ if (lexrc.next()) {
+ docstring const cnt = lexrc.getDocString();
+ if (!counters_.remove(cnt))
+ LYXERR0("Unable to remove counter: " + to_utf8(cnt));
+ }
+ break;
+
case TC_IFCOUNTER:
ifcounter = true;
case TC_COUNTER: