Commit 9df5e91f authored by Kohei Yoshida's avatar Kohei Yoshida

Move the circular safe flag to the calc status object.

This fixes the #REF! problem.
parent b03111d9
Pipeline #32465441 passed with stage
in 8 minutes and 33 seconds
......@@ -9,9 +9,9 @@
namespace ixion {
calc_status::calc_status() : result(nullptr), refcount(0) {}
calc_status::calc_status() : result(nullptr), circular_safe(false), refcount(0) {}
calc_status::calc_status(const rc_size_t& _group_size) :
result(nullptr), group_size(_group_size), refcount(0) {}
result(nullptr), group_size(_group_size), circular_safe(false), refcount(0) {}
void calc_status::add_ref()
{
......
......@@ -27,6 +27,7 @@ struct calc_status
std::unique_ptr<formula_result> result;
const rc_size_t group_size;
bool circular_safe;
size_t refcount;
......
......@@ -46,8 +46,6 @@ struct formula_cell::impl
formula_tokens_store_ptr_t m_tokens;
rc_address_t m_group_pos;
bool m_circular_safe:1;
impl() : impl(-1, -1, new calc_status, formula_tokens_store_ptr_t()) {}
impl(const formula_tokens_store_ptr_t& tokens) : impl(-1, -1, new calc_status, tokens) {}
......@@ -56,8 +54,7 @@ struct formula_cell::impl
const formula_tokens_store_ptr_t& tokens) :
m_calc_status(cs),
m_tokens(tokens),
m_group_pos(row, col, false, false),
m_circular_safe(false) {}
m_group_pos(row, col, false, false) {}
/**
* Block until the result becomes available.
......@@ -80,7 +77,7 @@ struct formula_cell::impl
void reset_flag()
{
m_circular_safe = false;
m_calc_status->circular_safe = false;
}
/**
......@@ -91,7 +88,7 @@ struct formula_cell::impl
*/
bool is_circular_safe() const
{
return m_circular_safe;
return m_calc_status->circular_safe;
}
bool check_ref_for_circular_safety(const formula_cell& ref, const abs_address_t& pos)
......@@ -355,7 +352,7 @@ void formula_cell::check_circular(const iface::formula_model_access& cxt, const
}
// No circular dependencies. Good.
mp_impl->m_circular_safe = true;
mp_impl->m_calc_status->circular_safe = true;
}
void formula_cell::reset()
......
......@@ -38,5 +38,6 @@ E6=24
C7=24
D7=30
E7=36
E11=360
%check
%exit
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