xlnt/source/named_range.cpp

41 lines
748 B
C++
Raw Normal View History

2014-05-21 22:20:30 +08:00
#include "named_range.h"
2014-05-22 05:48:51 +08:00
#include "range_reference.h"
2014-05-21 22:20:30 +08:00
#include "worksheet.h"
namespace xlnt {
void named_range::set_scope(worksheet scope)
{
2014-05-22 05:48:51 +08:00
parent_worksheet_ = scope;
2014-05-21 22:20:30 +08:00
}
bool named_range::operator==(const xlnt::named_range &comparand) const
{
2014-05-22 05:48:51 +08:00
return comparand.parent_worksheet_ == parent_worksheet_
&& comparand.target_range_ == target_range_;
2014-05-21 22:20:30 +08:00
}
2014-05-22 05:48:51 +08:00
named_range::named_range()
2014-05-21 22:20:30 +08:00
{
}
named_range::named_range(const std::string &name, worksheet ws, const range_reference &target)
2014-05-22 05:48:51 +08:00
: name_(name),
parent_worksheet_(ws),
target_range_(target)
2014-05-21 22:20:30 +08:00
{
}
range_reference named_range::get_target_range() const
{
2014-05-22 05:48:51 +08:00
return target_range_;
2014-05-21 22:20:30 +08:00
}
worksheet named_range::get_scope() const
{
2014-05-22 05:48:51 +08:00
return parent_worksheet_;
2014-05-21 22:20:30 +08:00
}
} // namespace xlnt