diff --git a/src/selection.cpp b/src/selection.cpp
index acab9396c86bb29b758a951e8b06d9dfb888373f..b71f27815214e527d8059792c352bdf5d21b5e4c 100644 (file)
--- a/src/selection.cpp
+++ b/src/selection.cpp
return bbox;
}
-NR::Maybe<NR::Rect> Selection::bounds(SPItem::BBoxType type) const
+boost::optional<NR::Rect> Selection::bounds(SPItem::BBoxType type) const
{
GSList const *items = const_cast<Selection *>(this)->itemList();
- NR::Maybe<NR::Rect> bbox = NR::Nothing();
+ boost::optional<NR::Rect> bbox;
for ( GSList const *i = items ; i != NULL ; i = i->next ) {
bbox = NR::union_bounds(bbox, sp_item_bbox_desktop(SP_ITEM(i->data), type));
}
@@ -414,13 +414,13 @@ NRRect *Selection::boundsInDocument(NRRect *bbox, SPItem::BBoxType type) const {
return bbox;
}
-NR::Maybe<NR::Rect> Selection::boundsInDocument(SPItem::BBoxType type) const {
+boost::optional<NR::Rect> Selection::boundsInDocument(SPItem::BBoxType type) const {
NRRect r;
return boundsInDocument(&r, type)->upgrade();
}
/** Extract the position of the center from the first selected object */
-NR::Maybe<NR::Point> Selection::center() const {
+boost::optional<NR::Point> Selection::center() const {
GSList *items = (GSList *) const_cast<Selection *>(this)->itemList();
NR::Point center;
if (items) {
return first->getCenter();
}
}
- NR::Maybe<NR::Rect> bbox = bounds();
+ boost::optional<NR::Rect> bbox = bounds();
if (bbox) {
return bounds()->midpoint();
} else {
- return NR::Nothing();
+ return boost::optional<NR::Point>();
}
}
cvh.add(*i);
}
- NR::Maybe<NR::Rect> rHull = cvh.bounds();
+ boost::optional<NR::Rect> rHull = cvh.bounds();
if (rHull) {
for ( unsigned i = 0 ; i < 4 ; ++i ) {
pHull.push_back(rHull->corner(i));