diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-08-05 22:40:31 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-08-05 22:40:31 +0000 |
| commit | 900577c7e71534ec32dcb4e0677a509a6e517b12 (patch) | |
| tree | 8d5b4c6201b0728bff338e89106d1a8c5a0b7fef /src/selection.cpp | |
| parent | codedread's patch for bug 254850 (fixes handling of description field in Obje... (diff) | |
| download | inkscape-900577c7e71534ec32dcb4e0677a509a6e517b12.tar.gz inkscape-900577c7e71534ec32dcb4e0677a509a6e517b12.zip | |
NR::Maybe => boost::optional
(bzr r6569)
Diffstat (limited to 'src/selection.cpp')
| -rw-r--r-- | src/selection.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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<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) { @@ -429,11 +429,11 @@ NR::Maybe<NR::Point> Selection::center() const { 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>(); } } @@ -473,7 +473,7 @@ std::vector<NR::Point> Selection::getSnapPointsConvexHull() const { 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)); |
