On Wed, Jul 02, 2003 at 01:09:57PM +0300, Martin Vermeer wrote:
> OK Jürgen, here is the updated patch

Is this something that should go into CVS at some time or just some
'private add-on'?

If the former I have some minor nitpicks:

> Index: bufferparams.C
> ===================================================================
> RCS file: /cvs/lyx/lyx-devel/src/bufferparams.C,v
> retrieving revision 1.56
> diff -u -p -r1.56 bufferparams.C
> --- bufferparams.C    2003/06/30 23:55:51     1.56
> +++ bufferparams.C    2003/07/02 09:34:26
> @@ -67,6 +67,7 @@ BufferParams::BufferParams()
>       secnumdepth = 3;
>       tocdepth = 3;
>       language = default_language;
> +     branch_sel = "";

This is not needed. 

> +             } else if ((tmptok == "Note")          || (tmptok == "comment")
> +                                     || (tmptok =="blind")      || (tmptok == 
> "foot")
> +                                     || (tmptok == "margin")    || (tmptok == 
> "petite")
> +                                     || (tmptok == "greyedout") || (tmptok == 
> "branch")

[And _I_ am not a fan of 'obviously' superfluous parantheses ;-}]

> Index: frontends/controllers/Dialog.C
> ===================================================================
> RCS file: /cvs/lyx/lyx-devel/src/frontends/controllers/Dialog.C,v
> retrieving revision 1.5
> diff -u -p -r1.5 Dialog.C
> --- frontends/controllers/Dialog.C    2003/06/30 23:56:10     1.5
> +++ frontends/controllers/Dialog.C    2003/07/02 09:34:27
> @@ -66,8 +66,9 @@ void Dialog::RestoreButton()
>  
>  void Dialog::show(string const & data)
>  {
> -     if (controller().isBufferDependent() && !kernel().isBufferAvailable())
> +     if (controller().isBufferDependent() && !kernel().isBufferAvailable()) {
>               return;
> +     }

What's that?

> @@ -814,6 +819,9 @@ bool FormDocument::options_apply(BufferP
>       params.float_placement =
>               getString(options_->input_float_placement);
>  
> +     params.branch_sel =
> +             getString(options_->input_branch);
> +     
>       return redo;

Should fit on a line, shouldn't it?

> diff -u -p -r1.26 insetnote.C
> --- insets/insetnote.C        2003/06/16 11:49:32     1.26
> +++ insets/insetnote.C        2003/07/02 09:34:30
>  using std::ostream;
>  
>  
>  void InsetNote::init()
>  {
> -     LyXFont font(LyXFont::ALL_SANE);
> -     font.decSize();
> -     font.decSize();
> -     font.setColor(LColor::note);
> -     setLabelFont(font);
> -     setBackgroundColor(LColor::notebg);
> -     setLabel(_("note"));
>       setInsetName("Note");
> +     setButtonLabel();
>  }
>  
>  
> -InsetNote::InsetNote(BufferParams const & bp)
> +InsetNote::InsetNote(BufferParams const & bp, string const & label)
>       : InsetCollapsable(bp)
>  {
> +     params_.type = label;
>       init();
> +     setLabel(label);
>  }

>  InsetBase * InsetNote::clone() const
>  {
>       return new InsetNote(*this);
> @@ -67,6 +73,246 @@ string const InsetNote::editMessage() co
>  
>  void InsetNote::write(Buffer const * buf, ostream & os) const
>  {
> -     os << getInsetName() << "\n";
> +     params_.write(os);
>       InsetCollapsable::write(buf, os);
> +
> +}  

Why that line?

> +void InsetNote::read(Buffer const * buf, LyXLex & lex)
> +{
> +     //params_.read(lex);
> +    if (params_.type == "branch") {
> +             if (lex.isOK()) {
> +                     lex.next();
> +                     params_.branch = lex.getString();
> +             }
> +     }

Indentation is off (spaces instead of tabs)

> +             return InsetCollapsable::localDispatch(cmd);
> +
> +     case LFUN_INSET_DIALOG_UPDATE:
> +                     InsetNoteMailer("note", *this).updateDialog(bv);
> +                     return DISPATCHED;
> +             
> +     case LFUN_MOUSE_RELEASE:
> +             if (cmd.button() == mouse_button::button3) {
> +                 InsetNoteMailer("note", *this).showDialog(bv);
> +                     return DISPATCHED;
> +             }

Here as well.

> +                     
> +     default:
> +             return InsetCollapsable::localDispatch(cmd);
> +     }
> +
> +     return UNDISPATCHED; // suppresses warning

Should not be needed if all branches end in 'return'.

> +     if ((pt != "blind") && (pt != "branch")) {

Parantheses (comes up multiple times)

> +void InsetNote::validate(LaTeXFeatures & features) const
> +{
> +     if (params_.type == "comment") features.require("verbatim");
> +     inset.validate(features);
> +}

Break that 'if' line

> +string const InsetNoteMailer::params2string(string const & name,
> +                             InsetNoteParams const & params)
> +{
> +     ostringstream data;
> +     data << name << ' ';
> +     params.write(data);
> +     return STRCONV(data.str());
> +
> +}

Why the empty line?

> +     if (type == "branch") {
> +     if (lex.isOK()) {
> +             lex.next();
> +             branch = lex.getString();
> +             }
> +     }

Intendation.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)

Reply via email to