On Sat, Mar 26, 2005 at 03:03:02PM +0100, Juergen Spitzmueller wrote: > Martin Vermeer wrote: > > The options problem is in bufferparams.C: > > > > 623 // the options > > 624 if (!options.empty()) { > > 625 os << "\\options " << options << '\n'; > > 626 } > > > > here also the empty string must be handled; I propose by > > "\options none". > > What if a class/package really has an option called "none"? I think we should > try to get bufferparams to not to output options of there are none. As it > used to be. > > Jürgen
Here it is. Works a dream. Are there any other parameters that behave in this way? - Martin
Index: buffer.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v retrieving revision 1.612 diff -u -r1.612 buffer.C --- buffer.C 8 Feb 2005 13:17:57 -0000 1.612 +++ buffer.C 26 Mar 2005 14:41:36 -0000 @@ -13,6 +13,7 @@ #include "buffer.h" #include "author.h" +#include "BranchList.h" #include "buffer_funcs.h" #include "bufferlist.h" #include "bufferparams.h" @@ -394,6 +395,10 @@ int unknown_tokens = 0; int line = -1; int begin_header_line = -1; + + // Initialize parameters that may be/go lacking in header: + params().branchlist().clear(); + params().options = string(); while (lex.isOK()) { lex.next(); Index: BranchList.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BranchList.h,v retrieving revision 1.8 diff -u -r1.8 BranchList.h --- BranchList.h 5 Jan 2004 17:33:56 -0000 1.8 +++ BranchList.h 26 Mar 2005 14:41:36 -0000 @@ -74,6 +74,8 @@ /// bool empty() { return list.empty(); } /// + void clear() { list.clear(); } + /// const_iterator begin() const { return list.begin(); } const_iterator end() const { return list.end(); }
pgpEKIVqDLomS.pgp
Description: PGP signature