summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a325f9a)
raw | patch | inline | side by side (parent: a325f9a)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 19 Mar 2007 03:00:31 +0000 (03:00 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 19 Mar 2007 03:00:31 +0000 (03:00 +0000) |
src/libnr/nr-rect-l.cpp | patch | blob | history | |
src/libnr/nr-rect-l.h | patch | blob | history |
index 40db67a1edfdb2f30ae2b2581c8f56777ecf3705..3b00acd0392123ea8056622c2c8c7bbf409e5721 100644 (file)
--- a/src/libnr/nr-rect-l.cpp
+++ b/src/libnr/nr-rect-l.cpp
#include <libnr/nr-rect-l.h>
+NR::Maybe<NR::Rect> NRRectL::upgrade() const {
+ if (nr_rect_l_test_empty(this)) {
+ return NR::Nothing();
+ } else {
+ return NR::Rect(NR::Point(x0, y0), NR::Point(x1, y1));
+ }
+}
+
namespace NR {
IRect::IRect(Rect const &r) :
diff --git a/src/libnr/nr-rect-l.h b/src/libnr/nr-rect-l.h
index 756a537b0bb8071a81816a0f05ccbf4146006fc1..b84a8f0cbb9c41dfbab080aa2f2694cb8cf6cde6 100644 (file)
--- a/src/libnr/nr-rect-l.h
+++ b/src/libnr/nr-rect-l.h
#define SEEN_NR_RECT_L_H
#include <libnr/nr-i-coord.h>
+#include <libnr/nr-maybe.h>
+#include <libnr/nr-rect.h>
+#include <libnr/nr-point-l.h>
struct NRRectL {
+ NR::Maybe<NR::Rect> upgrade() const;
NR::ICoord x0, y0, x1, y1;
};
-#include <libnr/nr-rect.h>
-#include <libnr/nr-point-l.h>
namespace NR {