Hi all,
we have the field 'SwSortedObjs* pSortedObjs' in the class SwPageFrm.
And we have the strange management of it:
For example, sw/source/core/layout/flylay.cxx:734
if ( pSortedObjs )
{
pSortedObjs->Remove( *pToRemove );
if ( !pSortedObjs->Count() )
{ DELETEZ( pSortedObjs );
}
}
i.e. we delete pSortedObjs every time it is empty, and create it again
when we want to add something into it. This entails annoying checks,
like
if ( pPage->GetSortedObjs() )
// [loop over pSortedObjs]
What do you think about changing the code so that pSortedObjs will be
alive every time? We will be able to return a reference to pSortedObjs
in GetSortedObjs() instead of a pointer and remove the mentioned
checks (there are a lot of such checks). I could do this. :-)
Same problem with the field 'SwSortedObjs* pDrawObjs' in the class SwFrm.
All the best,
Ivan
Context
- [Libreoffice] Possible little code simplification · Ivan Timofeev
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.