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

(1.2.0.128): ASCOfficeOdfFileW

канвасы, схемы-диаграммы(smart-art)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57846 954022d7-b5bf-4e40-9824-e11837661b57
parent bbbb523d
...@@ -286,19 +286,11 @@ public: ...@@ -286,19 +286,11 @@ public:
void serialize(CP_ATTR_NODE); void serialize(CP_ATTR_NODE);
public: public:
// fo:padding
_CP_OPT(length) fo_padding_; _CP_OPT(length) fo_padding_;
// fo:padding-top
_CP_OPT(length) fo_padding_top_; _CP_OPT(length) fo_padding_top_;
// fo:padding-bottom
_CP_OPT(length) fo_padding_bottom_; _CP_OPT(length) fo_padding_bottom_;
// fo:padding-left
_CP_OPT(length) fo_padding_left_; _CP_OPT(length) fo_padding_left_;
// fo:padding-right
_CP_OPT(length) fo_padding_right_; _CP_OPT(length) fo_padding_right_;
}; };
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
/* File created by MIDL compiler version 7.00.0555 */ /* File created by MIDL compiler version 7.00.0555 */
/* at Mon Apr 07 14:29:55 2014 /* at Wed Aug 13 19:13:58 2014
*/ */
/* Compiler settings for .\ASCOfficeOdfFileW.idl: /* Compiler settings for .\ASCOfficeOdfFileW.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555
......
...@@ -1379,6 +1379,10 @@ ...@@ -1379,6 +1379,10 @@
RelativePath=".\OdfFormat\shapes\oox_shapeStars.h" RelativePath=".\OdfFormat\shapes\oox_shapeStars.h"
> >
</File> </File>
<File
RelativePath=".\OdfFormat\Shapes\oox_shapeWordArt.h"
>
</File>
</Filter> </Filter>
<File <File
RelativePath=".\OdfFormat\abstract_xml.cpp" RelativePath=".\OdfFormat\abstract_xml.cpp"
......
...@@ -365,13 +365,18 @@ int draw_enhanced_geometry::parsing(_CP_OPT(std::wstring) val) ...@@ -365,13 +365,18 @@ int draw_enhanced_geometry::parsing(_CP_OPT(std::wstring) val)
/// draw-enhanced_geometry_attlist /// draw-enhanced_geometry_attlist
void draw_enhanced_geometry_attlist::serialize(CP_ATTR_NODE) void draw_enhanced_geometry_attlist::serialize(CP_ATTR_NODE)
{ {
CP_XML_ATTR_OPT(L"draw:type", draw_type_); CP_XML_ATTR_OPT(L"draw:type", draw_type_);
CP_XML_ATTR_OPT(L"draw:text-areas", draw_text_areas_); CP_XML_ATTR_OPT(L"draw:text-areas", draw_text_areas_);
CP_XML_ATTR_OPT(L"draw:modifiers", draw_modifiers_); CP_XML_ATTR_OPT(L"draw:modifiers", draw_modifiers_);
CP_XML_ATTR_OPT(L"draw:enhanced-path", draw_enhanced_path_); CP_XML_ATTR_OPT(L"draw:enhanced-path", draw_enhanced_path_);
CP_XML_ATTR_OPT(L"draw:glue-points", draw_glue_points_); CP_XML_ATTR_OPT(L"draw:glue-points", draw_glue_points_);
CP_XML_ATTR_OPT(L"draw:mirror-vertical", draw_mirror_vertical_); CP_XML_ATTR_OPT(L"draw:mirror-vertical", draw_mirror_vertical_);
CP_XML_ATTR_OPT(L"draw:mirror-horizontal", draw_mirror_horizontal_); CP_XML_ATTR_OPT(L"draw:mirror-horizontal", draw_mirror_horizontal_);
CP_XML_ATTR_OPT(L"draw:text-path", draw_text_path_);
CP_XML_ATTR_OPT(L"draw:text-path-mode", draw_text_path_mode_);
CP_XML_ATTR_OPT(L"draw:text-path-scale", draw_text_path_scale_);
CP_XML_ATTR_OPT(L"draw:text-path-same-letter-heights", draw_text_path_same_letter_heights_);
} }
// draw:enhanced_geometry // draw:enhanced_geometry
const wchar_t * draw_enhanced_geometry::ns = L"draw"; const wchar_t * draw_enhanced_geometry::ns = L"draw";
......
...@@ -285,14 +285,19 @@ CP_REGISTER_OFFICE_ELEMENT2(draw_handle); ...@@ -285,14 +285,19 @@ CP_REGISTER_OFFICE_ELEMENT2(draw_handle);
class draw_enhanced_geometry_attlist class draw_enhanced_geometry_attlist
{ {
public: public:
_CP_OPT(std::wstring) draw_type_; _CP_OPT(std::wstring) draw_type_;
_CP_OPT(std::wstring) draw_modifiers_; _CP_OPT(std::wstring) draw_modifiers_;
_CP_OPT(std::wstring) draw_enhanced_path_; _CP_OPT(std::wstring) draw_enhanced_path_;
_CP_OPT(std::wstring) draw_text_areas_; _CP_OPT(std::wstring) draw_text_areas_;
_CP_OPT(std::wstring) draw_glue_points_; _CP_OPT(std::wstring) draw_glue_points_;
_CP_OPT(Bool) draw_mirror_vertical_;
_CP_OPT(Bool) draw_mirror_horizontal_;
_CP_OPT(Bool) draw_mirror_vertical_; _CP_OPT(Bool) draw_text_path_;
_CP_OPT(Bool) draw_mirror_horizontal_; _CP_OPT(Bool) draw_text_path_same_letter_heights_;
_CP_OPT(std::wstring) draw_text_path_mode_;
_CP_OPT(std::wstring) draw_text_path_scale_;
void serialize(CP_ATTR_NODE); void serialize(CP_ATTR_NODE);
}; };
...@@ -312,17 +317,17 @@ public: ...@@ -312,17 +317,17 @@ public:
virtual void serialize(std::wostream & _Wostream); virtual void serialize(std::wostream & _Wostream);
draw_enhanced_geometry_attlist draw_enhanced_geometry_attlist_; draw_enhanced_geometry_attlist draw_enhanced_geometry_attlist_;
_CP_OPT(std::wstring) svg_viewbox_; _CP_OPT(std::wstring) svg_viewbox_;
typedef std::pair<std::wstring,std::wstring> pair_string_value; typedef std::pair<std::wstring,std::wstring> pair_string_value;
std::vector<draw_handle_geometry> draw_handle_geometry_; // std::vector<draw_handle_geometry> draw_handle_geometry_; //
std::vector<pair_string_value>draw_equation_array_; std::vector<pair_string_value> draw_equation_array_;
office_element_ptr_array draw_handle_; office_element_ptr_array draw_handle_;
office_element_ptr_array draw_equation_;// draw_handle - office_element_ptr_array draw_equation_;// draw_handle -
static int parsing(_CP_OPT(std::wstring) val);//todoooo static int parsing(_CP_OPT(std::wstring) val);//todoooo
......
...@@ -140,6 +140,8 @@ public: ...@@ -140,6 +140,8 @@ public:
void set_textarea_padding(double left,double top,double right,double bottom);//in cm void set_textarea_padding(double left,double top,double right,double bottom);//in cm
void set_textarea_writing_mode(int mode); void set_textarea_writing_mode(int mode);
void set_textarea_wrap(bool val); void set_textarea_wrap(bool val);
void set_textarea_fontcolor(std::wstring hexColor);
void set_textarea_font(_CP_OPT(std::wstring) & latin, _CP_OPT(std::wstring) & cs, _CP_OPT(std::wstring) & ea);
////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////
void start_gradient_style(); void start_gradient_style();
void set_gradient_type(int type); void set_gradient_type(int type);
......
...@@ -50,9 +50,18 @@ public: ...@@ -50,9 +50,18 @@ public:
void set_page_border(std::wstring top, std::wstring left, std::wstring bottom, std::wstring right); void set_page_border(std::wstring top, std::wstring left, std::wstring bottom, std::wstring right);
void set_page_border_shadow(bool val); void set_page_border_shadow(bool val);
void set_page_border_padding_bottom(int offset_type, double length_pt);
void set_page_border_padding_top(int offset_type, double length_pt);
void set_page_border_padding_left(int offset_type, double length_pt);
void set_page_border_padding_right(int offset_type, double length_pt);
void set_page_orientation(int type); void set_page_orientation(int type);
void set_page_size(_CP_OPT(length) width, _CP_OPT(length) height); void set_page_size(_CP_OPT(length) width, _CP_OPT(length) height);
void set_title_page_enable(bool val);
void set_pages_mirrored(bool val);
void add_footer(int type); void add_footer(int type);
void set_footer_size(_CP_OPT(length) length_); void set_footer_size(_CP_OPT(length) length_);
void add_header(int type); void add_header(int type);
......
...@@ -127,6 +127,16 @@ std::wstring odf_layout_state::get_name() ...@@ -127,6 +127,16 @@ std::wstring odf_layout_state::get_name()
return style_->style_page_layout_attlist_.style_name_.get_value_or(L""); return style_->style_page_layout_attlist_.style_name_.get_value_or(L"");
} }
void odf_layout_state::set_pages_mirrored(bool val)
{
style_page_layout* style_ = dynamic_cast<style_page_layout*>(elements_[0].elm.get());//0 - root
if (!style_)return;
style_->style_page_layout_attlist_.style_page_usage_ = page_usage(page_usage::Mirrored);
}
style_page_layout_properties *odf_layout_state::get_properties() style_page_layout_properties *odf_layout_state::get_properties()
{ {
style_page_layout_properties *result=NULL; style_page_layout_properties *result=NULL;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "office_elements.h" #include "office_elements.h"
#include "office_elements_create.h" #include "office_elements_create.h"
#include "length.h"
namespace cpdoccore { namespace cpdoccore {
namespace odf { namespace odf {
...@@ -68,6 +69,12 @@ public: ...@@ -68,6 +69,12 @@ public:
style_page_layout_properties *get_properties();// ... style_page_layout_properties *get_properties();// ...
style_header_footer_properties *get_header_properties();//-''- style_header_footer_properties *get_header_properties();//-''-
style_header_footer_properties *get_footer_properties();//-''- style_header_footer_properties *get_footer_properties();//-''-
void set_pages_mirrored(bool val);
_CP_OPT(length) header_size_;
_CP_OPT(length) footer_size_;
private: private:
std::wstring style_oox_name_; std::wstring style_oox_name_;
......
...@@ -30,9 +30,31 @@ odf_text_context::odf_text_context(odf_conversion_context *odf_context) ...@@ -30,9 +30,31 @@ odf_text_context::odf_text_context(odf_conversion_context *odf_context)
current_outline_ = 0; current_outline_ = 0;
in_field_ = false; in_field_ = false;
keep_next_paragraph_ = false;
list_state_.currnet_level = -1 ;
list_state_.started_list = false;
list_state_.started_list_item = false;
} }
odf_text_context::~odf_text_context() odf_text_context::~odf_text_context()
{ {
}
void odf_text_context::clear_params()
{
single_paragraph_ = false;
paragraph_properties_ = NULL;
text_properties_ = NULL;
current_outline_ = 0;
in_field_ = false;
keep_next_paragraph_ = false;
list_state_.currnet_level = -1 ;
list_state_.started_list = false;
list_state_.started_list_item = false;
} }
void odf_text_context::set_styles_context(odf_style_context* styles_context) void odf_text_context::set_styles_context(odf_style_context* styles_context)
{ {
...@@ -202,8 +224,11 @@ void odf_text_context::start_paragraph(office_element_ptr & elm, bool styled) ...@@ -202,8 +224,11 @@ void odf_text_context::start_paragraph(office_element_ptr & elm, bool styled)
text_h* h = dynamic_cast<text_h*>(elm.get()); text_h* h = dynamic_cast<text_h*>(elm.get());
if (h)p->paragraph_.paragraph_attrs_.text_style_name_ = style_ref(parent_paragraph_style_); if (h)p->paragraph_.paragraph_attrs_.text_style_name_ = style_ref(parent_paragraph_style_);
} }
if (paragraph_properties_)paragraph_properties_->content().fo_break_before_ = need_break_; if (paragraph_properties_ && need_break_)
need_break_ = boost::none; {
paragraph_properties_->content().fo_break_before_ = need_break_;
need_break_ = boost::none;
}
odf_element_state state={elm, style_name, style_elm,level}; odf_element_state state={elm, style_name, style_elm,level};
text_elements_list_.push_back(state); text_elements_list_.push_back(state);
...@@ -221,7 +246,7 @@ void odf_text_context::end_paragraph() ...@@ -221,7 +246,7 @@ void odf_text_context::end_paragraph()
current_level_.pop_back(); current_level_.pop_back();
} }
paragraph_properties_ = NULL; paragraph_properties_ = NULL;
//need_break_ = boost::none; text_properties_ = NULL;
} }
void odf_text_context::start_element(office_element_ptr & elm, office_element_ptr style_elm ,std::wstring style_name) void odf_text_context::start_element(office_element_ptr & elm, office_element_ptr style_elm ,std::wstring style_name)
...@@ -260,6 +285,7 @@ void odf_text_context::start_span(bool styled) ...@@ -260,6 +285,7 @@ void odf_text_context::start_span(bool styled)
std::wstring style_name; std::wstring style_name;
office_element_ptr style_elm; office_element_ptr style_elm;
text_properties_ = NULL;
if (styled) if (styled)
{ {
odf_style_state_ptr style_state = styles_context_->last_state(style_family::Text); odf_style_state_ptr style_state = styles_context_->last_state(style_family::Text);
...@@ -324,17 +350,25 @@ void odf_text_context::start_list_item() ...@@ -324,17 +350,25 @@ void odf_text_context::start_list_item()
current_level_.back().elm->add_child_element(list_elm); current_level_.back().elm->add_child_element(list_elm);
current_level_.push_back(state); current_level_.push_back(state);
list_state_.started_list_item = true;
list_state_.currnet_level++;
} }
void odf_text_context::end_list_item() void odf_text_context::end_list_item()
{ {
if (styles_context_ == NULL || single_paragraph_)return; if (styles_context_ == NULL || single_paragraph_)
return;
if (current_level_.size() > 0) if (current_level_.size() > 0)
current_level_.pop_back(); current_level_.pop_back();
list_state_.currnet_level--;
list_state_.started_list_item = false;
} }
void odf_text_context::start_list(std::wstring style_name) void odf_text_context::start_list(std::wstring style_name) //todoooo add new_numbering ???
{ {
if (styles_context_ == NULL || single_paragraph_)return; if (styles_context_ == NULL || single_paragraph_)return;
office_element_ptr list_elm; office_element_ptr list_elm;
create_element(L"text", L"list", list_elm, odf_context_); create_element(L"text", L"list", list_elm, odf_context_);
...@@ -346,7 +380,11 @@ void odf_text_context::start_list(std::wstring style_name) ...@@ -346,7 +380,11 @@ void odf_text_context::start_list(std::wstring style_name)
if (style_name.length() > 0) if (style_name.length() > 0)
{ {
text_list* list = dynamic_cast<text_list*>(list_elm.get()); text_list* list = dynamic_cast<text_list*>(list_elm.get());
if (list) list->text_style_name_ = style_ref(style_name); if (list)
{
list->text_style_name_ = style_ref(style_name);
list->text_continue_numbering_ = true;
}
} }
text_elements_list_.push_back(state); text_elements_list_.push_back(state);
...@@ -354,6 +392,8 @@ void odf_text_context::start_list(std::wstring style_name) ...@@ -354,6 +392,8 @@ void odf_text_context::start_list(std::wstring style_name)
current_level_.back().elm->add_child_element(list_elm); current_level_.back().elm->add_child_element(list_elm);
current_level_.push_back(state); current_level_.push_back(state);
list_state_.started_list = true;
} }
void odf_text_context::end_list() void odf_text_context::end_list()
{ {
...@@ -361,6 +401,9 @@ void odf_text_context::end_list() ...@@ -361,6 +401,9 @@ void odf_text_context::end_list()
if (current_level_.size() > 0) if (current_level_.size() > 0)
current_level_.pop_back(); current_level_.pop_back();
list_state_.started_list_item = false;
list_state_.started_list = false;
} }
/////////////////////////////////////////////////////////////////////////////////////////// LIST /////////////////////////////////////////////////////////////////////////////////////////// LIST
void odf_text_context::start_field(int type) void odf_text_context::start_field(int type)
...@@ -435,7 +478,16 @@ void odf_text_context::add_tab() ...@@ -435,7 +478,16 @@ void odf_text_context::add_tab()
if (current_level_.size()>0) if (current_level_.size()>0)
current_level_.back().elm->add_child_element(elm); current_level_.back().elm->add_child_element(elm);
} }
void odf_text_context::add_break(int type, int clear) void odf_text_context::save_property_break()
{
if (paragraph_properties_ == NULL) return;
if (!need_break_) return;
paragraph_properties_->content().fo_break_before_ = need_break_;
need_break_ = boost::none;
}
void odf_text_context::set_type_break(int type, int clear)
{ {
//brclearAll = 0, //brclearAll = 0,
//brclearLeft = 1, //brclearLeft = 1,
......
...@@ -29,6 +29,7 @@ public: ...@@ -29,6 +29,7 @@ public:
odf_text_context(odf_conversion_context *odf_context); odf_text_context(odf_conversion_context *odf_context);
~odf_text_context(); ~odf_text_context();
public: public:
void clear_params();
void set_styles_context(odf_style_context* styles_context);// embedded void set_styles_context(odf_style_context* styles_context);// embedded
odf_style_context* get_styles_context();// embedded odf_style_context* get_styles_context();// embedded
...@@ -46,7 +47,6 @@ public: ...@@ -46,7 +47,6 @@ public:
void start_paragraph(office_element_ptr & elm, bool styled = false); void start_paragraph(office_element_ptr & elm, bool styled = false);
void end_paragraph(); void end_paragraph();
bool is_need_break(){return bool(need_break_);}
void start_element(office_element_ptr & elm, office_element_ptr style_elm = office_element_ptr(),std::wstring style_name = L""); void start_element(office_element_ptr & elm, office_element_ptr style_elm = office_element_ptr(),std::wstring style_name = L"");
void end_element(); void end_element();
...@@ -63,7 +63,10 @@ public: ...@@ -63,7 +63,10 @@ public:
void start_list(std::wstring style_name); void start_list(std::wstring style_name);
void end_list(); void end_list();
void add_break(int type, int clear); bool is_need_break(){return bool(need_break_);}
void set_type_break(int type, int clear);
void save_property_break();
void add_tab(); void add_tab();
int current_outline_; int current_outline_;
...@@ -79,7 +82,22 @@ public: ...@@ -79,7 +82,22 @@ public:
style_paragraph_properties *get_paragraph_properties(){return paragraph_properties_;} style_paragraph_properties *get_paragraph_properties(){return paragraph_properties_;}
void set_outline_level(int level); void set_outline_level(int level);
bool get_KeepNextParagraph() {return keep_next_paragraph_;}
void set_KeepNextParagraph(bool val) {keep_next_paragraph_ = val;}
bool get_list_item_state() {return list_state_.started_list_item;}
struct _list_state
{
bool started_list_item;
bool started_list;
int currnet_level;
}list_state_;
private: private:
bool keep_next_paragraph_;
_CP_OPT(fo_break) need_break_; _CP_OPT(fo_break) need_break_;
bool single_paragraph_; bool single_paragraph_;
......
...@@ -45,9 +45,6 @@ odt_conversion_context::odt_conversion_context(package::odf_document * outputDoc ...@@ -45,9 +45,6 @@ odt_conversion_context::odt_conversion_context(package::odf_document * outputDoc
is_hyperlink_ = false; is_hyperlink_ = false;
is_footer_header_ = false; is_footer_header_ = false;
list_state_.currnet_level = -1 ;
list_state_.started = false;
drop_cap_state_.clear(); drop_cap_state_.clear();
} }
...@@ -221,11 +218,17 @@ void odt_conversion_context::add_page_break() ...@@ -221,11 +218,17 @@ void odt_conversion_context::add_page_break()
//http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415190_253892949 //http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415190_253892949
// !! span, ... !! // !! span, ... !!
if (para = dynamic_cast<text_p*>(current_root_elements_.back().elm.get())) //if (para = dynamic_cast<text_p*>(current_root_elements_.back().elm.get()))
//{
// style_ = dynamic_cast<style*>(current_root_elements_.back().style_elm.get());//
// end_paragraph();
//}
//else/* if (header = dynamic_cast<text_h*>(current_root_elements_.back().elm.get()))*/
{ {
style_ = dynamic_cast<style*>(current_root_elements_.back().style_elm.get()); // ( ) -
end_paragraph(); // -
} text_context()->save_property_break();
}
text_context()->start_element(elm); text_context()->start_element(elm);
add_to_root(); add_to_root();
text_context()->end_element(); text_context()->end_element();
...@@ -238,7 +241,7 @@ void odt_conversion_context::add_page_break() ...@@ -238,7 +241,7 @@ void odt_conversion_context::add_page_break()
{ {
style_paragraph_properties * new_props = NULL; style_paragraph_properties * new_props = NULL;
if (styles_context()->last_state()) if (styles_context()->last_state())
{ {// -
new_props = styles_context()->last_state()->get_paragraph_properties(); new_props = styles_context()->last_state()->get_paragraph_properties();
if (new_props)new_props->apply_from(style_->style_content_.get_style_paragraph_properties()); if (new_props)new_props->apply_from(style_->style_content_.get_style_paragraph_properties());
...@@ -439,55 +442,44 @@ void odt_conversion_context::end_paragraph() ...@@ -439,55 +442,44 @@ void odt_conversion_context::end_paragraph()
void odt_conversion_context::start_list_item(int level, std::wstring style_name ) void odt_conversion_context::start_list_item(int level, std::wstring style_name )
{ {
if (list_state_.started == false) if (text_context()->list_state_.started_list == false)
{ {
text_context()->start_list(style_name); text_context()->start_list(style_name);
list_state_.started = true;
add_to_root(); add_to_root();
} }
/* if (list_state_.currnet_level == level)
{ if (text_context()->list_state_.currnet_level >= level)
text_context()->start_list_item();
list_state_.currnet_level++;
}
else */
if (list_state_.currnet_level >= level)
{ {
while (list_state_.currnet_level >= level) while (text_context()->list_state_.currnet_level >= level)
{ {
text_context()->end_list_item(); text_context()->end_list_item();
list_state_.currnet_level--;
} }
} }
if (list_state_.currnet_level < level) if (text_context()->list_state_.currnet_level < level)
{ {
while (list_state_.currnet_level < level) while (text_context()->list_state_.currnet_level < level)
{ {
text_context()->start_list_item(); text_context()->start_list_item();
list_state_.currnet_level++;
} }
} }
} }
void odt_conversion_context::end_list_item() void odt_conversion_context::end_list_item()
{ {
if (list_state_.currnet_level < 0) return; if (text_context()->list_state_.currnet_level < 0)
return;
text_context()->end_list_item(); text_context()->end_list_item();
list_state_.currnet_level--;
} }
void odt_conversion_context::set_no_list() void odt_conversion_context::set_no_list()
{ {
if (list_state_.started == false) return; if (text_context()->list_state_.started_list == false) return;
while (list_state_.currnet_level >=0) while (text_context()->list_state_.currnet_level >=0)
{ {
text_context()->end_list_item(); text_context()->end_list_item();
list_state_.currnet_level--;
} }
text_context()->end_list(); text_context()->end_list();
list_state_.started = false;
} }
void odt_conversion_context::flush_section() void odt_conversion_context::flush_section()
{ {
...@@ -495,7 +487,8 @@ void odt_conversion_context::flush_section() ...@@ -495,7 +487,8 @@ void odt_conversion_context::flush_section()
{ {
for (long i=0; i< current_root_elements_.size(); i++) for (long i=0; i< current_root_elements_.size(); i++)
{ {
if (sections_.back().continuous && i<2)// - add_page_break if ((sections_.back().continuous && i<2) || !sections_.back().continuous)
// - add_page_break
{ {
text_soft_page_break * break_ = dynamic_cast<text_soft_page_break*>(current_root_elements_[i].elm.get()); text_soft_page_break * break_ = dynamic_cast<text_soft_page_break*>(current_root_elements_[i].elm.get());
if (break_) if (break_)
......
...@@ -154,18 +154,7 @@ private: ...@@ -154,18 +154,7 @@ private:
double characters_size_pt; double characters_size_pt;
}drop_cap_state_; }drop_cap_state_;
struct _list_state
{
// office_element_ptr elm;
// office_element_ptr style_elm;
// std::wstring style_name;
//
// bool empty;
// bool continuous;
bool started;
int currnet_level;
}list_state_;
}; };
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "Shapes\oox_shapePrimitives.h" #include "Shapes\oox_shapePrimitives.h"
#include "Shapes\oox_shapeRibbons.h" #include "Shapes\oox_shapeRibbons.h"
#include "Shapes\oox_shapeConnectors.h" #include "Shapes\oox_shapeConnectors.h"
#include "Shapes\oox_shapeWordArt.h"
#include "..\..\..\Common\DocxFormat\Source\Common\SimpleTypes_Drawing.h" #include "..\..\..\Common\DocxFormat\Source\Common\SimpleTypes_Drawing.h"
...@@ -37,10 +38,51 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType) ...@@ -37,10 +38,51 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
case SimpleTypes::shapetypeStar16: return boost::make_shared<oox_shape_star16>(); case SimpleTypes::shapetypeStar16: return boost::make_shared<oox_shape_star16>();
case SimpleTypes::shapetypeStar32: return boost::make_shared<oox_shape_star32>(); case SimpleTypes::shapetypeStar32: return boost::make_shared<oox_shape_star32>();
//case (2001 + SimpleTypes::textshapetypeTextArchDown):
//case (2001 + SimpleTypes::textshapetypeTextArchDownPour):
//case (2001 + SimpleTypes::textshapetypeTextArchUp):
//case (2001 + SimpleTypes::textshapetypeTextArchUpPour):
//case (2001 + SimpleTypes::textshapetypeTextButton):
//case (2001 + SimpleTypes::textshapetypeTextButtonPour):
//case (2001 + SimpleTypes::textshapetypeTextCanDown):
//case (2001 + SimpleTypes::textshapetypeTextCanUp):
//case (2001 + SimpleTypes::textshapetypeTextCascadeDown):
//case (2001 + SimpleTypes::textshapetypeTextCascadeUp):
//case (2001 + SimpleTypes::textshapetypeTextChevron):
//case (2001 + SimpleTypes::textshapetypeTextChevronInverted):
//case (2001 + SimpleTypes::textshapetypeTextCircle):
case (2001 + SimpleTypes::textshapetypeTextCirclePour): return boost::make_shared<oox_shape_textCirclePour>();
//case (2001 + SimpleTypes::textshapetypeTextCurveDown):
//case (2001 + SimpleTypes::textshapetypeTextCurveUp):
//case (2001 + SimpleTypes::textshapetypeTextDeflate):
//case (2001 + SimpleTypes::textshapetypeTextDeflateBottom):
//case (2001 + SimpleTypes::textshapetypeTextDeflateInflate):
//case (2001 + SimpleTypes::textshapetypeTextDeflateInflateDeflate):
//case (2001 + SimpleTypes::textshapetypeTextDeflateTop):
//case (2001 + SimpleTypes::textshapetypeTextDoubleWave1):
//case (2001 + SimpleTypes::textshapetypeTextFadeDown):
//case (2001 + SimpleTypes::textshapetypeTextFadeLeft):
//case (2001 + SimpleTypes::textshapetypeTextFadeRight):
//case (2001 + SimpleTypes::textshapetypeTextFadeUp):
//case (2001 + SimpleTypes::textshapetypeTextInflate):
//case (2001 + SimpleTypes::textshapetypeTextInflateBottom):
//case (2001 + SimpleTypes::textshapetypeTextInflateTop):
case (2001 + SimpleTypes::textshapetypeTextPlain): return boost::make_shared<oox_shape_textPlain>();
//case (2001 + SimpleTypes::textshapetypeTextRingInside):
//case (2001 + SimpleTypes::textshapetypeTextRingOutside):
//case (2001 + SimpleTypes::textshapetypeTextSlantDown):
//case (2001 + SimpleTypes::textshapetypeTextSlantUp):
//case (2001 + SimpleTypes::textshapetypeTextStop):
//case (2001 + SimpleTypes::textshapetypeTextTriangle):
//case (2001 + SimpleTypes::textshapetypeTextTriangleInverted):
//case (2001 + SimpleTypes::textshapetypeTextWave1):
//case (2001 + SimpleTypes::textshapetypeTextWave2):
//case (2001 + SimpleTypes::textshapetypeTextWave4):
//case SimpleTypes::shapetypeStraightConnector1: return boost::make_shared<oox_shape_straightConnector1>(); //case SimpleTypes::shapetypeStraightConnector1: return boost::make_shared<oox_shape_straightConnector1>();
default: default:
return boost::make_shared<oox_shape>(); if (ooxPrstGeomType > 2000) return boost::make_shared<oox_shape_textPlain>();
else return boost::make_shared<oox_shape>();
} }
} }
......
...@@ -28,74 +28,43 @@ class style_page_layout_properties_attlist ...@@ -28,74 +28,43 @@ class style_page_layout_properties_attlist
{ {
public: public:
void serialize(CP_ATTR_NODE); void serialize(CP_ATTR_NODE);
_CP_OPT(length) fo_page_width_; // +
_CP_OPT(length) fo_page_height_; // + _CP_OPT(length) fo_page_width_;
common_num_format_attlist common_num_format_attlist_; _CP_OPT(length) fo_page_height_;
common_num_format_attlist common_num_format_attlist_;
common_num_format_prefix_suffix_attlist common_num_format_prefix_suffix_attlist_; common_num_format_prefix_suffix_attlist common_num_format_prefix_suffix_attlist_;
_CP_OPT(std::wstring) style_paper_tray_name_;
_CP_OPT(std::wstring) style_print_orientation_; // + common_horizontal_margin_attlist common_horizontal_margin_attlist_;
//15.2.5 common_vertical_margin_attlist common_vertical_margin_attlist_;
common_horizontal_margin_attlist common_horizontal_margin_attlist_; common_margin_attlist common_margin_attlist_;
common_vertical_margin_attlist common_vertical_margin_attlist_;
common_margin_attlist common_margin_attlist_;
// 15.2.6 common_border_attlist common_border_attlist_;
common_border_attlist common_border_attlist_; common_border_line_width_attlist common_border_line_width_attlist_;
// 15.2.7 common_padding_attlist common_padding_attlist_;
common_border_line_width_attlist common_border_line_width_attlist_; common_shadow_attlist common_shadow_attlist_;
// 15.2.8
common_padding_attlist common_padding_attlist_;
// 15.2.9
common_shadow_attlist common_shadow_attlist_;
// 15.2.10 common_background_color_attlist common_background_color_attlist_;
common_background_color_attlist common_background_color_attlist_; common_writing_mode_attlist common_writing_mode_attlist_;
// 15.2.12
_CP_OPT(style_ref) style_register_truth_ref_style_name_; _CP_OPT(style_ref) style_register_truth_ref_style_name_;
// 15.2.13 TODO _CP_OPT(std::wstring) style_print_;
_CP_OPT(std::wstring) style_print_; _CP_OPT(std::wstring) style_paper_tray_name_;
_CP_OPT(std::wstring) style_print_orientation_;
// 15.2.14 _CP_OPT(direction) style_print_page_order_;
_CP_OPT(direction) style_print_page_order_; _CP_OPT(std::wstring) style_first_page_number_;
_CP_OPT(percent) style_scale_to_;
// 15.2.15 TODO _CP_OPT(unsigned int) style_scale_to_pages_;
_CP_OPT(std::wstring) style_first_page_number_; _CP_OPT(table_centering) style_table_centering_;
_CP_OPT(length) style_footnote_max_height_;
// 15.2.16 _CP_OPT(layout_grid_mode) style_layout_grid_mode_;
_CP_OPT(percent) style_scale_to_; _CP_OPT(length) style_layout_grid_base_height_;
_CP_OPT(unsigned int) style_scale_to_pages_; _CP_OPT(length) style_layout_grid_ruby_height_;
_CP_OPT(unsigned int) style_layout_grid_lines_;
// 15.2.17 _CP_OPT(color) style_layout_grid_color_;
_CP_OPT(table_centering) style_table_centering_; _CP_OPT(Bool) style_layout_grid_ruby_below_;
// 15.2.18 _CP_OPT(Bool) style_layout_grid_print_;
_CP_OPT(length) style_footnote_max_height_; _CP_OPT(Bool) style_layout_grid_display_;
// 15.2.19
common_writing_mode_attlist common_writing_mode_attlist_;
// 15.2.21
_CP_OPT(layout_grid_mode) style_layout_grid_mode_;
// 15.2.22
_CP_OPT(length) style_layout_grid_base_height_;
// 15.2.23
_CP_OPT(length) style_layout_grid_ruby_height_;
// 15.2.24
_CP_OPT(unsigned int) style_layout_grid_lines_;
// 15.2.25
_CP_OPT(color) style_layout_grid_color_;
// 15.2.26
_CP_OPT(Bool) style_layout_grid_ruby_below_;
// 15.2.27
_CP_OPT(Bool) style_layout_grid_print_;
// 15.2.28
_CP_OPT(Bool) style_layout_grid_display_;
}; };
......
...@@ -56,209 +56,113 @@ private: ...@@ -56,209 +56,113 @@ private:
public: public:
_CP_OPT(std::wstring) r_style_; _CP_OPT(std::wstring) r_style_;
_CP_OPT(font_variant) fo_font_variant_;
// 15.4.1 fo:font-variant _CP_OPT(text_transform) fo_text_transform_;
_CP_OPT(font_variant) fo_font_variant_; // + _CP_OPT(color) fo_color_;
// 15.4.2 fo:text-transform _CP_OPT(Bool) style_use_window_font_color_;
_CP_OPT(text_transform) fo_text_transform_; // + _CP_OPT(Bool) style_text_outline_;
// 15.4.3 fo:color _CP_OPT(line_type) style_text_line_through_type_;
_CP_OPT(color) fo_color_; // + _CP_OPT(line_style) style_text_line_through_style_;
// 15.4.4 style:use-window-font-color
_CP_OPT(Bool) style_use_window_font_color_;
// 15.4.5 style:text-outline
_CP_OPT(Bool) style_text_outline_; // +
// 15.4.6 style:text-line-through-type
_CP_OPT(line_type) style_text_line_through_type_; // +
// 15.4.7 style:text-line-through-style
_CP_OPT(line_style) style_text_line_through_style_; // +
// 15.4.8 style:text-line-through-width
_CP_OPT(line_width) style_text_line_through_width_; _CP_OPT(line_width) style_text_line_through_width_;
// 15.4.9 style:text-line-through-color
_CP_OPT(color) style_text_line_through_color_; _CP_OPT(color) style_text_line_through_color_;
// 15.4.10 style:text-line-through-text
_CP_OPT(std::wstring) style_text_line_through_text_; _CP_OPT(std::wstring) style_text_line_through_text_;
// 15.4.11 style:text-line-through-text-style
_CP_OPT(style_ref) style_text_line_through_text_style_; _CP_OPT(style_ref) style_text_line_through_text_style_;
// 15.4.12 style:text-position
_CP_OPT(text_position) style_text_position_; // +
// 15.4.13 style:font-name _CP_OPT(text_position) style_text_position_;
_CP_OPT(std::wstring) style_font_name_; // +
// style:font-name-asian _CP_OPT(std::wstring) style_font_name_;
_CP_OPT(std::wstring) style_font_name_asian_; // + _CP_OPT(std::wstring) style_font_name_asian_;
// style:font-name-complex _CP_OPT(std::wstring) style_font_name_complex_;
_CP_OPT(std::wstring) style_font_name_complex_; // +
// 15.4.14 fo:font-family
_CP_OPT(std::wstring) fo_font_family_; _CP_OPT(std::wstring) fo_font_family_;
// style:font-family-asian
_CP_OPT(std::wstring) style_font_family_asian_; _CP_OPT(std::wstring) style_font_family_asian_;
// style:font-family-complex
_CP_OPT(std::wstring) style_font_family_complex_; _CP_OPT(std::wstring) style_font_family_complex_;
// 15.4.15 style:font-family-generic
_CP_OPT(font_family_generic) style_font_family_generic_; _CP_OPT(font_family_generic) style_font_family_generic_;
// style:font-family-generic-asian
_CP_OPT(font_family_generic) style_font_family_generic_asian_; _CP_OPT(font_family_generic) style_font_family_generic_asian_;
// style:font-family-generic-complex
_CP_OPT(font_family_generic) style_font_family_generic_complex_; _CP_OPT(font_family_generic) style_font_family_generic_complex_;
// 15.4.16 style:font-style-name
_CP_OPT(std::wstring) style_font_style_name_; _CP_OPT(std::wstring) style_font_style_name_;
// style:font-style-name-asian
_CP_OPT(std::wstring) style_font_style_name_asian_; _CP_OPT(std::wstring) style_font_style_name_asian_;
// style:font-style-name-complex
_CP_OPT(std::wstring) style_font_style_name_complex_; _CP_OPT(std::wstring) style_font_style_name_complex_;
// 15.4.17 style:font-pitch
_CP_OPT(font_pitch) style_font_pitch_; _CP_OPT(font_pitch) style_font_pitch_;
// style:font-pitch
_CP_OPT(font_pitch) style_font_pitch_asian_; _CP_OPT(font_pitch) style_font_pitch_asian_;
// style:font-pitch-complex
_CP_OPT(font_pitch) style_font_pitch_complex_; _CP_OPT(font_pitch) style_font_pitch_complex_;
// 15.4.18 style:font-charset
_CP_OPT(std::wstring) style_font_charset_; _CP_OPT(std::wstring) style_font_charset_;
// style:font-charset-asian
_CP_OPT(std::wstring) style_font_charset_asian_; _CP_OPT(std::wstring) style_font_charset_asian_;
// style:font-charset-complex
_CP_OPT(std::wstring) style_font_charset_complex_; _CP_OPT(std::wstring) style_font_charset_complex_;
// 15.4.19 fo:font-size _CP_OPT(font_size) fo_font_size_;
_CP_OPT(font_size) fo_font_size_; // +
// style:font-size-asian
_CP_OPT(font_size) style_font_size_asian_; _CP_OPT(font_size) style_font_size_asian_;
// style:font-size-complex
_CP_OPT(font_size) style_font_size_complex_; _CP_OPT(font_size) style_font_size_complex_;
// 15.4.20 style:font-size-rel
_CP_OPT(length) style_font_size_rel_; _CP_OPT(length) style_font_size_rel_;
// style:font-size-rel-asian
_CP_OPT(length) style_font_size_rel_asian_; _CP_OPT(length) style_font_size_rel_asian_;
// style:font-size-rel-complex
_CP_OPT(length) style_font_size_rel_complex_; _CP_OPT(length) style_font_size_rel_complex_;
// 15.4.21 style:script-type
_CP_OPT(script_type) style_script_type_; _CP_OPT(script_type) style_script_type_;
// 15.4.22 fo:letter-spacing _CP_OPT(letter_spacing) fo_letter_spacing_;
_CP_OPT(letter_spacing) fo_letter_spacing_; // +
// 15.4.23 fo:language _CP_OPT(std::wstring) fo_language_;
_CP_OPT(std::wstring) fo_language_; // +
// style:language-asian
_CP_OPT(std::wstring) style_language_asian_; _CP_OPT(std::wstring) style_language_asian_;
// style:language-complex
_CP_OPT(std::wstring) style_language_complex_; _CP_OPT(std::wstring) style_language_complex_;
// 15.4.24 fo:country _CP_OPT(std::wstring) fo_country_;
_CP_OPT(std::wstring) fo_country_; // + _CP_OPT(std::wstring) style_country_asian_;
// style:country-asian _CP_OPT(std::wstring) style_country_complex_;
_CP_OPT(std::wstring) style_country_asian_;
// style:country-complex
_CP_OPT(std::wstring) style_country_complex_;
// 15.4.25 fo:font-style _CP_OPT(font_style) fo_font_style_;
_CP_OPT(font_style) fo_font_style_; // + _CP_OPT(font_style) style_font_style_asian_;
// style:font-style-asian _CP_OPT(font_style) style_font_style_complex_;
_CP_OPT(font_style) style_font_style_asian_;
// style:font-style-complex
_CP_OPT(font_style) style_font_style_complex_;
// 15.4.26 style:font-relief
_CP_OPT(font_relief) style_font_relief_; // +
// 15.4.27 fo:text-shadow
_CP_OPT(shadow_type) fo_text_shadow_; // +
// 15.4.28 style:text-underline-type _CP_OPT(font_relief) style_font_relief_;
_CP_OPT(line_type) style_text_underline_type_; // +
// 15.4.29 style:text-underline-style
_CP_OPT(line_style) style_text_underline_style_; // +
// 15.4.30 style:text-underline-width _CP_OPT(shadow_type) fo_text_shadow_;
_CP_OPT(line_width) style_text_underline_width_; // +
// 15.4.31 style:text-underline-color _CP_OPT(line_type) style_text_underline_type_;
_CP_OPT(underline_color) style_text_underline_color_; // + _CP_OPT(line_style) style_text_underline_style_;
_CP_OPT(line_width) style_text_underline_width_;
_CP_OPT(underline_color) style_text_underline_color_;
// 15.4.32 fo:font-weight _CP_OPT(font_weight) fo_font_weight_;
_CP_OPT(font_weight) fo_font_weight_; // +
// style:font-weight-asian
_CP_OPT(font_weight) style_font_weight_asian_; _CP_OPT(font_weight) style_font_weight_asian_;
// style:font-weight-complex
_CP_OPT(font_weight) style_font_weight_complex_; _CP_OPT(font_weight) style_font_weight_complex_;
// 15.4.33 style:text-underline-mode
_CP_OPT(line_mode) style_text_underline_mode_; _CP_OPT(line_mode) style_text_underline_mode_;
// 15.4.34 style:text-line-through-mode
_CP_OPT(line_mode) style_text_line_through_mode_; _CP_OPT(line_mode) style_text_line_through_mode_;
_CP_OPT(Bool) style_letter_kerning_;
// 15.4.35 style:letter-kerning
_CP_OPT(Bool) style_letter_kerning_;
// 15.4.36 style:text-blinking
_CP_OPT(Bool) style_text_blinking_; _CP_OPT(Bool) style_text_blinking_;
// 15.4.37 fo:background-color
_CP_OPT(background_color) fo_background_color_; _CP_OPT(background_color) fo_background_color_;
// 15.4.38 style:text-combine
_CP_OPT(text_combine) style_text_combine_; _CP_OPT(text_combine) style_text_combine_;
// 15.4.39 style:text-combine-start-char _CP_OPT(wchar_t) style_text_combine_start_char_;
_CP_OPT(wchar_t) style_text_combine_start_char_; _CP_OPT(wchar_t) style_text_combine_end_char_;
//style:text-combine-end-char
_CP_OPT(wchar_t) style_text_combine_end_char_;
// 15.4.40 style:text-emphasize _CP_OPT(text_emphasize) style_text_emphasize_;
_CP_OPT(text_emphasize) style_text_emphasize_; // + _CP_OPT(percent) style_text_scale_;
_CP_OPT(int) style_text_rotation_angle_;
// 15.4.41 style:text-scale
_CP_OPT(percent) style_text_scale_; // +
// 15.4.42 style:text-rotation-angle
_CP_OPT(int) style_text_rotation_angle_;
// 15.4.43 style:text-rotation-scale
_CP_OPT(text_rotation_scale) style_text_rotation_scale_; _CP_OPT(text_rotation_scale) style_text_rotation_scale_;
// 15.4.44 fo:hyphenate _CP_OPT(Bool) fo_hyphenate_;
_CP_OPT(Bool) fo_hyphenate_; _CP_OPT(unsigned int) fo_hyphenation_remain_char_count_;
_CP_OPT(unsigned int) fo_hyphenation_push_char_count_;
// 15.4.45 fo:hyphenation-remain-char-count
_CP_OPT(unsigned int) fo_hyphenation_remain_char_count_;
// 15.4.46 fo:hyphenation-push-char-count _CP_OPT(text_display) text_display_;
_CP_OPT(unsigned int) fo_hyphenation_push_char_count_;
// 15.4.47 text:display
_CP_OPT(text_display) text_display_; // +
// text:condition
_CP_OPT(std::wstring) text_condition_; _CP_OPT(std::wstring) text_condition_;
// style:text-overline-color
_CP_OPT(std::wstring) style_text_overline_color_; _CP_OPT(std::wstring) style_text_overline_color_;
// style:text-overline-mode
_CP_OPT(std::wstring) style_text_overline_mode_; _CP_OPT(std::wstring) style_text_overline_mode_;
// style:text-overline-style
_CP_OPT(std::wstring) style_text_overline_style_; _CP_OPT(std::wstring) style_text_overline_style_;
common_border_attlist common_border_attlist_; common_border_attlist common_border_attlist_;
......
...@@ -128,8 +128,8 @@ public: ...@@ -128,8 +128,8 @@ public:
virtual void serialize(std::wostream & _Wostream); virtual void serialize(std::wostream & _Wostream);
style_ref text_style_name_; style_ref text_style_name_;
_CP_OPT(bool) text_continue_numbering_; _CP_OPT(Bool) text_continue_numbering_;
office_element_ptr text_list_header_; office_element_ptr text_list_header_;
office_element_ptr_array text_list_items_; office_element_ptr_array text_list_items_;
......
...@@ -148,6 +148,10 @@ ...@@ -148,6 +148,10 @@
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
> >
<File
RelativePath=".\Oox2OdfConverter\ConvertDiagram.cpp"
>
</File>
<File <File
RelativePath=".\Oox2OdfConverter\Converter.cpp" RelativePath=".\Oox2OdfConverter\Converter.cpp"
> >
......
...@@ -81,6 +81,11 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown) ...@@ -81,6 +81,11 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
OOX::Drawing::CShape* pShape = static_cast<OOX::Drawing::CShape*>(oox_unknown); OOX::Drawing::CShape* pShape = static_cast<OOX::Drawing::CShape*>(oox_unknown);
convert(pShape); convert(pShape);
}break; }break;
case OOX::et_a_LockedCanvas:
{
OOX::Drawing::CLockedCanvas* pLockedCanvas = static_cast<OOX::Drawing::CLockedCanvas*>(oox_unknown);
convert(pLockedCanvas);
}break;
case OOX::et_a_prstGeom: case OOX::et_a_prstGeom:
{ {
OOX::Drawing::CPresetGeometry2D* pPresetGeom = static_cast<OOX::Drawing::CPresetGeometry2D*>(oox_unknown); OOX::Drawing::CPresetGeometry2D* pPresetGeom = static_cast<OOX::Drawing::CPresetGeometry2D*>(oox_unknown);
...@@ -208,21 +213,16 @@ void OoxConverter::convert(OOX::Drawing::CShape *oox_shape) ...@@ -208,21 +213,16 @@ void OoxConverter::convert(OOX::Drawing::CShape *oox_shape)
OOX::Drawing::CPresetGeometry2D * geometry = oox_shape->m_oSpPr->m_oPrstGeom.GetPointer(); OOX::Drawing::CPresetGeometry2D * geometry = oox_shape->m_oSpPr->m_oPrstGeom.GetPointer();
type =(geometry->m_oPrst.GetValue()); type =(geometry->m_oPrst.GetValue());
} }
if (oox_shape->m_oNvSpPr.IsInit() && oox_shape->m_oNvSpPr->m_oCNvSpPr.IsInit()) if (oox_shape->m_oNvSpPr.IsInit() && oox_shape->m_oNvSpPr->m_oCNvSpPr.IsInit() &&
{ oox_shape->m_oNvSpPr->m_oCNvSpPr->m_otxBox.GetValue() == 1) type = 2000; //textBox
if (oox_shape->m_oNvSpPr->m_oCNvSpPr->m_otxBox.GetValue() == 1)
type = 2000; //textBox if (type == SimpleTypes::shapetypeRect && oox_shape->m_oTxSp.IsInit() && oox_shape->m_oTxSp->m_oTxBody.IsInit()) type = 2000;
}
if (type == SimpleTypes::shapetypeRect && oox_shape->m_oTxSp.IsInit() && oox_shape->m_oTxSp->m_oTxBody.IsInit()) if (type == 2000 && oox_shape->m_oTxSp->m_oTxBody->m_oBodyPr.IsInit() && oox_shape->m_oTxSp->m_oTxBody->m_oBodyPr->m_oFromWordArt.ToBool())
{ {
type = 2000;// , , ... int wordart_type = convert(oox_shape->m_oTxSp->m_oTxBody->m_oBodyPr->m_oPrstTxWrap.GetPointer());
if (oox_shape->m_oTxSp->m_oTxBody->m_oBodyPr.IsInit())
{
int wordart_type = convert(oox_shape->m_oTxSp->m_oTxBody->m_oBodyPr->m_oPrstTxWrap.GetPointer());
if (wordart_type >=0)type = wordart_type; if (wordart_type >0)type = wordart_type;
}
} }
if (type < 0)return; if (type < 0)return;
...@@ -304,7 +304,54 @@ void OoxConverter::convert(OOX::Drawing::CGroupShapeProperties * oox_group_spP ...@@ -304,7 +304,54 @@ void OoxConverter::convert(OOX::Drawing::CGroupShapeProperties * oox_group_spP
} }
} }
void OoxConverter::convert(OOX::Drawing::CFontReference *style_font_ref)
{
if (!style_font_ref) return;
OOX::CTheme *theme = oox_theme();
if (!theme) return;
CString color;
if (style_font_ref->m_eType == OOX::Drawing::colorSheme)
{
color = style_font_ref->m_oShemeClr.m_oVal.ToString();
}
if (style_font_ref->m_oIdx.GetValue() == SimpleTypes::fontcollectionindexMajor)
{
convert(&theme->m_oThemeElements.m_oFontScheme.m_oMajorFont, &color);
}
if (style_font_ref->m_oIdx.GetValue() == SimpleTypes::fontcollectionindexMinor)
{
convert(&theme->m_oThemeElements.m_oFontScheme.m_oMinorFont, &color);
}
}
void OoxConverter::convert(OOX::Drawing::CFontCollection *style_font, CString *sheme_color)
{
if ((sheme_color) && (sheme_color->GetLength() >0))
{
std::wstring hexColor;
_CP_OPT(double) opacity;
OOX::Drawing::CSchemeColor sheme;
sheme.m_oVal.FromString(*sheme_color);
convert(&sheme, hexColor, opacity);
odf_context()->drawing_context()->set_textarea_fontcolor(hexColor);
}
if (style_font == NULL) return;
_CP_OPT(std::wstring) font_latin, font_cs, font_ea;
if (style_font->m_oCs.m_oTypeFace.IsInit()) font_cs = string2std_string(style_font->m_oCs.m_oTypeFace->GetValue());
if (style_font->m_oEa.m_oTypeFace.IsInit()) font_ea = string2std_string(style_font->m_oEa.m_oTypeFace->GetValue());
if (style_font->m_oLatin.m_oTypeFace.IsInit()) font_latin = string2std_string(style_font->m_oLatin.m_oTypeFace->GetValue());
odf_context()->drawing_context()->set_textarea_font(font_latin,font_ea,font_cs);
//nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
//CSimpleArray<OOX::Drawing::CSupplementalFont> m_arrFont;
}
void OoxConverter::convert(OOX::Drawing::CStyleMatrixReference *style_matrix_ref) void OoxConverter::convert(OOX::Drawing::CStyleMatrixReference *style_matrix_ref)
{ {
if (!style_matrix_ref) return; if (!style_matrix_ref) return;
...@@ -376,6 +423,25 @@ void OoxConverter::convert(OOX::Drawing::CShapeProperties * oox_spPr, OOX::Dra ...@@ -376,6 +423,25 @@ void OoxConverter::convert(OOX::Drawing::CShapeProperties * oox_spPr, OOX::Dra
bool use_fill_from_style = false; bool use_fill_from_style = false;
bool use_line_from_style = false; bool use_line_from_style = false;
if (oox_spPr->m_oXfrm.IsInit()) //CTransform2D
{
if (oox_spPr->m_oXfrm->m_oOff.IsInit())
{
odf_context()->drawing_context()->set_position(oox_spPr->m_oXfrm->m_oOff->m_oX.ToPoints(),
oox_spPr->m_oXfrm->m_oOff->m_oY.ToPoints());
}
if (oox_spPr->m_oXfrm->m_oExt.IsInit())
{
odf_context()->drawing_context()->set_size( oox_spPr->m_oXfrm->m_oExt->m_oCx.ToPoints(),
oox_spPr->m_oXfrm->m_oExt->m_oCy.ToPoints());
}
if (oox_spPr->m_oXfrm->m_oFlipH.GetValue() == SimpleTypes::onoffTrue)
odf_context()->drawing_context()->set_flip_H(true);
if (oox_spPr->m_oXfrm->m_oFlipV.GetValue() == SimpleTypes::onoffTrue)
odf_context()->drawing_context()->set_flip_V(true);
if (oox_spPr->m_oXfrm->m_oRot.GetValue() > 0)
odf_context()->drawing_context()->set_rotate(oox_spPr->m_oXfrm->m_oRot.GetValue());
}
switch(oox_spPr->m_eGeomType) switch(oox_spPr->m_eGeomType)
{ {
case OOX::Drawing::geomtypeCustom : case OOX::Drawing::geomtypeCustom :
...@@ -431,27 +497,6 @@ void OoxConverter::convert(OOX::Drawing::CShapeProperties * oox_spPr, OOX::Dra ...@@ -431,27 +497,6 @@ void OoxConverter::convert(OOX::Drawing::CShapeProperties * oox_spPr, OOX::Dra
//nullable<OOX::Drawing::CScene3D> m_oScene3D; //nullable<OOX::Drawing::CScene3D> m_oScene3D;
//nullable<OOX::Drawing::CShape3D> m_oSp3D; //nullable<OOX::Drawing::CShape3D> m_oSp3D;
//----------------------------------------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------------------------------------
if (oox_spPr->m_oXfrm.IsInit()) //CTransform2D
{
if (oox_spPr->m_oXfrm->m_oOff.IsInit())
{
odf_context()->drawing_context()->set_position(oox_spPr->m_oXfrm->m_oOff->m_oX.ToPoints(),
oox_spPr->m_oXfrm->m_oOff->m_oY.ToPoints());
}
if (oox_spPr->m_oXfrm->m_oExt.IsInit())
{
odf_context()->drawing_context()->set_size( oox_spPr->m_oXfrm->m_oExt->m_oCx.ToPoints(),
oox_spPr->m_oXfrm->m_oExt->m_oCy.ToPoints());
}
if (oox_spPr->m_oXfrm->m_oFlipH.GetValue() == SimpleTypes::onoffTrue)
odf_context()->drawing_context()->set_flip_H(true);
if (oox_spPr->m_oXfrm->m_oFlipV.GetValue() == SimpleTypes::onoffTrue)
odf_context()->drawing_context()->set_flip_V(true);
if (oox_spPr->m_oXfrm->m_oRot.GetValue() > 0)
odf_context()->drawing_context()->set_rotate(oox_spPr->m_oXfrm->m_oRot.GetValue());
}
} }
void OoxConverter::convert(OOX::Drawing::CNonVisualDrawingProps * oox_cnvPr) void OoxConverter::convert(OOX::Drawing::CNonVisualDrawingProps * oox_cnvPr)
{ {
...@@ -972,64 +1017,21 @@ void OoxConverter::convert(OOX::Drawing::CTextBodyProperties *oox_bodyPr) ...@@ -972,64 +1017,21 @@ void OoxConverter::convert(OOX::Drawing::CTextBodyProperties *oox_bodyPr)
//+ style section //+ style section
//+element text:section //+element text:section
} }
if (oox_bodyPr->m_oFromWordArt.ToBool() && oox_bodyPr->m_oPrstTxWrap.IsInit())
//for (long i=0; i<oox_prst_geom->m_oAvLst->m_arrGd.GetSize(); i++) {
//{ for (long i=0; i< oox_bodyPr->m_oPrstTxWrap->m_oAvLst->m_arrGd.GetSize(); i++)
// odf_context()->drawing_context()->add_modifier(string2std_string(oox_prst_geom->m_oAvLst->m_arrGd[i].m_oFmla.GetValue())); {
//} odf_context()->drawing_context()->add_modifier(string2std_string(oox_bodyPr->m_oPrstTxWrap->m_oAvLst->m_arrGd[i].m_oFmla.GetValue()));
}
}
} }
int OoxConverter::convert(OOX::Drawing::CPresetTextShape *oox_text_preset) int OoxConverter::convert(OOX::Drawing::CPresetTextShape *oox_text_preset)
{ {
if (oox_text_preset == NULL) return -1; if (oox_text_preset == NULL) return -1;
if (oox_text_preset->m_oPrst.GetValue() == SimpleTypes::textshapetypeTextNoShape) return -1;
int type = 2001 + oox_text_preset->m_oPrst.GetValue(); return 2001 + oox_text_preset->m_oPrst.GetValue();
switch(oox_text_preset->m_oPrst.GetValue())
{
case SimpleTypes::textshapetypeTextArchDown : break;
case SimpleTypes::textshapetypeTextArchDownPour : break;
case SimpleTypes::textshapetypeTextArchUp : break;
case SimpleTypes::textshapetypeTextArchUpPour : break;
case SimpleTypes::textshapetypeTextButton : break;
case SimpleTypes::textshapetypeTextButtonPour : break;
case SimpleTypes::textshapetypeTextCanDown : break;
case SimpleTypes::textshapetypeTextCanUp : break;
case SimpleTypes::textshapetypeTextCascadeDown : break;
case SimpleTypes::textshapetypeTextCascadeUp : break;
case SimpleTypes::textshapetypeTextChevron : break;
case SimpleTypes::textshapetypeTextChevronInverted: break;
case SimpleTypes::textshapetypeTextCircle : break;
case SimpleTypes::textshapetypeTextCirclePour : break;
case SimpleTypes::textshapetypeTextCurveDown : break;
case SimpleTypes::textshapetypeTextCurveUp : break;
case SimpleTypes::textshapetypeTextDeflate : break;
case SimpleTypes::textshapetypeTextDeflateBottom: break;
case SimpleTypes::textshapetypeTextDeflateInflate: break;
case SimpleTypes::textshapetypeTextDeflateInflateDeflate: break;
case SimpleTypes::textshapetypeTextDeflateTop : break;
case SimpleTypes::textshapetypeTextDoubleWave1 : break;
case SimpleTypes::textshapetypeTextFadeDown : break;
case SimpleTypes::textshapetypeTextFadeLeft : break;
case SimpleTypes::textshapetypeTextFadeRight : break;
case SimpleTypes::textshapetypeTextFadeUp : break;
case SimpleTypes::textshapetypeTextInflate : break;
case SimpleTypes::textshapetypeTextInflateBottom: break;
case SimpleTypes::textshapetypeTextInflateTop : break;
case SimpleTypes::textshapetypeTextNoShape : break;
case SimpleTypes::textshapetypeTextPlain : break;
case SimpleTypes::textshapetypeTextRingInside : break;
case SimpleTypes::textshapetypeTextRingOutside : break;
case SimpleTypes::textshapetypeTextSlantDown : break;
case SimpleTypes::textshapetypeTextSlantUp : break;
case SimpleTypes::textshapetypeTextStop : break;
case SimpleTypes::textshapetypeTextTriangle : break;
case SimpleTypes::textshapetypeTextTriangleInverted : break;
case SimpleTypes::textshapetypeTextWave1 : break;
case SimpleTypes::textshapetypeTextWave2 : break;
case SimpleTypes::textshapetypeTextWave4 : break;
}
return type;
} }
void OoxConverter::convert(OOX::Drawing::CRunProperty * oox_run_pr, odf::style_text_properties * text_properties) void OoxConverter::convert(OOX::Drawing::CRunProperty * oox_run_pr, odf::style_text_properties * text_properties)
{ {
......
...@@ -45,6 +45,7 @@ namespace OOX ...@@ -45,6 +45,7 @@ namespace OOX
namespace Drawing namespace Drawing
{ {
class CDiagrammParts;
class CPresetTextShape; class CPresetTextShape;
class CShape; class CShape;
class CLockedCanvas; class CLockedCanvas;
...@@ -88,6 +89,8 @@ namespace OOX ...@@ -88,6 +89,8 @@ namespace OOX
class CEffectList; class CEffectList;
class COuterShadowEffect; class COuterShadowEffect;
class CInnerShadowEffect; class CInnerShadowEffect;
class CFontReference;
class CFontCollection;
namespace Colors namespace Colors
{ {
...@@ -239,8 +242,11 @@ namespace OOX ...@@ -239,8 +242,11 @@ namespace OOX
class CRichText; class CRichText;
class CTextProperties; class CTextProperties;
} }
namespace Diagram
{
class CShape;
class CShapeTree;
}
namespace Vml namespace Vml
{ {
class CVmlShapeElements; class CVmlShapeElements;
...@@ -329,6 +335,8 @@ public: ...@@ -329,6 +335,8 @@ public:
void convert(OOX::Drawing::COuterShadowEffect *oox_shadow, CString *change_sheme_color = NULL); void convert(OOX::Drawing::COuterShadowEffect *oox_shadow, CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CInnerShadowEffect *oox_shadow, CString *change_sheme_color = NULL); void convert(OOX::Drawing::CInnerShadowEffect *oox_shadow, CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CFontCollection *style_font, CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CFontReference *style_font_ref);
void convert(OOX::Drawing::CStyleMatrixReference *style_matrix_ref); void convert(OOX::Drawing::CStyleMatrixReference *style_matrix_ref);
void convert(OOX::Drawing::CPath2D *oox_geom_path); void convert(OOX::Drawing::CPath2D *oox_geom_path);
void convert(OOX::Drawing::CPath2DLineTo *oox_geom_path); void convert(OOX::Drawing::CPath2DLineTo *oox_geom_path);
...@@ -347,6 +355,9 @@ public: ...@@ -347,6 +355,9 @@ public:
void convert(OOX::Drawing::CRun *oox_run); void convert(OOX::Drawing::CRun *oox_run);
void convert(OOX::Drawing::CRunProperty *oox_run_pr, cpdoccore::odf::style_text_properties * text_properties); void convert(OOX::Drawing::CRunProperty *oox_run_pr, cpdoccore::odf::style_text_properties * text_properties);
void convert(OOX::Drawing::CLineSpacing *oox_spacing, cpdoccore::odf::length_or_percent & length_or_percent); void convert(OOX::Drawing::CLineSpacing *oox_spacing, cpdoccore::odf::length_or_percent & length_or_percent);
//.diagram................................................................................................................................
void convert(OOX::Diagram::CShapeTree *oox_shape_tree);
void convert(OOX::Diagram::CShape *oox_shape);
//.chart............................................................................................................................ //.chart............................................................................................................................
void convert(OOX::Spreadsheet::CT_ChartSpace *oox_chart); void convert(OOX::Spreadsheet::CT_ChartSpace *oox_chart);
void convert(OOX::Spreadsheet::CT_Title *ct_title); void convert(OOX::Spreadsheet::CT_Title *ct_title);
......
...@@ -49,14 +49,14 @@ namespace OOX ...@@ -49,14 +49,14 @@ namespace OOX
class CTblBorders; class CTblBorders;
class CSdt; class CSdt;
class CBackground; class CBackground;
class CLockedCanvas;
} }
namespace Numbering namespace Numbering
{ {
class CAbstractNum; class CAbstractNum;
class CLvl; class CLvl;
}; }
} }
namespace ComplexTypes namespace ComplexTypes
{ {
...@@ -140,13 +140,15 @@ namespace Oox2Odf ...@@ -140,13 +140,15 @@ namespace Oox2Odf
void convert(OOX::Logic::CGroupShape *oox_group_shape); void convert(OOX::Logic::CGroupShape *oox_group_shape);
void convert(OOX::Logic::CShape *oox_shape); void convert(OOX::Logic::CShape *oox_shape);
void convert(OOX::Logic::CPicture *oox_picture); void convert(OOX::Logic::CPicture *oox_picture);
void convert(OOX::Logic::CLockedCanvas *oox_canvas);
void convert(OOX::Drawing::CAnchor *oox_anchor); void convert(OOX::Drawing::CAnchor *oox_anchor);
void convert(OOX::Drawing::CInline *oox_inline); void convert(OOX::Drawing::CInline *oox_inline);
void convert(OOX::Drawing::CGraphic *oox_graphic); void convert(OOX::Drawing::CGraphic *oox_graphic);
void convert(OOX::Drawing::CChart *oox_chart); void convert(OOX::Drawing::CChart *oox_chart);
void convert(OOX::Drawing::CPicture *oox_picture); void convert(OOX::Drawing::CPicture *oox_picture);
void convert(OOX::Drawing::CDiagrammParts *oox_diagramm);
void convert(SimpleTypes::CTheme<> *oox_font_theme,_CP_OPT(std::wstring) & odf_font_name); void convert(SimpleTypes::CTheme<> *oox_font_theme,_CP_OPT(std::wstring) & odf_font_name);
void convert(ComplexTypes::Word::CColor *color, _CP_OPT(odf::color) & odf_color); void convert(ComplexTypes::Word::CColor *color, _CP_OPT(odf::color) & odf_color);
void convert(SimpleTypes::CUniversalMeasure *oox_size, _CP_OPT(odf::length) & odf_size); void convert(SimpleTypes::CUniversalMeasure *oox_size, _CP_OPT(odf::length) & odf_size);
...@@ -187,6 +189,5 @@ namespace Oox2Odf ...@@ -187,6 +189,5 @@ namespace Oox2Odf
void convert(OOX::Logic::CTableRowProperties *oox_table_row_pr); void convert(OOX::Logic::CTableRowProperties *oox_table_row_pr);
void convert(OOX::Logic::CTableRowProperties *oox_table_row_pr, odf::style_table_row_properties *table_row_properties); void convert(OOX::Logic::CTableRowProperties *oox_table_row_pr, odf::style_table_row_properties *table_row_properties);
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
bool m_bKeepNextParagraph;
}; };
} }
\ No newline at end of file
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//2 //2
//0 //0
//127 //128
#define INTVER 1,2,0,127 #define INTVER 1,2,0,128
#define STRVER "1,2,0,127\0" #define STRVER "1,2,0,128\0"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment