Commit af0bf700 authored by ElenaSubbotina's avatar ElenaSubbotina Committed by Alexander Trofimov

OdfFormatReader - правка багов по результатам тестирования

parent ba915264
...@@ -719,7 +719,8 @@ void docx_conversion_context::docx_serialize_paragraph_style(std::wostream & str ...@@ -719,7 +719,8 @@ void docx_conversion_context::docx_serialize_paragraph_style(std::wostream & str
CP_XML_WRITER(strm) CP_XML_WRITER(strm)
{ {
if (get_section_context().dump_.empty() == false && (!ParentId.empty() || get_section_context().get().is_dump_)) if (get_section_context().dump_.empty() == false && (!ParentId.empty() || get_section_context().get().is_dump_)
&& !get_table_context().in_table())
{// {//
CP_XML_NODE(L"w:pPr") CP_XML_NODE(L"w:pPr")
{ {
...@@ -734,9 +735,11 @@ void docx_conversion_context::docx_serialize_paragraph_style(std::wostream & str ...@@ -734,9 +735,11 @@ void docx_conversion_context::docx_serialize_paragraph_style(std::wostream & str
{ {
CP_XML_NODE(L"w:pPr") CP_XML_NODE(L"w:pPr")
{ {
CP_XML_STREAM() << get_section_context().dump_; if ( !get_table_context().in_table() )
get_section_context().dump_.clear(); {
CP_XML_STREAM() << get_section_context().dump_;
get_section_context().dump_.clear();
}
if (!ParentId.empty()) if (!ParentId.empty())
{ {
CP_XML_NODE(L"w:pStyle") CP_XML_NODE(L"w:pStyle")
......
...@@ -30,6 +30,8 @@ void docx_table_state::start_column(unsigned int repeated, const std::wstring & ...@@ -30,6 +30,8 @@ void docx_table_state::start_column(unsigned int repeated, const std::wstring &
std::wstring docx_table_state::get_default_cell_style_col(unsigned int column) std::wstring docx_table_state::get_default_cell_style_col(unsigned int column)
{ {
if (columnsDefaultCellStyleName_.size() <= column)
return L"";
return columnsDefaultCellStyleName_.at(column); return columnsDefaultCellStyleName_.at(column);
} }
......
...@@ -32,13 +32,12 @@ oox_chart_context_ptr oox_chart_context::create(std::wstring const & name) ...@@ -32,13 +32,12 @@ oox_chart_context_ptr oox_chart_context::create(std::wstring const & name)
{ {
return boost::make_shared<oox_chart_context>(name); return boost::make_shared<oox_chart_context>(name);
} }
oox_chart_context::oox_chart_context() oox_chart_context::oox_chart_context() : impl_(new oox_chart_context::Impl())
: impl_(new oox_chart_context::Impl())
{ {
} }
oox_chart_context::oox_chart_context(std::wstring const & name) oox_chart_context::oox_chart_context(std::wstring const & name) : impl_(new oox_chart_context::Impl(name))
: impl_(new oox_chart_context::Impl(name))
{ {
} }
std::wostream & oox_chart_context::chartData() std::wostream & oox_chart_context::chartData()
{ {
...@@ -89,6 +88,15 @@ bool oox_chart_context::empty() const ...@@ -89,6 +88,15 @@ bool oox_chart_context::empty() const
return false;//impl_->empty(); return false;//impl_->empty();
} }
void oox_chart_context::set_cache_only (bool val)
{
for (int i = 0 ; i < plot_area_.charts_.size(); i++)
{
plot_area_.charts_[i]->set_cache_only(val);
}
}
} }
} }
......
...@@ -30,6 +30,7 @@ public: ...@@ -30,6 +30,7 @@ public:
bool empty() const; bool empty() const;
void write_to(std::wostream & strm); void write_to(std::wostream & strm);
static oox_chart_context_ptr create(std::wstring const & name); static oox_chart_context_ptr create(std::wstring const & name);
static oox_chart_context_ptr create(); static oox_chart_context_ptr create();
...@@ -83,6 +84,8 @@ public: ...@@ -83,6 +84,8 @@ public:
plot_area_.properties_ = prop; plot_area_.properties_ = prop;
plot_area_.fill_ = fill; plot_area_.fill_ = fill;
} }
void set_cache_only (bool val);
private: private:
class Impl; class Impl;
_CP_SCOPED_PTR(Impl) impl_; _CP_SCOPED_PTR(Impl) impl_;
...@@ -91,7 +94,7 @@ private: ...@@ -91,7 +94,7 @@ private:
cpdoccore::oox::oox_plot_area plot_area_; cpdoccore::oox::oox_plot_area plot_area_;
cpdoccore::oox::oox_chart_legend legend_; cpdoccore::oox::oox_chart_legend legend_;
std::vector<odf_reader::_property> graphic_properties_; std::vector<odf_reader::_property> graphic_properties_;
_oox_fill fill_; _oox_fill fill_;
}; };
......
...@@ -72,6 +72,11 @@ void oox_chart_series::setFormula(int ind, std::wstring &value) ...@@ -72,6 +72,11 @@ void oox_chart_series::setFormula(int ind, std::wstring &value)
} }
} }
void oox_chart_series::set_cache_only (bool val)
{
bLocalTable_ = val;
}
void oox_chart_series::parse_properties() void oox_chart_series::parse_properties()
{ {
_CP_OPT(int) iSymbolType; _CP_OPT(int) iSymbolType;
...@@ -100,13 +105,13 @@ void oox_chart_series::setValues(int ind, std::vector<std::wstring> & values) ...@@ -100,13 +105,13 @@ void oox_chart_series::setValues(int ind, std::vector<std::wstring> & values)
boost::algorithm::trim(v); boost::algorithm::trim(v);
if (ind == 4) if (ind == 4)
{ {
values_[ind].strRef_.str_cash.push_back(v); values_[ind].strRef_.str_cache.push_back(v);
values_[ind].strRef_.str_cash_count++; values_[ind].strRef_.str_cache_count++;
} }
else else
{ {
values_[ind].numRef_.num_cash.push_back(v); values_[ind].numRef_.num_cache.push_back(v);
values_[ind].numRef_.num_cash_count++; values_[ind].numRef_.num_cache_count++;
} }
} }
} }
...@@ -136,7 +141,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream) ...@@ -136,7 +141,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
{ {
CP_XML_NODE(values_[i].type) CP_XML_NODE(values_[i].type)
{ {
if (values_[i].numRef_.present) if (values_[i].numRef_.present && !bLocalTable_)
{ {
CP_XML_NODE(L"c:numRef") CP_XML_NODE(L"c:numRef")
{ {
...@@ -145,7 +150,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream) ...@@ -145,7 +150,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
CP_XML_CONTENT(values_[i].numRef_.formula); CP_XML_CONTENT(values_[i].numRef_.formula);
} }
if (values_[i].numRef_.num_cash_count>0) if (values_[i].numRef_.num_cache_count>0)
{ {
CP_XML_NODE(L"c:numCache")// CP_XML_NODE(L"c:numCache")//
{ {
...@@ -155,10 +160,10 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream) ...@@ -155,10 +160,10 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
} }
CP_XML_NODE(L"c:ptCount") CP_XML_NODE(L"c:ptCount")
{ {
CP_XML_ATTR(L"val", values_[i].numRef_.num_cash_count); CP_XML_ATTR(L"val", values_[i].numRef_.num_cache_count);
} }
int j=0; int j=0;
BOOST_FOREACH(std::wstring & v, values_[i].numRef_.num_cash) BOOST_FOREACH(std::wstring & v, values_[i].numRef_.num_cache)
{ {
CP_XML_NODE(L"c:pt") CP_XML_NODE(L"c:pt")
{ {
...@@ -177,39 +182,59 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream) ...@@ -177,39 +182,59 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
} }
} }
} }
//if (values_[i].strRef_.present) else if (values_[i].numRef_.num_cache_count > 0)
//{ {
// CP_XML_NODE(L"c:strRef") CP_XML_NODE(L"c:numLit")
// { {
// CP_XML_NODE(L"c:f") CP_XML_NODE(L"c:formatCode")
// { {
// CP_XML_CONTENT(values_[i].strRef_.formula); CP_XML_CONTENT(L"General");//????
// } }
// CP_XML_NODE(L"c:ptCount")
// if (values_[i].strRef_.str_cash_count>0) {
// { CP_XML_ATTR(L"val", values_[i].numRef_.num_cache_count);
// CP_XML_NODE(L"c:strCache")// }
// { int j=0;
// CP_XML_NODE(L"c:ptCount") BOOST_FOREACH(std::wstring & v, values_[i].numRef_.num_cache)
// { {
// CP_XML_ATTR(L"val", values_[i].strRef_.str_cash_count); if (v == L"NaN") continue;
// } CP_XML_NODE(L"c:pt")
// int j=0; {
// BOOST_FOREACH(std::wstring & v, values_[i].strRef_.str_cash) CP_XML_ATTR(L"idx", j++);
// { double val = 0;
// CP_XML_NODE(L"c:pt")
// { try { val = boost::lexical_cast<double>(v);}
// CP_XML_ATTR(L"idx", j++); catch(...){}
// CP_XML_NODE(L"c:v") CP_XML_NODE(L"c:v")
// { {
// CP_XML_CONTENT(v); CP_XML_CONTENT(val);
// } }
// } }
// } }
// } }
// } }
// } else if (values_[i].strRef_.str_cache_count > 0)
//} {
CP_XML_NODE(L"c:strLit")
{
CP_XML_NODE(L"c:ptCount")
{
CP_XML_ATTR(L"val", values_[i].strRef_.str_cache_count);
}
int j=0;
BOOST_FOREACH(std::wstring & v, values_[i].strRef_.str_cache)
{
CP_XML_NODE(L"c:pt")
{
CP_XML_ATTR(L"idx", j++);
CP_XML_NODE(L"c:v")
{
CP_XML_CONTENT(v);
}
}
}
}
}
} }
} }
} }
......
...@@ -24,7 +24,8 @@ public: ...@@ -24,7 +24,8 @@ public:
values_[3].type=L"c:bubbleSize";// !!!! values_[3].type=L"c:bubbleSize";// !!!!
values_[4].type=L"c:cat";// values_[4].type=L"c:cat";//
iSymbolMarkerType_ =0; iSymbolMarkerType_ = 0;
bLocalTable_ = false;
} }
~oox_chart_series(){} ~oox_chart_series(){}
...@@ -42,8 +43,11 @@ public: ...@@ -42,8 +43,11 @@ public:
void setFormula(int ind, std::wstring & value); void setFormula(int ind, std::wstring & value);
void setValues(int ind, std::vector<std::wstring> & values); void setValues(int ind, std::vector<std::wstring> & values);
void parse_properties(); void parse_properties();
void set_cache_only (bool val);
int iSymbolMarkerType_; int iSymbolMarkerType_;
bool bLocalTable_;
odf_reader::chart::series content_; odf_reader::chart::series content_;
......
...@@ -29,21 +29,21 @@ struct _oox_numLit ...@@ -29,21 +29,21 @@ struct _oox_numLit
//}; //};
struct _oox_strRef struct _oox_strRef
{ {
bool present; bool present;
std::wstring formula; std::wstring formula;
int str_cash_count; int str_cache_count;
std::vector<std::wstring>str_cash; std::vector<std::wstring> str_cache;
}; };
struct _oox_numRef struct _oox_numRef
{ {
bool present; bool present;
std::wstring formula; std::wstring formula;
std::wstring formatCode; std::wstring formatCode;
int num_cash_count; int num_cache_count;
std::vector<std::wstring>num_cash; std::vector<std::wstring> num_cache;
}; };
//extLst (Chart Extensibility) 21.2.2.64 //extLst (Chart Extensibility) 21.2.2.64
...@@ -55,13 +55,12 @@ struct _oox_chart_values ...@@ -55,13 +55,12 @@ struct _oox_chart_values
public: public:
_oox_chart_values() _oox_chart_values()
{ {
numLit_.present =false;
numRef_.present=false; numRef_.present=false;
numRef_.formatCode = L"General"; numRef_.formatCode = L"General";
numRef_.num_cash_count=0; numRef_.num_cache_count=0;
strRef_.present=false; strRef_.present=false;
strRef_.str_cash_count=0; strRef_.str_cache_count=0;
present = false; present = false;
} }
...@@ -69,7 +68,6 @@ public: ...@@ -69,7 +68,6 @@ public:
bool present; bool present;
std::wstring type; std::wstring type;
_oox_numLit numLit_;
_oox_numRef numRef_; _oox_numRef numRef_;
_oox_strRef strRef_; _oox_strRef strRef_;
......
...@@ -10,10 +10,20 @@ ...@@ -10,10 +10,20 @@
namespace cpdoccore { namespace cpdoccore {
namespace oox { namespace oox {
void oox_chart::set_cache_only (bool val)
{
for (int i = 0 ; i < series_.size(); i++)
{
series_[i]->set_cache_only(val);
}
}
void oox_chart::set_formula_series(int ind, std::wstring val) void oox_chart::set_formula_series(int ind, std::wstring val)
{ {
oox_series_ptr & current_ptr = series_.back(); oox_series_ptr & current_ptr = series_.back();
current_ptr->setFormula(ind,val); current_ptr->setFormula(ind,val);
} }
void oox_chart::set_name(std::wstring val) void oox_chart::set_name(std::wstring val)
{ {
......
...@@ -33,9 +33,10 @@ public: ...@@ -33,9 +33,10 @@ public:
virtual void add_series(int id){} virtual void add_series(int id){}
void set_formula_series(int ind,std::wstring val); void set_cache_only (bool val);
void set_values_series(int ind, std::vector<std::wstring> & val); void set_formula_series (int ind,std::wstring val);
void set_name(std::wstring val); void set_values_series (int ind, std::vector<std::wstring> & val);
void set_name (std::wstring val);
//void set_showBubbleSize(bool Val){data_labels_.set_showBubbleSize(Val);} //void set_showBubbleSize(bool Val){data_labels_.set_showBubbleSize(Val);}
//void set_showCatName(bool Val){data_labels_.set_showCatName(Val);} //void set_showCatName(bool Val){data_labels_.set_showCatName(Val);}
......
...@@ -160,6 +160,8 @@ void chart_build::docx_convert(oox::docx_conversion_context & Context) ...@@ -160,6 +160,8 @@ void chart_build::docx_convert(oox::docx_conversion_context & Context)
oox_convert(chart); oox_convert(chart);
chart.set_cache_only(true);
Context.end_chart(); Context.end_chart();
} }
else if (object_type_ == 2 && office_text_) else if (object_type_ == 2 && office_text_)
...@@ -197,6 +199,7 @@ void chart_build::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -197,6 +199,7 @@ void chart_build::pptx_convert(oox::pptx_conversion_context & Context)
oox_convert(chart); oox_convert(chart);
chart.set_cache_only(true);
Context.end_chart(); Context.end_chart();
} }
else if (object_type_ == 2 && office_text_) else if (object_type_ == 2 && office_text_)
...@@ -208,14 +211,14 @@ void chart_build::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -208,14 +211,14 @@ void chart_build::pptx_convert(oox::pptx_conversion_context & Context)
office_math_->pptx_convert(Context); office_math_->pptx_convert(Context);
} }
} }
void chart_build::calc_cash_series(std::wstring adress, std::vector<std::wstring> & cash) void chart_build::calc_cache_series(std::wstring adress, std::vector<std::wstring> & cash)
{ {
formulasconvert::odf2oox_converter converter; formulasconvert::odf2oox_converter converter;
std::wstring ref_1,ref_2,table; std::wstring ref_1, ref_2, table;
size_t col_1=0,row_1=0,col_2=0,row_2=0; size_t col_1=0, row_1=0, col_2=0, row_2=0;
if (!converter.find_first_last_ref(adress,table,ref_1,ref_2))return; if (!converter.find_first_last_ref(adress, table, ref_1, ref_2))return;
//if ((res = table.find(L"local-table"))<0)return; //if ((res = table.find(L"local-table"))<0)return;
oox::getCellAddressInv(ref_1,col_1,row_1); oox::getCellAddressInv(ref_1,col_1,row_1);
...@@ -260,7 +263,7 @@ void chart_build::oox_convert(oox::oox_chart_context & chart) ...@@ -260,7 +263,7 @@ void chart_build::oox_convert(oox::oox_chart_context & chart)
oox::oox_chart_ptr current = chart.get_current_chart(); oox::oox_chart_ptr current = chart.get_current_chart();
if (!current) continue; if (!current) continue;
current->set_properties(plot_area_.properties_); current->set_properties(plot_area_.properties_);
current->set_additional_properties(chart_graphic_properties_); current->set_additional_properties(chart_graphic_properties_);
...@@ -275,13 +278,13 @@ void chart_build::oox_convert(oox::oox_chart_context & chart) ...@@ -275,13 +278,13 @@ void chart_build::oox_convert(oox::oox_chart_context & chart)
// - = todooo // - = todooo
std::vector<std::wstring> cell_cash; std::vector<std::wstring> cell_cash;
calc_cash_series(s.cell_range_address_, cell_cash); calc_cache_series(s.cell_range_address_, cell_cash);
if (domain_cell_range_adress_.length() > 0) if (domain_cell_range_adress_.length() > 0)
{ {
std::vector<std::wstring> domain_cash; std::vector<std::wstring> domain_cash;
calc_cash_series(domain_cell_range_adress_,domain_cash); calc_cache_series(domain_cell_range_adress_,domain_cash);
if (last_set_type == chart_bubble) if (last_set_type == chart_bubble)
{ {
...@@ -309,7 +312,7 @@ void chart_build::oox_convert(oox::oox_chart_context & chart) ...@@ -309,7 +312,7 @@ void chart_build::oox_convert(oox::oox_chart_context & chart)
if (categories_.size() > 0)// if (categories_.size() > 0)//
{ {
std::vector<std::wstring> cat_cash; std::vector<std::wstring> cat_cash;
calc_cash_series(categories_[0], cat_cash); calc_cache_series(categories_[0], cat_cash);
current->set_formula_series(4,categories_[0]); current->set_formula_series(4,categories_[0]);
current->set_values_series(4,cat_cash); current->set_values_series(4,cat_cash);
...@@ -429,6 +432,11 @@ void process_build_chart::visit(const office_document_content& val) ...@@ -429,6 +432,11 @@ void process_build_chart::visit(const office_document_content& val)
if (val.office_body_) if (val.office_body_)
val.office_body_->accept(*this); val.office_body_->accept(*this);
} }
void process_build_chart::visit(office_document_content& val)
{
if (val.office_body_)
val.office_body_->accept(*this);
}
void process_build_chart::visit(office_body& val) void process_build_chart::visit(office_body& val)
{ {
if (val.content_) if (val.content_)
......
...@@ -109,7 +109,7 @@ public: ...@@ -109,7 +109,7 @@ public:
void add_point(unsigned int rep, std::wstring const & styleName); void add_point(unsigned int rep, std::wstring const & styleName);
void calc_cash_series(std::wstring adress, std::vector<std::wstring> & cash); void calc_cache_series(std::wstring adress, std::vector<std::wstring> & cash);
void xlsx_convert(oox::xlsx_conversion_context & Context); void xlsx_convert(oox::xlsx_conversion_context & Context);
void docx_convert(oox::docx_conversion_context & Context); void docx_convert(oox::docx_conversion_context & Context);
...@@ -174,7 +174,8 @@ public: ...@@ -174,7 +174,8 @@ public:
class process_build_chart : public base_visitor, class process_build_chart : public base_visitor,
public const_visitor<office_document_content>, public const_visitor<office_document_content>,
public visitor<office_document_content>,
public visitor<office_body>, public visitor<office_body>,
public visitor<office_chart>, public visitor<office_chart>,
public visitor<office_text>, public visitor<office_text>,
...@@ -246,6 +247,7 @@ private: ...@@ -246,6 +247,7 @@ private:
public: public:
virtual void visit(const office_document_content& val); virtual void visit(const office_document_content& val);
virtual void visit(office_document_content& val);
virtual void visit(office_body & val); virtual void visit(office_body & val);
virtual void visit(office_chart & val); virtual void visit(office_chart & val);
......
...@@ -52,7 +52,7 @@ namespace chart { ...@@ -52,7 +52,7 @@ namespace chart {
std::vector<_property> line_properties_; std::vector<_property> line_properties_;
simple equation_properties_; simple equation_properties_;
treadline(){bEquation = false;bREquation = false;} treadline(){bEquation = false; bREquation = false;}
}; };
struct plot_area : public simple struct plot_area : public simple
...@@ -75,10 +75,10 @@ namespace chart { ...@@ -75,10 +75,10 @@ namespace chart {
title title_; title title_;
std::wstring dimension_; std::wstring dimension_;
std::wstring chart_name_; std::wstring chart_name_;
std::wstring style_name_; std::wstring style_name_;
std::vector<grid> grids_; std::vector<grid> grids_;
}; };
struct series : public simple struct series : public simple
...@@ -92,26 +92,26 @@ namespace chart { ...@@ -92,26 +92,26 @@ namespace chart {
std::wstring style_name_; std::wstring style_name_;
}; };
std::wstring name_; std::wstring name_;
std::wstring cell_range_address_; std::wstring cell_range_address_;
std::wstring label_cell_address_; std::wstring label_cell_address_;
class_type class_; class_type class_;
std::wstring attached_axis_; std::wstring attached_axis_;
std::wstring style_name_; std::wstring style_name_;
std::vector<point> points_; std::vector<point> points_;
simple mean_value_; simple mean_value_;
simple error_indicator_; simple error_indicator_;
treadline regression_curve_; treadline regression_curve_;
series(){} series(){}
series( series(
std::wstring const & rangeAddress, std::wstring const & rangeAddress,
std::wstring const & labelCell, std::wstring const & labelCell,
class_type classType, class_type classType,
std::wstring const & attachedAxis, std::wstring const & attachedAxis,
std::wstring const & styleName std::wstring const & styleName
) : ) :
cell_range_address_(rangeAddress), cell_range_address_(rangeAddress),
label_cell_address_(labelCell), label_cell_address_(labelCell),
......
...@@ -99,7 +99,7 @@ void office_body::docx_convert(oox::docx_conversion_context & Context) ...@@ -99,7 +99,7 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
Context.get_headers_footers().set_enable_write(true); Context.get_headers_footers().set_enable_write(true);
if (!Context.get_section_context().dump_.empty()) if (!Context.get_section_context().dump_.empty() && !Context.get_table_context().in_table())
{ {
Context.output_stream() << Context.get_section_context().dump_; Context.output_stream() << Context.get_section_context().dump_;
Context.get_section_context().dump_.clear(); Context.get_section_context().dump_.clear();
......
...@@ -76,9 +76,14 @@ void style_chart_properties::add_attributes( const xml::attributes_wc_ptr & Attr ...@@ -76,9 +76,14 @@ void style_chart_properties::add_attributes( const xml::attributes_wc_ptr & Attr
CP_APPLY_ATTR(L"chart:error-lower-limit",dVal); if (dVal)content_.push_back(_property(L"error-lower-limit", dVal.get())); CP_APPLY_ATTR(L"chart:error-lower-limit",dVal); if (dVal)content_.push_back(_property(L"error-lower-limit", dVal.get()));
CP_APPLY_ATTR(L"chart:error-upper-limit",dVal); if (dVal)content_.push_back(_property(L"error-upper-limit", dVal.get())); CP_APPLY_ATTR(L"chart:error-upper-limit",dVal); if (dVal)content_.push_back(_property(L"error-upper-limit", dVal.get()));
CP_APPLY_ATTR(L"chart:axis-position", strVal);
if (strVal) content_.push_back(_property(L"axis-position", *strVal));
CP_APPLY_ATTR(L"chart:tick-mark-position", strVal);
if (strVal) content_.push_back(_property(L"tick-mark-position", *strVal));
CP_APPLY_ATTR(L"chart:interpolation", strVal); CP_APPLY_ATTR(L"chart:interpolation", strVal);
if (iVal)content_.push_back(_property(L"interpolation", chart_interpolation(chart_interpolation::parse(strVal.get())).get_type())); if (strVal)content_.push_back(_property(L"interpolation", chart_interpolation(chart_interpolation::parse(strVal.get())).get_type()));
CP_APPLY_ATTR(L"chart:solid-type", strVal); CP_APPLY_ATTR(L"chart:solid-type", strVal);
if (strVal)content_.push_back(_property(L"solid-type", chart_solid_type(chart_solid_type::parse(strVal.get())).get_type())); if (strVal)content_.push_back(_property(L"solid-type", chart_solid_type(chart_solid_type::parse(strVal.get())).get_type()));
......
...@@ -156,15 +156,18 @@ int process_paragraph_attr(const paragraph_attrs & Attr, oox::docx_conversion_co ...@@ -156,15 +156,18 @@ int process_paragraph_attr(const paragraph_attrs & Attr, oox::docx_conversion_co
const std::wstring id = Context.styles_map_.get( styleInst->name(), styleInst->type() ); const std::wstring id = Context.styles_map_.get( styleInst->name(), styleInst->type() );
std::wostream & _Wostream = Context.output_stream(); std::wostream & _Wostream = Context.output_stream();
_Wostream << L"<w:pPr>"; _Wostream << L"<w:pPr>";
if ( !Context.get_table_context().in_table())
{
_Wostream << Context.get_section_context().dump_; _Wostream << Context.get_section_context().dump_;
Context.get_section_context().dump_.clear(); Context.get_section_context().dump_.clear();
}
_Wostream << L"<w:pStyle w:val=\"" << id << L"\" />"; _Wostream << L"<w:pStyle w:val=\"" << id << L"\" />";
Context.docx_serialize_list_properties(_Wostream); Context.docx_serialize_list_properties(_Wostream);
_Wostream << L"</w:pPr>"; _Wostream << L"</w:pPr>";
return 2; return 2;
} }
} }
else if (!Context.get_section_context().dump_.empty()) else if (!Context.get_section_context().dump_.empty() && !Context.get_table_context().in_table())
{ {
Context.output_stream() << L"<w:pPr>"; Context.output_stream() << L"<w:pPr>";
Context.output_stream() << Context.get_section_context().dump_; Context.output_stream() << Context.get_section_context().dump_;
...@@ -173,7 +176,7 @@ int process_paragraph_attr(const paragraph_attrs & Attr, oox::docx_conversion_co ...@@ -173,7 +176,7 @@ int process_paragraph_attr(const paragraph_attrs & Attr, oox::docx_conversion_co
} }
return 3; return 3;
} }
else if (!Context.get_section_context().dump_.empty()) else if (!Context.get_section_context().dump_.empty() && !Context.get_table_context().in_table())
{ {
Context.output_stream() << L"<w:pPr>"; Context.output_stream() << L"<w:pPr>";
Context.output_stream() << Context.get_section_context().dump_; Context.output_stream() << Context.get_section_context().dump_;
......
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