On Mon, Jul 21, 2003 at 12:03:13PM +0000, Angus Leeming spake thusly:

...

> > > If not you should have a 'break' in
> > > there. Your Assert isn't doing much at the moment ;-)
> >
> > It should catch the 'branch not existing' condition and return an
> > empty string. I believe Assert(false) will do that.

Of course the statement following Assert(false) doesn't do much
either... but gcc doesn't notice that and bleats. That's why returning
an empty string :-)

...

> > I don't think it's wrong, but yours looks better. Compiling now.
> 
> Well and good. Nonetheless, it is wrong:
>       while (j < string::npos) {
>                j = s.find_first_of(separator(), i);
>               // j can now be string::npos
>               // j-i makes no sense
>               name = s.substr(i, j - i);

Good point :-) and Alfredo's point that '<' doesn't necessarily work
right with npos.
 
> Angus
 
See the fresh patch attached. Thanks for all the good help!

New ChangeLog entry:

2003-07-21      Martin Vermeer <[EMAIL PROTECTED]>

        * lib/ui/stdmenus.ui:
        * src/BranchList.[Ch]:
        * src/LyXAction.C:
        * src/Makefile.am:
        * src/bufferparams.[Ch]:
        * src/factory.C:
        * src/lfuns.h:
        * src/lyxfunc.C:
        * src/text3.C:
        * src/frontends/controllers/Makefile.am:
        * src/frontends/xforms/Dialogs.C:
        * src/frontends/xforms/FormBranch.[Ch]:
        * src/frontends/xforms/FormDocument.[Ch]:
        * src/frontends/xforms/Makefile.am:
        * src/frontends/xforms/forms/Makefile.am:
        * src/frontends/xforms/forms/form_branch.fd:
        * src/frontends/xforms/forms/form_document.fd:
        * src/insets/Makefile.am:
        * src/insets/inset.h:
        * src/insets/insetbranch.[Ch]:
        * src/insets/insetcollapsable.[Ch]: implements the 'branch inset'
        idea. This allows the output of various versions of a document
        from a single source version, selectively outputing or suppressing
        output of parts of the text.
        This implementation contains a 'branch list editor' in a separate
        tab of the document settings dialog. Branches are user definable.

        * src/insets/insetnote.C: whitespace fix.

Martin
-- 
Martin Vermeer  [EMAIL PROTECTED]
Helsinki University of Technology 
Dept. of Surveying, Inst. of Geodesy
P.O. Box 1200, FIN-02015 HUT, Finland
:wq

Attachment: branch_d.diff.gz
Description: application/gunzip

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to