On 16.06.2010 11:07, Malte Timmermann wrote:

We have
   const SfxPoolItem&  Get(....)
and
   const SfxPoolItem* GetItem(...)

Not sure why we have two different Get Methods, but the first doesn't
allow to return NULL, so I assume the second one would also have to
return the same VoidItem for consistency.

I assume that Get() can't be used right away because the internally stored item pointer may have the value NULL or even -1(!). So I think that you can't call GetItem() before checking if the ItemSet has an item and it would be just wrong if it would be called for an invalid item.

Putting them on a different ID than it's own ID doesn't sound right to me.
For the different which ID stuff we have the SlotID mechanism.
But that would probably need cloning the item and changing the which
when putting it into a pool/itemset where different which ids are use.
So the situations where we put items on different IDs should be
investigated more closely.

But again, looking at
  pItem = new SfxVoidItem( m_nSlotID );
  rReq.SetReturnValue( SfxVoidItem( rReq.GetSlot() ) );
it seems to be a supported and wanted scenario.

The fact that it is used that not mean that it is correct or even necessary. ;-) The question is what is the intent of writing this code and if that really requires such a fuzzy interface.

Regards,
Mathias

--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "nospamfor...@gmx.de".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to