From 5f8d99126c6273d77e169cb55ec199410b3b3808 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 19 Mar 2007 03:00:31 +0000 Subject: [PATCH] add ::upgrade for NRRectL --- src/libnr/nr-rect-l.cpp | 8 ++++++++ src/libnr/nr-rect-l.h | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libnr/nr-rect-l.cpp b/src/libnr/nr-rect-l.cpp index 40db67a1e..3b00acd03 100644 --- a/src/libnr/nr-rect-l.cpp +++ b/src/libnr/nr-rect-l.cpp @@ -1,5 +1,13 @@ #include +NR::Maybe 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 756a537b0..b84a8f0cb 100644 --- a/src/libnr/nr-rect-l.h +++ b/src/libnr/nr-rect-l.h @@ -2,13 +2,15 @@ #define SEEN_NR_RECT_L_H #include +#include +#include +#include struct NRRectL { + NR::Maybe upgrade() const; NR::ICoord x0, y0, x1, y1; }; -#include -#include namespace NR { -- 2.30.2