Commit 1f42a433 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@55163 954022d7-b5bf-4e40-9824-e11837661b57
parent c04de8bd
......@@ -886,6 +886,14 @@
<Filter
Name="elements"
>
<File
RelativePath=".\OdfFormat\list.cpp"
>
</File>
<File
RelativePath=".\OdfFormat\list.h"
>
</File>
<File
RelativePath=".\OdfFormat\office_body.cpp"
>
......@@ -902,6 +910,14 @@
RelativePath=".\OdfFormat\office_spreadsheet.h"
>
</File>
<File
RelativePath=".\OdfFormat\paragraph_elements.cpp"
>
</File>
<File
RelativePath=".\OdfFormat\paragraph_elements.h"
>
</File>
<File
RelativePath=".\OdfFormat\table.cpp"
>
......@@ -910,10 +926,26 @@
RelativePath=".\OdfFormat\table.h"
>
</File>
<File
RelativePath=".\OdfFormat\text_elements.cpp"
>
</File>
<File
RelativePath=".\OdfFormat\text_elements.h"
>
</File>
</Filter>
<Filter
Name="odf spreadsheet"
>
<File
RelativePath=".\OdfFormat\odf_text_context.cpp"
>
</File>
<File
RelativePath=".\OdfFormat\odf_text_context.h"
>
</File>
<File
RelativePath=".\OdfFormat\ods_conversion_context.cpp"
>
......
#include "precompiled_cpodf.h"
#include "list.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/serialize.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/utils.h>
#include <cpdoccore/xml/simple_xml_writer.h>
namespace cpdoccore {
namespace odf {
using xml::xml_char_wc;
// text:number
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_number::ns = L"text";
const wchar_t * text_number::name = L"number";
void text_number::serialize(::std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_STREAM() << string_;
}
}
}
void text_number::add_text(const std::wstring & Text)
{
string_ = Text;
}
// text:list-item
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_list_item::ns = L"text";
const wchar_t * text_list_item::name = L"list-item";
void text_list_item::serialize(::std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
if (text_number_)text_number_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & parElement, content_)
{
parElement->serialize(CP_XML_STREAM());
}
}
}
}
void text_list_item::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"number")
{
CP_CREATE_ELEMENT(text_number_);
}
else
{
CP_CREATE_ELEMENT(content_);
}
}
void text_list_item::add_child_element( office_element_ptr & child_element)
{
if (false)//CP_CHECK_NAME(L"text", L"number")
{
text_number_ = child_element;
}
else
{
content_.push_back( child_element);
}
}
// text:list-header
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_list_header::ns = L"text";
const wchar_t * text_list_header::name = L"list-header";
void text_list_header::serialize(::std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
if (text_number_)text_number_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & parElement, content_)
{
parElement->serialize(CP_XML_STREAM());
}
}
}
}
void text_list_header::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"number")
{
CP_CREATE_ELEMENT(text_number_);
}
else
{
CP_CREATE_ELEMENT(content_);
}
}
void text_list_header::add_child_element( office_element_ptr & child_element)
{
if (false)//CP_CHECK_NAME(L"text", L"number")
{
text_number_ = child_element;
}
else
{
content_.push_back( child_element);
}
}
}
}
\ No newline at end of file
#pragma once
#include <cpdoccore/CPOptional.h>
#include "office_elements.h"
#include "office_elements_create.h"
namespace cpdoccore {
namespace odf {
// text:number
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_number : public office_element_impl<text_number>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNumber;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_number() {}
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
virtual void add_text(const std::wstring & Text);
::std::wstring string_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_number);
// text:list-item
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_list_item;
typedef shared_ptr<text_list_item>::Type text_list_item_ptr;
typedef ::std::vector<text_list_item_ptr> text_list_item_ptr_array;
class text_list_item : public office_element_impl<text_list_item>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListItem;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
public:
text_list_item() {}
virtual void add_text(const std::wstring & Text) {} ;
_CP_OPT(unsigned int) text_start_value_;
office_element_ptr text_number_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_list_item);
// text:list-header
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_list_header;
typedef shared_ptr<text_list_header>::Type text_list_header_ptr;
class text_list_header : public office_element_impl<text_list_header>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListHeader;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
public:
text_list_header() {}
virtual void add_text(const std::wstring & Text) {} ;
private:
office_element_ptr text_number_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_list_header);
}
}
......@@ -13,7 +13,7 @@
namespace cpdoccore {
namespace odf {
odf_style_context::odf_style_context(odf_conversion_context & Context/*, xlsx_text_context & textCotnext*/): context_(Context)
odf_style_context::odf_style_context(odf_conversion_context & Context): context_(Context)
{
}
......
......@@ -19,7 +19,7 @@ typedef shared_ptr<office_element>::Type office_element_ptr;
class odf_style_context
{
public:
odf_style_context(odf_conversion_context & Context/*, ods_text_context & textCotnext*/);
odf_style_context(odf_conversion_context & Context);
void create_style(std::wstring name, const style_family style_family, bool automatic = false, bool root = false, int oox_id = -1);
void create_default(const style_family style_family);
......
#include "precompiled_cpodf.h"
#include "ods_table_context.h"
//#include "ods_textcontext.h"
#include "ods_conversion_context.h"
#include "logging.h"
......
......@@ -23,64 +23,16 @@ public:
void start_table(office_element_ptr & elm,std::wstring & name);
void end_table();
//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 non_empty_row();
// bool is_empty_row() const;
// 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();
// 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:
private:
ods_conversion_context & context_;
std::list<ods_table_state> table_state_list_;
//ods_text_context & xlsx_text_context_;
};
......
......@@ -47,7 +47,7 @@ public:
void set_root(bool root){is_root_ = root;}
////////////////////////
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const
virtual ::std::wostream & serialize(::std::wostream & _Wostream) const
{
_CP_LOG(info) << L"[warning] use base text_to_stream\n";
return _Wostream;
......
This diff is collapsed.
This diff is collapsed.
......@@ -61,7 +61,7 @@ class text_list_level_style_number_attr
public:
text_list_level_style_number_attr() : text_display_levels_(1), text_start_value_(1) {}
optional<style_ref>::Type text_style_name_;
_CP_OPT(style_ref) text_style_name_;
common_num_format_attlist common_num_format_attlist_;
common_num_format_prefix_suffix_attlist common_num_format_prefix_suffix_attlist_;
......
#include "precompiled_cpodf.h"
#include "text_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/serialize.h>
#include <cpdoccore/xml/attributes.h>
#include "paragraph_elements.h"
#include "list.h"
#include <cpdoccore/odf/odf_document.h>
#include "odf_conversion_context.h"
#include "style_paragraph_properties.h"
#include "style_text_properties.h"
namespace cpdoccore {
namespace odf {
using xml::xml_char_wc;
// text:h
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_h::ns = L"text";
const wchar_t * text_h::name = L"h";
void paragraph::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context)
{
CP_CREATE_ELEMENT_SIMPLE(paragraph_content_);
}
void paragraph::add_child_element( office_element_ptr & child_element)
{
paragraph_content_.push_back(child_element);
}
void paragraph::add_text(const std::wstring & Text)
{
office_element_ptr elm = text_text::create(Text) ;
paragraph_content_.push_back( elm );
}
void paragraph::serialize(std::wostream & _Wostream)
{
BOOST_FOREACH(const office_element_ptr & elm, paragraph_content_)
{
elm->serialize(_Wostream);
}
}
void paragraph::serialize_attr(CP_ATTR_NODE)
{
paragraph_attrs_.serialize(CP_GET_XML_NODE());
}
//////////////////////////////////////////////
text_h::text_h() : text_outline_level_(1), text_restart_numbering_(false), text_is_list_header_(false)
{}
void text_h::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR(L"text:outline-level", text_outline_level_);
CP_XML_ATTR(L"text:restart-numbering", text_restart_numbering_);
CP_XML_ATTR_OPT(L"text:start-value", text_start_value_);
CP_XML_ATTR(L"text:is-list-header", text_is_list_header_);
paragraph_.serialize_attr (CP_GET_XML_NODE());
paragraph_.serialize (CP_XML_STREAM());
}
}
}
//
void text_h::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
{
paragraph_.create_child_element(Ns, Name, getContext());
}
void text_h::add_text(const std::wstring & Text)
{
paragraph_.add_text(Text);
}
void text_h::add_child_element( office_element_ptr & child_element)
{
paragraph_.add_child_element(child_element);
}
// text:p
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_p::ns = L"text";
const wchar_t * text_p::name = L"p";
void text_p::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
paragraph_.create_child_element( Ns, Name, getContext());
}
void text_p::add_child_element( office_element_ptr & child_element)
{
paragraph_.add_child_element(child_element);
}
void text_p::add_text(const std::wstring & Text)
{
paragraph_.add_text(Text);
}
void text_p::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
paragraph_.serialize_attr (CP_GET_XML_NODE());
paragraph_.serialize (CP_XML_STREAM());
}
}
}
// text:list
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_list::ns = L"text";
const wchar_t * text_list::name = L"list";
void text_list::serialize(std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR(L"text:style-name",text_style_name_);
CP_XML_ATTR_OPT(L"text_continue_numbering_", text_continue_numbering_ );
if (text_list_header_) text_list_header_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & listItem, text_list_items_)
{
listItem->serialize(CP_XML_STREAM());
}
}
}
}
void text_list::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"list-header")
{
CP_CREATE_ELEMENT(text_list_header_);
}
else
{
CP_CREATE_ELEMENT(text_list_items_);
}
}
void text_list::add_child_element( office_element_ptr & child_element)
{
if (false)//header
text_list_header_ = child_element;
else
text_list_items_.push_back(child_element);
}
// text:soft-page-break
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_soft_page_break::ns = L"text";
const wchar_t * text_soft_page_break::name = L"soft-page-break";
void text_soft_page_break::serialize(::std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE();
}
}
// text-section-attr
//////////////////////////////////////////////////////////////////////////////////////////////////
void text_section_attr::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"text:style-name", text_style_name_);
CP_XML_ATTR(L"text:name", text_name_);
CP_XML_ATTR_OPT(L"text:protected", text_protected_);
CP_XML_ATTR_OPT(L"text:protection-key", text_protection_key_);
CP_XML_ATTR_OPT(L"text:display", text_display_);
CP_XML_ATTR_OPT(L"text:condition", text_condition_);
}
// text:section
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_section::ns = L"text";
const wchar_t * text_section::name = L"section";
void text_section::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
{
if (L"text" == Ns && L"section-source" == Name)
{
CP_CREATE_ELEMENT(text_section_source_);
}
else
{
CP_CREATE_ELEMENT(text_content_);
}
}
void text_section::add_child_element( office_element_ptr & child_element)
{
if (false)//header
text_section_source_ = child_element;
else
text_content_.push_back(child_element);
}
// text-section-source-attr
//////////////////////////////////////////////////////////////////////////////////////////////////
void text_section_source_attr::serialize(CP_ATTR_NODE)
{
common_xlink_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"text:section-name", text_section_name_);
CP_XML_ATTR_OPT(L"text:filter-name", text_filter_name_);
}
// text:section-source
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_section_source::ns = L"text";
const wchar_t * text_section_source::name = L"section-source";
void text_section_source::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
// text:index-body
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_index_body::ns = L"text";
const wchar_t * text_index_body::name = L"index-body";
void text_index_body::serialize(::std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & listItem, index_content_main_)
{
listItem->serialize(CP_XML_STREAM());
}
}
}
}
void text_index_body::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(index_content_main_);
}
void text_index_body::add_child_element( office_element_ptr & child_element)
{
index_content_main_.push_back(child_element);
}
// text:index-title
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_index_title::ns = L"text";
const wchar_t * text_index_title::name = L"index-title";
void text_index_title::serialize(::std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & listItem, index_content_main_)
{
listItem->serialize(CP_XML_STREAM());
}
}
}
}
void text_index_title::create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(index_content_main_);
}
void text_index_title::add_child_element( office_element_ptr & child_element)
{
index_content_main_.push_back(child_element);
}
// text:table-of-content
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_table_of_content::ns = L"text";
const wchar_t * text_table_of_content::name = L"table-of-content";
void text_table_of_content::serialize(::std::wostream & _Wostream)
{
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE_SIMPLE()
{
text_section_attr_.serialize(CP_GET_XML_NODE());
if (text_index_body_)text_index_body_->serialize(CP_XML_STREAM());
if (text_table_of_content_source_)text_table_of_content_source_->serialize(CP_XML_STREAM());
}
}
}
void text_table_of_content::create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"index-body")
{
CP_CREATE_ELEMENT(text_index_body_);
}
}
void text_table_of_content::add_child_element( office_element_ptr & child_element)
{
//if CP_CHECK_NAME(L"text", L"index-body")
{
text_index_body_ = child_element;
}
}
}
}
#pragma once
#include <iosfwd>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements_create.h"
#include "common_attlists.h"
#include "style_ref.h"
#include "textdisplay.h"
namespace cpdoccore {
namespace odf {
class paragraph_attrs
{
public:
style_ref text_style_name_;
style_ref_array text_class_names_;
style_ref text_cond_style_name_;
void serialize(CP_ATTR_NODE);
};
class paragraph
{
public:
paragraph() : next_par_(NULL), next_section_(false), next_end_section_(false) {}
public:
paragraph * get_next() { return next_par_; }
void set_next(paragraph * next) {next_par_ = next;}
void set_next_section(bool Val)
{
next_section_ = Val;
}
void set_next_end_section(bool Val)
{
next_end_section_ = Val;
}
void add_text(const std::wstring & Text);
void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name,odf_conversion_context * context);
void add_child_element( office_element_ptr & child_element);
void serialize (std::wostream & _Wostream);
void serialize_attr (CP_ATTR_NODE);
paragraph_attrs paragraph_attrs_;
office_element_ptr_array paragraph_content_;
paragraph * next_par_;
bool next_section_;
bool next_end_section_;
};
// text:h
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_h : public office_element_impl<text_h>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextH;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
text_h();
virtual void add_text(const std::wstring & Text);
// heading-attrs
unsigned int text_outline_level_;
bool text_restart_numbering_; // default false
_CP_OPT(unsigned int) text_start_value_;
bool text_is_list_header_; // default false
_CP_OPT(std::wstring) text_number_;
paragraph paragraph_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_h);
// text:p
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_p : public office_element_impl<text_p>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextP;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
text_p(){};
paragraph paragraph_;
virtual void add_text(const std::wstring & Text);
};
CP_REGISTER_OFFICE_ELEMENT2(text_p);
// text:list
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_list : public office_element_impl<text_list>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextList;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_list(){};
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
style_ref text_style_name_;
_CP_OPT(bool) text_continue_numbering_;
office_element_ptr text_list_header_;
office_element_ptr_array text_list_items_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_list);
// text:soft-page-break
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_soft_page_break : public office_element_impl<text_soft_page_break>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSoftPageBreak;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
};
CP_REGISTER_OFFICE_ELEMENT2(text_soft_page_break);
class text_section_attr
{
public:
_CP_OPT(style_ref) text_style_name_;
std::wstring text_name_;
_CP_OPT(bool) text_protected_;
_CP_OPT(std::wstring) text_protection_key_;
_CP_OPT(text_display) text_display_;
_CP_OPT(std::wstring) text_condition_;
void serialize(CP_ATTR_NODE);
};
// text:section
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_section : public office_element_impl<text_section>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSection;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
text_section_attr text_section_attr_;
office_element_ptr text_section_source_;
office_element_ptr_array text_content_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_section);
// text-section-source-attr
class text_section_source_attr
{
public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
common_xlink_attlist common_xlink_attlist_;
_CP_OPT(std::wstring) text_section_name_;
_CP_OPT(std::wstring) text_filter_name_;
void serialize(CP_ATTR_NODE);
};
// text:section-source
// text-section-source
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_section_source : public office_element_impl<text_section_source>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSectionSource;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element){}
virtual void serialize(std::wostream & _Wostream);
text_section_source_attr text_section_source_attr_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_section_source);
// text:table-of-content
// text-table-of-content
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_table_of_content : public office_element_impl<text_table_of_content>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTableOfContent;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
text_section_attr text_section_attr_;
office_element_ptr text_table_of_content_source_;
office_element_ptr text_index_body_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_table_of_content);
// text:index-body
// text-index-body
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_index_body : public office_element_impl<text_index_body>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexBody;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
office_element_ptr_array index_content_main_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_index_body);
// text:index-title
// text-index-title
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_index_title : public office_element_impl<text_index_title>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexTitle;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element( office_element_ptr & child_element);
virtual void serialize(std::wostream & _Wostream);
text_section_attr text_section_attr_;
office_element_ptr_array index_content_main_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_index_title);
}
}
......@@ -234,19 +234,19 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSi *oox_shared_string)
{
if (oox_shared_string == NULL)return;
//ods_context->start_text();
//ods_context->start_paragraph();
for(int i = 0; i < oox_shared_string->m_arrItems.GetSize(); ++i)
{
convert(oox_shared_string->m_arrItems[i]);
}
//ods_context->end_text();
//ods_context->end_paragraph();
}
void XlsxConverter::convert(OOX::Spreadsheet::CRun *oox_text_run)
{
if (oox_text_run == NULL)return;
//ods_context->start_run();
//ods_context->text_context().start_span();
//ods_context->end_run();
//ods_context->end_span();
}
void XlsxConverter::convert(OOX::Spreadsheet::CText *oox_text)
......
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