Commit 0c0f2cf9 authored by ElenaSubbotina's avatar ElenaSubbotina Committed by Alexander Trofimov

OdfFormat - высота строк в табличках

parent 77d6ebdd
#include "xlsx_table_state.h" #include <cpdoccore/odf/odf_document.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "logging.h" #include "logging.h"
#include "xlsx_table_state.h"
#include "xlsxconversioncontext.h" #include "xlsxconversioncontext.h"
#include <cpdoccore/xml/simple_xml_writer.h> #include "../odf/odfcontext.h"
#include "../odf/style_table_properties.h"
#include "../odf/datatypes/stylefamily.h"
namespace cpdoccore { namespace cpdoccore {
namespace oox { namespace oox {
xlsx_table_state::xlsx_table_state(xlsx_conversion_context & Context, const std::wstring & StyleName, const std::wstring & tableName) xlsx_table_state::xlsx_table_state(xlsx_conversion_context * Context, std::wstring styleName, std::wstring tableName)
: context_(Context), : context_ (Context),
table_style_(StyleName), table_style_ (styleName),
tableName_(tableName), tableName_ (tableName),
current_table_column_(-1), current_table_column_ (-1),
current_table_row_(-1), current_table_row_ (-1),
columns_spanned_num_(0), columns_spanned_num_ (0),
columns_count_(0), columns_count_ (0),
xlsx_drawing_context_(Context.get_drawing_context_handle()), xlsx_drawing_context_ (Context->get_drawing_context_handle()),
xlsx_comments_context_(Context.get_comments_context_handle()), xlsx_comments_context_ (Context->get_comments_context_handle()),
table_column_last_width_(0.0) table_column_last_width_(0.0)
{ {
memset(&group_row_,0,sizeof(_group_row)); memset(&group_row_,0,sizeof(_group_row));
...@@ -225,6 +231,7 @@ double charsToSize(unsigned int charsCount, double maxDigitSize) ...@@ -225,6 +231,7 @@ double charsToSize(unsigned int charsCount, double maxDigitSize)
void xlsx_table_state::serialize_table_format(std::wostream & _Wostream) void xlsx_table_state::serialize_table_format(std::wostream & _Wostream)
{ {
odf_reader::odf_read_context & odfContext = context_->root()->odf_context();
CP_XML_WRITER(_Wostream) CP_XML_WRITER(_Wostream)
{ {
CP_XML_NODE(L"sheetView") CP_XML_NODE(L"sheetView")
...@@ -234,32 +241,26 @@ void xlsx_table_state::serialize_table_format(std::wostream & _Wostream) ...@@ -234,32 +241,26 @@ void xlsx_table_state::serialize_table_format(std::wostream & _Wostream)
// -rightToLeft // -rightToLeft
// -zoomScale // -zoomScale
} }
double default_height = (2 * context_->getMaxDigitSize().second * 72. / 96. * 100.) /100.;//in point size.
odf_reader::style_instance * rowDefStyle = odfContext.styleContainer().style_default_by_type(odf_types::style_family::TableRow);
if ((rowDefStyle) && (rowDefStyle->content()))
{
const odf_reader::style_table_row_properties * prop = rowDefStyle->content()->get_style_table_row_properties();
if ( (prop) && (prop->style_table_row_properties_attlist_.style_row_height_))
{
default_height = prop->style_table_row_properties_attlist_.style_row_height_->get_value_unit(odf_types::length::pt);
}
std::wstringstream ht_s;
ht_s.precision(3);
ht_s << std::fixed << default_height;
CP_XML_NODE(L"sheetFormatPr") CP_XML_NODE(L"sheetFormatPr")
{ {
double default_height = (context_.getMaxDigitSize().second * 72. / 96. * 100.) /100.;//in point size. CP_XML_ATTR(L"defaultRowHeight", ht_s.str());
}
//odf::style_instance * rowStyle = odfContext.styleContainer().style_by_name(styleName, odf_types::style_family::TableRow,false/*false*/);
//if (!rowStyle)
// break;
//if (!rowStyle->content())
// break;
//const odf_reader::style_table_row_properties * prop = rowStyle->content()->get_style_table_row_properties();
//if (!prop)
// break;
//if (const _CP_OPT(odf_types::length) & height = prop->style_table_row_properties_attlist_.style_row_height_)
//{
// row_height = height->get_value_unit(odf_types::length::pt);
// std::wstringstream ht_s;
// ht_s.precision(3);
// ht_s << std::fixed << row_height;
// ht = ht_s.str();
//}
//CP_XML_ATTR(L"defaultColWidth", merges_.size());
CP_XML_ATTR(L"defaultRowHeight",default_height);
} }
} }
......
...@@ -13,11 +13,14 @@ namespace cpdoccore { ...@@ -13,11 +13,14 @@ namespace cpdoccore {
namespace oox { namespace oox {
class xlsx_conversion_context; class xlsx_conversion_context;
class xlsx_table_state;
typedef _CP_PTR(xlsx_table_state) xlsx_table_state_ptr;
class xlsx_table_state class xlsx_table_state
{ {
public: public:
xlsx_table_state(xlsx_conversion_context & Context, const std::wstring & StyleName, const std::wstring & tableName); xlsx_table_state(xlsx_conversion_context * Context, std::wstring styleName, std::wstring tableName);
std::wstring current_style() const { return table_style_; } std::wstring current_style() const { return table_style_; }
void start_column(unsigned int repeated, const std::wstring & defaultCellStyleName); void start_column(unsigned int repeated, const std::wstring & defaultCellStyleName);
void start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName); void start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
...@@ -55,10 +58,10 @@ public: ...@@ -55,10 +58,10 @@ public:
void start_hyperlink(); void start_hyperlink();
std::wstring end_hyperlink(std::wstring const & ref, std::wstring const & href, std::wstring const & display); std::wstring end_hyperlink(std::wstring const & ref, std::wstring const & href, std::wstring const & display);
void serialize_table_format(std::wostream & _Wostream); void serialize_table_format (std::wostream & _Wostream);
void serialize_merge_cells(std::wostream & _Wostream); void serialize_merge_cells (std::wostream & _Wostream);
void serialize_hyperlinks(std::wostream & _Wostream); void serialize_hyperlinks (std::wostream & _Wostream);
void dump_rels_hyperlinks(rels & Rels); void dump_rels_hyperlinks (rels & Rels);
std::wstring get_current_table_name() const { return tableName_; } std::wstring get_current_table_name() const { return tableName_; }
...@@ -70,28 +73,31 @@ public: ...@@ -70,28 +73,31 @@ public:
bool collapsed; bool collapsed;
}group_row_; }group_row_;
private: private:
xlsx_conversion_context & context_; xlsx_conversion_context * context_;
std::wstring table_style_;
std::wstring tableName_; std::wstring tableName_;
std::wstring table_style_;
std::wstring table_row_style_; std::wstring table_row_style_;
std::wstring cell_style_;
std::vector<std::wstring> column_default_cell_style_name_; std::vector<std::wstring> column_default_cell_style_name_;
std::wstring row_default_cell_style_name_; std::wstring row_default_cell_style_name_;
std::wstring cell_style_;
int current_table_column_; int current_table_column_;
int current_table_row_; int current_table_row_;
bool empty_row_;
unsigned int columns_spanned_num_; unsigned int columns_spanned_num_;
std::wstring columns_spanned_style_; std::wstring columns_spanned_style_;
std::vector<xlsx_row_spanned> rows_spanned_; std::vector<xlsx_row_spanned> rows_spanned_;
std::vector<unsigned int> columns_; std::vector<unsigned int> columns_;
unsigned int columns_count_; unsigned int columns_count_;
double table_column_last_width_;
xlsx_merge_cells merge_cells_; xlsx_merge_cells merge_cells_;
xlsx_table_metrics xlsx_table_metrics_; xlsx_table_metrics xlsx_table_metrics_;
xlsx_drawing_context xlsx_drawing_context_; xlsx_drawing_context xlsx_drawing_context_;
xlsx_comments_context xlsx_comments_context_; xlsx_comments_context xlsx_comments_context_;
bool empty_row_;
double table_column_last_width_;
xlsx_hyperlinks xlsx_hyperlinks_; xlsx_hyperlinks xlsx_hyperlinks_;
}; };
......
...@@ -18,25 +18,26 @@ namespace oox { ...@@ -18,25 +18,26 @@ namespace oox {
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
xlsx_table_state & xlsx_table_context::state() xlsx_table_state_ptr & xlsx_table_context::state()
{ {
return table_state_stack_.back(); return table_state_stack_.back();
} }
const xlsx_table_state & xlsx_table_context::state() const const xlsx_table_state_ptr & xlsx_table_context::state() const
{ {
return table_state_stack_.back(); return table_state_stack_.back();
} }
xlsx_table_context:: xlsx_table_context::
xlsx_table_context(xlsx_conversion_context & Context, xlsx_text_context & textContext): context_(Context), xlsx_table_context(xlsx_conversion_context * Context, xlsx_text_context & textContext): context_(Context),
xlsx_text_context_(textContext) xlsx_text_context_(textContext)
{ {
} }
void xlsx_table_context::start_table(const std::wstring & tableName, const std::wstring & tableStyleName) void xlsx_table_context::start_table(std::wstring tableName, std::wstring tableStyleName)
{ {
table_state_stack_.push_back( xlsx_table_state(context_, tableStyleName, tableName) ); xlsx_table_state_ptr state = boost::make_shared<xlsx_table_state>(context_, tableStyleName, tableName);
table_state_stack_.push_back( state);
} }
void xlsx_table_context::end_table() void xlsx_table_context::end_table()
...@@ -46,27 +47,27 @@ void xlsx_table_context::end_table() ...@@ -46,27 +47,27 @@ void xlsx_table_context::end_table()
std::wstring xlsx_table_context::get_current_table_name() const std::wstring xlsx_table_context::get_current_table_name() const
{ {
return state().get_current_table_name(); return state()->get_current_table_name();
} }
void xlsx_table_context::start_cell(const std::wstring & formula, size_t columnsSpanned, size_t rowsSpanned) void xlsx_table_context::start_cell(const std::wstring & formula, size_t columnsSpanned, size_t rowsSpanned)
{ {
state().start_cell(columnsSpanned, rowsSpanned); state()->start_cell(columnsSpanned, rowsSpanned);
} }
void xlsx_table_context::end_cell() void xlsx_table_context::end_cell()
{ {
state().end_cell(); state()->end_cell();
} }
void xlsx_table_context::set_current_cell_style_id(unsigned int xfId) void xlsx_table_context::set_current_cell_style_id(unsigned int xfId)
{ {
return state().set_current_cell_style_id(xfId); return state()->set_current_cell_style_id(xfId);
} }
int xlsx_table_context::get_current_cell_style_id() int xlsx_table_context::get_current_cell_style_id()
{ {
return state().get_current_cell_style_id(); return state()->get_current_cell_style_id();
} }
void xlsx_table_context::start_cell_content() void xlsx_table_context::start_cell_content()
...@@ -81,116 +82,116 @@ int xlsx_table_context::end_cell_content() ...@@ -81,116 +82,116 @@ int xlsx_table_context::end_cell_content()
void xlsx_table_context::start_covered_cell() void xlsx_table_context::start_covered_cell()
{ {
return state().start_covered_cell(); return state()->start_covered_cell();
} }
void xlsx_table_context::end_covered_cell() void xlsx_table_context::end_covered_cell()
{ {
return state().end_covered_cell(); return state()->end_covered_cell();
} }
void xlsx_table_context::set_table_row_group(int count, bool collapsed, int level) void xlsx_table_context::set_table_row_group(int count, bool collapsed, int level)
{ {
return state().set_table_row_group(count, collapsed, level); return state()->set_table_row_group(count, collapsed, level);
} }
void xlsx_table_context::start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName) void xlsx_table_context::start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName)
{ {
return state().start_row(StyleName, defaultCellStyleName); return state()->start_row(StyleName, defaultCellStyleName);
} }
void xlsx_table_context::non_empty_row() void xlsx_table_context::non_empty_row()
{ {
return table_state_stack_.back().non_empty_row(); return state()->non_empty_row();
} }
bool xlsx_table_context::is_empty_row() const bool xlsx_table_context::is_empty_row() const
{ {
return state().is_empty_row(); return state()->is_empty_row();
} }
void xlsx_table_context::end_row() void xlsx_table_context::end_row()
{ {
return state().end_row(); return state()->end_row();
} }
void xlsx_table_context::start_column(unsigned int repeated, const std::wstring & defaultCellStyleName) void xlsx_table_context::start_column(unsigned int repeated, const std::wstring & defaultCellStyleName)
{ {
return state().start_column(repeated, defaultCellStyleName); return state()->start_column(repeated, defaultCellStyleName);
} }
unsigned int xlsx_table_context::columns_count() unsigned int xlsx_table_context::columns_count()
{ {
return table_state_stack_.back().columns_count(); return state()->columns_count();
} }
std::wstring xlsx_table_context::default_row_cell_style() const std::wstring xlsx_table_context::default_row_cell_style() const
{ {
return state().default_row_cell_style(); return state()->default_row_cell_style();
} }
std::wstring xlsx_table_context::default_column_cell_style() const std::wstring xlsx_table_context::default_column_cell_style() const
{ {
return state().default_column_cell_style(); return state()->default_column_cell_style();
} }
int xlsx_table_context::current_column() const int xlsx_table_context::current_column() const
{ {
return state().current_column(); return state()->current_column();
} }
int xlsx_table_context::current_row() const int xlsx_table_context::current_row() const
{ {
return state().current_row(); return state()->current_row();
} }
void xlsx_table_context::serialize_merge_cells(std::wostream & _Wostream) void xlsx_table_context::serialize_merge_cells(std::wostream & _Wostream)
{ {
return state().serialize_merge_cells(_Wostream); return state()->serialize_merge_cells(_Wostream);
} }
void xlsx_table_context::serialize_table_format(std::wostream & _Wostream) void xlsx_table_context::serialize_table_format(std::wostream & _Wostream)
{ {
return state().serialize_table_format(_Wostream); return state()->serialize_table_format(_Wostream);
} }
void xlsx_table_context::serialize_hyperlinks(std::wostream & _Wostream) void xlsx_table_context::serialize_hyperlinks(std::wostream & _Wostream)
{ {
return state().serialize_hyperlinks(_Wostream); return state()->serialize_hyperlinks(_Wostream);
} }
void xlsx_table_context::dump_rels_hyperlinks(rels & Rels) void xlsx_table_context::dump_rels_hyperlinks(rels & Rels)
{ {
return state().dump_rels_hyperlinks(Rels); return state()->dump_rels_hyperlinks(Rels);
} }
xlsx_table_metrics & xlsx_table_context::get_table_metrics() xlsx_table_metrics & xlsx_table_context::get_table_metrics()
{ {
return state().get_table_metrics(); return state()->get_table_metrics();
} }
xlsx_drawing_context & xlsx_table_context::get_drawing_context() xlsx_drawing_context & xlsx_table_context::get_drawing_context()
{ {
return state().get_drawing_context(); return state()->get_drawing_context();
} }
xlsx_comments_context & xlsx_table_context::get_comments_context() xlsx_comments_context & xlsx_table_context::get_comments_context()
{ {
return state().get_comments_context(); return state()->get_comments_context();
} }
void xlsx_table_context::table_column_last_width(double w) void xlsx_table_context::table_column_last_width(double w)
{ {
return state().table_column_last_width(w); return state()->table_column_last_width(w);
} }
double xlsx_table_context::table_column_last_width() const double xlsx_table_context::table_column_last_width() const
{ {
return state().table_column_last_width(); return state()->table_column_last_width();
} }
void xlsx_table_context::start_hyperlink() void xlsx_table_context::start_hyperlink()
{ {
return state().start_hyperlink(); return state()->start_hyperlink();
} }
std::wstring xlsx_table_context::end_hyperlink(std::wstring const & ref, std::wstring const & href, std::wstring const & display) std::wstring xlsx_table_context::end_hyperlink(std::wstring const & ref, std::wstring const & href, std::wstring const & display)
{ {
return state().end_hyperlink(ref, href, display); return state()->end_hyperlink(ref, href, display);
} }
......
...@@ -16,10 +16,10 @@ class xlsx_text_context; ...@@ -16,10 +16,10 @@ class xlsx_text_context;
class xlsx_table_context class xlsx_table_context
{ {
public: public:
xlsx_table_context(xlsx_conversion_context & Context, xlsx_text_context & textCotnext); xlsx_table_context(xlsx_conversion_context * Context, xlsx_text_context & textCotnext);
public: public:
void start_table(const std::wstring & tableName, const std::wstring & tableStyleName); void start_table(std::wstring tableName, std::wstring tableStyleName);
void end_table(); void end_table();
std::wstring get_current_table_name() const; std::wstring get_current_table_name() const;
...@@ -70,8 +70,8 @@ public: ...@@ -70,8 +70,8 @@ public:
void table_column_last_width(double w); void table_column_last_width(double w);
double table_column_last_width() const; double table_column_last_width() const;
xlsx_table_state & state(); xlsx_table_state_ptr & state();
const xlsx_table_state & state() const; const xlsx_table_state_ptr & state() const;
void start_hyperlink(); void start_hyperlink();
std::wstring end_hyperlink(std::wstring const & ref, std::wstring const & href, std::wstring const & display); std::wstring end_hyperlink(std::wstring const & ref, std::wstring const & href, std::wstring const & display);
...@@ -80,9 +80,9 @@ public: ...@@ -80,9 +80,9 @@ public:
void serialize_hyperlinks(std::wostream & _Wostream); void serialize_hyperlinks(std::wostream & _Wostream);
private: private:
xlsx_conversion_context & context_; xlsx_conversion_context * context_;
xlsx_text_context & xlsx_text_context_; xlsx_text_context & xlsx_text_context_;
std::list<xlsx_table_state> table_state_stack_; std::list<xlsx_table_state_ptr> table_state_stack_;
}; };
......
...@@ -34,7 +34,7 @@ xlsx_conversion_context(::cpdoccore::oox::package::xlsx_document * outputDocumen ...@@ -34,7 +34,7 @@ xlsx_conversion_context(::cpdoccore::oox::package::xlsx_document * outputDocumen
::cpdoccore::odf_reader::odf_document * odfDocument): output_document_(outputDocument), ::cpdoccore::odf_reader::odf_document * odfDocument): output_document_(outputDocument),
odf_document_(odfDocument), odf_document_(odfDocument),
xlsx_text_context_(odf_document_->odf_context().styleContainer()), xlsx_text_context_(odf_document_->odf_context().styleContainer()),
xlsx_table_context_(*this, xlsx_text_context_), xlsx_table_context_(this, xlsx_text_context_),
maxDigitSize_ (std::pair<float,float>(-1.0, -1.0) ), maxDigitSize_ (std::pair<float,float>(-1.0, -1.0) ),
default_style_( (std::numeric_limits<size_t>::max)() ), default_style_( (std::numeric_limits<size_t>::max)() ),
...@@ -244,7 +244,7 @@ void xlsx_conversion_context::create_new_sheet(std::wstring const & name) ...@@ -244,7 +244,7 @@ void xlsx_conversion_context::create_new_sheet(std::wstring const & name)
{ {
sheets_.push_back(xlsx_xml_worksheet::create(name)); sheets_.push_back(xlsx_xml_worksheet::create(name));
} }
bool xlsx_conversion_context::start_table(const std::wstring & tableName, const std::wstring & tableStyleName) bool xlsx_conversion_context::start_table(std::wstring tableName, std::wstring tableStyleName)
{ {
// TODO : nested tables forbidden // TODO : nested tables forbidden
if (get_table_context().depth() > 0) if (get_table_context().depth() > 0)
......
...@@ -66,10 +66,9 @@ public: ...@@ -66,10 +66,9 @@ public:
void start_span(const std::wstring & styleName); void start_span(const std::wstring & styleName);
void end_span(); void end_span();
bool start_table(const std::wstring & tableName, const std::wstring & tableStyleName); bool start_table(std::wstring tableName,std::wstring tableStyleName);
void end_table(); void end_table();
void start_table_column(unsigned int repeated, const std::wstring & defaultCellStyleName, int & cMin, int & cMax); void start_table_column(unsigned int repeated, const std::wstring & defaultCellStyleName, int & cMin, int & cMax);
void table_column_last_width(double w); void table_column_last_width(double w);
double table_column_last_width() const; double table_column_last_width() const;
......
...@@ -38,33 +38,6 @@ style_instance::style_instance( ...@@ -38,33 +38,6 @@ style_instance::style_instance(
} }
std::wostream & style_instance::dbg_dump(std::wostream & _Wostream)
{
_Wostream << L"[STYLE]\n";
_Wostream << L"\tname: '" << name() << L"'\n";
_Wostream << L"\ttype: '" << style_family(type()) << L"'\n";
_Wostream << L"\tcontent: '" << content() << L"'\n";
_Wostream << L"\tparent: '" << parent() << L"'\n";
_Wostream << L"\tparent_name: '" << parent_name() << L"'\n";
_Wostream << L"\tnext: '" << next() << L"'\n";
_Wostream << L"\tnext_name: '" << next_name() << L"'\n";
_Wostream << L"\tauto: '" << is_automatic() << L"'\n";
_Wostream << L"\tdefault: '" << is_default() << L"'\n";
_Wostream << L"\n";
return _Wostream;
}
std::wostream & styles_container::dbg_dump(std::wostream & _Wostream)
{
BOOST_FOREACH(style_instance_ptr & elm, instances_)
{
elm->dbg_dump(_Wostream);
}
return _Wostream;
}
style_instance * styles_container::hyperlink_style() style_instance * styles_container::hyperlink_style()
{ {
if (hyperlink_style_pos_ > 0) if (hyperlink_style_pos_ > 0)
......
...@@ -44,12 +44,11 @@ public: ...@@ -44,12 +44,11 @@ public:
const std::wstring & parent_name() const; const std::wstring & parent_name() const;
style_instance * next() const; style_instance * next() const;
const std::wstring & next_name() const; const std::wstring & next_name() const;
bool is_automatic() const;
bool is_default() const;
const styles_container * container() const { return container_; } const styles_container * container() const { return container_; }
const std::wstring & data_style_name() const; const std::wstring & data_style_name() const;
std::wostream & dbg_dump(std::wostream & _Wostream); bool is_automatic() const;
bool is_default() const;
private: private:
styles_container * container_; styles_container * container_;
...@@ -126,8 +125,6 @@ public: ...@@ -126,8 +125,6 @@ public:
instances_array & instances() { return instances_; } instances_array & instances() { return instances_; }
std::wostream & dbg_dump(std::wostream & _Wostream);
presentation_layouts_instance & presentation_layouts() { return presentation_layouts_; } presentation_layouts_instance & presentation_layouts() { return presentation_layouts_; }
presentation_masters_instance & presentation_masters() { return presentation_masters_; } presentation_masters_instance & presentation_masters() { return presentation_masters_; }
......
...@@ -84,38 +84,28 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -84,38 +84,28 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
odf_read_context & odfContext = Context.root()->odf_context(); odf_read_context & odfContext = Context.root()->odf_context();
do
{
odf_reader::style_instance * rowStyle = odfContext.styleContainer().style_by_name(rowStyleName, odf_types::style_family::TableRow,false/*false*/); odf_reader::style_instance * rowStyle = odfContext.styleContainer().style_by_name(rowStyleName, odf_types::style_family::TableRow,false/*false*/);
if (!rowStyle) if ((rowStyle) && (rowStyle->content()))
break; {
if (!rowStyle->content())
break;
const odf_reader::style_table_row_properties * prop = rowStyle->content()->get_style_table_row_properties(); const odf_reader::style_table_row_properties * prop = rowStyle->content()->get_style_table_row_properties();
if (!prop) if ((prop) && (prop->style_table_row_properties_attlist_.style_row_height_))
break;
if (const _CP_OPT(odf_types::length) & height = prop->style_table_row_properties_attlist_.style_row_height_)
{ {
row_height = height->get_value_unit(odf_types::length::pt); row_height = prop->style_table_row_properties_attlist_.style_row_height_->get_value_unit(odf_types::length::pt);
if ((prop->style_table_row_properties_attlist_.style_use_optimal_row_height_) && if ((prop->style_table_row_properties_attlist_.style_use_optimal_row_height_) &&
(*prop->style_table_row_properties_attlist_.style_use_optimal_row_height_==true)) (*prop->style_table_row_properties_attlist_.style_use_optimal_row_height_==true))
{ {
// . // .
//
//todooo () - !!!
} }
else
{
std::wstringstream ht_s; std::wstringstream ht_s;
ht_s.precision(3); ht_s.precision(3);
ht_s << std::fixed << row_height; ht_s << std::fixed << row_height;
ht = ht_s.str(); ht = ht_s.str();
} }
} }
}
while (0);
bool hidden = table_table_row_attlist_.table_visibility_.get_type() == table_visibility::Collapse; bool hidden = table_table_row_attlist_.table_visibility_.get_type() == table_visibility::Collapse;
...@@ -131,22 +121,22 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -131,22 +121,22 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
{ {
CP_XML_ATTR(L"r", Context.current_table_row() + 1); CP_XML_ATTR(L"r", Context.current_table_row() + 1);
if (Context.get_table_context().state().group_row_.enabled) if (Context.get_table_context().state()->group_row_.enabled)
{ {
//std::wstring str_spans = boost::lexical_cast<std::wstring>(Context.get_table_context().state().group_row_.count); //std::wstring str_spans = boost::lexical_cast<std::wstring>(Context.get_table_context().state()->group_row_.count);
//str_spans = str_spans + L":"; //str_spans = str_spans + L":";
std::wstring str_spans = L"1:" + boost::lexical_cast<std::wstring>(Context.get_table_context().columns_count()); std::wstring str_spans = L"1:" + boost::lexical_cast<std::wstring>(Context.get_table_context().columns_count());
ht = L""; ht = L"";
CP_XML_ATTR(L"collapsed", Context.get_table_context().state().group_row_.collapsed); CP_XML_ATTR(L"collapsed", Context.get_table_context().state()->group_row_.collapsed);
CP_XML_ATTR(L"outlineLevel", Context.get_table_context().state().group_row_.level); CP_XML_ATTR(L"outlineLevel", Context.get_table_context().state()->group_row_.level);
CP_XML_ATTR(L"spans", str_spans); CP_XML_ATTR(L"spans", str_spans);
if (Context.get_table_context().state().group_row_.collapsed)hidden = false; if (Context.get_table_context().state()->group_row_.collapsed)hidden = false;
Context.get_table_context().state().group_row_.count--; Context.get_table_context().state()->group_row_.count--;
if (Context.get_table_context().state().group_row_.count<1) if (Context.get_table_context().state()->group_row_.count<1)
Context.get_table_context().state().group_row_.enabled = false; Context.get_table_context().state()->group_row_.enabled = false;
} }
if (hidden) if (hidden)
......
...@@ -126,6 +126,7 @@ int CF12::serialize(std::wostream & stream) ...@@ -126,6 +126,7 @@ int CF12::serialize(std::wostream & stream)
CP_XML_NODE(L"dataBar") CP_XML_NODE(L"dataBar")
{ {
//todooo cfvo = num - db1 & db2
CP_XML_NODE(L"cfvo") CP_XML_NODE(L"cfvo")
{ {
if (dataBar->iPercentMin > 0) if (dataBar->iPercentMin > 0)
......
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