Martin Vermeer wrote:
> Does this look ready to go in?

Don't use 
+/* This file is part of
+ * ======================================================
+ *
+ *           LyX, The Document Processor
+ *
+ *           Copyright 1995 Matthias Ettrich
+ *           Copyright 1995-2001 The LyX Team.
+ *
+ *
+ * ====================================================== */

Use
/**
 * \file BranchList.C
 * This file is part of LyX, the document processor.
 * Licence details can be found in the file COPYING.
 *
 * \author Martin Vermeer
 *
 * Full author contact details are available in file CREDITS
 */


You mean 'Assert(false)' here I think.
+string BranchList::getColor(string const & s) const
        ...
+       Assert(true);
+       return string();
+}

Can 's' belong to multiple branches? If not you should have a 'break' in 
there. Your Assert isn't doing much at the moment ;-)
+void BranchList::setColor(string const & s, string const & val)
+{
+       List::iterator it = list.begin();
+       List::iterator end = list.end();
+       for (; it != end; it++) {
+               if (s.find(it->getBranch(), 0) != string::npos) {
+                       it->setColor(val);
                        break;
+               }
+       }
+       Assert(true);
        Assert(false);
+}

Same question for setSelected. Do you need a 'break' in the loop?

I think the logic here is wrong.
+void BranchList::add(string const & s)
+{
+       string name;
+       size_t i = 0;
+       size_t j = 0;
+       Branch br;
+       while (j < string::npos) {
+               j = s.find_first_of(separator(), i);
+               name = s.substr(i, j - i);
+               br.setBranch(name);
+               br.setSelected(false);
+               br.setBranch(name);
+               br.setColor("none");
+               list.push_back(br);
+               i = j;
+               i++;
+       }
+}

        for (;;) {
                string::size_type const j = s.find_first_of(separator(), i);
                if (j == string::npos)
                        break;
                ...
        }

Ditto for setColors.

I'm not an author of this file, or of FormBranch.h, or indeed of 
insetbranch.[Ch] ;-)
+/**
+ * \file FormBranch.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Angus Leeming
+ * \author Martin Vermeer
+ *
+ * Full author contact details are available in file CREDITS
+ */

You could reasonably add yourself as an author of FormDocument.C

You've added some spurious white space to insetnote.h (although you have 
also removed some from insetnote.C).


-- 
Angus

Reply via email to