Commit e43de8bc authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

куча второстепенных мелочей для диаграмм

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@56167 954022d7-b5bf-4e40-9824-e11837661b57
parent 86c4ff36
......@@ -37,6 +37,13 @@ namespace odf
int level;
};
struct odf_axis_state
{
unsigned int oox_id;
int dimension;//1 -x, 2, -y, 3 -z
std::wstring name;
office_element_ptr elm;
};
struct odf_chart_state
{
odf_chart_state() {clear();}
......@@ -44,19 +51,11 @@ namespace odf
{
elements_.clear();
chart_width_pt = chart_height_pt = 0;
categories_.clear();
axis_id=0;
}
double chart_width_pt;
double chart_height_pt;
std::vector<std::wstring> categories_;
std::vector<odf_element_state> elements_;
int axis_id;
std::vector<odf_element_state> elements_;
};
class odf_chart_context::Impl
{
......@@ -70,10 +69,15 @@ public:
current_graphic_properties_ = NULL;
current_chart_properties_ = NULL;
}
odf_chart_state current_chart_state_;
odf_chart_state current_chart_state_;
std::vector<std::wstring> categories_;
std::vector<odf_axis_state> axis_;
std::vector<office_element_ptr> group_series_;
std::vector<unsigned int> axis_group_series_;
std::vector<office_element_ptr> current_level_; //
std::vector<odf_chart_state> chart_list_; // .. ""
std::vector<office_element_ptr> current_level_; //
std::vector<odf_chart_state> chart_list_; // .. ""
odf_style_context *styles_context_;
odf_conversion_context *odf_context_;
......@@ -85,8 +89,6 @@ public:
chart_chart *get_current_chart();
chart_axis *get_current_axis();
//chart_seris *get_current_series();
//chart_plot_area *get_current_plot_area();
};
chart_chart* odf_chart_context::Impl::get_current_chart()
{
......@@ -97,21 +99,12 @@ chart_chart* odf_chart_context::Impl::get_current_chart()
}
return NULL;
}
//chart_seris* odf_chart_context::Impl::odf_chart_context::get_current_series()
//{
//}
chart_axis * odf_chart_context::Impl::get_current_axis()
{
for (long i=current_chart_state_.elements_.size()-1; i>=0; i--)
{
chart_axis * axis = dynamic_cast<chart_axis*>(current_chart_state_.elements_[i].elm.get());
if (axis) return axis;
}
if (axis_.size() > 0) return dynamic_cast<chart_axis*>(axis_.back().elm.get());
return NULL;
}
//chart_plot_area* odf_chart_context::Impl::get_current_plot_area()
//{
//}
////////////////////////////////////////////////////////////////////////////
odf_chart_context::odf_chart_context(odf_conversion_context *odf_context)
......@@ -199,12 +192,15 @@ void odf_chart_context::set_3D(bool Val)
if (!impl_->current_chart_properties_) return;
impl_->current_chart_properties_->content().chart_three_dimensional_ = Val;
}
void odf_chart_context::start_group_series()
{
}
void odf_chart_context::start_series(std::wstring type)
{
office_element_ptr chart_elm;
create_element(L"chart", L"series", chart_elm, impl_->odf_context_);
office_element_ptr elm;
create_element(L"chart", L"series", elm, impl_->odf_context_);
chart_series *series = dynamic_cast<chart_series*>(chart_elm.get());
chart_series *series = dynamic_cast<chart_series*>(elm.get());
if (series == NULL)return;
//////////
impl_->styles_context_->create_style(L"",style_family::Chart, true, false, -1);
......@@ -220,9 +216,73 @@ void odf_chart_context::start_series(std::wstring type)
series->chart_series_attlist_.common_attlist_.chart_style_name_ = style_name;
series->chart_series_attlist_.chart_class_ = std::wstring(L"chart:") + type;
}
start_element(chart_elm, style_elm, style_name);
start_element(elm, style_elm, style_name);
impl_->group_series_.push_back(elm);
}
void odf_chart_context::set_label_delete(bool val)
{
if (!impl_->current_chart_properties_)return;
impl_->current_chart_properties_->content().chart_display_label_ = !val;
}
void odf_chart_context::set_label_show_bubble_size(bool val)
{
}
void odf_chart_context::set_label_show_cat_name(bool val)
{
}
void odf_chart_context::set_label_show_leader_line(bool val)
{
}
void odf_chart_context::set_label_show_legend_key(bool val)
{
}
void odf_chart_context::set_label_show_percent(bool val)
{
if (!impl_->current_chart_properties_)return;
impl_->current_chart_properties_->content().chart_percentage_ = val;
}
void odf_chart_context::set_label_show_ser_name(bool val)
{
}
void odf_chart_context::set_label_show_values(bool val)
{
if (!impl_->current_chart_properties_ || !val)return;
impl_->current_chart_properties_->content().chart_data_label_number_=chart_data_label_number(chart_data_label_number::value);
}
void odf_chart_context::add_axis_group_series(unsigned int id)
{
impl_->axis_group_series_.push_back(id);
}
void odf_chart_context::end_group_series()
{
std::wstring axis_name;
for (long i=0; i < impl_->axis_group_series_.size(); i++)
{
for (long j = 0; j < impl_->axis_.size(); j++)
{
if (impl_->axis_[j].dimension ==1)continue;
if (impl_->axis_[j].oox_id == impl_->axis_group_series_[i])
{
axis_name = impl_->axis_[j].name;
break;
}
}
if (axis_name.length() > 0)break;
}
for (long i =0; i < impl_->group_series_.size() && axis_name.length() > 0; i++)
{
chart_series *series= dynamic_cast<chart_series*>(impl_->group_series_[i].get());
if (series)
{
series->chart_series_attlist_.chart_attached_axis_ = axis_name;
}
}
impl_->group_series_.clear();
impl_->axis_group_series_.clear();
}
void odf_chart_context::add_categories(std::wstring formula)
void odf_chart_context::add_categories(std::wstring formula, office_element_ptr & axis)
{
office_element_ptr elm;
create_element(L"chart", L"categories", elm, impl_->odf_context_);
......@@ -234,8 +294,7 @@ void odf_chart_context::add_categories(std::wstring formula)
int level = impl_->current_level_.size();
if (impl_->current_level_.size()>0)
impl_->current_level_.back()->add_child_element(elm);
if (axis)axis->add_child_element(elm);
odf_element_state state={elm, L"",office_element_ptr(), level};
impl_->current_chart_state_.elements_.push_back(state);
......@@ -243,10 +302,10 @@ void odf_chart_context::add_categories(std::wstring formula)
void odf_chart_context::start_axis()
{
office_element_ptr chart_elm;
create_element(L"chart", L"axis", chart_elm, impl_->odf_context_);
office_element_ptr elm;
create_element(L"chart", L"axis", elm, impl_->odf_context_);
chart_axis *axis = dynamic_cast<chart_axis*>(chart_elm.get());
chart_axis *axis = dynamic_cast<chart_axis*>(elm.get());
if (axis == NULL)return;
//////////
impl_->styles_context_->create_style(L"",style_family::Chart, true, false, -1);
......@@ -261,14 +320,12 @@ void odf_chart_context::start_axis()
style_name = style_->style_name_;
axis->chart_axis_attlist_.common_attlist_.chart_style_name_ = style_name;
}
start_element(chart_elm, style_elm, style_name);
start_element(elm, style_elm, style_name);
if (impl_->current_chart_state_.axis_id < impl_->current_chart_state_.categories_.size() &&
impl_->current_chart_state_.categories_[impl_->current_chart_state_.axis_id].length() > 0)
{
add_categories(impl_->current_chart_state_.categories_[impl_->current_chart_state_.axis_id]);
}
impl_->current_chart_state_.axis_id++;
odf_axis_state axis_state={0,0,L"",elm};
impl_->axis_.push_back(axis_state);
/////////////////////defaults
impl_->current_chart_properties_->content().chart_reverse_direction_ = false;
}
void odf_chart_context::start_grid(int type)
{
......@@ -326,7 +383,7 @@ void odf_chart_context::start_plot_area()
chart_plot_area *plot_area = dynamic_cast<chart_plot_area*>(chart_elm.get());
if (plot_area == NULL)return;
plot_area->chart_plot_area_attlist_.chart_data_source_has_labels_ = L"both";
//plot_area->chart_plot_area_attlist_.chart_data_source_has_labels_ = L"both";
//////////
impl_->styles_context_->create_style(L"",style_family::Chart, true, false, -1);
......@@ -444,19 +501,43 @@ void odf_chart_context::set_axis_orientation(int type)
if (!impl_->current_chart_properties_)return;
if (type == 0) impl_->current_chart_properties_->content().chart_reverse_direction_ = true;
}
void odf_chart_context::set_axis_max(double val)
{
if (!impl_->current_chart_properties_)return;
impl_->current_chart_properties_->content().chart_maximum_ = val;
}
void odf_chart_context::set_axis_min(double val)
{
if (!impl_->current_chart_properties_)return;
impl_->current_chart_properties_->content().chart_minimum_ = val;
}
void odf_chart_context::set_axis_logarithmic(bool val)
{
if (!impl_->current_chart_properties_)return;
impl_->current_chart_properties_->content().chart_logarithmic_ = val;
}
void odf_chart_context::set_axis_dimension(std::wstring val)
void odf_chart_context::set_axis_id(unsigned int id)
{
if (impl_->axis_.size()>0)impl_->axis_.back().oox_id = id;
}
void odf_chart_context::set_axis_dimension(int type)
{
chart_axis *axis = impl_->get_current_axis();
if (!axis)return;
std::wstring val;
if (type == 1) val = L"x";
if (type == 2) val = L"y";
if (type == 3) val = L"z";
axis->chart_axis_attlist_.chart_dimension_ = val;
axis->chart_axis_attlist_.chart_name_ = std::wstring(L"primary-") + val; // -
axis->chart_axis_attlist_.chart_name_ = std::wstring(L"axis-") + boost::lexical_cast<std::wstring>(impl_->axis_.size()+1);
if (impl_->axis_.size()>0)
{
impl_->axis_.back().dimension = type;
impl_->axis_.back().name = *axis->chart_axis_attlist_.chart_name_;
}
}
void odf_chart_context::set_axis_position(int type)
{
......@@ -590,16 +671,22 @@ void odf_chart_context::end_chart()
if (impl_->current_chart_state_.elements_.size() < 1) return;
end_element();
///////////////////
for (long i=0; i< impl_->axis_.size() && impl_->categories_.size() > 0; i++)
{
if (impl_->axis_[i].elm == NULL)continue;
add_categories(impl_->categories_[0],impl_->axis_[i].elm);
}
///////////////
impl_->chart_list_.push_back(impl_->current_chart_state_);
impl_->current_chart_state_.clear();
impl_->categories_.clear();
impl_->axis_.clear();
impl_->group_series_.clear();
}
static formulasconvert::oox2odf_converter formulas_converter;
void odf_chart_context::set_series_name(std::wstring name)
{
}
void odf_chart_context::set_series_value_formula(std::wstring oox_formula)
{
std::wstring odfFormula = formulas_converter.convert_chart_distance(oox_formula);
......@@ -622,7 +709,7 @@ void odf_chart_context::set_category_axis_formula(std::wstring oox_formula)
{
std::wstring odfFormula = formulas_converter.convert_chart_distance(oox_formula);
impl_->current_chart_state_.categories_.push_back(odfFormula);
impl_->categories_.push_back(odfFormula);
}
}
}
\ No newline at end of file
......@@ -34,19 +34,34 @@ public:
void set_3D(bool Val);
void set_size_chart(double width_pt, double height_pt);
void start_series(std::wstring type);
void set_series_value_formula(std::wstring oox_formula);
void set_series_label_formula(std::wstring oox_formula);
void set_series_name(std::wstring name);
void set_category_axis_formula(std::wstring oox_formula);
void start_group_series();
void add_axis_group_series(unsigned int id);
void start_series(std::wstring type);
void set_series_value_formula(std::wstring oox_formula);
void set_series_label_formula(std::wstring oox_formula);
void set_category_axis_formula(std::wstring oox_formula);
void end_group_series();
void set_label_name(std::wstring name);
void set_label_delete(bool val);
void set_label_show_bubble_size(bool val);
void set_label_show_cat_name(bool val);
void set_label_show_leader_line(bool val);
void set_label_show_legend_key(bool val);
void set_label_show_percent(bool val);
void set_label_show_ser_name(bool val);
void set_label_show_values(bool val);
void start_axis();
void set_axis_dimension(std::wstring val);
void set_axis_id(unsigned int id);
void set_axis_dimension(int type);
void set_axis_orientation(int type);
void set_axis_logarithmic(bool val);
void set_axis_label(int type);
void set_axis_position(int type);
void set_axis_label_position(int type);
void set_axis_max(double val);
void set_axis_min(double val);
void start_title();
void start_grid(int type);
void start_plot_area();
......@@ -59,7 +74,7 @@ public:
void start_text();
void end_text();
void add_categories(std::wstring formula);
void add_categories(std::wstring formula, office_element_ptr & axis);
void set_layout_x(double *val,int mode);
void set_layout_y(double *val,int mode);
......
......@@ -375,8 +375,8 @@ void OoxConverter::convert(OOX::Drawing::CGradientFillProperties *oox_grad_fill)
std::wstring hexColorStart, hexColorEnd;
_CP_OPT(double) opacityStart, opacityEnd;
convert((OOX::Drawing::CColor*)(&oox_grad_fill->m_oGsLst->m_arrGs[oox_grad_fill->m_oGsLst->m_arrGs.GetSize()-1]),hexColorStart, opacityStart);
convert((OOX::Drawing::CColor*)(&oox_grad_fill->m_oGsLst->m_arrGs[0]),hexColorEnd, opacityEnd);
convert((OOX::Drawing::CColor*)(&oox_grad_fill->m_oGsLst->m_arrGs[0]),hexColorStart, opacityStart);
convert((OOX::Drawing::CColor*)(&oox_grad_fill->m_oGsLst->m_arrGs[oox_grad_fill->m_oGsLst->m_arrGs.GetSize()-1]),hexColorEnd, opacityEnd);
odf_context()->drawing_context()->set_gradient_start(hexColorStart, opacityStart);
odf_context()->drawing_context()->set_gradient_end(hexColorEnd, opacityEnd);
......
......@@ -302,6 +302,7 @@ public:
void convert(OOX::Spreadsheet::CT_ManualLayout *ct_layout);
void convert(OOX::Spreadsheet::CT_ChartLines *grid, int type);
void convert(OOX::Spreadsheet::CT_SerTx *ser_tx);
void convert(OOX::Spreadsheet::CT_DLbls *ser_lbls);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
void convert(double oox_font_size, cpdoccore::_CP_OPT(cpdoccore::odf::font_size) & odf_font_size);
};
......
......@@ -129,6 +129,17 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_PlotArea* ct_plotArea)
convert(ct_plotArea->m_oSpPr.GetPointer());
convert(ct_plotArea->m_layout);
///////////////////////
for (long i=0; i< ct_plotArea->m_Items1.GetCount(); i++)
{
if (!ct_plotArea->m_ItemsElementName1[i]) continue;
switch(*ct_plotArea->m_ItemsElementName1[i])
{
case OOX::Spreadsheet::itemschoicetype6CATAX: convert((OOX::Spreadsheet::CT_CatAx*)ct_plotArea->m_Items1[i]);break;
case OOX::Spreadsheet::itemschoicetype6DATEAX: convert((OOX::Spreadsheet::CT_DateAx*)ct_plotArea->m_Items1[i]);break;
case OOX::Spreadsheet::itemschoicetype6SERAX: convert((OOX::Spreadsheet::CT_SerAx*)ct_plotArea->m_Items1[i]);break;
case OOX::Spreadsheet::itemschoicetype6VALAX: convert((OOX::Spreadsheet::CT_ValAx*)ct_plotArea->m_Items1[i]);break;
}
}
for (long i=0; i< ct_plotArea->m_Items.GetCount(); i++)//
{
if (!ct_plotArea->m_ItemsElementName0[i]) continue;
......@@ -152,17 +163,6 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_PlotArea* ct_plotArea)
case OOX::Spreadsheet::itemschoicetype5SURFACECHART: convert((OOX::Spreadsheet::CT_SurfaceChart*) ct_plotArea->m_Items[i]);break;
}
}
for (long i=0; i< ct_plotArea->m_Items1.GetCount(); i++)
{
if (!ct_plotArea->m_ItemsElementName1[i]) continue;
switch(*ct_plotArea->m_ItemsElementName1[i])
{
case OOX::Spreadsheet::itemschoicetype6CATAX: convert((OOX::Spreadsheet::CT_CatAx*)ct_plotArea->m_Items1[i]);break;
case OOX::Spreadsheet::itemschoicetype6DATEAX: convert((OOX::Spreadsheet::CT_DateAx*)ct_plotArea->m_Items1[i]);break;
case OOX::Spreadsheet::itemschoicetype6SERAX: convert((OOX::Spreadsheet::CT_SerAx*)ct_plotArea->m_Items1[i]);break;
case OOX::Spreadsheet::itemschoicetype6VALAX: convert((OOX::Spreadsheet::CT_ValAx*)ct_plotArea->m_Items1[i]);break;
}
}
if (ct_plotArea->m_dTable)
{
}
......@@ -174,7 +174,9 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_CatAx* axis)
if (axis == NULL)return;
odf_context()->chart_context()->start_axis();
odf_context()->chart_context()->set_axis_dimension(L"x");
odf_context()->chart_context()->set_axis_dimension(1);
if (axis->m_axId && axis->m_axId->m_val)
odf_context()->chart_context()->set_axis_id(*axis->m_axId->m_val);
convert(axis->m_oSpPr.GetPointer());
if (axis->m_scaling)
{
......@@ -182,8 +184,8 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_CatAx* axis)
odf_context()->chart_context()->set_axis_logarithmic(true);
if (axis->m_scaling->m_orientation && axis->m_scaling->m_orientation->m_val)
odf_context()->chart_context()->set_axis_orientation(*axis->m_scaling->m_orientation->m_val);
if (axis->m_scaling->m_min){}
if (axis->m_scaling->m_max){}
if (axis->m_scaling->m_min && axis->m_scaling->m_min->m_val) odf_context()->chart_context()->set_axis_min(*axis->m_scaling->m_min->m_val);
if (axis->m_scaling->m_max && axis->m_scaling->m_max->m_val) odf_context()->chart_context()->set_axis_max(*axis->m_scaling->m_max->m_val);
}
if (axis->m_majorTickMark)odf_context()->chart_context()->set_axis_label(1);
if (axis->m_minorTickMark)odf_context()->chart_context()->set_axis_label(2);
......@@ -204,7 +206,9 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_DateAx* axis)
if (axis == NULL)return;
odf_context()->chart_context()->start_axis();
odf_context()->chart_context()->set_axis_dimension(L"x");
odf_context()->chart_context()->set_axis_dimension(1);
if (axis->m_axId && axis->m_axId->m_val)
odf_context()->chart_context()->set_axis_id(*axis->m_axId->m_val);
convert(axis->m_oSpPr.GetPointer());
if (axis->m_scaling)
{
......@@ -212,8 +216,9 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_DateAx* axis)
odf_context()->chart_context()->set_axis_logarithmic(true);
if (axis->m_scaling->m_orientation && axis->m_scaling->m_orientation->m_val)
odf_context()->chart_context()->set_axis_orientation(*axis->m_scaling->m_orientation->m_val);
if (axis->m_scaling->m_min){}
if (axis->m_scaling->m_max){}
if (axis->m_scaling->m_min && axis->m_scaling->m_min->m_val) odf_context()->chart_context()->set_axis_min(*axis->m_scaling->m_min->m_val);
if (axis->m_scaling->m_max && axis->m_scaling->m_max->m_val) odf_context()->chart_context()->set_axis_max(*axis->m_scaling->m_max->m_val);
}
if (axis->m_majorTickMark)odf_context()->chart_context()->set_axis_label(1);
if (axis->m_minorTickMark)odf_context()->chart_context()->set_axis_label(2);
......@@ -231,7 +236,9 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_SerAx* axis)
if (axis == NULL)return;
odf_context()->chart_context()->start_axis();
odf_context()->chart_context()->set_axis_dimension(L"x");
odf_context()->chart_context()->set_axis_dimension(1);
if (axis->m_axId && axis->m_axId->m_val)
odf_context()->chart_context()->set_axis_id(*axis->m_axId->m_val);
convert(axis->m_oSpPr.GetPointer());
if (axis->m_scaling)
{
......@@ -239,8 +246,8 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_SerAx* axis)
odf_context()->chart_context()->set_axis_logarithmic(true);
if (axis->m_scaling->m_orientation && axis->m_scaling->m_orientation->m_val)
odf_context()->chart_context()->set_axis_orientation(*axis->m_scaling->m_orientation->m_val);
if (axis->m_scaling->m_min){}
if (axis->m_scaling->m_max){}
if (axis->m_scaling->m_min && axis->m_scaling->m_min->m_val) odf_context()->chart_context()->set_axis_min(*axis->m_scaling->m_min->m_val);
if (axis->m_scaling->m_max && axis->m_scaling->m_max->m_val) odf_context()->chart_context()->set_axis_max(*axis->m_scaling->m_max->m_val);
}
if (axis->m_majorTickMark)odf_context()->chart_context()->set_axis_label(1);
if (axis->m_minorTickMark)odf_context()->chart_context()->set_axis_label(2);
......@@ -258,7 +265,9 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ValAx* axis)
if (axis == NULL)return;
odf_context()->chart_context()->start_axis();
odf_context()->chart_context()->set_axis_dimension(L"y");
odf_context()->chart_context()->set_axis_dimension(2);
if (axis->m_axId && axis->m_axId->m_val)
odf_context()->chart_context()->set_axis_id(*axis->m_axId->m_val);
convert(axis->m_oSpPr.GetPointer());
if (axis->m_scaling)
{
......@@ -266,8 +275,8 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ValAx* axis)
odf_context()->chart_context()->set_axis_logarithmic(true);
if (axis->m_scaling->m_orientation && axis->m_scaling->m_orientation->m_val)
odf_context()->chart_context()->set_axis_orientation(*axis->m_scaling->m_orientation->m_val);
if (axis->m_scaling->m_min){}
if (axis->m_scaling->m_max){}
if (axis->m_scaling->m_min && axis->m_scaling->m_min->m_val)odf_context()->chart_context()->set_axis_min(*axis->m_scaling->m_min->m_val);
if (axis->m_scaling->m_max && axis->m_scaling->m_max->m_val)odf_context()->chart_context()->set_axis_max(*axis->m_scaling->m_max->m_val);
}
if (axis->m_majorTickMark)odf_context()->chart_context()->set_axis_label(1);
if (axis->m_minorTickMark)odf_context()->chart_context()->set_axis_label(2);
......@@ -281,6 +290,15 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ValAx* axis)
odf_context()->chart_context()->end_element();
}
////////////////////////////////////////////////////////////////////////////////////////////
void OoxConverter::convert(OOX::Spreadsheet::CT_ChartLines *grid, int type)
{
if (grid == NULL)return;
odf_context()->chart_context()->start_grid(type);
convert(grid->m_oSpPr.GetPointer());
odf_context()->chart_context()->end_element();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_Area3DChart *chart)
{
if (chart == NULL)return;
......@@ -293,24 +311,24 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Area3DChart *chart)
convert(chart->m_ser[i]);
}
}
void OoxConverter::convert(OOX::Spreadsheet::CT_ChartLines *grid, int type)
{
if (grid == NULL)return;
odf_context()->chart_context()->start_grid(type);
convert(grid->m_oSpPr.GetPointer());
odf_context()->chart_context()->end_element();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_AreaChart *chart)
{
if (chart == NULL)return;
odf_context()->chart_context()->set_type_chart(L"area");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
for (long i=0; i< chart->m_axId.GetCount(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_Bar3DChart *chart)
{
......@@ -319,10 +337,18 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Bar3DChart *chart)
odf_context()->chart_context()->set_type_chart(L"bar");
odf_context()->chart_context()->set_3D(true);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
for (long i=0; i< chart->m_axId.GetCount(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_BarChart *chart)
{
......@@ -330,20 +356,35 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_BarChart *chart)
odf_context()->chart_context()->set_type_chart(L"bar");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
for (long i=0; i< chart->m_axId.GetCount(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_Line3DChart *chart)
{
odf_context()->chart_context()->set_type_chart(L"line");
odf_context()->chart_context()->set_3D(true);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
for (long i=0; i< chart->m_axId.GetCount(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_LineChart *chart)
{
......@@ -351,10 +392,17 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_LineChart *chart)
odf_context()->chart_context()->set_type_chart(L"line");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
for (long i=0; i< chart->m_axId.GetCount(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_Pie3DChart *chart)
{
......@@ -363,10 +411,17 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Pie3DChart *chart)
odf_context()->chart_context()->set_type_chart(L"circle");
odf_context()->chart_context()->set_3D(true);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
//for (long i=0; i< chart->m_axId.GetCount(); i++)
//{
// odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
//}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_PieChart *chart)
{
......@@ -374,10 +429,17 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_PieChart *chart)
odf_context()->chart_context()->set_type_chart(L"circle");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
//for (long i=0; i< chart->m_axId.GetCount(); i++)
//{
// odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
//}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_Surface3DChart *chart)
{
......@@ -386,10 +448,16 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Surface3DChart *chart)
odf_context()->chart_context()->set_type_chart(L"surface");
odf_context()->chart_context()->set_3D(true);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
for (long i=0; i< chart->m_axId.GetCount(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_SurfaceChart *chart)
{
......@@ -397,10 +465,16 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_SurfaceChart *chart)
odf_context()->chart_context()->set_type_chart(L"surface");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
for (long i=0; i< chart->m_axId.GetCount(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_BubbleChart *chart)
{
......@@ -408,10 +482,17 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_BubbleChart *chart)
odf_context()->chart_context()->set_type_chart(L"bubble");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
for (long i=0; i< chart->m_axId.GetCount(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_DoughnutChart *chart)
{
......@@ -419,10 +500,17 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_DoughnutChart *chart)
odf_context()->chart_context()->set_type_chart(L"ring");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
//for (long i=0; i< chart->m_axId.GetCount(); i++)
//{
// odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
//}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_ScatterChart *chart)
{
......@@ -430,10 +518,17 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ScatterChart *chart)
odf_context()->chart_context()->set_type_chart(L"scatter");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
for (long i=0; i< chart->m_axId.GetCount(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_RadarChart *chart)
{
......@@ -441,10 +536,17 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_RadarChart *chart)
odf_context()->chart_context()->set_type_chart(L"radar");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
//for (long i=0; i< chart->m_axId.GetCount(); i++)
//{
// odf_context()->chart_context()->add_axis_group_series(**chart->m_axId[i]->m_val->m_val);
//}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_StockChart *chart)
{
......@@ -452,10 +554,17 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_StockChart *chart)
odf_context()->chart_context()->set_type_chart(L"stock");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
for (long i=0; i< chart->m_axId.GetCount(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_OfPieChart *chart)
{
......@@ -463,15 +572,23 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_OfPieChart *chart)
odf_context()->chart_context()->set_type_chart(L"circle");
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
}
//for (long i=0; i< chart->m_axId.GetCount(); i++)
//{
// odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
//}
odf_context()->chart_context()->end_group_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_AreaSer* ser)
{
odf_context()->chart_context()->start_series(L"area");
convert(ser->m_oSpPr.GetPointer());
convert(ser->m_dLbls);
convert(ser->m_cat);
convert(ser->m_val);
convert(ser->m_tx);
......@@ -483,8 +600,9 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_BubbleSer* ser)
odf_context()->chart_context()->start_series(L"bubble");
convert(ser->m_oSpPr.GetPointer());
convert(ser->m_xVal/*, 1*/);
convert(ser->m_yVal/*, 2*/);
convert(ser->m_dLbls);
convert(ser->m_xVal);
convert(ser->m_yVal);
convert(ser->m_tx);
odf_context()->chart_context()->end_element();
}
......@@ -505,6 +623,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_PieSer* ser)
odf_context()->chart_context()->start_series(L"circle");
convert(ser->m_oSpPr.GetPointer());
convert(ser->m_dLbls);
convert(ser->m_cat);
convert(ser->m_val);
convert(ser->m_tx);
......@@ -516,6 +635,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_BarSer* ser)
odf_context()->chart_context()->start_series(L"bar");
convert(ser->m_oSpPr.GetPointer());
convert(ser->m_dLbls);
convert(ser->m_cat);
convert(ser->m_val);
convert(ser->m_tx);
......@@ -527,8 +647,9 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ScatterSer* ser)
odf_context()->chart_context()->start_series(L"scatter");
convert(ser->m_oSpPr.GetPointer());
convert(ser->m_xVal/*, 1*/);
convert(ser->m_yVal/*, 2*/);
convert(ser->m_dLbls);
convert(ser->m_xVal);
convert(ser->m_yVal);
convert(ser->m_tx);
odf_context()->chart_context()->end_element();
}
......@@ -538,6 +659,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_RadarSer* ser)
odf_context()->chart_context()->start_series(L"radar");
convert(ser->m_oSpPr.GetPointer());
convert(ser->m_dLbls);
convert(ser->m_cat);
convert(ser->m_val);
convert(ser->m_tx);
......@@ -549,11 +671,52 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_LineSer* ser)
odf_context()->chart_context()->start_series(L"line");
convert(ser->m_oSpPr.GetPointer());
convert(ser->m_dLbls);
convert(ser->m_cat);
convert(ser->m_val);
convert(ser->m_tx);
odf_context()->chart_context()->end_element();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_DLbls* ser_lbls)
{
if (ser_lbls == NULL)return;
for (long i=0; i< ser_lbls->m_Items.GetCount(); i++)
{
bool boolVal = false;
OOX::Spreadsheet::CT_Boolean * ct_boolean = (OOX::Spreadsheet::CT_Boolean*)ser_lbls->m_Items[i];
if (ct_boolean && ct_boolean->m_val) boolVal = * ct_boolean->m_val;
switch(*ser_lbls->m_ItemsElementName0[i])
{
case OOX::Spreadsheet::itemschoicetype3DELETE :
odf_context()->chart_context()->set_label_delete(boolVal); break;
case OOX::Spreadsheet::itemschoicetype3SHOWBUBBLESIZE:
odf_context()->chart_context()->set_label_show_bubble_size(boolVal); break;
case OOX::Spreadsheet::itemschoicetype3SHOWCATNAME:
odf_context()->chart_context()->set_label_show_cat_name(boolVal); break;
case OOX::Spreadsheet::itemschoicetype3SHOWLEADERLINES:
odf_context()->chart_context()->set_label_show_leader_line(boolVal); break;
case OOX::Spreadsheet::itemschoicetype3SHOWLEGENDKEY:
odf_context()->chart_context()->set_label_show_legend_key(boolVal); break;
case OOX::Spreadsheet::itemschoicetype3SHOWPERCENT:
odf_context()->chart_context()->set_label_show_percent(boolVal); break;
case OOX::Spreadsheet::itemschoicetype3SHOWSERNAME:
odf_context()->chart_context()->set_label_show_ser_name(boolVal); break;
case OOX::Spreadsheet::itemschoicetype3SHOWVAL:
odf_context()->chart_context()->set_label_show_values(boolVal); break;
//case OOX::Spreadsheet::itemschoicetype3SPPR: convert((OOX::Spreadsheet:: *)ser_lbls->m_Items[i]); break;
//case OOX::Spreadsheet::itemschoicetype3TXPR: convert((OOX::Spreadsheet:: *)ser_lbls->m_Items[i]); break;
//case OOX::Spreadsheet::itemschoicetype3DLBLPOS: convert((OOX::Spreadsheet:: *)ser_lbls->m_Items[i]); break;
//case OOX::Spreadsheet::itemschoicetype3LEADERLINES: convert((OOX::Spreadsheet::CT_ChartLines *)ser_lbls->m_Items[i]); break;
//case OOX::Spreadsheet::itemschoicetype3NUMFMT: convert((OOX::Spreadsheet:: *)ser_lbls->m_Items[i]); break;
//case OOX::Spreadsheet::itemschoicetype3SEPARATOR: convert((OOX::Spreadsheet:: *)ser_lbls->m_Items[i]); break;
}
}
}
void OoxConverter::convert(OOX::Spreadsheet::CT_SerTx* ser_tx)
{
if (ser_tx == NULL)return;
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//40
#define INTVER 1,2,0,40
#define STRVER "1,2,0,40\0"
//41
#define INTVER 1,2,0,41
#define STRVER "1,2,0,41\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