Commit dddb4706 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatReader - сортировки в таблицах по множеству условий

parent d20b3abe
...@@ -118,7 +118,7 @@ namespace formulasconvert { ...@@ -118,7 +118,7 @@ namespace formulasconvert {
} }
std::wstring replace_named_ref_formater1(boost::wsmatch const & what) std::wstring replace_named_ref_formater1(boost::wsmatch const & what)
{ {
boost::wregex complexRef(L"\\$([^\\.]+?){0,1}\\.(\\$[a-zA-Z]+\\${0,1}\\d+)(?::\\.(\\$[a-zA-Z]+\\${0,1}\\d+)){0,1}"); boost::wregex complexRef(L"\\${0,1}([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)(?::\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)){0,1}");
std::wstring expr = what[1].str(); std::wstring expr = what[1].str();
const std::wstring res = boost::regex_replace( const std::wstring res = boost::regex_replace(
...@@ -158,7 +158,7 @@ void odf2oox_converter::Impl::replace_cells_range(std::wstring& expr) ...@@ -158,7 +158,7 @@ void odf2oox_converter::Impl::replace_cells_range(std::wstring& expr)
void odf2oox_converter::Impl::replace_named_ref(std::wstring & expr) void odf2oox_converter::Impl::replace_named_ref(std::wstring & expr)
{ {
boost::wregex complexRef(L"\\$([^\\.]+?){0,1}\\.(\\$[a-zA-Z]+\\${0,1}\\d+)(?::\\.(\\$[a-zA-Z]+\\${0,1}\\d+)){0,1}"); boost::wregex complexRef(L"\\${0,1}([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)(?::\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)){0,1}");
const std::wstring res = boost::regex_replace( const std::wstring res = boost::regex_replace(
expr, expr,
......
...@@ -8,7 +8,7 @@ namespace cpdoccore { ...@@ -8,7 +8,7 @@ namespace cpdoccore {
namespace oox { namespace oox {
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
/// \class default_content_type // default_content_type
class default_content_type : public xml::element_impl<default_content_type> class default_content_type : public xml::element_impl<default_content_type>
{ {
public: public:
...@@ -31,7 +31,7 @@ private: ...@@ -31,7 +31,7 @@ private:
}; };
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
/// \class override_content_type
class override_content_type : public xml::element_impl<override_content_type> class override_content_type : public xml::element_impl<override_content_type>
{ {
public: public:
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
}; };
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
/// \class content_type_content // content_type_content
class content_type_content : public xml::element_impl<content_type_content> class content_type_content : public xml::element_impl<content_type_content>
{ {
public: public:
......
...@@ -73,7 +73,7 @@ private: ...@@ -73,7 +73,7 @@ private:
}; };
/// \class xl_charts_files // xl_charts_files
class docx_charts_files : public element class docx_charts_files : public element
{ {
public: public:
......
...@@ -43,7 +43,7 @@ private: ...@@ -43,7 +43,7 @@ private:
class rels; class rels;
typedef _CP_PTR(rels) rels_ptr; typedef _CP_PTR(rels) rels_ptr;
/// \class rels // rels
class rels : public xml::element_impl<rels> class rels : public xml::element_impl<rels>
{ {
public: public:
......
...@@ -27,7 +27,7 @@ typedef std::vector<element_ptr> element_ptr_array; ...@@ -27,7 +27,7 @@ typedef std::vector<element_ptr> element_ptr_array;
class document; class document;
/// \class element // element
class element class element
{ {
public: public:
...@@ -76,7 +76,7 @@ private: ...@@ -76,7 +76,7 @@ private:
class rels_file; class rels_file;
typedef boost::shared_ptr<rels_file> rels_file_ptr; typedef boost::shared_ptr<rels_file> rels_file_ptr;
/// \class rels_file // rels_file
class rels_file : public element class rels_file : public element
{ {
public: public:
...@@ -97,7 +97,7 @@ private: ...@@ -97,7 +97,7 @@ private:
rels rels_; rels rels_;
}; };
/// \class rels_files // rels_files
class rels_files : public element class rels_files : public element
{ {
public: public:
......
...@@ -45,7 +45,7 @@ private: ...@@ -45,7 +45,7 @@ private:
rels_file_ptr rels_; rels_file_ptr rels_;
}; };
/// \class slides_files // slides_files
class slides_files : public element class slides_files : public element
{ {
public: public:
...@@ -66,7 +66,7 @@ public: ...@@ -66,7 +66,7 @@ public:
rels_files * rels_; rels_files * rels_;
}; };
/// \class slideLayouts_files // slideLayouts_files
class slideLayouts_files : public element class slideLayouts_files : public element
{ {
public: public:
...@@ -94,7 +94,7 @@ private: ...@@ -94,7 +94,7 @@ private:
}; };
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
/// \class slideMasters_files // slideMasters_files
class slideMasters_files : public element class slideMasters_files : public element
{ {
public: public:
...@@ -118,7 +118,7 @@ public: ...@@ -118,7 +118,7 @@ public:
class ppt_comments_files; class ppt_comments_files;
typedef _CP_PTR(ppt_comments_files) ppt_comments_files_ptr; typedef _CP_PTR(ppt_comments_files) ppt_comments_files_ptr;
/// \class ppt_comments // ppt_comments
class ppt_comments_files: public element class ppt_comments_files: public element
{ {
public: public:
...@@ -136,7 +136,7 @@ private: ...@@ -136,7 +136,7 @@ private:
}; };
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// \class ppt_charts_files // ppt_charts_files
class ppt_charts_files : public element class ppt_charts_files : public element
{ {
public: public:
...@@ -149,7 +149,7 @@ public: ...@@ -149,7 +149,7 @@ public:
}; };
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// \class ppt_theme_files // ppt_theme_files
class ppt_themes_files : public element class ppt_themes_files : public element
{ {
public: public:
...@@ -209,7 +209,7 @@ private: ...@@ -209,7 +209,7 @@ private:
element_ptr media_; element_ptr media_;
}; };
/// \class xlsx_document // xlsx_document
class pptx_document : public document class pptx_document : public document
{ {
public: public:
......
...@@ -40,19 +40,10 @@ public: ...@@ -40,19 +40,10 @@ public:
CP_XML_NODE(L"mergeCell") CP_XML_NODE(L"mergeCell")
{ {
CP_XML_ATTR(L"ref", getCellAddress(m.c, m.r) + L":" + getCellAddress(m.c + m.cols, m.r + m.rows)); CP_XML_ATTR(L"ref", getCellAddress(m.c, m.r) + L":" + getCellAddress(m.c + m.cols, m.r + m.rows));
} // L"mergeCell" }
} }
} // L"mergeCells" }
} }
//_Wostream << L"<mergeCells count=\"" << merges_.size() << L"\">";
//BOOST_FOREACH(const merge & m, merges_)
//{
// _Wostream << L"<mergeCell ref=\""
// << getCellAddress(m.c, m.r) << L":"
// << getCellAddress(m.c + m.cols, m.r + m.rows) << L"\" />";
//}
//_Wostream << L"</mergeCells>";
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace oox { namespace oox {
/// \class xlsx_xml_worksheet::Impl // xlsx_xml_worksheet::Impl
class xlsx_xml_worksheet::Impl class xlsx_xml_worksheet::Impl
{ {
public: public:
...@@ -20,6 +20,8 @@ public: ...@@ -20,6 +20,8 @@ public:
std::wstringstream drawing_; std::wstringstream drawing_;
std::wstringstream hyperlinks_; std::wstringstream hyperlinks_;
std::wstringstream comments_; std::wstringstream comments_;
std::wstringstream sort_;
std::wstringstream autofilter_;
rels hyperlinks_rels_; rels hyperlinks_rels_;
...@@ -70,7 +72,14 @@ std::wostream & xlsx_xml_worksheet::mergeCells() ...@@ -70,7 +72,14 @@ std::wostream & xlsx_xml_worksheet::mergeCells()
{ {
return impl_->mergeCells_; return impl_->mergeCells_;
} }
std::wostream & xlsx_xml_worksheet::sort()
{
return impl_->sort_;
}
std::wostream & xlsx_xml_worksheet::autofilter()
{
return impl_->autofilter_;
}
std::wostream & xlsx_xml_worksheet::drawing() std::wostream & xlsx_xml_worksheet::drawing()
{ {
return impl_->drawing_; return impl_->drawing_;
...@@ -111,8 +120,14 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm) ...@@ -111,8 +120,14 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
// !!! // !!!
CP_XML_STREAM() << impl_->mergeCells_.str(); CP_XML_STREAM() << impl_->mergeCells_.str();
CP_XML_STREAM() << impl_->sort_.str();
//autofilters
//conditional formats
if (!impl_->hyperlinks_.str().empty()) if (!impl_->hyperlinks_.str().empty())
{ {
CP_XML_NODE(L"hyperlinks") CP_XML_NODE(L"hyperlinks")
{ {
...@@ -120,7 +135,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm) ...@@ -120,7 +135,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
} }
} }
CP_XML_STREAM() << impl_->drawing_.str(); CP_XML_STREAM() << impl_->drawing_.str();
if (impl_->commentsId_.length()>0) if (impl_->commentsId_.length()>0)
{ {
CP_XML_NODE(L"legacyDrawing") CP_XML_NODE(L"legacyDrawing")
......
...@@ -13,7 +13,7 @@ namespace oox { ...@@ -13,7 +13,7 @@ namespace oox {
class xlsx_xml_worksheet; class xlsx_xml_worksheet;
typedef _CP_PTR(xlsx_xml_worksheet) xlsx_xml_worksheet_ptr; typedef _CP_PTR(xlsx_xml_worksheet) xlsx_xml_worksheet_ptr;
/// \class xlsx_xml_worksheet // xlsx_xml_worksheet
class xlsx_xml_worksheet: noncopyable class xlsx_xml_worksheet: noncopyable
{ {
public: public:
...@@ -28,15 +28,17 @@ public: ...@@ -28,15 +28,17 @@ public:
std::wostream & hyperlinks(); std::wostream & hyperlinks();
std::wostream & mergeCells(); std::wostream & mergeCells();
std::wostream & drawing(); std::wostream & drawing();
std::wostream & comments(); std::wostream & comments();
std::wostream & autofilter();
std::wostream & sort();
rels & hyperlinks_rels(); rels & hyperlinks_rels();
void write_to(std::wostream & strm); void write_to(std::wostream & strm);
void set_drawing_link(std::wstring const & fileName, std::wstring const & id); void set_drawing_link (std::wstring const & fileName, std::wstring const & id);
void set_vml_drawing_link(std::wstring const & fileName, std::wstring const & id); void set_vml_drawing_link (std::wstring const & fileName, std::wstring const & id);
void set_comments_link(std::wstring const & fileName, std::wstring const & id); void set_comments_link (std::wstring const & fileName, std::wstring const & id);
std::pair<std::wstring, std::wstring> get_drawing_link() const; std::pair<std::wstring, std::wstring> get_drawing_link() const;
std::pair<std::wstring, std::wstring> get_vml_drawing_link() const; std::pair<std::wstring, std::wstring> get_vml_drawing_link() const;
...@@ -48,26 +50,6 @@ private: ...@@ -48,26 +50,6 @@ private:
class Impl; class Impl;
_CP_SCOPED_PTR(Impl) impl_; _CP_SCOPED_PTR(Impl) impl_;
}; };
//
//class xlsx_xml_workbook;
//typedef _CP_PTR(xlsx_xml_workbook) xlsx_xml_workbook_ptr;
//
///// \class xlsx_xml_workbook
//class xlsx_xml_workbook : noncopyable
//{
//public:
// xlsx_xml_workbook();
// ~xlsx_xml_workbook();
//public:
// std::wostream & sheets();
//
//public:
// void write_to(std::wostream & strm);
//
//private:
// class Impl;
// _CP_SCOPED_PTR(Impl) impl_;
//};
} }
} }
...@@ -38,7 +38,7 @@ private: ...@@ -38,7 +38,7 @@ private:
rels_file_ptr rels_; rels_file_ptr rels_;
}; };
/// \class sheets_files // sheets_files
class sheets_files : public element class sheets_files : public element
{ {
public: public:
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
}; };
/// \class xl_charts_files // xl_charts_files
class xl_charts_files : public element class xl_charts_files : public element
{ {
public: public:
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
class xl_comments; class xl_comments;
typedef _CP_PTR(xl_comments) xl_comments_ptr; typedef _CP_PTR(xl_comments) xl_comments_ptr;
/// \class xl_comments // xl_comments
class xl_comments: public element class xl_comments: public element
{ {
public: public:
...@@ -96,7 +96,7 @@ private: ...@@ -96,7 +96,7 @@ private:
class xl_drawings; class xl_drawings;
typedef _CP_PTR(xl_drawings) xl_drawings_ptr; typedef _CP_PTR(xl_drawings) xl_drawings_ptr;
/// \class xl_drawings // xl_drawings
class xl_drawings: public element class xl_drawings: public element
{ {
public: public:
...@@ -118,7 +118,7 @@ private: ...@@ -118,7 +118,7 @@ private:
}; };
/// \class xl_files // xl_files
class xl_files : public element class xl_files : public element
{ {
public: public:
...@@ -153,7 +153,7 @@ private: ...@@ -153,7 +153,7 @@ private:
}; };
/// \class xlsx_document // xlsx_document
class xlsx_document : public document class xlsx_document : public document
{ {
public: public:
......
...@@ -18,7 +18,7 @@ namespace oox { ...@@ -18,7 +18,7 @@ namespace oox {
class xlsx_cell_format; class xlsx_cell_format;
/// \class class xlsx_style_manager // class xlsx_style_manager
class xlsx_style_manager class xlsx_style_manager
{ {
public: public:
......
...@@ -9,7 +9,7 @@ namespace cpdoccore { ...@@ -9,7 +9,7 @@ namespace cpdoccore {
namespace oox namespace oox
{ {
/// \class xlsx_table_metrics // xlsx_table_metrics
class xlsx_table_metrics class xlsx_table_metrics
{ {
public: public:
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "../odf/style_table_properties.h" #include "../odf/style_table_properties.h"
#include "../odf/datatypes/stylefamily.h" #include "../odf/datatypes/stylefamily.h"
#include "../formulasconvert/formulasconvert.h"
namespace cpdoccore { namespace cpdoccore {
namespace oox { namespace oox {
...@@ -153,7 +155,6 @@ void xlsx_table_state::end_cell() ...@@ -153,7 +155,6 @@ void xlsx_table_state::end_cell()
in_cell = false; in_cell = false;
} }
void xlsx_table_state::set_current_cell_style_id(unsigned int xfId) void xlsx_table_state::set_current_cell_style_id(unsigned int xfId)
{ {
for (size_t i = 0; i <= columns_spanned_num_; ++i) for (size_t i = 0; i <= columns_spanned_num_; ++i)
...@@ -294,5 +295,8 @@ void xlsx_table_state::start_hyperlink() ...@@ -294,5 +295,8 @@ void xlsx_table_state::start_hyperlink()
return xlsx_hyperlinks_.add(ref, href, display); return xlsx_hyperlinks_.add(ref, href, display);
} }
} }
} }
...@@ -13,21 +13,27 @@ namespace cpdoccore { ...@@ -13,21 +13,27 @@ namespace cpdoccore {
namespace oox { namespace oox {
class xlsx_conversion_context; class xlsx_conversion_context;
class xlsx_table_context;
class xlsx_table_state; class xlsx_table_state;
typedef _CP_PTR(xlsx_table_state) xlsx_table_state_ptr; typedef _CP_PTR(xlsx_table_state) xlsx_table_state_ptr;
class xlsx_table_state class xlsx_table_state
{ {
public: public:
xlsx_table_state(xlsx_conversion_context * Context, std::wstring styleName, std::wstring tableName); xlsx_table_state(xlsx_conversion_context * Context, std::wstring styleName, std::wstring tableName);
std::wstring current_style() const { return table_style_; } std::wstring current_style() const { return table_style_; }
void start_column(unsigned int repeated, const std::wstring & defaultCellStyleName);
void start_column(unsigned int repeated, const std::wstring & defaultCellStyleName);
void start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName); void start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
void non_empty_row();
void non_empty_row();
bool is_empty_row() const; bool is_empty_row() const;
void end_row(); void end_row();
std::wstring current_row_style() const;
std::wstring current_row_style() const;
std::wstring default_row_cell_style() const; std::wstring default_row_cell_style() const;
std::wstring default_column_cell_style() const; std::wstring default_column_cell_style() const;
...@@ -39,7 +45,7 @@ public: ...@@ -39,7 +45,7 @@ public:
void end_covered_cell(); void end_covered_cell();
void set_current_cell_style_id(unsigned int xfId); void set_current_cell_style_id(unsigned int xfId);
int get_current_cell_style_id(); int get_current_cell_style_id();
int current_column() const; int current_column() const;
int current_row() const; int current_row() const;
...@@ -74,7 +80,9 @@ public: ...@@ -74,7 +80,9 @@ public:
}group_row_; }group_row_;
friend class xlsx_conversion_context; friend class xlsx_conversion_context;
private: friend class xlsx_table_context;
private:
bool in_cell; bool in_cell;
xlsx_conversion_context * context_; xlsx_conversion_context * context_;
std::wstring tableName_; std::wstring tableName_;
...@@ -85,12 +93,12 @@ private: ...@@ -85,12 +93,12 @@ private:
std::vector<std::wstring> column_default_cell_style_name_; std::vector<std::wstring> column_default_cell_style_name_;
std::wstring row_default_cell_style_name_; std::wstring row_default_cell_style_name_;
int current_table_column_; int current_table_column_;
int current_table_row_; int current_table_row_;
bool empty_row_; bool empty_row_;
unsigned int columns_spanned_num_; unsigned int columns_spanned_num_;
std::wstring columns_spanned_style_; std::wstring columns_spanned_style_;
std::vector<xlsx_row_spanned> rows_spanned_; std::vector<xlsx_row_spanned> rows_spanned_;
std::vector<unsigned int> columns_; std::vector<unsigned int> columns_;
......
...@@ -2,13 +2,19 @@ ...@@ -2,13 +2,19 @@
#include "xlsx_tablecontext.h" #include "xlsx_tablecontext.h"
#include "xlsx_textcontext.h" #include "xlsx_textcontext.h"
#include "xlsxconversioncontext.h" #include "xlsxconversioncontext.h"
#include "xlsx_utils.h"
#include "xlsx_table_state.h"
#include "../formulasconvert/formulasconvert.h"
#include "logging.h" #include "logging.h"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <iostream> #include <iostream>
#include <cpdoccore/odf/odf_document.h> #include <cpdoccore/odf/odf_document.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "xlsx_table_state.h"
namespace cpdoccore { namespace cpdoccore {
namespace oox { namespace oox {
...@@ -28,6 +34,62 @@ const xlsx_table_state_ptr & xlsx_table_context::state() const ...@@ -28,6 +34,62 @@ const xlsx_table_state_ptr & xlsx_table_context::state() const
return table_state_stack_.back(); return table_state_stack_.back();
} }
void xlsx_table_context::start_database_range(std::wstring tableName, std::wstring ref)
{
formulasconvert::odf2oox_converter convert;
ref = convert.convert_named_ref(ref);
std::wstring ref1, ref2;
int pos = ref.find(L":");
if (pos >= 0)
{
_database_range range;
databaseRanges_.push_back(range);
ref1 = ref.substr(0, pos );
ref2 = ref.substr(pos + 1);
pos = ref1.find(L"!");
if (pos > 0)
{
databaseRanges_.back().table_name = ref1.substr(0, pos);
ref1 = ref1.substr(pos + 1);
}
pos = ref2.find(L"!");
if (pos > 0) ref2 = ref2.substr(pos + 1);
databaseRanges_.back().ref = ref1 + L":" + ref2;
}
}
void xlsx_table_context::set_database_orientation (bool val)
{
if (databaseRanges_.empty()) return;
databaseRanges_.back().byRow = val;
}
void xlsx_table_context::set_database_header (bool val)
{
if (databaseRanges_.empty()) return;
databaseRanges_.back().withHeader = val;
}
void xlsx_table_context::set_database_filter (bool val)
{
if (databaseRanges_.empty()) return;
databaseRanges_.back().filter = val;
}
void xlsx_table_context::end_database_range()
{
}
void xlsx_table_context::add_database_sort(int field_number, int order)
{
databaseRanges_.back().bySort.push_back(std::pair<int, bool>(field_number, order == 1 ? false : true ));
}
xlsx_table_context:: xlsx_table_context::
xlsx_table_context(xlsx_conversion_context * Context, xlsx_text_context & textContext): context_(Context), xlsx_table_context(xlsx_conversion_context * Context, xlsx_text_context & textContext): context_(Context),
xlsx_text_context_(textContext) xlsx_text_context_(textContext)
...@@ -143,6 +205,78 @@ int xlsx_table_context::current_row() const ...@@ -143,6 +205,78 @@ int xlsx_table_context::current_row() const
return state()->current_row(); return state()->current_row();
} }
void xlsx_table_context::serialize_sort(std::wostream & _Wostream)
{
if (databaseRanges_.size() < 1) return;
CP_XML_WRITER(_Wostream)
{
for (int j = 0 ; j < databaseRanges_.size(); j++)
{
if (databaseRanges_[j].table_name != state()->tableName_)
continue;
CP_XML_NODE(L"sortState")
{
CP_XML_ATTR(L"ref", databaseRanges_[j].ref);
if (!databaseRanges_[j].byRow)
CP_XML_ATTR(L"columnSort", true);
for (int i = 0 ; i < databaseRanges_[j].bySort.size(); i++)
{
bool in_range = true;
std::wstring ref1, ref2;
size_t col_1, row_1, col_2, row_2;
int pos = databaseRanges_[j].ref.find(L":");
if (pos >= 0)
{
ref1 = databaseRanges_[j].ref.substr(0, pos );
ref2 = databaseRanges_[j].ref.substr(pos + 1);
}
getCellAddressInv(ref1, col_1, row_1);
getCellAddressInv(ref2, col_2, row_2);
if (databaseRanges_[j].byRow)
{
if (databaseRanges_[j].bySort[i].first < col_1 ||
databaseRanges_[j].bySort[i].first > col_2 ) in_range = false;
ref1 = getCellAddress(databaseRanges_[j].bySort[i].first +
( databaseRanges_[j].withHeader ? 1 : 0), row_1);
ref2 = getCellAddress(databaseRanges_[j].bySort[i].first +
( databaseRanges_[j].withHeader ? 1 : 0), row_2);
}
else
{
if (databaseRanges_[j].bySort[i].first < row_1 ||
databaseRanges_[j].bySort[i].first > row_2 ) in_range = false;
ref1 = getCellAddress(col_1, databaseRanges_[j].bySort[i].first +
( databaseRanges_[j].withHeader ? 1 : 0));
ref2 = getCellAddress(col_2, databaseRanges_[j].bySort[i].first +
( databaseRanges_[j].withHeader ? 1 : 0));
}
if (in_range)
{
CP_XML_NODE(L"sortCondition")
{
CP_XML_ATTR(L"ref", ref1 + L":" + ref2);
if (databaseRanges_[j].bySort[i].second)
CP_XML_ATTR(L"descending", 1);
}
}
}
}
}
}
}
void xlsx_table_context::serialize_autofilter(std::wostream & _Wostream)
{
}
void xlsx_table_context::serialize_merge_cells(std::wostream & _Wostream) void xlsx_table_context::serialize_merge_cells(std::wostream & _Wostream)
{ {
return state()->serialize_merge_cells(_Wostream); return state()->serialize_merge_cells(_Wostream);
......
...@@ -9,10 +9,22 @@ ...@@ -9,10 +9,22 @@
namespace cpdoccore { namespace cpdoccore {
namespace oox { namespace oox {
struct _database_range
{
_database_range() : byRow(true), filter(false), withHeader(false) {}
std::wstring table_name;
std::wstring ref;
bool byRow;
bool filter;
bool withHeader;
std::vector<std::pair<int, bool>> bySort; //field + order
};
class xlsx_conversion_context; class xlsx_conversion_context;
class xlsx_text_context; class xlsx_text_context;
/// \class xlsx_table_context
class xlsx_table_context class xlsx_table_context
{ {
public: public:
...@@ -37,7 +49,7 @@ public: ...@@ -37,7 +49,7 @@ public:
void end_covered_cell(); void end_covered_cell();
void start_cell_content(); void start_cell_content();
int end_cell_content(); int end_cell_content();
void set_current_cell_style_id(unsigned int xfId); void set_current_cell_style_id(unsigned int xfId);
int get_current_cell_style_id(); int get_current_cell_style_id();
...@@ -57,9 +69,10 @@ public: ...@@ -57,9 +69,10 @@ public:
unsigned int columns_count(); unsigned int columns_count();
void serialize_merge_cells(std::wostream & _Wostream); void serialize_sort (std::wostream & _Wostream);
void serialize_autofilter (std::wostream & _Wostream);
void serialize_table_format(std::wostream & _Wostream); void serialize_merge_cells (std::wostream & _Wostream);
void serialize_table_format (std::wostream & _Wostream);
xlsx_table_metrics & get_table_metrics(); xlsx_table_metrics & get_table_metrics();
...@@ -67,22 +80,34 @@ public: ...@@ -67,22 +80,34 @@ public:
xlsx_comments_context & get_comments_context(); xlsx_comments_context & get_comments_context();
void table_column_last_width(double w); void table_column_last_width (double w);
double table_column_last_width() const; double table_column_last_width () const;
xlsx_table_state_ptr & state(); xlsx_table_state_ptr & state();
const xlsx_table_state_ptr & state() const; const xlsx_table_state_ptr & state() const;
void start_hyperlink(); void start_hyperlink();
std::wstring end_hyperlink(std::wstring const & ref, std::wstring const & href, std::wstring const & display); 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);
void start_database_range(std::wstring table_name, std::wstring ref);
void set_database_orientation (bool val);
void set_database_header (bool val);
void set_database_filter (bool val);
void add_database_sort (int field_number, int order);
void end_database_range();
void dump_rels_hyperlinks(rels & Rels);
void serialize_hyperlinks(std::wostream & _Wostream);
private: private:
xlsx_conversion_context * context_; xlsx_conversion_context * context_;
xlsx_text_context & xlsx_text_context_; xlsx_text_context & xlsx_text_context_;
std::list<xlsx_table_state_ptr> table_state_stack_; std::vector<xlsx_table_state_ptr> table_state_stack_;
std::vector<_database_range> databaseRanges_;
}; };
......
...@@ -293,9 +293,11 @@ void xlsx_conversion_context::end_table() ...@@ -293,9 +293,11 @@ void xlsx_conversion_context::end_table()
get_table_context().serialize_table_format(current_sheet().sheetFormat()); get_table_context().serialize_table_format(current_sheet().sheetFormat());
get_table_context().serialize_merge_cells(current_sheet().mergeCells()); get_table_context().serialize_autofilter (current_sheet().autofilter());
get_table_context().serialize_hyperlinks(current_sheet().hyperlinks()); get_table_context().serialize_sort (current_sheet().sort());
get_table_context().dump_rels_hyperlinks(current_sheet().hyperlinks_rels()); get_table_context().serialize_merge_cells (current_sheet().mergeCells());
get_table_context().serialize_hyperlinks (current_sheet().hyperlinks());
get_table_context().dump_rels_hyperlinks (current_sheet().hyperlinks_rels());
get_drawing_context().set_odf_packet_path(root()->get_folder()); get_drawing_context().set_odf_packet_path(root()->get_folder());
......
#include "calcext_elements.h"
#include <ostream>
#include <sstream>
#include <string>
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/regex.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/odf/odf_document.h>
#include "serialize_elements.h"
namespace cpdoccore {
using namespace odf_types;
namespace odf_reader {
void calcext_data_bar_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"calcext:axis-color", calcext_axis_color_);
CP_APPLY_ATTR(L"calcext:positive-color", calcext_positive_color_);
CP_APPLY_ATTR(L"calcext:negative-color", calcext_negative_color_);
}
void calcext_icon_set_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"calcext:icon-set-type", calcext_icon_set_type_);
}
void calcext_condition_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"calcext:base-cell-address", calcext_base_cell_address_);
CP_APPLY_ATTR(L"calcext:apply-style-name", calcext_apply_style_name_);
CP_APPLY_ATTR(L"calcext:value", calcext_value_);
}
void calcext_date_is_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"calcext:style", calcext_style_);
CP_APPLY_ATTR(L"calcext:date", calcext_date_);
}
// calcext_conditional_formats
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_conditional_formats::ns = L"calcext";
const wchar_t * calcext_conditional_formats::name = L"conditional-formats";
void calcext_conditional_formats::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void calcext_conditional_formats::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void calcext_conditional_formats::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
// calcext_conditional_format
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_conditional_format::ns = L"calcext";
const wchar_t * calcext_conditional_format::name = L"conditional-format";
void calcext_conditional_format::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"calcext:target-range-address", calcext_target_range_address_);
}
void calcext_conditional_format::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void calcext_conditional_format::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
// calcext_data_bar
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_data_bar::ns = L"calcext";
const wchar_t * calcext_data_bar::name = L"data-bar";
void calcext_data_bar::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
calcext_data_bar_attr_.add_attributes(Attributes);
}
void calcext_data_bar::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void calcext_data_bar::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
// calcext_color_scale
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_color_scale::ns = L"calcext";
const wchar_t * calcext_color_scale::name = L"color-scale";
void calcext_color_scale::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void calcext_color_scale::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void calcext_color_scale::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
// calcext_icon_set
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_icon_set::ns = L"calcext";
const wchar_t * calcext_icon_set::name = L"icon-set";
void calcext_icon_set::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
calcext_icon_set_attr_.add_attributes(Attributes);
}
void calcext_icon_set::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void calcext_icon_set::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
// calcext_formatting_entry
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_formatting_entry::ns = L"calcext";
const wchar_t * calcext_formatting_entry::name = L"formatting-entry";
void calcext_formatting_entry::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void calcext_formatting_entry::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
void calcext_formatting_entry::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
// calcext_color_scale_entry
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_color_scale_entry::ns = L"calcext";
const wchar_t * calcext_color_scale_entry::name = L"color_scale_entry";
void calcext_color_scale_entry::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void calcext_color_scale_entry::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
void calcext_color_scale_entry::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
// calcext_condition
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_condition::ns = L"calcext";
const wchar_t * calcext_condition::name = L"condition";
void calcext_condition::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
calcext_condition_attr_.add_attributes(Attributes);
}
void calcext_condition::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
void calcext_condition::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
// calcext_condition
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * calcext_date_is::ns = L"calcext";
const wchar_t * calcext_date_is::name = L"date-is";
void calcext_date_is::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
calcext_date_is_attr_.add_attributes(Attributes);
}
void calcext_date_is::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_NOT_APPLICABLE_ELM();
}
void calcext_date_is::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
}
}
\ No newline at end of file
#pragma once
#include <iosfwd>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements.h"
#include "office_elements_create.h"
#include "datatypes/common_attlists.h"
#include "../docx/xlsxconversioncontext.h"
#include "datatypes/iconset_type.h"
#include "datatypes/calcext_type.h"
namespace cpdoccore {
namespace odf_reader {
class calcext_data_bar_attr
{
public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
_CP_OPT(odf_types::color) calcext_axis_color_;
_CP_OPT(odf_types::color) calcext_positive_color_;
_CP_OPT(odf_types::color) calcext_negative_color_;
};
class calcext_condition_attr
{
public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
_CP_OPT(std::wstring) calcext_base_cell_address_;
_CP_OPT(odf_types::style_ref) calcext_apply_style_name_;
_CP_OPT(std::wstring) calcext_value_;
};
class calcext_icon_set_attr
{
public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
_CP_OPT(odf_types::iconset_type) calcext_icon_set_type_;
};
class calcext_date_is_attr
{
public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
_CP_OPT(odf_types::style_ref) calcext_style_;
_CP_OPT(std::wstring) calcext_date_;
};
//////////////////////////////////////////////////////////////////////////////////////////////////
// calcext:color-scale-entry
class calcext_color_scale_entry : public office_element_impl<calcext_color_scale_entry>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextColorScaleEntry;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
_CP_OPT(odf_types::color) calcext_color_;
_CP_OPT(std::wstring) calcext_value_;
_CP_OPT(odf_types::calcext_type) calcext_type_;
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_color_scale_entry);
class calcext_formatting_entry : public office_element_impl<calcext_formatting_entry>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextFormattingEntry;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
_CP_OPT(std::wstring) calcext_value_;
_CP_OPT(odf_types::calcext_type) calcext_type_;
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_formatting_entry);
// calcext:icon-set
class calcext_icon_set : public office_element_impl<calcext_icon_set>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextIconSet;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
calcext_icon_set_attr calcext_icon_set_attr_;
private:
office_element_ptr_array content_;//entries
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_icon_set);
// calcext:data-bar
class calcext_data_bar: public office_element_impl<calcext_data_bar>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextDataBar;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
calcext_data_bar_attr calcext_data_bar_attr_;
private:
office_element_ptr_array content_;//entries
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_data_bar)
// calcext:color-scale
class calcext_color_scale: public office_element_impl<calcext_color_scale>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextColorScale;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
office_element_ptr_array content_;//color_scale_entries
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_color_scale)
// calcext:date-is
class calcext_date_is: public office_element_impl<calcext_date_is>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextDateIs;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
calcext_date_is_attr calcext_date_is_attr_;
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_date_is)
// calcext:condition
class calcext_condition: public office_element_impl<calcext_condition>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextCondition;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
calcext_condition_attr calcext_condition_attr_;
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_condition)
// calcext:conditional-format
class calcext_conditional_format: public office_element_impl<calcext_conditional_format>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextConditionalFormat;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
_CP_OPT(std::wstring) calcext_target_range_address_;
private:
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_conditional_format)
// calcext:conditional-formats
class calcext_conditional_formats: public office_element_impl<calcext_conditional_formats>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextConditionalFormats;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_conditional_formats)
}
}
#pragma once #pragma once
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include "../docx/oox_drawing_fills.h" #include "../docx/oox_drawing_fills.h"
// ( ) xlsx & odf_reader - // ( ) xlsx & odf_reader -
......
...@@ -314,7 +314,6 @@ public: ...@@ -314,7 +314,6 @@ public:
}; };
/// \class common_num_format_attlist
/// common-num-format-attlist /// common-num-format-attlist
class common_num_format_attlist class common_num_format_attlist
{ {
...@@ -329,7 +328,6 @@ public: ...@@ -329,7 +328,6 @@ public:
}; };
/// \class common_num_format_prefix_suffix_attlist
/// common-num-format-prefix-suffix-attlist /// common-num-format-prefix-suffix-attlist
class common_num_format_prefix_suffix_attlist class common_num_format_prefix_suffix_attlist
{ {
...@@ -344,7 +342,6 @@ public: ...@@ -344,7 +342,6 @@ public:
}; };
/// \class common_text_align
/// common-text-align /// common-text-align
class common_text_align class common_text_align
{ {
...@@ -357,7 +354,6 @@ public: ...@@ -357,7 +354,6 @@ public:
_CP_OPT(text_align) fo_text_align_; _CP_OPT(text_align) fo_text_align_;
}; };
/// \class common_draw_size_attlist
/// common-draw-size-attlist /// common-draw-size-attlist
class common_draw_size_attlist class common_draw_size_attlist
{ {
...@@ -408,7 +404,6 @@ public: ...@@ -408,7 +404,6 @@ public:
}; };
/// \class common_draw_rel_size_attlist
/// common-draw-rel-size-attlist /// common-draw-rel-size-attlist
class common_draw_rel_size_attlist class common_draw_rel_size_attlist
{ {
...@@ -423,7 +418,6 @@ public: ...@@ -423,7 +418,6 @@ public:
_CP_OPT(percent_or_scale) style_rel_height_; _CP_OPT(percent_or_scale) style_rel_height_;
}; };
/// \class common_vertical_rel_attlist
/// common-vertical-rel-attlist /// common-vertical-rel-attlist
class common_vertical_rel_attlist class common_vertical_rel_attlist
{ {
...@@ -437,7 +431,6 @@ public: ...@@ -437,7 +431,6 @@ public:
}; };
/// \class common_horizontal_rel_attlist
/// common-horizontal-rel-attlist /// common-horizontal-rel-attlist
class common_horizontal_rel_attlist class common_horizontal_rel_attlist
{ {
...@@ -451,7 +444,6 @@ public: ...@@ -451,7 +444,6 @@ public:
}; };
/// \class common_vertical_pos_attlist
/// common-vertical-pos-attlist /// common-vertical-pos-attlist
class common_vertical_pos_attlist class common_vertical_pos_attlist
{ {
...@@ -466,7 +458,6 @@ public: ...@@ -466,7 +458,6 @@ public:
}; };
/// \class common_horizontal_pos_attlist
/// common-horizontal-pos-attlist /// common-horizontal-pos-attlist
class common_horizontal_pos_attlist class common_horizontal_pos_attlist
{ {
...@@ -482,7 +473,6 @@ public: ...@@ -482,7 +473,6 @@ public:
}; };
/// \class common_draw_style_name_attlist
/// common-draw-style-name-attlist /// common-draw-style-name-attlist
class common_draw_style_name_attlist class common_draw_style_name_attlist
{ {
......
#ifndef _CPDOCCORE_DOCUMENT_CONTEXT_H_ #pragma once
#define _CPDOCCORE_DOCUMENT_CONTEXT_H_
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
...@@ -27,5 +26,3 @@ private: ...@@ -27,5 +26,3 @@ private:
} }
} }
#endif
...@@ -44,10 +44,10 @@ private: ...@@ -44,10 +44,10 @@ private:
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name); virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
private: private:
draw_image_attlist draw_image_attlist_; draw_image_attlist draw_image_attlist_;
odf_types::common_xlink_attlist common_xlink_attlist_; odf_types::common_xlink_attlist common_xlink_attlist_;
office_element_ptr office_binary_data_; office_element_ptr office_binary_data_;
office_element_ptr_array content_; office_element_ptr_array content_;
friend class odf_document; friend class odf_document;
}; };
...@@ -173,7 +173,7 @@ public: ...@@ -173,7 +173,7 @@ public:
static const wchar_t * ns; static const wchar_t * ns;
static const wchar_t * name; static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement; static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawG; static const ElementType type = typeDrawG;
CPDOCCORE_DEFINE_VISITABLE(); CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context); virtual void docx_convert(oox::docx_conversion_context & Context);
...@@ -199,7 +199,6 @@ class draw_text_box_attlist ...@@ -199,7 +199,6 @@ class draw_text_box_attlist
public: public:
void add_attributes( const xml::attributes_wc_ptr & Attributes ); void add_attributes( const xml::attributes_wc_ptr & Attributes );
public:
_CP_OPT(std::wstring) draw_chain_next_name_; _CP_OPT(std::wstring) draw_chain_next_name_;
_CP_OPT(odf_types::length) draw_corner_radius_; _CP_OPT(odf_types::length) draw_corner_radius_;
_CP_OPT(odf_types::length_or_percent) fo_min_width_; _CP_OPT(odf_types::length_or_percent) fo_min_width_;
...@@ -216,7 +215,7 @@ public: ...@@ -216,7 +215,7 @@ public:
static const wchar_t * ns; static const wchar_t * ns;
static const wchar_t * name; static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement; static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawTextBox; static const ElementType type = typeDrawTextBox;
CPDOCCORE_DEFINE_VISITABLE(); CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context); virtual void docx_convert(oox::docx_conversion_context & Context);
......
...@@ -30,7 +30,7 @@ public: ...@@ -30,7 +30,7 @@ public:
_CP_OPT(std::wstring) use_footer_name_; _CP_OPT(std::wstring) use_footer_name_;
_CP_OPT(std::wstring) use_date_time_name_; _CP_OPT(std::wstring) use_date_time_name_;
}; };
/// \class draw_page // draw_page
class draw_page : public office_element_impl<draw_page> class draw_page : public office_element_impl<draw_page>
{ {
public: public:
......
...@@ -29,8 +29,7 @@ private: ...@@ -29,8 +29,7 @@ private:
odf_types::common_xlink_attlist common_xlink_attlist_; odf_types::common_xlink_attlist common_xlink_attlist_;
}; };
/// \class svg_font_face_uri // svg:font-face-uri
/// \brief svg:font-face-uri
class svg_font_face_uri : public office_element_impl<svg_font_face_uri> class svg_font_face_uri : public office_element_impl<svg_font_face_uri>
{ {
public: public:
...@@ -55,10 +54,6 @@ private: ...@@ -55,10 +54,6 @@ private:
}; };
CP_REGISTER_OFFICE_ELEMENT2(svg_font_face_uri);
/// \class svg_font_face_format
/// \brief svg:font-face-format
class svg_font_face_format : public office_element_impl<svg_font_face_format> class svg_font_face_format : public office_element_impl<svg_font_face_format>
{ {
public: public:
...@@ -83,8 +78,7 @@ private: ...@@ -83,8 +78,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(svg_font_face_format); CP_REGISTER_OFFICE_ELEMENT2(svg_font_face_format);
/// \class svg_font_face_name // svg:font-face-name
/// \brief svg:font-face-name
class svg_font_face_name : public office_element_impl<svg_font_face_name> class svg_font_face_name : public office_element_impl<svg_font_face_name>
{ {
public: public:
...@@ -110,8 +104,7 @@ private: ...@@ -110,8 +104,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(svg_font_face_name); CP_REGISTER_OFFICE_ELEMENT2(svg_font_face_name);
/// \class svg_definition_src // svg:definition-src
/// \brief svg:definition-src
class svg_definition_src : public office_element_impl<svg_definition_src> class svg_definition_src : public office_element_impl<svg_definition_src>
{ {
public: public:
...@@ -134,8 +127,7 @@ private: ...@@ -134,8 +127,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(svg_definition_src); CP_REGISTER_OFFICE_ELEMENT2(svg_definition_src);
/// \class style_font_face // style:font-face
/// \brief style:font-face
class style_font_face : public office_element_impl<style_font_face> class style_font_face : public office_element_impl<style_font_face>
{ {
public: public:
...@@ -208,8 +200,7 @@ private: ...@@ -208,8 +200,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(style_font_face); CP_REGISTER_OFFICE_ELEMENT2(style_font_face);
/// \class office_font_face_decls // office-font-face-decls
/// \brief office-font-face-decls
class office_font_face_decls : public office_element_impl<office_font_face_decls> class office_font_face_decls : public office_element_impl<office_font_face_decls>
{ {
public: public:
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class style_header_footer_properties_attlist
/// style-header-footer-properties-attlist /// style-header-footer-properties-attlist
class style_header_footer_properties_attlist class style_header_footer_properties_attlist
{ {
...@@ -56,8 +55,7 @@ public: ...@@ -56,8 +55,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_header_footer_properties); CP_REGISTER_OFFICE_ELEMENT2(style_header_footer_properties);
/// \class common_style_header_footer_attlist // common-style-header-footer-attlist
/// common-style-header-footer-attlist
class common_style_header_footer_attlist class common_style_header_footer_attlist
{ {
public: public:
...@@ -67,9 +65,7 @@ private: ...@@ -67,9 +65,7 @@ private:
bool style_display_; // default true bool style_display_; // default true
}; };
// header-footer-content
/// \class header_footer_content
/// header-footer-content
class header_footer_content class header_footer_content
{ {
public: public:
......
#ifndef _CPDOCCORE_ODF_LIST_H_ #pragma once
#define _CPDOCCORE_ODF_LIST_H_
#include <cpdoccore/CPOptional.h> #include <cpdoccore/CPOptional.h>
#include "office_elements.h" #include "office_elements.h"
...@@ -120,5 +119,3 @@ CP_REGISTER_OFFICE_ELEMENT2(list_header); ...@@ -120,5 +119,3 @@ CP_REGISTER_OFFICE_ELEMENT2(list_header);
} }
} }
} }
#endif // #ifndef _CPDOCCORE_ODF_LIST_H_
\ No newline at end of file
#ifndef CPDOCCORE_ODF_CONTENT_XML_H_ #pragma once
#define CPDOCCORE_ODF_CONTENT_XML_H_
#include <cpdoccore/common/readdocelement.h> #include <cpdoccore/common/readdocelement.h>
#include "office_elements.h" #include "office_elements.h"
...@@ -44,5 +43,3 @@ private: ...@@ -44,5 +43,3 @@ private:
} }
} }
#endif
...@@ -19,7 +19,6 @@ typedef shared_ptr<odf_read_context>::Type odf_read_context_ptr; ...@@ -19,7 +19,6 @@ typedef shared_ptr<odf_read_context>::Type odf_read_context_ptr;
class content_xml_t; class content_xml_t;
typedef shared_ptr<content_xml_t>::Type content_xml_t_ptr; typedef shared_ptr<content_xml_t>::Type content_xml_t_ptr;
/// \class odf_document::Impl
class odf_document::Impl class odf_document::Impl
{ {
public: public:
......
...@@ -32,7 +32,7 @@ public: ...@@ -32,7 +32,7 @@ public:
_CP_OPT(odf_types::style_ref) draw_style_name_; _CP_OPT(odf_types::style_ref) draw_style_name_;
}; };
/// \brief dc:date // dc:date
class dc_date : public office_element_impl<dc_date> class dc_date : public office_element_impl<dc_date>
{ {
public: public:
...@@ -54,7 +54,7 @@ private: ...@@ -54,7 +54,7 @@ private:
}; };
CP_REGISTER_OFFICE_ELEMENT2(dc_date); CP_REGISTER_OFFICE_ELEMENT2(dc_date);
/// \brief dc:creator // dc:creator
class dc_creator : public office_element_impl<dc_creator> class dc_creator : public office_element_impl<dc_creator>
{ {
public: public:
...@@ -77,7 +77,7 @@ private: ...@@ -77,7 +77,7 @@ private:
}; };
CP_REGISTER_OFFICE_ELEMENT2(dc_creator); CP_REGISTER_OFFICE_ELEMENT2(dc_creator);
/// \brief office:annotation // office:annotation
class office_annotation : public office_element_impl<office_annotation> class office_annotation : public office_element_impl<office_annotation>
{ {
public: public:
......
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class office_binary_data // office:binary-data
/// \brief office:binary-data
class office_binary_data : public office_element_impl<office_binary_data> class office_binary_data : public office_element_impl<office_binary_data>
{ {
public: public:
......
#ifndef _CPDOCCORE_ODF_OFFICE_BODY_H_ #pragma once
#define _CPDOCCORE_ODF_OFFICE_BODY_H_
#include <iosfwd> #include <iosfwd>
#include <cpdoccore/CPOptional.h> #include <cpdoccore/CPOptional.h>
...@@ -14,8 +13,7 @@ namespace odf_reader { ...@@ -14,8 +13,7 @@ namespace odf_reader {
class office_body; class office_body;
typedef shared_ptr<office_body>::Type office_body_ptr; typedef shared_ptr<office_body>::Type office_body_ptr;
/// \class office_body // office:body
/// \brief office:body
class office_body : public office_element_impl<office_body> class office_body : public office_element_impl<office_body>
{ {
public: public:
...@@ -51,5 +49,3 @@ CP_REGISTER_OFFICE_ELEMENT2(office_body); ...@@ -51,5 +49,3 @@ CP_REGISTER_OFFICE_ELEMENT2(office_body);
} }
} }
#endif
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class office_chart // office:chart
/// \brief office:chart
/// office-chart
class office_chart : public office_element_impl<office_chart> class office_chart : public office_element_impl<office_chart>
{ {
public: public:
...@@ -61,9 +59,7 @@ public: ...@@ -61,9 +59,7 @@ public:
_CP_OPT(std::wstring) chart_row_mapping_; _CP_OPT(std::wstring) chart_row_mapping_;
}; };
/// \class chart_chart // chart:chart
/// \brief chart:chart
/// chart-chart
class chart_chart : public office_element_impl<chart_chart> class chart_chart : public office_element_impl<chart_chart>
{ {
public: public:
...@@ -97,9 +93,7 @@ public: ...@@ -97,9 +93,7 @@ public:
}; };
/// \class chart_title // chart:title
/// \brief chart:title
/// chart-title
class chart_title : public office_element_impl<chart_title> class chart_title : public office_element_impl<chart_title>
{ {
public: public:
...@@ -120,9 +114,7 @@ public: ...@@ -120,9 +114,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(chart_title); CP_REGISTER_OFFICE_ELEMENT2(chart_title);
/// \class chart_subtitle // chart:subtitle
/// \brief chart:subtitle
/// chart-subtitle
class chart_subtitle : public office_element_impl<chart_subtitle> class chart_subtitle : public office_element_impl<chart_subtitle>
{ {
public: public:
...@@ -144,9 +136,7 @@ public: ...@@ -144,9 +136,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(chart_subtitle); CP_REGISTER_OFFICE_ELEMENT2(chart_subtitle);
/// \class chart_footer // chart:footer
/// \brief chart:footer
/// chart-footer
class chart_footer : public office_element_impl<chart_footer> class chart_footer : public office_element_impl<chart_footer>
{ {
public: public:
...@@ -183,9 +173,7 @@ public: ...@@ -183,9 +173,7 @@ public:
}; };
/// \class chart_legend // chart:legend
/// \brief chart:legend
/// chart-legend
class chart_legend : public office_element_impl<chart_legend> class chart_legend : public office_element_impl<chart_legend>
{ {
public: public:
...@@ -223,9 +211,7 @@ public: ...@@ -223,9 +211,7 @@ public:
// common-dr3d-transform-attlist // common-dr3d-transform-attlist
}; };
/// \class chart_plot_area // chart:plot-area
/// \brief chart:plot-area
/// chart-plot-area
class chart_plot_area : public office_element_impl<chart_plot_area> class chart_plot_area : public office_element_impl<chart_plot_area>
{ {
public: public:
...@@ -278,9 +264,7 @@ public: ...@@ -278,9 +264,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(chart_wall); CP_REGISTER_OFFICE_ELEMENT2(chart_wall);
/// \class chart_floor // chart:floor
/// \brief chart:floor
/// chart-floor
class chart_floor : public office_element_impl<chart_floor> class chart_floor : public office_element_impl<chart_floor>
{ {
public: public:
...@@ -312,9 +296,7 @@ public: ...@@ -312,9 +296,7 @@ public:
common_chart_attlist common_attlist_; common_chart_attlist common_attlist_;
}; };
/// \class chart_axis // chart:axis
/// \brief chart:axis
/// chart-axis
class chart_axis : public office_element_impl<chart_axis> class chart_axis : public office_element_impl<chart_axis>
{ {
public: public:
...@@ -348,9 +330,7 @@ public: ...@@ -348,9 +330,7 @@ public:
}; };
/// \class chart_grid // chart:grid
/// \brief chart:grid
/// chart-grid
class chart_grid : public office_element_impl<chart_grid> class chart_grid : public office_element_impl<chart_grid>
{ {
public: public:
...@@ -371,9 +351,7 @@ public: ...@@ -371,9 +351,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(chart_grid); CP_REGISTER_OFFICE_ELEMENT2(chart_grid);
/// \class chart_categories // chart:categories
/// \brief chart:categories
/// chart-categories
class chart_categories : public office_element_impl<chart_categories> class chart_categories : public office_element_impl<chart_categories>
{ {
public: public:
...@@ -408,9 +386,7 @@ public: ...@@ -408,9 +386,7 @@ public:
}; };
/// \class chart_series // chart:series
/// \brief chart:series
/// chart-series
class chart_series : public office_element_impl<chart_series> class chart_series : public office_element_impl<chart_series>
{ {
public: public:
...@@ -433,9 +409,7 @@ public: ...@@ -433,9 +409,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(chart_series); CP_REGISTER_OFFICE_ELEMENT2(chart_series);
/// \class chart_domain // chart:domain
/// \brief chart:domain
/// chart-domain
class chart_domain : public office_element_impl<chart_domain> class chart_domain : public office_element_impl<chart_domain>
{ {
public: public:
...@@ -466,9 +440,7 @@ public: ...@@ -466,9 +440,7 @@ public:
common_chart_attlist common_attlist_; common_chart_attlist common_attlist_;
}; };
/// \class chart_data_point // chart:data-point
/// \brief chart:data-point
/// chart-data-point
class chart_data_point : public office_element_impl<chart_data_point> class chart_data_point : public office_element_impl<chart_data_point>
{ {
public: public:
...@@ -489,9 +461,7 @@ public: ...@@ -489,9 +461,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(chart_data_point); CP_REGISTER_OFFICE_ELEMENT2(chart_data_point);
/// \class chart_mean_value // chart:mean-value
/// \brief chart:mean-value
/// chart-mean-value
class chart_mean_value : public office_element_impl<chart_mean_value> class chart_mean_value : public office_element_impl<chart_mean_value>
{ {
public: public:
...@@ -512,9 +482,7 @@ public: ...@@ -512,9 +482,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(chart_mean_value); CP_REGISTER_OFFICE_ELEMENT2(chart_mean_value);
/// \class chart_error_indicator // chart:error-indicator
/// \brief chart:error-indicator
/// chart-error-indicator
class chart_error_indicator : public office_element_impl<chart_error_indicator> class chart_error_indicator : public office_element_impl<chart_error_indicator>
{ {
public: public:
...@@ -581,9 +549,7 @@ public: ...@@ -581,9 +549,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(chart_regression_curve); CP_REGISTER_OFFICE_ELEMENT2(chart_regression_curve);
/// \class chart_stock_gain_marker // chart:stock-gain-marker
/// \brief chart:stock-gain-marker
/// chart-stock-gain-marker
class chart_stock_gain_marker : public office_element_impl<chart_stock_gain_marker> class chart_stock_gain_marker : public office_element_impl<chart_stock_gain_marker>
{ {
public: public:
...@@ -605,9 +571,7 @@ public: ...@@ -605,9 +571,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(chart_stock_gain_marker); CP_REGISTER_OFFICE_ELEMENT2(chart_stock_gain_marker);
/// \class chart_stock_loss_marker // chart:stock-loss-marker
/// \brief chart:stock-loss-marker
/// chart-stock-loss-marker
class chart_stock_loss_marker : public office_element_impl<chart_stock_loss_marker> class chart_stock_loss_marker : public office_element_impl<chart_stock_loss_marker>
{ {
public: public:
...@@ -629,9 +593,7 @@ public: ...@@ -629,9 +593,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(chart_stock_loss_marker); CP_REGISTER_OFFICE_ELEMENT2(chart_stock_loss_marker);
/// \class chart_stock_range_line // chart:stock-range-line
/// \brief chart:stock-range-line
/// chart-stock-range-line
class chart_stock_range_line : public office_element_impl<chart_stock_range_line> class chart_stock_range_line : public office_element_impl<chart_stock_range_line>
{ {
public: public:
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class office_document_base // office_document_base
class office_document_base : public office_element class office_document_base : public office_element
{ {
public: public:
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
}; };
/// \class office_document // office_document
class office_document : public office_document_base class office_document : public office_document_base
{ {
public: public:
...@@ -72,7 +72,7 @@ public: ...@@ -72,7 +72,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(office_document); CP_REGISTER_OFFICE_ELEMENT2(office_document);
/// \class office_document_content // office_document_content
class office_document_content : public office_document_base class office_document_content : public office_document_base
{ {
public: public:
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(office_document_content); CP_REGISTER_OFFICE_ELEMENT2(office_document_content);
/// \class office_document_styles // office_document_styles
class office_document_styles : public office_document_base class office_document_styles : public office_document_base
{ {
public: public:
...@@ -107,7 +107,7 @@ private: ...@@ -107,7 +107,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(office_document_styles); CP_REGISTER_OFFICE_ELEMENT2(office_document_styles);
/// \class office_document_meta // office_document_meta
class office_document_meta : public office_document_base class office_document_meta : public office_document_base
{ {
public: public:
...@@ -123,7 +123,7 @@ public: ...@@ -123,7 +123,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(office_document_meta); CP_REGISTER_OFFICE_ELEMENT2(office_document_meta);
/// \class office_document_settings // office_document_settings
class office_document_settings : public office_document_base class office_document_settings : public office_document_base
{ {
public: public:
...@@ -140,7 +140,7 @@ public: ...@@ -140,7 +140,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(office_document_settings); CP_REGISTER_OFFICE_ELEMENT2(office_document_settings);
/// \class manifest:manifest // manifest:manifest
class manifest_manifest : public office_document_base class manifest_manifest : public office_document_base
{ {
public: public:
...@@ -156,7 +156,7 @@ public: ...@@ -156,7 +156,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(manifest_manifest); CP_REGISTER_OFFICE_ELEMENT2(manifest_manifest);
/// \class manifest:file-entry // manifest:file-entry
class manifest_entry : public office_element class manifest_entry : public office_element
{ {
public: public:
...@@ -182,7 +182,7 @@ public: ...@@ -182,7 +182,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(manifest_entry); CP_REGISTER_OFFICE_ELEMENT2(manifest_entry);
/// \class manifest:encryption-data // manifest:encryption-data
class manifest_encryption_data : public office_element class manifest_encryption_data : public office_element
{ {
public: public:
......
...@@ -83,7 +83,6 @@ inline office_element::~office_element() ...@@ -83,7 +83,6 @@ inline office_element::~office_element()
{ {
} }
/// \class office_element_impl
template <class Element> template <class Element>
class office_element_impl : public virtual office_element class office_element_impl : public virtual office_element
{ {
......
#ifndef _CPDOCCORE_ODF_OFFCIE_ELEMENTS_CREATE_H_ #pragma once
#define _CPDOCCORE_ODF_OFFCIE_ELEMENTS_CREATE_H_
#include <string> #include <string>
#include <map> #include <map>
...@@ -102,7 +101,7 @@ template<class T> int RegisterElement<T>::class_registered_ = 0; //with namespa ...@@ -102,7 +101,7 @@ template<class T> int RegisterElement<T>::class_registered_ = 0; //with namespa
template<class T> int RegisterElement<T>::class_registered_1_ = 0; //without namespace template<class T> int RegisterElement<T>::class_registered_1_ = 0; //without namespace
/// \brief SAX, shared_ptr // SAX, shared_ptr
bool create_element_and_read(xml::sax * Reader, bool create_element_and_read(xml::sax * Reader,
const ::std::wstring & Ns, const ::std::wstring & Ns,
const ::std::wstring & Name, const ::std::wstring & Name,
...@@ -110,7 +109,7 @@ bool create_element_and_read(xml::sax * Reader, ...@@ -110,7 +109,7 @@ bool create_element_and_read(xml::sax * Reader,
document_context * Context, document_context * Context,
bool isRoot = false); bool isRoot = false);
/// \brief SAX, array // SAX, array
bool create_element_and_read(xml::sax * Reader, bool create_element_and_read(xml::sax * Reader,
const ::std::wstring & Ns, const ::std::wstring & Ns,
const ::std::wstring & Name, const ::std::wstring & Name,
...@@ -140,6 +139,4 @@ void not_applicable_element(const std::wstring & Current, const std::wstring & N ...@@ -140,6 +139,4 @@ void not_applicable_element(const std::wstring & Current, const std::wstring & N
} }
} }
\ No newline at end of file
#endif // #ifndef _CPDOCCORE_ODF_OFFCIE_ELEMENTS_CREATE_H_
#ifndef _CPDOCCORE_ODF_OFFCIE_ELEMENTS_TYPE_H_ #pragma once
#define _CPDOCCORE_ODF_OFFCIE_ELEMENTS_TYPE_H_
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
...@@ -144,11 +143,15 @@ enum ElementType ...@@ -144,11 +143,15 @@ enum ElementType
typeOfficeBinaryData, typeOfficeBinaryData,
typeTableTableSource,
typeTableNamedExpressions, typeTableNamedExpressions,
typeTableNamedExpression, typeTableNamedExpression,
typeTableNamedRange, typeTableNamedRange,
typeTableTable, typeTableDatabaseRanges,
typeTableDatabaseRange,
typeTableSort,
typeTableSortBy,
typeTableTable,
typeTableTableColumn, typeTableTableColumn,
typeTableTableColumns, typeTableTableColumns,
typeTableTableHeaderColumns, typeTableTableHeaderColumns,
...@@ -160,6 +163,7 @@ enum ElementType ...@@ -160,6 +163,7 @@ enum ElementType
typeTableTableHeaderRows, typeTableTableHeaderRows,
typeTableTableRowGroup, typeTableTableRowGroup,
typeTableTableRowNoGroup, typeTableTableRowNoGroup,
typeTableTableSource,
typeOfficeBody, typeOfficeBody,
typeOfficeText, typeOfficeText,
...@@ -332,7 +336,17 @@ enum ElementType ...@@ -332,7 +336,17 @@ enum ElementType
typeStyleRegionCenter, typeStyleRegionCenter,
typeStyleRegionRight, typeStyleRegionRight,
typeStyleChartProperties typeStyleChartProperties,
typeCalcextColorScaleEntry,
typeCalcextFormattingEntry,
typeCalcextIconSet,
typeCalcextDataBar,
typeCalcextColorScale,
typeCalcextDateIs,
typeCalcextCondition,
typeCalcextConditionalFormat,
typeCalcextConditionalFormats
}; };
...@@ -340,4 +354,3 @@ enum ElementType ...@@ -340,4 +354,3 @@ enum ElementType
} }
} }
#endif // #ifndef _CPDOCCORE_ODF_OFFCIE_ELEMENTS_TYPE_H_
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h" #include "serialize_elements.h"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \brief office:event-listeners // office:event-listeners
class office_event_listeners : public office_element_impl<office_event_listeners> class office_event_listeners : public office_element_impl<office_event_listeners>
{ {
public: public:
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
//presentation:effect //presentation:effect
}; };
/// \brief presentation:event-listeners_ // presentation:event-listeners_
class presentation_event_listener : public office_element_impl<presentation_event_listener> class presentation_event_listener : public office_element_impl<presentation_event_listener>
{ {
public: public:
...@@ -83,7 +83,7 @@ private: ...@@ -83,7 +83,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(presentation_event_listener); CP_REGISTER_OFFICE_ELEMENT2(presentation_event_listener);
/// \brief script:event-listeners_ // script:event-listeners_
class script_event_listener : public office_element_impl<presentation_event_listener> class script_event_listener : public office_element_impl<presentation_event_listener>
{ {
public: public:
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \brief office:presentation // office:presentation
class office_presentation : public office_element_impl<office_presentation> class office_presentation : public office_element_impl<office_presentation>
{ {
public: public:
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
#include <cpdoccore/CPOptional.h> #include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h> #include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h> #include <cpdoccore/xml/nodetype.h>
#include "office_elements.h" #include "office_elements.h"
#include "office_elements_create.h" #include "office_elements_create.h"
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class office_scripts // office:scripts
/// \brief office:scripts
class office_scripts : public office_element_impl<office_scripts> class office_scripts : public office_element_impl<office_scripts>
{ {
public: public:
...@@ -35,8 +35,7 @@ private: ...@@ -35,8 +35,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(office_scripts); CP_REGISTER_OFFICE_ELEMENT2(office_scripts);
/// \class office_script // office:script
/// \brief office:script
class office_script : public office_element_impl<office_script> class office_script : public office_element_impl<office_script>
{ {
public: public:
......
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class office_settings // office:settings
/// \brief office:settings
class office_settings : public office_element_impl<office_settings> class office_settings : public office_element_impl<office_settings>
{ {
public: public:
...@@ -31,8 +30,7 @@ private: ...@@ -31,8 +30,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(office_settings); CP_REGISTER_OFFICE_ELEMENT2(office_settings);
/// \class config_item_set // config:config-item-set
/// \brief config:config-item-set
class settings_config_item_set : public office_element_impl<settings_config_item_set> class settings_config_item_set : public office_element_impl<settings_config_item_set>
{ {
public: public:
...@@ -53,8 +51,7 @@ private: ...@@ -53,8 +51,7 @@ private:
}; };
CP_REGISTER_OFFICE_ELEMENT2(settings_config_item_set); CP_REGISTER_OFFICE_ELEMENT2(settings_config_item_set);
/// \class config_item // config:config-item
/// \brief config:config-item
class settings_config_item : public office_element_impl<settings_config_item> class settings_config_item : public office_element_impl<settings_config_item>
{ {
public: public:
...@@ -74,8 +71,7 @@ private: ...@@ -74,8 +71,7 @@ private:
}; };
CP_REGISTER_OFFICE_ELEMENT2(settings_config_item); CP_REGISTER_OFFICE_ELEMENT2(settings_config_item);
/// \class config_item_map_indexed // config:config-item_map_indexed
/// \brief config:config-item_map_indexed
class settings_config_item_map_indexed : public office_element_impl<settings_config_item_map_indexed> class settings_config_item_map_indexed : public office_element_impl<settings_config_item_map_indexed>
{ {
public: public:
...@@ -97,8 +93,7 @@ private: ...@@ -97,8 +93,7 @@ private:
}; };
CP_REGISTER_OFFICE_ELEMENT2(settings_config_item_map_indexed); CP_REGISTER_OFFICE_ELEMENT2(settings_config_item_map_indexed);
/// \class config_item_map_named // config:config-item_map_named
/// \brief config:config-item_map_named
class settings_config_item_map_named : public office_element_impl<settings_config_item_map_named> class settings_config_item_map_named : public office_element_impl<settings_config_item_map_named>
{ {
public: public:
...@@ -120,8 +115,7 @@ private: ...@@ -120,8 +115,7 @@ private:
}; };
CP_REGISTER_OFFICE_ELEMENT2(settings_config_item_map_named); CP_REGISTER_OFFICE_ELEMENT2(settings_config_item_map_named);
/// \class config_item // config:config-item
/// \brief config:config-item
class settings_config_item_map_entry : public office_element_impl<settings_config_item_map_entry> class settings_config_item_map_entry : public office_element_impl<settings_config_item_map_entry>
{ {
public: public:
......
...@@ -19,7 +19,12 @@ const wchar_t * office_spreadsheet::name = L"spreadsheet"; ...@@ -19,7 +19,12 @@ const wchar_t * office_spreadsheet::name = L"spreadsheet";
void office_spreadsheet::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name) void office_spreadsheet::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{ {
CP_CREATE_ELEMENT(content_); if CP_CHECK_NAME(L"table", L"database-ranges")
{
CP_CREATE_ELEMENT(table_database_ranges_);
}
else
CP_CREATE_ELEMENT(content_);
} }
void office_spreadsheet::add_text(const std::wstring & Text) void office_spreadsheet::add_text(const std::wstring & Text)
...@@ -45,7 +50,12 @@ void office_spreadsheet::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -45,7 +50,12 @@ void office_spreadsheet::xlsx_convert(oox::xlsx_conversion_context & Context)
{ {
Context.start_office_spreadsheet(this); Context.start_office_spreadsheet(this);
_CP_LOG << L"[info][xlsx] process spreadsheet (" << content_.size() << L" elmements)" << std::endl; _CP_LOG << L"[info][xlsx] process spreadsheet (" << content_.size() << L" elmements)" << std::endl;
BOOST_FOREACH(const office_element_ptr & elm, content_)
BOOST_FOREACH(const office_element_ptr & elm, table_database_ranges_)
{
elm->xlsx_convert(Context);
}
BOOST_FOREACH(const office_element_ptr & elm, content_)
{ {
elm->xlsx_convert(Context); elm->xlsx_convert(Context);
} }
......
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class office_spreadsheet // office:spreadsheet
/// \brief office:spreadsheet
class office_spreadsheet : public office_element_impl<office_spreadsheet> class office_spreadsheet : public office_element_impl<office_spreadsheet>
{ {
public: public:
...@@ -36,6 +35,8 @@ public: ...@@ -36,6 +35,8 @@ public:
// TODO: text-decls // TODO: text-decls
// TODO: table-decls // TODO: table-decls
office_element_ptr_array table_database_ranges_;
office_element_ptr_array content_; office_element_ptr_array content_;
// TODO: text-page-sequence // TODO: text-page-sequence
// TODO: office-text-content-epilogue: // TODO: office-text-content-epilogue:
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class office_text // office_text
/// \brief office:text // office:text
class office_text : public office_element_impl<office_text> class office_text : public office_element_impl<office_text>
{ {
public: public:
......
#ifndef _CPDOCCORE_ODF_OFFCIE_SKIP_ELEMENT_ #pragma once
#define _CPDOCCORE_ODF_OFFCIE_SKIP_ELEMENT_
#include <cpdoccore/xml/xmlelement.h> #include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h> #include <cpdoccore/xml/nodetype.h>
#include "office_elements.h" #include "office_elements.h"
#include "office_elements_create.h" #include "office_elements_create.h"
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class _skip_element // _skip_element
class _skip_element : public office_element_impl<_skip_element> class _skip_element : public office_element_impl<_skip_element>
{ {
public: public:
...@@ -33,5 +32,3 @@ public: ...@@ -33,5 +32,3 @@ public:
} }
} }
#endif
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class style_chart_properties // style:chart-properties
/// style:chart-properties
class style_chart_properties : public office_element_impl<style_chart_properties>// class style_chart_properties : public office_element_impl<style_chart_properties>//
{ {
public: public:
......
...@@ -107,7 +107,6 @@ public: ...@@ -107,7 +107,6 @@ public:
}; };
/// \class style_graphic_properties
/// style:graphic-properties /// style:graphic-properties
class style_graphic_properties : public office_element_impl<style_graphic_properties> class style_graphic_properties : public office_element_impl<style_graphic_properties>
{ {
......
...@@ -52,7 +52,7 @@ namespace oox{ ...@@ -52,7 +52,7 @@ namespace oox{
namespace odf_reader { namespace odf_reader {
/// \class style_tab_stop // style_tab_stop
class style_tab_stop : public office_element_impl<style_tab_stop> class style_tab_stop : public office_element_impl<style_tab_stop>
{ {
public: public:
...@@ -89,7 +89,7 @@ private: ...@@ -89,7 +89,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(style_tab_stop); CP_REGISTER_OFFICE_ELEMENT2(style_tab_stop);
/// \class style_tab_stops // style_tab_stops
class style_tab_stops : public office_element_impl<style_tab_stops> class style_tab_stops : public office_element_impl<style_tab_stops>
{ {
public: public:
...@@ -118,7 +118,7 @@ private: ...@@ -118,7 +118,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(style_tab_stops); CP_REGISTER_OFFICE_ELEMENT2(style_tab_stops);
/// \class style_drop_cap // style_drop_cap
class style_drop_cap : public office_element_impl<style_drop_cap> class style_drop_cap : public office_element_impl<style_drop_cap>
{ {
public: public:
...@@ -147,7 +147,6 @@ private: ...@@ -147,7 +147,6 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(style_drop_cap); CP_REGISTER_OFFICE_ELEMENT2(style_drop_cap);
/// \class style_background_image
/// style:background-image /// style:background-image
class style_background_image : public office_element_impl<style_background_image> class style_background_image : public office_element_impl<style_background_image>
{ {
...@@ -177,7 +176,7 @@ public: ...@@ -177,7 +176,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_background_image); CP_REGISTER_OFFICE_ELEMENT2(style_background_image);
/// \class paragraph_format_properties // paragraph_format_properties
class paragraph_format_properties : public oox::conversion_element class paragraph_format_properties : public oox::conversion_element
{ {
public: public:
...@@ -311,7 +310,7 @@ public: ...@@ -311,7 +310,7 @@ public:
_CP_OPT(bool) style_join_border_; _CP_OPT(bool) style_join_border_;
}; };
/// \class style_paragraph_properties // style_paragraph_properties
class style_paragraph_properties : public office_element_impl<style_paragraph_properties> class style_paragraph_properties : public office_element_impl<style_paragraph_properties>
{ {
public: public:
......
#ifndef _CPDOCCORE_ODF_STYLE_REGIONS_H_ #pragma once
#define _CPDOCCORE_ODF_STYLE_REGIONS_H_
#include <cpdoccore/CPOptional.h> #include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h> #include <cpdoccore/xml/xmlelement.h>
...@@ -10,8 +9,7 @@ ...@@ -10,8 +9,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class style_region_left // style:region-left
/// \brief style:region-left
class style_region_left : public office_element_impl<style_region_left> class style_region_left : public office_element_impl<style_region_left>
{ {
public: public:
...@@ -36,8 +34,7 @@ private: ...@@ -36,8 +34,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(style_region_left); CP_REGISTER_OFFICE_ELEMENT2(style_region_left);
/// \class style_region_right // style:region-right
/// \brief style:region-right
class style_region_right : public office_element_impl<style_region_right> class style_region_right : public office_element_impl<style_region_right>
{ {
public: public:
...@@ -63,8 +60,7 @@ private: ...@@ -63,8 +60,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(style_region_right); CP_REGISTER_OFFICE_ELEMENT2(style_region_right);
/// \class style_region_center // style:region-center
/// \brief style:region-center
class style_region_center : public office_element_impl<style_region_center> class style_region_center : public office_element_impl<style_region_center>
{ {
public: public:
...@@ -92,5 +88,3 @@ CP_REGISTER_OFFICE_ELEMENT2(style_region_center); ...@@ -92,5 +88,3 @@ CP_REGISTER_OFFICE_ELEMENT2(style_region_center);
} }
} }
#endif
...@@ -99,7 +99,6 @@ private: ...@@ -99,7 +99,6 @@ private:
}; };
/// \class style_table_properties
/// style:table-properties /// style:table-properties
class style_table_properties : public office_element_impl<style_table_properties> class style_table_properties : public office_element_impl<style_table_properties>
{ {
...@@ -137,8 +136,6 @@ public: ...@@ -137,8 +136,6 @@ public:
}; };
/// \class style_table_column_properties
/// style-table-column-properties
/// style:table-column-properties /// style:table-column-properties
class style_table_column_properties : public office_element_impl<style_table_column_properties> class style_table_column_properties : public office_element_impl<style_table_column_properties>
{ {
...@@ -184,8 +181,6 @@ public: ...@@ -184,8 +181,6 @@ public:
}; };
/// \class style_table_row_properties
/// style-table-row-properties
/// style:table-row-properties /// style:table-row-properties
class style_table_row_properties : public office_element_impl<style_table_row_properties> class style_table_row_properties : public office_element_impl<style_table_row_properties>
{ {
...@@ -301,8 +296,7 @@ private: ...@@ -301,8 +296,7 @@ private:
}; };
/// \class style_table_cell_properties
/// style-table-cell-properties
/// style:table-cell-properties /// style:table-cell-properties
class style_table_cell_properties : public office_element_impl<style_table_cell_properties> class style_table_cell_properties : public office_element_impl<style_table_cell_properties>
{ {
......
...@@ -271,7 +271,7 @@ public: ...@@ -271,7 +271,7 @@ public:
class style_text_properties; class style_text_properties;
typedef shared_ptr<style_text_properties>::Type style_text_properties_ptr; typedef shared_ptr<style_text_properties>::Type style_text_properties_ptr;
/// \class style_text_properties
/// style:text-properties /// style:text-properties
class style_text_properties : public office_element_impl<style_text_properties> class style_text_properties : public office_element_impl<style_text_properties>
{ {
......
...@@ -87,7 +87,7 @@ private: ...@@ -87,7 +87,7 @@ private:
}; };
/// \class default_style // default_style
/// style:default-style /// style:default-style
class default_style : public office_element_impl<default_style> class default_style : public office_element_impl<default_style>
{ {
...@@ -122,7 +122,7 @@ CP_REGISTER_OFFICE_ELEMENT2(default_style); ...@@ -122,7 +122,7 @@ CP_REGISTER_OFFICE_ELEMENT2(default_style);
///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////
/// \class style_draw_gradient // style_draw_gradient
class draw_gradient : public office_element_impl<draw_gradient> class draw_gradient : public office_element_impl<draw_gradient>
{ {
public: public:
...@@ -160,7 +160,7 @@ private: ...@@ -160,7 +160,7 @@ private:
}; };
CP_REGISTER_OFFICE_ELEMENT2(draw_gradient); CP_REGISTER_OFFICE_ELEMENT2(draw_gradient);
///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////
/// \class style_draw_hatch // style_draw_hatch
class draw_hatch : public office_element_impl<draw_hatch> class draw_hatch : public office_element_impl<draw_hatch>
{ {
public: public:
...@@ -189,7 +189,7 @@ private: ...@@ -189,7 +189,7 @@ private:
}; };
CP_REGISTER_OFFICE_ELEMENT2(draw_hatch); CP_REGISTER_OFFICE_ELEMENT2(draw_hatch);
///////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////
/// \class style_draw_gradient // style_draw_gradient
class draw_opacity : public office_element_impl<draw_opacity> class draw_opacity : public office_element_impl<draw_opacity>
{ {
public: public:
...@@ -220,7 +220,7 @@ private: ...@@ -220,7 +220,7 @@ private:
friend class odf_document; friend class odf_document;
}; };
CP_REGISTER_OFFICE_ELEMENT2(draw_opacity); CP_REGISTER_OFFICE_ELEMENT2(draw_opacity);
/// \class style_draw_fill_image // style_draw_fill_image
class draw_fill_image : public office_element_impl<draw_fill_image> class draw_fill_image : public office_element_impl<draw_fill_image>
{ {
public: public:
...@@ -252,7 +252,7 @@ typedef weak_ptr<style>::Type style_weak_ptr; ...@@ -252,7 +252,7 @@ typedef weak_ptr<style>::Type style_weak_ptr;
typedef ::std::vector< style_weak_ptr > style_weak_ptr_array; typedef ::std::vector< style_weak_ptr > style_weak_ptr_array;
typedef ::std::vector< style_ptr > style_ptr_array; typedef ::std::vector< style_ptr > style_ptr_array;
/// \class style // style
/// style:style /// style:style
class style : public office_element_impl<style> class style : public office_element_impl<style>
{ {
...@@ -299,7 +299,7 @@ private: ...@@ -299,7 +299,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(style); CP_REGISTER_OFFICE_ELEMENT2(style);
/// \class styles // styles
class styles class styles
{ {
public: public:
...@@ -350,8 +350,7 @@ private: ...@@ -350,8 +350,7 @@ private:
friend class odf_document; friend class odf_document;
}; };
/// \class office_automatic_styles // office:automatic-styles
/// \brief office:automatic-styles
class office_automatic_styles : public office_element_impl<office_automatic_styles> class office_automatic_styles : public office_element_impl<office_automatic_styles>
{ {
public: public:
...@@ -377,8 +376,7 @@ private: ...@@ -377,8 +376,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(office_automatic_styles); CP_REGISTER_OFFICE_ELEMENT2(office_automatic_styles);
/// \class office_master_styles // office:master-styles
/// \brief office:master-styles
class office_master_styles : public office_element_impl<office_master_styles> class office_master_styles : public office_element_impl<office_master_styles>
{ {
public: public:
...@@ -408,8 +406,7 @@ private: ...@@ -408,8 +406,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(office_master_styles); CP_REGISTER_OFFICE_ELEMENT2(office_master_styles);
/// \class class style_master_page_attlist // style-master-page-attlist
/// \brief style-master-page-attlist
class style_master_page_attlist class style_master_page_attlist
{ {
public: public:
...@@ -424,8 +421,7 @@ public: ...@@ -424,8 +421,7 @@ public:
_CP_OPT(odf_types::style_ref) style_next_style_name_; _CP_OPT(odf_types::style_ref) style_next_style_name_;
}; };
/// \class style_master_page // style:master-page
/// \brief style:master-page
class style_master_page; class style_master_page;
typedef boost::shared_ptr<style_master_page> style_master_page_ptr; typedef boost::shared_ptr<style_master_page> style_master_page_ptr;
...@@ -468,8 +464,7 @@ public: ...@@ -468,8 +464,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_master_page); CP_REGISTER_OFFICE_ELEMENT2(style_master_page);
/// \class office_styles // office:styles
/// \brief office:styles
class office_styles : public office_element_impl<office_styles> class office_styles : public office_element_impl<office_styles>
{ {
public: public:
...@@ -522,9 +517,7 @@ private: ...@@ -522,9 +517,7 @@ private:
}; };
/// \class style_header // style:header
/// style:header
/// style-header
class style_header : public office_element_impl<style_header>, public header_footer_impl class style_header : public office_element_impl<style_header>, public header_footer_impl
{ {
public: public:
...@@ -547,9 +540,7 @@ public: ...@@ -547,9 +540,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_header); CP_REGISTER_OFFICE_ELEMENT2(style_header);
/// \class style_footer
/// style:footer /// style:footer
/// style-header
class style_footer : public office_element_impl<style_footer>, public header_footer_impl class style_footer : public office_element_impl<style_footer>, public header_footer_impl
{ {
public: public:
...@@ -571,9 +562,8 @@ public: ...@@ -571,9 +562,8 @@ public:
}; };
CP_REGISTER_OFFICE_ELEMENT2(style_footer); CP_REGISTER_OFFICE_ELEMENT2(style_footer);
/// \class style_header_first
/// style:header-first /// style:header-first
/// style-header
class style_header_first : public office_element_impl<style_header_first>, public header_footer_impl class style_header_first : public office_element_impl<style_header_first>, public header_footer_impl
{ {
public: public:
...@@ -596,9 +586,7 @@ public: ...@@ -596,9 +586,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_header_first); CP_REGISTER_OFFICE_ELEMENT2(style_header_first);
/// \class style_footer_first
/// style:footer_first /// style:footer_first
/// style-header
class style_footer_first : public office_element_impl<style_footer_first>, public header_footer_impl class style_footer_first : public office_element_impl<style_footer_first>, public header_footer_impl
{ {
public: public:
...@@ -619,10 +607,7 @@ public: ...@@ -619,10 +607,7 @@ public:
}; };
CP_REGISTER_OFFICE_ELEMENT2(style_footer_first);
/// \class style_header_left
/// style:header-left /// style:header-left
/// style-header-left
class style_header_left : public office_element_impl<style_header_left>, public header_footer_impl class style_header_left : public office_element_impl<style_header_left>, public header_footer_impl
{ {
public: public:
...@@ -645,9 +630,7 @@ public: ...@@ -645,9 +630,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_header_left); CP_REGISTER_OFFICE_ELEMENT2(style_header_left);
/// \class style_footer_left
/// style:footer-left /// style:footer-left
/// style-footer-left
class style_footer_left : public office_element_impl<style_footer_left>, public header_footer_impl class style_footer_left : public office_element_impl<style_footer_left>, public header_footer_impl
{ {
public: public:
...@@ -750,8 +733,7 @@ public: ...@@ -750,8 +733,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_column_sep); CP_REGISTER_OFFICE_ELEMENT2(style_column_sep);
/// \class style_section_properties
/// style-section-properties
/// style:section-properties /// style:section-properties
class style_section_properties : public office_element_impl<style_section_properties> class style_section_properties : public office_element_impl<style_section_properties>
{ {
...@@ -785,7 +767,6 @@ public: ...@@ -785,7 +767,6 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_section_properties); CP_REGISTER_OFFICE_ELEMENT2(style_section_properties);
/// \class style_page_layout_attlist
/// style-page-layout-attlist /// style-page-layout-attlist
class style_page_layout_attlist class style_page_layout_attlist
{ {
...@@ -799,9 +780,7 @@ private: ...@@ -799,9 +780,7 @@ private:
}; };
/// \class style_header_style
/// style:header-style /// style:header-style
/// style-header-style
class style_header_style : public office_element_impl<style_header_style> class style_header_style : public office_element_impl<style_header_style>
{ {
public: public:
...@@ -825,9 +804,7 @@ public: ...@@ -825,9 +804,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_header_style); CP_REGISTER_OFFICE_ELEMENT2(style_header_style);
/// \class style_footer_style
/// style:footer-style /// style:footer-style
/// style-footer-style
class style_footer_style : public office_element_impl<style_header_style> class style_footer_style : public office_element_impl<style_header_style>
{ {
public: public:
...@@ -851,9 +828,7 @@ public: ...@@ -851,9 +828,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_footer_style); CP_REGISTER_OFFICE_ELEMENT2(style_footer_style);
/// \class style_page_layout
/// style:page-layout /// style:page-layout
/// style-page-layout
class style_page_layout : public office_element_impl<style_page_layout> class style_page_layout : public office_element_impl<style_page_layout>
{ {
public: public:
...@@ -975,8 +950,6 @@ private: ...@@ -975,8 +950,6 @@ private:
}; };
// \class style_footnote_sep
// style-footnote-sep
// style:footnote-sep // style:footnote-sep
class style_footnote_sep : public office_element_impl<style_footnote_sep> class style_footnote_sep : public office_element_impl<style_footnote_sep>
{ {
...@@ -1013,8 +986,6 @@ public: ...@@ -1013,8 +986,6 @@ public:
}; };
// \class style_page_layout_properties
// style-page-layout-properties
// style:page-layout-properties // style:page-layout-properties
class style_page_layout_properties : public office_element_impl<style_page_layout_properties> class style_page_layout_properties : public office_element_impl<style_page_layout_properties>
{ {
...@@ -1046,8 +1017,6 @@ public: ...@@ -1046,8 +1017,6 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(style_page_layout_properties); CP_REGISTER_OFFICE_ELEMENT2(style_page_layout_properties);
// \class text_notes_configuration
// text-notes-configuration
// text:notes-configuration // text:notes-configuration
class text_notes_configuration : public office_element_impl<text_notes_configuration> class text_notes_configuration : public office_element_impl<text_notes_configuration>
{ {
...@@ -1082,7 +1051,6 @@ public: ...@@ -1082,7 +1051,6 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_notes_configuration); CP_REGISTER_OFFICE_ELEMENT2(text_notes_configuration);
/// \class style_page_layout
/// style:presentation-page-layout /// style:presentation-page-layout
class style_presentation_page_layout; class style_presentation_page_layout;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h" #include "serialize_elements.h"
#include "odfcontext.h" #include "odfcontext.h"
#include <cpdoccore/odf/odf_document.h> #include <cpdoccore/odf/odf_document.h>
...@@ -139,7 +140,11 @@ void table_table::add_child_element( xml::sax * Reader, const ::std::wstring & N ...@@ -139,7 +140,11 @@ void table_table::add_child_element( xml::sax * Reader, const ::std::wstring & N
{ {
CP_CREATE_ELEMENT(table_shapes_); CP_CREATE_ELEMENT(table_shapes_);
} }
else else if CP_CHECK_NAME(L"calcext", L"conditional-formats")
{
CP_CREATE_ELEMENT(conditional_formats_);
}
else
CP_NOT_APPLICABLE_ELM(); CP_NOT_APPLICABLE_ELM();
} }
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include "office_elements_create.h" #include "office_elements_create.h"
#include "table_named_expressions.h" #include "table_named_expressions.h"
#include "table_database_ranges.h"
#include "calcext_elements.h"
#include "datatypes/tablemode.h" #include "datatypes/tablemode.h"
#include "datatypes/common_attlists.h" #include "datatypes/common_attlists.h"
...@@ -658,14 +660,19 @@ private: ...@@ -658,14 +660,19 @@ private:
public: public:
table_table_attlist table_table_attlist_; table_table_attlist table_table_attlist_;
office_element_ptr table_table_source_; //table-table-source
table_columns_and_groups table_columns_and_groups_;
table_rows_and_groups table_rows_and_groups_;
office_element_ptr table_table_source_;
office_element_ptr conditional_formats_;
office_element_ptr table_shapes_;
//office-dde-source //office-dde-source
//table-scenario //table-scenario
//office-forms //office-forms
office_element_ptr table_shapes_;
table_columns_and_groups table_columns_and_groups_; //table-columns-and-groups
table_rows_and_groups table_rows_and_groups_;
}; };
CP_REGISTER_OFFICE_ELEMENT2(table_table); CP_REGISTER_OFFICE_ELEMENT2(table_table);
......
#ifndef _CPDOCCORE_ODF_TABLE_CALCULATION_SETTINGS_H_ #pragma once
#define _CPDOCCORE_ODF_TABLE_CALCULATION_SETTINGS_H_
#include <iosfwd> #include <iosfwd>
#include <cpdoccore/CPOptional.h> #include <cpdoccore/CPOptional.h>
...@@ -11,8 +10,7 @@ ...@@ -11,8 +10,7 @@
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
/// \class table_calculation_settings // table:calculation-settings
/// \brief table:calculation-settings
class table_calculation_settings : public office_element_impl<table_calculation_settings> class table_calculation_settings : public office_element_impl<table_calculation_settings>
{ {
public: public:
...@@ -28,12 +26,12 @@ private: ...@@ -28,12 +26,12 @@ private:
virtual void add_text(const std::wstring & Text); virtual void add_text(const std::wstring & Text);
private: private:
_CP_OPT(bool) table_case_sensitive_; _CP_OPT(bool) table_case_sensitive_;
_CP_OPT(bool) table_precision_as_shown_; _CP_OPT(bool) table_precision_as_shown_;
_CP_OPT(bool) table_search_criteria_must_apply_to_whole_cell_; _CP_OPT(bool) table_search_criteria_must_apply_to_whole_cell_;
_CP_OPT(bool) table_automatic_find_labels_; _CP_OPT(bool) table_automatic_find_labels_;
_CP_OPT(bool) table_use_regular_expressions_; _CP_OPT(bool) table_use_regular_expressions_;
_CP_OPT(unsigned int) table_null_year_; _CP_OPT(unsigned int) table_null_year_;
office_element_ptr table_null_date_; office_element_ptr table_null_date_;
...@@ -41,8 +39,7 @@ private: ...@@ -41,8 +39,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(table_calculation_settings); CP_REGISTER_OFFICE_ELEMENT2(table_calculation_settings);
/// \class table_null_date // table:null-date
/// \brief table:null-date
class table_null_date : public office_element_impl<table_null_date> class table_null_date : public office_element_impl<table_null_date>
{ {
public: public:
...@@ -64,9 +61,7 @@ private: ...@@ -64,9 +61,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(table_null_date); CP_REGISTER_OFFICE_ELEMENT2(table_null_date);
/// \class table_iteration // table:iteration
/// \brief table:iteration
/// table-iteration
class table_iteration : public office_element_impl<table_iteration> class table_iteration : public office_element_impl<table_iteration>
{ {
public: public:
...@@ -82,14 +77,12 @@ private: ...@@ -82,14 +77,12 @@ private:
virtual void add_text(const std::wstring & Text); virtual void add_text(const std::wstring & Text);
private: private:
_CP_OPT(std::wstring) table_status_; _CP_OPT(std::wstring) table_status_;
_CP_OPT(unsigned int) table_steps_; _CP_OPT(unsigned int) table_steps_;
_CP_OPT(double) table_maximum_difference_; _CP_OPT(double) table_maximum_difference_;
}; };
CP_REGISTER_OFFICE_ELEMENT2(table_iteration); CP_REGISTER_OFFICE_ELEMENT2(table_iteration);
} }
} }
\ No newline at end of file
#endif
#include "table_database_ranges.h"
#include <boost/make_shared.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h"
#include "odfcontext.h"
#include <cpdoccore/odf/odf_document.h>
namespace cpdoccore {
namespace odf_reader {
// table:table-source
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * table_database_ranges::ns = L"table";
const wchar_t * table_database_ranges::name = L"database-ranges";
void table_database_ranges::add_attributes(xml::attributes_wc_ptr const & Attributes)
{
}
void table_database_ranges::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void table_database_ranges::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (int i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
}
// table:named-range
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * table_database_range::ns = L"table";
const wchar_t * table_database_range::name = L"database-range";
void table_database_range::add_attributes(xml::attributes_wc_ptr const & Attributes)
{
CP_APPLY_ATTR(L"table:name" , table_name_);
CP_APPLY_ATTR(L"table:target-range-address" , table_target_range_address_);
CP_APPLY_ATTR(L"table:display-filter-buttons" , table_display_filter_buttons_);
CP_APPLY_ATTR(L"table:orientation" , table_orientation_);
CP_APPLY_ATTR(L"table:contains-header" , table_contains_header_);
}
void table_database_range::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void table_database_range::xlsx_convert(oox::xlsx_conversion_context & Context)
{
if (!table_target_range_address_) return;
Context.get_table_context().start_database_range(table_name_.get_value_or(L""), *table_target_range_address_);
if (table_display_filter_buttons_)
Context.get_table_context().set_database_filter(table_display_filter_buttons_->get());
if (table_orientation_)
Context.get_table_context().set_database_orientation(*table_orientation_ == L"row" ? true : false);
if (table_contains_header_)
Context.get_table_context().set_database_header(table_contains_header_->get());
for (int i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
Context.get_table_context().end_database_range();
}
// table:sort
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * table_sort::ns = L"table";
const wchar_t * table_sort::name = L"sort";
void table_sort::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
if (L"table" == Ns && L"sort-by" == Name)
{
CP_CREATE_ELEMENT(table_sort_by_);
}
}
void table_sort::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (int i = 0; i < table_sort_by_.size(); i++)
{
table_sort_by * sort_by = dynamic_cast<table_sort_by*>(table_sort_by_[i].get());
int descending = 1;
if ((sort_by->table_order_) && (sort_by->table_order_.get() == L"descending"))
descending = 2;
Context.get_table_context().add_database_sort(sort_by->table_field_number_, descending);
}
}
// table:sort-by
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * table_sort_by::ns = L"table";
const wchar_t * table_sort_by::name = L"sort-by";
void table_sort_by::add_attributes(xml::attributes_wc_ptr const & Attributes)
{
CP_APPLY_ATTR(L"table:field-number" , table_field_number_, 0);
CP_APPLY_ATTR(L"table:data-type" , table_data_type_);
CP_APPLY_ATTR(L"table:order" , table_order_);
}
}
}
#pragma once
#include <iosfwd>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements.h"
#include "office_elements_create.h"
#include "datatypes/common_attlists.h"
#include "../docx/xlsxconversioncontext.h"
namespace cpdoccore {
using namespace odf_types;
namespace odf_reader {
// table:named-expressions
class table_database_ranges : public office_element_impl<table_database_ranges>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDatabaseRanges;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element ( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_database_ranges);
// table:named-range
class table_database_range: public office_element_impl<table_database_range>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDatabaseRange;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
_CP_OPT(std::wstring) table_name_;
_CP_OPT(std::wstring) table_target_range_address_;
_CP_OPT(Bool) table_display_filter_buttons_;
_CP_OPT(Bool) table_contains_header_;
_CP_OPT(std::wstring) table_orientation_;
//table:refresh-delay
office_element_ptr_array content_;
//"table-database-source-sql"
//"table-database-source-table"
//"table-database-source-query"
};
CP_REGISTER_OFFICE_ELEMENT2(table_database_range);
// table:sort
class table_sort: public office_element_impl<table_sort>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableSort;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes ){}
virtual void add_child_element ( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
office_element_ptr_array table_sort_by_;
//attr
//table:algorithm
//table:country
//table:language
//table:case-sensitive
};
CP_REGISTER_OFFICE_ELEMENT2(table_sort);
// table:sort-by
class table_sort_by: public office_element_impl<table_sort_by>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableSortBy;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element ( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name){}
int table_field_number_;
_CP_OPT(std::wstring) table_data_type_;
_CP_OPT(std::wstring) table_order_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_sort_by);
}
}
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h" #include "serialize_elements.h"
#include "odfcontext.h" #include "odfcontext.h"
......
#ifndef _CPDOCCORE_TABLE_NAMED_EXPRESSIONS_H_ #pragma once
#define _CPDOCCORE_TABLE_NAMED_EXPRESSIONS_H_
#include <iosfwd> #include <iosfwd>
#include <cpdoccore/CPOptional.h> #include <cpdoccore/CPOptional.h>
...@@ -94,5 +93,3 @@ CP_REGISTER_OFFICE_ELEMENT2(table_named_expression); ...@@ -94,5 +93,3 @@ CP_REGISTER_OFFICE_ELEMENT2(table_named_expression);
} }
} }
#endif
...@@ -270,7 +270,6 @@ void table_table::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -270,7 +270,6 @@ void table_table::xlsx_convert(oox::xlsx_conversion_context & Context)
} }
} }
//office-dde-sourcetable_linked_source_attlist
Context.start_table(tableName, tableStyleName); Context.start_table(tableName, tableStyleName);
table_columns_and_groups_.xlsx_convert(Context); table_columns_and_groups_.xlsx_convert(Context);
...@@ -279,7 +278,10 @@ void table_table::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -279,7 +278,10 @@ void table_table::xlsx_convert(oox::xlsx_conversion_context & Context)
if (table_shapes_) if (table_shapes_)
table_shapes_->xlsx_convert(Context); table_shapes_->xlsx_convert(Context);
Context.end_table(); if (conditional_formats_)
conditional_formats_->xlsx_convert(Context);
Context.end_table();
} }
void table_columns::xlsx_convert(oox::xlsx_conversion_context & Context) void table_columns::xlsx_convert(oox::xlsx_conversion_context & Context)
......
#ifndef _CPDOCCORE_VISITOR_H_INCLUDED_ #pragma once
#define _CPDOCCORE_VISITOR_H_INCLUDED_
/* /*
visitor: visitor:
...@@ -138,6 +136,4 @@ namespace cpdoccore { ...@@ -138,6 +136,4 @@ namespace cpdoccore {
return accept_impl(*this, guest);\ return accept_impl(*this, guest);\
} }
} }
\ No newline at end of file
#endif
...@@ -1215,6 +1215,14 @@ ...@@ -1215,6 +1215,14 @@
RelativePath="..\src\odf\anim_elements.h" RelativePath="..\src\odf\anim_elements.h"
> >
</File> </File>
<File
RelativePath="..\src\odf\calcext_elements.cpp"
>
</File>
<File
RelativePath="..\src\odf\calcext_elements.h"
>
</File>
<File <File
RelativePath="..\src\odf\chart_build_oox.cpp" RelativePath="..\src\odf\chart_build_oox.cpp"
> >
...@@ -1643,6 +1651,14 @@ ...@@ -1643,6 +1651,14 @@
RelativePath="..\src\odf\table_calculation_settings.h" RelativePath="..\src\odf\table_calculation_settings.h"
> >
</File> </File>
<File
RelativePath="..\src\odf\table_database_ranges.cpp"
>
</File>
<File
RelativePath="..\src\odf\table_database_ranges.h"
>
</File>
<File <File
RelativePath="..\src\odf\table_docx.cpp" RelativePath="..\src\odf\table_docx.cpp"
> >
......
...@@ -51,10 +51,10 @@ public: ...@@ -51,10 +51,10 @@ public:
virtual void serialize(std::wostream & _Wostream); virtual void serialize(std::wostream & _Wostream);
_CP_OPT(std::wstring) table_name_; _CP_OPT(std::wstring) table_name_;
_CP_OPT(std::wstring) table_target_range_address_; _CP_OPT(std::wstring) table_target_range_address_;
_CP_OPT(odf_types::Bool) table_display_filter_buttons_; _CP_OPT(odf_types::Bool) table_display_filter_buttons_;
}; };
...@@ -62,31 +62,5 @@ public: ...@@ -62,31 +62,5 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(table_database_range); CP_REGISTER_OFFICE_ELEMENT2(table_database_range);
///// \brief table:named-expression
//class table_named_expression : public office_element_impl<table_named_expression>
//{
//public:
// static const wchar_t * ns;
// static const wchar_t * name;
// static const xml::NodeType xml_type = xml::typeElement;
// static const ElementType type = typeTableNamedExpression;
//
// CPDOCCORE_DEFINE_VISITABLE()
//
// virtual void create_child_element(const ::std::wstring & Ns, const ::std::wstring & Name){}
// virtual void add_child_element( const office_element_ptr & child_element){}
//
// virtual void serialize(std::wostream & _Wostream);
//
// _CP_OPT(std::wstring) table_name_;
// _CP_OPT(std::wstring) table_expression_;
// _CP_OPT(std::wstring) table_base_cell_address_;
//
//};
//
//CP_REGISTER_OFFICE_ELEMENT2(table_named_expression);
} }
} }
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