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

x2t собран с конвертацией Open Office форматов (в обе стороны)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62955 954022d7-b5bf-4e40-9824-e11837661b57
parent 33ef5b44
...@@ -49,7 +49,6 @@ SOURCES += \ ...@@ -49,7 +49,6 @@ SOURCES += \
../src/odf/draw_frame_pptx.cpp \ ../src/odf/draw_frame_pptx.cpp \
../src/odf/draw_frame_xlsx.cpp \ ../src/odf/draw_frame_xlsx.cpp \
../src/odf/draw_page.cpp \ ../src/odf/draw_page.cpp \
../src/odf/draw_page_pptx.cpp \
../src/odf/draw_shapes.cpp \ ../src/odf/draw_shapes.cpp \
../src/odf/draw_shapes_docx.cpp \ ../src/odf/draw_shapes_docx.cpp \
../src/odf/draw_shapes_pptx.cpp \ ../src/odf/draw_shapes_pptx.cpp \
......
...@@ -17,7 +17,10 @@ ...@@ -17,7 +17,10 @@
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
namespace cpdoccore { namespace cpdoccore {
namespace odf {
using namespace odf_types;
namespace odf_reader {
void draw_page::pptx_convert(oox::pptx_conversion_context & Context) void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
{ {
......
...@@ -48,7 +48,7 @@ public: ...@@ -48,7 +48,7 @@ public:
virtual void start_text_context() = 0; virtual void start_text_context() = 0;
virtual void end_text_context() = 0; virtual void end_text_context() = 0;
virtual void start_image(std::wstring & image_file_name) = 0; virtual void start_image(const std::wstring & image_file_name) = 0;
virtual odf_style_context * styles_context(); virtual odf_style_context * styles_context();
...@@ -109,4 +109,4 @@ private: ...@@ -109,4 +109,4 @@ private:
}; };
} }
} }
\ No newline at end of file
...@@ -40,7 +40,7 @@ public: ...@@ -40,7 +40,7 @@ public:
void process_office_styles (office_element_ptr root ); void process_office_styles (office_element_ptr root );
void reset_defaults(); void reset_defaults();
void add_default(odf_style_state_ptr & state) {current_default_styles_.push_back(state);} void add_default(const odf_style_state_ptr & state) {current_default_styles_.push_back(state);}
std::wstring find_odf_style_name_default (odf_types::style_family::type family); std::wstring find_odf_style_name_default (odf_types::style_family::type family);
office_element_ptr find_odf_style_default (odf_types::style_family::type family); office_element_ptr find_odf_style_default (odf_types::style_family::type family);
......
...@@ -52,7 +52,7 @@ void odf_style_state::add_child(office_element_ptr & child) ...@@ -52,7 +52,7 @@ void odf_style_state::add_child(office_element_ptr & child)
odf_style_->add_child_element(child); odf_style_->add_child_element(child);
} }
void odf_style_state::set_name(std::wstring & name) void odf_style_state::set_name(std::wstring name)
{ {
odf_style_name_ = name; odf_style_name_ = name;
...@@ -62,7 +62,7 @@ void odf_style_state::set_name(std::wstring & name) ...@@ -62,7 +62,7 @@ void odf_style_state::set_name(std::wstring & name)
style_->style_name_ = name; style_->style_name_ = name;
} }
void odf_style_state::set_display_name(std::wstring & name) void odf_style_state::set_display_name(std::wstring name)
{ {
style* style_ = dynamic_cast<style*>(odf_style_.get()); style* style_ = dynamic_cast<style*>(odf_style_.get());
if (!style_)return; if (!style_)return;
...@@ -82,7 +82,7 @@ style_family::type odf_style_state::get_family_type() ...@@ -82,7 +82,7 @@ style_family::type odf_style_state::get_family_type()
{ {
return style_family_; return style_family_;
} }
void odf_style_state::set_parent_style_name(std::wstring & name) void odf_style_state::set_parent_style_name(std::wstring name)
{ {
if (name.length() < 1) return; if (name.length() < 1) return;
...@@ -93,7 +93,7 @@ void odf_style_state::set_parent_style_name(std::wstring & name) ...@@ -93,7 +93,7 @@ void odf_style_state::set_parent_style_name(std::wstring & name)
return; return;
style_->style_parent_style_name_ = name; style_->style_parent_style_name_ = name;
} }
void odf_style_state::set_list_style_name(std::wstring & name) void odf_style_state::set_list_style_name(std::wstring name)
{ {
if (name.length() < 1) return; if (name.length() < 1) return;
...@@ -108,7 +108,7 @@ void odf_style_state::set_dont_write(bool Val) ...@@ -108,7 +108,7 @@ void odf_style_state::set_dont_write(bool Val)
{ {
writable_ = !Val; writable_ = !Val;
} }
void odf_style_state::set_data_style_name(std::wstring & name) void odf_style_state::set_data_style_name(std::wstring name)
{ {
style* style_ = dynamic_cast<style*>(odf_style_.get()); style* style_ = dynamic_cast<style*>(odf_style_.get());
if (!style_)return; if (!style_)return;
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
void add_child(office_element_ptr & child); void add_child(office_element_ptr & child);
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
void set_name(std::wstring & name); void set_name(std::wstring name);
std::wstring get_name(); std::wstring get_name();
odf_types::style_family::type get_family_type(); odf_types::style_family::type get_family_type();
...@@ -54,11 +54,11 @@ public: ...@@ -54,11 +54,11 @@ public:
void set_number_format(int id) {num_fmt_id_ = id;} void set_number_format(int id) {num_fmt_id_ = id;}
int get_number_format() {return num_fmt_id_;} int get_number_format() {return num_fmt_id_;}
void set_parent_style_name(std::wstring & name) ; void set_parent_style_name(std::wstring name) ;
void set_data_style_name(std::wstring & name); void set_data_style_name(std::wstring name);
void set_list_style_name(std::wstring & name); void set_list_style_name(std::wstring name);
void set_display_name(std::wstring & name); void set_display_name(std::wstring name);
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
style_text_properties * get_text_properties(); style_text_properties * get_text_properties();
style_paragraph_properties * get_paragraph_properties() ; style_paragraph_properties * get_paragraph_properties() ;
......
...@@ -74,11 +74,11 @@ void ods_conversion_context::start_conditional_formats() ...@@ -74,11 +74,11 @@ void ods_conversion_context::start_conditional_formats()
current_table().start_conditional_formats(); current_table().start_conditional_formats();
} }
void ods_conversion_context::add_defined_range(std::wstring & name,std::wstring & cell_range, int sheet_id, bool printable) void ods_conversion_context::add_defined_range(const std::wstring & name, const std::wstring & cell_range, int sheet_id, bool printable)
{ {
table_context_.add_defined_range(name,cell_range, sheet_id, printable); table_context_.add_defined_range(name,cell_range, sheet_id, printable);
} }
void ods_conversion_context::add_defined_expression(std::wstring & name,std::wstring & value, int sheet_id, bool printable) void ods_conversion_context::add_defined_expression( const std::wstring & name, const std::wstring & value, int sheet_id, bool printable)
{ {
table_context_.add_defined_expression(name,value, sheet_id, printable); table_context_.add_defined_expression(name,value, sheet_id, printable);
} }
...@@ -95,7 +95,7 @@ void ods_conversion_context::start_sheet() ...@@ -95,7 +95,7 @@ void ods_conversion_context::start_sheet()
current_table().set_table_master_page(page_layout_context()->last_master().get_name()); current_table().set_table_master_page(page_layout_context()->last_master().get_name());
} }
void ods_conversion_context::set_sheet_dimension(std::wstring & ref) void ods_conversion_context::set_sheet_dimension(const std::wstring & ref)
{ {
std::vector<std::wstring> ref_cells; std::vector<std::wstring> ref_cells;
boost::algorithm::split(ref_cells,ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on); boost::algorithm::split(ref_cells,ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
...@@ -246,7 +246,7 @@ void ods_conversion_context::add_hyperlink(std::wstring & ref, std::wstring & li ...@@ -246,7 +246,7 @@ void ods_conversion_context::add_hyperlink(std::wstring & ref, std::wstring & li
} }
} }
void ods_conversion_context::add_merge_cells(std::wstring & ref) void ods_conversion_context::add_merge_cells(const std::wstring & ref)
{ {
std::vector<std::wstring> ref_cells; std::vector<std::wstring> ref_cells;
boost::algorithm::split(ref_cells,ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on); boost::algorithm::split(ref_cells,ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
...@@ -414,7 +414,7 @@ void ods_conversion_context::end_text_context() ...@@ -414,7 +414,7 @@ void ods_conversion_context::end_text_context()
delete current_text_context_; delete current_text_context_;
current_text_context_ = NULL; current_text_context_ = NULL;
} }
void ods_conversion_context::add_text_content(std::wstring & text) void ods_conversion_context::add_text_content(const std::wstring & text)
{ {
if (current_text_context_) if (current_text_context_)
{ {
...@@ -463,7 +463,7 @@ void ods_conversion_context::end_drawings() ...@@ -463,7 +463,7 @@ void ods_conversion_context::end_drawings()
{ {
current_table().drawing_context()->clear(); current_table().drawing_context()->clear();
} }
void ods_conversion_context::start_image(std::wstring & image_file_name) void ods_conversion_context::start_image(const std::wstring & image_file_name)
{ {
std::wstring odf_ref_name ; std::wstring odf_ref_name ;
......
...@@ -31,7 +31,7 @@ public: ...@@ -31,7 +31,7 @@ public:
virtual void end_document(); virtual void end_document();
void start_sheet(); void start_sheet();
void set_sheet_dimension(std::wstring & ref); void set_sheet_dimension(const std::wstring & ref);
void end_sheet(); void end_sheet();
void start_columns(); void start_columns();
...@@ -49,10 +49,10 @@ public: ...@@ -49,10 +49,10 @@ public:
void end_rows(); void end_rows();
void start_cell_text(); void start_cell_text();
void add_text_content(std::wstring & text); void add_text_content(const std::wstring & text);
void end_cell_text(); void end_cell_text();
void add_merge_cells(std::wstring & ref); void add_merge_cells(const std::wstring & ref);
void add_hyperlink(std::wstring & ref, std::wstring & link, std::wstring & display); void add_hyperlink(std::wstring & ref, std::wstring & link, std::wstring & display);
void start_comment (int col, int row, std::wstring & author); void start_comment (int col, int row, std::wstring & author);
...@@ -70,12 +70,12 @@ public: ...@@ -70,12 +70,12 @@ public:
void start_drawings(); void start_drawings();
void end_drawings(); void end_drawings();
virtual void start_image(std::wstring & image_file_name); virtual void start_image(const std::wstring & image_file_name);
double convert_symbol_width(double val); double convert_symbol_width(double val);
void add_defined_range(std::wstring & name,std::wstring & cell_range, int sheet_id, bool printable = false); void add_defined_range(const std::wstring & name, const std::wstring & cell_range, int sheet_id, bool printable = false);
void add_defined_expression(std::wstring & name,std::wstring & value, int sheet_id, bool printable = false); void add_defined_expression(const std::wstring & name, const std::wstring & value, int sheet_id, bool printable = false);
void start_autofilter(std::wstring ref); void start_autofilter(std::wstring ref);
void end_autofilter(){} void end_autofilter(){}
...@@ -95,4 +95,4 @@ private: ...@@ -95,4 +95,4 @@ private:
} }
} }
\ No newline at end of file
...@@ -53,7 +53,7 @@ void ods_table_context::start_defined_expressions(office_element_ptr & root_elm) ...@@ -53,7 +53,7 @@ void ods_table_context::start_defined_expressions(office_element_ptr & root_elm)
table_defined_expressions_.root = root_elm; table_defined_expressions_.root = root_elm;
} }
void ods_table_context::add_defined_range(std::wstring & name,std::wstring & cell_range, int sheet_id, bool printable) void ods_table_context::add_defined_range(const std::wstring & name, const std::wstring & cell_range, int sheet_id, bool printable)
{ {
office_element_ptr elm; office_element_ptr elm;
create_element(L"table", L"named-range",elm, &context_); create_element(L"table", L"named-range",elm, &context_);
...@@ -99,7 +99,7 @@ void ods_table_context::add_defined_range(std::wstring & name,std::wstring & cel ...@@ -99,7 +99,7 @@ void ods_table_context::add_defined_range(std::wstring & name,std::wstring & cel
} }
} }
void ods_table_context::add_defined_expression(std::wstring & name,std::wstring & value, int sheet_id, bool printable) void ods_table_context::add_defined_expression(const std::wstring & name, const std::wstring & value, int sheet_id, bool printable)
{ {
office_element_ptr elm; office_element_ptr elm;
create_element(L"table", L"named-expression",elm, &context_); create_element(L"table", L"named-expression",elm, &context_);
......
...@@ -38,8 +38,8 @@ public: ...@@ -38,8 +38,8 @@ public:
void start_defined_expressions(office_element_ptr & root_elm); void start_defined_expressions(office_element_ptr & root_elm);
void add_defined_range(std::wstring & name,std::wstring & cell_range, int sheet_id, bool printable = false); void add_defined_range(const std::wstring & name, const std::wstring & cell_range, int sheet_id, bool printable = false);
void add_defined_expression(std::wstring & name,std::wstring & value, int sheet_id, bool printable = false); void add_defined_expression(const std::wstring & name, const std::wstring & value, int sheet_id, bool printable = false);
void start_autofilter(std::wstring ref); void start_autofilter(std::wstring ref);
......
...@@ -152,7 +152,7 @@ void odt_conversion_context::end_text_context() ...@@ -152,7 +152,7 @@ void odt_conversion_context::end_text_context()
text_context_.pop_back(); text_context_.pop_back();
} }
} }
void odt_conversion_context::add_text_content(std::wstring & text) void odt_conversion_context::add_text_content(const std::wstring & text)
{ {
if (drop_cap_state_.enabled) if (drop_cap_state_.enabled)
{ {
...@@ -658,7 +658,7 @@ void odt_conversion_context::end_comment(int oox_comm_id) ...@@ -658,7 +658,7 @@ void odt_conversion_context::end_comment(int oox_comm_id)
text_context()->current_level_.back().elm->add_child_element(comm_elm); text_context()->current_level_.back().elm->add_child_element(comm_elm);
} }
} }
void odt_conversion_context::start_image(std::wstring & image_file_name) void odt_conversion_context::start_image(const std::wstring & image_file_name)
{ {
std::wstring odf_ref_name ; std::wstring odf_ref_name ;
......
...@@ -49,8 +49,8 @@ public: ...@@ -49,8 +49,8 @@ public:
void start_drawings(); void start_drawings();
void end_drawings(); void end_drawings();
virtual void start_image(std::wstring & image_file_name); virtual void start_image(const std::wstring & image_file_name);
void add_text_content (std::wstring & text); void add_text_content (const std::wstring & text);
void start_paragraph(bool styled = false); void start_paragraph(bool styled = false);
void end_paragraph(); void end_paragraph();
...@@ -161,4 +161,4 @@ private: ...@@ -161,4 +161,4 @@ private:
} }
} }
\ No newline at end of file
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