John Levon <[EMAIL PROTECTED]> writes:

|  bool CutAndPaste::checkPastePossible(LyXParagraph *)
|  {
| -    if (!buf) return false;
| -
| -    return true;
| +     return buf;
|  }

I don't like this. 
at most change it to 

        return buf ? true : false;

but this is probably just me...

| diff -u -r1.78 lyxparagraph.h
| --- lyxparagraph.h    2001/05/30 13:53:30     1.78
| +++ lyxparagraph.h    2001/06/01 19:57:23
| @@ -111,8 +111,9 @@
|       ///
|  
|       string const String(Buffer const *, bool label);
| -     ///
| -     string const String(Buffer const *, size_type beg, size_type end);
| +     /// if withlabels is false, don't include label strings
| +     string const String(Buffer const *, size_type beg, size_type end,
| +             bool withlabels = true);

I like this even less.

default args should not be used as a flag to choose between two
variants of a method. Instead it should be split into two methods.

String...
StringWithLables...

| -     ///
| -     string const selectionAsString(Buffer const *) const;
| +     /// if withlabels is false, don't add labels
| +     string const selectionAsString(Buffer const *, bool withlabels
| = true) const;

same thing:

selectionAsString...
selectionAsStringWithLabels...

| -     if (beg == 0 && !params.labelString().empty())
| +     if (withlabels && beg == 0 && !params.labelString().empty())
|               ost << params.labelString() << ' ';

and this is why... not nice at all.
  
-- 
        Lgb

Reply via email to