Hi all,
I just updated 2geom in our trunk. It contains the 'new' Rect and OptRect (and Interval and OptInterval). Geom::Rect can no longer be empty. It *always* contains a rectangle. Geom::OptRect contains a rect or nothing (which means an empty rect). The same holds for Geom::Interval and Geom::OptInterval.
For example, boundingbox functions return an OptRect. You have to check whether it is empty or not, before you use the values in the Rect. If you didn't and turns out the bbox is empty, Inkscape will crash :-) Note that Rect's no longer have the method 'isEmpty'. Rect's do have the 'hasZeroArea' method. If this is true, the Rect contains a single point, like a (0,0)-(0,0) rectangle. It's not empty, it contains one point (0,0).
(OptRect and OptInterval have the same usage as boost::optional<Rect>)
I made Inkscape compile with this update, and tried to fix cases where there was not an explicit empty check. I may have introduced/uncovered bugs, sorry for that. Let us know about what you've found.
Cheers, Johan