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

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@54946 954022d7-b5bf-4e40-9824-e11837661b57
parent 8edf8e80
......@@ -5,6 +5,17 @@
namespace cpdoccore { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const chart_data_label_number & _Val)
{
switch(_Val.get_type())
{
case chart_data_label_number::none: _Wostream << L"none"; break;
case chart_data_label_number::value: _Wostream << L"value"; break;
case chart_data_label_number::percentage : _Wostream << L"percentage"; break;
}
return _Wostream;
}
chart_data_label_number chart_data_label_number::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
......
......@@ -30,6 +30,7 @@ public:
private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const chart_data_label_number & _Val);
}
......
......@@ -5,6 +5,20 @@
namespace cpdoccore { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const chart_error_category & _Val)
{
switch(_Val.get_type())
{
case chart_error_category::none: _Wostream << L"none"; break;
case chart_error_category::variance: _Wostream << L"variance"; break;
case chart_error_category::standard_deviation: _Wostream << L"standard-deviation"; break;
case chart_error_category::percentage: _Wostream << L"percentage"; break;
case chart_error_category::error_margin: _Wostream << L"error-margin"; break;
case chart_error_category::constant: _Wostream << L"constant"; break;
}
return _Wostream;
}
chart_error_category chart_error_category::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
......
......@@ -34,6 +34,7 @@ private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const chart_error_category & _Val);
}
......
......@@ -5,6 +5,16 @@
namespace cpdoccore { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const chart_interpolation & _Val)
{
switch(_Val.get_type())
{
case chart_interpolation::none: _Wostream << L"none"; break;
case chart_interpolation::cubicSpline: _Wostream << L"cubic-spline"; break;
case chart_interpolation::bSpline: _Wostream << L"b-spline"; break;
}
return _Wostream;
}
chart_interpolation chart_interpolation::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
......
......@@ -38,6 +38,7 @@ private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const chart_interpolation & _Val);
}
......
......@@ -5,6 +5,17 @@
namespace cpdoccore { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const chart_label_arrangement & _Val)
{
switch(_Val.get_type())
{
case chart_label_arrangement::side_by_side: _Wostream << L"side_by_side"; break;
case chart_label_arrangement::stagger_even: _Wostream << L"stagger_even"; break;
case chart_label_arrangement::stagger_odd : _Wostream << L"stagger_odd"; break;
}
return _Wostream;
}
chart_label_arrangement chart_label_arrangement::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
......
......@@ -38,6 +38,7 @@ private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const chart_label_arrangement & _Val);
}
......
......@@ -5,6 +5,19 @@
namespace cpdoccore { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const chart_regression_type & _Val)
{
switch(_Val.get_type())
{
case chart_regression_type::none: _Wostream << L"none"; break;
case chart_regression_type::linear: _Wostream << L"linear"; break;
case chart_regression_type::logarithmic : _Wostream << L"logarithmic"; break;
case chart_regression_type::exponential : _Wostream << L"exponential"; break;
case chart_regression_type::power : _Wostream << L"power"; break;
}
return _Wostream;
}
chart_regression_type chart_regression_type::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
......
......@@ -36,6 +36,7 @@ private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const chart_regression_type & _Val);
}
......
......@@ -5,6 +5,17 @@
namespace cpdoccore { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const chart_series_source & _Val)
{
switch(_Val.get_type())
{
case chart_series_source::columns: _Wostream << L"columns";
case chart_series_source::rows: _Wostream << L"rows";
}
return _Wostream;
}
chart_series_source chart_series_source::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
......
......@@ -37,6 +37,7 @@ private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const chart_series_source & _Val);
}
......
......@@ -5,6 +5,17 @@
namespace cpdoccore { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const chart_solid_type & _Val)
{
switch(_Val.get_type())
{
case chart_solid_type::cuboid: _Wostream << L"cuboid"; break;
case chart_solid_type::cylinder: _Wostream << L"cylinder"; break;
case chart_solid_type::cone: _Wostream << L"cone"; break;
case chart_solid_type::pyramid: _Wostream << L"pyramid"; break;
}
return _Wostream;
}
chart_solid_type chart_solid_type::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
......
......@@ -34,6 +34,7 @@ private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const chart_solid_type & _Val);
}
......
......@@ -5,6 +5,41 @@
namespace cpdoccore { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const chart_symbol_type & _Val)
{
switch(_Val.get_type())
{
case chart_symbol_type::noneSymbol:_Wostream << L"none"; break;
case chart_symbol_type::autoSymbol:_Wostream << L"auto"; break;
case chart_symbol_type::namedSymbol:_Wostream << L"named-symbol"; break;
}
return _Wostream;
}
std::wostream & operator << (std::wostream & _Wostream, const chart_symbol_name & _Val)
{
switch(_Val.get_type())
{
case chart_symbol_name::noneSymbol: _Wostream << L"none"; break;
case chart_symbol_name::autoSymbol: _Wostream << L"auto"; break;
case chart_symbol_name::squareSymbol: _Wostream << L"square"; break;
case chart_symbol_name::diamondSymbol: _Wostream << L"diamond"; break;
case chart_symbol_name::arrow_downSymbol: _Wostream << L"arrow-down"; break;
case chart_symbol_name::arrow_upSymbol: _Wostream << L"arrow-up"; break;
case chart_symbol_name::arrow_rightSymbol: _Wostream << L"arrow-right"; break;
case chart_symbol_name::arrow_leftSymbol: _Wostream << L"arrow-left"; break;
case chart_symbol_name::bow_tieSymbol: _Wostream << L"bow-tie"; break;
case chart_symbol_name::hourglassSymbol: _Wostream << L"hourglass"; break;
case chart_symbol_name::circleSymbol: _Wostream << L"circle"; break;
case chart_symbol_name::starSymbol: _Wostream << L"star"; break;
case chart_symbol_name::xSymbol: _Wostream << L"x"; break;
case chart_symbol_name::plusSymbol: _Wostream << L"plus"; break;
case chart_symbol_name::asteriskSymbol: _Wostream << L"asterisk"; break;
case chart_symbol_name::horizontal_barSymbol:_Wostream << L"horizontal"; break;
case chart_symbol_name::verticalSymbol: _Wostream << L"vertical"; break;
}
return _Wostream;
}
chart_symbol_type chart_symbol_type::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
......
......@@ -83,12 +83,15 @@ private:
};
std::wostream & operator << (std::wostream & _Wostream, const chart_symbol_type & _Val);
std::wostream & operator << (std::wostream & _Wostream, const chart_symbol_name & _Val);
}
APPLY_PARSE_XML_ATTRIBUTES(odf::chart_symbol_type);
APPLY_PARSE_XML_ATTRIBUTES(odf::chart_symbol_name);
}
#endif
......@@ -6,6 +6,26 @@
namespace cpdoccore {
namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const marker_style & _Val)
{
//switch(_Val.get_type())
//{
//case marker_style::
// _Wostream << "none";
// break;
//case marker_style::Single:
// _Wostream << "single";
// break;
//case marker_style::Double:
// _Wostream << "double";
// break;
//default:
// break;
//}
_Wostream << _Val.get();
return _Wostream;
}
std::wstring marker_style::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
......
......@@ -26,6 +26,7 @@ private:
std::wstring style_;
};
std::wostream & operator << (std::wostream & _Wostream, const marker_style & _Val);
}
......
......@@ -114,6 +114,61 @@ void style_chart_properties::add_attributes( const xml::attributes_wc_ptr & Attr
common_rotation_angle_attlist_.add_attributes(Attributes);
//CP_APPLY_ATTR(L"chart:scale-text", chart_scale_text_ );
// CP_APPLY_ATTR(L"chart:three-dimensional", chart_three_dimensional_ );
//CP_APPLY_ATTR(L"chart:vertical", chart_vertical_ );
//CP_APPLY_ATTR(L"chart:stacked", chart_stacked_ );
//CP_APPLY_ATTR(L"chart:visible", chart_visible_ );
//CP_APPLY_ATTR(L"chart:logarithmic", chart_logarithmic_ );
//CP_APPLY_ATTR(L"chart:percentage", chart_percentage_ );
//CP_APPLY_ATTR(L"chart:connect-bars", chart_connect_bars_ );
//CP_APPLY_ATTR(L"chart:deep", chart_deep_ );
//CP_APPLY_ATTR(L"chart:tick-marks-major-outer",chart_tick_marks_major_outer_ );
//CP_APPLY_ATTR(L"chart:tick-marks-minor-inner",chart_tick_marks_minor_inner_ );
//CP_APPLY_ATTR(L"chart:tick-marks-minor-outer",chart_marks_minor_outer_ );
//CP_APPLY_ATTR(L"chart:lines", chart_lines_ );
//CP_APPLY_ATTR(L"chart:display-label", chart_display_label_ );
//CP_APPLY_ATTR(L"chart:reverse-direction", chart_reverse_direction_ );
//CP_APPLY_ATTR(L"text:line-break", chart_line_break_ );
//CP_APPLY_ATTR(L"chart:text-overlap", chart_text_overlap_ );
//CP_APPLY_ATTR(L"chart:link-data-style-to-source",chart_link-data-style-to-source_ );
//CP_APPLY_ATTR(L"chart:data-label-symbol", chart_data-label-symbol_ );
//CP_APPLY_ATTR(L"chart:data-label-text", chart_data-label-text_ );
//CP_APPLY_ATTR(L"chart:mean-value", chart_mean-value_ );
//CP_APPLY_ATTR(L"chart:error-upper-indicator",chart_error_upper_indicator_ );
//CP_APPLY_ATTR(L"chart:error-lower-indicator",chart_error_lower_indicator_ );
//CP_APPLY_ATTR(L"chart:symbol-type", chart_symbol_type_);
//CP_APPLY_ATTR(L"chart:symbol-name", chart_symbol_name_);
//
//CP_APPLY_ATTR(L"chart:gap-width", chart_gap_width_);
//CP_APPLY_ATTR(L"chart:overlap", chart_overlap_);
//CP_APPLY_ATTR(L"chart:spline-order", chart_spline_order_);
//CP_APPLY_ATTR(L"chart:spline-resolution", chart_spline_resolution_);
//CP_APPLY_ATTR(L"chart:pie-offset", chart_pie_offset_);
//CP_APPLY_ATTR(L"chart:interval-minor-divisor",chart_interval_minor_divisor_);
//
//CP_APPLY_ATTR(L"chart:maximum", chart_maximum_);
//CP_APPLY_ATTR(L"chart:minimum", chart_minimum_);
//CP_APPLY_ATTR(L"chart:origin", chart_origin_);
//CP_APPLY_ATTR(L"chart:interval-major", chart_interval_major_);
//CP_APPLY_ATTR(L"chart:error-percentage", chart_error_percentage_);
//CP_APPLY_ATTR(L"chart:error-margin", chart_error_margin_);
//CP_APPLY_ATTR(L"chart:error-upper-limit", chart_error_upper_limit_);
//CP_APPLY_ATTR(L"chart:symbol-width", chart_symbol_width_);
//CP_APPLY_ATTR(L"chart:symbol-height", chart_symbol_height_);
// CP_APPLY_ATTR(L"chart:interpolation", chart_interpolation_);
//CP_APPLY_ATTR(L"chart:solid-type", chart_solid_type_);
//CP_APPLY_ATTR(L"chart:label-arrangement", chart_label_arrangement_);
//CP_APPLY_ATTR(L"style:direction", style_direction_);
//CP_APPLY_ATTR(L"chart:series-source", chart_series_source_);
//CP_APPLY_ATTR(L"chart:regression-type", chart_regression_type_);
//CP_APPLY_ATTR(L"chart:data-label-number", chart_data_label_number_);
//CP_APPLY_ATTR(L"chart:error-category", chart_error_category_);
//common_rotation_angle_attlist_.add_attributes(Attributes);
}
void style_chart_properties::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
......
......@@ -966,6 +966,22 @@
RelativePath=".\OdfFormat\odf_style_state.h"
>
</File>
<File
RelativePath=".\OdfFormat\style_chart_properties.cpp"
>
</File>
<File
RelativePath=".\OdfFormat\style_chart_properties.h"
>
</File>
<File
RelativePath=".\OdfFormat\style_graphic_properties.cpp"
>
</File>
<File
RelativePath=".\OdfFormat\style_graphic_properties.h"
>
</File>
<File
RelativePath=".\OdfFormat\style_map.cpp"
>
......
#include "precompiled_cpodf.h"
#include "style_chart_properties.h"
#include <iostream>
//#include "chart_objects.h"
namespace cpdoccore {
namespace odf {
using xml::xml_char_wc;
// style:chart-properties
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_chart_properties::ns = L"style";
const wchar_t * style_chart_properties::name = L"chart-properties";
void chart_format_properties::serialize(std::wostream & _Wostream ,const wchar_t * ns, const wchar_t * name )
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"chart:scale-text", chart_scale_text_ );
CP_XML_ATTR_OPT(L"chart:three-dimensional", chart_three_dimensional_ );
CP_XML_ATTR_OPT(L"chart:vertical", chart_vertical_ );
CP_XML_ATTR_OPT(L"chart:stacked", chart_stacked_ );
CP_XML_ATTR_OPT(L"chart:visible", chart_visible_ );
CP_XML_ATTR_OPT(L"chart:logarithmic", chart_logarithmic_ );
CP_XML_ATTR_OPT(L"chart:percentage", chart_percentage_ );
CP_XML_ATTR_OPT(L"chart:connect-bars", chart_connect_bars_ );
CP_XML_ATTR_OPT(L"chart:deep", chart_deep_ );
CP_XML_ATTR_OPT(L"chart:tick-marks-major-outer",chart_tick_marks_major_outer_ );
CP_XML_ATTR_OPT(L"chart:tick-marks-minor-inner",chart_tick_marks_minor_inner_ );
CP_XML_ATTR_OPT(L"chart:tick-marks-minor-outer",chart_tick_marks_minor_outer_ );
CP_XML_ATTR_OPT(L"chart:lines", chart_lines_ );
CP_XML_ATTR_OPT(L"chart:display-label", chart_display_label_ );
CP_XML_ATTR_OPT(L"chart:reverse-direction", chart_reverse_direction_ );
CP_XML_ATTR_OPT(L"text:line-break", text_line_break_ );
CP_XML_ATTR_OPT(L"chart:text-overlap", chart_text_overlap_ );
CP_XML_ATTR_OPT(L"chart:link-data-style-to-source",chart_link_data_style_to_source_ );
CP_XML_ATTR_OPT(L"chart:data-label-symbol", chart_data_label_symbol_ );
CP_XML_ATTR_OPT(L"chart:data-label-text", chart_data_label_text_ );
CP_XML_ATTR_OPT(L"chart:mean-value", chart_mean_value_ );
CP_XML_ATTR_OPT(L"chart:error-upper-indicator", chart_error_upper_indicator_ );
CP_XML_ATTR_OPT(L"chart:error-lower-indicator", chart_error_lower_indicator_ );
CP_XML_ATTR_OPT(L"chart:symbol-type", chart_symbol_type_);
CP_XML_ATTR_OPT(L"chart:symbol-name", chart_symbol_name_);
CP_XML_ATTR_OPT(L"chart:gap-width", chart_gap_width_);
CP_XML_ATTR_OPT(L"chart:overlap", chart_overlap_);
CP_XML_ATTR_OPT(L"chart:spline-order", chart_spline_order_);
CP_XML_ATTR_OPT(L"chart:spline-resolution", chart_spline_resolution_);
CP_XML_ATTR_OPT(L"chart:pie-offset", chart_pie_offset_);
CP_XML_ATTR_OPT(L"chart:interval-minor-divisor",chart_interval_minor_divisor_);
CP_XML_ATTR_OPT(L"chart:maximum", chart_maximum_);
CP_XML_ATTR_OPT(L"chart:minimum", chart_minimum_);
CP_XML_ATTR_OPT(L"chart:origin", chart_origin_);
CP_XML_ATTR_OPT(L"chart:interval-major", chart_interval_major_);
CP_XML_ATTR_OPT(L"chart:error-percentage", chart_error_percentage_);
CP_XML_ATTR_OPT(L"chart:error-margin", chart_error_margin_);
CP_XML_ATTR_OPT(L"chart:error-upper-limit", chart_error_upper_limit_);
CP_XML_ATTR_OPT(L"chart:symbol-width", chart_symbol_width_);
CP_XML_ATTR_OPT(L"chart:symbol-height", chart_symbol_height_);
CP_XML_ATTR_OPT(L"chart:interpolation", chart_interpolation_);
CP_XML_ATTR_OPT(L"chart:solid-type", chart_solid_type_);
CP_XML_ATTR_OPT(L"chart:label-arrangement", chart_label_arrangement_);
CP_XML_ATTR_OPT(L"style:direction", style_direction_);
CP_XML_ATTR_OPT(L"chart:series-source", chart_series_source_);
CP_XML_ATTR_OPT(L"chart:regression-type", chart_regression_type_);
CP_XML_ATTR_OPT(L"chart:data-label-number", chart_data_label_number_);
CP_XML_ATTR_OPT(L"chart:error-category", chart_error_category_);
common_rotation_angle_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
void style_chart_properties::serialize(std::wostream & _Wostream)
{
chart_format_properties_.serialize(_Wostream,ns,name);
}
}
}
#pragma once
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements.h"
#include "office_elements_create.h"
#include "chartsymbol.h"
#include "length.h"
#include "chartinterpolation.h"
#include "chartsolidtype.h"
#include "chartlabelarrangement.h"
#include "common_attlists.h"
#include "chartdatalabelnumber.h"
#include "charterrorcategory.h"
#include "chartseriessource.h"
#include "chartregressiontype.h"
#include "direction.h"
namespace cpdoccore {
namespace odf {
class chart_format_properties
{
public:
void serialize(std::wostream & strm, const wchar_t * ns, const wchar_t * name );
_CP_OPT(bool) chart_scale_text_;
_CP_OPT(bool) chart_three_dimensional_;
_CP_OPT(bool) chart_vertical_;
_CP_OPT(bool) chart_stacked_;
_CP_OPT(bool) chart_visible_;
_CP_OPT(bool) chart_logarithmic_;
_CP_OPT(bool) chart_percentage_;
_CP_OPT(bool) chart_connect_bars_;
_CP_OPT(bool) chart_deep_;
_CP_OPT(bool) chart_tick_marks_major_outer_;
_CP_OPT(bool) chart_tick_marks_minor_inner_;
_CP_OPT(bool) chart_tick_marks_minor_outer_;
_CP_OPT(bool) chart_lines_;
_CP_OPT(bool) chart_display_label_;
_CP_OPT(bool) chart_reverse_direction_;
_CP_OPT(bool) text_line_break_;
_CP_OPT(bool) chart_text_overlap_;
_CP_OPT(bool) chart_link_data_style_to_source_;
_CP_OPT(bool) chart_data_label_symbol_;
_CP_OPT(bool) chart_data_label_text_;
_CP_OPT(bool) chart_mean_value_;
_CP_OPT(bool) chart_error_upper_indicator_;
_CP_OPT(bool) chart_error_lower_indicator_;
_CP_OPT(chart_symbol_type) chart_symbol_type_;
_CP_OPT(chart_symbol_name) chart_symbol_name_;
_CP_OPT(int) chart_gap_width_;
_CP_OPT(int) chart_overlap_;
_CP_OPT(int) chart_spline_order_;
_CP_OPT(int) chart_spline_resolution_;
_CP_OPT(int) chart_pie_offset_;
_CP_OPT(int) chart_interval_minor_divisor_;
_CP_OPT(double) chart_maximum_;
_CP_OPT(double) chart_minimum_;
_CP_OPT(double) chart_origin_;
_CP_OPT(double) chart_interval_major_;
_CP_OPT(double) chart_error_percentage_;
_CP_OPT(double) chart_error_margin_;
_CP_OPT(double) chart_error_upper_limit_;
_CP_OPT(chart_interpolation) chart_interpolation_;
_CP_OPT(chart_solid_type) chart_solid_type_;
_CP_OPT(chart_label_arrangement) chart_label_arrangement_;
_CP_OPT(direction) style_direction_;
_CP_OPT(chart_series_source) chart_series_source_;
_CP_OPT(length) chart_symbol_width_;
_CP_OPT(length) chart_symbol_height_;
_CP_OPT(chart_regression_type) chart_regression_type_;
_CP_OPT(chart_data_label_number) chart_data_label_number_;
_CP_OPT(chart_error_category) chart_error_category_;
common_rotation_angle_attlist common_rotation_angle_attlist_;
};
/// \class style_chart_properties
/// style:chart-properties
class style_chart_properties : public office_element_impl<style_chart_properties>//
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleChartProperties;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element(office_element_ptr & child){}
virtual void serialize(std::wostream & strm);
chart_format_properties & content() { return chart_format_properties_; }
private:
chart_format_properties chart_format_properties_;
};
CP_REGISTER_OFFICE_ELEMENT2(style_chart_properties);
}
}
#include "precompiled_cpodf.h"
#include <iostream>
#include "style_graphic_properties.h"
#include <cpdoccore/xml/serialize.h>
#include <cpdoccore/xml/attributes.h>
namespace cpdoccore {
namespace odf {
using xml::xml_char_wc;
void graphic_format_properties::serialize(std::wostream & _Wostream ,const wchar_t * ns, const wchar_t * name )
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
common_draw_fill_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"draw:wrap-influence-on-position", draw_wrap_influence_on_position_);
CP_XML_ATTR_OPT(L"draw:textarea-horizontal-align", draw_textarea_horizontal_align_);
CP_XML_ATTR_OPT(L"draw:textarea-vertical-align", draw_textarea_vertical_align_);
CP_XML_ATTR_OPT(L"draw:stroke", draw_stroke_);
CP_XML_ATTR_OPT(L"draw:stroke-dash",draw_stroke_dash_);
CP_XML_ATTR_OPT(L"draw:marker-start",draw_marker_start_);
CP_XML_ATTR_OPT(L"draw:marker-end", draw_marker_end_);
CP_XML_ATTR_OPT(L"svg:stroke-color",svg_stroke_color_);
CP_XML_ATTR_OPT(L"svg:stroke-width", svg_stroke_width_);
CP_XML_ATTR_OPT(L"svg:stroke-opacity",svg_stroke_opacity_);
CP_XML_ATTR_OPT(L"fo:min-width", fo_min_width_);
CP_XML_ATTR_OPT(L"fo:min-height", fo_min_height_);
CP_XML_ATTR_OPT(L"fo:max-width", fo_max_width_);
CP_XML_ATTR_OPT(L"fo:max-height", fo_max_height_);
CP_XML_ATTR_OPT(L"fo:clip", fo_clip_);
CP_XML_ATTR_OPT(L"style:print-content", style_print_content_);
CP_XML_ATTR_OPT(L"style:protect", style_protect_);
CP_XML_ATTR_OPT(L"style:editable", style_editable_);
CP_XML_ATTR_OPT(L"style:wrap", style_wrap_);
CP_XML_ATTR_OPT(L"style:wrap-dynamic-treshold", style_wrap_dynamic_treshold_);
CP_XML_ATTR_OPT(L"style:number-wrapped-paragraphs", style_number_wrapped_paragraphs_);
CP_XML_ATTR_OPT(L"style:wrap-contour", style_wrap_contour_);
CP_XML_ATTR_OPT(L"style:wrap-contour-mode", style_wrap_contour_mode_);
CP_XML_ATTR_OPT(L"style:run-through", style_run_through_);
CP_XML_ATTR_OPT(L"style:flow-with-text", style_flow_with_text_);
CP_XML_ATTR_OPT(L"style:overflow-behavior", style_overflow_behavior_);
CP_XML_ATTR_OPT(L"style:mirror", style_mirror_);
common_draw_rel_size_attlist_.serialize(CP_GET_XML_NODE());
common_horizontal_margin_attlist_.serialize(CP_GET_XML_NODE());
common_vertical_margin_attlist_.serialize(CP_GET_XML_NODE());
common_margin_attlist_.serialize(CP_GET_XML_NODE());
common_horizontal_pos_attlist_.serialize(CP_GET_XML_NODE());
common_horizontal_rel_attlist_.serialize(CP_GET_XML_NODE());
common_vertical_pos_attlist_.serialize(CP_GET_XML_NODE());
common_vertical_rel_attlist_.serialize(CP_GET_XML_NODE());
common_text_anchor_attlist_.serialize(CP_GET_XML_NODE());
common_border_attlist_.serialize(CP_GET_XML_NODE());
common_border_line_width_attlist_.serialize(CP_GET_XML_NODE());
common_padding_attlist_.serialize(CP_GET_XML_NODE());
common_shadow_attlist_.serialize(CP_GET_XML_NODE());
common_background_color_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
// style:graphic-properties
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_graphic_properties::ns = L"style";
const wchar_t * style_graphic_properties::name = L"graphic-properties";
void style_graphic_properties::serialize(std::wostream & strm)
{
graphic_format_properties_.serialize(strm,ns,name);
}
}
}
#pragma once
#include <iosfwd>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements.h"
#include "office_elements_create.h"
#include "common_attlists.h"
#include "lengthorpercent.h"
#include "stylehorizontalpos.h"
#include "stylehorizontalrel.h"
#include "styleverticalrel.h"
#include "styleverticalpos.h"
#include "anchortype.h"
#include "stylewrap.h"
#include "hyphenationladdercount.h"
#include "stylewrapcontourmode.h"
#include "runthrough.h"
#include "linestyle.h"
#include "markerstyle.h"
#include "verticalalign.h"
#include "gradientstyle.h"
namespace cpdoccore {
namespace odf {
class graphic_format_properties
{
public:
void apply_from(const graphic_format_properties & Other);
void serialize(std::wostream & strm, const wchar_t * ns, const wchar_t * name );
public:
common_draw_rel_size_attlist common_draw_rel_size_attlist_;
_CP_OPT(length_or_percent) fo_min_width_;
_CP_OPT(length_or_percent) fo_min_height_;
_CP_OPT(length_or_percent) fo_max_width_;
_CP_OPT(length_or_percent) fo_max_height_;
///////////////////////////////
_CP_OPT(color) svg_stroke_color_;
_CP_OPT(length_or_percent) svg_stroke_opacity_;
_CP_OPT(line_style) draw_stroke_;
_CP_OPT(std::wstring) draw_stroke_dash_;
_CP_OPT(length_or_percent) svg_stroke_width_;
_CP_OPT(marker_style) draw_marker_end_;
_CP_OPT(marker_style) draw_marker_start_;
_CP_OPT(text_align) draw_textarea_horizontal_align_;
_CP_OPT(vertical_align) draw_textarea_vertical_align_;
common_draw_fill_attlist common_draw_fill_attlist_;
common_horizontal_margin_attlist common_horizontal_margin_attlist_;
common_vertical_margin_attlist common_vertical_margin_attlist_;
common_margin_attlist common_margin_attlist_;
_CP_OPT(bool) style_print_content_;
_CP_OPT(std::wstring) style_protect_;
common_horizontal_pos_attlist common_horizontal_pos_attlist_;
common_horizontal_rel_attlist common_horizontal_rel_attlist_;
common_vertical_pos_attlist common_vertical_pos_attlist_;
common_vertical_rel_attlist common_vertical_rel_attlist_;
common_text_anchor_attlist common_text_anchor_attlist_;
common_text_animation_attlist common_text_animation_attlist_;
common_border_attlist common_border_attlist_;
common_border_line_width_attlist common_border_line_width_attlist_;
common_padding_attlist common_padding_attlist_;
common_shadow_attlist common_shadow_attlist_;
common_background_color_attlist common_background_color_attlist_;
_CP_OPT(bool) style_editable_;
_CP_OPT(style_wrap) style_wrap_;
_CP_OPT(unsigned int) style_wrap_dynamic_treshold_;
_CP_OPT(integer_or_nolimit) style_number_wrapped_paragraphs_;
_CP_OPT(bool) style_wrap_contour_;
_CP_OPT(wrap_contour_mode) style_wrap_contour_mode_;
_CP_OPT(run_through) style_run_through_;
_CP_OPT(bool) style_flow_with_text_;
_CP_OPT(std::wstring) style_overflow_behavior_;
_CP_OPT(std::wstring) style_mirror_;
_CP_OPT(std::wstring) fo_clip_;
_CP_OPT(std::wstring) draw_wrap_influence_on_position_;
office_element_ptr style_background_image_;
};
/// \class style_graphic_properties
/// style:graphic-properties
class style_graphic_properties : public office_element_impl<style_graphic_properties>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleGraphicPropertis;
CPDOCCORE_DEFINE_VISITABLE();
graphic_format_properties & content(){ return graphic_format_properties_; }
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element(office_element_ptr & child){}
virtual void serialize(std::wostream & strm);
private:
graphic_format_properties graphic_format_properties_;
};
CP_REGISTER_OFFICE_ELEMENT2(style_graphic_properties);
}
}
......@@ -22,23 +22,83 @@ using xml::xml_char_wc;
const wchar_t * style_tab_stop::ns = L"style";
const wchar_t * style_tab_stop::name = L"tab-stop";
void style_tab_stop::serialize(std::wostream & strm)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR (L"style:position", style_position_);
CP_XML_ATTR_OPT(L"style:type", style_type_);
CP_XML_ATTR_OPT(L"style:char", style_char_);
CP_XML_ATTR_OPT(L"style:leader-type", style_leader_style_);
CP_XML_ATTR_OPT(L"style:leader-style", style_leader_style_);
CP_XML_ATTR_OPT(L"style:leader-width", style_leader_width_);
CP_XML_ATTR_OPT(L"style:leader-color", style_leader_color_);
CP_XML_ATTR_OPT(L"style:leader-text", style_leader_text_);
CP_XML_ATTR_OPT(L"style:leader-text-style", style_leader_text_style_);
}
}
}
// style:tab-stop
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_tab_stops::ns = L"style";
const wchar_t * style_tab_stops::name = L"tab-stops";
void style_tab_stops::serialize(std::wostream & strm)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(office_element_ptr & elm, style_tab_stops_)
{
elm->serialize(CP_XML_STREAM());
}
}
}
}
// style:drop-cap
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_drop_cap::ns = L"style";
const wchar_t * style_drop_cap::name = L"drop-cap";
void style_drop_cap::serialize(std::wostream & strm)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR (L"style:length", style_length_);
CP_XML_ATTR (L"style:lines", style_lines_);
CP_XML_ATTR_OPT(L"style:distance", style_distance_);
CP_XML_ATTR_OPT(L"style:style-name", style_style_name_);
}
}
}
// style:background-image
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_background_image::ns = L"style";
const wchar_t * style_background_image::name = L"background-image";
void style_background_image::serialize(std::wostream & strm)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"style:repeat", style_repeat_);
CP_XML_ATTR_OPT(L"style:position", style_position_);
CP_XML_ATTR_OPT(L"filter:name", filter_name_);
CP_XML_ATTR_OPT(L"draw:opacity", draw_opacity_);
if (common_xlink_attlist_) common_xlink_attlist_->serialize(CP_GET_XML_NODE());
if (office_binary_data_) office_binary_data_->serialize(CP_XML_STREAM());
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void paragraph_format_properties::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name,odf_conversion_context * Context)
{
......@@ -65,17 +125,92 @@ void paragraph_format_properties::create_child_element(const ::std::wstring & Ns
}
void paragraph_format_properties::serialize(std::wostream & _Wostream ,const wchar_t * ns, const wchar_t * name )
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"fo:line-height", fo_line_height_);
CP_XML_ATTR_OPT(L"style:line-height-at-least", style_line_height_at_least_);
CP_XML_ATTR_OPT(L"style:line-spacing", style_line_spacing_);
CP_XML_ATTR_OPT(L"style:font-independent-line-spacing", style_font_independent_line_spacing_);
CP_XML_ATTR_OPT(L"fo:text-align", fo_text_align_);
CP_XML_ATTR_OPT(L"fo:text-align-last", fo_text_align_last_);
CP_XML_ATTR_OPT(L"style:justify-single-word", style_justify_single_word_);
CP_XML_ATTR_OPT(L"fo:keep-together", fo_keep_together_);
CP_XML_ATTR_OPT(L"fo:widows", fo_widows_);
CP_XML_ATTR_OPT(L"fo:orphans", fo_orphans_);
CP_XML_ATTR_OPT(L"style:tab-stop-distance", style_tab_stop_distance_);
CP_XML_ATTR_OPT(L"fo:hyphenation-keep", fo_hyphenation_keep_);
CP_XML_ATTR_OPT(L"fo:hyphenation-ladder-count", fo_hyphenation_ladder_count_);
CP_XML_ATTR_OPT(L"style:register-true", style_register_true_);
CP_XML_ATTR_OPT(L"fo:margin-left", fo_margin_left_);
CP_XML_ATTR_OPT(L"fo:margin-right", fo_margin_right_);
CP_XML_ATTR_OPT(L"fo:text-indent", fo_text_indent_);
CP_XML_ATTR_OPT(L"style:auto-text-indent", style_auto_text_indent_);
CP_XML_ATTR_OPT(L"fo:margin-top", fo_margin_top_);
CP_XML_ATTR_OPT(L"fo:margin-bottom", fo_margin_bottom_);
CP_XML_ATTR_OPT(L"fo:margin", fo_margin_);
CP_XML_ATTR_OPT(L"fo:break-before", fo_break_before_);
CP_XML_ATTR_OPT(L"fo:break-after", fo_break_after_);
CP_XML_ATTR_OPT(L"fo:background-color", fo_background_color_);
CP_XML_ATTR_OPT(L"fo:border", fo_border_);
CP_XML_ATTR_OPT(L"fo:border-top", fo_border_top_);
CP_XML_ATTR_OPT(L"fo:border-bottom", fo_border_bottom_);
CP_XML_ATTR_OPT(L"fo:border-left", fo_border_left_);
CP_XML_ATTR_OPT(L"fo:border-right", fo_border_right_);
CP_XML_ATTR_OPT(L"style:border-line-width", style_border_line_width_);
CP_XML_ATTR_OPT(L"style:border-line-width-top", style_border_line_width_top_);
CP_XML_ATTR_OPT(L"style:border-line-width-bottom", style_border_line_width_bottom_);
CP_XML_ATTR_OPT(L"style:border-line-width-left", style_border_line_width_left_);
CP_XML_ATTR_OPT(L"style:border-line-width-right", style_border_line_width_right_);
CP_XML_ATTR_OPT(L"fo:padding", fo_padding_);
CP_XML_ATTR_OPT(L"fo:padding-top", fo_padding_top_);
CP_XML_ATTR_OPT(L"fo:padding-bottom", fo_padding_bottom_);
CP_XML_ATTR_OPT(L"fo:padding-left", fo_padding_left_);
CP_XML_ATTR_OPT(L"fo:padding-right", fo_padding_right_);
CP_XML_ATTR_OPT(L"style:shadow", style_shadow_);
CP_XML_ATTR_OPT(L"fo:keep-with-next", fo_keep_with_next_);
CP_XML_ATTR_OPT(L"text:number-lines", text_number_lines_);
CP_XML_ATTR_OPT(L"text:line-number", text_line_number_);
CP_XML_ATTR_OPT(L"style:text-autospace", style_text_autospace_);
CP_XML_ATTR_OPT(L"style:punctuation-wrap", style_punctuation_wrap_);
CP_XML_ATTR_OPT(L"style:line-break", style_line_break_);
CP_XML_ATTR_OPT(L"style:vertical-align", style_vertical_align_);
CP_XML_ATTR_OPT(L"style:writing-mode", style_writing_mode_);
CP_XML_ATTR_OPT(L"style:writing-mode-automatic", style_writing_mode_automatic_);
CP_XML_ATTR_OPT(L"style:snap-to-layout-grid", style_snap_to_layout_grid_);
//_CP_OPT(std::wstring) style_page_number_str_;
//CP_XML_ATTR_OPT(L"style:page-number", style_page_number_str_);
//if (style_page_number_str_)
//{
// int res =0;
// if ((res=style_page_number_str_.get().find(L"auto"))<0)
// style_page_number_= boost::lexical_cast<int>(style_page_number_str_.get());
//}
CP_XML_ATTR_OPT(L"style:background-transparency", style_background_transparency_);
CP_XML_ATTR_OPT(L"style:join_border", style_join_border_);
}
}
}
// style:paragraph-properties
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_paragraph_properties::ns = L"style";
const wchar_t * style_paragraph_properties::name = L"paragraph-properties";
void style_paragraph_properties::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
style_paragraph_properties_content_.create_child_element(Ns, Name, getContext());
}
void style_paragraph_properties::serialize(std::wostream & strm)
{
style_paragraph_properties_content_.serialize(strm,ns,name);
}
void paragraph_format_properties::apply_from(const paragraph_format_properties & Other)
{
apply_line_width(fo_line_height_, Other.fo_line_height_);
......
......@@ -60,7 +60,7 @@ public:
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element(office_element_ptr & child){}
virtual void serialize(std::wostream & strm){}
virtual void serialize(std::wostream & strm);
length style_position_;
_CP_OPT(style_type) style_type_;
......@@ -94,7 +94,7 @@ public:
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element(office_element_ptr & child){}
virtual void serialize(std::wostream & strm){}
virtual void serialize(std::wostream & strm);
office_element_ptr_array style_tab_stops_;
};
......@@ -115,7 +115,7 @@ public:
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element(office_element_ptr & child){}
virtual void serialize(std::wostream & strm){}
virtual void serialize(std::wostream & strm);
drop_cap_length style_length_;
......@@ -143,7 +143,7 @@ public:
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element(office_element_ptr & child){}
virtual void serialize(std::wostream & strm){}
virtual void serialize(std::wostream & strm);
_CP_OPT(style_repeat) style_repeat_;
_CP_OPT(style_position) style_position_;
......@@ -164,7 +164,7 @@ public:
void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name,odf_conversion_context * Context);
void add_child_element(office_element_ptr & child){}
void serialize(std::wostream & strm){}
void serialize(std::wostream & strm, const wchar_t * ns, const wchar_t * name );
void apply_from(const paragraph_format_properties & Other);
......@@ -351,7 +351,7 @@ public:
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element(office_element_ptr & child){}
virtual void serialize(std::wostream & strm){}
virtual void serialize(std::wostream & strm);
const paragraph_format_properties & content() const { return style_paragraph_properties_content_; }
......
......@@ -54,26 +54,6 @@ void table_format_properties::serialize(std::wostream & _Wostream,const wchar_t
}
}
/*
[ ] w:tblStyle Referenced Table Style
[ ] w:tblpPr Floating Table Positioning
[ ] w:tblOverlap Floating Table Allows Other Tables to Overlap
[ ] w:bidiVisual Visually Right to Left Table
[ ] w:tblStyleRowBandSize Number of Rows in Row Band
[ ] w:tblStyleColBandSize Number of Columns in Column Band
[x] w:tblW Preferred Table Width
[x] w:jc Table Alignment
[ ] w:tblCellSpacing Table Cell Spacing Default
[ ] w:tblInd Table Indent from Leading Margin
[ ] w:tblBorders Table Borders
[ ] w:shd Table Shading
[ ] w:tblLayout Table Layout
[ ] w:tblCellMar Table Cell Margin Defaults
[ ] w:tblLook Table Style Conditional Formatting Settings
[ ] w:tblPrChange Revision Information for Table Properties
*/
// style:table-properties
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_table_properties::ns = L"style";
......@@ -93,7 +73,19 @@ void style_table_properties::serialize(std::wostream & _Wostream)
// style-table-column-properties-attlist
//////////////////////////////////////////////////////////////////////////////////////////////////
void style_table_column_properties_attlist::serialize(std::wostream & _Wostream,const wchar_t * ns, const wchar_t * name )
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"style:column-width", style_column_width_);
CP_XML_ATTR_OPT(L"style:rel-column-width", style_rel_column_width_);
CP_XML_ATTR_OPT(L"style:use-optimal-column-width", style_use_optimal_column_width_);
common_break_attlist_.serialize(CP_GET_XML_NODE());
}
}
}
// style:table-column-properties
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_table_column_properties::ns = L"style";
......@@ -103,7 +95,10 @@ void style_table_column_properties::create_child_element( const ::std::wstring
{
CP_NOT_APPLICABLE_ELM();
}
void style_table_column_properties::serialize(std::wostream & strm)
{
style_table_column_properties_attlist_.serialize(strm,ns,name);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
......@@ -112,8 +107,6 @@ void style_table_column_properties::create_child_element( const ::std::wstring
const wchar_t * style_table_cell_properties::ns = L"style";
const wchar_t * style_table_cell_properties::name = L"table-cell-properties";
void style_table_cell_properties::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
{
if (L"style" == Ns && L"background-image" == Name)
......@@ -126,29 +119,45 @@ void style_table_cell_properties::create_child_element( const ::std::wstring & N
}
}
// style-table-row-properties-attlist
//////////////////////////////////////////////////////////////////////////////////////////////////
// style:table-row-properties
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_table_row_properties::ns = L"style";
const wchar_t * style_table_row_properties::name = L"table-row-properties";
void style_table_cell_properties::serialize(std::wostream & strm)
{
style_table_cell_properties_attlist_.serialize(strm,ns,name);
if (style_background_image_)style_background_image_->serialize(strm);
}
void style_table_row_properties::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
void style_table_cell_properties_attlist::serialize(std::wostream & _Wostream ,const wchar_t * ns, const wchar_t * name )
{
if (L"style" == Ns && L"background-image" == Name)
CP_XML_WRITER(_Wostream)
{
CP_CREATE_ELEMENT(style_background_image_);
}
else
CP_XML_NODE_SIMPLE()
{
CP_NOT_APPLICABLE_ELM();
CP_XML_ATTR_OPT(L"style:vertical-align", style_vertical_align_);
CP_XML_ATTR_OPT(L"style:text-align-source", style_text_align_source_);
CP_XML_ATTR_OPT(L"style:direction", style_direction_);
CP_XML_ATTR_OPT(L"style:glyph-orientation-vertical", style_glyph_orientation_vertical_);
common_shadow_attlist_.serialize(CP_GET_XML_NODE());
common_background_color_attlist_.serialize(CP_GET_XML_NODE());
common_border_attlist_.serialize(CP_GET_XML_NODE());
common_border_line_width_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"style:diagonal-tl-br", style_diagonal_tl_br_);
CP_XML_ATTR_OPT(L"style:diagonal-tl-br-widths", style_diagonal_tl_br_widths_);
CP_XML_ATTR_OPT(L"style:diagonal-bl-tr", style_diagonal_bl_tr_);
CP_XML_ATTR_OPT(L"style:diagonal-bl-tr-widths", style_diagonal_bl_tr_widths_);
common_padding_attlist_.serialize(CP_GET_XML_NODE());
common_rotation_angle_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"fo:wrap-option", fo_wrap_option_);
CP_XML_ATTR_OPT(L"style:rotation-align", style_rotation_align_);
CP_XML_ATTR_OPT(L"style:cell-protect", style_cell_protect_);
CP_XML_ATTR_OPT(L"style:print-content", style_print_content_);
CP_XML_ATTR_OPT(L"style:decimal-places", style_decimal_places_);
CP_XML_ATTR_OPT(L"style:repeat-content", style_repeat_content_);
CP_XML_ATTR_OPT(L"style:shrink-to-fit", style_shrink_to_fit_);
}
}
}
/////
void style_table_cell_properties_attlist::apply_from(const style_table_cell_properties_attlist & Other)
{
_CP_APPLY_PROP(style_vertical_align_, Other.style_vertical_align_);
......@@ -177,6 +186,46 @@ void style_table_cell_properties_attlist::apply_from(const style_table_cell_prop
_CP_APPLY_PROP(style_repeat_content_, Other.style_repeat_content_);
_CP_APPLY_PROP(style_shrink_to_fit_, Other.style_shrink_to_fit_);
}
// style-table-row-properties-attlist
//////////////////////////////////////////////////////////////////////////////////////////////////
void style_table_row_properties_attlist::serialize(std::wostream & _Wostream ,const wchar_t * ns, const wchar_t * name )
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"style:row-height", style_row_height_);
CP_XML_ATTR_OPT(L"style:min-row-height", style_min_row_height_);
CP_XML_ATTR_OPT(L"style:use-optimal-row-height", style_use_optimal_row_height_);
common_background_color_attlist_.serialize(CP_GET_XML_NODE());
common_break_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"fo:keep-together", fo_keep_together_);
}
}
}
// style:table-row-properties
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_table_row_properties::ns = L"style";
const wchar_t * style_table_row_properties::name = L"table-row-properties";
void style_table_row_properties::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
{
if (L"style" == Ns && L"background-image" == Name)
{
CP_CREATE_ELEMENT(style_background_image_);
}
else
{
CP_NOT_APPLICABLE_ELM();
}
}
void style_table_row_properties::serialize(std::wostream & strm)
{
style_table_row_properties_attlist_.serialize(strm,ns,name);
if (style_background_image_)style_background_image_->serialize(strm);
}
/////
}
}
......@@ -82,6 +82,7 @@ CP_REGISTER_OFFICE_ELEMENT2(style_table_properties);
class style_table_column_properties_attlist
{
public:
void serialize(std::wostream & strm ,const wchar_t * ns, const wchar_t * name );
_CP_OPT(length) style_column_width_;
_CP_OPT(length) style_rel_column_width_;
......@@ -90,8 +91,6 @@ public:
};
/// \class style_table_column_properties
/// style-table-column-properties
/// style:table-column-properties
class style_table_column_properties : public office_element_impl<style_table_column_properties>
{
......@@ -106,7 +105,7 @@ public:
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element(office_element_ptr & child)
{std::wstringstream str; str <<L"Non add child in "; str << ns; str << L":"; str <<name; _CP_LOG(error) << str.str();}
virtual void serialize(std::wostream & strm){}
virtual void serialize(std::wostream & strm);
style_table_column_properties_attlist style_table_column_properties_attlist_;
......@@ -118,6 +117,7 @@ CP_REGISTER_OFFICE_ELEMENT2(style_table_column_properties);
class style_table_row_properties_attlist
{
public:
void serialize(std::wostream & strm ,const wchar_t * ns, const wchar_t * name );
_CP_OPT(length) style_row_height_;
_CP_OPT(length) style_min_row_height_;
......@@ -143,7 +143,7 @@ public:
virtual void add_child_element(office_element_ptr & child)
{std::wstringstream str; str <<L"Non add child in "; str << ns; str << L":"; str <<name; _CP_LOG(error) << str.str();}
virtual void serialize(std::wostream & strm){}
virtual void serialize(std::wostream & strm);
public:
style_table_row_properties_attlist style_table_row_properties_attlist_;
......@@ -159,6 +159,7 @@ class style_table_cell_properties_attlist
public:
void apply_from(const style_table_cell_properties_attlist & Other);
void serialize(std::wostream & strm ,const wchar_t * ns, const wchar_t * name );
public:
// 15.11.1
......@@ -253,7 +254,7 @@ public:
virtual void add_child_element(office_element_ptr & child)
{std::wstringstream str; str <<L"Non add child in "; str << ns; str << L":"; str <<name; _CP_LOG(error) << str.str();}
virtual void serialize(std::wostream & strm){}
virtual void serialize(std::wostream & strm);
style_table_cell_properties_attlist style_table_cell_properties_attlist_;
office_element_ptr style_background_image_;
......
......@@ -279,7 +279,7 @@ void styles::add_child_element(office_element_ptr & child, odf_conversion_contex
break;
}
}
void styles::serialize(std::wostream & strm)
void styles::serialize(std::wostream & strm)//content from defferent element
{
BOOST_FOREACH(office_element_ptr & elm, number_styles_)
{
......
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