Lars Gullik Bjønnes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| Comments?
I thought avalialbe a quite nice logical name to use, so I am not sure
that the code gets any cleaner by doing this.
I prefer to know exactly what available() mean and buffer gives me
exactly that. I can replace the "if (buffer())" with "if (buffer()!= 0)"
if you don't like the implicit cast. This will still be better than
available() IMO.
But I won't stay in the way.
Thanks... committed. comments below.
BufferView::available relies on implicit cast to bool. This ok for such an easy
function.
But that does not mean that we should rely on the same implict cast in
all places where available() is just replaced with buffer_.
Just a few simple case here. So no controversy.
| Index: src/frontends/controllers/Kernel.C
| ===================================================================
| --- src/frontends/controllers/Kernel.C (revision 15012)
| +++ src/frontends/controllers/Kernel.C (working copy)
| @@ -51,7 +51,7 @@
| {
| if (!lyxview_.view())
| return false;
| - return lyxview_.view()->available();
| + return lyxview_.view()->buffer();
This one in particular I guess.
Could be replaced by
+ return lyxview_.view()->buffer() != 0;
if you want. I don't really care about either style.
Abdel.