Commit 8edf8e80 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@54945 954022d7-b5bf-4e40-9824-e11837661b57
parent 1a082e2b
...@@ -287,6 +287,15 @@ typedef xml::writer::element<wchar_t> xml_element; ...@@ -287,6 +287,15 @@ typedef xml::writer::element<wchar_t> xml_element;
#define CP_XML_CONTENT(VAL) _xml_node_.contents((VAL)) #define CP_XML_CONTENT(VAL) _xml_node_.contents((VAL))
#define CP_XML_STREAM() _xml_node_.stream() #define CP_XML_STREAM() _xml_node_.stream()
#define CP_GET_XML_NODE() _xml_node_
#define CP_ATTR_NODE xml_element & _xml_node_
#define CP_XML_ATTR_OPT(NAME, VAL) if (VAL)CP_XML_ATTR(NAME, (*VAL))
#define CP_XML_NODE_SIMPLE() std::wstring NS_NAME = std::wstring(ns) + std::wstring(L":") + std::wstring(name); CP_XML_NODE(NS_NAME)
} }
......
...@@ -6,6 +6,20 @@ ...@@ -6,6 +6,20 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const draw_fill & _Val)
{
std::wstring fillType;
switch(_Val.get_type())
{
case draw_fill::none: _Wostream << L"none" ;break;
case draw_fill::hatch: _Wostream << L"hatch" ;break;
case draw_fill::solid: _Wostream << L"solid" ;break;
case draw_fill::gradient: _Wostream << L"gradient" ;break;
case draw_fill::bitmap: _Wostream << L"bitmap" ;break;
}
return _Wostream;
}
//std::wstring draw_fill::get_type_ms() //std::wstring draw_fill::get_type_ms()
//{ //{
// std::wstring fillType; // std::wstring fillType;
......
...@@ -4,7 +4,30 @@ ...@@ -4,7 +4,30 @@
#include <ostream> #include <ostream>
namespace cpdoccore { namespace odf { namespace cpdoccore { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const presentation_class & _Val)
{
std::wstring res = L"";
switch(_Val.get_type())
{
case presentation_class::title: _Wostream << L"title" ; break;
case presentation_class::subtitle: _Wostream << L"subtitle" ; break;
case presentation_class::graphic: _Wostream << L"graphic" ; break;
case presentation_class::object: _Wostream << L"object" ; break;
case presentation_class::chart: _Wostream << L"chart" ; break;
case presentation_class::table: _Wostream << L"table" ; break;
case presentation_class::orgchart: _Wostream << L"orgchart" ; break;
case presentation_class::header: _Wostream << L"header" ; break;
case presentation_class::footer: _Wostream << L"footer" ; break;
case presentation_class::date_time: _Wostream << L"date_time" ; break;
case presentation_class::page_number: _Wostream << L"page_number" ; break;
case presentation_class::page: _Wostream << L"page" ; break;
case presentation_class::notes: _Wostream << L"notes" ; break;
case presentation_class::handout: _Wostream << L"handout" ; break;
case presentation_class::outline: _Wostream << L"outline" ; break;
case presentation_class::text: _Wostream << L"text" ; break;
}
return _Wostream;
}
presentation_class presentation_class::parse(const std::wstring & Str) presentation_class presentation_class::parse(const std::wstring & Str)
{ {
std::wstring tmp = Str; std::wstring tmp = Str;
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const style_ref & _styleRef) std::wostream & operator << (std::wostream & _Wostream, const style_ref & _styleRef)
{ {
_Wostream << _styleRef.style_name(); _Wostream << _styleRef.style_name();
......
...@@ -59,6 +59,14 @@ std::wostream & operator << (std::wostream & _Wostream, const style_family & _Va ...@@ -59,6 +59,14 @@ std::wostream & operator << (std::wostream & _Wostream, const style_family & _Va
return _Wostream; return _Wostream;
} }
bool style_family::operator == (const style_family & rVal) const
{
const bool res =
get_type() == rVal.get_type();
return res;
}
style_family style_family::parse(const std::wstring & Str) style_family style_family::parse(const std::wstring & Str)
{ {
std::wstring tmp = Str; std::wstring tmp = Str;
......
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
{ {
return type_; return type_;
}; };
bool operator == (const style_family & rVal) const;
static style_family parse(const std::wstring & Str); static style_family parse(const std::wstring & Str);
private: private:
...@@ -47,7 +47,6 @@ private: ...@@ -47,7 +47,6 @@ private:
}; };
std::wostream & operator << (std::wostream & _Wostream, const style_family & _Val); std::wostream & operator << (std::wostream & _Wostream, const style_family & _Val);
} }
APPLY_PARSE_XML_ATTRIBUTES(odf::style_family); APPLY_PARSE_XML_ATTRIBUTES(odf::style_family);
......
...@@ -282,8 +282,6 @@ private: ...@@ -282,8 +282,6 @@ private:
std::wstring name_; std::wstring name_;
}; };
/// õðàíèëèùå äëÿ ñòèëåé ñïèñêîâ
class list_style_container class list_style_container
{ {
public: public:
......
...@@ -25,14 +25,32 @@ bool table_format_properties::create_child_element(const ::std::wstring & Ns, co ...@@ -25,14 +25,32 @@ bool table_format_properties::create_child_element(const ::std::wstring & Ns, co
} }
} }
void table_format_properties::serialize(std::wostream & _Wostream) void table_format_properties::serialize(std::wostream & _Wostream,const wchar_t * ns, const wchar_t * name)
{ {
CP_XML_WRITER(_Wostream) CP_XML_WRITER(_Wostream)
{ {
CP_XML_NODE_SIMPLE()
{
// content_->serialize(CP_XML_STREAM()); CP_XML_ATTR_OPT(L"style:width", style_width_);
CP_XML_ATTR_OPT(L"style:rel-width", style_rel_width_);
if (style_background_image_) style_background_image_->serialize(_Wostream); CP_XML_ATTR_OPT(L"table:align", table_align_);
CP_XML_ATTR_OPT(L"style:may-break-between-rows", style_may_break_between_rows_);
CP_XML_ATTR_OPT(L"table:border-model", table_border_model_);
CP_XML_ATTR_OPT(L"table:display", table_display_);
common_writing_mode_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_page_number_attlist_.serialize(CP_GET_XML_NODE());
common_break_attlist_.serialize(CP_GET_XML_NODE());
common_background_color_attlist_.serialize(CP_GET_XML_NODE());
common_shadow_attlist_.serialize(CP_GET_XML_NODE());
common_keep_with_next_attlist_.serialize(CP_GET_XML_NODE());
if (style_background_image_) style_background_image_->serialize(_Wostream);
}
} }
} }
...@@ -69,13 +87,8 @@ void style_table_properties::create_child_element(const ::std::wstring & Ns, con ...@@ -69,13 +87,8 @@ void style_table_properties::create_child_element(const ::std::wstring & Ns, con
void style_table_properties::serialize(std::wostream & _Wostream) void style_table_properties::serialize(std::wostream & _Wostream)
{ {
CP_XML_WRITER(_Wostream) table_format_properties_.serialize(_Wostream,ns,name);
{
CP_XML_NODE_SIMPLE()
{
table_format_properties_.serialize(_Wostream);
}
}
} }
// style-table-column-properties-attlist // style-table-column-properties-attlist
......
...@@ -31,7 +31,7 @@ class table_format_properties ...@@ -31,7 +31,7 @@ class table_format_properties
public: public:
bool create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context); bool create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
void serialize(std::wostream & strm); void serialize(std::wostream & strm ,const wchar_t * ns, const wchar_t * name );
private: private:
optional<length>::Type style_width_; optional<length>::Type style_width_;
optional<percent>::Type style_rel_width_; optional<percent>::Type style_rel_width_;
......
...@@ -123,7 +123,185 @@ void text_format_properties_content::apply_from(const text_format_properties_con ...@@ -123,7 +123,185 @@ void text_format_properties_content::apply_from(const text_format_properties_con
_CP_APPLY_PROP(style_text_overline_style_, Other.style_text_overline_style_); _CP_APPLY_PROP(style_text_overline_style_, Other.style_text_overline_style_);
} }
void text_format_properties_content::serialize(std::wostream & _Wostream,const wchar_t * ns, const wchar_t * name )
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
// 15.4.1
CP_XML_ATTR_OPT(L"fo:font-variant", fo_font_variant_);
// 15.4.2
CP_XML_ATTR_OPT(L"fo:text-transform", fo_text_transform_);
// 15.4.3
CP_XML_ATTR_OPT(L"fo:color", fo_color_);
// 15.4.4
CP_XML_ATTR_OPT(L"style:use-window-font-color", style_use_window_font_color_);
// 15.4.5
CP_XML_ATTR_OPT(L"style:text-outline", style_text_outline_);
// 15.4.6
CP_XML_ATTR_OPT(L"style:text-line-through-type", style_text_line_through_type_);
// 15.4.7
CP_XML_ATTR_OPT(L"style:text-line-through-style", style_text_line_through_style_);
// 15.4.8
CP_XML_ATTR_OPT(L"style:text-line-through-width", style_text_line_through_width_);
// 15.4.9
CP_XML_ATTR_OPT(L"style:text-line-through-color", style_text_line_through_color_);
// 15.4.10
CP_XML_ATTR_OPT(L"style:text-line-through-text", style_text_line_through_text_);
// 15.4.11
CP_XML_ATTR_OPT(L"style:text-line-through-text-style", style_text_line_through_text_style_);
// 15.4.12
CP_XML_ATTR_OPT(L"style:text-position", style_text_position_);
// 15.4.13
CP_XML_ATTR_OPT(L"style:font-name", style_font_name_);
CP_XML_ATTR_OPT(L"style:font-name-asian", style_font_name_asian_);
CP_XML_ATTR_OPT(L"style:font-name-complex", style_font_name_complex_);
// 15.4.14
CP_XML_ATTR_OPT(L"fo:font-family", fo_font_family_);
CP_XML_ATTR_OPT(L"style:font-family-asian", style_font_family_asian_);
CP_XML_ATTR_OPT(L"style:font-family-complex", style_font_family_complex_);
// 15.4.15
CP_XML_ATTR_OPT(L"style:font-family-generic", style_font_family_generic_);
CP_XML_ATTR_OPT(L"style:font-family-generic-asian", style_font_family_generic_asian_);
CP_XML_ATTR_OPT(L"style:font-family-generic-complex", style_font_family_generic_complex_);
// 15.4.16
CP_XML_ATTR_OPT(L"style:font-style-name", style_font_style_name_);
CP_XML_ATTR_OPT(L"style:font-style-name-asian", style_font_style_name_asian_);
CP_XML_ATTR_OPT(L"style:font-style-name-complex", style_font_style_name_complex_);
// 15.4.17
CP_XML_ATTR_OPT(L"style:font-pitch", style_font_pitch_);
CP_XML_ATTR_OPT(L"style:font-pitch", style_font_pitch_asian_);
CP_XML_ATTR_OPT(L"style:font-pitch-complex", style_font_pitch_complex_);
// 15.4.18
CP_XML_ATTR_OPT(L"style:font-charset", style_font_charset_);
CP_XML_ATTR_OPT(L"style:font-charset-asian", style_font_charset_asian_);
CP_XML_ATTR_OPT(L"style:font-charset-complex", style_font_charset_complex_);
// 15.4.19
CP_XML_ATTR_OPT(L"fo:font-size", fo_font_size_);
CP_XML_ATTR_OPT(L"style:font-size-asian", style_font_size_asian_);
CP_XML_ATTR_OPT(L"style:font-size-complex", style_font_size_complex_);
// 15.4.20
CP_XML_ATTR_OPT(L"style:font-size-rel", style_font_size_rel_);
CP_XML_ATTR_OPT(L"style:font-size-rel-asian", style_font_size_rel_asian_);
CP_XML_ATTR_OPT(L"style:font-size-rel-complex", style_font_size_rel_complex_);
// 15.4.21
CP_XML_ATTR_OPT(L"style:script-type", style_script_type_);
// 15.4.22
CP_XML_ATTR_OPT(L"fo:letter-spacing", fo_letter_spacing_);
// 15.4.23
CP_XML_ATTR_OPT(L"fo:language", fo_language_);
CP_XML_ATTR_OPT(L"style:language-asian", style_language_asian_);
CP_XML_ATTR_OPT(L"style:language-complex", style_language_complex_);
// 15.4.24
CP_XML_ATTR_OPT(L"fo:country", fo_country_);
CP_XML_ATTR_OPT(L"style:country-asian", style_country_asian_);
CP_XML_ATTR_OPT(L"style:country-complex", style_country_complex_);
// 15.4.25
CP_XML_ATTR_OPT(L"fo:font-style", fo_font_style_);
CP_XML_ATTR_OPT(L"style:font-style-asian", style_font_style_asian_);
CP_XML_ATTR_OPT(L"style:font-style-complex", style_font_style_complex_);
// 15.4.26
CP_XML_ATTR_OPT(L"style:font-relief", style_font_relief_);
// 15.4.27
CP_XML_ATTR_OPT(L"fo:text-shadow", fo_text_shadow_);
// 15.4.28
CP_XML_ATTR_OPT(L"style:text-underline-type", style_text_underline_type_);
// 15.4.29
CP_XML_ATTR_OPT(L"style:text-underline-style", style_text_underline_style_);
// 15.4.30
CP_XML_ATTR_OPT(L"style:text-underline-width", style_text_underline_width_);
// 15.4.31
CP_XML_ATTR_OPT(L"style:text-underline-color", style_text_underline_color_);
// 15.4.32
CP_XML_ATTR_OPT(L"fo:font-weight", fo_font_weight_);
CP_XML_ATTR_OPT(L"style:font-weight-asian", style_font_weight_asian_);
CP_XML_ATTR_OPT(L"style:font-weight-complex", style_font_weight_complex_);
// 15.4.33
CP_XML_ATTR_OPT(L"style:text-underline-mode", style_text_underline_mode_);
// 15.4.34
CP_XML_ATTR_OPT(L"style:text-line-through-mode", style_text_line_through_mode_);
// 15.4.35
CP_XML_ATTR_OPT(L"style:letter-kerning", style_letter_kerning_);
// 15.4.36
CP_XML_ATTR_OPT(L"style:text-blinking", style_text_blinking_);
// 15.4.37
CP_XML_ATTR_OPT(L"fo:background-color", fo_background_color_);
// 15.4.38
CP_XML_ATTR_OPT(L"style:text-combine", style_text_combine_);
// 15.4.39
CP_XML_ATTR_OPT(L"style:text-combine-start-char", style_text_combine_start_char_);
CP_XML_ATTR_OPT(L"style:text-combine-end-char", style_text_combine_end_char_);
// 15.4.40
CP_XML_ATTR_OPT(L"style:text-emphasize", style_text_emphasize_);
// 15.4.41
CP_XML_ATTR_OPT(L"style:text-scale", style_text_scale_);
// 15.4.42
CP_XML_ATTR_OPT(L"style:text-rotation-angle", style_text_rotation_angle_);
// 15.4.43
CP_XML_ATTR_OPT(L"style:text-rotation-scale", style_text_rotation_scale_);
// 15.4.44
CP_XML_ATTR_OPT(L"fo:hyphenate", fo_hyphenate_);
// 15.4.45
CP_XML_ATTR_OPT(L"fo:hyphenation-remain-char-count", fo_hyphenation_remain_char_count_);
// 15.4.46
CP_XML_ATTR_OPT(L"fo:hyphenation-push-char-count", fo_hyphenation_push_char_count_);
// 15.4.47
CP_XML_ATTR_OPT(L"text:display", text_display_);
CP_XML_ATTR_OPT(L"text:condition", text_condition_);
CP_XML_ATTR_OPT(L"style:text-overline-color", style_text_overline_color_);
CP_XML_ATTR_OPT(L"style:text-overline-mode", style_text_overline_mode_);
CP_XML_ATTR_OPT(L"style:text-overline-style", style_text_overline_style_);
}
}
}
// style:text-properties // style:text-properties
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
...@@ -135,7 +313,10 @@ void style_text_properties::create_child_element(const ::std::wstring & Ns, cons ...@@ -135,7 +313,10 @@ void style_text_properties::create_child_element(const ::std::wstring & Ns, cons
{ {
CP_NOT_APPLICABLE_ELM(); CP_NOT_APPLICABLE_ELM();
} }
void style_text_properties::serialize(std::wostream & strm)
{
text_format_properties_content_.serialize(strm,ns,name);
}
} }
} }
......
...@@ -42,7 +42,7 @@ namespace odf { ...@@ -42,7 +42,7 @@ namespace odf {
class text_format_properties_content class text_format_properties_content
{ {
public: public:
void serialize(std::wostream & strm){} void serialize(std::wostream & strm,const wchar_t * ns, const wchar_t * name );
void apply_from(const text_format_properties_content & Other); void apply_from(const text_format_properties_content & Other);
...@@ -280,7 +280,7 @@ public: ...@@ -280,7 +280,7 @@ public:
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name); virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element(office_element_ptr & child){} virtual void add_child_element(office_element_ptr & child){}
virtual void serialize(std::wostream & strm){} virtual void serialize(std::wostream & strm);
const text_format_properties_content & content() const { return text_format_properties_content_; } ; const text_format_properties_content & content() const { return text_format_properties_content_; } ;
text_format_properties_content & content() { return text_format_properties_content_; } ; text_format_properties_content & content() { return text_format_properties_content_; } ;
......
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