Compare commits

..

40 Commits

Author SHA1 Message Date
65a203838b fix buid 2022-09-28 14:21:14 +03:00
8301f402c5 Merge pull request #1042 from ONLYOFFICE/fix/bug59153
Fix bug 59153
2022-09-27 11:43:29 +03:00
caab9eae47 Fix bug 59119 2022-09-27 11:34:54 +03:00
f5282fdc98 Fix bug 59153 2022-09-27 10:10:00 +03:00
d560fcc0a8 fix buid 2022-09-27 09:51:49 +03:00
9ca7cc5008 Merge pull request #1041 from ONLYOFFICE/fix/v.7.2-fix-bugs
Fix/v.7.2 fix bugs
2022-09-26 16:08:37 +03:00
56c3301e54 for bug #59118 2022-09-23 17:57:49 +03:00
23bf5cb929 Merge branch 'feature/v7.2-controls' into fix/v.7.2-fix-bugs 2022-09-23 17:56:19 +03:00
0b1c7f2642 fix viewProps presentation 2022-09-22 15:22:58 +03:00
b0d0186dd4 Merge branch release/v7.2.0 into master 2022-09-22 12:17:40 +00:00
d72d114f19 fix bug #59118
refactoring
2022-09-22 00:43:51 +03:00
a0cf3f13c3 Merge remote-tracking branch 'origin/fix/v7.2.0-ppt-2' into fix/v.7.2-fix-bugs 2022-09-21 10:34:33 +03:00
d400135f60 Merge branch 'fix/v7.2.0-fix-bugs' into fix/v.7.2-fix-bugs 2022-09-21 10:33:22 +03:00
856933b884 fix bug #59108 2022-09-20 20:12:44 +03:00
eab909f76b fix bug #59106 2022-09-20 19:30:00 +03:00
30799c7b8c fix bug #59074 2022-09-20 17:00:33 +03:00
c3246cf089 fix charset == 128 2022-09-19 18:41:14 +03:00
8032ffa3fd fix bug #59071 2022-09-19 14:18:28 +03:00
a6e490f70a fix bug #59070 2022-09-19 14:18:28 +03:00
e72ad2def4 For bug 59079 2022-09-16 22:41:48 +03:00
cfce809885 For bug 58435 2022-09-16 21:35:03 +03:00
760242fa4d fix bug #58814 2022-09-16 08:46:57 +03:00
c257b901ac Fix bug 59046 2022-09-15 17:47:23 +03:00
1873515006 Fix bug 58096 2022-09-15 16:33:08 +03:00
cb76784260 fix bug #59002 2022-09-15 13:24:16 +03:00
4982e1e1ed Merge pull request #1036 from ONLYOFFICE/fix/bug59036
Fix bug 59036
2022-09-14 19:05:28 +03:00
c087e9e9e4 Fix bug 59036
fix string path offset
2022-09-14 18:40:23 +03:00
4dae14c0b0 Merge pull request #1034 from ONLYOFFICE/fix/meta2
Fix temp files
2022-09-14 15:51:10 +03:00
798c8ee702 Fix temp files 2022-09-14 15:04:31 +03:00
f6974d1064 Merge pull request #1033 from ONLYOFFICE/fix/v7.2.0-fix-bugs
Fix/v7.2.0 fix bugs
2022-09-14 10:35:38 +03:00
78289248c8 . 2022-09-14 10:25:32 +03:00
bdbe8e811c Merge remote-tracking branch 'origin/fix/v7.2.0-ppt-2' into fix/v7.2.0-fix-bugs 2022-09-14 10:22:26 +03:00
5a0c45a87d for bug #57526 2022-09-14 10:19:37 +03:00
13316ce210 fix bug #59012 2022-09-13 18:14:45 +03:00
fb5ae0133c fix bug #58967 2022-09-13 15:55:08 +03:00
3c7cf1b061 fix bug #58982
refactoring & fix other bugs spreadsheet 2003 xml
2022-09-13 11:25:15 +03:00
108ff55a61 fix pictureBrightness 2022-09-09 18:13:16 +03:00
eaa3aa0e96 fix bug #58841 2022-09-09 17:56:58 +03:00
1475162206 controls(activeX) presentation 2022-09-08 13:49:47 +03:00
d4a4e91d5a Merge branch hotfix/v7.1.1 into master 2022-07-11 08:58:59 +00:00
156 changed files with 3175 additions and 2062 deletions

View File

@ -148,7 +148,8 @@ namespace BinXlsxRW{
oDrawingConverter.SetDstPath(sDstPath + FILE_SEPARATOR_STR + L"xl");
oDrawingConverter.SetSrcPath(strFileInDir, 2);
oDrawingConverter.SetFontDir(m_sFontDir);
BinXlsxRW::BinaryFileReader oBinaryFileReader;
return oBinaryFileReader.Xml2Xlsx(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions, m_bIsMacro);
}

View File

@ -233,7 +233,6 @@ public:
else if ((pos + 8 <= size) && (expr.substr(pos, 8) == L"APERSAND"))
{
result += L"&"; pos += 8;
result += expr[pos++];
}
else
{
@ -791,7 +790,6 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
boost::match_default | boost::format_all);
}
XmlUtils::replace_all(res, L"&", L"&amp;");
oox_replace_tmp_back(res);
replace_vertical(res);

View File

@ -569,7 +569,8 @@ enum ElementType
typeScriptEventListener,
typeNumberNumberStyle,
typeNumberBaseStyle,
typeNumberNumberStyle,
typeNumberDataStyle,
typeNumberText,
typeNumberNumber,

View File

@ -37,6 +37,8 @@
#include <stack>
#include <cassert>
#include "../../../Common/DocxFormat/Source/XML/Utils.h"
namespace cpdoccore
{

View File

@ -99,14 +99,14 @@ void pptx_xml_slide::write_to(std::wostream & strm)
{
CP_XML_ATTR(L"name", name());
CP_XML_STREAM() << strmBackground_.str();
CP_XML_STREAM() << strmBackground_.rdbuf();
CP_XML_NODE(L"p:spTree")
{
CP_XML_STREAM() << strmData_.str();
CP_XML_STREAM() << strmData_.rdbuf();
}
}
CP_XML_STREAM() << strmTiming_.str();
CP_XML_STREAM() << strmTiming_.rdbuf();
CP_XML_NODE(L"p:clrMapOvr")
{
CP_XML_NODE(L"a:masterClrMapping");
@ -165,7 +165,7 @@ void pptx_xml_slideLayout::write_to(std::wostream & strm)
{
CP_XML_NODE(L"p:spTree")
{
CP_XML_STREAM() << strmData_.str();
CP_XML_STREAM() << strmData_.rdbuf();
//в slideLayoutData_
//contentPart (Content Part) §19.3.1.14
@ -258,11 +258,11 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
CP_XML_NODE(L"p:cSld")
{
CP_XML_STREAM() << strmBackground_.str();
CP_XML_STREAM() << strmBackground_.rdbuf();
CP_XML_NODE(L"p:spTree")
{
CP_XML_STREAM() << strmData_.str();
CP_XML_STREAM() << strmData_.rdbuf();
}
}
CP_XML_NODE(L"p:clrMap")
@ -291,7 +291,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
}
}
}
CP_XML_STREAM() << strmDataExtra_.str();
CP_XML_STREAM() << strmDataExtra_.rdbuf();
CP_XML_NODE(L"p:txStyles")
{
CP_XML_NODE(L"p:titleStyle");
@ -324,17 +324,17 @@ void pptx_xml_theme::write_to(std::wostream & strm)
CP_XML_NODE(L"a:clrScheme")
{
CP_XML_ATTR(L"name", name_);
CP_XML_STREAM() << clrSchemeData_.str();
CP_XML_STREAM() << clrSchemeData_.rdbuf();
}
CP_XML_NODE(L"a:fontScheme")
{
CP_XML_ATTR(L"name", name_);
CP_XML_STREAM() << fontSchemeData_.str();
CP_XML_STREAM() << fontSchemeData_.rdbuf();
}
CP_XML_NODE(L"a:fmtScheme")
{
CP_XML_ATTR(L"name", name_);
CP_XML_STREAM() << fmtSchemeData_.str();
CP_XML_STREAM() << fmtSchemeData_.rdbuf();
}
}
}
@ -417,7 +417,7 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
CP_XML_NODE(L"p:sldMasterIdLst")
{
CP_XML_STREAM() << slideMastersData_.str();
CP_XML_STREAM() << slideMastersData_.rdbuf();
}
std::wstring notesMaster = slideNotesMastersData_.str();
if (notesMaster.empty() == false)
@ -429,11 +429,11 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
}
CP_XML_NODE(L"p:sldIdLst")
{
CP_XML_STREAM() << slidesData_.str();
CP_XML_STREAM() << slidesData_.rdbuf();
}
CP_XML_STREAM() << slidesProperties_.str();
CP_XML_STREAM() << slidesProperties_.rdbuf();
CP_XML_STREAM() << slidesNotesProperties_.str();
CP_XML_STREAM() << slidesNotesProperties_.rdbuf();
CP_XML_NODE(L"p:defaultTextStyle")//??
{
@ -491,11 +491,11 @@ void pptx_xml_slideNotes::write_to(std::wostream & strm)
CP_XML_NODE(L"p:cSld")
{
CP_XML_STREAM() << strmBackground_.str();
CP_XML_STREAM() << strmBackground_.rdbuf();
CP_XML_NODE(L"p:spTree")
{
CP_XML_STREAM() << strmData_.str();
CP_XML_STREAM() << strmData_.rdbuf();
}
}
CP_XML_NODE(L"p:clrMapOvr")
@ -563,11 +563,11 @@ void pptx_xml_slideNotesMaster::write_to(std::wostream & strm)
CP_XML_NODE(L"p:cSld")
{
CP_XML_STREAM() << strmBackground_.str();
CP_XML_STREAM() << strmBackground_.rdbuf();
CP_XML_NODE(L"p:spTree")
{
CP_XML_STREAM() << strmData_.str();
CP_XML_STREAM() << strmData_.rdbuf();
}
}
CP_XML_NODE(L"p:clrMap")

View File

@ -33,9 +33,9 @@
#include "xlsx_defined_names.h"
#include <vector>
#include "../../include/xml/simple_xml_writer.h"
#include "../../formulasconvert/formulasconvert.h"
#include "../../include/xml/simple_xml_writer.h"
namespace cpdoccore {
namespace oox {
@ -75,7 +75,7 @@ public:
{
CP_XML_NODE(L"definedName")
{
CP_XML_ATTR(L"name", content_[i].name);
CP_XML_ATTR(L"name", XmlUtils::EncodeXmlString(content_[i].name));
if (content_[i].tableId >= 0)
{
@ -84,11 +84,11 @@ public:
if ( content_[i].ref.find(L"#REF!") != std::wstring::npos )
{
CP_XML_ATTR(L"comment", content_[i].ref);
CP_XML_ATTR(L"comment", XmlUtils::EncodeXmlString(content_[i].ref));
CP_XML_CONTENT(L"#REF!");
}
else
CP_XML_CONTENT(content_[i].ref);
CP_XML_CONTENT(XmlUtils::EncodeXmlString(content_[i].ref));
}
}

View File

@ -45,6 +45,29 @@ public:
std::wstring name_;
bool hidden_;
void clear()
{
cols_.clear();
sheetFormat_.clear();
sheetData_.clear();
mergeCells_.clear();
hyperlinks_.clear();
comments_.clear();
sort_.clear();
tableParts_.clear();
autofilter_.clear();
conditionalFormatting_.clear();
picture_background_.clear();
dataValidations_.clear();
dataValidationsX14_.clear();
ole_objects_.clear();
page_props_.clear();
header_footer_.clear();
controls_.clear();
protection_.clear();
breaks_.clear();
}
std::wstringstream cols_;
std::wstringstream sheetFormat_;
std::wstringstream sheetData_;
@ -196,43 +219,44 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
CP_XML_ATTR(L"mc:Ignorable",L"x14ac");
CP_XML_ATTR(L"xmlns:x14ac", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac");
CP_XML_STREAM() << impl_->sheetFormat_.str();
CP_XML_STREAM() << impl_->sheetFormat_.rdbuf();
CP_XML_STREAM() << impl_->cols_.str();
CP_XML_STREAM() << impl_->cols_.rdbuf();
CP_XML_NODE(L"sheetData")
{
CP_XML_STREAM() << impl_->sheetData_.str();
impl_->sheetData_.flush();
CP_XML_STREAM() << impl_->sheetData_.rdbuf();
}
if (!impl_->protection_.str().empty())
{
CP_XML_STREAM() << impl_->protection_.str();
CP_XML_STREAM() << impl_->protection_.rdbuf();
}
//оказывается порядок нахождения элементов важен !!! (для office 2010)
//объединенные ячейки раньше чем гиперлинки !!!
CP_XML_STREAM() << impl_->autofilter_.str(); //автофильтры перед merge !!!
CP_XML_STREAM() << impl_->autofilter_.rdbuf(); //автофильтры перед merge !!!
CP_XML_STREAM() << impl_->mergeCells_.str();
CP_XML_STREAM() << impl_->mergeCells_.rdbuf();
CP_XML_STREAM() << impl_->sort_.str();
CP_XML_STREAM() << impl_->sort_.rdbuf();
CP_XML_STREAM() << impl_->conditionalFormatting_.str();
CP_XML_STREAM() << impl_->conditionalFormatting_.rdbuf();
CP_XML_STREAM() << impl_->dataValidations_.str();
CP_XML_STREAM() << impl_->dataValidations_.rdbuf();
if (!impl_->hyperlinks_.str().empty())
{
CP_XML_NODE(L"hyperlinks")
{
CP_XML_STREAM() << impl_->hyperlinks_.str();
CP_XML_STREAM() << impl_->hyperlinks_.rdbuf();
}
}
CP_XML_STREAM() << impl_->page_props_.str();
CP_XML_STREAM() << impl_->page_props_.rdbuf();
//props выше legacyDrawing !!
CP_XML_STREAM() << impl_->header_footer_.str();
CP_XML_STREAM() << impl_->header_footer_.rdbuf();
CP_XML_STREAM() << impl_->breaks_.str();
CP_XML_STREAM() << impl_->breaks_.rdbuf();
if (false == impl_->drawingId_.empty())
{
@ -252,21 +276,21 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
{
CP_XML_NODE(L"oleObjects")
{
CP_XML_STREAM() << impl_->ole_objects_.str();
CP_XML_STREAM() << impl_->ole_objects_.rdbuf();
}
}
if (false == impl_->controls_.str().empty())
{
CP_XML_NODE(L"controls")
{
CP_XML_STREAM() << impl_->controls_.str();
CP_XML_STREAM() << impl_->controls_.rdbuf();
}
}
if (false == impl_->tableParts_.str().empty())
{
CP_XML_NODE(L"tableParts")
{
CP_XML_STREAM() << impl_->tableParts_.str();
CP_XML_STREAM() << impl_->tableParts_.rdbuf();
}
}
CP_XML_STREAM() << impl_->picture_background_.str();
@ -280,12 +304,13 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
CP_XML_ATTR(L"uri", L"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}");
CP_XML_ATTR(L"xmlns:x14", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
CP_XML_STREAM() << impl_->dataValidationsX14_.str();
CP_XML_STREAM() << impl_->dataValidationsX14_.rdbuf();
}
}
}
}
}
impl_->clear();
}
void xlsx_xml_worksheet::set_drawing_link(std::wstring const & fileName, std::wstring const & id)

View File

@ -173,7 +173,7 @@ void sheets_files::write(const std::wstring & RootPath)
//item->get_rel_file()->write(path.string<std::wstring>());
package::simple_element(fileName, item->str()).write(path);
package::simple_element(fileName, item->content().str()).write(path);
}
}
//--------------------------------------------------------------------------------------------
@ -375,7 +375,7 @@ void xl_pivot_cache_files::write(const std::wstring & RootPath)
contentTypes->add_override(std::wstring(L"/xl/pivotCache/") + fileNameD, kWSConTypeD);
package::simple_element(fileNameD, pivot_caches_[i]->str_d()).write(path);
package::simple_element(fileNameD, pivot_caches_[i]->definitions().str()).write(path);
if (pivot_caches_[i]->get_rels().empty() == false)
{
@ -392,7 +392,7 @@ void xl_pivot_cache_files::write(const std::wstring & RootPath)
const std::wstring fileRef = std::wstring(L"pivotCache/") + fileNameD;
rels_->add(id, kWSRel, fileRef);
}
std::wstring content_records = pivot_caches_[i]->str_r();
std::wstring content_records = pivot_caches_[i]->records().str();
if (!content_records.empty())
{
const std::wstring fileNameR = std::wstring(L"pivotCacheRecords") + std::to_wstring(i + 1) + L".xml";

View File

@ -57,13 +57,11 @@ class sheet_content : noncopyable
{
public:
sheet_content();
std::wostream & content() { return content_; }
std::wstringstream & content() { return content_; }
void add_rel(relationship const & r);
void add_rels(rels & r);
rels_file_ptr get_rel_file() { return rels_; }
std::wstring str() { return content_.str(); }
static _CP_PTR(sheet_content) create();
private:
std::wstringstream content_;
rels_file_ptr rels_;
@ -79,13 +77,10 @@ public:
pivot_cache_content();
static _CP_PTR(pivot_cache_content) create();
std::wostream & definitions() { return definitions_; }
std::wostream & records() { return records_; }
std::wstringstream & definitions() { return definitions_; }
std::wstringstream & records() { return records_; }
rels & get_rels() { return definitions_rels_file_->get_rels(); }
std::wstring str_d() { return definitions_.str(); }
std::wstring str_r() { return records_.str(); }
friend class xl_pivot_cache_files;
private:
std::wstringstream records_;

View File

@ -236,20 +236,20 @@ double convertTime(int hours, int minutes, double sec)
return v;
}
bool parseDate(const std::wstring & Date, int & Year, int & Month, int & Day)
bool parseDateTime(const std::wstring & DateTime, int & Year, int & Month, int & Day,
_CP_OPT(int) & Hours, _CP_OPT(int) & Minutes, _CP_OPT(int) & Sec)
{
// for example, "1899-12-31T05:37:46.665696"
try
{
boost::wregex r(L"([\\d]+)-([\\d]+)-([\\d]+)(?:T([\\d]+):([\\d]+):([\\d]+)(?:\\.([\\d]+))?)?");
boost::match_results<std::wstring::const_iterator> res;
if (boost::regex_match(Date, res, r))
if (boost::regex_match(DateTime, res, r))
{
Year = boost::lexical_cast<int>(res[1].str());
Month = boost::lexical_cast<int>(res[2].str());
Day = boost::lexical_cast<int>(res[3].str());
int Hours, Minutes, Sec, FSec;
if (res[4].matched)
Hours = boost::lexical_cast<int>(res[4].str());
@ -260,7 +260,7 @@ bool parseDate(const std::wstring & Date, int & Year, int & Month, int & Day)
Sec = boost::lexical_cast<int>(res[6].str());
if (res[7].matched)
FSec = boost::lexical_cast<int>(res[7].str());
int FSec = boost::lexical_cast<int>(res[7].str());
return true;
}

View File

@ -33,7 +33,7 @@
#include <string>
#include <boost/cstdint.hpp>
#include "../../include/CPOptional.h"
#include "xlsx_cell_format.h"
namespace cpdoccore {
@ -57,9 +57,7 @@ bool parseBoolVal(const std::wstring & str);
std::wstring cellType2Str(XlsxCellType::type type);
bool parseDate(const std::wstring & Date, int & Year, int & Month, int & Day);
bool parseDateTime(const std::wstring & DateTime, int & Y, int & M, int & D, _CP_OPT(int) & H, _CP_OPT(int) & Min, _CP_OPT(int) & S);
bool parseTime(const std::wstring & Time, int & Hours, int & Minutes, double & seconds);
boost::int64_t convertDate(int Year, int Month, int Day);
double convertTime(int hours, int minutes, double sec);

View File

@ -252,7 +252,7 @@ void xlsx_conversion_context::end_document()
CP_XML_NODE(L"sheets")
{
CP_XML_STREAM() << workbook_content.str();
CP_XML_STREAM() << workbook_content.rdbuf();
}
if (false == mapExternalLink_.empty())
{

View File

@ -810,7 +810,7 @@ const wchar_t * table_content_validation::name = L"content-validation";
void table_content_validation::add_attributes(xml::attributes_wc_ptr const & Attributes)
{
CP_APPLY_ATTR(L"table:name", table_name_);
CP_APPLY_ATTR(L"table:name", table_name_);
CP_APPLY_ATTR(L"table:condition", table_condition_);
CP_APPLY_ATTR(L"table:display-list", table_display_list_);
CP_APPLY_ATTR(L"table:allowempty-cell", table_allowempty_cell_);

View File

@ -461,11 +461,7 @@ double pixToSize(double pixels, double maxDigitSize)
return (int(( pixels /*/ 0.75*/ - 5)/ maxDigitSize * 100. + 0.5)) /100. * 0.9; // * 9525. * 72.0 / (360000.0 * 2.54);
}
double cmToChars (double cm)
{
double pt = cm * 28.34467120181406;
return pt * 48. /(12.75 * 8.43 *2.);
}
}
void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
@ -552,8 +548,6 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
const double pixDpi = in_width * 96.;
width = pixToSize(pixDpi, Context.getMaxDigitSize().first);
//const double width = cmToChars(prop->attlist_.style_column_width_->get_value_unit(length::cm));
// see ECMA-376 page 1768
if (in_width > 0)
CP_XML_ATTR(L"width", *width);
@ -814,12 +808,25 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
if (attr.office_date_value_)
{
int y, m, d;
if (oox::parseDate(attr.office_date_value_.get(), y, m, d))
_CP_OPT(int) h, min, sec;
if (oox::parseDateTime(attr.office_date_value_.get(), y, m, d, h, min, sec))
{
boost::int64_t intDate = oox::convertDate(y, m, d);
_CP_OPT(double) dTime;
if (h && min)
{
dTime = oox::convertTime(*h, *min, sec.get_value_or(0));
}
if (intDate > 0)
{
number_val = boost::lexical_cast<std::wstring>(intDate);
if (dTime)
{
number_val = XmlUtils::DoubleToString(*dTime + intDate);
}
else
{
number_val = boost::lexical_cast<std::wstring>(intDate);
}
xlsx_value_type = oox::XlsxCellType::n;
if (num_format_type == office_value_type::Currency)
@ -1005,7 +1012,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
CP_XML_ATTR(L"t", L"array");
CP_XML_ATTR(L"aca", false);
}
CP_XML_CONTENT(xlsxFormula);
CP_XML_CONTENT(XmlUtils::EncodeXmlString(xlsxFormula));
}
}
}
@ -1155,12 +1162,26 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte
if (attr.office_date_value_)
{
int y, m, d;
if (oox::parseDate(attr.office_date_value_.get(), y, m, d))
_CP_OPT(int) h, min, s;
if (oox::parseDateTime(attr.office_date_value_.get(), y, m, d, h, min, s))
{
boost::int64_t intDate = oox::convertDate(y, m, d);
_CP_OPT(double) dTime;
if (h && min)
{
dTime = oox::convertTime(*h, *min, s.get_value_or(0));
}
if (intDate > 0)
{
number_val = boost::lexical_cast<std::wstring>(intDate);
if (dTime)
{
number_val = XmlUtils::DoubleToString(*dTime + intDate);
}
else
{
number_val = std::to_wstring(intDate);
}
}
else
{

View File

@ -41,9 +41,9 @@ class abstract_xml : public office_element_impl<abstract_xml>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = type_AbstractXml;
CPDOCCORE_DEFINE_VISITABLE()
public:
abstract_xml() {}

View File

@ -49,9 +49,9 @@ class anim_par : public office_element_impl<anim_par>//Параллельные
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeAnimPar;
CPDOCCORE_DEFINE_VISITABLE();
odf_types::common_anim_smil_attlist attlist_;
office_element_ptr anim_par_;
@ -70,9 +70,8 @@ class anim_seq : public office_element_impl<anim_seq>//Последовател
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeAnimSeq;
CPDOCCORE_DEFINE_VISITABLE();
static const ElementType type = typeAnimSeq;
odf_types::common_anim_smil_attlist attlist_;
office_element_ptr_array anim_par_array_;
@ -112,9 +111,9 @@ class anim_transitionFilter : public office_element_impl<anim_transitionFilter>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeAnimTransitionFilter;
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){}
@ -131,9 +130,9 @@ class anim_audio : public office_element_impl<anim_audio>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeAnimAudio;
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){}

View File

@ -56,9 +56,9 @@ void calcext_icon_set_attr::serialize(CP_ATTR_NODE)
}
void calcext_condition_attr::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"calcext:base-cell-address", calcext_base_cell_address_);
CP_XML_ATTR_OPT(L"calcext:apply-style-name", calcext_apply_style_name_);
CP_XML_ATTR_OPT(L"calcext:value", calcext_value_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:base-cell-address", calcext_base_cell_address_);
CP_XML_ATTR_OPT(L"calcext:apply-style-name", calcext_apply_style_name_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:value", calcext_value_);
}
void calcext_date_is_attr::serialize(CP_ATTR_NODE)
{
@ -216,7 +216,7 @@ void calcext_formatting_entry::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"calcext:value",calcext_value_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:value",calcext_value_);
CP_XML_ATTR_OPT(L"calcext:type", calcext_type_);
}
}
@ -233,7 +233,7 @@ void calcext_color_scale_entry::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"calcext:value", calcext_value_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:value", calcext_value_);
CP_XML_ATTR_OPT(L"calcext:type", calcext_type_);
CP_XML_ATTR_OPT(L"calcext:color", calcext_color_);
}

View File

@ -94,9 +94,9 @@ class calcext_color_scale_entry : 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 = typeCalcextColorScaleEntry;
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){}
@ -116,9 +116,9 @@ class calcext_formatting_entry : public office_element_impl<calcext_formatting_e
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 create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -137,9 +137,9 @@ 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 create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -158,9 +158,9 @@ 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 create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -178,9 +178,9 @@ 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 create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -197,9 +197,9 @@ 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 create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -216,9 +216,9 @@ 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 create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -235,9 +235,9 @@ class calcext_conditional_format: public office_element_impl<calcext_conditional
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 create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -258,9 +258,9 @@ class calcext_conditional_formats: public office_element_impl<calcext_conditiona
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 create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -38,11 +38,6 @@
#include <boost/algorithm/string.hpp>
#include <xml/xmlchar.h>
#include <xml/attributes.h>
#include "odf_conversion_context.h"
namespace cpdoccore {

View File

@ -48,10 +48,8 @@ class draw_base : public office_element_impl<draw_base>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawBase;
CPDOCCORE_DEFINE_VISITABLE()
static const ElementType type = typeDrawBase;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -62,7 +60,6 @@ public:
odf_types::union_common_draw_attlists common_draw_attlists_;
office_element_ptr_array content_;
};
}

View File

@ -67,9 +67,9 @@ class draw_image : public office_element_impl<draw_image>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawImage;
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);
@ -93,9 +93,9 @@ class draw_chart : public office_element_impl<draw_chart>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawChart;
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);
@ -118,9 +118,7 @@ class draw_frame : public draw_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawFrame;
CPDOCCORE_DEFINE_VISITABLE()
static const ElementType type = typeDrawFrame;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -148,9 +146,9 @@ class draw_g : public office_element_impl<draw_g>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawG;
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);
@ -183,9 +181,9 @@ class draw_text_box : public office_element_impl<draw_text_box>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawTextBox;
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);
@ -204,9 +202,9 @@ class draw_object : public office_element_impl<draw_object>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawObject;
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);
@ -225,9 +223,9 @@ class draw_object_ole : public office_element_impl<draw_object>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawObjectOle;
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);
@ -246,9 +244,9 @@ class draw_plugin : public office_element_impl<draw_plugin>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawPlugin;
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);

View File

@ -68,9 +68,9 @@ class draw_page : public office_element_impl<draw_page>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawPage;
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);
@ -91,9 +91,9 @@ class presentation_footer_decl : public office_element_impl<presentation_footer_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationFooterDecl;
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){}
@ -112,9 +112,9 @@ class presentation_date_time_decl : public office_element_impl<presentation_date
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationDateTimeDecl;
CPDOCCORE_DEFINE_VISITABLE();
_CP_OPT(std::wstring) presentation_name_;
_CP_OPT(std::wstring) presentation_source_;
@ -134,9 +134,9 @@ class presentation_notes : public office_element_impl<presentation_notes>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationNotes;
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);

View File

@ -46,7 +46,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawShape;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
virtual void serialize_attlist(CP_ATTR_NODE);
@ -56,7 +56,7 @@ public:
_CP_OPT(std::wstring) draw_id_;//используется для анимашек
CPDOCCORE_DEFINE_VISITABLE();
int sub_type_;
@ -79,7 +79,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawRect;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -104,7 +104,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawEllipse;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -120,7 +120,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawCircle;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
};
@ -146,7 +146,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawLine;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -172,7 +172,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawPath;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -199,7 +199,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawPolygon;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -219,7 +219,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawCustomShape;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
virtual void add_child_element( const office_element_ptr & child_element);
@ -248,8 +248,8 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawEquation;
static const xml::NodeType xml_type = xml::typeElement;
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){}
@ -294,8 +294,8 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawHandle;
static const xml::NodeType xml_type = xml::typeElement;
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){}
@ -340,7 +340,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawEnhancedGeometry;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -361,7 +361,7 @@ public:
static int parsing(_CP_OPT(std::wstring) val);//todoooo наоборот
CPDOCCORE_DEFINE_VISITABLE();
};
CP_REGISTER_OFFICE_ELEMENT2(draw_enhanced_geometry);
@ -375,7 +375,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawCaption;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
};
@ -399,7 +399,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawConnector;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -418,7 +418,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawControl;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -442,7 +442,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDr3dScene;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -462,7 +462,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDr3dExtrude;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -479,7 +479,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDr3dRotate;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -494,9 +494,9 @@ class dr3d_light : public office_element_impl<dr3d_light>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDr3dLight;
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){}
@ -519,7 +519,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDr3dCube;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -541,7 +541,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDr3dSphere;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -564,8 +564,8 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawA;
static const xml::NodeType xml_type = xml::typeElement;
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);

View File

@ -71,9 +71,9 @@ class style_header_footer_properties : public office_element_impl<style_header_f
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleHeaderFooterProperties;
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)

View File

@ -45,9 +45,9 @@ class text_number : public office_element_impl<text_number>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNumber;
CPDOCCORE_DEFINE_VISITABLE()
public:
text_number() {}
@ -74,9 +74,9 @@ class text_list_item : public office_element_impl<text_list_item>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListItem;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -110,9 +110,9 @@ class text_list_header : public office_element_impl<text_list_header>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListHeader;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -41,10 +41,10 @@ class math_mstack : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMStack;
CPDOCCORE_DEFINE_VISITABLE();
private:
@ -65,10 +65,10 @@ class math_msrow : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSRow;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -88,10 +88,10 @@ class math_msline : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSLine;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -111,10 +111,10 @@ class math_mlongdiv : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSLongDiv;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -134,10 +134,10 @@ class math_mscarries : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSCarries;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -156,10 +156,10 @@ class math_msgroup : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSGroup;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -179,11 +179,11 @@ class math_mscarry : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSCarry;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(const office_element_ptr & child_element);

View File

@ -52,7 +52,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeMathElement;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name) {}
virtual void add_child_element(const office_element_ptr & child_element) {}
@ -60,8 +60,8 @@ public:
virtual void serialize(std::wostream & _Wostream) {}
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
friend class odf_document;
};
@ -72,10 +72,10 @@ class office_math : public office_element_impl<office_math>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMath;
CPDOCCORE_DEFINE_VISITABLE();
friend class odf_document;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -94,11 +94,11 @@ class math_semantics : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMathSemantics;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(const office_element_ptr & child_element);
@ -116,14 +116,12 @@ class math_annotation : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMathAnnotation;
_CP_OPT(std::wstring) encoding_;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(const office_element_ptr & child_element);
@ -144,11 +142,11 @@ class math_annotation_xml : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMathAnnotationXml;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(const office_element_ptr & child_element);

View File

@ -49,13 +49,13 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMRow;
math_mrow();
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -73,11 +73,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMFrac;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
_CP_OPT(Bool) bevelled;
private:
@ -99,11 +99,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSqrt;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -120,11 +120,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMRoot;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -141,11 +141,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMStyle;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
_CP_OPT(color) color_;
@ -169,10 +169,10 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMEnClose;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -189,11 +189,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMFenced;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -210,11 +210,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMPadded;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);

View File

@ -43,11 +43,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSub;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -65,11 +65,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSup;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -88,11 +88,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSubSup;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -109,11 +109,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMNone;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -132,11 +132,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMPreScripts;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -151,11 +151,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMMultiScripts;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -174,11 +174,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMUnderOver;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -195,11 +195,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMOver;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
_CP_OPT(Bool) accent;
private:
@ -217,11 +217,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMUnder;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);

View File

@ -41,11 +41,11 @@ class math_mtable : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMTable;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -64,11 +64,11 @@ class math_malignmark : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMAlignMark;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -87,11 +87,11 @@ class math_maligngroup : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMAlignGroup;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -110,11 +110,11 @@ class math_mtd : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMTd;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -133,11 +133,11 @@ class math_mlabeledtr : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMLabelEdTr;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -156,11 +156,11 @@ class math_mtr : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMTr;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);

View File

@ -44,7 +44,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMI;
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -68,7 +68,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMO;
_CP_OPT(Bool) accent_;
@ -97,7 +97,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMN;
@ -123,7 +123,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMText;
@ -149,7 +149,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSpace;
@ -173,7 +173,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMS;
@ -197,7 +197,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMGlyph;

View File

@ -49,6 +49,9 @@ namespace cpdoccore {
using namespace odf_types;
namespace odf_writer {
const wchar_t * number_style_base::ns = L"number";
const wchar_t * number_style_base::name = L"base-style";
std::wstring number_style_base::get_style_name() const
{

View File

@ -43,12 +43,13 @@
namespace cpdoccore {
namespace odf_writer {
class number_style_base : public office_element
class number_style_base : public office_element_impl<number_style_base>
{
public:
CPDOCCORE_DEFINE_VISITABLE()
static const wchar_t * ns;
static const wchar_t * name;
static const ElementType type = typeNumberBaseStyle;
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -71,10 +72,10 @@ class number_number_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberNumberStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
virtual void serialize(std::wostream & strm);
@ -87,10 +88,10 @@ class number_currency_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberCurrencyStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
virtual void serialize(std::wostream & strm);
};
@ -102,10 +103,10 @@ class number_text_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberTextStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
virtual void serialize(std::wostream & strm);
};
@ -117,10 +118,10 @@ class number_date_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberDataStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
virtual void serialize(std::wostream & strm);
@ -134,10 +135,8 @@ class number_percentage_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberPercentageStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
virtual void serialize(std::wostream & strm);
};
@ -149,11 +148,9 @@ class number_time_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberTimeStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
static const ElementType type = typeNumberTimeStyle;
_CP_OPT(bool) number_automatic_order_;
virtual void serialize(std::wostream & strm);
@ -166,9 +163,9 @@ class number_text : public office_element_impl<number_text>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberText;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
@ -187,9 +184,9 @@ class number_number : public office_element_impl<number_number>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberNumber;
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);
@ -215,9 +212,9 @@ class number_embedded_text : public office_element_impl<number_embedded_text>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberEmbeddedText;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -236,9 +233,9 @@ class number_scientific_number : public office_element_impl<number_scientific_nu
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberScientificNumber;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -263,9 +260,9 @@ class number_currency_symbol : public office_element_impl<number_currency_symbol
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberCurrencySymbol;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -286,9 +283,9 @@ class number_text_content : public office_element_impl<number_text_content>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberTextContent;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
@ -306,9 +303,9 @@ class number_day_of_week : public office_element_impl<number_day_of_week>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberDayOfWeek;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -324,9 +321,9 @@ class number_quarter : public office_element_impl<number_quarter>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberQuarter;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -342,9 +339,9 @@ class number_day : public office_element_impl<number_day>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberDay;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -361,9 +358,9 @@ class number_month : public office_element_impl<number_month>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberMonth;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -381,9 +378,9 @@ class number_year : public office_element_impl<number_year>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberYear;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -399,9 +396,9 @@ class number_hours : public office_element_impl<number_hours>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberHours;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -417,9 +414,9 @@ class number_minutes : public office_element_impl<number_minutes>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberMinutes;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -435,9 +432,9 @@ class number_seconds : public office_element_impl<number_seconds>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberSeconds;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -454,9 +451,9 @@ class number_am_pm : public office_element_impl<number_am_pm>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberAmPm;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -469,9 +466,9 @@ class number_fraction : public office_element_impl<number_fraction>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberFraction;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);

View File

@ -49,14 +49,200 @@ namespace odf_writer
{
namespace package
{
std::string GetUtf8StringFromUnicode_4bytes(const wchar_t* pUnicodes, size_t lCount)
{
std::string res;
res.resize(6 * lCount + 1);
BYTE* pData = (BYTE*)res.c_str();
BYTE* pCodesCur = pData;
const wchar_t* pEnd = pUnicodes + lCount;
const wchar_t* pCur = pUnicodes;
while (pCur < pEnd)
{
unsigned int code = (unsigned int)*pCur++;
if (code < 0x80)
{
*pCodesCur++ = (BYTE)code;
}
else if (code < 0x0800)
{
*pCodesCur++ = 0xC0 | (code >> 6);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x10000)
{
*pCodesCur++ = 0xE0 | (code >> 12);
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x1FFFFF)
{
*pCodesCur++ = 0xF0 | (code >> 18);
*pCodesCur++ = 0x80 | (code >> 12 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x3FFFFFF)
{
*pCodesCur++ = 0xF8 | (code >> 24);
*pCodesCur++ = 0x80 | (code >> 18 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 12 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x7FFFFFFF)
{
*pCodesCur++ = 0xFC | (code >> 30);
*pCodesCur++ = 0x80 | (code >> 24 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 18 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 12 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
}
*pCodesCur++ = 0;
res.resize(pCodesCur - pData);
return res;
}
std::string GetUtf8StringFromUnicode_2bytes(const wchar_t* pUnicodes, size_t lCount)
{
std::string res;
res.resize(6 * lCount + 1);
BYTE* pData = (BYTE*)res.c_str();
BYTE* pCodesCur = pData;
const wchar_t* pEnd = pUnicodes + lCount;
const wchar_t* pCur = pUnicodes;
while (pCur < pEnd)
{
unsigned int code = (unsigned int)*pCur++;
if (code >= 0xD800 && code <= 0xDFFF && pCur < pEnd)
{
code = 0x10000 + (((code & 0x3FF) << 10) | (0x03FF & *pCur++));
}
if (code < 0x80)
{
*pCodesCur++ = (BYTE)code;
}
else if (code < 0x0800)
{
*pCodesCur++ = 0xC0 | (code >> 6);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x10000)
{
*pCodesCur++ = 0xE0 | (code >> 12);
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x1FFFFF)
{
*pCodesCur++ = 0xF0 | (code >> 18);
*pCodesCur++ = 0x80 | ((code >> 12) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x3FFFFFF)
{
*pCodesCur++ = 0xF8 | (code >> 24);
*pCodesCur++ = 0x80 | ((code >> 18) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 12) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x7FFFFFFF)
{
*pCodesCur++ = 0xFC | (code >> 30);
*pCodesCur++ = 0x80 | ((code >> 24) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 18) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 12) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
}
*pCodesCur = 0;
res.resize(pCodesCur - pData);
return res;
}
std::string GetUtf8StringFromUnicode(const wchar_t* pUnicodes, size_t lCount)
{
if (sizeof(WCHAR) == 2)
{
return GetUtf8StringFromUnicode_2bytes(pUnicodes, lCount);
}
else
{
return GetUtf8StringFromUnicode_4bytes(pUnicodes, lCount);
}
}
simple_element::simple_element(const std::wstring & FileName, const std::wstring & Content, bool utf8) : file_name_(FileName), utf8_(utf8)
{
if (utf8_)
{
content_utf8_ = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(Content);
if (Content.length() > 10 * 1024 * 1024)
{
size_t pos = 0;
while (pos < Content.length())
{
size_t sz = 2 * 1024 * 1024;
if (sz + pos > Content.length())
sz = Content.length() - pos;
if (sz < 1)
break;
content_utf8_ += GetUtf8StringFromUnicode(Content.c_str() + pos, sz);
pos += sz;
}
}
else
content_utf8_ = GetUtf8StringFromUnicode(Content.c_str(), Content.length());
}else
content_utf8_ = std::string( Content.begin(), Content.end());
}
simple_element::simple_element(const std::wstring & FileName, wchar_t* Content, size_t Size, bool utf8)
{
if (utf8_)
{
if (Size > 10 * 1024 * 1024)
{
size_t pos = 0;
while (pos < Size)
{
size_t sz = 2 * 1024 * 1024;
if (sz + pos > Size)
sz = Size - pos;
if (sz < 1)
break;
content_utf8_ += GetUtf8StringFromUnicode(Content + pos, sz);
pos += sz;
}
}
else
content_utf8_ = GetUtf8StringFromUnicode(Content, Size);
}
else
{
std::wstring str(Content, Size);
content_utf8_ = std::string(str.begin(), str.end());
}
}
simple_element::simple_element(const std::wstring & FileName, std::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>> & streambuf, size_t Size, bool utf8)
{
}
simple_element::simple_element(const std::wstring & FileName, const std::string & Content) : file_name_(FileName), utf8_(false), content_utf8_(Content)
{
}
@ -361,9 +547,11 @@ namespace odf_writer
{
if (false == bXmlRootNodeWrite)
{
if (content)
if (content_)
{
simple_element elm(L"content.xml", content->content_str());
simple_element elm(L"content.xml", content_->content_str());
content_.reset();
elm.write(RootPath, add_padding);
}
}
@ -375,46 +563,6 @@ namespace odf_writer
{
CP_XML_NODE(L"office:document-content")
{
//CP_XML_ATTR(L"xmlns:office", L"urn:oasis:names:tc:opendocument:xmlns:office:1.0" );
//CP_XML_ATTR(L"xmlns:style", L"urn:oasis:names:tc:opendocument:xmlns:style:1.0" );
//CP_XML_ATTR(L"xmlns:text", L"urn:oasis:names:tc:opendocument:xmlns:text:1.0" );
//CP_XML_ATTR(L"xmlns:table", L"urn:oasis:names:tc:opendocument:xmlns:table:1.0" );
//CP_XML_ATTR(L"xmlns:draw", L"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" );
//CP_XML_ATTR(L"xmlns:fo", L"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" );
//CP_XML_ATTR(L"xmlns:xlink", L"http://www.w3.org/1999/xlink" );
//CP_XML_ATTR(L"xmlns:dc", L"http://purl.org/dc/elements/1.1/" );
//CP_XML_ATTR(L"xmlns:meta", L"urn:oasis:names:tc:opendocument:xmlns:meta:1.0" );
//CP_XML_ATTR(L"xmlns:number", L"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" );
//CP_XML_ATTR(L"xmlns:presentation", L"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" );
//CP_XML_ATTR(L"xmlns:svg", L"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
//CP_XML_ATTR(L"xmlns:chart", L"urn:oasis:names:tc:opendocument:xmlns:chart:1.0" );
//CP_XML_ATTR(L"xmlns:dr3d", L"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" );
//CP_XML_ATTR(L"xmlns:math", L"http://www.w3.org/1998/Math/MathML" );
//CP_XML_ATTR(L"xmlns:form", L"urn:oasis:names:tc:opendocument:xmlns:form:1.0" );
//CP_XML_ATTR(L"xmlns:script", L"urn:oasis:names:tc:opendocument:xmlns:script:1.0" );
//CP_XML_ATTR(L"xmlns:ooo", L"http://openoffice.org/2004/office" );
//CP_XML_ATTR(L"xmlns:ooow", L"http://openoffice.org/2004/writer" );
//CP_XML_ATTR(L"xmlns:oooc", L"http://openoffice.org/2004/calc" );
//CP_XML_ATTR(L"xmlns:dom", L"http://www.w3.org/2001/xml-events" );
//CP_XML_ATTR(L"xmlns:xforms", L"http://www.w3.org/2002/xforms");
//CP_XML_ATTR(L"xmlns:xsd", L"http://www.w3.org/2001/XMLSchema" );
//CP_XML_ATTR(L"xmlns:xsi", L"http://www.w3.org/2001/XMLSchema-instance" );
//CP_XML_ATTR(L"xmlns:rpt", L"http://openoffice.org/2005/report" );
//CP_XML_ATTR(L"xmlns:of", L"urn:oasis:names:tc:opendocument:xmlns:of:1.2" );
//CP_XML_ATTR(L"xmlns:xhtml", L"http://www.w3.org/1999/xhtml" );
//CP_XML_ATTR(L"xmlns:grddl", L"http://www.w3.org/2003/g/data-view#" );
//CP_XML_ATTR(L"xmlns:officeooo", L"http://openoffice.org/2009/office" );
//CP_XML_ATTR(L"xmlns:textooo", L"http://openoffice.org/2013/office" );
//CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
//CP_XML_ATTR(L"xmlns:drawooo", L"http://openoffice.org/2010/draw" );
//CP_XML_ATTR(L"xmlns:chartooo", L"http://openoffice.org/2010/chart" );
//CP_XML_ATTR(L"xmlns:smil", L"urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0");
//CP_XML_ATTR(L"xmlns:anim", L"urn:oasis:names:tc:opendocument:xmlns:animation:1.0" );
//CP_XML_ATTR(L"xmlns:calcext", L"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" );
//CP_XML_ATTR(L"xmlns:field", L"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" );
//CP_XML_ATTR(L"xmlns:formx", L"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" );
//CP_XML_ATTR(L"xmlns:loext", L"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" );
//CP_XML_ATTR(L"xmlns:css3t", L"http://www.w3.org/TR/css3-text/" );
CP_XML_ATTR(L"xmlns:meta", L"urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
CP_XML_ATTR(L"xmlns:office", L"urn:oasis:names:tc:opendocument:xmlns:office:1.0");
CP_XML_ATTR(L"xmlns:draw", L"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
@ -457,19 +605,25 @@ namespace odf_writer
CP_XML_ATTR(L"office:version", L"1.2");
if (content)
if (content_)
{
CP_XML_STREAM() << content->styles_str();
content_->styles_.flush();
CP_XML_STREAM() << content_->styles_.rdbuf();
content_->styles_.clear();
}
CP_XML_NODE(L"office:body")
{
if (content)
if (content_)
{
CP_XML_STREAM() << content->content_str();
content_->content_.flush();
CP_XML_STREAM() << content_->content_.rdbuf();
content_->content_.clear();
}
}
}
}
resStream.flush();
simple_element elm(L"content.xml", resStream.str());
elm.write(RootPath, add_padding);
}
@ -525,12 +679,13 @@ namespace odf_writer
if (content_)
{
CP_XML_STREAM() << content_->str();
CP_XML_STREAM() << content_->content().rdbuf();
}
}
}
content_.reset();
simple_element elm(L"styles.xml", resStream.str());
elm.write(RootPath, add_padding);
}
@ -549,12 +704,13 @@ namespace odf_writer
if (content_)
{
CP_XML_STREAM() << content_->str();
CP_XML_STREAM() << content_->content().rdbuf();
}
}
}
content_.reset();
simple_element elm(L"settings.xml", resStream.str());
elm.write(RootPath, add_padding);
}

View File

@ -58,10 +58,8 @@ namespace odf_writer
{
public:
content_simple(){}
std::wostream & content() { return content_; }
std::wstring str() { return content_.str(); }
static _CP_PTR(content_simple) create();
std::wstringstream & content() { return content_;}
private:
std::wstringstream content_;
};
@ -72,6 +70,8 @@ namespace odf_writer
class content_content : noncopyable
{
public:
friend class content_file;
content_content(){}
std::wostream & content() { return content_; }
std::wostream & styles() { return styles_; }
@ -103,6 +103,10 @@ namespace odf_writer
simple_element(const std::wstring & FileName, const std::string & Content);
simple_element(const std::wstring & FileName, const std::wstring & Content, bool utf8 = true);
simple_element(const std::wstring & FileName, wchar_t* Content, size_t Size, bool utf8 = true);
simple_element(const std::wstring & FileName, std::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>> & streambuf, size_t Size, bool utf8 = true);
static element_ptr create(const std::wstring & FileName, const std::wstring & Content, bool utf8 = true);
static element_ptr create(const std::wstring & FileName, const std::string & Content);
@ -126,10 +130,10 @@ namespace odf_writer
private:
bool bXmlRootNodeWrite = true;
public:
void set_content(content_content_ptr & c, bool bRootNode = true) { content = c; bXmlRootNodeWrite = bRootNode; }
void set_content(content_content_ptr & c, bool bRootNode = true) { content_ = c; bXmlRootNodeWrite = bRootNode; }
virtual void write(const std::wstring & RootPath, bool add_padding = false);
content_content_ptr content;
content_content_ptr content_;
};
class styles_file : public element

View File

@ -89,10 +89,18 @@ odf_conversion_context::odf_conversion_context(_office_type_document type_, pack
}
odf_conversion_context::~odf_conversion_context()
{
output_document_ = NULL;
if (applicationFonts_)
delete applicationFonts_;
for (size_t i = 0; i < objects_.size(); ++i)
{
if (objects_[i]) delete objects_[i];
objects_[i] = NULL;
}
objects_.clear();
}
void odf_conversion_context::set_fonts_directory(std::wstring pathFonts)
{
if (applicationFonts_)
@ -130,14 +138,14 @@ double odf_conversion_context::convert_symbol_width(double val)
odf_style_context* odf_conversion_context::styles_context()
{
if (!objects_.empty())
return objects_[current_object_].style_context.get();
return objects_[current_object_]->style_context.get();
else
return NULL;
}
odf_settings_context* odf_conversion_context::settings_context()
{
if (!objects_.empty())
return objects_[current_object_].settings_context.get();
return objects_[current_object_]->settings_context.get();
else
return NULL;
}
@ -159,22 +167,22 @@ odf_math_context* odf_conversion_context::math_context()
odf_number_styles_context* odf_conversion_context::numbers_styles_context()
{
if (objects_.size() > 0 && objects_[current_object_].style_context)
return &(objects_[current_object_].style_context->numbers_styles());
if (objects_.size() > 0 && objects_[current_object_]->style_context)
return &(objects_[current_object_]->style_context->numbers_styles());
else return NULL;
}
_mediaitems* odf_conversion_context::mediaitems()
{
return &objects_[current_object_].mediaitems;
return &objects_[current_object_]->mediaitems;
}
void odf_conversion_context::end_document()
{
rels rels_;
rels rels_;
for (size_t i = 0; i < objects_.size(); i++)
{
_object & object = objects_[i];
_object & object = *objects_[i];
bool isRoot = (i == 0 ? true : false);
if (object.content == NULL)continue;
@ -184,8 +192,8 @@ void odf_conversion_context::end_document()
package::content_content_ptr content_root_ = package::content_content::create();
if (objects_.back().scripts)
objects_.back().scripts->serialize(content_root_->styles());
if (objects_.back()->scripts)
objects_.back()->scripts->serialize(content_root_->styles());
object.content->serialize(content_root_->content());
@ -245,15 +253,13 @@ void odf_conversion_context::end_document()
output_document_->add_object(package::element_ptr(object_files), isRoot);
}
}
output_document_->set_rels(rels_);
}
void odf_conversion_context::start_chart()
{
create_object();
create_element(L"office", L"chart", objects_.back().content, this, true);
create_element(L"office", L"chart", objects_.back()->content, this, true);
chart_context_.set_styles_context(odf_conversion_context::styles_context());
chart_context_.start_chart(get_current_object_element());
@ -261,36 +267,39 @@ void odf_conversion_context::start_chart()
void odf_conversion_context::start_spreadsheet()
{
create_object();
create_element(L"office", L"spreadsheet", objects_.back().content, this, true);
create_element(L"office", L"spreadsheet", objects_.back()->content, this, true);
}
void odf_conversion_context::start_text()
{
create_object();
create_element(L"office", L"text", objects_.back().content, this, true);
create_element(L"office", L"text", objects_.back()->content, this, true);
}
void odf_conversion_context::start_presentation()
{
create_object();
create_element(L"office", L"presentation", objects_.back().content, this, true);
create_element(L"office", L"presentation", objects_.back()->content, this, true);
create_element(L"office", L"scripts", objects_.back().scripts, this);
create_element(L"office", L"scripts", objects_.back()->scripts, this);
}
void odf_conversion_context::create_object(bool bAddContentExt)
{
_object obj;
obj.content_ext = bAddContentExt;
obj.style_context = boost::make_shared<odf_style_context>();
obj.settings_context = boost::make_shared<odf_settings_context>();
obj.name = get_next_name_object();
obj.style_context->set_odf_context(this);
obj.settings_context->set_odf_context(this);
objects_.push_back(obj);
_object *obj = new _object();
current_object_ = objects_.size() - 1;
if (obj)
{
obj->content_ext = bAddContentExt;
obj->style_context = boost::make_shared<odf_style_context>();
obj->settings_context = boost::make_shared<odf_settings_context>();
obj->name = get_next_name_object();
obj->style_context->set_odf_context(this);
obj->settings_context->set_odf_context(this);
objects_.push_back(obj);
current_object_ = objects_.size() - 1;
}
}
void odf_conversion_context::end_chart()
{
@ -312,7 +321,7 @@ bool odf_conversion_context::start_math()
//имитация рисованного объекта - высота-ширина ????
create_object(false);
create_element(L"math", L"math", objects_.back().content, this, true);
create_element(L"math", L"math", objects_.back()->content, this, true);
math_context_.set_styles_context(odf_conversion_context::styles_context());
math_context_.start_math(get_current_object_element());
@ -368,7 +377,7 @@ office_element_ptr & odf_conversion_context::get_current_object_element()
create_object();
}
return objects_[current_object_].content;
return objects_[current_object_]->content;
}
std::wstring odf_conversion_context::get_next_name_object()
@ -535,13 +544,13 @@ void odf_conversion_context::add_font(const std::wstring& font_name)
{
if (objects_.empty())return;
if (objects_[current_object_].mapFonts.find(font_name) == objects_[current_object_].mapFonts.end())
if (objects_[current_object_]->mapFonts.find(font_name) == objects_[current_object_]->mapFonts.end())
{
objects_[current_object_].mapFonts.insert(std::make_pair(font_name, 1));
objects_[current_object_]->mapFonts.insert(std::make_pair(font_name, 1));
}
else
{
objects_[current_object_].mapFonts[font_name]++;
objects_[current_object_]->mapFonts[font_name]++;
}
}
}

View File

@ -165,7 +165,7 @@ private:
odf_element_state temporary_;
std::vector<_object> objects_;//"0" = root
std::vector<_object*> objects_;//"0" = root
odf_chart_context chart_context_;
odf_page_layout_context page_layout_context_;

View File

@ -425,7 +425,7 @@ office_element_ptr & odf_style_context::add_or_find(std::wstring name, style_fam
if (oox_id >= 0 && style_state_list_[i]->style_oox_id_ == oox_id)
return style_state_list_[i]->get_office_element();
if ((name.length() >=0 && style_state_list_[i]->odf_style_->get_name() == name)
if ((name.length() >= 0 && style_state_list_[i]->odf_style_->get_name() == name)
&& style_state_list_[i]->root_ == root) return style_state_list_[i]->get_office_element();
//во избежания имена генерим уникальные (в принципе для root и остальных - можно одинаковые)
}

View File

@ -160,14 +160,11 @@ ods_table_state::ods_table_state(odf_conversion_context * Context, office_elemen
defaut_row_height_ = 9;
defaut_column_width_ = 28.34467120181406 * 1.674;//
cells_size_ = 0;
}
void ods_table_state::set_table_name(std::wstring name)
{
office_table_name_ = XmlUtils::EncodeXmlString(name);
office_table_name_ = name;
table_table* table = dynamic_cast<table_table*>(office_table_.get());
if (table == NULL)return;
@ -498,17 +495,17 @@ void ods_table_state::set_row_height(double height)
bool ods_table_state::is_cell_hyperlink()
{
if ( cells_size_ < 1 )return false;
if (cells_.empty())return false;
return cells_.back().hyperlink_idx >= 0 ? true : false;
}
bool ods_table_state::is_cell_comment()
{
if ( cells_size_ < 1 )return false;
if (cells_.empty())return false;
return cells_.back().comment_idx >= 0 ? true : false;
}
bool ods_table_state::is_cell_data_validation()
{
if ( cells_size_ < 1 ) return false;
if (cells_.empty()) return false;
return cells_.back().data_validation_name.empty() ? true : false;
}
int ods_table_state::is_cell_hyperlink(int col, int row)
@ -607,14 +604,14 @@ office_element_ptr & ods_table_state::current_row_element()
}
office_element_ptr & ods_table_state::current_cell_element()
{
if (cells_size_ > 0)
if (false == cells_.empty())
return cells_.back().elm;
else
throw;
}
ods_hyperlink_state & ods_table_state::current_hyperlink()
{
if ((cells_size_ > 0 && !hyperlinks_.empty()) && (cells_.back().hyperlink_idx >= 0) )
if ((false == cells_.empty() && !hyperlinks_.empty()) && (cells_.back().hyperlink_idx >= 0) )
{
return hyperlinks_[cells_.back().hyperlink_idx];
}
@ -657,7 +654,6 @@ void ods_table_state::start_cell(office_element_ptr & elm, office_element_ptr &
current_table_column_ += state.repeated;
cells_.push_back(state);
cells_size_++;
if (current_covered_cols_ > 0 && covered_cell)
current_covered_cols_--;
@ -665,7 +661,7 @@ void ods_table_state::start_cell(office_element_ptr & elm, office_element_ptr &
void ods_table_state::set_cell_format_value(office_value_type::type value_type)
{
if (cells_size_ < 1)return;
if (cells_.empty())return;
if (value_type == office_value_type::Custom)return; //general .. need detect
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
@ -679,7 +675,7 @@ void ods_table_state::set_cell_format_value(office_value_type::type value_type)
}
void ods_table_state::set_cell_type(int type)
{
if (cells_size_ < 1)return;
if (cells_.empty())return;
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
if (cell == NULL)return;
@ -1270,7 +1266,7 @@ void ods_table_state::set_cell_text(odf_text_context* text_context, bool cash_va
}
void ods_table_state::set_cell_value(const std::wstring & value, bool need_cash)
{
if (cells_size_ < 1)return;
if (cells_.empty())return;
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
if (cell == NULL)return;
@ -1416,7 +1412,7 @@ void ods_table_state::end_cell_text()
}
void ods_table_state::end_cell()
{
if ( cells_size_ < 1)return;
if (cells_.empty())return;
if (cells_.back().comment_idx >= 0)
{
@ -1434,6 +1430,10 @@ void ods_table_state::end_cell()
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
if (cell)cell->attlist_.common_value_and_type_attlist_ = boost::none;
}
if (map_merged_cells.empty())
{
cells_.pop_back();
}
}
void ods_table_state::add_default_cell( int repeated)
@ -1565,7 +1565,6 @@ void ods_table_state::add_default_cell( int repeated)
state.comment_idx = comment_idx;
cells_.push_back(state);
cells_size_++;
current_table_column_ += state.repeated;

View File

@ -495,7 +495,6 @@ private:
std::vector<office_element_ptr> current_level_;//постоянно меняющийся список уровней ("0-й элемент - сама таблица)
std::vector<ods_cell_state> cells_;
long cells_size_;
std::vector<ods_hyperlink_state> hyperlinks_;
std::map<unsigned int, ods_shared_formula_state> shared_formulas_;

View File

@ -71,9 +71,9 @@ class dc_date : public office_element_impl<dc_date>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDcDate;
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){}
@ -92,9 +92,9 @@ class dc_creator : public office_element_impl<dc_creator>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDcCreator;
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){}
@ -113,9 +113,9 @@ class office_annotation : public office_element_impl<office_annotation>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeAnnotation;
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);
@ -139,9 +139,9 @@ class office_annotation_end : public office_element_impl<office_annotation_end>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeAnnotationEnd;
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){}
@ -166,9 +166,9 @@ class officeooo_annotation : public office_element_impl<officeooo_annotation>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeAnnotation;
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);

View File

@ -49,10 +49,10 @@ class office_body : public office_element_impl<office_body>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeBody;
CPDOCCORE_DEFINE_VISITABLE()
office_element * content() { return content_.get(); }

View File

@ -51,9 +51,9 @@ class office_chart : public office_element_impl<office_chart>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeChart;
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);
@ -93,9 +93,9 @@ class chart_chart : public office_element_impl<chart_chart>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartChart;
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);
@ -124,9 +124,9 @@ class chart_title : public office_element_impl<chart_title>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartTitle;
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);
@ -144,9 +144,9 @@ class chart_subtitle : public office_element_impl<chart_subtitle>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartSubtitle;
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);
@ -165,9 +165,9 @@ class chart_footer : public office_element_impl<chart_footer>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartFooter;
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);
@ -203,9 +203,9 @@ class chart_legend : public office_element_impl<chart_legend>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartLegend;
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){}
@ -239,9 +239,9 @@ class chart_plot_area : public office_element_impl<chart_plot_area>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartPlotArea;
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);
@ -269,9 +269,9 @@ class chart_wall : public office_element_impl<chart_wall>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartWall;
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){}
@ -290,9 +290,9 @@ class chart_floor : public office_element_impl<chart_floor>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartFloor;
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){}
@ -321,9 +321,9 @@ class chart_axis : public office_element_impl<chart_axis>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartAxis;
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);
@ -352,9 +352,9 @@ class chart_grid : public office_element_impl<chart_grid>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartGrid;
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){}
@ -372,9 +372,9 @@ class chart_categories : public office_element_impl<chart_categories>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartCategories;
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){}
@ -405,9 +405,9 @@ class chart_series : public office_element_impl<chart_series>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartSeries;
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);
@ -425,9 +425,9 @@ class chart_domain : public office_element_impl<chart_domain>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartDomain;
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){}
@ -454,9 +454,9 @@ class chart_data_point : public office_element_impl<chart_data_point>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartDataPoint;
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){}
@ -474,9 +474,9 @@ class chart_mean_value : public office_element_impl<chart_mean_value>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartMeanValue;
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){}
@ -493,9 +493,9 @@ class chart_error_indicator : public office_element_impl<chart_error_indicator>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartErrorIndicator;
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){}
@ -511,9 +511,9 @@ class chart_equation : public office_element_impl<chart_equation>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartEquation;
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){}//???
@ -531,9 +531,9 @@ class chart_regression_curve : public office_element_impl<chart_regression_curve
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartRegressionCurve;
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);
@ -552,9 +552,9 @@ class chart_stock_gain_marker : public office_element_impl<chart_stock_gain_mark
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartStockGainMarker;
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){}
@ -573,9 +573,9 @@ class chart_stock_loss_marker : public office_element_impl<chart_stock_loss_mark
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartStockLossMarker;
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){}
@ -594,9 +594,9 @@ class chart_stock_range_line : public office_element_impl<chart_stock_range_line
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartStockRangeLine;
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){}
@ -615,9 +615,9 @@ class chart_date_scale : public office_element_impl<chart_date_scale>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartDateScale;
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){}

View File

@ -51,9 +51,9 @@ class manifest_encryption_data : public office_element_impl<manifest_encryption_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeManifestEncryptionData;
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);
@ -76,9 +76,9 @@ class manifest_algorithm : public office_element_impl<manifest_algorithm>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeManifestAlgorithm;
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){}
@ -96,9 +96,9 @@ class manifest_key_derivation : public office_element_impl<manifest_key_derivati
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeManifestKeyDerivation;
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){}
@ -118,9 +118,9 @@ class manifest_start_key_generation : public office_element_impl<manifest_start_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeManifestStartKeyGeneration;
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){}

View File

@ -32,17 +32,12 @@
#pragma once
#include <vector>
#include <boost/algorithm/string/replace.hpp>
#include <CPOptional.h>
#include <CPSharedPtr.h>
#include <CPWeakPtr.h>
#include <xml/xmlelement.h>
#include <xml/attributes.h>
#include <logging.h>
#include <boost/noncopyable.hpp>
#include <odf/odf_elements_type.h>
#include "visitor.h"
namespace cpdoccore {
namespace odf_writer {
@ -51,17 +46,18 @@ class odf_conversion_context;
class office_element;
typedef shared_ptr<office_element>::Type office_element_ptr;
typedef weak_ptr<office_element>::Type office_element_weak_ptr;
typedef std::vector<office_element_ptr> office_element_ptr_array;
class office_element : public xml::element<wchar_t>, public base_visitable, boost::noncopyable
class office_element : boost::noncopyable
{
public:
office_element() : context_(NULL) {}
virtual ElementType get_type() const = 0;
virtual ~office_element() = 0;
virtual const wchar_t * get_ns() const = 0;
virtual const wchar_t * get_name() const = 0;
virtual ElementType get_type() const = 0;
virtual void serialize(std::wostream & _Wostream) = 0 ;
void setContext(odf_conversion_context * Context) { context_ = Context; }
@ -77,62 +73,39 @@ public:
////////////////////////
virtual std::wostream & serialize(std::wostream & _Wostream) const
{
_CP_LOG << L"[warning] use base text_to_stream\n";
return _Wostream;
}
virtual std::wostream & xml_to_stream(std::wostream & _Wostream) const
{
_CP_LOG << L"[warning] use base xml_to_stream\n";
_CP_LOG << L"[warning] use base serialize\n";
return _Wostream;
}
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const
{
_CP_LOG << L"[warning] use base text_to_stream\n";
return _Wostream;
}
private:
bool is_root_;
odf_conversion_context * context_;
};
#define CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_ public:\
virtual const wchar_t * get_ns() const { return ns; }\
virtual const wchar_t * get_name() const { return name; }\
virtual xml::NodeType get_xml_type() const { return xml_type; }\
virtual ElementType get_type() const { return type; }
inline office_element::~office_element()
{
}
/// \class office_element_impl
template <class Element>
class office_element_impl : public virtual office_element
{
// xml::element impl
public:
virtual const wchar_t * get_ns() const
{
return Element::ns;
}
}
virtual const wchar_t * get_name() const
{
return Element::name;
}
virtual xml::NodeType get_xml_type() const
{
return Element::xml_type;
}
virtual void add_child_element( const office_element_ptr & child)
{
_CP_LOG << L"Non add child in " << Element::ns << L":" << Element::name << std::endl;
}
private:
// office_element impl
public:
virtual ElementType get_type() const
{
return Element::type;

View File

@ -32,7 +32,7 @@
#include "office_elements_create.h"
#include <iostream>
#include <sstream>
#include "logging.h"
namespace cpdoccore {
@ -111,13 +111,12 @@ void not_applicable_element(const std::wstring & Current,const std::wstring & Ns
#endif
}
void not_applicable_element(const office_element * CurrentElm, const std::wstring & Ns, const std::wstring & Name)
{
std::wstringstream ss;
if (CurrentElm)
ss << CurrentElm->get_ns() << L":" << CurrentElm->get_name();
not_applicable_element(ss.str(), Ns, Name);
std::wstringstream ss;
if (CurrentElm)
ss << CurrentElm->get_ns() << L":" << CurrentElm->get_name();
not_applicable_element(ss.str(), Ns, Name);
}
bool create_element(const std::wstring & Ns,

View File

@ -48,9 +48,9 @@ class office_event_listeners : public office_element_impl<office_event_listeners
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeEventListeners;
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);
@ -84,9 +84,9 @@ class presentation_event_listener : public office_element_impl<presentation_even
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationEventListener;
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);
@ -107,9 +107,9 @@ class script_event_listener : public office_element_impl<presentation_event_list
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeScriptEventListener;
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);

View File

@ -54,9 +54,9 @@ class office_forms : public office_element_impl<office_forms>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeForms;
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);
@ -76,9 +76,9 @@ class form_form : public office_element_impl<form_form>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormForm;
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);
@ -124,9 +124,9 @@ class form_properties : public office_element_impl<form_properties>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormProperties;
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);
@ -143,9 +143,9 @@ class form_property : public office_element_impl<form_property>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormProperty;
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){}
@ -163,9 +163,9 @@ class form_list_property : public office_element_impl<form_list_property>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormListProperty;
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);
@ -185,9 +185,9 @@ class form_list_value : public office_element_impl<form_list_value>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormListValue;
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){}
@ -205,7 +205,7 @@ public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormElement;
form_element() {}
@ -245,9 +245,9 @@ class form_button : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormButton;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
@ -272,9 +272,9 @@ class form_image_frame : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormImageFrame;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
@ -288,9 +288,9 @@ class form_text : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormText;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
@ -308,9 +308,9 @@ class form_textarea : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormTextarea;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
@ -327,9 +327,9 @@ class form_fixed_text : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormFixedText;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
};
@ -341,9 +341,9 @@ class form_checkbox : public form_text
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormCheckbox;
CPDOCCORE_DEFINE_VISITABLE();
form_checkbox() : current_state_(false), image_position_(L"center") {}
virtual void serialize(std::wostream & _Wostream);
@ -362,9 +362,9 @@ class form_radio : public form_checkbox
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormRadio;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
};
@ -376,9 +376,9 @@ class form_combobox : public form_text
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormCombobox;
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);
@ -402,9 +402,9 @@ class form_listbox : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormListbox;
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);
@ -434,9 +434,9 @@ class form_date : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormDate;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
};
@ -450,9 +450,9 @@ public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormValueRange;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
@ -471,9 +471,9 @@ class form_frame : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormFrame;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
};
@ -485,9 +485,9 @@ class form_item : public office_element_impl<form_item>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormItem;
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){}

View File

@ -46,9 +46,9 @@ class office_presentation : public office_element_impl<office_presentation>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficePresentation;
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);

View File

@ -46,9 +46,9 @@ class office_scripts : public office_element_impl<office_scripts>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeScripts;
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);
@ -68,9 +68,9 @@ class office_script : public office_element_impl<office_script>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeScript;
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);

View File

@ -84,7 +84,7 @@ void settings_config_item_set::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR( L"config:name", config_name_);
CP_XML_ATTR( L"config:name", XmlUtils::EncodeXmlString(config_name_));
for (size_t i = 0; i < content_.size(); i++)
{
@ -114,10 +114,10 @@ void settings_config_item::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR( L"config:name", config_name_);
CP_XML_ATTR( L"config:name", XmlUtils::EncodeXmlString(config_name_));
CP_XML_ATTR( L"config:type", config_type_);
CP_XML_STREAM() << content_;
CP_XML_STREAM() << XmlUtils::EncodeXmlString(content_);
}
}
}
@ -141,7 +141,7 @@ void settings_config_item_map_indexed::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT( L"config:name", config_name_);
CP_XML_ATTR_OPT_ENCODE_STRING( L"config:name", config_name_);
for (size_t i = 0; i < content_.size(); i++)
{
@ -170,7 +170,7 @@ void settings_config_item_map_named::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT( L"config:name", config_name_);
CP_XML_ATTR_OPT_ENCODE_STRING( L"config:name", config_name_);
for (size_t i = 0; i < content_.size(); i++)
{
@ -199,7 +199,7 @@ void settings_config_item_map_entry::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT( L"config:name", config_name_);
CP_XML_ATTR_OPT_ENCODE_STRING( L"config:name", config_name_);
for (size_t i = 0; i < content_.size(); i++)
{

View File

@ -49,9 +49,9 @@ class office_settings : public office_element_impl<office_settings>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettings;
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);
@ -69,9 +69,9 @@ class settings_config_item_set : public office_element_impl<settings_config_item
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettingsConfigItemSet;
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);
@ -89,9 +89,9 @@ class settings_config_item : public office_element_impl<settings_config_item>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettingsConfigItem;
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);
@ -110,9 +110,9 @@ class settings_config_item_map_indexed : public office_element_impl<settings_con
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettingsConfigItemMapIndexed;
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);
@ -130,9 +130,9 @@ class settings_config_item_map_named : public office_element_impl<settings_confi
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettingsConfigItemMapNamed;
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);
@ -150,9 +150,9 @@ class settings_config_item_map_entry : public office_element_impl<settings_confi
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettingsConfigItemMapEntry;
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);

View File

@ -46,6 +46,16 @@ namespace odf_writer {
const wchar_t * office_spreadsheet::ns = L"office";
const wchar_t * office_spreadsheet::name = L"spreadsheet";
office_spreadsheet::~office_spreadsheet()
{
named_expressions_.reset();
database_ranges_.reset();
data_pilot_tables_.reset();
content_validations_.reset();
forms_.reset();
content_.clear();
}
void office_spreadsheet::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"office", L"forms")

View File

@ -46,11 +46,13 @@ namespace odf_writer {
class office_spreadsheet : public office_element_impl<office_spreadsheet>
{
public:
office_spreadsheet() {}
virtual ~office_spreadsheet();
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSpreadsheet;
CPDOCCORE_DEFINE_VISITABLE()
static const ElementType type = typeOfficeSpreadsheet;
office_element_ptr_array & getContent(){return content_;}

View File

@ -58,9 +58,9 @@ class office_text : public office_element_impl<office_text>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeText;
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);
@ -94,9 +94,9 @@ class office_change_info : public office_element_impl<office_change_info>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeChangeInfo;
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);

View File

@ -80,7 +80,7 @@ std::wostream & text_text::text_to_stream(std::wostream & _Wostream) const
void text_text::serialize(std::wostream & _Wostream)
{
_Wostream << xml::utils::replace_text_to_xml( text_ );
_Wostream << xml::utils::replace_text_to_xml( text_ , true);
}
void text_text::add_text(const std::wstring & Text)

View File

@ -58,9 +58,7 @@ public:
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeText;
static const ElementType type = typeTextText;
CPDOCCORE_DEFINE_VISITABLE();
static const ElementType type = typeTextText;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -86,9 +84,9 @@ class text_s : public office_element_impl<text_s>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextS;
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){}
@ -110,9 +108,9 @@ class text_tab : public office_element_impl<text_tab>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTab;
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){}
@ -136,9 +134,9 @@ class text_line_break : public office_element_impl<text_line_break>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextLineBreak;
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){}
@ -158,9 +156,9 @@ class text_bookmark : public office_element_impl<text_bookmark>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBookmark;
CPDOCCORE_DEFINE_VISITABLE();
public:
@ -184,9 +182,9 @@ class text_bookmark_start : public office_element_impl<text_bookmark_start>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBookmarkStart;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_bookmark_start() {}
@ -209,9 +207,9 @@ class text_bookmark_end : public office_element_impl<text_bookmark_end>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBookmarkEnd;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_bookmark_end() {} ;
@ -234,9 +232,9 @@ class text_reference_mark : public office_element_impl<text_reference_mark>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextReferenceMark;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_reference_mark() {};
@ -259,9 +257,9 @@ class text_reference_mark_start : public office_element_impl<text_reference_mark
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextReferenceMarkStart;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_reference_mark_start() {}
@ -284,9 +282,9 @@ class text_reference_mark_end : public office_element_impl<text_reference_mark_e
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextReferenceMarkEnd;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_reference_mark_end() {};
@ -309,9 +307,9 @@ class text_span : public office_element_impl<text_span>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSpan;
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);
@ -338,9 +336,9 @@ class text_a : public office_element_impl<text_a>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextA;
CPDOCCORE_DEFINE_VISITABLE();
public:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -372,9 +370,9 @@ class text_note_citation : public office_element_impl<text_note_citation>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNoteCitation;
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);
@ -398,9 +396,9 @@ class text_note_body : public office_element_impl<text_note_body>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNoteBody;
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);
@ -424,9 +422,9 @@ class text_note : public office_element_impl<text_note>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNote;
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);
@ -454,9 +452,9 @@ class text_ruby : public office_element_impl<text_ruby>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextRuby;
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);
@ -491,9 +489,9 @@ class text_title : public office_element_impl<text_title>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTitle;
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);
@ -516,9 +514,9 @@ class text_placeholder : public office_element_impl<text_placeholder>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextPlaceholder;
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);
@ -539,9 +537,9 @@ class text_page_number: public office_element_impl<text_page_number>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextPageNumber;
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);
@ -568,9 +566,9 @@ class text_page_count : public office_element_impl<text_page_count>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextPageCount;
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);
@ -592,9 +590,9 @@ class text_date : public office_element_impl<text_date>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextDate;
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);
@ -619,9 +617,9 @@ class text_time : public office_element_impl<text_time>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTime;
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);
@ -646,9 +644,9 @@ class text_file_name : public office_element_impl<text_file_name>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextFileName;
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);
@ -670,9 +668,9 @@ class text_sequence : public office_element_impl<text_sequence>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSequence;
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);
@ -698,9 +696,9 @@ class text_text_input : public office_element_impl<text_text_input>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTextInput;
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);
@ -720,9 +718,9 @@ class text_sheet_name : public office_element_impl<text_sheet_name>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSheetName;
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);
@ -742,9 +740,9 @@ class presentation_footer : public office_element_impl<presentation_footer>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationFooter;
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){}
@ -760,9 +758,9 @@ class presentation_date_time: public office_element_impl<presentation_date_time>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationDateTime;
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){}
@ -778,9 +776,9 @@ class text_toc_mark_start : public office_element_impl<text_toc_mark_start>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTocMarkStart;
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){}
@ -799,9 +797,9 @@ class text_toc_mark_end : public office_element_impl<text_toc_mark_end>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTocMarkEnd;
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){}
@ -819,9 +817,9 @@ class text_toc_mark : public office_element_impl<text_toc_mark>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTocMark;
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){}
@ -840,9 +838,9 @@ class text_alphabetical_index_mark_start : public office_element_impl<text_alpha
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextAlphabeticalIndexMarkStart;
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){}
@ -866,9 +864,9 @@ class text_alphabetical_index_mark_end : public office_element_impl<text_alphabe
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextAlphabeticalIndexMarkEnd;
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){}
@ -886,9 +884,9 @@ class text_alphabetical_index_mark : public office_element_impl<text_alphabetica
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextAlphabeticalIndexMark;
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){}
@ -912,10 +910,10 @@ class text_bibliography_mark : public office_element_impl<text_bibliography_mark
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBibliographyMark;
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){}
@ -962,9 +960,9 @@ class text_sequence_ref : public office_element_impl<text_sequence_ref>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSequenceRef;
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){}
@ -985,9 +983,9 @@ class text_drop_down : public office_element_impl<text_drop_down>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextDropDown;
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);
@ -1009,9 +1007,9 @@ class text_label : public office_element_impl<text_label>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextLabel;
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){}

View File

@ -129,10 +129,10 @@ class style_chart_properties : public office_element_impl<style_chart_properties
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleChartProperties;
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){}

View File

@ -148,10 +148,10 @@ class style_graphic_properties : public office_element_impl<style_graphic_proper
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleGraphicPropertis;
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){}
@ -169,10 +169,10 @@ class loext_graphic_properties : public office_element_impl<loext_graphic_proper
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleGraphicPropertis;
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){}

View File

@ -48,9 +48,9 @@ class style_map : public office_element_impl<style_map>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleMap;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm){}

View File

@ -122,9 +122,9 @@ class style_page_layout_properties : public office_element_impl<style_page_layou
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStylePageLayout;
CPDOCCORE_DEFINE_VISITABLE()
style_page_layout_properties() { }

View File

@ -80,10 +80,10 @@ class style_tab_stop : public office_element_impl<style_tab_stop>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTabStop;
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){}
@ -111,10 +111,10 @@ class style_tab_stops : public office_element_impl<style_tab_stops>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTabStops;
CPDOCCORE_DEFINE_VISITABLE()
size_t size() const { return style_tab_stops_.size(); }
@ -134,10 +134,10 @@ class style_drop_cap : public office_element_impl<style_drop_cap>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDropCap;
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){}
@ -159,10 +159,10 @@ class style_background_image : public office_element_impl<style_background_image
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleBackgroundImage;
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){}
@ -264,10 +264,10 @@ class style_paragraph_properties : public office_element_impl<style_paragraph_pr
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleParagraphProperties;
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);

View File

@ -53,10 +53,10 @@ class presentation_placeholder : public office_element_impl<presentation_placeho
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStylePresentationPlaceholder;
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){}
@ -80,10 +80,10 @@ class presentation_sound : public office_element_impl<presentation_sound>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStylePresentationSound;
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){}
@ -135,10 +135,10 @@ class style_drawing_page_properties : public office_element_impl<style_drawing_p
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawingPageProperties;
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){}

View File

@ -51,9 +51,9 @@ class style_columns : public office_element_impl<style_columns>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleColumns;
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);
@ -76,9 +76,9 @@ class style_column : public office_element_impl<style_column>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleColumn;
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){}
@ -100,9 +100,9 @@ class style_column_sep : public office_element_impl<style_column_sep>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleColumnSep;
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){}
@ -124,9 +124,9 @@ class style_section_properties : public office_element_impl<style_section_proper
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleSectionProperties;
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);

View File

@ -97,10 +97,10 @@ class style_table_properties : public office_element_impl<style_table_properties
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTableProperties;
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){}
@ -134,10 +134,10 @@ class style_table_column_properties : public office_element_impl<style_table_col
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTableColumnProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
@ -168,10 +168,10 @@ class style_table_row_properties : public office_element_impl<style_table_row_pr
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTableRowProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
@ -236,10 +236,10 @@ class style_table_cell_properties : public office_element_impl<style_table_cell_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTableCellProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);

View File

@ -202,10 +202,10 @@ class style_text_properties : public office_element_impl<style_text_properties>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTextProperties;
CPDOCCORE_DEFINE_VISITABLE()
void apply_from(const style_text_properties * Other);

View File

@ -135,9 +135,9 @@ class default_style : public office_element_impl<default_style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDefaultStyle;
CPDOCCORE_DEFINE_VISITABLE()
default_style() : content_(getContext()) {}
@ -160,10 +160,10 @@ class draw_gradient : public office_element_impl<draw_gradient>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawGradient;
CPDOCCORE_DEFINE_VISITABLE()
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
@ -195,10 +195,10 @@ class draw_hatch : public office_element_impl<draw_hatch>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawHatch;
CPDOCCORE_DEFINE_VISITABLE()
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
@ -222,10 +222,10 @@ class draw_opacity : public office_element_impl<draw_opacity>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawOpacity;
CPDOCCORE_DEFINE_VISITABLE()
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
@ -255,10 +255,10 @@ class draw_layer : public office_element_impl<draw_layer>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawLayer;
CPDOCCORE_DEFINE_VISITABLE()
_CP_OPT(std::wstring) draw_name_;
@ -273,10 +273,10 @@ class draw_layer_set : public office_element_impl<draw_layer_set>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawLayerSet;
CPDOCCORE_DEFINE_VISITABLE()
office_element_ptr_array content_;
@ -293,10 +293,10 @@ class draw_fill_image : public office_element_impl<draw_fill_image>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawFillImage;
CPDOCCORE_DEFINE_VISITABLE()
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
@ -316,10 +316,10 @@ class draw_marker : public office_element_impl<draw_marker>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawMarker;
CPDOCCORE_DEFINE_VISITABLE()
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
@ -346,9 +346,9 @@ class style : public office_element_impl<style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleStyle;
CPDOCCORE_DEFINE_VISITABLE()
style() : content_(getContext()) {}
@ -436,9 +436,9 @@ class office_automatic_styles : public office_element_impl<office_automatic_styl
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeAutomaticStyles;
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);
@ -457,9 +457,9 @@ class office_master_styles : public office_element_impl<office_master_styles>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeMasterStyles;
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);
@ -500,9 +500,9 @@ class style_master_page: public office_element_impl<style_master_page>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleMasterPage;
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);
@ -536,9 +536,9 @@ class office_styles : public office_element_impl<office_styles>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeStyles;
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);
@ -586,9 +586,9 @@ class style_header : public office_element_impl<style_header>, public header_foo
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleHeader;
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);
@ -606,9 +606,9 @@ class style_footer : public office_element_impl<style_footer>, public header_foo
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFooter;
CPDOCCORE_DEFINE_VISITABLE()
virtual void serialize(std::wostream & strm);
@ -627,9 +627,9 @@ class style_header_first : public office_element_impl<style_header_first>, publi
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleHeaderFirst;
CPDOCCORE_DEFINE_VISITABLE()
virtual void serialize(std::wostream & strm);
@ -647,9 +647,9 @@ class style_footer_first : public office_element_impl<style_footer_first>, publi
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFooterFirst;
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);
@ -667,9 +667,9 @@ class style_header_left : public office_element_impl<style_header_left>, public
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleHeaderLeft;
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);
@ -687,9 +687,9 @@ class style_footer_left : public office_element_impl<style_footer_left>, public
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFooterLeft;
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);
@ -718,9 +718,9 @@ class style_header_style : public office_element_impl<style_header_style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleHeaderStyle;
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);
@ -739,9 +739,9 @@ class style_footer_style : public office_element_impl<style_footer_style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFooterStyle;
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);
@ -759,9 +759,9 @@ class style_page_layout : public office_element_impl<style_page_layout>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStylePageLayout;
CPDOCCORE_DEFINE_VISITABLE()
style_page_layout_attlist style_page_layout_attlist_;
@ -799,9 +799,9 @@ class style_footnote_sep : public office_element_impl<style_footnote_sep>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFootnoteSep;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
@ -818,9 +818,9 @@ class text_notes_configuration : public office_element_impl<text_notes_configura
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNotesConfiguration;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm){}
@ -847,9 +847,9 @@ class text_linenumbering_configuration : public office_element_impl<text_linenum
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextLinenumberingConfiguration;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
@ -874,9 +874,9 @@ class text_linenumbering_separator : public office_element_impl<text_linenumberi
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextLinenumberingSeparator;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name) {}
virtual void serialize(std::wostream & strm);
@ -894,9 +894,9 @@ class style_presentation_page_layout : public office_element_impl<style_presenta
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStylePresentationPageLayout;
CPDOCCORE_DEFINE_VISITABLE()
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);
@ -918,10 +918,10 @@ class style_font_face : public office_element_impl<style_font_face>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFontFace;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name){}
@ -981,10 +981,10 @@ class office_font_face_decls : public office_element_impl<office_font_face_decls
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeFontFaceDecls;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);
@ -1001,9 +1001,9 @@ class style_region_left : public office_element_impl<style_region_left>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleRegionLeft;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);
@ -1020,9 +1020,9 @@ class style_region_right : public office_element_impl<style_region_right>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleRegionRight;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);
@ -1041,9 +1041,9 @@ class style_region_center : public office_element_impl<style_region_center>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleRegionCenter;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);

View File

@ -65,9 +65,9 @@ class text_list_style : public office_element_impl<text_list_style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListStyle;
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);
@ -117,9 +117,9 @@ class style_list_level_properties : public office_element_impl<style_list_level_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleListLevelProperties;
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);
@ -151,9 +151,9 @@ class style_list_level_label_alignment : public office_element_impl<style_list_l
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleListLevelLabelAlignment;
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);
@ -179,9 +179,9 @@ class text_list_level_style_number : public office_element_impl<text_list_level_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListLevelStyleNumber;
CPDOCCORE_DEFINE_VISITABLE()
office_element_ptr style_list_level_properties_;
@ -220,9 +220,9 @@ class text_list_level_style_bullet : public office_element_impl<text_list_level_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListLevelStyleBullet;
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);
@ -254,9 +254,9 @@ class text_list_level_style_image : public office_element_impl<text_list_level_s
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListLevelStyleImage;
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);
@ -276,9 +276,9 @@ class text_outline_style : public office_element_impl<text_outline_style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextOutlineStyle;
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);
@ -296,9 +296,9 @@ class text_outline_level_style : public office_element_impl<text_outline_level_s
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextOutlineLevelStyle;
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);

View File

@ -81,7 +81,7 @@ void table_table_cell_attlist::serialize(CP_ATTR_NODE)
}
CP_XML_ATTR_OPT(L"table:style-name", table_style_name_);
CP_XML_ATTR_OPT(L"table:content-validation-name", table_content_validation_name_);
CP_XML_ATTR_OPT(L"table:formula", table_formula_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:formula", table_formula_);
if (common_value_and_type_attlist_)
common_value_and_type_attlist_->serialize(CP_GET_XML_NODE());
@ -417,8 +417,8 @@ void table_columns::serialize(std::wostream & strm)
// table-columns-no-group
//////////////////////////////////////////////////////////////////////////////////////////////////
//const wchar_t * table_columns_no_group::ns = L"table";
//const wchar_t * table_columns_no_group::name = L"table-columns";
const wchar_t * table_columns_no_group::ns = L"table";
const wchar_t * table_columns_no_group::name = L"table-columns";
table_columns_no_group::table_columns_no_group(odf_conversion_context * _Context) : was_header_(false)
{
Context = _Context;
@ -999,10 +999,10 @@ void table_content_validation::serialize(std::wostream & _Wostream)
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:name", table_name_);
CP_XML_ATTR_OPT(L"table:condition", table_condition_);
CP_XML_ATTR_OPT(L"table:display-list", table_display_list_);
CP_XML_ATTR_OPT(L"table:allow-empty-cell", table_allowempty_cell_);
CP_XML_ATTR_OPT(L"table:base-cell-address", table_base_cell_address_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:condition", table_condition_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:display-list", table_display_list_);
CP_XML_ATTR_OPT(L"table:allow-empty-cell", table_allowempty_cell_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:base-cell-address", table_base_cell_address_);
for (size_t i = 0; i < content_.size(); i++)
{

View File

@ -157,10 +157,10 @@ class table_table_protection : public office_element_impl<table_table_protection
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableProtection;
CPDOCCORE_DEFINE_VISITABLE();
table_table_protection() : select_protected_cells(true), select_unprotected_cells(true) {}
@ -188,10 +188,10 @@ class table_table_source : public office_element_impl<table_table_source>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableSource;
CPDOCCORE_DEFINE_VISITABLE();
table_table_source_attlist table_table_source_attlist_;
table_linked_source_attlist table_linked_source_attlist_;
@ -221,19 +221,14 @@ public:
};
//-----------------------------------------------------------------------------------------------------
class table_columns_no_group: public office_element
class table_columns_no_group : public office_element_impl<table_columns_no_group>
{
public:
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_;
const wchar_t * ns;
const wchar_t * name;
xml::NodeType xml_type;
ElementType type;
static const wchar_t * ns;
static const wchar_t * name;
static const ElementType type = typeTableTableColumnNoGroup;
CPDOCCORE_DEFINE_VISITABLE();
public:
table_columns_no_group(odf_conversion_context * _Context);
table_columns_no_group(odf_conversion_context * _Context);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name/*, odf_conversion_context * Context*/);
virtual void add_child_element( const office_element_ptr & child_element);
@ -250,8 +245,7 @@ public:
table_columns table_columns_2_;
private:
odf_conversion_context * Context;
odf_conversion_context * Context;
};
//-----------------------------------------------------------------------------------------------------
@ -292,10 +286,10 @@ class table_table_column : public office_element_impl<table_table_column>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableColumn;
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);
@ -315,10 +309,10 @@ class table_table_columns : public office_element_impl<table_table_columns>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableColumns;
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);
@ -337,10 +331,10 @@ class table_table_header_columns : public office_element_impl<table_table_header
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableHeaderColumns;
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);
@ -370,10 +364,8 @@ class table_table_column_group : public office_element_impl<table_table_column_g
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableColumnGroup;
CPDOCCORE_DEFINE_VISITABLE();
static const ElementType type = typeTableTableColumnGroup;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -397,10 +389,10 @@ class table_table_row : public office_element_impl<table_table_row>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableRow;
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);
@ -435,10 +427,10 @@ class table_table_cell : public office_element_impl<table_table_cell>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableCell;
CPDOCCORE_DEFINE_VISITABLE();
table_table_cell() { }
@ -461,10 +453,10 @@ class table_covered_table_cell : public office_element_impl<table_covered_table_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableCoveredTableCell;
CPDOCCORE_DEFINE_VISITABLE();
table_covered_table_cell() {empty_ = true; }
@ -487,10 +479,10 @@ class table_table_rows : public office_element_impl<table_table_rows>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableRows;
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);
@ -513,10 +505,10 @@ class table_table_header_rows : public office_element_impl<table_table_header_ro
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableHeaderRows;
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);
@ -543,20 +535,16 @@ public:
};
//-----------------------------------------------------------------------------------------------------
class table_rows_no_group : public office_element
class table_rows_no_group : public office_element_impl<table_rows_no_group>
{
public:
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_;
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableRowNoGroup;
static _CP_PTR(table_rows_no_group) create(odf_conversion_context * Context);
CPDOCCORE_DEFINE_VISITABLE();
public:
table_rows_no_group(odf_conversion_context * Context);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -609,10 +597,10 @@ class table_table_row_group : public office_element_impl<table_table_row_group>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableRowGroup;
CPDOCCORE_DEFINE_VISITABLE();
table_table_row_group()
{
@ -635,10 +623,10 @@ class table_table : public office_element_impl<table_table>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTable;
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);
@ -669,10 +657,10 @@ class table_shapes : public office_element_impl<table_shapes>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableShapes;
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);
@ -690,10 +678,10 @@ class table_content_validations : public office_element_impl<table_content_valid
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableContentValidations;
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);
@ -711,10 +699,10 @@ class table_content_validation : public office_element_impl<table_content_valida
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableContentValidation;
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);
@ -737,10 +725,10 @@ class table_error_message : public office_element_impl<table_error_message>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableErrorMassage;
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);
@ -761,10 +749,10 @@ class table_help_message : public office_element_impl<table_help_message>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableHelpMassage;
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);

View File

@ -56,9 +56,9 @@ class table_data_pilot_tables : public office_element_impl<table_data_pilot_tabl
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotTables;
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);
@ -76,9 +76,9 @@ class table_data_pilot_table : public office_element_impl<table_data_pilot_table
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotTable;
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);
@ -108,9 +108,9 @@ class table_data_pilot_field : public office_element_impl<table_data_pilot_field
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotField;
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);
@ -139,9 +139,9 @@ class table_data_pilot_grand_total : public office_element_impl<table_data_pilot
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotGrandTotal;
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){}
@ -160,9 +160,9 @@ class table_data_pilot_field_reference : public office_element_impl<table_data_p
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotFieldReference;
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){}
@ -183,9 +183,9 @@ class table_database_source_table : public office_element_impl<table_database_so
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDatabaseSourceTable;
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){}
@ -204,9 +204,9 @@ class table_database_source_query : public office_element_impl<table_database_so
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDatabaseSourceQuery;
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){}
@ -225,9 +225,9 @@ class table_database_source_sql : public office_element_impl<table_database_sour
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDatabaseSourceSql;
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){}
@ -247,9 +247,9 @@ class table_source_cell_range : public office_element_impl<table_source_cell_ran
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableSourceCellRange;
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);
@ -267,9 +267,9 @@ class table_source_cell_ranges : public office_element_impl<table_source_cell_ra
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableSourceCellRanges;
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){}
@ -287,9 +287,9 @@ class table_source_service : public office_element_impl<table_source_service>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableSourceService;
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){}
@ -311,9 +311,9 @@ class table_data_pilot_level : public office_element_impl<table_data_pilot_level
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotLevel;
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);
@ -337,9 +337,9 @@ class table_data_pilot_groups : public office_element_impl<table_data_pilot_grou
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotGroups;
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);
@ -364,9 +364,9 @@ class table_data_pilot_group : public office_element_impl<table_data_pilot_group
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotGroup;
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);
@ -385,9 +385,9 @@ class table_data_pilot_members : public office_element_impl<table_data_pilot_mem
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotMembers;
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);
@ -405,9 +405,9 @@ class table_data_pilot_member : public office_element_impl<table_data_pilot_memb
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotMember;
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){}
@ -426,9 +426,9 @@ class table_data_pilot_group_member : public office_element_impl<table_data_pilo
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotGroupMember;
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){}
@ -445,9 +445,9 @@ class table_data_pilot_subtotals : public office_element_impl<table_data_pilot_s
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotSubtotals;
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);
@ -465,9 +465,9 @@ class table_data_pilot_subtotal : public office_element_impl<table_data_pilot_su
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotSubtotal;
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){}
@ -485,9 +485,9 @@ class table_data_pilot_layout_info : public office_element_impl<table_data_pilot
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataLayoutInfo;
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){}
@ -505,9 +505,9 @@ class table_data_pilot_sort_info : public office_element_impl<table_data_pilot_s
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataSortInfo;
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){}
@ -526,9 +526,9 @@ class table_data_pilot_display_info : public office_element_impl<table_data_pilo
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataDisplayInfo;
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){}

View File

@ -102,7 +102,7 @@ void table_database_range::serialize(std::wostream & _Wostream)
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:name", table_name_);
CP_XML_ATTR_OPT(L"table:target-range-address", table_target_range_address_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:target-range-address", table_target_range_address_);
CP_XML_ATTR_OPT(L"table:display-filter-buttons", table_display_filter_buttons_);
}
}

View File

@ -49,10 +49,10 @@ 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 create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -71,10 +71,10 @@ 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 create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}

View File

@ -112,9 +112,9 @@ void table_named_range::serialize(std::wostream & _Wostream)
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:name", table_name_);
CP_XML_ATTR_OPT(L"table:base-cell-address", table_base_cell_address_);
CP_XML_ATTR_OPT(L"table:cell-range-address", table_cell_range_address_);
CP_XML_ATTR_OPT(L"table:range-usable-as", table_range_usable_as_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:base-cell-address", table_base_cell_address_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:cell-range-address", table_cell_range_address_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:range-usable-as", table_range_usable_as_);
}
}
}
@ -131,7 +131,7 @@ void table_named_expression::serialize(std::wostream & _Wostream)
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:name", table_name_);
CP_XML_ATTR_OPT(L"table:base-cell-address", table_base_cell_address_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:base-cell-address", table_base_cell_address_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:expression", table_expression_);
}
}

View File

@ -47,10 +47,10 @@ class table_named_expressions : public office_element_impl<table_named_expressio
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableNamedExpressions;
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);
@ -70,10 +70,10 @@ class table_named_range : public office_element_impl<table_named_range>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableNamedRange;
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){}
@ -97,10 +97,10 @@ 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){}

View File

@ -88,9 +88,9 @@ class text_h : public office_element_impl<text_h>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextH;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -121,9 +121,9 @@ class text_p : public office_element_impl<text_p>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextP;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -144,9 +144,9 @@ class text_list : public office_element_impl<text_list>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextList;
CPDOCCORE_DEFINE_VISITABLE()
public:
@ -173,9 +173,9 @@ class text_soft_page_break : public office_element_impl<text_soft_page_break>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSoftPageBreak;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -204,9 +204,9 @@ class text_section : public office_element_impl<text_section>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSection;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -241,9 +241,9 @@ class text_section_source : public office_element_impl<text_section_source>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSectionSource;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element){}
@ -260,10 +260,10 @@ class text_table_of_content : public office_element_impl<text_table_of_content>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTableOfContent;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -284,9 +284,9 @@ class text_index_body : public office_element_impl<text_index_body>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexBody;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -305,9 +305,9 @@ class text_index_title : public office_element_impl<text_index_title>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexTitle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -326,10 +326,10 @@ class text_unknown_change : public office_element_impl<text_unknown_change>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextUnknownChange;
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);
@ -347,7 +347,7 @@ class text_insertion : public text_unknown_change
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextInsertion;
virtual void serialize(std::wostream & _Wostream);
@ -361,7 +361,7 @@ class text_deletion : public text_unknown_change
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextDeletion;
virtual void serialize(std::wostream & _Wostream);
@ -375,7 +375,7 @@ class text_format_change : public text_unknown_change
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextFormatChange;
virtual void serialize(std::wostream & _Wostream);
@ -391,9 +391,9 @@ class text_tracked_changes : public office_element_impl<text_tracked_changes>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTrackedChanges;
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);
@ -411,9 +411,9 @@ class text_changed_region : public office_element_impl<text_changed_region>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextChangedRegion;
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);
@ -432,10 +432,10 @@ public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextChange;
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) {}
@ -451,7 +451,7 @@ class text_change : public text_add_change
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextChange;
virtual void serialize(std::wostream & _Wostream);
@ -464,7 +464,7 @@ class text_change_start : public text_add_change
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextChangeStart;
virtual void serialize(std::wostream & _Wostream);
@ -477,7 +477,7 @@ class text_change_end : public text_add_change
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextChangeEnd;
virtual void serialize(std::wostream & _Wostream);
@ -491,10 +491,10 @@ class text_table_index : public office_element_impl<text_table_index>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTableIndex;
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);
@ -515,10 +515,10 @@ class text_illustration_index : public office_element_impl<text_illustration_ind
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIllustrationIndex;
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);
@ -539,10 +539,10 @@ class text_alphabetical_index : public office_element_impl<text_alphabetical_ind
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextAlphabeticalIndex;
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);
@ -563,10 +563,10 @@ class text_user_index : public office_element_impl<text_user_index>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextUserIndex;
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);
@ -587,10 +587,10 @@ class text_bibliography : public office_element_impl<text_bibliography>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBibliography;
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);
@ -610,9 +610,9 @@ class text_bibliography_source: public office_element_impl<text_bibliography_sou
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBibliographySource;
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);
@ -629,9 +629,9 @@ class common_entry_template : public office_element_impl<common_entry_template>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextCommonEntryTemplate;
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);
@ -650,9 +650,9 @@ class text_bibliography_entry_template: public common_entry_template
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBibliographyEntryTemplate;
CPDOCCORE_DEFINE_VISITABLE()
virtual void serialize(std::wostream & _Wostream);
@ -665,9 +665,9 @@ class text_index_title_template : public office_element_impl<text_index_title_te
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexTitleTemplate;
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){}
@ -686,9 +686,9 @@ class text_sequence_decl : public office_element_impl<text_sequence_decl>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSequenceDecl;
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){}
@ -708,9 +708,9 @@ class text_sequence_decls : public office_element_impl<text_sequence_decls>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSequenceDecls;
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);
@ -728,9 +728,9 @@ class text_table_of_content_source: public office_element_impl<text_table_of_con
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTableOfContentSource;
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);
@ -758,9 +758,9 @@ class text_table_of_content_entry_template : public common_entry_template
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTableOfContentEntryTemplate;
CPDOCCORE_DEFINE_VISITABLE()
};
CP_REGISTER_OFFICE_ELEMENT2(text_table_of_content_entry_template);
//---------------------------------------------------------------------------------------------------
@ -771,9 +771,9 @@ class text_index_entry_bibliography: public office_element_impl<text_index_entry
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexEntryBibliography;
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){}
@ -792,9 +792,9 @@ class text_index_entry_chapter: public office_element_impl<text_index_entry_chap
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexEntryChapter;
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){}
@ -810,9 +810,9 @@ class text_index_entry_link_end: public office_element_impl<text_index_entry_lin
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexEntryLinkEnd;
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){}
@ -828,9 +828,9 @@ class text_index_entry_link_start: public office_element_impl<text_index_entry_l
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexEntryLinkStart;
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){}
@ -846,9 +846,9 @@ class text_index_entry_page_number: public office_element_impl<text_index_entry_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexEntryPageNumber;
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){}
@ -864,9 +864,9 @@ class text_index_entry_span: public office_element_impl<text_index_entry_span>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexEntrySpan;
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){}
@ -882,9 +882,9 @@ class text_index_entry_tab_stop: public office_element_impl<text_index_entry_tab
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexEntryTabStop;
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){}
@ -900,9 +900,9 @@ class text_index_entry_text: public office_element_impl<text_index_entry_text>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIndexEntryText;
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){}
@ -918,9 +918,9 @@ class text_illustration_index_source: public office_element_impl<text_illustrati
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIllustrationIndexSource;
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);
@ -946,9 +946,9 @@ class text_illustration_index_entry_template : public common_entry_template
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextIllustrationIndexEntryTemplate;
CPDOCCORE_DEFINE_VISITABLE()
};
CP_REGISTER_OFFICE_ELEMENT2(text_illustration_index_entry_template);
//---------------------------------------------------------------------------------------------------
@ -959,9 +959,9 @@ class text_user_index_source: public office_element_impl<text_user_index_source>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextUserIndexSource;
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);
@ -994,9 +994,9 @@ class text_user_index_entry_template : public common_entry_template
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextUserIndexEntryTemplate;
CPDOCCORE_DEFINE_VISITABLE()
};
CP_REGISTER_OFFICE_ELEMENT2(text_user_index_entry_template);
//---------------------------------------------------------------------------------------------------
@ -1007,9 +1007,9 @@ class alphabetical_index_source : public office_element_impl<alphabetical_index_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextAlphabeticalIndexSource;
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);
@ -1046,9 +1046,9 @@ class text_alphabetical_index_entry_template : public common_entry_template
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextAlphabeticalIndexEntryTemplate;
CPDOCCORE_DEFINE_VISITABLE()
};
CP_REGISTER_OFFICE_ELEMENT2(text_alphabetical_index_entry_template);
//---------------------------------------------------------------------------------------------------
@ -1059,9 +1059,9 @@ class text_table_index_source: public office_element_impl<text_table_index_sourc
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTableIndexSource;
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);
@ -1087,9 +1087,9 @@ class text_table_index_entry_template : public common_entry_template
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTableIndexEntryTemplate;
CPDOCCORE_DEFINE_VISITABLE()
};
CP_REGISTER_OFFICE_ELEMENT2(text_table_index_entry_template);
}

View File

@ -164,6 +164,8 @@ bool XlsxConverter::convertDocument()
if (xlsx_flat_document) delete xlsx_flat_document; xlsx_flat_document = NULL;
ods_context->end_document();
if (ods_context) delete ods_context; ods_context = NULL;
return true;
}

View File

@ -92,10 +92,10 @@ void BulletsConverter::ConvertPFRun(PPTX::Logic::TextParagraphPr &oPPr, CTextPFR
LONG val = pPF->spaceAfter.get();
auto pSpcAft = new PPTX::Logic::TextSpacing;
pSpcAft->m_name = L"a:spcAft";
if (val > 0)
if (val > 0) // Spacing Points
pSpcAft->spcPts = round(12.5 * pPF->spaceAfter.get());
else if (val < 0 && val > -13200)
pSpcAft->spcPts = val * -1000;
else if (val < 0 && val > -13200) // Spacing Percent
pSpcAft->spcPct = val * -1000;
oPPr.spcAft = pSpcAft;
}
@ -189,9 +189,9 @@ void BulletsConverter::ConvertAllBullets(PPTX::Logic::TextParagraphPr &oPPr, CTe
pBuFont->m_name = L"a:buFont";
pBuFont->typeface = pPF->bulletFontProperties->Name;
if ( pPF->bulletFontProperties->PitchFamily > 0)
if ( CFontProperty::IsValidPitchFamily(pPF->bulletFontProperties->PitchFamily))
pBuFont->pitchFamily = std::to_wstring(pPF->bulletFontProperties->PitchFamily);
if ( pPF->bulletFontProperties->Charset > 0)
if ( CFontProperty::IsValidCharset(pPF->bulletFontProperties->Charset))
pBuFont->charset = std::to_wstring(pPF->bulletFontProperties->Charset);
oPPr.buTypeface.m_Typeface.reset(pBuFont);

View File

@ -2053,8 +2053,11 @@ std::wstring PPT_FORMAT::CShapeWriter::ConvertImage()
m_oWriter.WriteString(L"><a:lum");
if (pImageElement->m_lpictureBrightness != 0)
{
std::wstring bright = std::to_wstring((UINT)(pImageElement->m_lpictureBrightness * 3.051705)); // 0 - min, backgrpund. 50000 - usually. 100000 - max,white
m_oWriter.WriteString(L" bright=\"" + bright + L"\"");
int bright = std::round(3.051705 * pImageElement->m_lpictureBrightness); // -100000 - min, backgrpund. 50000 - usually. 100000 - max,white
if (bright < -100000 || bright > 100000)
bright = 50000;
m_oWriter.WriteString(L" bright=\"" + std::to_wstring(bright) + L"\"");
}
if (pImageElement->m_lpictureContrast != 0x10000)
{

View File

@ -2614,10 +2614,19 @@ void CDrawingConverter::ConvertShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::CX
}
else
{
//oProps.X выставлять не надо, они учтены в pMainProps
pSpPr->xfrm = new PPTX::Logic::Xfrm();
pSpPr->xfrm->offX = 0;
pSpPr->xfrm->offY = 0;
if (*pMainProps)
{//oProps.X выставлять не надо, они учтены в pMainProps
pSpPr->xfrm->offX = 0;
pSpPr->xfrm->offY = 0;
}
else
{
pSpPr->xfrm->offX = oProps.X;
pSpPr->xfrm->offY = oProps.Y;
}
pSpPr->xfrm->extX = oProps.Width;
pSpPr->xfrm->extY = oProps.Height;
}
@ -4515,8 +4524,11 @@ std::wstring CDrawingConverter::GetVMLShapeXml(CPPTShape* pPPTShape)
void CDrawingConverter::SendMainProps(const std::wstring& strMainProps, std::wstring**& pMainProps)
{
*pMainProps = new std::wstring();
**pMainProps = strMainProps;
if (((m_pBinaryWriter) && (m_pBinaryWriter->m_pMainDocument)) || !m_pBinaryWriter)
{
*pMainProps = new std::wstring();
**pMainProps = strMainProps;
}
}
void CDrawingConverter::CheckBorderShape(PPTX::Logic::SpTreeElem* oElem, XmlUtils::CXmlNode& oNode, CPPTShape* pPPTShape)
{

View File

@ -530,6 +530,7 @@ namespace NSBinPptxRW
_INT32 m_nCountEmbedded = 1;
_INT32 m_nCountCharts = 1;
_INT32 m_nCountDiagram = 1;
_INT32 m_nCountActiveX = 1;
BinDocxRW::CDocxSerializer* m_pMainDocument;
int m_nDocumentType;

View File

@ -34,6 +34,7 @@
#include "../../../ASCOfficePPTFile/PPTFormatLib/Enums/enums.h"
#include "../../../Common/DocxFormat/Source/Base/Nullable.h"
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Interactive.h"
#include <set>
using namespace ODRAW;
@ -91,8 +92,8 @@ namespace PPT_FORMAT
{
public:
std::wstring Name;
BYTE PitchFamily;
BYTE Charset;
int PitchFamily;
int Charset;
CFontProperty() : PitchFamily(0), Charset(0) {}
@ -108,15 +109,36 @@ namespace PPT_FORMAT
return *this;
}
std::wstring getXmlArgsStr()const
{
std::wstring str = L" typeface=\"" + Name + L"\"";
str += L" pitchFamily=\"" + std::to_wstring(PitchFamily) + L"\"";
if (Charset != 0)
str += L" charset=\"" + std::to_wstring((char)Charset) + L"\"";
return str;
}
std::wstring getXmlArgsStr()const
{
std::wstring str = L" typeface=\"" + Name + L"\"";
if (IsValidPitchFamily(PitchFamily))
str += L" pitchFamily=\"" + std::to_wstring(PitchFamily) + L"\"";
if (IsValidCharset(Charset))
str += L" charset=\"" + std::to_wstring((char)Charset) + L"\"";
return str;
}
static bool IsValidCharset(int value)
{
if (value <= 0 || value > 255)
return false;
std::set<int> BLCharset = {128, 136};
return BLCharset.find(value) == BLCharset.end();
}
static bool IsValidPitchFamily(int value)
{
if (value <= 0 || value > 255)
return false;
std::set<int> BLPitchFamily = {148, 164};
return BLPitchFamily.find(value) == BLPitchFamily.end();
}
};
class CBulletAutoNum

View File

@ -774,93 +774,57 @@ namespace NSBinPptxRW
m_oReader.m_pRels->WriteCustoms(nCountCustoms);
}
if (false)
// presProps
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::PresProps);
if (m_mainTables.end() != pPair)
{
// tableStyles
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::TableStyles);
if (m_mainTables.end() != pPair)
m_oReader.Seek(pPair->second);
try
{
m_oReader.Seek(pPair->second);
try
{
m_oTableStyles.fromPPTY(&m_oReader);
}
catch (...)
{
}
m_oPresProps.fromPPTY(&m_oReader);
}
// presProps
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::PresProps);
if (m_mainTables.end() != pPair)
catch (...)
{
}
}
else
{
CreateDefaultPresProps();
}
// viewProps
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::ViewProps);
if (m_mainTables.end() != pPair)
{
m_oReader.Seek(pPair->second);
try
{
m_oViewProps.fromPPTY(&m_oReader);
}
catch (...)
{
m_oReader.Seek(pPair->second);
try
{
m_oPresProps.fromPPTY(&m_oReader);
}
catch (...)
{
//todooo сделать в отдельный лог
}
}
// viewProps
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::ViewProps);
if (m_mainTables.end() != pPair)
{
m_oReader.Seek(pPair->second);
try
{
m_oViewProps.fromPPTY(&m_oReader);
}
catch (...)
{
}
}
}
else
{
// create default
CreateDefaultViewProps();
// presProps
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::PresProps);
if (m_mainTables.end() != pPair)
}
// tableStyles
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::TableStyles);
if (m_mainTables.end() != pPair)
{
m_oReader.Seek(pPair->second);
try
{
m_oReader.Seek(pPair->second);
try
{
m_oPresProps.fromPPTY(&m_oReader);
}
catch (...)
{
}
m_oTableStyles.fromPPTY(&m_oReader);
}
else
catch (...)
{
CreateDefaultPresProps();
}
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::TableStyles);
if (m_mainTables.end() != pPair)
{
m_oReader.Seek(pPair->second);
try
{
m_oTableStyles.fromPPTY(&m_oReader);
}
catch (...)
{
}
}
if (m_oTableStyles.Styles.empty())
{
CreateDefaultTableStyles();
}
}
if (m_oTableStyles.Styles.empty())
{
CreateDefaultTableStyles();
}
//------------------------------------------------------------------------------------------
// app
oXmlWriter.ClearNoAttack();
@ -886,14 +850,14 @@ namespace NSBinPptxRW
oXmlWriter.SaveToFile(pathCore.GetPath());
}
// presProps
// presProps
oXmlWriter.ClearNoAttack();
m_oPresProps.toXmlWriter(&oXmlWriter);
OOX::CPath pathPresProps = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("presProps.xml");
oXmlWriter.SaveToFile(pathPresProps.GetPath());
// viewProps
// viewProps
oXmlWriter.ClearNoAttack();
m_oViewProps.toXmlWriter(&oXmlWriter);
@ -903,14 +867,14 @@ namespace NSBinPptxRW
m_oReader.m_pRels->Clear();
m_oReader.m_pRels->StartRels();
// tablestyles
// tablestyles
oXmlWriter.ClearNoAttack();
m_oTableStyles.toXmlWriter(&oXmlWriter);
OOX::CPath pathTableStyles = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("tableStyles.xml");
oXmlWriter.SaveToFile(pathTableStyles.GetPath());
// presentation
// presentation
bool bIsAuthors = false;
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::Presentation);
if (m_mainTables.end() != pPair)
@ -1015,7 +979,7 @@ namespace NSBinPptxRW
RELEASEARRAYOBJECTS(pDstBuffer);
}
// content types
// content types
OOX::CContentTypes *pContentTypes = m_oImageManager.m_pContentTypes;
pContentTypes->Registration(m_oPresentation.type().OverrideType(),
@ -1040,47 +1004,47 @@ namespace NSBinPptxRW
pContentTypes->Registration(OOX::FileTypes::CustomProperties.OverrideType(), L"/docProps", OOX::FileTypes::CustomProperties.DefaultFileName().GetPath());
}
// themes
// themes
for (size_t i = 0; i < m_arThemes.size(); ++i)
{
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.theme+xml", L"/ppt/theme", L"theme" + std::to_wstring((int)i + 1) + L".xml");
}
// notes master
// notes master
if (!m_arNotesMasters.empty())
{
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml", L"/ppt/notesMasters", L"notesMaster1.xml");
}
// masters
// masters
for (LONG i = 0; i < nCountMasters; ++i)
{
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml", L"/ppt/slideMasters", L"slideMaster" + std::to_wstring(i + 1) + L".xml");
}
// layouts
// layouts
for (LONG i = 0; i < nCountLayouts; ++i)
{
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml", L"/ppt/slideLayouts", L"slideLayout" + std::to_wstring((int)i + 1) + L".xml");
}
// slides
// slides
for (size_t i = 0; i < m_arSlides.size(); ++i)
{
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.slide+xml", L"/ppt/slides", L"slide" + std::to_wstring((int)i + 1) + L".xml");
}
// notes
// notes
for (size_t i = 0; i < m_arNotesSlides.size(); ++i)
{
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml", L"/ppt/notesSlides", L"notesSlide" + std::to_wstring((int)i + 1) + L".xml");
}
// slideComments
// slideComments
for (int i = 1; i < nComment; ++i)
{
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.comments+xml", L"/ppt/comments", L"comment" + std::to_wstring(i) + L".xml");
}
// comment authors
// comment authors
if (bIsAuthors)
{
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml", L"/ppt", L"commentAuthors.xml");

View File

@ -161,6 +161,10 @@ namespace PPTX
return smart_ptr<OOX::File>(new OOX::JsaProject( pMain, filename ));
else if (relation.Type() == OOX::FileTypes::CustomXml)
return smart_ptr<OOX::File>(new OOX::CCustomXML(pMain, filename, filename));
else if (relation.Type() == OOX::FileTypes::ActiveX_xml)
return smart_ptr<OOX::File>(new OOX::ActiveX_xml(pMain, filename, filename));
else if (relation.Type() == OOX::FileTypes::ActiveX_bin)
return smart_ptr<OOX::File>(new OOX::ActiveX_bin(pMain, filename));
return smart_ptr<OOX::File>(new OOX::UnknowTypeFile(pMain));
}

View File

@ -47,10 +47,9 @@ namespace PPTX
public:
WritingElement_AdditionConstructors(CSld)
CSld() : spTree(L"p")
CSld(OOX::Document *pMain = NULL) : WrapperWritingElement(pMain), spTree(L"p")
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
}
@ -58,9 +57,9 @@ namespace PPTX
{
XmlMacroReadAttributeBase(node, L"name", attrName);
bg = node.ReadNode(_T("p:bg"));
spTree = node.ReadNodeNoNS(_T("spTree"));
controls = node.ReadNode(_T("p:controls"));
bg = node.ReadNode(L"p:bg");
spTree = node.ReadNodeNoNS(L"spTree");
controls = node.ReadNode(L"p:controls");
FillParentPointersForChilds();
}
@ -68,27 +67,29 @@ namespace PPTX
virtual std::wstring toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(_T("name"), attrName);
oAttr.Write(L"name", attrName);
XmlUtils::CNodeValue oValue;
oValue.WriteNullable(bg);
oValue.Write(spTree);
oValue.WriteNullable(controls);
return XmlUtils::CreateNode(_T("p:cSld"), oAttr, oValue);
return XmlUtils::CreateNode(L"p:cSld", oAttr, oValue);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:cSld"));
pWriter->StartNode(L"p:cSld");
pWriter->StartAttributes();
pWriter->WriteAttribute2(_T("name"), attrName);
pWriter->WriteAttribute2(L"name", attrName);
pWriter->EndAttributes();
pWriter->Write(bg);
spTree.toXmlWriter(pWriter);
pWriter->Write(controls);
pWriter->EndNode(_T("p:cSld"));
pWriter->EndNode(L"p:cSld");
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
@ -105,18 +106,16 @@ namespace PPTX
pWriter->WriteRecord1(1, spTree.grpSpPr);
pWriter->StartRecord(2);
pWriter->WriteULONG((_UINT32)spTree.SpTreeElems.size() + (controls.IsInit() ? controls->arrControls.size() : 0));
pWriter->WriteULONG((_UINT32)spTree.SpTreeElems.size());
for (size_t i = 0; i < spTree.SpTreeElems.size(); i++)
{
pWriter->WriteRecord1(0, spTree.SpTreeElems[i]);
}
if (controls.IsInit())
{
controls->toPPTY(pWriter);
}
pWriter->EndRecord();
pWriter->EndRecord();
pWriter->EndRecord();
pWriter->EndRecord();
pWriter->WriteRecord2(2, controls);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
@ -152,6 +151,12 @@ namespace PPTX
spTree.fromPPTY(pReader);
break;
}
case 2:
{
controls = new Controls(m_pMainDocument);
controls->fromPPTY(pReader);
break;
}
default:
{
pReader->Seek(_end_rec);

View File

@ -31,6 +31,7 @@
*/
#include "Controls.h"
#include "../../ASCOfficeDrawingConverter.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/ActiveX.h"
#include "../Slide.h"
@ -38,13 +39,155 @@ namespace PPTX
{
namespace Logic
{
void Controls::fromXML(XmlUtils::CXmlNode& node)
{
arrControls.clear();
XmlUtils::CXmlNodes oNodes;
if (node.GetNodes(L"*", oNodes))
{
int nCount = oNodes.GetCount();
for (int i = 0; i < nCount; ++i)
{
XmlUtils::CXmlNode oNode;
oNodes.GetAt(i, oNode);
std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());
if (strName == L"control")
{
Control elem(oNode);
arrControls.push_back(elem);
}
else if (L"AlternateContent" == strName)
{
XmlUtils::CXmlNode oNodeChoice, oNodeFallback;
XmlUtils::CXmlNode oNodeFallbackControl;
bool resFallback, resChoice = oNode.GetNode(L"mc:Choice", oNodeChoice);
if (oNode.GetNode(L"mc:Fallback", oNodeFallback))
{
resFallback = oNodeFallback.GetNode(L"p:control", oNodeFallbackControl);
}
std::wstring sRequires;
if (resChoice)
{
oNodeChoice.GetAttributeIfExist(L"Requires", sRequires);
}
if (L"v" != sRequires || !resFallback)
{
XmlUtils::CXmlNode oNodeChoiceControl;
if (oNodeChoice.GetNode(L"p:control", oNodeChoiceControl))
{
Control elem(oNodeChoiceControl);
arrControls.push_back(elem);
continue;
}
}
Control elem(oNodeFallbackControl);
arrControls.push_back(elem);
}
}
}
FillParentPointersForChilds();
}
std::wstring Controls::toXML() const
{
XmlUtils::CNodeValue oValue;
oValue.WriteArray(arrControls);
return XmlUtils::CreateNode(L"p:controls", oValue);
}
void Controls::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(L"p:controls");
pWriter->EndAttributes();
for (size_t i = 0; i < arrControls.size(); ++i)
arrControls[i].toXmlWriter(pWriter);
pWriter->EndNode(L"p:controls");
}
void Controls::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
for (size_t i = 0; i <arrControls.size(); i++)
arrControls[i].toPPTY(pWriter);
for (size_t i = 0; i < arrControls.size(); i++)
{
pWriter->WriteRecord1(0, arrControls[i]);
}
}
void Controls::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
while (pReader->GetPos() < _end_rec)
{
BYTE _rec = pReader->GetUChar();
switch (_rec)
{
case 0:
{
arrControls.push_back(Control(m_pMainDocument));
arrControls.back().fromPPTY(pReader);
}break;
default:
{
pReader->SkipRecord();
}break;
}
}
}
//------------------------------------------------------------------------------------------------------------------------
void Control::fromXML(XmlUtils::CXmlNode& node)
{
name = node.GetAttribute(L"name");
spid = node.GetAttribute(L"spid");
XmlMacroReadAttributeBase(node, L"r:id", rId);
XmlMacroReadAttributeBase(node, L"imgW", width);
XmlMacroReadAttributeBase(node, L"imgH", height);
XmlMacroReadAttributeBase(node, L"showAsIcon", showAsIcon);
if (false == rId.IsInit())
XmlMacroReadAttributeBase(node, L"id", rId);
pic = node.ReadNode(L"p:pic");
FillParentPointersForChilds();
}
std::wstring Control::toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(L"name", name);
if (rId.IsInit()) oAttr.Write(L"r:id", rId->ToString());
if (width.IsInit()) oAttr.Write(L"imgW", std::to_wstring(*width));
if (height.IsInit())oAttr.Write(L"imgH", std::to_wstring(*height));
oAttr.Write(L"spid", spid);
return XmlUtils::CreateNode(L"p:control", oAttr);
}
void Control::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(L"p:control");
pWriter->StartAttributes();
pWriter->WriteAttribute(L"name", name);
pWriter->WriteAttribute(L"spid", spid);
if (rId.IsInit()) pWriter->WriteAttribute(L"r:id", rId->ToString());
if (width.IsInit())pWriter->WriteAttribute(L"imgW", std::to_wstring(*width));
if (height.IsInit())pWriter->WriteAttribute(L"imgH", std::to_wstring(*height));
pWriter->WriteAttribute(L"showAsIcon", showAsIcon);
pWriter->EndAttributes();
pWriter->Write(pic);
pWriter->EndNode(L"p:control");
}
std::wstring Control::GetVmlXmlBySpid(std::wstring spid, smart_ptr<OOX::IFileContainer> & rels) const
{
@ -69,43 +212,126 @@ namespace PPTX
}
void Control::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
if (spid.IsInit() == false) return;
std::wstring s = *spid;
if (s.length() < 8) s = _T("_x0000_s") + s;
smart_ptr<OOX::IFileContainer> rels;
std::wstring xml = GetVmlXmlBySpid(s, rels);
if (xml.length() > 0)
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteString2(0, name);
pWriter->WriteUInt2(1, width);
pWriter->WriteUInt2(2, height);
pWriter->WriteBool2(3, showAsIcon);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
if (pic.IsInit())
{
std::wstring temp = _T("<v:object>");
temp += xml;
temp += L"</v:object>";
NSBinPptxRW::CDrawingConverter oDrawingConverter;
RELEASEOBJECT(oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager);
oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager = pWriter->m_pCommon->m_pMediaManager;
std::wstring *main_props = NULL;
oDrawingConverter.SetRels(rels);
std::vector<nullable<PPTX::Logic::SpTreeElem>> elements;
oDrawingConverter.ConvertVml(temp, elements);
oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager = NULL;
smart_ptr<OOX::IFileContainer> rels_old = pWriter->GetRels();
pWriter->SetRels(rels);
for (size_t i = 0; i < elements.size(); ++i)
{
pWriter->StartRecord(0);
elements[i]->toPPTY(pWriter);
pWriter->EndRecord();
}
pWriter->SetRels(rels_old);
pWriter->WriteRecord2(0, pic);
}
else if (spid.IsInit())
{
std::wstring s = *spid;
if (s.length() < 8) s = L"_x0000_s" + s;
smart_ptr<OOX::IFileContainer> rels;
std::wstring xml = GetVmlXmlBySpid(s, rels);
if (false == xml.empty())
{
std::wstring temp = L"<v:object>";
temp += xml;
temp += L"</v:object>";
NSBinPptxRW::CDrawingConverter oDrawingConverter;
RELEASEOBJECT(oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager);
oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager = pWriter->m_pCommon->m_pMediaManager;
std::wstring *main_props = NULL;
oDrawingConverter.SetRels(rels);
std::vector<nullable<PPTX::Logic::SpTreeElem>> elements;
oDrawingConverter.ConvertVml(temp, elements);
oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager = NULL;
smart_ptr<OOX::IFileContainer> rels_old = pWriter->GetRels();
pWriter->SetRels(rels);
for (size_t i = 0; i < elements.size(); ++i)
{
pWriter->WriteRecord2(0, elements[i]);
}
pWriter->SetRels(rels_old);
}
}
//----------------------------------
smart_ptr<OOX::File> pFileControl;
if (rId.IsInit() && parentFileIs<PPTX::Slide>())
{
pFileControl = parentFileAs<PPTX::Slide>().Find(rId.get());
}
smart_ptr<OOX::ActiveX_xml> pActiveX_xml = pFileControl.smart_dynamic_cast<OOX::ActiveX_xml>();
if (pActiveX_xml.IsInit())
{
pWriter->StartRecord(1);
pActiveX_xml->toPPTY(pWriter);
pWriter->EndRecord();
}
}
void Control::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
if (0 == _at) name = pReader->GetString2();
else if (1 == _at) width = pReader->GetULong();
else if (2 == _at) height = pReader->GetULong();
else if (3 == _at) showAsIcon = pReader->GetBool();
else
break;
}
while (pReader->GetPos() < _end_rec)
{
BYTE _rec = pReader->GetUChar();
switch (_rec)
{
case 0:
{
pReader->Skip(1); // type (0)
LONG nElemLength = pReader->GetLong(); // len
pic.Init();
pic->fromPPTY(pReader);
}break;
case 1:
{
smart_ptr<OOX::ActiveX_xml> pActiveX_xml = new OOX::ActiveX_xml(m_pMainDocument);
pActiveX_xml->fromPPTY(pReader);
std::wstring sActiveXFileName = L"activeX" + std::to_wstring(pReader->m_nCountActiveX++) + L".xml";
OOX::CPath sActiveXPath = pReader->m_pRels->m_pManager->GetDstFolder() + FILE_SEPARATOR_STR + L"activeX";
NSDirectory::CreateDirectory(sActiveXPath.GetPath());
OOX::CPath oActiveXRegPath = std::wstring(L"/ppt/activeX/");
pActiveX_xml->write(sActiveXPath + FILE_SEPARATOR_STR + sActiveXFileName, oActiveXRegPath, *pReader->m_pRels->m_pManager->m_pContentTypes);
std::wstring sActiveXRelsPath = L"../activeX/" + sActiveXFileName;
size_t nRId = pReader->m_pRels->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/control", sActiveXRelsPath, L"");
rId = OOX::RId(nRId);
}break;
default:
{
pReader->SkipRecord();
}break;
}
}
pReader->Seek(_end_rec);
}
} // namespace Logic
} // namespace PPTX

View File

@ -45,74 +45,33 @@ namespace PPTX
{
public:
PPTX_LOGIC_BASE(Control)
void AddObjectTo (const std::vector<SpTreeElem> *spTreeElements, NSShapeImageGen::CMediaManager* pMediaManager) const ;
Control(OOX::Document *pMain = NULL) : WrapperWritingElement(pMain)
{
}
std::wstring GetVmlXmlBySpid(std::wstring spid, smart_ptr<OOX::IFileContainer> & rels) const ;
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const ;
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
virtual void fromXML(XmlUtils::CXmlNode& node)
{
name = node.GetAttribute(_T("name"));
spid = node.GetAttribute(_T("spid"));
XmlMacroReadAttributeBase(node, L"rId" , rId);
XmlMacroReadAttributeBase(node, L"width" , width);
XmlMacroReadAttributeBase(node, L"height" , height);
XmlMacroReadAttributeBase(node, L"showAsIcon", showAsIcon);
virtual void fromXML(XmlUtils::CXmlNode& node);
pic = node.ReadNode(_T("p:pic"));
virtual std::wstring toXML() const;
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
FillParentPointersForChilds();
}
nullable_string name;
nullable_string spid;
nullable_bool showAsIcon;
nullable_uint height;
nullable_uint width;
nullable<OOX::RId> rId;
virtual std::wstring toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(_T("name"), name);
if (rId.IsInit()) oAttr.Write(_T("rId"), rId->ToString());
if (width.IsInit()) oAttr.Write(_T("width"), width->ToString());
if (height.IsInit())oAttr.Write(_T("height"), height->ToString());
oAttr.Write(_T("spid"), spid);
return XmlUtils::CreateNode(_T("p:control"), oAttr);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:control"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("name") , name);
pWriter->WriteAttribute(_T("showAsIcon"), showAsIcon);
pWriter->WriteAttribute(_T("spid") , spid);
if (rId.IsInit()) pWriter->WriteAttribute(_T("rId"), rId->ToString());
if (width.IsInit())pWriter->WriteAttribute(_T("width"), width->ToString());
if (height.IsInit())pWriter->WriteAttribute(_T("height"), height->ToString());
pWriter->EndAttributes();
pWriter->Write(pic);
pWriter->EndNode(_T("p:control"));
}
nullable_string name;
nullable_string spid;
nullable_bool showAsIcon;
nullable<SimpleTypes::CPositiveCoordinate<0>> height;
nullable<SimpleTypes::CPositiveCoordinate<0>> width;
nullable<OOX::RId> rId;
nullable<PPTX::Logic::Pic> pic;
/// todooo
nullable<PPTX::Logic::Pic> pic;
//extLst (Extension List) 19.2.1.12
protected:
virtual void FillParentPointersForChilds()
{
if (pic.IsInit()) pic->SetParentPointer(this);
}
};
@ -121,58 +80,19 @@ namespace PPTX
{
public:
PPTX_LOGIC_BASE(Controls)
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
Controls(OOX::Document *pMain = NULL) : WrapperWritingElement(pMain)
{
arrControls.clear();
XmlUtils::CXmlNodes oNodes;
if (node.GetNodes(_T("*"), oNodes))
{
int nCount = oNodes.GetCount();
for (int i = 0; i < nCount; ++i)
{
XmlUtils::CXmlNode oNode;
oNodes.GetAt(i, oNode);
std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());
if (strName == _T("control"))
{
Control elem(oNode);
arrControls.push_back(elem);
}
}
}
FillParentPointersForChilds();
}
virtual std::wstring toXML() const
{
XmlUtils::CNodeValue oValue;
oValue.WriteArray(arrControls);
return XmlUtils::CreateNode(_T("p:controls"), oValue);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:controls"));
pWriter->EndAttributes();
for (size_t i = 0; i < arrControls.size(); ++i)
arrControls[i].toXmlWriter(pWriter);
pWriter->EndNode(_T("p:controls"));
}
virtual void fromXML(XmlUtils::CXmlNode& node);
virtual std::wstring toXML() const;
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
public:
std::vector<Control> arrControls;
protected:

View File

@ -270,8 +270,6 @@ namespace PPTX
pWriter->EndRecord();
}
public:
std::vector<Gd> avLst;
std::vector<Gd> gdLst;
std::vector<AhBase> ahLst;

View File

@ -187,7 +187,7 @@ namespace PPTX
pReader->Seek(_end_rec);
}
public:
Limit::TextShapeType prst;
std::vector<Gd> avLst;
protected:

View File

@ -250,7 +250,7 @@ namespace PPTX
{
pReader->Skip(1); // type
Paragrs.push_back(Paragraph());
Paragrs[Paragrs.size() - 1].fromPPTY(pReader);
Paragrs.back().fromPPTY(pReader);
}
break;
}

View File

@ -30,8 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_SLIDES_SLIDE_INCLUDE_H_
#define PPTX_SLIDES_SLIDE_INCLUDE_H_
#include "WrapperFile.h"
#include "FileContainer.h"
@ -251,7 +249,7 @@ namespace PPTX
{
case 0:
{
cSld = new Logic::CSld();
cSld = new Logic::CSld(WrapperFile::m_pMainDocument);
cSld->fromPPTY(pReader);
break;
}
@ -345,5 +343,3 @@ namespace PPTX
}
};
} // namespace PPTX
#endif // PPTX_SLIDES_SLIDE_INCLUDE_H_

View File

@ -85,8 +85,6 @@ namespace PPTX
{
WrapperFile::write(filename, directory, content);
}
public:
virtual const OOX::FileType type() const
{
return OOX::Presentation::FileTypes::TableStyles;

View File

@ -30,8 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_VIEWPROPS_FILE_INCLUDE_H_
#define PPTX_VIEWPROPS_FILE_INCLUDE_H_
#include "WrapperFile.h"
#include "FileContainer.h"
@ -61,54 +59,74 @@ namespace PPTX
virtual ~ViewProps()
{
}
public:
virtual void read(const OOX::CPath& filename, FileMap& map)
{
//FileContainer::read(filename, map);
XmlUtils::CXmlNode oNode;
oNode.FromXmlFile(filename.m_strFilename);
XmlMacroReadAttributeBase(oNode, L"lastView", attrLastView);
XmlMacroReadAttributeBase(oNode, L"showComments", attrShowComments);
GridSpacing = oNode.ReadNode(_T("p:gridSpacing"));
if(GridSpacing.is_init())
GridSpacing->SetParentFilePointer(this);
XmlUtils::CXmlNodes oNodes;
if (oNode.GetNodes(_T("*"), oNodes))
{
int nCount = oNodes.GetCount();
for (int i = 0; i < nCount; ++i)
{
XmlUtils::CXmlNode oNodeChild;
oNodes.GetAt(i, oNodeChild);
NormalViewPr = oNode.ReadNode(_T("normalViewPr"));
if(NormalViewPr.is_init())
NormalViewPr->SetParentFilePointer(this);
NotesTextViewPr = oNode.ReadNode(_T("notesTextViewPr"));
if(NotesTextViewPr.is_init())
NotesTextViewPr->SetParentFilePointer(this);
NotesViewPr = oNode.ReadNode(_T("notesViewPr"));
if(NotesViewPr.is_init())
NotesViewPr->SetParentFilePointer(this);
OutlineViewPr = oNode.ReadNode(_T("outlineViewPr"));
if(OutlineViewPr.is_init())
OutlineViewPr->SetParentFilePointer(this);
SlideViewPr = oNode.ReadNode(_T("slideViewPr"));
if(SlideViewPr.is_init())
SlideViewPr->SetParentFilePointer(this);
SorterViewPr = oNode.ReadNode(_T("sorterViewPr"));
if(SorterViewPr.is_init())
SorterViewPr->SetParentFilePointer(this);
std::wstring strName = XmlUtils::GetNameNoNS(oNodeChild.GetName());
if (L"gridSpacing" == strName)
{
GridSpacing = oNodeChild;
if (GridSpacing.is_init())
GridSpacing->SetParentFilePointer(this);
}
else if (L"normalViewPr" == strName)
{
NormalViewPr = oNodeChild;
if (NormalViewPr.is_init())
NormalViewPr->SetParentFilePointer(this);
}
else if (L"notesTextViewPr" == strName)
{
NotesTextViewPr = oNodeChild;
if (NotesTextViewPr.is_init())
NotesTextViewPr->SetParentFilePointer(this);
}
else if (L"notesViewPr" == strName)
{
NotesViewPr = oNodeChild;
if (NotesViewPr.is_init())
NotesViewPr->SetParentFilePointer(this);
}
else if (L"outlineViewPr" == strName)
{
OutlineViewPr = oNodeChild;
if (OutlineViewPr.is_init())
OutlineViewPr->SetParentFilePointer(this);
}
else if (L"slideViewPr" == strName)
{
SlideViewPr = oNodeChild;
if (SlideViewPr.is_init())
SlideViewPr->SetParentFilePointer(this);
}
else if (L"sorterViewPr" == strName)
{
SorterViewPr = oNodeChild;
if (SorterViewPr.is_init())
SorterViewPr->SetParentFilePointer(this);
}
}
}
}
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const
{
WrapperFile::write(filename, directory, content);
FileContainer::write(filename, directory, content);
}
public:
virtual const OOX::FileType type() const
{
return OOX::Presentation::FileTypes::ViewProps;
@ -143,17 +161,94 @@ namespace PPTX
pWriter->EndRecord();
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
pReader->Skip(1);
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
attrLastView = pReader->GetUChar();
}break;
case 1:
{
attrShowComments = pReader->GetBool();
}break;
default:
break;
}
}
while (pReader->GetPos() < _end_rec)
{
BYTE _rec = pReader->GetUChar();
switch (_rec)
{
case 0:
{
GridSpacing = new nsViewProps::GridSpacing();
GridSpacing->fromPPTY(pReader);
}break;
case 1:
{
NormalViewPr = new nsViewProps::NormalViewPr();
NormalViewPr->fromPPTY(pReader);
}break;
case 2:
{
NotesTextViewPr = new nsViewProps::NotesTextViewPr();
NotesTextViewPr->fromPPTY(pReader);
}break;
case 3:
{
NotesViewPr = new nsViewProps::NotesViewPr();
NotesViewPr->fromPPTY(pReader);
}break;
case 4:
{
OutlineViewPr = new nsViewProps::OutlineViewPr();
OutlineViewPr->fromPPTY(pReader);
}break;
case 5:
{
SlideViewPr = new nsViewProps::SlideViewPr();
SlideViewPr->fromPPTY(pReader);
}break;
case 6:
{
SorterViewPr = new nsViewProps::SorterViewPr();
SorterViewPr->fromPPTY(pReader);
}break;
default:
{
pReader->SkipRecord();
}break;
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:viewPr"));
pWriter->StartNode(L"p:viewPr");
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
pWriter->WriteAttribute(_T("lastView"), attrLastView);
pWriter->WriteAttribute(_T("showComments"), attrShowComments);
pWriter->WriteAttribute(L"xmlns:a", PPTX::g_Namespaces.a.m_strLink);
pWriter->WriteAttribute(L"xmlns:r", PPTX::g_Namespaces.r.m_strLink);
pWriter->WriteAttribute(L"xmlns:p", PPTX::g_Namespaces.p.m_strLink);
pWriter->WriteAttribute(L"lastView", attrLastView);
pWriter->WriteAttribute(L"showComments", attrShowComments);
pWriter->EndAttributes();
@ -165,10 +260,9 @@ namespace PPTX
pWriter->Write(NotesViewPr);
pWriter->Write(GridSpacing);
pWriter->EndNode(_T("p:viewPr"));
pWriter->EndNode(L"p:viewPr");
}
public:
nullable_limit<Limit::LastView> attrLastView;
nullable_bool attrShowComments;
@ -182,4 +276,3 @@ namespace PPTX
};
} // namespace PPTX
#endif // PPTX_VIEWPROPS_FILE_INCLUDE_H_

View File

@ -30,8 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_VIEWPROPS_COMMON_SLIDE_VIEW_PROPERTIES_INCLUDE_H_
#define PPTX_VIEWPROPS_COMMON_SLIDE_VIEW_PROPERTIES_INCLUDE_H_
#include "./../WrapperWritingElement.h"
#include "CViewPr.h"
@ -60,16 +58,14 @@ namespace PPTX
return *this;
}
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
GuideLst.clear();
CViewPr = node.ReadNode(_T("p:cViewPr"));
CViewPr = node.ReadNode(L"p:cViewPr");
XmlUtils::CXmlNode oNodeLst = node.ReadNode(_T("p:guideLst"));
XmlMacroLoadArray(oNodeLst, _T("p:guide"), GuideLst, Guide);
XmlUtils::CXmlNode oNodeLst = node.ReadNode(L"p:guideLst");
XmlMacroLoadArray(oNodeLst, L"p:guide", GuideLst, Guide);
XmlMacroReadAttributeBase(node, L"showGuides", attrShowGuides);
XmlMacroReadAttributeBase(node, L"snapToGrid", attrSnapToGrid);
@ -80,15 +76,15 @@ namespace PPTX
virtual std::wstring toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(_T("showGuides"), attrShowGuides);
oAttr.Write(_T("snapToGrid"), attrSnapToGrid);
oAttr.Write(_T("snapToObjects"), attrSnapToObjects);
oAttr.Write(L"showGuides", attrShowGuides);
oAttr.Write(L"snapToGrid", attrSnapToGrid);
oAttr.Write(L"snapToObjects", attrSnapToObjects);
XmlUtils::CNodeValue oValue;
oValue.Write(CViewPr);
oValue.WriteArray(_T("p:guideLst"), GuideLst);
oValue.WriteArray(L"p:guideLst", GuideLst);
return XmlUtils::CreateNode(_T("p:cSldViewPr"), oAttr, oValue);
return XmlUtils::CreateNode(L"p:cSldViewPr", oAttr, oValue);
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
@ -100,35 +96,84 @@ namespace PPTX
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->WriteRecord1(0, CViewPr);
pWriter->WriteRecordArray(1, 2, GuideLst);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
pWriter->StartRecord(1);
ULONG len = (ULONG)GuideLst.size();
pWriter->WriteULONG(len);
for (ULONG i = 0; i < len; i++)
pReader->Skip(1); // start attributes
while (true)
{
pWriter->WriteRecord1(2, GuideLst[i]);
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
attrShowGuides = pReader->GetBool();
}break;
case 1:
{
attrSnapToGrid = pReader->GetBool();
}break;
case 2:
{
attrSnapToObjects = pReader->GetBool();
}break;
default:
break;
}
}
pWriter->EndRecord();
while (pReader->GetPos() < _end_rec)
{
BYTE _at = pReader->GetUChar();
switch (_at)
{
case 0:
{
CViewPr.fromPPTY(pReader);
}break;
case 1:
{
pReader->Skip(4);
ULONG _c = pReader->GetULong();
for (ULONG i = 0; i < _c; ++i)
{
pReader->Skip(1); // type
GuideLst.push_back(Guide());
GuideLst.back().fromPPTY(pReader);
}
}break;
default:
{
break;
}
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:cSldViewPr"));
pWriter->StartNode(L"p:cSldViewPr");
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("showGuides"), attrShowGuides);
pWriter->WriteAttribute(_T("snapToGrid"), attrSnapToGrid);
pWriter->WriteAttribute(_T("snapToObjects"), attrSnapToObjects);
pWriter->WriteAttribute(L"showGuides", attrShowGuides);
pWriter->WriteAttribute(L"snapToGrid", attrSnapToGrid);
pWriter->WriteAttribute(L"snapToObjects", attrSnapToObjects);
pWriter->EndAttributes();
CViewPr.toXmlWriter(pWriter);
pWriter->WriteArray(_T("p:guideLst"), GuideLst);
pWriter->WriteArray(L"p:guideLst", GuideLst);
pWriter->EndNode(_T("p:cSldViewPr"));
pWriter->EndNode(L"p:cSldViewPr");
}
public:
nsViewProps::CViewPr CViewPr;
std::vector<Guide> GuideLst;
@ -147,5 +192,3 @@ namespace PPTX
};
} // namespace nsViewProps
} // namespace PPTX
#endif // PPTX_VIEWPROPS_COMMON_SLIDE_VIEW_PROPERTIES_INCLUDE_H_

View File

@ -30,8 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_VIEWPROPS_COMMON_VIEW_PROPERTIES_INCLUDE_H_
#define PPTX_VIEWPROPS_COMMON_VIEW_PROPERTIES_INCLUDE_H_
#include "./../WrapperWritingElement.h"
#include "Origin.h"
@ -45,27 +43,25 @@ namespace PPTX
{
public:
PPTX_LOGIC_BASE(CViewPr)
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
XmlMacroReadAttributeBase(node, L"varScale", attrVarScale);
Scale = node.ReadNode(_T("p:scale"));
Origin = node.ReadNode(_T("p:origin"));
Scale = node.ReadNode(L"p:scale");
Origin = node.ReadNode(L"p:origin");
FillParentPointersForChilds();
}
virtual std::wstring toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(_T("varScale"), attrVarScale);
oAttr.Write(L"varScale", attrVarScale);
XmlUtils::CNodeValue oValue;
oValue.Write(Scale);
oValue.Write(Origin);
return XmlUtils::CreateNode(_T("p:cViewPr"), oAttr, oValue);
return XmlUtils::CreateNode(L"p:cViewPr", oAttr, oValue);
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
@ -77,21 +73,64 @@ namespace PPTX
pWriter->WriteRecord1(0, Origin);
pWriter->WriteRecord1(1, Scale);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
attrVarScale = pReader->GetBool();
}break;
default:
break;
}
}
while (pReader->GetPos() < _end_rec)
{
BYTE _rec = pReader->GetUChar();
switch (_rec)
{
case 0:
{
Origin.fromPPTY(pReader);
}break;
case 1:
{
Scale.fromPPTY(pReader);
}break;
default:
{
pReader->SkipRecord();
}break;
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:cViewPr"));
pWriter->StartNode(L"p:cViewPr");
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("varScale"), attrVarScale);
pWriter->WriteAttribute(L"varScale", attrVarScale);
pWriter->EndAttributes();
Scale.toXmlWriter(pWriter);
Origin.toXmlWriter(pWriter);
pWriter->EndNode(_T("p:cViewPr"));
pWriter->EndNode(L"p:cViewPr");
}
public:
nullable_bool attrVarScale;
nsViewProps::Origin Origin;
nsViewProps::Scale Scale;
@ -104,5 +143,3 @@ namespace PPTX
};
} // namespace nsViewProps
} // namespace PPTX
#endif // PPTX_VIEWPROPS_COMMON_VIEW_PROPERTIES_INCLUDE_H_

View File

@ -30,9 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_VIEWPROPS_GRIDSPACING_INCLUDE_H_
#define PPTX_VIEWPROPS_GRIDSPACING_INCLUDE_H_
#include "./../WrapperWritingElement.h"
namespace PPTX
@ -44,7 +41,6 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(GridSpacing)
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
cx = node.ReadAttributeInt(L"cx");
@ -55,34 +51,60 @@ namespace PPTX
virtual std::wstring toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(_T("cx"), cx);
oAttr.Write(_T("cy"), cy);
oAttr.Write(L"cx", cx);
oAttr.Write(L"cy", cy);
return XmlUtils::CreateNode(_T("p:gridSpacing"), oAttr);
return XmlUtils::CreateNode(L"p:gridSpacing", oAttr);
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteINT(cx);
pWriter->WriteINT(cy);
pWriter->WriteInt1(0, cx);
pWriter->WriteInt1(1, cy);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
cx = pReader->GetLong();
}break;
case 1:
{
cy = pReader->GetLong();
}break;
default:
break;
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:gridSpacing"));
pWriter->StartNode(L"p:gridSpacing");
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("cx"), cx);
pWriter->WriteAttribute(_T("cy"), cy);
pWriter->WriteAttribute(L"cx", cx);
pWriter->WriteAttribute(L"cy", cy);
pWriter->EndAttributes();
pWriter->EndNode(_T("p:gridSpacing"));
pWriter->EndNode(L"p:gridSpacing");
}
public:
int cx;
int cy;
protected:
@ -98,5 +120,3 @@ namespace PPTX
};
} // namespace nsViewProps
} // namespace PPTX
#endif // PPTX_VIEWPROPS_GRIDSPACING_INCLUDE_H_

View File

@ -30,8 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_VIEWPROPS_GUIDE_INCLUDE_H_
#define PPTX_VIEWPROPS_GUIDE_INCLUDE_H_
#include "./../WrapperWritingElement.h"
#include "./../Limit/Orient.h"
@ -45,7 +43,6 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(Guide)
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
XmlMacroReadAttributeBase(node, L"orient", orient);
@ -56,12 +53,11 @@ namespace PPTX
virtual std::wstring toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(_T("pos"), pos);
oAttr.WriteLimitNullable(_T("orient"), orient);
oAttr.Write(L"pos", pos);
oAttr.WriteLimitNullable(L"orient", orient);
return XmlUtils::CreateNode(_T("p:guide"), oAttr);
return XmlUtils::CreateNode(L"p:guide", oAttr);
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
@ -71,20 +67,45 @@ namespace PPTX
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
pos = pReader->GetLong();
}break;
case 1:
{
orient = pReader->GetUChar();
}break;
default:
break;
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:guide"));
pWriter->StartNode(L"p:guide");
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("pos"), pos);
pWriter->WriteAttribute(_T("orient"), orient);
pWriter->WriteAttribute(L"pos", pos);
pWriter->WriteAttribute(L"orient", orient);
pWriter->EndAttributes();
pWriter->EndNode(_T("p:guide"));
pWriter->EndNode(L"p:guide");
}
public:
nullable_int pos;
nullable_limit<Limit::Orient> orient;
protected:
@ -97,5 +118,3 @@ namespace PPTX
};
} // namespace nsViewProps
} // namespace PPTX
#endif // PPTX_VIEWPROPS_GUIDE_INCLUDE_H_

View File

@ -53,77 +53,134 @@ namespace PPTX
XmlMacroReadAttributeBase(node, L"showOutlineIcons", attrShowOutlineIcons);
XmlMacroReadAttributeBase(node, L"snapVertSplitter", attrSnapVertSplitter);
restoredLeft = node.ReadNodeNoNS(_T("restoredLeft"));
restoredTop = node.ReadNodeNoNS(_T("restoredTop"));
restoredLeft = node.ReadNodeNoNS(L"restoredLeft");
restoredTop = node.ReadNodeNoNS(L"restoredTop");
FillParentPointersForChilds();
}
virtual std::wstring toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(_T("horzBarState"), attrHorzBarState->get());
oAttr.Write(_T("vertBarState"), attrVertBarState->get());
oAttr.Write(L"horzBarState", attrHorzBarState->get());
oAttr.Write(L"vertBarState", attrVertBarState->get());
oAttr.Write(_T("preferSingleView"), attrPreferSingleView);
oAttr.Write(_T("showOutlineIcons"), attrShowOutlineIcons);
oAttr.Write(_T("snapVertSplitter"), attrSnapVertSplitter);
oAttr.Write(L"preferSingleView", attrPreferSingleView);
oAttr.Write(L"showOutlineIcons", attrShowOutlineIcons);
oAttr.Write(L"snapVertSplitter", attrSnapVertSplitter);
XmlUtils::CNodeValue oValue;
oValue.Write(restoredTop);
oValue.Write(restoredLeft);
return XmlUtils::CreateNode(_T("p:normalViewPr"), oAttr, oValue);
return XmlUtils::CreateNode(L"p:normalViewPr", oAttr, oValue);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:normalViewPr"));
pWriter->StartNode(L"p:normalViewPr");
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("horzBarState"), attrHorzBarState);
pWriter->WriteAttribute(_T("vertBarState"), attrVertBarState);
pWriter->WriteAttribute(_T("preferSingleView"), attrPreferSingleView);
pWriter->WriteAttribute(_T("showOutlineIcons"), attrShowOutlineIcons);
pWriter->WriteAttribute(_T("snapVertSplitter"), attrSnapVertSplitter);
pWriter->WriteAttribute(L"horzBarState", attrHorzBarState);
pWriter->WriteAttribute(L"vertBarState", attrVertBarState);
pWriter->WriteAttribute(L"preferSingleView", attrPreferSingleView);
pWriter->WriteAttribute(L"showOutlineIcons", attrShowOutlineIcons);
pWriter->WriteAttribute(L"snapVertSplitter", attrSnapVertSplitter);
pWriter->EndAttributes();
pWriter->StartNode(_T("p:restoredLeft"));
pWriter->StartNode(L"p:restoredLeft");
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("sz"), restoredLeft.sz);
pWriter->WriteAttribute(_T("autoAdjust"), restoredLeft.autoAdjust);
pWriter->WriteAttribute(L"sz", restoredLeft.sz);
pWriter->WriteAttribute(L"autoAdjust", restoredLeft.autoAdjust);
pWriter->EndAttributes();
pWriter->EndNode(_T("p:restoredLeft"));
pWriter->EndNode(L"p:restoredLeft");
pWriter->StartNode(_T("p:restoredTop"));
pWriter->StartNode(L"p:restoredTop");
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("sz"), restoredTop.sz);
pWriter->WriteAttribute(_T("autoAdjust"), restoredTop.autoAdjust);
pWriter->WriteAttribute(L"sz", restoredTop.sz);
pWriter->WriteAttribute(L"autoAdjust", restoredTop.autoAdjust);
pWriter->EndAttributes();
pWriter->EndNode(_T("p:restoredTop"));
pWriter->EndNode(L"p:restoredTop");
pWriter->EndNode(_T("p:normalViewPr"));
pWriter->EndNode(L"p:normalViewPr");
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
attrHorzBarState = pReader->GetUChar();
}break;
case 1:
{
attrVertBarState = pReader->GetUChar();
}break;
case 2:
{
attrPreferSingleView = pReader->GetBool();
}break;
case 3:
{
attrShowOutlineIcons = pReader->GetBool();
}break;
case 4:
{
attrSnapVertSplitter = pReader->GetBool();
}break;
default:
break;
}
}
while (pReader->GetPos() < _end_rec)
{
BYTE _rec = pReader->GetUChar();
switch (_rec)
{
case 0:
{
restoredLeft.name = L"restoredLeft";
restoredLeft.fromPPTY(pReader);
}break;
case 1:
{
restoredTop.name = L"restoredTop";
restoredTop.fromPPTY(pReader);
}break;
default:
{
pReader->SkipRecord();
}break;
}
}
pReader->Seek(_end_rec);
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteBool2(0, attrPreferSingleView);
pWriter->WriteBool2(1, attrShowOutlineIcons);
pWriter->WriteBool2(2, attrSnapVertSplitter);
pWriter->WriteLimit2(3, attrHorzBarState);
pWriter->WriteLimit2(4, attrVertBarState);
pWriter->WriteBool2(0, attrPreferSingleView);
pWriter->WriteBool2(1, attrShowOutlineIcons);
pWriter->WriteBool2(2, attrSnapVertSplitter);
pWriter->WriteLimit2(3, attrHorzBarState);
pWriter->WriteLimit2(4, attrVertBarState);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->WriteRecord1(0, restoredLeft);
pWriter->WriteRecord1(1, restoredTop);
}
nsViewProps::Restored restoredLeft;
nsViewProps::Restored restoredTop;
nsViewProps::Restored restoredLeft;
nsViewProps::Restored restoredTop;
nullable_limit<Limit::SplitterBarState> attrHorzBarState;
nullable_limit<Limit::SplitterBarState> attrVertBarState;

View File

@ -30,8 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_VIEWPROPS_NOTES_TEXT_VIEW_PROPERTIES_INCLUDE_H_
#define PPTX_VIEWPROPS_NOTES_TEXT_VIEW_PROPERTIES_INCLUDE_H_
#include "./../WrapperWritingElement.h"
#include "CViewPr.h"
@ -45,10 +43,9 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(NotesTextViewPr)
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
CViewPr = node.ReadNode(_T("p:cViewPr"));
CViewPr = node.ReadNode(L"p:cViewPr");
FillParentPointersForChilds();
}
@ -57,24 +54,44 @@ namespace PPTX
XmlUtils::CNodeValue oValue;
oValue.Write(CViewPr);
return XmlUtils::CreateNode(_T("p:notesTextViewPr"), oValue);
return XmlUtils::CreateNode(L"p:notesTextViewPr", oValue);
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteRecord1(0, CViewPr);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
while (pReader->GetPos() < _end_rec)
{
BYTE _rec = pReader->GetUChar();
switch (_rec)
{
case 0:
{
CViewPr.fromPPTY(pReader);
}break;
default:
{
pReader->SkipRecord();
}break;
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:notesTextViewPr"));
pWriter->StartNode(L"p:notesTextViewPr");
pWriter->EndAttributes();
CViewPr.toXmlWriter(pWriter);
pWriter->EndNode(_T("p:notesTextViewPr"));
pWriter->EndNode(L"p:notesTextViewPr");
}
public:
nsViewProps::CViewPr CViewPr;
protected:
virtual void FillParentPointersForChilds()
@ -83,6 +100,4 @@ namespace PPTX
}
};
} // namespace nsViewProps
} // namespace PPTX
#endif // PPTX_VIEWPROPS_NOTES_TEXT_VIEW_PROPERTIES_INCLUDE_H_
} // namespace PPTX

View File

@ -30,8 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_VIEWPROPS_NOTES_VIEW_PROPERTIES_INCLUDE_H_
#define PPTX_VIEWPROPS_NOTES_VIEW_PROPERTIES_INCLUDE_H_
#include "./../WrapperWritingElement.h"
#include "CSldViewPr.h"
@ -45,10 +43,9 @@ namespace PPTX
public:
PPTX_LOGIC_BASE(NotesViewPr)
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
CSldViewPr = node.ReadNode(_T("p:cSldViewPr"));
CSldViewPr = node.ReadNode(L"p:cSldViewPr");
FillParentPointersForChilds();
}
@ -57,24 +54,44 @@ namespace PPTX
XmlUtils::CNodeValue oValue;
oValue.Write(CSldViewPr);
return XmlUtils::CreateNode(_T("p:notesViewPr"), oValue);
return XmlUtils::CreateNode(L"p:notesViewPr", oValue);
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteRecord1(0, CSldViewPr);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
while (pReader->GetPos() < _end_rec)
{
BYTE _rec = pReader->GetUChar();
switch (_rec)
{
case 0:
{
CSldViewPr.fromPPTY(pReader);
}break;
default:
{
pReader->SkipRecord();
}break;
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:notesViewPr"));
pWriter->StartNode(L"p:notesViewPr");
pWriter->EndAttributes();
CSldViewPr.toXmlWriter(pWriter);
pWriter->EndNode(_T("p:notesViewPr"));
pWriter->EndNode(L"p:notesViewPr");
}
public:
nsViewProps::CSldViewPr CSldViewPr;
protected:
virtual void FillParentPointersForChilds()
@ -84,5 +101,3 @@ namespace PPTX
};
} // namespace nsViewProps
} // namespace PPTX
#endif // PPTX_VIEWPROPS_NOTES_VIEW_PROPERTIES_INCLUDE_H_

Some files were not shown because too many files have changed in this diff Show More