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é
Context
- [Libreoffice] code simplification: please logic review, to be sure · Pierre-André Jacquod
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.