[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Concerning automated astyle application to the code
From:       Dmitry Kazakov <dimula73 () gmail ! com>
Date:       2010-01-17 19:53:44
Message-ID: ae32c1ef1001171153m3cb484b2wb95e45529d7ba3c9 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi, All!

I know it is good to keep the code in a good consistent style. But here is a
piece of code, changed by automated astyle commit:


KisPaintDeviceSP KisGroupLayer::tryObligeChild() const
{
    KisPaintDeviceSP retval;

    if (parent().isNull() && childCount() == 1) {
        const KisLayer *child =
dynamic_cast<KisLayer*>(firstChild().data());

        if (child &&
                child->channelFlags().isEmpty() &&
                child->projection() &&
                child->visible() &&
                child->opacity() == OPACITY_OPAQUE &&
                *child->projection()->colorSpace() == *colorSpace()) {

            retval = child->projection();
        }
    }

    return retval;
}

In original it looked quite pretty:

KisPaintDeviceSP KisGroupLayer::tryObligeChild() const
{
    KisPaintDeviceSP retval;

    if (parent().isNull() && childCount() == 1) {
        const KisLayer *child =
dynamic_cast<KisLayer*>(firstChild().data());

        if (child &&
            child->channelFlags().isEmpty() &&
            child->projection() &&
            child->visible() &&
            child->opacity() == OPACITY_OPAQUE &&
            *child->projection()->colorSpace() == *colorSpace()) {

            retval = child->projection();
        }
    }

    return retval;
}

So should we report to astyle developers or change some options?

-- 
Dmitry Kazakov

[Attachment #5 (text/html)]

Hi, All!<div><br></div><div>I know it is good to keep the code in a good consistent \
style. But here is a piece of code, changed by automated astyle \
commit:</div><div><br></div><div><br></div><div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">KisPaintDeviceSP \
KisGroupLayer::tryObligeChild() const</font></div> <div><font \
class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">{</font></div><div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">       KisPaintDeviceSP retval;</font></div><div><font \
class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br> \
</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">       if (parent().isNull() &amp;&amp; childCount() == 1) \
{</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">             const KisLayer *child = \
dynamic_cast&lt;KisLayer*&gt;(firstChild().data());</font></div> <div><font \
class="Apple-style-span" face="&#39;courier new&#39;, \
monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">             if (child &amp;&amp;</font></div><div><font \
class="Apple-style-span" face="&#39;courier new&#39;, monospace">                     \
child-&gt;channelFlags().isEmpty() &amp;&amp;</font></div> <div><font \
class="Apple-style-span" face="&#39;courier new&#39;, monospace">                     \
child-&gt;projection() &amp;&amp;</font></div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">                         child-&gt;visible() \
&amp;&amp;</font></div> <div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">                         child-&gt;opacity() == OPACITY_OPAQUE \
&amp;&amp;</font></div><div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">                         \
*child-&gt;projection()-&gt;colorSpace() == *colorSpace()) {</font></div> <div><font \
class="Apple-style-span" face="&#39;courier new&#39;, \
monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">                   retval = child-&gt;projection();</font></div> \
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">          \
}</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">       }</font></div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace"><br> </font></div><div><font \
class="Apple-style-span" face="&#39;courier new&#39;, monospace">       return \
retval;</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">}</font></div><div><br></div> <div><font class="Apple-style-span" \
face="arial, helvetica, sans-serif">In original it looked quite \
pretty:</font></div><div><br></div></div><div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">KisPaintDeviceSP \
KisGroupLayer::tryObligeChild() const</font></div> <div><font \
class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">{</font></div><div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">       KisPaintDeviceSP retval;</font></div><div><font \
class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br> \
</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">       if (parent().isNull() &amp;&amp; childCount() == 1) \
{</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">             const KisLayer *child = \
dynamic_cast&lt;KisLayer*&gt;(firstChild().data());</font></div> <div><font \
class="Apple-style-span" face="&#39;courier new&#39;, \
monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">             if (child &amp;&amp;</font></div><div><font \
class="Apple-style-span" face="&#39;courier new&#39;, monospace">                   \
child-&gt;channelFlags().isEmpty() &amp;&amp;</font></div> <div><font \
class="Apple-style-span" face="&#39;courier new&#39;, monospace">                   \
child-&gt;projection() &amp;&amp;</font></div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">                   child-&gt;visible() \
&amp;&amp;</font></div> <div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">                   child-&gt;opacity() == OPACITY_OPAQUE \
&amp;&amp;</font></div><div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">                   *child-&gt;projection()-&gt;colorSpace() == \
*colorSpace()) {</font></div> <div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace"><br></font></div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">                   retval = \
child-&gt;projection();</font></div> <div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">             }</font></div><div><font \
class="Apple-style-span" face="&#39;courier new&#39;, monospace">       \
}</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, \
monospace"><br> </font></div><div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">       return retval;</font></div><div><font \
class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">}</font></div><div><br></div> <div><font class="Apple-style-span" \
face="arial, helvetica, sans-serif">So should we report to astyle developers or \
change some options?</font></div><br>-- <br>Dmitry Kazakov<br> </div>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic