2014-05-30 08:52:14 +08:00
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <vector>
|
|
|
|
|
2014-06-06 04:19:31 +08:00
|
|
|
#include "cell_impl.hpp"
|
2014-05-30 08:52:14 +08:00
|
|
|
|
2014-05-31 06:42:25 +08:00
|
|
|
namespace xlnt {
|
|
|
|
|
2014-05-30 08:52:14 +08:00
|
|
|
class workbook;
|
|
|
|
|
2014-05-31 06:42:25 +08:00
|
|
|
namespace detail {
|
|
|
|
|
2014-05-30 08:52:14 +08:00
|
|
|
struct worksheet_impl
|
|
|
|
{
|
|
|
|
worksheet_impl(workbook *parent_workbook, const std::string &title)
|
|
|
|
: parent_(parent_workbook), title_(title), freeze_panes_("A1")
|
|
|
|
{
|
2014-06-10 12:29:49 +08:00
|
|
|
page_margins_.set_left(0.75);
|
|
|
|
page_margins_.set_right(0.75);
|
|
|
|
page_margins_.set_top(1);
|
|
|
|
page_margins_.set_bottom(1);
|
|
|
|
page_margins_.set_header(0.5);
|
|
|
|
page_margins_.set_footer(0.5);
|
2014-05-30 08:52:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
worksheet_impl(const worksheet_impl &other)
|
|
|
|
{
|
|
|
|
*this = other;
|
|
|
|
}
|
|
|
|
|
|
|
|
void operator=(const worksheet_impl &other)
|
|
|
|
{
|
|
|
|
parent_ = other.parent_;
|
|
|
|
title_ = other.title_;
|
|
|
|
freeze_panes_ = other.freeze_panes_;
|
|
|
|
cell_map_ = other.cell_map_;
|
2014-06-14 03:05:24 +08:00
|
|
|
for(auto &row : cell_map_)
|
|
|
|
{
|
|
|
|
for(auto &cell : row.second)
|
|
|
|
{
|
|
|
|
cell.second.parent_ = this;
|
|
|
|
}
|
|
|
|
}
|
2014-05-30 08:52:14 +08:00
|
|
|
relationships_ = other.relationships_;
|
|
|
|
page_setup_ = other.page_setup_;
|
|
|
|
auto_filter_ = other.auto_filter_;
|
|
|
|
page_margins_ = other.page_margins_;
|
|
|
|
merged_cells_ = other.merged_cells_;
|
|
|
|
named_ranges_ = other.named_ranges_;
|
|
|
|
}
|
|
|
|
|
|
|
|
workbook *parent_;
|
2014-06-05 06:42:17 +08:00
|
|
|
std::unordered_map<row_t, row_properties> row_properties_;
|
2014-05-30 08:52:14 +08:00
|
|
|
std::string title_;
|
|
|
|
cell_reference freeze_panes_;
|
|
|
|
std::unordered_map<int, std::unordered_map<int, cell_impl>> cell_map_;
|
|
|
|
std::vector<relationship> relationships_;
|
|
|
|
page_setup page_setup_;
|
|
|
|
range_reference auto_filter_;
|
|
|
|
margins page_margins_;
|
|
|
|
std::vector<range_reference> merged_cells_;
|
|
|
|
std::unordered_map<std::string, range_reference> named_ranges_;
|
2014-07-20 02:43:48 +08:00
|
|
|
std::vector<comment> comments_;
|
2014-05-30 08:52:14 +08:00
|
|
|
};
|
|
|
|
|
2014-05-31 06:42:25 +08:00
|
|
|
} // namespace detail
|
|
|
|
} // namespace xlnt
|