Commit 567b6128 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

диаграммы. каркас и шаблоны.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@56068 954022d7-b5bf-4e40-9824-e11837661b57
parent e119f7b0
...@@ -942,6 +942,14 @@ ...@@ -942,6 +942,14 @@
RelativePath=".\OdfFormat\office_body.h" RelativePath=".\OdfFormat\office_body.h"
> >
</File> </File>
<File
RelativePath=".\OdfFormat\office_chart.cpp"
>
</File>
<File
RelativePath=".\OdfFormat\office_chart.h"
>
</File>
<File <File
RelativePath=".\OdfFormat\office_spreadsheet.cpp" RelativePath=".\OdfFormat\office_spreadsheet.cpp"
> >
......
...@@ -279,7 +279,6 @@ void draw_object::serialize(std::wostream & _Wostream) ...@@ -279,7 +279,6 @@ void draw_object::serialize(std::wostream & _Wostream)
{ {
CP_XML_NODE_SIMPLE() CP_XML_NODE_SIMPLE()
{ {
//draw_object_attlist_.serialize(CP_GET_XML_NODE());
common_xlink_attlist_.serialize(CP_GET_XML_NODE()); common_xlink_attlist_.serialize(CP_GET_XML_NODE());
} }
} }
......
...@@ -183,6 +183,7 @@ public: ...@@ -183,6 +183,7 @@ public:
virtual void serialize(std::wostream & _Wostream); virtual void serialize(std::wostream & _Wostream);
common_xlink_attlist common_xlink_attlist_; common_xlink_attlist common_xlink_attlist_;
//draw:notify-on-update-of-ranges
}; };
CP_REGISTER_OFFICE_ELEMENT2(draw_object); CP_REGISTER_OFFICE_ELEMENT2(draw_object);
......
...@@ -57,11 +57,9 @@ namespace odf ...@@ -57,11 +57,9 @@ namespace odf
{ {
public: public:
virtual ~element() = 0; virtual ~element() = 0;
//void set_main_document(element * _element) { element_ = _element; }
//document * get_main_document() { return element_; }
virtual void write(const std::wstring & RootPath) = 0; virtual void write(const std::wstring & RootPath) = 0;
std::wstring local_path;
private: private:
element * element_; element * element_;
}; };
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include "office_spreadsheet.h"
#include "office_chart.h"
#include "office_elements_create.h" #include "office_elements_create.h"
#include "odf_conversion_context.h" #include "odf_conversion_context.h"
...@@ -42,10 +45,7 @@ odf_conversion_context::~odf_conversion_context() ...@@ -42,10 +45,7 @@ odf_conversion_context::~odf_conversion_context()
} }
//void odf_conversion_context::start_font_face()
//{
// create_element(L"office", L"font-face-decls", styles_, this,true);
//}
void odf_conversion_context::end_document() void odf_conversion_context::end_document()
{ {
...@@ -57,7 +57,7 @@ void odf_conversion_context::end_document() ...@@ -57,7 +57,7 @@ void odf_conversion_context::end_document()
if (object.content == NULL)continue; if (object.content == NULL)continue;
process_styles(object); process_styles(object,isRoot);
package::content_content_ptr content_root_ = package::content_content::create(); package::content_content_ptr content_root_ = package::content_content::create();
object.content->serialize(content_root_->content()); object.content->serialize(content_root_->content());
...@@ -81,7 +81,16 @@ void odf_conversion_context::end_document() ...@@ -81,7 +81,16 @@ void odf_conversion_context::end_document()
object_files->set_media (object.mediaitems); object_files->set_media (object.mediaitems);
object_files->set_pictures (object.mediaitems); object_files->set_pictures (object.mediaitems);
output_document_->add_object(package::element_ptr(object_files ),isRoot); if (!isRoot)object_files->local_path = object.name + L"/";
rels_.add(relationship(std::wstring(L"text/xml"), object_files->local_path + L"styles.xml"));
rels_.add(relationship(std::wstring(L"text/xml"), object_files->local_path + L"content.xml"));
rels_.add(relationship(std::wstring(L"text/xml"), object_files->local_path + L"meta.xml"));
if (isRoot)object_files->local_path = L"/";
rels_.add(relationship(std::wstring(L"application/vnd.oasis.opendocument.") + object.content->get_name(), object_files->local_path));
output_document_->add_object(package::element_ptr(object_files),isRoot);
} }
object.mediaitems.dump_rels(rels_); object.mediaitems.dump_rels(rels_);
...@@ -105,6 +114,8 @@ void odf_conversion_context::create_object() ...@@ -105,6 +114,8 @@ void odf_conversion_context::create_object()
obj.style_context = boost::make_shared<odf_style_context>(); obj.style_context = boost::make_shared<odf_style_context>();
obj.style_context->set_odf_context(this); obj.style_context->set_odf_context(this);
obj.name = get_next_name_object();
objects_.push_back(obj); objects_.push_back(obj);
current_object_ = objects_.size()-1; current_object_ = objects_.size()-1;
...@@ -113,22 +124,29 @@ void odf_conversion_context::end_object() ...@@ -113,22 +124,29 @@ void odf_conversion_context::end_object()
{ {
current_object_ = 0; current_object_ = 0;
} }
std::wstring odf_conversion_context::get_next_name_object()
{
return std::wstring(L"Object ") + boost::lexical_cast<std::wstring>(objects_.size());
}
void odf_conversion_context::process_styles(_object & object) void odf_conversion_context::process_styles(_object & object, bool isRoot)
{ {
create_element(L"office", L"font-face-decls", object.styles, this,true);
create_element(L"office", L"styles", object.styles, this,true);//îáùèå ñòèëè create_element(L"office", L"styles", object.styles, this,true);//îáùèå ñòèëè
object.style_context->process_office(object.styles.back()); object.style_context->process_office(object.styles.back());
create_element(L"office", L"automatic-styles", object.styles, this,true); if (isRoot)
object.style_context->process_automatic_styles(object.styles.back()); {
create_element(L"office", L"font-face-decls", object.styles, this,true);
create_element(L"office", L"master-styles", object.styles, this,true);
object.style_context->process_master(object.styles.back()); create_element(L"office", L"automatic-styles", object.styles, this,true);
object.style_context->process_automatic_styles(object.styles.back());
create_element(L"office", L"master-styles", object.styles, this,true);
object.style_context->process_master(object.styles.back());
create_element(L"office", L"font-face-decls", object.content_styles, this,true);
}
///////////////////////////////
create_element(L"office", L"font-face-decls", object.content_styles, this,true);
create_element(L"office", L"automatic-styles", object.content_styles, this,true); create_element(L"office", L"automatic-styles", object.content_styles, this,true);
object.style_context->process_automatic(object.content_styles.back()); object.style_context->process_automatic(object.content_styles.back());
......
...@@ -17,6 +17,8 @@ class odf_conversion_context : boost::noncopyable ...@@ -17,6 +17,8 @@ class odf_conversion_context : boost::noncopyable
{ {
struct _object struct _object
{ {
std::wstring name;
office_element_ptr content; office_element_ptr content;
std::vector<office_element_ptr> content_styles; std::vector<office_element_ptr> content_styles;
std::vector<office_element_ptr> styles; std::vector<office_element_ptr> styles;
...@@ -48,9 +50,10 @@ public: ...@@ -48,9 +50,10 @@ public:
void create_object(); void create_object();
void end_object(); void end_object();
std::wstring get_next_name_object();
private: private:
void process_styles(_object & object); void process_styles(_object & object, bool isRoot);
int current_object_; int current_object_;
//page_layout_container & pageLayoutContainer() { return page_layout_container_; } //page_layout_container & pageLayoutContainer() { return page_layout_container_; }
......
...@@ -448,7 +448,6 @@ void odf_drawing_context::end_line_properies() ...@@ -448,7 +448,6 @@ void odf_drawing_context::end_line_properies()
{ {
impl_->current_drawing_part_ = Unknown; impl_->current_drawing_part_ = Unknown;
} }
void odf_drawing_context::start_shadow_properies() void odf_drawing_context::start_shadow_properies()
{ {
impl_->current_drawing_part_ = Shadow; impl_->current_drawing_part_ = Shadow;
...@@ -724,13 +723,21 @@ void odf_drawing_context::start_image(std::wstring & path) ...@@ -724,13 +723,21 @@ void odf_drawing_context::start_image(std::wstring & path)
set_image_style_repeat(1);//default set_image_style_repeat(1);//default
} }
void odf_drawing_context::start_object() void odf_drawing_context::start_object(std::wstring name)
{ {
start_frame(); start_frame();
office_element_ptr object_elm; office_element_ptr object_elm;
create_element(L"draw", L"object", object_elm, impl_->odf_context_); create_element(L"draw", L"object", object_elm, impl_->odf_context_);
draw_object* object = dynamic_cast<draw_object*>(object_elm.get());
if (object == NULL)return;
object->common_xlink_attlist_.href_= std::wstring(L"./") + name;
object->common_xlink_attlist_.type_= xlink_type::Simple;
object->common_xlink_attlist_.show_ = xlink_show::Embed;
object->common_xlink_attlist_.actuate_= xlink_actuate::OnLoad;
start_element(object_elm); start_element(object_elm);
} }
......
...@@ -43,7 +43,7 @@ public: ...@@ -43,7 +43,7 @@ public:
void start_text_box(); void start_text_box();
void end_text_box(); void end_text_box();
void start_object(); void start_object(std::wstring name);
void end_object(); void end_object();
void start_element(office_element_ptr & elm); void start_element(office_element_ptr & elm);
......
...@@ -17,8 +17,8 @@ void relationship::serialize(std::wostream & _Wostream) ...@@ -17,8 +17,8 @@ void relationship::serialize(std::wostream & _Wostream)
{ {
CP_XML_NODE(L"manifest:file-entry") CP_XML_NODE(L"manifest:file-entry")
{ {
CP_XML_ATTR(L"manifest:media-type", type());
CP_XML_ATTR(L"manifest:full-path", target()); CP_XML_ATTR(L"manifest:full-path", target());
CP_XML_ATTR(L"manifest:media-type", type());
} }
} }
} }
......
...@@ -551,7 +551,7 @@ void ods_table_state::convert_position(oox_table_position & oox_pos, double & x, ...@@ -551,7 +551,7 @@ void ods_table_state::convert_position(oox_table_position & oox_pos, double & x,
int curr_col = 1,i; int curr_col = 1,i;
for (i=0; i< columns_.size(); i++) for (i=0; i< columns_.size(); i++)
{ {
if (oox_pos.col > columns_[i].repeated - curr_col) if (oox_pos.col > columns_[i].repeated + curr_col)
{ {
sz_col += (columns_[i].repeated ) * columns_[i].size; sz_col += (columns_[i].repeated ) * columns_[i].size;
} }
...@@ -569,7 +569,7 @@ void ods_table_state::convert_position(oox_table_position & oox_pos, double & x, ...@@ -569,7 +569,7 @@ void ods_table_state::convert_position(oox_table_position & oox_pos, double & x,
int curr_row = 1; int curr_row = 1;
for (i=0; i< rows_.size(); i++) for (i=0; i< rows_.size(); i++)
{ {
if (oox_pos.row > rows_[i].repeated - curr_row) if (oox_pos.row > rows_[i].repeated + curr_row)
{ {
sz_row += (rows_[i].repeated ) * rows_[i].size; sz_row += (rows_[i].repeated ) * rows_[i].size;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -1133,7 +1133,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGraphicFrame* oox_graphic_frame) ...@@ -1133,7 +1133,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGraphicFrame* oox_graphic_frame)
{ {
if (!oox_graphic_frame)return; if (!oox_graphic_frame)return;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
ods_context->drawing_context()->start_object(); ods_context->drawing_context()->start_object(ods_context->get_next_name_object());
{ {
if (oox_graphic_frame->m_oNvGraphicFramePr.IsInit()) if (oox_graphic_frame->m_oNvGraphicFramePr.IsInit())
{ {
...@@ -1159,7 +1159,6 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGraphicFrame* oox_graphic_frame) ...@@ -1159,7 +1159,6 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGraphicFrame* oox_graphic_frame)
} }
// //
} }
} }
ods_context->drawing_context()->end_object(); ods_context->drawing_context()->end_object();
} }
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//2 //2
//0 //0
//31 //32
#define INTVER 1,2,0,31 #define INTVER 1,2,0,32
#define STRVER "1,2,0,31\0" #define STRVER "1,2,0,32\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