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/libnr/nr-rect.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/libnr/nr-rect.cpp')
| -rw-r--r-- | src/libnr/nr-rect.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libnr/nr-rect.cpp b/src/libnr/nr-rect.cpp index 04d93ae04..77af27417 100644 --- a/src/libnr/nr-rect.cpp +++ b/src/libnr/nr-rect.cpp @@ -17,7 +17,7 @@ NRRect::NRRect(NR::Rect const &rect) x1(rect.max()[NR::X]), y1(rect.max()[NR::Y]) {} -NRRect::NRRect(NR::Maybe<NR::Rect> const &rect) { +NRRect::NRRect(boost::optional<NR::Rect> const &rect) { if (rect) { x0 = rect->min()[NR::X]; y0 = rect->min()[NR::Y]; @@ -28,9 +28,9 @@ NRRect::NRRect(NR::Maybe<NR::Rect> const &rect) { } } -NR::Maybe<NR::Rect> NRRect::upgrade() const { +boost::optional<NR::Rect> NRRect::upgrade() const { if (nr_rect_d_test_empty_ptr(this)) { - return NR::Nothing(); + return boost::optional<NR::Rect>(); } else { return NR::Rect(NR::Point(x0, y0), NR::Point(x1, y1)); } @@ -308,17 +308,17 @@ void Rect::growBy(double size) { } /** Returns the set of points shared by both rectangles. */ -Maybe<Rect> intersection(Maybe<Rect> const & a, Maybe<Rect> const & b) { +boost::optional<Rect> intersection(boost::optional<Rect> const & a, boost::optional<Rect> const & b) { if ( !a || !b ) { - return Nothing(); + return boost::optional<Rect>(); } else { Rect r; for ( int i=0 ; i < 2 ; i++ ) { r._min[i] = std::max(a->_min[i], b->_min[i]); r._max[i] = std::min(a->_max[i], b->_max[i]); if ( r._min[i] > r._max[i] ) { - return Nothing(); - } + return boost::optional<Rect>(); + } } return r; } |
