On Sat, 2004-04-24 at 12:01, Carl Hetherington wrote:
Hi,
While doing some SPSelection OO-ification I have noticed that there seems to be some confusion in the code about whether desktop->selection is ever NULL in normal operation. Anyone got any clues?
I'm not sure. I don't think there was ever a defined policy for that -- everyone just programmed defensively with g_return_val_if_fail() and the like. Just in case.
The same confusion arises in other places where a SPSelection* is held. Personally, I'd favour the convention that all SPSelection* in structs are assumed to be non-NULL.
Generally speaking I would too -- this is another of my motivations for the C++ification, actually. It forces all these policy issues (formerly hidden by defensive programming) to the surface where we can deal with them.
-mental