The branch, rgh/CounterValue, has been updated. - Log -----------------------------------------------------------------
commit cd42f35aa041e64c304a1d284a58aecc6c9d3827 Author: Richard Heck <rgh...@lyx.org> Date: Fri May 31 11:08:18 2013 -0400 Use counters, etc, for chunks. diff --git a/lib/layouts/litinsets.inc b/lib/layouts/litinsets.inc index 4f95019..e9575c0 100644 --- a/lib/layouts/litinsets.inc +++ b/lib/layouts/litinsets.inc @@ -8,34 +8,40 @@ Format 45 +Counter chunk + PrettyFormat "Chunk ##" + InitialValue 2 +End + InsetLayout "Flex:Chunk" - LabelString "Chunk" - LatexType none - LyXType Custom - RightDelim <br/>@ - Decoration Classic - Font - Color latex - Family typewriter - EndFont - #LabelFont - #Color latex - #Size Small - #EndFont - MultiPar true - CustomPars false - ForcePlain true - PassThru 1 - ParbreakIsNewline 1 - KeepEmpty true - Spellcheck 0 - FreeSpacing true - ForceLTR true - Argument 1 - Mandatory 1 - LabelString "Options" - Tooltip "Options" - LeftDelim << - RightDelim >>=<br/> - EndArgument + LabelString "Chunk" + LatexType none + LyXType Custom + Counter chunk + RightDelim <br/>@ + Decoration Classic + Font + Color latex + Family typewriter + EndFont + #LabelFont + #Color latex + #Size Small + #EndFont + MultiPar true + CustomPars false + ForcePlain true + PassThru 1 + ParbreakIsNewline 1 + KeepEmpty true + Spellcheck 0 + FreeSpacing true + ForceLTR true + Argument 1 + Mandatory 1 + LabelString "Options" + Tooltip "Options" + LeftDelim << + RightDelim >>=<br/> + EndArgument End commit 32480a4369a824760bde3c7cce9e40a4f23f773b Author: Richard Heck <rgh...@lyx.org> Date: Fri May 31 11:05:14 2013 -0400 Documentation. diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx index bace2f6..33b0db0 100644 --- a/lib/doc/Customization.lyx +++ b/lib/doc/Customization.lyx @@ -19389,6 +19389,37 @@ End \end_layout \begin_layout Description + +\change_inserted 1414654397 1370012684 +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted 1414654397 1370012589 +InitialValue +\end_layout + +\end_inset + + [ +\begin_inset Flex Code +status collapsed + +\begin_layout Plain Layout + +\change_inserted 1414654397 1370012639 +number +\end_layout + +\end_inset + +=1] Sets the initial value for the counter, to which it will be reset whenever + that happens. + Normally, one will want the default, 1. +\end_layout + +\begin_layout Description \begin_inset Flex Code status collapsed commit d16400ff4b324f8156e01d8d1b9a9b1bfd26f652 Author: Richard Heck <rgh...@lyx.org> Date: Fri May 31 11:05:12 2013 -0400 Add a comment. diff --git a/src/Counters.cpp b/src/Counters.cpp index ae31204..7800856 100644 --- a/src/Counters.cpp +++ b/src/Counters.cpp @@ -88,6 +88,10 @@ bool Counter::read(Lexer & lex) case CT_INITIALVALUE: lex.next(); initial_value_ = lex.getInteger() - 1; + // we get -1 on an error, and negative values don't make + // much sense anyway. + if (initial_value_ < 0) + initial_value_ = 0; break; case CT_PRETTYFORMAT: lex.next(); ----------------------------------------------------------------------- Summary of changes: lib/doc/Customization.lyx | 31 +++++++++++++++++++++ lib/layouts/litinsets.inc | 64 ++++++++++++++++++++++++-------------------- src/Counters.cpp | 4 +++ 3 files changed, 70 insertions(+), 29 deletions(-) hooks/post-receive -- Repository for new features