xlnt/source/detail/workbook_impl.hpp

85 lines
2.5 KiB
C++
Raw Normal View History

2014-05-31 06:42:25 +08:00
#pragma once
2014-07-24 08:51:28 +08:00
#include <iterator>
2014-05-31 06:42:25 +08:00
#include <vector>
namespace xlnt {
2014-05-31 06:42:25 +08:00
namespace detail {
struct workbook_impl
{
workbook_impl();
2015-10-15 06:05:13 +08:00
workbook_impl(const workbook_impl &other)
: active_sheet_index_(other.active_sheet_index_),
worksheets_(other.worksheets_),
2015-10-30 07:37:07 +08:00
relationships_(other.relationships_),
root_relationships_(other.root_relationships_),
2015-10-15 06:05:13 +08:00
drawings_(other.drawings_),
properties_(other.properties_),
guess_types_(other.guess_types_),
2015-10-19 03:30:46 +08:00
data_only_(other.data_only_),
2015-10-21 01:53:47 +08:00
styles_(other.styles_),
2015-10-29 03:08:54 +08:00
colors_(other.colors_),
2015-10-21 01:53:47 +08:00
borders_(other.borders_),
fills_(other.fills_),
fonts_(other.fonts_),
2015-10-30 01:46:56 +08:00
number_formats_(other.number_formats_),
manifest_(other.manifest_)
2015-10-15 06:05:13 +08:00
{
}
2014-07-24 08:51:28 +08:00
workbook_impl &operator=(const workbook_impl &other)
{
active_sheet_index_ = other.active_sheet_index_;
worksheets_.clear();
std::copy(other.worksheets_.begin(), other.worksheets_.end(), back_inserter(worksheets_));
relationships_.clear();
std::copy(other.relationships_.begin(), other.relationships_.end(), std::back_inserter(relationships_));
2015-10-30 07:37:07 +08:00
root_relationships_.clear();
std::copy(other.root_relationships_.begin(), other.root_relationships_.end(), std::back_inserter(root_relationships_));
2014-07-24 08:51:28 +08:00
drawings_.clear();
std::copy(other.drawings_.begin(), other.drawings_.end(), back_inserter(drawings_));
properties_ = other.properties_;
2014-07-25 05:31:46 +08:00
guess_types_ = other.guess_types_;
data_only_ = other.data_only_;
2015-10-21 01:53:47 +08:00
styles_ = other.styles_;
2015-10-19 03:30:46 +08:00
borders_ = other.borders_;
fills_ = other.fills_;
fonts_ = other.fonts_;
number_formats_ = other.number_formats_;
2015-10-29 03:08:54 +08:00
colors_ = other.colors_;
2015-10-30 01:46:56 +08:00
manifest_ = other.manifest_;
2014-07-24 08:51:28 +08:00
2015-10-15 06:05:13 +08:00
return *this;
2014-07-24 08:51:28 +08:00
}
2014-07-25 05:31:46 +08:00
2015-10-15 06:05:13 +08:00
std::size_t active_sheet_index_;
std::vector<worksheet_impl> worksheets_;
std::vector<relationship> relationships_;
2015-10-30 07:37:07 +08:00
std::vector<relationship> root_relationships_;
std::vector<drawing> drawings_;
2015-10-21 01:53:47 +08:00
2014-07-20 04:59:05 +08:00
document_properties properties_;
2015-10-21 01:53:47 +08:00
2014-07-25 05:31:46 +08:00
bool guess_types_;
bool data_only_;
2015-10-19 03:30:46 +08:00
2015-10-21 01:53:47 +08:00
std::vector<style> styles_;
2015-10-24 02:42:36 +08:00
std::size_t next_custom_format_id_;
2015-10-29 03:08:54 +08:00
std::vector<color> colors_;
2015-10-21 01:53:47 +08:00
std::vector<border> borders_;
std::vector<fill> fills_;
std::vector<font> fonts_;
std::vector<number_format> number_formats_;
2015-10-30 01:46:56 +08:00
manifest manifest_;
2015-10-30 07:37:07 +08:00
theme theme_;
};
2014-05-31 06:42:25 +08:00
} // namespace detail
} // namespace xlnt