2014-06-06 04:19:31 +08:00
|
|
|
#include "writer/style_writer.hpp"
|
2014-06-13 05:04:37 +08:00
|
|
|
#include "workbook/workbook.hpp"
|
|
|
|
#include "worksheet/worksheet.hpp"
|
|
|
|
#include "worksheet/range.hpp"
|
|
|
|
#include "cell/cell.hpp"
|
2014-06-05 06:42:17 +08:00
|
|
|
|
|
|
|
namespace xlnt {
|
|
|
|
|
|
|
|
style_writer::style_writer(xlnt::workbook &wb) : wb_(wb)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
std::unordered_map<std::size_t, std::string> style_writer::get_style_by_hash() const
|
|
|
|
{
|
2014-06-13 05:04:37 +08:00
|
|
|
std::unordered_map<std::size_t, std::string> styles;
|
|
|
|
for(auto ws : wb_)
|
|
|
|
{
|
|
|
|
for(auto row : ws.rows())
|
|
|
|
{
|
|
|
|
for(auto cell : row)
|
|
|
|
{
|
|
|
|
if(cell.has_style())
|
|
|
|
{
|
|
|
|
styles[1] = "style";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return styles;
|
2014-06-05 06:42:17 +08:00
|
|
|
}
|
|
|
|
|
2014-07-27 04:19:15 +08:00
|
|
|
std::vector<style> style_writer::get_styles() const
|
|
|
|
{
|
|
|
|
std::vector<style> styles;
|
|
|
|
|
|
|
|
for(auto ws : wb_)
|
|
|
|
{
|
|
|
|
for(auto row : ws.rows())
|
|
|
|
{
|
|
|
|
for(auto cell : row)
|
|
|
|
{
|
|
|
|
if(cell.has_style())
|
|
|
|
{
|
|
|
|
styles.push_back(cell.get_style());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return styles;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string style_writer::write_table() const
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2014-06-05 06:42:17 +08:00
|
|
|
} // namespace xlnt
|