Am Mon, 14 Jun 2010 15:11:57 +0200 schrieb Malte Timmermann <[email protected]>:
> Hi Bjoern, > > Björn Michaelsen wrote, On 06/14/10 13:34: > > Hi all, > > > > while testing the new SfxItemSets in cws new_itemsets I came across > > a few interesting uses of itemsets which I had considered to be > > illegal (but I might be wrong there). I assumed: > > - non-void items should only be put at the same which id in a set > > as the which id on the item itself. > > - void items should always have a which id of 0 and are allowed to > > be put anywhere. > > Who says they would need to have which ID 0 ? Well, as I said I can be wrong here. But a SfxVoidItem with which id set to 0 is interpreted as "disabled". However, some functions only test for the type being SfxVoidItem, while others test only for the which id being 0. Thus having a "half-disabled" item might lead to "interesting" results. See for example: http://svn.services.openoffice.org/opengrok/xref/DEV300_m82/svl/source/items/itemset.cxx#542 (SfxItemSet::GetItemState) http://svn.services.openoffice.org/opengrok/xref/DEV300_m82/svl/source/items/itemset.cxx#589 (SfxItemSet::Put) http://svn.services.openoffice.org/opengrok/xref/DEV300_m82/svl/source/items/itemset.cxx#2040 (SfxItemSet::DisableItem) So, when you used SfxVoidItems, did you intend them to be interpreted as "disabled"? Best Regards, Bjoern --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
