Commit 31e2af7c authored by Kohei Yoshida's avatar Kohei Yoshida

rc_abs_range_t to construct from abs_range_t.

It loses the sheet indices, of course, but the rest should be copied
over.
parent e3192ab3
Pipeline #38428160 passed with stage
in 4 minutes and 41 seconds
......@@ -115,6 +115,7 @@ struct IXION_DLLPUBLIC abs_rc_address_t
abs_rc_address_t(init_invalid);
abs_rc_address_t(row_t _row, col_t _column);
abs_rc_address_t(const abs_rc_address_t& r);
abs_rc_address_t(const abs_address_t& r);
bool valid() const;
......@@ -223,6 +224,8 @@ struct IXION_DLLPUBLIC abs_rc_range_t
abs_rc_range_t();
abs_rc_range_t(init_invalid);
abs_rc_range_t(const abs_rc_range_t& other);
abs_rc_range_t(const abs_range_t& other);
struct hash
{
......
......@@ -226,6 +226,9 @@ abs_rc_address_t::abs_rc_address_t(row_t _row, col_t _column) :
abs_rc_address_t::abs_rc_address_t(const abs_rc_address_t& r) :
row(r.row), column(r.column) {}
abs_rc_address_t::abs_rc_address_t(const abs_address_t& r) :
row(r.row), column(r.column) {}
bool abs_rc_address_t::valid() const
{
return row >= 0 && column >= 0 && row <= row_unset && column <= column_unset;
......@@ -359,6 +362,12 @@ abs_rc_range_t::abs_rc_range_t() {}
abs_rc_range_t::abs_rc_range_t(init_invalid) :
first(abs_rc_address_t::invalid), last(abs_rc_address_t::invalid) {}
abs_rc_range_t::abs_rc_range_t(const abs_rc_range_t& other) :
first(other.first), last(other.last) {}
abs_rc_range_t::abs_rc_range_t(const abs_range_t& other) :
first(other.first), last(other.last) {}
size_t abs_rc_range_t::hash::operator() (const abs_rc_range_t& range) const
{
abs_rc_address_t::hash adr_hash;
......
......@@ -694,6 +694,25 @@ void test_address()
// These are invalid addresses.
assert(!abs_address_t(abs_address_t::invalid).valid());
assert(!abs_range_t(abs_range_t::invalid).valid());
{
abs_range_t range(1, 1, 2, 3, 3);
assert(range.first.sheet == 1);
assert(range.first.row == 1);
assert(range.first.column == 2);
assert(range.last.sheet == 1);
assert(range.last.row == 3);
assert(range.last.column == 4);
abs_range_t range2(range);
assert(range2 == range);
abs_rc_range_t rc_range(range);
assert(rc_range.first.row == 1);
assert(rc_range.first.column == 2);
assert(rc_range.last.row == 3);
assert(rc_range.last.column == 4);
}
}
bool check_formula_expression(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment