On Monday 06 of February 2012, Kohei Yoshida wrote:
Hi there,
I've just added a new method to SfxItemSet to provide an easy way to
check whether or not an item is already set, and if it's already set,
get that item. Here is what I've added:
bool SfxItemSet::HasItem(sal_uInt16 nWhich, const SfxPoolItem*& rpItem)
const {
return SFX_ITEM_SET == GetItemState(nWhich, true, &rpItem);
}
I would suggest to make the second argument 'const SfxPoolItem **ppItem = 0',
not only to keep it consistent with GetItemState(), but also to make it more
visible that it is an out argument. The intuitive reading of "if(
set.HasItem( which, item ))" to me is "does 'set' have an item of
type 'which' that is 'item'?".
--
Lubos Lunak
l.lunak@suse.cz
Context
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.