Commit 4fda6101 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatWriter - convert smart art

parent 99822fb5
......@@ -465,7 +465,7 @@ public:
void serialize(CP_ATTR_NODE);
_CP_OPT(horizontal_pos) style_horizontal_pos_;
_CP_OPT(length) svg_x_;
_CP_OPT(length) svg_x_;
};
......@@ -477,10 +477,10 @@ public:
void apply_from(const common_draw_style_name_attlist & Other);
void serialize(CP_ATTR_NODE);
_CP_OPT(style_ref) draw_style_name_;
_CP_OPT(std::wstring) draw_class_names_;
_CP_OPT(style_ref) presentation_style_name_;
_CP_OPT(std::wstring) presentation_class_names_;
_CP_OPT(style_ref) draw_style_name_;
_CP_OPT(std::wstring) draw_class_names_;
_CP_OPT(style_ref) presentation_style_name_;
_CP_OPT(std::wstring) presentation_class_names_;
};
......@@ -606,8 +606,8 @@ public:
void apply_from(const common_draw_shape_with_text_and_styles_attlist & Other);
void serialize(CP_ATTR_NODE);
common_draw_shape_with_styles_attlist common_draw_shape_with_styles_attlist_;
common_draw_text_style_name_attlist common_draw_text_style_name_attlist_;
common_draw_shape_with_styles_attlist common_draw_shape_with_styles_attlist_;
common_draw_text_style_name_attlist common_draw_text_style_name_attlist_;
};
/// presentation-shape-attlist
......@@ -618,9 +618,9 @@ public:
void apply_from(const presentation_shape_attlist & Other);
void serialize(CP_ATTR_NODE);
_CP_OPT(std::wstring) presentation_class_;
_CP_OPT(Bool) presentation_placeholder_;
_CP_OPT(Bool) presentation_user_transformed_;
_CP_OPT(std::wstring) presentation_class_;
_CP_OPT(Bool) presentation_placeholder_;
_CP_OPT(Bool) presentation_user_transformed_;
};
......
......@@ -80,7 +80,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"" , 7}, // shapetypeChartX,
{ L"chevron" , 7}, // shapetypeChevron,
{ L"" , 7}, // shapetypeChord,
{ L"circular-arrow" , 7}, // shapetypeCircularArrow,
{ L"" , 7}, // shapetypeCircularArrow,
{ L"cloud" , 7}, // shapetypeCloud,
{ L"cloud-callout" , 7}, // shapetypeCloudCallout,
{ L"" , 7}, // shapetypeCorner,
......
......@@ -29,6 +29,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../oox_shape_defines.h"
// shapetypeAccentBorderCallout1,
// shapetypeAccentBorderCallout2,
// shapetypeAccentBorderCallout3,
......@@ -344,7 +344,7 @@ void odf_chart_context::start_chart(office_element_ptr & root)
std::wstring style_name;
odf_element_state state={chart_elm, style_name, style_elm, level};
odf_chart_level_state level_state = {NULL,NULL,NULL,NULL,chart_elm};
odf_chart_level_state level_state = {NULL, NULL, NULL, NULL, chart_elm};
style* style_ = dynamic_cast<style*>(style_elm.get());
if (style_)
......@@ -366,18 +366,18 @@ void odf_chart_context::start_chart(office_element_ptr & root)
impl_->current_chart_state_.elements_.push_back(state);
}
void odf_chart_context::set_chart_size(double width_pt, double height_pt)
void odf_chart_context::set_chart_size(_CP_OPT(double) width_pt, _CP_OPT(double) height_pt)
{
if (width_pt <0.01 || height_pt < 0.01)return;
if (!width_pt && !height_pt) return;
impl_->current_chart_state_.chart_height_pt = height_pt;
impl_->current_chart_state_.chart_width_pt = width_pt;
impl_->current_chart_state_.chart_height_pt = *height_pt;
impl_->current_chart_state_.chart_width_pt = *width_pt;
chart_chart *chart = impl_->get_current_chart();
if (!chart)return;
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_width_ = length(length(width_pt,length::pt).get_value_unit(length::cm),length::cm);
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_height_ = length(length(height_pt,length::pt).get_value_unit(length::cm),length::cm);
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_width_ = length(length(*width_pt,length::pt).get_value_unit(length::cm), length::cm);
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_height_ = length(length(*height_pt,length::pt).get_value_unit(length::cm), length::cm);
}
void odf_chart_context::set_chart_type(std::wstring type)
{
......
......@@ -58,19 +58,19 @@ public:
odf_drawing_context *drawing_context();
odf_text_context *text_context();
void start_chart(office_element_ptr & root);
void set_chart_type(std::wstring type);
void set_chart_3D(bool Val);
void set_chart_size(double width_pt, double height_pt);
void set_chart_colored(bool val);
void set_chart_grouping(int type);
void set_chart_scatter_type(int type);
void set_chart_bar_grouping(int type);
void start_chart (office_element_ptr & root);
void set_chart_type (std::wstring type);
void set_chart_3D (bool Val);
void set_chart_size (_CP_OPT(double) width_pt, _CP_OPT(double) height_pt);
void set_chart_colored (bool val);
void set_chart_grouping (int type);
void set_chart_scatter_type (int type);
void set_chart_bar_grouping (int type);
void set_chart_bar_direction(int type);
void set_chart_bar_type(int type);
void set_chart_bar_type (int type);
void set_chart_bar_gap_width(std::wstring val);
void set_chart_bar_overlap(std::wstring val);
void set_chart_radar_type(int type);
void set_chart_bar_overlap (std::wstring val);
void set_chart_radar_type (int type);
void set_chart_stock_candle_stick(bool val);
void set_marker_size(int size);
......@@ -81,26 +81,26 @@ public:
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,int type);
void start_data_point_series(int count);
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,int type);
void start_data_point_series (int count);
long get_count_data_points_series();
void set_series_pie_explosion(int val);
void end_series();
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 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_id(unsigned int id);
......
......@@ -177,6 +177,8 @@ struct odf_drawing_state
svg_width_ = boost::none;
name_ = L"";
description_ = L"";
hidden_ = false;
z_order_ = -1;
rotateAngle = boost::none;
......@@ -201,9 +203,10 @@ struct odf_drawing_state
_CP_OPT(length) svg_height_;
_CP_OPT(length) svg_width_;
std::wstring name_;
int z_order_;
std::wstring name_;
std::wstring description_;
int z_order_;
bool hidden_;
_CP_OPT(double) rotateAngle;
......@@ -342,10 +345,12 @@ void odf_drawing_context::start_group()
if (group== NULL)return;
//если группа топовая - то данные если не записать - сотруться
if (impl_->current_drawing_state_.name_.length() > 0)
if (!impl_->current_drawing_state_.name_.empty())
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_name_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
if (impl_->current_drawing_state_.z_order_ >= 0)
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_z_index_attlist_.draw_z_index_ = impl_->current_drawing_state_.z_order_;
if (!impl_->current_drawing_state_.name_.empty())
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_name_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
impl_->current_drawing_state_.name_ = L"";
impl_->current_drawing_state_.z_order_ = -1;
......@@ -956,9 +961,9 @@ void odf_drawing_context::end_frame()
/////////////////////
void odf_drawing_context::start_element(office_element_ptr & elm, office_element_ptr style_elm)
{
int level = impl_->current_level_.size();
int level = (int)impl_->current_level_.size();
if (impl_->current_level_.size()>0)
if (impl_->current_level_.size() > 0)
impl_->current_level_.back()->add_child_element(elm);
std::wstring style_name;
......@@ -968,13 +973,13 @@ void odf_drawing_context::start_element(office_element_ptr & elm, office_element
style_name = style_->style_name_;
impl_->current_graphic_properties = style_->style_content_.get_style_graphic_properties();
if (impl_->current_drawing_state_.name_.length() < 1)
if (impl_->current_drawing_state_.name_.empty())
{
impl_->current_drawing_state_.name_ = std::wstring(L"Object_") + style_name;
}
}
odf_element_state state={elm, style_name, style_elm, level};
odf_element_state state = {elm, style_name, style_elm, level};
impl_->current_drawing_state_.elements_.push_back(state);
impl_->current_level_.push_back(elm);
......@@ -1009,10 +1014,18 @@ void odf_drawing_context::end_line_properties()
// impl_->current_drawing_part_ = Unknown;
//}
////////////////////////////////////////////////////////////////////
void odf_drawing_context::set_name(std::wstring name)
void odf_drawing_context::set_name(const std::wstring & name)
{
impl_->current_drawing_state_.name_ = name;
}
void odf_drawing_context::set_description (const std::wstring & description)
{
impl_->current_drawing_state_.description_ = description;
}
void odf_drawing_context::set_hidden (bool bVal)
{
impl_->current_drawing_state_.hidden_ = bVal;
}
void odf_drawing_context::set_opacity(double percent_)
{
if (!impl_->current_graphic_properties)return;
......@@ -1125,7 +1138,7 @@ void odf_drawing_context::set_path(std::wstring path_string)
//boost::replace_all(path_string, L",", L"0"); // нужен разбор
//impl_->current_drawing_state_.path_ = path_string;
}
void odf_drawing_context::add_path_element(std::wstring command, std::wstring & strE)
void odf_drawing_context::add_path_element(std::wstring command, const std::wstring & strE)
{
if (command != impl_->current_drawing_state_.path_last_command_)
{
......@@ -1500,7 +1513,19 @@ void odf_drawing_context::set_position_line(_CP_OPT(double) & x_pt, _CP_OPT(doub
if (y2_pt && !line->draw_line_attlist_.svg_y2_) line->draw_line_attlist_.svg_y2_ = length(length(*y2_pt,length::pt).get_value_unit(length::cm),length::cm);
}
void odf_drawing_context::get_position(_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt)
{
if (impl_->current_drawing_state_.svg_x_ && impl_->current_drawing_state_.svg_y_)
{
x_pt = impl_->current_drawing_state_.svg_x_->get_value_unit(length::pt);
y_pt = impl_->current_drawing_state_.svg_y_->get_value_unit(length::pt);
}
else if (impl_->anchor_settings_.svg_x_ && impl_->anchor_settings_.svg_y_)
{
x_pt = impl_->anchor_settings_.svg_x_->get_value_unit(length::pt);
y_pt = impl_->anchor_settings_.svg_y_->get_value_unit(length::pt);
}
}
void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt)
{
if (x_pt)
......@@ -1516,7 +1541,7 @@ void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) &
}
if (!impl_->current_drawing_state_.svg_x_ || impl_->current_drawing_state_.in_group)
{
impl_->current_drawing_state_.svg_x_ = length(length(x , length::pt).get_value_unit(length::cm),length::cm);
impl_->current_drawing_state_.svg_x_ = length(length(x , length::pt).get_value_unit(length::cm), length::cm);
}
}
......@@ -1538,7 +1563,7 @@ void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) &
}
}
}
void odf_drawing_context::get_size( double & width_pt, double & height_pt)
void odf_drawing_context::get_size( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt)
{
if (impl_->current_drawing_state_.svg_width_ && impl_->current_drawing_state_.svg_height_)
{
......@@ -1550,7 +1575,6 @@ void odf_drawing_context::get_size( double & width_pt, double & height_pt)
width_pt = impl_->anchor_settings_.svg_width_->get_value_unit(length::pt);
height_pt = impl_->anchor_settings_.svg_height_->get_value_unit(length::pt);
}
}
void odf_drawing_context::set_size( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt)
{
......@@ -1840,14 +1864,14 @@ void odf_drawing_context::set_textarea_writing_mode(int mode)
}
void odf_drawing_context::set_textarea_padding(double left,double top, double right,double bottom)//in cm
void odf_drawing_context::set_textarea_padding(_CP_OPT(double) & left, _CP_OPT(double) & top, _CP_OPT(double) & right, _CP_OPT(double) & bottom)//in cm
{
if (!impl_->current_graphic_properties)return;
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_left_ = length(left, length::cm);
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_top_ = length(top, length::cm);
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_right_ = length(right, length::cm);
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_bottom_ = length(bottom,length::cm);
if (left) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_left_ = length(*left, length::cm);
if (top) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_top_ = length(*top, length::cm);
if (right) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_right_ = length(*right,length::cm);
if (bottom) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_bottom_ = length(*bottom,length::cm);
}
......
......@@ -142,7 +142,7 @@ public:
bool is_exist_content();
//////////////////////////////////////////////////////////////////////////////////////
void set_path (std::wstring path_string);
void add_path_element (std::wstring command, std::wstring & elm);
void add_path_element (std::wstring command, const std::wstring & elm);
void add_modifier (std::wstring modifier);
void set_viewBox (double W, double H);
......@@ -151,14 +151,17 @@ public:
///////////////////////////////////////////////////////////////////////////////////////
void set_size ( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt);
void get_position (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt);
void set_position (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt);
void set_position_line (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt, _CP_OPT(double) & x1_pt, _CP_OPT(double) & y1_pt);
void get_size ( double & width_pt, double & height_pt);
void get_size ( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt);
void set_size ( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt);
void set_name (std::wstring name);
void set_name (const std::wstring & name);
void set_description (const std::wstring & descr);
void set_hidden (bool bVal);
void set_z_order (int id);
void set_flip_H (bool bVal);
......@@ -191,7 +194,7 @@ public:
void set_text (odf_text_context* text_context);
void set_textarea_vertical_align(int align);
void set_textarea_padding (double left,double top,double right,double bottom);//in cm
void set_textarea_padding (_CP_OPT(double) & left, _CP_OPT(double) & top, _CP_OPT(double) & right, _CP_OPT(double) & bottom);//in cm
void set_textarea_writing_mode (int mode);
void set_textarea_wrap (bool val);
void set_textarea_fontcolor (std::wstring hexColor);
......
......@@ -54,26 +54,31 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
{
switch (ooxPrstGeomType)
{
case SimpleTypes::shapetypeMathMultiply: return boost::make_shared<oox_shape_mathMultiply>();
case SimpleTypes::shapetypeSun: return boost::make_shared<oox_shape_sun>();
case SimpleTypes::shapetypeRound1Rect: return boost::make_shared<oox_shape_round1Rect>();
case SimpleTypes::shapetypeRound2DiagRect: return boost::make_shared<oox_shape_round2DiagRect>();
case SimpleTypes::shapetypeRound2SameRect: return boost::make_shared<oox_shape_round2SameRect>();
case SimpleTypes::shapetypeSnip1Rect: return boost::make_shared<oox_shape_snip1Rect>();
case SimpleTypes::shapetypeSnip2DiagRect: return boost::make_shared<oox_shape_snip2DiagRect>();
case SimpleTypes::shapetypeSnip2SameRect: return boost::make_shared<oox_shape_snip2SameRect>();
case SimpleTypes::shapetypeSnipRoundRect: return boost::make_shared<oox_shape_snipRoundRect>();
case SimpleTypes::shapetypeStar6: return boost::make_shared<oox_shape_star6>();
case SimpleTypes::shapetypeStar7: return boost::make_shared<oox_shape_star7>();
case SimpleTypes::shapetypeStar10: return boost::make_shared<oox_shape_star10>();
case SimpleTypes::shapetypeStar12: return boost::make_shared<oox_shape_star12>();
case SimpleTypes::shapetypeStar16: return boost::make_shared<oox_shape_star16>();
case SimpleTypes::shapetypeStar32: return boost::make_shared<oox_shape_star32>();
case SimpleTypes::shapetypeCurvedLeftArrow: return boost::make_shared<oox_shape_curvedLeftArrow>();
case SimpleTypes::shapetypeCurvedDownArrow: return boost::make_shared<oox_shape_curvedDownArrow>();
case SimpleTypes::shapetypeMathMultiply: return boost::make_shared<oox_shape_mathMultiply>();
case SimpleTypes::shapetypeSun: return boost::make_shared<oox_shape_sun>();
case SimpleTypes::shapetypeRound1Rect: return boost::make_shared<oox_shape_round1Rect>();
case SimpleTypes::shapetypeRound2DiagRect: return boost::make_shared<oox_shape_round2DiagRect>();
case SimpleTypes::shapetypeRound2SameRect: return boost::make_shared<oox_shape_round2SameRect>();
case SimpleTypes::shapetypeSnip1Rect: return boost::make_shared<oox_shape_snip1Rect>();
case SimpleTypes::shapetypeSnip2DiagRect: return boost::make_shared<oox_shape_snip2DiagRect>();
case SimpleTypes::shapetypeSnip2SameRect: return boost::make_shared<oox_shape_snip2SameRect>();
case SimpleTypes::shapetypeSnipRoundRect: return boost::make_shared<oox_shape_snipRoundRect>();
case SimpleTypes::shapetypeStar6: return boost::make_shared<oox_shape_star6>();
case SimpleTypes::shapetypeStar7: return boost::make_shared<oox_shape_star7>();
case SimpleTypes::shapetypeStar10: return boost::make_shared<oox_shape_star10>();
case SimpleTypes::shapetypeStar12: return boost::make_shared<oox_shape_star12>();
case SimpleTypes::shapetypeStar16: return boost::make_shared<oox_shape_star16>();
case SimpleTypes::shapetypeStar32: return boost::make_shared<oox_shape_star32>();
case SimpleTypes::shapetypeFunnel: return boost::make_shared<oox_shape_Funnel>();
case SimpleTypes::shapetypeGear6: return boost::make_shared<oox_shape_Gear6>();
case SimpleTypes::shapetypeGear9: return boost::make_shared<oox_shape_Gear9>();
case SimpleTypes::shapetypeCircularArrow: return boost::make_shared<oox_shape_CircularArrow>();
case SimpleTypes::shapetypeCurvedLeftArrow: return boost::make_shared<oox_shape_curvedLeftArrow>();
case SimpleTypes::shapetypeCurvedDownArrow: return boost::make_shared<oox_shape_curvedDownArrow>();
case SimpleTypes::shapetypeLeftCircularArrow: return boost::make_shared<oox_shape_LeftCircularArrow>();
case SimpleTypes::shapetypePlaque: return boost::make_shared<oox_shape_Plaque>();
case SimpleTypes::shapetypeDoubleWave: return boost::make_shared<oox_shape_DoubleWave>();
case SimpleTypes::shapetypePlaque: return boost::make_shared<oox_shape_Plaque>();
case SimpleTypes::shapetypeDoubleWave: return boost::make_shared<oox_shape_DoubleWave>();
//case (2001 + SimpleTypes::textshapetypeTextArchDown):
......
......@@ -643,10 +643,14 @@ void OoxConverter::convert(OOX::Vml::CTextbox *vml_textbox)
if (vml_textbox->m_oInsetMode.GetValue() == SimpleTypes::insetmodeCustom)
{
odf_context()->drawing_context()->set_textarea_padding(odf_types::length(vml_textbox->m_oInset.GetLeft(0), odf_types::length::pt).get_value_unit(odf_types::length::cm),
odf_types::length(vml_textbox->m_oInset.GetTop(0), odf_types::length::pt).get_value_unit(odf_types::length::cm),
odf_types::length(vml_textbox->m_oInset.GetRight(0), odf_types::length::pt).get_value_unit(odf_types::length::cm),
odf_types::length(vml_textbox->m_oInset.GetBottom(0), odf_types::length::pt).get_value_unit(odf_types::length::cm));
_CP_OPT(double) lIns, tIns, rIns, bIns;
lIns = odf_types::length(vml_textbox->m_oInset.GetLeft(0),odf_types::length::pt).get_value_unit(odf_types::length::cm);
tIns = odf_types::length(vml_textbox->m_oInset.GetTop(0), odf_types::length::pt).get_value_unit(odf_types::length::cm);
rIns = odf_types::length(vml_textbox->m_oInset.GetRight(0), odf_types::length::pt).get_value_unit(odf_types::length::cm);
bIns = odf_types::length(vml_textbox->m_oInset.GetBottom(0), odf_types::length::pt).get_value_unit(odf_types::length::cm);
odf_context()->drawing_context()->set_textarea_padding (lIns, tIns, rIns, bIns);
}
odf_context()->drawing_context()->set_textarea_wrap(true);
......
......@@ -273,11 +273,6 @@ namespace OOX
class CRichText;
class CTextProperties;
}
//namespace Diagram
//{
// class CShape;
// class CShapeTree;
//}
namespace Vml
{
class CShapeType;
......@@ -322,6 +317,32 @@ namespace PPTX
class SpPr;
class ShapeStyle;
class PrstTxWarp;
class PrstGeom;
class CustGeom;
class BlipFill;
class GradFill;
class SolidFill;
class PattFill;
class EffectLst;
class Ln;
class Path2D;
class PathBase;
class TxBody;
class BodyPr;
class UniFill;
class UniColor;
class NvSpPr;
class CNvPr;
class CNvSpPr;
class NvPr;
class Paragraph;
class TextParagraphPr;
class TextSpacing;
class RunProperties;
class Run;
class Fld;
class Br;
class MathParaWrapper;
}
}
......@@ -358,16 +379,17 @@ public:
OOX::Spreadsheet::IFileContainer *oox_current_child_document_spreadsheet;
OOX::IFileContainer *oox_current_child_document;
void convert (double oox_font_size, cpdoccore::_CP_OPT(cpdoccore::odf_types::font_size) & odf_font_size);
bool convert (int indexSchemeColor, BYTE& ucA, BYTE& ucG, BYTE& ucB, BYTE& ucR);
//.......................................................................................................................
void convert(OOX::WritingElement *oox_unknown);
void convert(double oox_font_size, cpdoccore::_CP_OPT(cpdoccore::odf_types::font_size) & odf_font_size);
//.drawing......................................................................................................................
void convert(OOX::Drawing::CDiagrammParts *oox_diagramm);
void convert(OOX::Drawing::CLockedCanvas *oox_canvas);
void convert(OOX::Drawing::CShape *oox_shape);
void convert(OOX::Drawing::CNonVisualDrawingProps *oox_cnvPr);
void convert(OOX::Drawing::CShapeProperties *oox_spPr, OOX::Drawing::CShapeStyle* oox_sp_style = NULL);
void convert(OOX::Drawing::CShapeProperties *oox_spPr, OOX::Drawing::CShapeStyle* oox_sp_style = NULL);
void convert(OOX::Drawing::CGroupShapeProperties *oox_groupSpPr);
void convert(OOX::Drawing::CTextBodyProperties *oox_bodyPr);
......@@ -406,11 +428,36 @@ public:
void convert(OOX::Drawing::CRun *oox_run);
void convert(OOX::Drawing::CRunProperty *oox_run_pr, cpdoccore::odf_writer::style_text_properties * text_properties);
void convert(OOX::Drawing::CLineSpacing *oox_spacing, cpdoccore::odf_types::length_or_percent & length_or_percent);
//.diagram(pptx)................................................................................................................................
//.diagram & pptx................................................................................................................................
void convert(PPTX::Logic::TextSpacing *oox_spacing, cpdoccore::odf_types::length_or_percent & length_or_percent);
void convert(PPTX::Logic::SpTree *oox_shape_tree);
void convert(PPTX::Logic::Shape *oox_shape);
void convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle* oox_sp_style = NULL);
int convert(PPTX::Logic::PrstTxWarp *oox_text_preset);
void convert(PPTX::Logic::PrstGeom *oox_geom);
void convert(PPTX::Logic::CustGeom *oox_geom);
void convert(PPTX::Logic::BlipFill *oox_fill);
void convert(PPTX::Logic::GradFill *oox_fill);
void convert(PPTX::Logic::SolidFill *oox_fill);
void convert(PPTX::Logic::PattFill *oox_fill);
void convert(PPTX::Logic::EffectLst *oox_effect_lst);
void convert(PPTX::Logic::Ln *oox_line);
void convert(PPTX::Logic::Path2D *oox_path2D);
void convert(PPTX::Logic::PathBase *oox_path);
void convert(PPTX::Logic::BodyPr *oox_bodyPr);
void convert(PPTX::Logic::UniFill *oox_fill, PPTX::Logic::ShapeStyle* oox_sp_style = NULL);
void convert(PPTX::Logic::UniColor *color, std::wstring & hexString, cpdoccore::_CP_OPT(double) & opacity);
void convert(PPTX::Logic::NvSpPr *oox_nvSpPr);
void convert(PPTX::Logic::CNvPr *oox_cnvPr);
void convert(PPTX::Logic::CNvSpPr *oox_cnvSpPr);
void convert(PPTX::Logic::NvPr *oox_nvPr);
void convert(PPTX::Logic::Paragraph *oox_para);
void convert(PPTX::Logic::TextParagraphPr *oox_para_props, cpdoccore::odf_writer::style_paragraph_properties * paragraph_properties);
void convert(PPTX::Logic::RunProperties *oox_run_props, cpdoccore::odf_writer::style_text_properties * text_properties);
void convert(PPTX::Logic::Run *oox_run);
void convert(PPTX::Logic::Fld *oox_fld);
void convert(PPTX::Logic::Br *oox_br);
void convert(PPTX::Logic::MathParaWrapper *oox_math);
//.chart............................................................................................................................
void convert(OOX::Spreadsheet::CT_ChartSpace *oox_chart);
void convert(OOX::Spreadsheet::CT_Title *ct_title);
......
......@@ -2859,7 +2859,7 @@ void DocxConverter::convert(OOX::Drawing::CChart * oox_chart)
odt_context->drawing_context()->start_drawing();
odt_context->drawing_context()->start_object(odf_context()->get_next_name_object());
double width =0, height =0;
_CP_OPT(double) width, height;
odt_context->drawing_context()->get_size(width, height);
OoxConverter::convert(pChart->m_oChartSpace.m_oSpPr.GetPointer());
......
......@@ -1923,59 +1923,49 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGraphicFrame* oox_graphic_frame)
////////////////////////////////////////////////////////////////////////////////
ods_context->drawing_context()->start_drawing();
if (oox_graphic_frame->m_oNvGraphicFramePr.IsInit())
{
OoxConverter::convert(oox_graphic_frame->m_oNvGraphicFramePr->m_oCNvPr.GetPointer());
}
if ( OOX::Drawing::graphictypeChart == oox_graphic_frame->m_oGraphic->m_oGraphicData->m_eGraphicType)
{
ods_context->drawing_context()->start_object(ods_context->get_next_name_object());
{
double width = 0, height = 0;
ods_context->drawing_context()->get_size(width, height);
if (oox_graphic_frame->m_oNvGraphicFramePr.IsInit())
{
OoxConverter::convert(oox_graphic_frame->m_oNvGraphicFramePr->m_oCNvPr.GetPointer());
}
convert(oox_graphic_frame->m_oGraphic->m_oGraphicData->m_oChart.GetPointer(), width, height);
}
ods_context->drawing_context()->end_object();
convert(oox_graphic_frame->m_oGraphic->m_oGraphicData->m_oChart.GetPointer());
}
else if ( OOX::Drawing::graphictypeDiagram == oox_graphic_frame->m_oGraphic->m_oGraphicData->m_eGraphicType)
{
double width = 0, height = 0;
ods_context->drawing_context()->get_size(width, height);
if (oox_graphic_frame->m_oNvGraphicFramePr.IsInit())
{
OoxConverter::convert(oox_graphic_frame->m_oNvGraphicFramePr->m_oCNvPr.GetPointer());
}
OoxConverter::convert(oox_graphic_frame->m_oGraphic->m_oGraphicData->m_oDiagrammParts.GetPointer());
}
ods_context->drawing_context()->end_drawing();
}
void XlsxConverter::convert(OOX::Spreadsheet::CGraphicChart *oox_chart, double width, double height)
void XlsxConverter::convert(OOX::Spreadsheet::CGraphicChart *oox_chart)
{
if (!oox_chart) return;
if( !oox_chart->m_oRId.IsInit()) return;
std::wstring sId = oox_chart->m_oRId->GetValue();
_CP_OPT(double) width, height;
odf_context()->drawing_context()->get_size (width, height);
smart_ptr<OOX::File> oFile = xlsx_current_drawing->Find(sId);
smart_ptr<OOX::File> oFile = xlsx_current_drawing->Find(oox_chart->m_oRId->GetValue());
if (oFile.IsInit() && OOX::Spreadsheet::FileTypes::Charts == oFile->type())
{
OOX::Spreadsheet::CChartSpace* pChart = (OOX::Spreadsheet::CChartSpace*)oFile.operator->();
if (pChart)
{
OoxConverter::convert(pChart->m_oChartSpace.m_oSpPr.GetPointer());
oox_current_child_document_spreadsheet = dynamic_cast<OOX::Spreadsheet::IFileContainer*>(pChart);
odf_context()->start_chart();
odf_context()->chart_context()->set_chart_size(width, height);
OoxConverter::convert(&pChart->m_oChartSpace);
odf_context()->end_chart();
oox_current_child_document_spreadsheet = dynamic_cast<OOX::Spreadsheet::IFileContainer*>(pChart);
odf_context()->drawing_context()->start_object(ods_context->get_next_name_object());
{
odf_context()->start_chart();
odf_context()->chart_context()->set_chart_size(width, height);
OoxConverter::convert(pChart->m_oChartSpace.m_oSpPr.GetPointer());
OoxConverter::convert(&pChart->m_oChartSpace);
odf_context()->end_chart();
}
odf_context()->drawing_context()->end_object();
oox_current_child_document_spreadsheet = NULL;
}
}
......
......@@ -201,7 +201,7 @@ namespace Oox2Odf
void convert(OOX::Spreadsheet::CConnShape *oox_conn_shape);
void convert(OOX::Spreadsheet::CGraphicFrame *oox_graphic_frame);
void convert(OOX::Spreadsheet::CGroupShape *oox_group_shape);
void convert(OOX::Spreadsheet::CGraphicChart *oox_chart, double width, double height);
void convert(OOX::Spreadsheet::CGraphicChart *oox_chart);
void convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_fmt);
void convert(OOX::Spreadsheet::CConditionalFormattingRule *oox_cond_rule);
......
......@@ -198,7 +198,7 @@ namespace PPTX
public:
int id;
std::wstring name;
std::wstring name;
nullable_string descr;
nullable_bool hidden;
nullable_string title;
......
......@@ -116,16 +116,6 @@ namespace PPTX
//Надо сделать примерно также для "origin color" и setter'ы
//Нет, нет и нет!!! Setter'ы делать только в УниКолор, т.к. при установке цвета меняется его тип!
protected:
//origin color
unsigned char alpha;
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char hue;
unsigned char saturation;
unsigned char luminance;
enum ColorType {ctRGBA, ctARGB, ctBGRA, ctABGR};
virtual DWORD ApplyModifiers(const ColorType ct)const
{
......@@ -389,6 +379,15 @@ namespace PPTX
return 0;
}
protected:
//origin color
unsigned char alpha;
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char hue;
unsigned char saturation;
unsigned char luminance;
//Эти функции использовать для заполнения "origin color"
void SetRGB2HSL()
{
......
......@@ -341,7 +341,7 @@ namespace PPTX
public:
nullable<TextParagraphPr> pPr;
std::vector<RunElem> RunElems;
std::vector<RunElem> RunElems;
nullable<RunProperties> endParaRPr;
protected:
virtual void FillParentPointersForChilds()
......
......@@ -70,7 +70,6 @@ namespace PPTX
return Elem->toXML();
return _T("");
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
if (is_init())
......
......@@ -53,7 +53,10 @@ namespace PPTX
rPr = oSrc.rPr;
return *this;
}
virtual OOX::EElementType getType () const
{
return OOX::et_p_br;
}
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
......
......@@ -59,7 +59,10 @@ namespace PPTX
return *this;
}
virtual OOX::EElementType getType () const
{
return OOX::et_p_fld;
}
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
......
......@@ -54,7 +54,11 @@ namespace PPTX
MathParaWrapper& operator=(const MathParaWrapper& oSrc);
public:
virtual OOX::EElementType getType () const
{
return OOX::et_p_MathPara;
}
virtual void fromXML(XmlUtils::CXmlNode& node);
virtual std::wstring toXML() const;
......@@ -64,10 +68,10 @@ namespace PPTX
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
virtual void fromPPTY(BYTE type, NSBinPptxRW::CBinaryFileReader* pReader);
virtual std::wstring GetText() const;
public:
nullable<OOX::Logic::COMathPara> m_oMathPara;
nullable<OOX::Logic::COMath> m_oMath;
nullable_string m_oXml;
nullable<OOX::Logic::COMathPara> m_oMathPara;
nullable<OOX::Logic::COMath> m_oMath;
nullable_string m_oXml;
protected:
virtual void FillParentPointersForChilds(){}
};
......
......@@ -55,7 +55,10 @@ namespace PPTX
return *this;
}
virtual OOX::EElementType getType () const
{
return OOX::et_p_r;
}
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
......
......@@ -2587,7 +2587,7 @@ namespace OOX
public:
// Attributes
nullable<std::wstring> m_oId;
nullable<std::wstring> m_oId;
nullable<SimpleTypes::Vml::CCssStyle> m_oStyle;
SimpleTypes::Vml::CVml_TextBoxInset m_oInset;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oSingleClick;
......
......@@ -335,9 +335,9 @@ namespace OOX
et_dsp_cNvPr,
et_dsp_txXfrm,
et_p_cNvPicPr, // <p:cNvPicPr>
et_p_cNvPr, // <p:cNvPr>
et_p_pic, // <p:pic>
et_p_cNvPicPr, // <p:cNvPicPr>
et_p_cNvPr, // <p:cNvPr>
et_p_pic, // <p:pic>
et_p_Shape, // <p:sp>
et_p_ShapeTree, // <p:spTree>
et_p_spPr, // <p:spPr>
......@@ -345,18 +345,22 @@ namespace OOX
et_p_groupSpPr, // <p:grpSpPr>
et_p_NvGrpSpPr,
et_p_xfrm,
et_a_p, // <a:p>
et_a_pPr, // <a:pPr>
et_a_r, // <a:p>
et_a_rPr, // <a:pPr>
et_a_t, // <a:t>
et_a_br, // <a:br>
et_a_spcPts, // <a:spcPts>
et_a_spcPct, // <a:spcPct>
et_a_spcAft, // <a:spcAft>
et_a_spcBef, // <a:spcBef>
et_a_lnSpc, // <a:lnSpc>
et_p_r,
et_p_fld,
et_p_br,
et_p_MathPara,
et_a_p, // <a:p>
et_a_pPr, // <a:pPr>
et_a_r, // <a:p>
et_a_rPr, // <a:pPr>
et_a_t, // <a:t>
et_a_br, // <a:br>
et_a_spcPts, // <a:spcPts>
et_a_spcPct, // <a:spcPct>
et_a_spcAft, // <a:spcAft>
et_a_spcBef, // <a:spcBef>
et_a_lnSpc, // <a:lnSpc>
et_ds_schemaRef, // <ds:shemeRef>
et_ds_schemaRefs, // <ds:schemaRefs>
......
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