Hello,
I am trying to wipe some unneeded calls and I see the following:

while( xxxx )
{
        -----
        SwFrm* pFrm;
        if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
            aName.Equals( pONd->GetChartTblName() ) &&
            0 != ( pFrm = pONd->getLayoutFrm( rVSh.GetLayout() ) ) )
        {....
        }
        ...
}

knowing that pFrm is never used execpt in the comparision, I wanted to simplify to :
   0 != ( pONd->getLayoutFrm( rVSh.GetLayout() )
since the return value of the operator= should be the same as the right operand.

But this basically, this just ensure that the return value is not NULL (comparing the pointer SwFrm* with 0 )

So I though the final version to be:
if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
            aName.Equals( pONd->GetChartTblName() ) &&
            pONd->getLayoutFrm( rVSh.GetLayout()         )
        {....
        }

Did I missed something with my logic ?

The code is from line 145 of sw/source/core/doc/docchart.cxx

Thanks a lot for your feed-back

best regards
Pierre-André
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to