From 900577c7e71534ec32dcb4e0677a509a6e517b12 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 5 Aug 2008 22:40:31 +0000 Subject: NR::Maybe => boost::optional (bzr r6569) --- src/selection.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/selection.cpp') diff --git a/src/selection.cpp b/src/selection.cpp index acab9396c..b71f27815 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -382,11 +382,11 @@ NRRect *Selection::bounds(NRRect *bbox, SPItem::BBoxType type) const return bbox; } -NR::Maybe Selection::bounds(SPItem::BBoxType type) const +boost::optional Selection::bounds(SPItem::BBoxType type) const { GSList const *items = const_cast(this)->itemList(); - NR::Maybe bbox = NR::Nothing(); + boost::optional 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 Selection::boundsInDocument(SPItem::BBoxType type) const { +boost::optional 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 Selection::center() const { +boost::optional Selection::center() const { GSList *items = (GSList *) const_cast(this)->itemList(); NR::Point center; if (items) { @@ -429,11 +429,11 @@ NR::Maybe Selection::center() const { return first->getCenter(); } } - NR::Maybe bbox = bounds(); + boost::optional bbox = bounds(); if (bbox) { return bounds()->midpoint(); } else { - return NR::Nothing(); + return boost::optional(); } } @@ -473,7 +473,7 @@ std::vector Selection::getSnapPointsConvexHull() const { cvh.add(*i); } - NR::Maybe rHull = cvh.bounds(); + boost::optional rHull = cvh.bounds(); if (rHull) { for ( unsigned i = 0 ; i < 4 ; ++i ) { pHull.push_back(rHull->corner(i)); -- cgit v1.2.3