Commit 3c061ff5 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@54712 954022d7-b5bf-4e40-9824-e11837661b57
parent f9353590
This diff is collapsed.
......@@ -22,7 +22,7 @@ public:
office_element_ptr & getCurrentElement();
std::vector<office_element_ptr> content_;
void add_rel(relationship const & r);
package::odf_document * output_document_;
......@@ -31,8 +31,6 @@ public:
private:
//odf_style_manager odf_styles_;
rels rels_;
//office_spreadsheet* current_spreadsheet_;
};
}
......
......@@ -8,26 +8,31 @@
namespace cpdoccore {
namespace odf {
//////////////////////////////////////////////////////////////////////////////////////////////////
ods_conversion_context::ods_conversion_context(package::odf_document * outputDocument)
: odf_conversion_context(outputDocument), ods_table_context_(*this)
{
}
void ods_conversion_context::start_document()
{
create_element(L"office", L"spreadsheet",content_, this);
create_element(L"office", L"spreadsheet",content_, this,true);
//current_spreadsheet_ = (office_spreadsheet*)dynamic_cast<office_spreadsheet*>(content_.back().get());
current_spreadsheet_ = (office_spreadsheet*)dynamic_cast<office_spreadsheet*>(content_.back().get());
}
void ods_conversion_context::start_sheet(std::wstring & name)
{
create_element(L"table", L"table",content_,this/*current_spreadsheet_.getContent()*/);
create_element(L"table", L"table",current_spreadsheet_->getContent(),this);
//current_sheet_ = (table_table*)dynamic_cast<table_table*>(content_.back().get());
ods_table_context_.start_table(current_spreadsheet_->getContent().back());
}
void ods_conversion_context::end_sheet()
{
ods_table_context_.end_table();
}
......
#pragma once
#include "odf_conversion_context.h"
#include "ods_table_context.h"
namespace cpdoccore {
namespace odf {
class office_spreadsheet;
class ods_conversion_context : public odf_conversion_context
{
public:
ods_conversion_context(package::odf_document * outputDocument) : odf_conversion_context(outputDocument){}
ods_conversion_context(package::odf_document * outputDocument);// : odf_conversion_context(outputDocument){}
virtual void start_document();
void start_sheet(std::wstring & name);
void end_sheet();
ods_table_context ods_table_context_;
office_spreadsheet* current_spreadsheet_;
};
......
#include "precompiled_cpodf.h"
#include "ods_table_context.h"
//#include "ods_textcontext.h"
#include "ods_conversion_context.h"
#include "logging.h"
#include <boost/foreach.hpp>
#include <iostream>
namespace cpdoccore {
namespace odf {
ods_table_context::ods_table_context(ods_conversion_context & Context/*, xlsx_text_context & textCotnext*/): context_(Context)
{
}
ods_table_state & ods_table_context::state()
{
return table_state_list_.back();
}
const ods_table_state & ods_table_context::state() const
{
return table_state_list_.back();
}
void ods_table_context::start_table(office_element_ptr & elm)
{
table_state_list_.push_back( ods_table_state(context_, elm) );
}
void ods_table_context::end_table()
{
}
}
}
\ No newline at end of file
#pragma once
#include <string>
#include "ods_table_state.h"
namespace cpdoccore {
namespace odf {
class ods_conversion_context;
class ods_text_context;
class office_element;
typedef shared_ptr<office_element>::Type office_element_ptr;
/// \class ods_table_context
class ods_table_context
{
public:
ods_table_context(ods_conversion_context & Context/*, ods_text_context & textCotnext*/);
public:
void start_table(office_element_ptr & elm);
void end_table();
//std::wstring get_current_table_name() const;
//void start_cell(const std::wstring & formula,
// size_t columnsSpanned,
// size_t rowsSpanned);
//void end_cell();
// std::wstring default_row_cell_style() const;
// std::wstring default_column_cell_style() const;
// void start_covered_cell();
// void end_covered_cell();
// void start_cell_content();
// int end_cell_content();
// void set_current_cell_style_id(unsigned int xfId);
// int get_current_cell_style_id();
// int current_column() const;
// int current_row() const;
//void set_table_row_group(int count, bool collapsed, int level);
// void start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
// void non_empty_row();
// bool is_empty_row() const;
// void end_row();
// void start_column(unsigned int repeated, const std::wstring & defaultCellStyleName);
// size_t depth() const { return table_state_stack_.size(); }
// unsigned int columns_count();
// void serialize_merge_cells(std::wostream & _Wostream);
//void serialize_table_format(std::wostream & _Wostream);
//xlsx_table_metrics & get_table_metrics();
//
//xlsx_drawing_context & get_drawing_context();
// xlsx_comments_context & get_comments_context();
//
// void table_column_last_width(double w);
// double table_column_last_width() const;
ods_table_state & state();
const ods_table_state & state() const;
// void start_hyperlink();
//std::wstring end_hyperlink(std::wstring const & ref, std::wstring const & href, std::wstring const & display);
// void dump_rels_hyperlinks(rels & Rels);
// void serialize_hyperlinks(std::wostream & _Wostream);
private:
ods_conversion_context & context_;
std::list<ods_table_state> table_state_list_;
//ods_text_context & xlsx_text_context_;
};
}
}
#include "precompiled_cpodf.h"
#include "logging.h"
#include "ods_table_state.h"
#include "ods_conversion_context.h"
#include "table.h"
namespace cpdoccore {
namespace odf {
ods_table_state::ods_table_state(ods_conversion_context & Context, office_element_ptr & elm): context_(Context)
{
office_element_ = (table_table*)dynamic_cast<table_table*>(elm.get());
}
}
}
#pragma once
#include <string>
#include <vector>
//
//#include "ods_row_spanned.h"
//#include "ods_merge_cells.h"
//#include "ods_table_metrics.h"
//#include "ods_drawing_context.h"
//#include "ods_comments_context.h"
//#include "ods_hyperlinks.h"
#include "office_elements.h"
#include "office_elements_create.h"
namespace cpdoccore {
namespace odf {
class ods_conversion_context;
class table_table;
class ods_table_state
{
public:
ods_table_state(ods_conversion_context & Context, office_element_ptr & elm);
// std::wstring current_style() const { return table_style_; }
// void start_column(unsigned int repeated, const std::wstring & defaultCellStyleName);
// void start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
// void non_empty_row();
// bool is_empty_row() const;
// void end_row();
// std::wstring current_row_style() const;
// std::wstring default_row_cell_style() const;
// std::wstring default_column_cell_style() const;
//void set_table_row_group(int count, bool collapsed, int level);
// void start_cell(size_t columnsSpanned, size_t rowsSpanned);
// void end_cell();
// void start_covered_cell();
// void end_covered_cell();
// void set_current_cell_style_id(unsigned int xfId);
// int get_current_cell_style_id();
// int current_column() const;
// int current_row() const;
// unsigned int current_columns_spaned() const;
// unsigned int current_rows_spanned(unsigned int Column) const;
// unsigned int columns_count() const;
//
// xlsx_table_metrics & get_table_metrics() { return xlsx_table_metrics_; }
// xlsx_drawing_context & get_drawing_context() { return xlsx_drawing_context_; }
// xlsx_comments_context & get_comments_context() { return xlsx_comments_context_; }
// void table_column_last_width(double w) { table_column_last_width_ = w; }
// double table_column_last_width() const { return table_column_last_width_; };
// void start_hyperlink();
//std::wstring end_hyperlink(std::wstring const & ref, std::wstring const & href, std::wstring const & display);
//void serialize_table_format(std::wostream & _Wostream);
//void serialize_merge_cells(std::wostream & _Wostream);
// void serialize_hyperlinks(std::wostream & _Wostream);
// void dump_rels_hyperlinks(rels & Rels);
//std::wstring get_current_table_name() const { return tableName_; }
//struct _group_row
//{
// bool enabled;
// int count;
// int level;
// bool collapsed;
//}group_row_;
private:
ods_conversion_context & context_;
table_table* office_element_;
//std::wstring table_style_;
// std::wstring tableName_;
// std::wstring table_row_style_;
// std::vector<std::wstring> column_default_cell_style_name_;
// std::wstring row_default_cell_style_name_;
// std::wstring cell_style_;
// int current_table_column_;
// int current_table_row_;
// unsigned int columns_spanned_num_;
// std::wstring columns_spanned_style_;
// std::vector<xlsx_row_spanned> rows_spanned_;
// std::vector<unsigned int> columns_;
// unsigned int columns_count_;
// xlsx_merge_cells merge_cells_;
// xlsx_table_metrics xlsx_table_metrics_;
// xlsx_drawing_context xlsx_drawing_context_;
// xlsx_comments_context xlsx_comments_context_;
//bool empty_row_;
// double table_column_last_width_;
// xlsx_hyperlinks xlsx_hyperlinks_;
};
}
}
......@@ -27,8 +27,7 @@ typedef shared_ptr<office_element>::Type office_element_ptr;
typedef weak_ptr<office_element>::Type office_element_weak_ptr;
typedef std::vector<office_element_ptr> office_element_ptr_array;
class office_element : public xml::element<wchar_t>, public base_visitable
class office_element : public xml::element<wchar_t>, public base_visitable, boost::noncopyable
{
public:
office_element() : context_(NULL) {}
......@@ -36,9 +35,9 @@ public:
virtual ElementType get_type() const = 0;
virtual ~office_element() = 0;
office_element_ptr & get_parent(){ return parent_;}
//office_element_ptr & get_parent(){ return parent_;}
void set_parent(office_element_ptr & parent){ parent_ = parent;}
// void set_parent(office_element_ptr & parent){ parent_ = parent;}
void setContext(odf_conversion_context * Context) { context_ = Context; }
......@@ -63,7 +62,7 @@ public:
}
private:
bool is_root_;
office_element_ptr parent_;
//office_element_ptr parent_;
odf_conversion_context * context_;
};
......
......@@ -109,5 +109,10 @@ bool create_element(const ::std::wstring & Ns,
void not_applicable_element(const office_element * CurrentElm, const std::wstring & Ns, const std::wstring & Name);
void not_applicable_element(const std::wstring & Current, const std::wstring & Ns, const std::wstring & Name);
#define CP_NOT_APPLICABLE_ELM() \
not_applicable_element(this, Ns, Name)
#define CP_NOT_APPLICABLE_ELM_SIMPLE(A) \
not_applicable_element(A, Ns, Name)
}
}
......@@ -18,19 +18,20 @@ namespace odf {
const wchar_t * office_spreadsheet::ns = L"office";
const wchar_t * office_spreadsheet::name = L"spreadsheet";
void office_spreadsheet::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void office_spreadsheet::add_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
create_element(Ns,Name,content_,getContext());
}
void office_spreadsheet::add_child_element(office_element_ptr & child_element)
{
content_.push_back(child_element);
}
void office_spreadsheet::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void office_spreadsheet::serialize(std::wostream & _Wostream)
{
......
......@@ -24,17 +24,16 @@ public:
static const ElementType type = typeOfficeSpreadsheet;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
office_element_ptr_array & getContent(){return content_;}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
public:
virtual void serialize(std::wostream & _Wostream);
private:
// TODO: office-text-content-prelude:
// TODO: office-forms
// TODO: text-tracked-changes
......
#include "precompiled_cpodf.h"
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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