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 "xlsx_table_state.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 oox {
xlsx_table_state::xlsx_table_state(xlsx_conversion_context & Context, const std::wstring & StyleName, const std::wstring & tableName)
: context_(Context),
table_style_(StyleName),
tableName_(tableName),
current_table_column_(-1),
current_table_row_(-1),
columns_spanned_num_(0),
columns_count_(0),
xlsx_drawing_context_(Context.get_drawing_context_handle()),
xlsx_comments_context_(Context.get_comments_context_handle()),
xlsx_table_state::xlsx_table_state(xlsx_conversion_context * Context, std::wstring styleName, std::wstring tableName)
: context_ (Context),
table_style_ (styleName),
tableName_ (tableName),
current_table_column_ (-1),
current_table_row_ (-1),
columns_spanned_num_ (0),
columns_count_ (0),
xlsx_drawing_context_ (Context->get_drawing_context_handle()),
xlsx_comments_context_ (Context->get_comments_context_handle()),
table_column_last_width_(0.0)
{
memset(&group_row_,0,sizeof(_group_row));
......@@ -225,6 +231,7 @@ double charsToSize(unsigned int charsCount, double maxDigitSize)
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_NODE(L"sheetView")
......@@ -234,32 +241,26 @@ void xlsx_table_state::serialize_table_format(std::wostream & _Wostream)
// -rightToLeft
// -zoomScale
}
CP_XML_NODE(L"sheetFormatPr")
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()))
{
double default_height = (context_.getMaxDigitSize().second * 72. / 96. * 100.) /100.;//in point size.
//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());
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_ATTR(L"defaultRowHeight",default_height);
CP_XML_NODE(L"sheetFormatPr")
{
CP_XML_ATTR(L"defaultRowHeight", ht_s.str());
}
}
}
......
......@@ -13,12 +13,15 @@ namespace cpdoccore {
namespace oox {
class xlsx_conversion_context;
class xlsx_table_state;
typedef _CP_PTR(xlsx_table_state) xlsx_table_state_ptr;
class xlsx_table_state
{
public:
xlsx_table_state(xlsx_conversion_context & Context, const std::wstring & StyleName, const std::wstring & tableName);
std::wstring current_style() const { return table_style_; }
xlsx_table_state(xlsx_conversion_context * Context, std::wstring styleName, std::wstring tableName);
std::wstring current_style() const { return table_style_; }
void start_column(unsigned int repeated, const std::wstring & defaultCellStyleName);
void start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
void non_empty_row();
......@@ -45,20 +48,20 @@ public:
unsigned int current_rows_spanned(unsigned int Column) const;
unsigned int columns_count() const;
xlsx_table_metrics & get_table_metrics() { return xlsx_table_metrics_; }
xlsx_drawing_context & get_drawing_context() { return xlsx_drawing_context_; }
xlsx_comments_context & get_comments_context() { return xlsx_comments_context_; }
xlsx_table_metrics & get_table_metrics() { return xlsx_table_metrics_; }
xlsx_drawing_context & get_drawing_context() { return xlsx_drawing_context_; }
xlsx_comments_context & get_comments_context() { return xlsx_comments_context_; }
void table_column_last_width(double w) { table_column_last_width_ = w; }
double table_column_last_width() const { return table_column_last_width_; };
void table_column_last_width(double w) { table_column_last_width_ = w; }
double table_column_last_width() const { return table_column_last_width_; };
void start_hyperlink();
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_merge_cells(std::wostream & _Wostream);
void serialize_hyperlinks(std::wostream & _Wostream);
void dump_rels_hyperlinks(rels & Rels);
void serialize_table_format (std::wostream & _Wostream);
void serialize_merge_cells (std::wostream & _Wostream);
void serialize_hyperlinks (std::wostream & _Wostream);
void dump_rels_hyperlinks (rels & Rels);
std::wstring get_current_table_name() const { return tableName_; }
......@@ -70,29 +73,32 @@ public:
bool collapsed;
}group_row_;
private:
xlsx_conversion_context & context_;
std::wstring table_style_;
std::wstring tableName_;
std::wstring table_row_style_;
std::vector<std::wstring> column_default_cell_style_name_;
std::wstring row_default_cell_style_name_;
std::wstring cell_style_;
int current_table_column_;
int current_table_row_;
unsigned int columns_spanned_num_;
std::wstring columns_spanned_style_;
std::vector<xlsx_row_spanned> rows_spanned_;
std::vector<unsigned int> columns_;
unsigned int columns_count_;
xlsx_merge_cells merge_cells_;
xlsx_table_metrics xlsx_table_metrics_;
xlsx_drawing_context xlsx_drawing_context_;
xlsx_comments_context xlsx_comments_context_;
bool empty_row_;
double table_column_last_width_;
xlsx_hyperlinks xlsx_hyperlinks_;
xlsx_conversion_context * context_;
std::wstring tableName_;
std::wstring table_style_;
std::wstring table_row_style_;
std::wstring cell_style_;
std::vector<std::wstring> column_default_cell_style_name_;
std::wstring row_default_cell_style_name_;
int current_table_column_;
int current_table_row_;
bool empty_row_;
unsigned int columns_spanned_num_;
std::wstring columns_spanned_style_;
std::vector<xlsx_row_spanned> rows_spanned_;
std::vector<unsigned int> columns_;
unsigned int columns_count_;
double table_column_last_width_;
xlsx_merge_cells merge_cells_;
xlsx_table_metrics xlsx_table_metrics_;
xlsx_drawing_context xlsx_drawing_context_;
xlsx_comments_context xlsx_comments_context_;
xlsx_hyperlinks xlsx_hyperlinks_;
};
......
......@@ -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();
}
const xlsx_table_state & xlsx_table_context::state() const
const xlsx_table_state_ptr & xlsx_table_context::state() const
{
return table_state_stack_.back();
}
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)
{
}
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()
......@@ -46,27 +47,27 @@ void xlsx_table_context::end_table()
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)
{
state().start_cell(columnsSpanned, rowsSpanned);
state()->start_cell(columnsSpanned, rowsSpanned);
}
void xlsx_table_context::end_cell()
{
state().end_cell();
state()->end_cell();
}
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()
{
return state().get_current_cell_style_id();
return state()->get_current_cell_style_id();
}
void xlsx_table_context::start_cell_content()
......@@ -81,116 +82,116 @@ int xlsx_table_context::end_cell_content()
void xlsx_table_context::start_covered_cell()
{
return state().start_covered_cell();
return state()->start_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)
{
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)
{
return state().start_row(StyleName, defaultCellStyleName);
return state()->start_row(StyleName, defaultCellStyleName);
}
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
{
return state().is_empty_row();
return state()->is_empty_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)
{
return state().start_column(repeated, defaultCellStyleName);
return state()->start_column(repeated, defaultCellStyleName);
}
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
{
return state().default_row_cell_style();
return state()->default_row_cell_style();
}
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
{
return state().current_column();
return state()->current_column();
}
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)
{
return state().serialize_merge_cells(_Wostream);
return state()->serialize_merge_cells(_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)
{
return state().serialize_hyperlinks(_Wostream);
return state()->serialize_hyperlinks(_Wostream);
}
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()
{
return state().get_table_metrics();
return state()->get_table_metrics();
}
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()
{
return state().get_comments_context();
return state()->get_comments_context();
}
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
{
return state().table_column_last_width();
return state()->table_column_last_width();
}
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)
{
return state().end_hyperlink(ref, href, display);
return state()->end_hyperlink(ref, href, display);
}
......
......@@ -16,10 +16,10 @@ class xlsx_text_context;
class xlsx_table_context
{
public:
xlsx_table_context(xlsx_conversion_context & Context, xlsx_text_context & textCotnext);
xlsx_table_context(xlsx_conversion_context * Context, xlsx_text_context & textCotnext);
public:
void start_table(const std::wstring & tableName, const std::wstring & tableStyleName);
void start_table(std::wstring tableName, std::wstring tableStyleName);
void end_table();
std::wstring get_current_table_name() const;
......@@ -70,8 +70,8 @@ public:
void table_column_last_width(double w);
double table_column_last_width() const;
xlsx_table_state & state();
const xlsx_table_state & state() const;
xlsx_table_state_ptr & state();
const xlsx_table_state_ptr & state() const;
void start_hyperlink();
std::wstring end_hyperlink(std::wstring const & ref, std::wstring const & href, std::wstring const & display);
......@@ -80,9 +80,9 @@ public:
void serialize_hyperlinks(std::wostream & _Wostream);
private:
xlsx_conversion_context & context_;
xlsx_text_context & xlsx_text_context_;
std::list<xlsx_table_state> table_state_stack_;
xlsx_conversion_context * context_;
xlsx_text_context & xlsx_text_context_;
std::list<xlsx_table_state_ptr> table_state_stack_;
};
......
......@@ -34,7 +34,7 @@ xlsx_conversion_context(::cpdoccore::oox::package::xlsx_document * outputDocumen
::cpdoccore::odf_reader::odf_document * odfDocument): output_document_(outputDocument),
odf_document_(odfDocument),
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) ),
default_style_( (std::numeric_limits<size_t>::max)() ),
......@@ -244,7 +244,7 @@ void xlsx_conversion_context::create_new_sheet(std::wstring const & 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
if (get_table_context().depth() > 0)
......
......@@ -66,14 +66,13 @@ public:
void start_span(const std::wstring & styleName);
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 start_table_column(unsigned int repeated, const std::wstring & defaultCellStyleName, int & cMin, int & cMax);
void table_column_last_width(double w);
double table_column_last_width() const;
void end_table_column();
void start_table_column(unsigned int repeated, const std::wstring & defaultCellStyleName, int & cMin, int & cMax);
void table_column_last_width(double w);
double table_column_last_width() const;
void end_table_column();
void set_table_row_group(int count, bool collapsed, int level);
void start_table_row(const std::wstring & styleName, const std::wstring & defaultCellStyleName);
......
......@@ -37,34 +37,7 @@ style_instance::style_instance(
parent_ = Container->style_by_name(parent_name_, style_type_,false);
}
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()
{
if (hyperlink_style_pos_ > 0)
......
......@@ -18,53 +18,52 @@ namespace odf_reader {
class styles_container;
class style_instance;
typedef boost::shared_ptr<style_instance> style_instance_ptr;
typedef boost::shared_ptr<style_instance> style_instance_ptr;
typedef boost::shared_ptr<styles_container> styles_container_ptr;
class style_instance
{
public:
style_instance(
styles_container * Container,
const std::wstring & Name,
odf_types::style_family::type Type,
style_content * Content,
bool IsAutomatic,
bool IsDefault,
const std::wstring & ParentStyleName,
const std::wstring & NextStyleName,
const std::wstring & DataStyleName
styles_container * Container,
const std::wstring & Name,
odf_types::style_family::type Type,
style_content * Content,
bool IsAutomatic,
bool IsDefault,
const std::wstring & ParentStyleName,
const std::wstring & NextStyleName,
const std::wstring & DataStyleName
);
const std::wstring & name() const;
odf_types::style_family::type type() const;
style_content * content() const;
style_instance * parent() const;
const std::wstring & parent_name() const;
style_instance * next() const;
const std::wstring & next_name() const;
bool is_automatic() const;
bool is_default() const;
const styles_container * container() const { return container_; }
const std::wstring & data_style_name() const;
std::wostream & dbg_dump(std::wostream & _Wostream);
const std::wstring & name() const;
odf_types::style_family::type type() const;
style_content * content() const;
style_instance * parent() const;
const std::wstring & parent_name() const;
style_instance * next() const;
const std::wstring & next_name() const;
const styles_container * container() const { return container_; }
const std::wstring & data_style_name() const;
bool is_automatic() const;
bool is_default() const;
private:
styles_container * container_;
std::wstring name_;
odf_types::style_family::type style_type_;
style_content * content_;
bool is_automatic_;
bool is_default_;
std::wstring parent_name_;
std::wstring next_name_;
mutable style_instance * parent_;
mutable style_instance * next_;
std::wstring data_style_name_;
styles_container * container_;
std::wstring name_;
odf_types::style_family::type style_type_;
style_content * content_;
bool is_automatic_;
bool is_default_;
std::wstring parent_name_;
std::wstring next_name_;
mutable style_instance * parent_;
mutable style_instance * next_;
std::wstring data_style_name_;
};
class presentation_layouts_instance
......@@ -107,14 +106,14 @@ public:
typedef std::vector<style_instance_ptr> instances_array;
void add_style(const std::wstring & Name,
odf_types::style_family::type Type,
style_content * Content,
bool IsAutomatic,
bool IsDefault,
const std::wstring & ParentStyleName,
const std::wstring & NextStyleName,
const std::wstring & DataStyleName);
void add_style(const std::wstring & Name,
odf_types::style_family::type Type,
style_content * Content,
bool IsAutomatic,
bool IsDefault,
const std::wstring & ParentStyleName,
const std::wstring & NextStyleName,
const std::wstring & DataStyleName);
void add_master_page_name(const std::wstring & StyleName, const std::wstring & MasterPageName);
......@@ -126,8 +125,6 @@ public:
instances_array & instances() { return instances_; }
std::wostream & dbg_dump(std::wostream & _Wostream);
presentation_layouts_instance & presentation_layouts() { return presentation_layouts_; }
presentation_masters_instance & presentation_masters() { return presentation_masters_; }
......
......@@ -130,9 +130,9 @@ public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
public:
_CP_OPT(odf_types::length) style_column_width_;
_CP_OPT(odf_types::length) style_rel_column_width_;
_CP_OPT(bool) style_use_optimal_column_width_;
_CP_OPT(odf_types::length) style_column_width_;
_CP_OPT(odf_types::length) style_rel_column_width_;
_CP_OPT(bool) style_use_optimal_column_width_;
odf_types::common_break_attlist common_break_attlist_;
};
......@@ -175,12 +175,12 @@ public:
void pptx_convert(oox::pptx_conversion_context & Context);
public:
_CP_OPT(odf_types::length) style_row_height_;
_CP_OPT(odf_types::length) style_min_row_height_;
_CP_OPT(bool) style_use_optimal_row_height_;
odf_types::common_background_color_attlist common_background_color_attlist_;
odf_types::common_break_attlist common_break_attlist_;
_CP_OPT(odf_types::keep_together) fo_keep_together_;
_CP_OPT(odf_types::length) style_row_height_;
_CP_OPT(odf_types::length) style_min_row_height_;
_CP_OPT(bool) style_use_optimal_row_height_;
odf_types::common_background_color_attlist common_background_color_attlist_;
odf_types::common_break_attlist common_break_attlist_;
_CP_OPT(odf_types::keep_together) fo_keep_together_;
};
......@@ -204,8 +204,8 @@ private:
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
public:
style_table_row_properties_attlist style_table_row_properties_attlist_;
office_element_ptr style_background_image_;
style_table_row_properties_attlist style_table_row_properties_attlist_;
office_element_ptr style_background_image_;
};
......
......@@ -84,38 +84,28 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & 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*/);
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);
odf_reader::style_instance * rowStyle = odfContext.styleContainer().style_by_name(rowStyleName, odf_types::style_family::TableRow,false/*false*/);
if ((rowStyle) && (rowStyle->content()))
{
const odf_reader::style_table_row_properties * prop = rowStyle->content()->get_style_table_row_properties();
if ((prop) && (prop->style_table_row_properties_attlist_.style_row_height_))
{
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_) &&
(*prop->style_table_row_properties_attlist_.style_use_optimal_row_height_==true))
{
// .
//
//todooo () - !!!
}
else
{
std::wstringstream ht_s;
ht_s.precision(3);
ht_s << std::fixed << row_height;
ht = ht_s.str();
}
}
}
while (0);
std::wstringstream ht_s;
ht_s.precision(3);
ht_s << std::fixed << row_height;
ht = ht_s.str();
}
}
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)
{
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":";
std::wstring str_spans = L"1:" + boost::lexical_cast<std::wstring>(Context.get_table_context().columns_count());
ht = L"";
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"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"spans", str_spans);
if (Context.get_table_context().state().group_row_.collapsed)hidden = false;
Context.get_table_context().state().group_row_.count--;
if (Context.get_table_context().state()->group_row_.collapsed)hidden = false;
Context.get_table_context().state()->group_row_.count--;
if (Context.get_table_context().state().group_row_.count<1)
Context.get_table_context().state().group_row_.enabled = false;
if (Context.get_table_context().state()->group_row_.count<1)
Context.get_table_context().state()->group_row_.enabled = false;
}
if (hidden)
......
......@@ -126,6 +126,7 @@ int CF12::serialize(std::wostream & stream)
CP_XML_NODE(L"dataBar")
{
//todooo cfvo = num - db1 & db2
CP_XML_NODE(L"cfvo")
{
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