Commit 9ea214e1 authored by ElenaSubbotina's avatar ElenaSubbotina Committed by Alexander Trofimov

OdfFormatReader - math

RtfFormat - styles table
parent 435f3353
......@@ -27,25 +27,24 @@ namespace oox {
docx_conversion_context::docx_conversion_context(package::docx_document * OutputDocument, odf_reader::odf_document * OdfDocument) :
streams_man_( streams_man::create(temp_stream_) ),
output_document_(OutputDocument),
odf_document_(OdfDocument),
current_run_(false),
page_break_after_(false),
page_break_before_(false),
page_break_(false),
in_automatic_style_(false),
output_document_ (OutputDocument),
odf_document_ (OdfDocument),
mediaitems_ (OdfDocument->get_folder() ),
current_run_ (false),
page_break_after_ (false),
page_break_before_ (false),
next_dump_page_properties_(false),
next_dump_section_(false),
mediaitems_( OdfDocument->get_folder() ),
in_paragraph_(false),
table_context_(*this),
in_automatic_style_ (false),
in_paragraph_ (false),
table_context_ (*this),
section_properties_in_table_(NULL),
new_list_style_number_(0),
rtl_(false),
delayed_converting_(false),
process_note_ (noNote),
new_list_style_number_ (0),
rtl_ (false),
delayed_converting_ (false),
process_headers_footers_(false),
process_note_(noNote),
process_comment_(false)
process_comment_ (false),
process_math_formula_ (false)
{
applicationFonts_ = new CApplicationFonts();
}
......@@ -62,14 +61,20 @@ void docx_conversion_context::set_font_directory(std::wstring pathFonts)
std::wstring styles_map::get(const std::wstring & Name, odf_types::style_family::type Type)
{
const std::wstring n = name(Name, Type);
if (map_.count(n))
//typedef boost::unordered::unordered_map<std::wstring,std::wstring>::iterator _mapIter;
typedef std::multimap<std::wstring,std::wstring>::iterator _mapIter;
_mapIter it = map_.find( n );
if (it != map_.end() )
{
return map_[n];
return it->second;
}
else
{
const std::wstring id = std::wstring(L"style") + boost::lexical_cast<std::wstring>(count_++);
map_[n] = id;
map_.insert(std::make_pair(n, id));
return id;
}
}
......@@ -140,6 +145,19 @@ void docx_conversion_context::finish_run()
}
}
}
void docx_conversion_context::start_math_formula()
{
process_math_formula_ = true;
output_stream() << L"<m:oMath>";
}
void docx_conversion_context::end_math_formula()
{
output_stream() << L"</m:oMath>";
process_math_formula_ = false;
}
void docx_conversion_context::start_chart(std::wstring const & name)
{
charts_.push_back(oox_chart_context::create(name));
......@@ -399,7 +417,6 @@ xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\"
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
......@@ -505,7 +522,7 @@ void docx_conversion_context::process_styles()
// add all styles to the map
BOOST_FOREACH(odf_reader::style_instance_ptr & inst, styles.instances())
{
style_map_.get(inst->name(), inst->type());
styles_map_.get(inst->name(), inst->type());
}
_Wostream << L"<w:docDefaults>";
......@@ -532,7 +549,7 @@ void docx_conversion_context::process_styles()
inst->type() == odf_types::style_family::Text
))
{
const std::wstring id = style_map_.get(inst->name(), inst->type());
const std::wstring id = styles_map_.get(inst->name(), inst->type());
_Wostream << L"<w:style w:styleId=\"" << id << L"\" w:type=\"" << StyleTypeOdf2Docx(inst->type()) << L"\"";
if (!inst->is_default())
{
......@@ -546,18 +563,18 @@ void docx_conversion_context::process_styles()
if (odf_reader::style_instance * baseOn = inst->parent())
{
const std::wstring basedOnId = style_map_.get(baseOn->name(), baseOn->type());
const std::wstring basedOnId = styles_map_.get(baseOn->name(), baseOn->type());
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\" />";
}
else if (!inst->is_default() && style_map_.check(L"", inst->type()))
else if (!inst->is_default() && styles_map_.check(L"", inst->type()))
{
const std::wstring basedOnId = style_map_.get(L"", inst->type());
const std::wstring basedOnId = styles_map_.get(L"", inst->type());
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\" />";
}
if (odf_reader::style_instance * next = inst->next())
{
const std::wstring nextId = style_map_.get(next->name(), next->type());
const std::wstring nextId = styles_map_.get(next->name(), next->type());
_Wostream << L"<w:next w:val=\"" << nextId << "\" />";
}
else if (inst->is_default())
......
......@@ -85,7 +85,9 @@ private:
std::wstring name(const std::wstring & Name, odf_types::style_family::type Type);
size_t count_;
boost::unordered_map<std::wstring, std::wstring> map_;
//boost::unordered_map<std::wstring, std::wstring> map_;
std::multimap<std::wstring, std::wstring> map_;
};
......@@ -471,7 +473,7 @@ public:
bool in_automatic_style();
styles_context & get_styles_context() { return styles_context_; }
styles_map & get_style_map() { return style_map_; }
styles_map * get_style_map() { return &styles_map_; }
void push_text_properties(const odf_reader::style_text_properties * TextProperties);
void pop_text_properties();
......@@ -521,9 +523,9 @@ public:
docx_table_context & get_table_context() { return table_context_; }
section_context & get_section_context() { return section_context_; }
section_context & get_section_context() { return section_context_; }
odf_reader::office_element * get_section_properties_in_table();
void section_properties_in_table(odf_reader::office_element * Elm);
odf_reader::office_element * get_section_properties_in_table();
typedef boost::shared_ptr<streams_man> StreamsManPtr;
void set_stream_man(StreamsManPtr Sm) { streams_man_ = Sm; }
......@@ -548,12 +550,18 @@ public:
void end_comment() {process_comment_ = false;}
bool process_comment_;
void start_math_formula();
void end_math_formula();
bool process_math_formula_;
void set_process_headers_footers(bool Val) { process_headers_footers_ = Val; }
headers_footers & get_headers_footers() { return headers_footers_; }
header_footer_context & get_header_footer_context() { return header_footer_context_; }
bool process_headers_footers_;
drop_cap_context & get_drop_cap_context(){return drop_cap_context_;}
styles_map styles_map_;
private:
std::wstringstream document_xml_;
std::wstringstream styles_xml_;
......@@ -579,7 +587,6 @@ private:
hyperlinks hyperlinks_;
mediaitems mediaitems_;
styles_map style_map_;
styles_context styles_context_;
std::wstring automatic_parent_style_;
......
......@@ -265,7 +265,6 @@ namespace
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" >";
......
......@@ -12,6 +12,7 @@
#include "office_binary_data.h"
#include "math_elements.h"
#include "text_elements.h"
#include "list.h"
#include "style_text_properties.h"
......
......@@ -168,7 +168,24 @@ void chart_build::docx_convert(oox::docx_conversion_context & Context)
}
else if (object_type_ == 3 && office_math_)
{
oox::docx_conversion_context::StreamsManPtr prev = Context.get_stream_man();
std::wstringstream temp_stream(Context.get_drawing_context().get_text_stream_frame());
Context.set_stream_man( boost::shared_ptr<oox::streams_man>( new oox::streams_man(temp_stream) ));
bool runState = Context.get_run_state();
Context.set_run_state(false);
bool pState = Context.get_paragraph_state();
Context.set_paragraph_state(false);
bool graphic_parent=false;
office_math_->docx_convert(Context);
Context.get_drawing_context().get_text_stream_frame() = temp_stream.str();
Context.set_stream_man(prev);
Context.set_run_state(runState);
Context.set_paragraph_state(pState);
}
}
void chart_build::pptx_convert(oox::pptx_conversion_context & Context)
......@@ -235,7 +252,7 @@ void chart_build::oox_convert(oox::oox_chart_context & chart)
BOOST_FOREACH(series & s, series_)
{
if (s.class_!=last_set_type)
if (s.class_ != last_set_type)
{// - .
chart.add_chart(s.class_);
last_set_type = s.class_;
......@@ -249,8 +266,9 @@ void chart_build::oox_convert(oox::oox_chart_context & chart)
current->add_series(series_id++);
if (s.cell_range_address_.length()<1) s.cell_range_address_ = plot_area_.cell_range_address_;//SplitByColumn(ind_ser,range);
//SplitByRow(ind_ser,range)
if (s.cell_range_address_.length() <1 )
s.cell_range_address_ = plot_area_.cell_range_address_; //SplitByColumn (ind_ser,range);
//SplitByRow (ind_ser,range);
// - -
// -
//
......@@ -259,7 +277,7 @@ void chart_build::oox_convert(oox::oox_chart_context & chart)
std::vector<std::wstring> cell_cash;
calc_cash_series(s.cell_range_address_, cell_cash);
if (domain_cell_range_adress_.length()>0)
if (domain_cell_range_adress_.length() > 0)
{
std::vector<std::wstring> domain_cash;
......@@ -425,11 +443,12 @@ void process_build_chart::visit(office_text& val)
chart_build_.object_type_ = 2;
chart_build_.office_text_ = &val;//
}
void process_build_chart::visit(const math& val)
void process_build_chart::visit(office_math& val)
{
chart_build_.object_type_ = 3;
//chart_build_.math_semantics_ = &val.semantics_;//
chart_build_.office_math_ = &val;//
}
void process_build_chart::visit(const chart_chart& val)
{
chart_build_.object_type_ = 1;
......
......@@ -121,7 +121,7 @@ public:
int object_type_;
office_text *office_text_;
math *office_math_;
office_math *office_math_;
std::wstring str_class_;
chart::class_type class_;
......@@ -176,12 +176,10 @@ class process_build_chart : public base_visitor,
public const_visitor<office_document_content>,
public visitor<office_body>,
public visitor<office_chart>,
public visitor<office_chart>,
public visitor<office_text>,
public const_visitor<math>,
public visitor<office_math>,
public const_visitor<chart_chart>,
public const_visitor<chart_title>,
......@@ -248,11 +246,13 @@ private:
public:
virtual void visit(const office_document_content& val);
virtual void visit(office_body& val);
virtual void visit(office_chart& val);
virtual void visit(office_text& val);
virtual void visit(const math& val);
virtual void visit(const chart_chart& val);
virtual void visit(office_body & val);
virtual void visit(office_chart & val);
virtual void visit(office_text & val);
virtual void visit(office_math & val);
virtual void visit(const chart_chart& val);
virtual void visit(const chart_title& val);
virtual void visit(const chart_subtitle& val);
virtual void visit(const chart_footer& val);
......
......@@ -152,8 +152,8 @@ void draw_frame::add_attributes( const xml::attributes_wc_ptr & Attributes )
void draw_frame::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
if (CP_CHECK_NAME(L"draw", L"text-box") ||
CP_CHECK_NAME(L"draw", L"image") ||// ..
CP_CHECK_NAME(L"draw", L"object") ||//
CP_CHECK_NAME(L"draw", L"image") ||// ..
CP_CHECK_NAME(L"draw", L"object") ||// embedded
CP_CHECK_NAME(L"draw", L"object-ole") ||
CP_CHECK_NAME(L"draw", L"applet") ||
CP_CHECK_NAME(L"draw", L"floating-frame") ||
......
......@@ -270,8 +270,8 @@ private:
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
public:
draw_object_attlist draw_object_attlist_;
odf_types::common_xlink_attlist common_xlink_attlist_;
draw_object_attlist draw_object_attlist_;
odf_types::common_xlink_attlist common_xlink_attlist_;
};
CP_REGISTER_OFFICE_ELEMENT2(draw_object);
......
......@@ -727,8 +727,12 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
odf_reader::style_instance* styleInst = Context.root()->odf_context().styleContainer().style_by_name(styleName, odf_types::style_family::Graphic,Context.process_headers_footers_);
if (styleInst)
{
style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Graphic);
if (defaultStyle)instances.push_back(defaultStyle);
if (drawing.sub_type > 0)
{
style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Graphic);
if (defaultStyle)instances.push_back(defaultStyle);
}
instances.push_back(styleInst);
}
graphic_format_properties graphicProperties = calc_graphic_properties_content(instances);
......@@ -778,6 +782,9 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
if (!drawing.isInline)
{
if (!drawing.styleWrap)
drawing.styleWrap = style_wrap(style_wrap::Parallel);//
drawing.relativeHeight = L"2";
drawing.behindDoc = L"0";
......@@ -1228,7 +1235,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
cpdoccore::odf_reader::odf_document objectSubDoc(objectPath,NULL);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
const office_element *contentSubDoc = objectSubDoc.get_impl()->get_content();
office_element *contentSubDoc = objectSubDoc.get_impl()->get_content();
if (!contentSubDoc)
return;
......@@ -1237,44 +1244,89 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
contentSubDoc->accept(process_build_object_);
objectBuild.docx_convert(Context);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (objectBuild.object_type_ == 1) //
draw_frame * frame = Context.get_drawing_context().get_current_frame();//owner
if (!frame)
return;
//------------------------------------------------------------------------------------------------------------
if (objectBuild.object_type_ == 1 ) //
{
//
const draw_frame * frame = Context.get_drawing_context().get_current_frame();//owner
if (!frame)
return;
oox::_docx_drawing drawing = oox::_docx_drawing();
drawing.type = oox::mediaitems::typeChart;
drawing.type = oox::mediaitems::typeChart;
drawing.id = Context.get_drawing_context().get_current_frame_id();
drawing.name = Context.get_drawing_context().get_current_object_name();
drawing.id = Context.get_drawing_context().get_current_frame_id();
drawing.name = Context.get_drawing_context().get_current_object_name();
bool isMediaInternal = true;
drawing.chartId = Context.add_mediaitem(href, oox::mediaitems::typeChart, isMediaInternal, href);
common_draw_docx_convert(Context, frame->common_draw_attlists_, drawing);
drawing.chartId = Context.add_mediaitem(href, drawing.type, isMediaInternal, href);
common_draw_docx_convert(Context, frame->common_draw_attlists_, drawing);
bool runState = Context.get_run_state();
bool pState = Context.get_paragraph_state();
Context.set_run_state(false);
Context.set_paragraph_state(false);
std::wostream & strm = Context.output_stream();
Context.add_new_run(_T(""));
docx_serialize(strm, drawing);
docx_serialize(Context.output_stream(), drawing);
Context.finish_run();
Context.set_run_state(runState);
Context.set_paragraph_state(pState);
}
else if (objectBuild.object_type_ == 0 || objectBuild.object_type_ == 3)
else if (objectBuild.object_type_ == 3) //
{
oox::_docx_drawing drawing = oox::_docx_drawing();
drawing.type = oox::mediaitems::typeShape;
drawing.id = Context.get_drawing_context().get_current_frame_id();
drawing.name = Context.get_drawing_context().get_current_object_name();
common_draw_docx_convert(Context, frame->common_draw_attlists_, drawing);
const std::wstring & content = Context.get_drawing_context().get_text_stream_frame();
bool runState = Context.get_run_state();
bool pState = Context.get_paragraph_state();
if (drawing.isInline)
{
if (runState) Context.finish_run();
if (pState == false)
{
Context.output_stream() << L"<m:oMathPara>";
Context.output_stream() << L"<m:oMathParaPr/>";
}
Context.output_stream() << content;
if (pState == false)
{
Context.output_stream() << L"</m:oMathPara>";
}
if (runState) Context.add_new_run(_T(""));
}
else
{//in frame
drawing.additional.push_back(_property(L"text-content",std::wstring(L"<w:p>") + content + L"</w:p>"));
Context.set_run_state(false);
Context.set_paragraph_state(false);
Context.add_new_run(_T(""));
docx_serialize(Context.output_stream(), drawing);
Context.finish_run();
Context.set_run_state(runState);
Context.set_paragraph_state(pState);
}
Context.get_drawing_context().clear_stream_frame();
}
else if (objectBuild.object_type_ == 0)
{
// - ( )
......
......@@ -246,8 +246,8 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
try {
const std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
odf_reader::odf_document::Impl * odfImpl = Context.root()->get_impl();
const std::wstring folderPath = odfImpl->get_folder();
odf_reader::odf_document * odf_reader = Context.root();
std::wstring folderPath = odf_reader->get_folder();
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
......
......@@ -214,9 +214,9 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
try {
const std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
odf_reader::odf_document::Impl * odfImpl = Context.root()->get_impl();
std::wstring folderPath = odfImpl->get_folder();
odf_reader::odf_document * odf_reader = Context.root();
std::wstring folderPath = odf_reader->get_folder();
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
// normalize path ???? todooo
......@@ -231,7 +231,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
chart_build objectBuild;
process_build_chart process_build_object_(objectBuild,objectSubDoc.odf_context().styleContainer(),objectSubDoc.odf_context().drawStyles() );
process_build_chart process_build_object_(objectBuild, objectSubDoc.odf_context().styleContainer(), objectSubDoc.odf_context().drawStyles() );
contentSubDoc->accept(process_build_object_);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -11,7 +11,6 @@
#include "datatypes/fontvariant.h"
#include "datatypes/fontweight.h"
#include "datatypes/fontstretch.h"
#include "datatypes/length.h"
#include "datatypes/fontfamilygeneric.h"
#include "datatypes/fontpitch.h"
......
#include "math_elementaries.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
namespace cpdoccore {
using namespace odf_types;
namespace odf_reader {
//----------------------------------------------------------------------------------------------------
const wchar_t * math_mstack::ns = L"math";
const wchar_t * math_mstack::name = L"mstack";
//----------------------------------------------------------------------------------------------------
void math_mstack::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mstack::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mstack::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_msrow::ns = L"math";
const wchar_t * math_msrow::name = L"msrow";
//----------------------------------------------------------------------------------------------------
void math_msrow::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_msrow::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_msrow::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_msline::ns = L"math";
const wchar_t * math_msline::name = L"msline";
//----------------------------------------------------------------------------------------------------
void math_msline::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_msline::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_msline::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_msgroup::ns = L"math";
const wchar_t * math_msgroup::name = L"msgroup";
//----------------------------------------------------------------------------------------------------
void math_msgroup::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_msgroup::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_msgroup::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_mlongdiv::ns = L"math";
const wchar_t * math_mlongdiv::name = L"mlongdiv";
//----------------------------------------------------------------------------------------------------
void math_mlongdiv::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mlongdiv::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mlongdiv::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_mscarry::ns = L"math";
const wchar_t * math_mscarry::name = L"mscarry";
//----------------------------------------------------------------------------------------------------
void math_mscarry::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mscarry::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mscarry::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_mscarries::ns = L"math";
const wchar_t * math_mscarries::name = L"mscarries";
//----------------------------------------------------------------------------------------------------
void math_mscarries::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mscarries::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mscarries::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
}
}
#pragma once
#include <iosfwd>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements_create.h"
namespace cpdoccore {
namespace odf_reader {
class math_mstack : public office_element_impl<math_mstack>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mstack);
CP_REGISTER_OFFICE_ELEMENT3(math_mstack);
//--------------------------------------------------------------------
class math_msrow : public office_element_impl<math_msrow>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_msrow);
CP_REGISTER_OFFICE_ELEMENT3(math_msrow);
//--------------------------------------------------------------------
class math_msline : public office_element_impl<math_msline>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_msline);
CP_REGISTER_OFFICE_ELEMENT3(math_msline);
//--------------------------------------------------------------------
class math_mlongdiv : public office_element_impl<math_mlongdiv>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mlongdiv);
CP_REGISTER_OFFICE_ELEMENT3(math_mlongdiv);
//--------------------------------------------------------------------
class math_mscarries : public office_element_impl<math_mscarries>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mscarries);
CP_REGISTER_OFFICE_ELEMENT3(math_mscarries);
//--------------------------------------------------------------------
class math_msgroup : public office_element_impl<math_msgroup>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_msgroup);
CP_REGISTER_OFFICE_ELEMENT3(math_msgroup);
//--------------------------------------------------------------------
class math_mscarry : public office_element_impl<math_mscarry>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mscarry);
CP_REGISTER_OFFICE_ELEMENT3(math_mscarry);
//--------------------------------------------------------------------
}
}
......@@ -13,40 +13,127 @@ namespace cpdoccore {
namespace odf_reader {
// math
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * math::ns = L"";
const wchar_t * math::name = L"math";
// math:math
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * math_math::ns = L"math";
const wchar_t * math_math::name = L"math";
//---------------------------------------------------------------
const wchar_t * office_math::ns = L"math";
const wchar_t * office_math::name = L"math";
void math::add_attributes( const xml::attributes_wc_ptr & Attributes )
//----------------------------------------------------------------------------------------------------
void office_math::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void office_math::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
if CP_CHECK_NAME1(L"semantics")
{
CP_CREATE_ELEMENT(semantics_);
}
}
void office_math::docx_convert(oox::docx_conversion_context & Context)
{
if (semantics_)
semantics_->docx_convert(Context);
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_semantics::ns = L"math";
const wchar_t * math_semantics::name = L"semantics";
//----------------------------------------------------------------------------------------------------
void math_semantics::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_semantics::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
if CP_CHECK_NAME1(L"annotation")
{
CP_CREATE_ELEMENT(annotation_);
}
else
CP_CREATE_ELEMENT(content_);
}
void math_semantics::docx_convert(oox::docx_conversion_context & Context)
{
Context.start_math_formula();
BOOST_FOREACH(const office_element_ptr & elm, content_)
{
elm->docx_convert(Context);
}
Context.end_math_formula();
}
void math::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
//----------------------------------------------------------------------------------------------------
const wchar_t * math_annotation::ns = L"math";
const wchar_t * math_annotation::name = L"annotation";
//----------------------------------------------------------------------------------------------------
void math_annotation::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_NOT_APPLICABLE_ELM();
// ver 2
CP_APPLY_ATTR(L"math:encoding", encoding_);
// ver 3
if (!encoding_) CP_APPLY_ATTR(L"encoding", encoding_);
}
void math_annotation::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math::docx_convert(oox::docx_conversion_context & Context)
void math_annotation::add_text(const std::wstring & Text)
{
text_ = Text;
}
void math_annotation::docx_convert(oox::docx_conversion_context & Context)
{
}
void math::xlsx_convert(oox::xlsx_conversion_context & Context)
//----------------------------------------------------------------------------------------------------
const wchar_t * math_annotation_xml::ns = L"math";
const wchar_t * math_annotation_xml::name = L"annotation-xml";
//----------------------------------------------------------------------------------------------------
void math_annotation_xml::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
// ver 2
CP_APPLY_ATTR(L"math:encoding", encoding_);
// ver 3
if (!encoding_) CP_APPLY_ATTR(L"encoding", encoding_);
}
void math::pptx_convert(oox::pptx_conversion_context & Context)
void math_annotation_xml::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_annotation_xml::add_text(const std::wstring & Text)
{
text_ = Text;
}
void math_annotation_xml::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
}
}
#pragma once
#include "math_elementaries.h"
#include "math_token_elements.h"
#include "math_table_elements.h"
#include "math_limit_elements.h"
#include "math_layout_elements.h"
#include <iosfwd>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
......@@ -10,7 +16,7 @@
namespace cpdoccore {
namespace odf_reader {
class math : public office_element_impl<math>
class office_math : public office_element_impl<office_math>
{
public:
static const wchar_t * ns;
......@@ -21,33 +27,101 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr semantics_;
};
CP_REGISTER_OFFICE_ELEMENT2(math);
CP_REGISTER_OFFICE_ELEMENT2(office_math);
CP_REGISTER_OFFICE_ELEMENT3(office_math);
//--------------------------------------------------------------------
class math_math : public math
class math_semantics : public office_element_impl<math_semantics>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMathMath;
static const ElementType type = typeMathSemantics;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
office_element_ptr annotation_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_math);
CP_REGISTER_OFFICE_ELEMENT2(math_semantics);
CP_REGISTER_OFFICE_ELEMENT3(math_semantics);
//-------------------------------------------------------------------------------------------
class math_annotation : public office_element_impl<math_annotation>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMathAnnotation;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
office_element_ptr_array content_;
_CP_OPT(std::wstring) text_;
_CP_OPT(std::wstring) encoding_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_annotation);
CP_REGISTER_OFFICE_ELEMENT3(math_annotation);
//--------------------------------------------------------------------
class math_annotation_xml : public office_element_impl<math_annotation_xml>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
office_element_ptr_array content_;
_CP_OPT(std::wstring) text_;
_CP_OPT(std::wstring) encoding_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_annotation_xml);
CP_REGISTER_OFFICE_ELEMENT3(math_annotation_xml);
//--------------------------------------------------------------------
}
}
#include "math_layout_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
namespace cpdoccore {
using namespace odf_types;
namespace odf_reader {
//---------------------------------------------------------------
const wchar_t * math_mrow::ns = L"math";
const wchar_t * math_mrow::name = L"mrow";
//----------------------------------------------------------------------------------------------------
void math_mrow::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mrow::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mrow::docx_convert(oox::docx_conversion_context & Context)
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
{
elm->docx_convert(Context);
}
}
//---------------------------------------------------------------
const wchar_t * math_mfrac::ns = L"math";
const wchar_t * math_mfrac::name = L"mfrac";
//----------------------------------------------------------------------------------------------------
void math_mfrac::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mfrac::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mfrac::docx_convert(oox::docx_conversion_context & Context)
{
if (content_.size() != 2)
{
return;
}
Context.output_stream() << L"<m:f>";
Context.output_stream() << L"<m:num>";
content_[0]->docx_convert(Context);
Context.output_stream() << L"</m:num>";
Context.output_stream() << L"<m:den>";
content_[1]->docx_convert(Context);
Context.output_stream() << L"</m:den>";
Context.output_stream() << L"</m:f>";
}
//---------------------------------------------------------------
const wchar_t * math_msqrt::ns = L"math";
const wchar_t * math_msqrt::name = L"msqrt";
//----------------------------------------------------------------------------------------------------
void math_msqrt::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_msqrt::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_msqrt::docx_convert(oox::docx_conversion_context & Context)
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
{
elm->docx_convert(Context);
}
}
//---------------------------------------------------------------
const wchar_t * math_mroot::ns = L"math";
const wchar_t * math_mroot::name = L"mroot";
//----------------------------------------------------------------------------------------------------
void math_mroot::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mroot::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mroot::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_mstyle::ns = L"math";
const wchar_t * math_mstyle::name = L"mstyle";
//----------------------------------------------------------------------------------------------------
void math_mstyle::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
// ver 2
CP_APPLY_ATTR(L"math:fontweight", fontweight_);
// ver 3
if (!fontweight_) CP_APPLY_ATTR( L"fontweight", fontweight_);
}
void math_mstyle::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mstyle::docx_convert(oox::docx_conversion_context & Context)
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
{
elm->docx_convert(Context);
}
}
//---------------------------------------------------------------
const wchar_t * math_menclose::ns = L"math";
const wchar_t * math_menclose::name = L"menclose";
//----------------------------------------------------------------------------------------------------
void math_menclose::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
//// ver 2
// CP_APPLY_ATTR(L"math:fontweight", fontweight_);
//
//// ver 3
// if (!fontweight_) CP_APPLY_ATTR( L"fontweight", fontweight_);
}
void math_menclose::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_menclose::docx_convert(oox::docx_conversion_context & Context)
{
//BOOST_FOREACH(const office_element_ptr & elm, content_)
//{
// elm->docx_convert(Context);
//}
}
//---------------------------------------------------------------
const wchar_t * math_mfenced::ns = L"math";
const wchar_t * math_mfenced::name = L"mfenced";
//----------------------------------------------------------------------------------------------------
void math_mfenced::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
//// ver 2
// CP_APPLY_ATTR(L"math:fontweight", fontweight_);
//
//// ver 3
// if (!fontweight_) CP_APPLY_ATTR( L"fontweight", fontweight_);
}
void math_mfenced::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mfenced::docx_convert(oox::docx_conversion_context & Context)
{
//BOOST_FOREACH(const office_element_ptr & elm, content_)
//{
// elm->docx_convert(Context);
//}
}
//---------------------------------------------------------------
const wchar_t * math_mpadded::ns = L"mpadded";
const wchar_t * math_mpadded::name = L"mpadded";
//----------------------------------------------------------------------------------------------------
void math_mpadded::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
//// ver 2
// CP_APPLY_ATTR(L"math:fontweight", fontweight_);
//
//// ver 3
// if (!fontweight_) CP_APPLY_ATTR( L"fontweight", fontweight_);
}
void math_mpadded::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mpadded::docx_convert(oox::docx_conversion_context & Context)
{
}
}
}
#pragma once
#include <iosfwd>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements_create.h"
#include "datatypes/common_attlists.h"
#include "datatypes/fontstyle.h"
#include "datatypes/fontweight.h"
namespace cpdoccore {
using namespace odf_types;
namespace odf_reader {
class math_mrow : public office_element_impl<math_mrow>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMRow;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mrow);
CP_REGISTER_OFFICE_ELEMENT3(math_mrow);
//--------------------------------------------------------------------------------------
class math_mfrac : public office_element_impl<math_mfrac>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_; //2 elements
_CP_OPT(length) linethickness;
//numalign left, central,right
//denomalign
_CP_OPT(Bool) bevelled;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mfrac);
CP_REGISTER_OFFICE_ELEMENT3(math_mfrac);
//--------------------------------------------------------------------------------------
class math_msqrt : public office_element_impl<math_msqrt>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_msqrt);
CP_REGISTER_OFFICE_ELEMENT3(math_msqrt);
//--------------------------------------------------------------------------------------
class math_mroot : public office_element_impl<math_mroot>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mroot);
CP_REGISTER_OFFICE_ELEMENT3(math_mroot);
//--------------------------------------------------------------------------------------
class math_mstyle : public office_element_impl<math_mstyle>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
_CP_OPT(font_weight) fontweight_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mstyle);
CP_REGISTER_OFFICE_ELEMENT3(math_mstyle);
//--------------------------------------------------------------------------------------
class math_menclose : public office_element_impl<math_menclose>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_menclose);
CP_REGISTER_OFFICE_ELEMENT3(math_menclose);
//--------------------------------------------------------------------------------------
class math_mfenced : public office_element_impl<math_mfenced>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mfenced);
CP_REGISTER_OFFICE_ELEMENT3(math_mfenced);
//--------------------------------------------------------------------------------------
class math_mpadded : public office_element_impl<math_mpadded>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mpadded);
CP_REGISTER_OFFICE_ELEMENT3(math_mpadded);
//--------------------------------------------------------------------------------------
//merror
//mphantom
}
}
#include "math_limit_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
namespace cpdoccore {
using namespace odf_types;
namespace odf_reader {
//---------------------------------------------------------------
const wchar_t * math_msub::ns = L"math";
const wchar_t * math_msub::name = L"msub";
//----------------------------------------------------------------------------------------------------
void math_msub::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_msub::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
//<msub> base subscript </msub>
CP_CREATE_ELEMENT(content_);
}
void math_msub::docx_convert(oox::docx_conversion_context & Context)
{
if (content_.size() != 2)
{
return;//todooo
}
std::wostream & strm = Context.output_stream();
strm << L"<m:sSub>";
strm << L"<m:e>";
content_[0]->docx_convert(Context);
strm << L"</m:e>";
strm << L"<m:sub>";
content_[1]->docx_convert(Context);
strm << L"</m:sub>";
strm << L"</m:sSub>";
}
//---------------------------------------------------------------
const wchar_t * math_msup::ns = L"math";
const wchar_t * math_msup::name = L"msup";
//----------------------------------------------------------------------------------------------------
void math_msup::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_msup::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_msup::docx_convert(oox::docx_conversion_context & Context)
{
if (content_.size() != 2)
{
return;//todooo
}
std::wostream & strm = Context.output_stream();
strm << L"<m:sSup>";
strm << L"<m:e>";
content_[0]->docx_convert(Context);
strm << L"</m:e>";
strm << L"<m:sup>";
content_[1]->docx_convert(Context);
strm << L"</m:sup>";
strm << L"</m:sSup>";
}
//---------------------------------------------------------------
const wchar_t * math_msubsup::ns = L"math";
const wchar_t * math_msubsup::name = L"msubsup";
//----------------------------------------------------------------------------------------------------
void math_msubsup::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_msubsup::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_msubsup::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_none::ns = L"math";
const wchar_t * math_none::name = L"none";
//----------------------------------------------------------------------------------------------------
void math_none::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_none::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_none::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_mprescripts::ns = L"math";
const wchar_t * math_mprescripts::name = L"mprescripts";
//----------------------------------------------------------------------------------------------------
void math_mprescripts::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mprescripts::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mprescripts::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_mmultiscripts::ns = L"math";
const wchar_t * math_mmultiscripts::name = L"mmultiscripts";
//----------------------------------------------------------------------------------------------------
void math_mmultiscripts::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mmultiscripts::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mmultiscripts::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_munderover::ns = L"math";
const wchar_t * math_munderover::name = L"munderover";
//----------------------------------------------------------------------------------------------------
void math_munderover::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_munderover::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_munderover::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_mover::ns = L"math";
const wchar_t * math_mover::name = L"mover";
//----------------------------------------------------------------------------------------------------
void math_mover::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mover::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mover::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------
const wchar_t * math_munder::ns = L"math";
const wchar_t * math_munder::name = L"munder";
//----------------------------------------------------------------------------------------------------
void math_munder::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_munder::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_munder::docx_convert(oox::docx_conversion_context & Context)
{
}
}
}
#pragma once
#include <iosfwd>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements_create.h"
namespace cpdoccore {
namespace odf_reader {
class math_msub : public office_element_impl<math_msub>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_msub);
CP_REGISTER_OFFICE_ELEMENT3(math_msub);
//--------------------------------------------------------------------
class math_msup : public office_element_impl<math_msup>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_msup);
CP_REGISTER_OFFICE_ELEMENT3(math_msup);
//--------------------------------------------------------------------
class math_msubsup : public office_element_impl<math_msubsup>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_msubsup);
CP_REGISTER_OFFICE_ELEMENT3(math_msubsup);
//--------------------------------------------------------------------
class math_none : public office_element_impl<math_none>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_none);
CP_REGISTER_OFFICE_ELEMENT3(math_none);
//--------------------------------------------------------------------
class math_mprescripts : public office_element_impl<math_mprescripts>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mprescripts);
CP_REGISTER_OFFICE_ELEMENT3(math_mprescripts);
//--------------------------------------------------------------------
class math_mmultiscripts : public office_element_impl<math_mmultiscripts>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mmultiscripts);
CP_REGISTER_OFFICE_ELEMENT3(math_mmultiscripts);
//--------------------------------------------------------------------
class math_munderover : public office_element_impl<math_munderover>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_munderover);
CP_REGISTER_OFFICE_ELEMENT3(math_munderover);
//--------------------------------------------------------------------
class math_mover : public office_element_impl<math_mover>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mover);
CP_REGISTER_OFFICE_ELEMENT3(math_mover);
//--------------------------------------------------------------------
class math_munder : public office_element_impl<math_munder>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_munder);
CP_REGISTER_OFFICE_ELEMENT3(math_munder);
//--------------------------------------------------------------------
}
}
#include "math_table_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
namespace cpdoccore {
using namespace odf_types;
namespace odf_reader {
//----------------------------------------------------------------------------------------------------
const wchar_t * math_mtable::ns = L"math";
const wchar_t * math_mtable::name = L"mtable";
//----------------------------------------------------------------------------------------------------
void math_mtable::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mtable::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mtable::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_mtr::ns = L"math";
const wchar_t * math_mtr::name = L"mtr";
//----------------------------------------------------------------------------------------------------
void math_mtr::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mtr::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mtr::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_mlabeledtr::ns = L"math";
const wchar_t * math_mlabeledtr::name = L"mlabeledtr";
//----------------------------------------------------------------------------------------------------
void math_mlabeledtr::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mlabeledtr::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mlabeledtr::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_mtd::ns = L"math";
const wchar_t * math_mtd::name = L"mtd";
//----------------------------------------------------------------------------------------------------
void math_mtd::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mtd::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mtd::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_maligngroup::ns = L"math";
const wchar_t * math_maligngroup::name = L"maligngroup";
//----------------------------------------------------------------------------------------------------
void math_maligngroup::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_maligngroup::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_maligngroup::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_malignmark::ns = L"math";
const wchar_t * math_malignmark::name = L"malignmarke";
//----------------------------------------------------------------------------------------------------
void math_malignmark::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_malignmark::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_malignmark::docx_convert(oox::docx_conversion_context & Context)
{
}
}
}
#pragma once
#include <iosfwd>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements_create.h"
namespace cpdoccore {
namespace odf_reader {
class math_mtable : public office_element_impl<math_mtable>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mtable);
CP_REGISTER_OFFICE_ELEMENT3(math_mtable);
//--------------------------------------------------------------------
class math_malignmark : public office_element_impl<math_malignmark>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_malignmark);
CP_REGISTER_OFFICE_ELEMENT3(math_malignmark);
//--------------------------------------------------------------------
class math_maligngroup : public office_element_impl<math_maligngroup>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_maligngroup);
CP_REGISTER_OFFICE_ELEMENT3(math_maligngroup);
//--------------------------------------------------------------------
class math_mtd : public office_element_impl<math_mtd>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mtd);
CP_REGISTER_OFFICE_ELEMENT3(math_mtd);
//--------------------------------------------------------------------
class math_mlabeledtr : public office_element_impl<math_mlabeledtr>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mlabeledtr);
CP_REGISTER_OFFICE_ELEMENT3(math_mlabeledtr);
//--------------------------------------------------------------------
class math_mtr : public office_element_impl<math_mtr>
{
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();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mtr);
CP_REGISTER_OFFICE_ELEMENT3(math_mtr);
//--------------------------------------------------------------------
}
}
#include "math_token_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <cpdoccore/xml/utils.h>
namespace cpdoccore {
using namespace odf_types;
namespace odf_reader {
//---------------------------------------------------------------
const wchar_t * math_mi::ns = L"math";
const wchar_t * math_mi::name = L"mi";
//----------------------------------------------------------------------------------------------------
void math_mi::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mi::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mi::add_text(const std::wstring & Text)
{
text_ = Text;
}
void math_mi::docx_convert(oox::docx_conversion_context & Context)
{
if (!text_) return;
std::wostream & strm = Context.output_stream();
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"m:r")
{
CP_XML_NODE(L"w:rPr")
{
CP_XML_NODE(L"w:rFonts")
{
CP_XML_ATTR(L"w:hAnsi", L"Cambria Math");
CP_XML_ATTR(L"w:ascii", L"Cambria Math");
}
}
CP_XML_NODE(L"m:t")
{
//CP_XML_ATTR(L"xml:space", L"preserve");
CP_XML_STREAM() << xml::utils::replace_text_to_xml( *text_ );
}
}
}
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_mo::ns = L"math";
const wchar_t * math_mo::name = L"mo";
//----------------------------------------------------------------------------------------------------
void math_mo::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mo::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mo::add_text(const std::wstring & Text)
{
text_ = Text;
}
void math_mo::docx_convert(oox::docx_conversion_context & Context)
{
if (!text_) return;
std::wostream & strm = Context.output_stream();
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"m:r")
{
CP_XML_NODE(L"w:rPr")
{
CP_XML_NODE(L"w:rFonts")
{
CP_XML_ATTR(L"w:hAnsi", L"Cambria Math");
CP_XML_ATTR(L"w:ascii", L"Cambria Math");
}
}
CP_XML_NODE(L"m:t")
{
//CP_XML_ATTR(L"xml:space", L"preserve");
CP_XML_STREAM() << xml::utils::replace_text_to_xml( *text_ );
}
}
}
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_mn::ns = L"math";
const wchar_t * math_mn::name = L"mn";
//----------------------------------------------------------------------------------------------------
void math_mn::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mn::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mn::add_text(const std::wstring & Text)
{
text_ = Text;
}
void math_mn::docx_convert(oox::docx_conversion_context & Context)
{
if (!text_) return;
std::wostream & strm = Context.output_stream();
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"m:r")
{
CP_XML_NODE(L"w:rPr")
{
CP_XML_NODE(L"w:rFonts")
{
CP_XML_ATTR(L"w:hAnsi", L"Cambria Math");
CP_XML_ATTR(L"w:ascii", L"Cambria Math");
}
}
CP_XML_NODE(L"m:t")
{
//CP_XML_ATTR(L"xml:space", L"preserve");
CP_XML_STREAM() << xml::utils::replace_text_to_xml( *text_ );
}
}
}
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_ms::ns = L"math";
const wchar_t * math_ms::name = L"ms";
//----------------------------------------------------------------------------------------------------
void math_ms::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_ms::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_ms::add_text(const std::wstring & Text)
{
text_ = Text;
}
void math_ms::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_mspace::ns = L"math";
const wchar_t * math_mspace::name = L"mspace";
//----------------------------------------------------------------------------------------------------
void math_mspace::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mspace::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mspace::add_text(const std::wstring & Text)
{
text_ = Text;
}
void math_mspace::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_mtext::ns = L"math";
const wchar_t * math_mtext::name = L"mtext";
//----------------------------------------------------------------------------------------------------
void math_mtext::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mtext::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mtext::add_text(const std::wstring & Text)
{
text_ = Text;
}
void math_mtext::docx_convert(oox::docx_conversion_context & Context)
{
}
//----------------------------------------------------------------------------------------------------
const wchar_t * math_mglyph::ns = L"math";
const wchar_t * math_mglyph::name = L"mglyph";
//----------------------------------------------------------------------------------------------------
void math_mglyph::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void math_mglyph::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void math_mglyph::add_text(const std::wstring & Text)
{
text_ = Text;
}
void math_mglyph::docx_convert(oox::docx_conversion_context & Context)
{
}
}
}
#pragma once
#include <iosfwd>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements_create.h"
namespace cpdoccore {
namespace odf_reader {
class math_mi : public office_element_impl<math_mi>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMI;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
office_element_ptr_array content_;
_CP_OPT(std::wstring) text_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mi);
CP_REGISTER_OFFICE_ELEMENT3(math_mi);
//--------------------------------------------------------------------
class math_mo : public office_element_impl<math_mo>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMO;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
office_element_ptr_array content_;
_CP_OPT(std::wstring) text_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mo);
CP_REGISTER_OFFICE_ELEMENT3(math_mo);
//--------------------------------------------------------------------
class math_mn : public office_element_impl<math_mn>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMN;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
office_element_ptr_array content_;
_CP_OPT(std::wstring) text_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mn);
CP_REGISTER_OFFICE_ELEMENT3(math_mn);
//--------------------------------------------------------------------
class math_mtext : public office_element_impl<math_mtext>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMText;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
office_element_ptr_array content_;
_CP_OPT(std::wstring) text_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mtext);
CP_REGISTER_OFFICE_ELEMENT3(math_mtext);
//--------------------------------------------------------------------
class math_mspace : public office_element_impl<math_mspace>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSpace;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
office_element_ptr_array content_;
_CP_OPT(std::wstring) text_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mspace);
CP_REGISTER_OFFICE_ELEMENT3(math_mspace);
//--------------------------------------------------------------------
class math_ms : public office_element_impl<math_ms>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMS;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
office_element_ptr_array content_;
_CP_OPT(std::wstring) text_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_ms);
CP_REGISTER_OFFICE_ELEMENT3(math_ms);
//--------------------------------------------------------------------
class math_mglyph : public office_element_impl<math_mglyph>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMGlyph;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
office_element_ptr_array content_;
_CP_OPT(std::wstring) text_;
};
CP_REGISTER_OFFICE_ELEMENT2(math_mglyph);
CP_REGISTER_OFFICE_ELEMENT3(math_mglyph);
//--------------------------------------------------------------------
}
}
......@@ -33,6 +33,7 @@
#include "templates.h"
#include "math_elements.h"
#include "paragraph_elements.h"
#include "text_elements.h"
......@@ -678,5 +679,9 @@ const office_element * odf_document::Impl::get_content() const
return content_xml_->get_content();
}
office_element * odf_document::Impl::get_content()
{
return content_xml_->get_content();
}
}
}
......@@ -31,7 +31,9 @@ public:
bool pptx_convert(oox::pptx_conversion_context & Context);
const std::wstring & get_folder() const { return base_folder_; }
const office_element * get_content() const;
const office_element * get_content() const;
office_element * get_content();
long get_office_mime_type() {return office_mime_type_;}
......
......@@ -23,7 +23,12 @@ typedef shared_ptr<office_element>::Type office_element_ptr;
#define CP_REGISTER_OFFICE_ELEMENT2(A) \
namespace { \
RegisterElement<A> RegisterElement##A;\
RegisterElement<A> RegisterElement##A(true);\
}
#define CP_REGISTER_OFFICE_ELEMENT3(A) \
namespace { \
RegisterElement<A> RegisterElement1##A(false);\
}
class office_element_creator
......@@ -62,20 +67,30 @@ private:
public:
static typename shared_ptr<V>::Type create()
{
//return shared_ptr<T>::Type( new T() );
return boost::make_shared<V>();
}
};
static int class_registered_;
static int class_registered_1_;
public:
RegisterElement()
RegisterElement(bool is_namespace)
{
if (class_registered_++ == 0)
{
// Jerry Schwarz counter
office_element_creator::get()->register_element(T::ns, T::name, &CreateImpl_<T>::create);
}
if (is_namespace)
{
if (class_registered_++ == 0)// Jerry Schwarz counter
{
office_element_creator::get()->register_element(T::ns, T::name, &CreateImpl_<T>::create);
}
}
else
{
if (class_registered_1_++ == 0)
{
std::wstring ns_;
office_element_creator::get()->register_element(ns_, T::name, &CreateImpl_<T>::create);
}
}
}
~RegisterElement()
......@@ -83,7 +98,9 @@ public:
}
};
template<class T> int RegisterElement<T>::class_registered_ = 0;
template<class T> int RegisterElement<T>::class_registered_ = 0; //with namespace
template<class T> int RegisterElement<T>::class_registered_1_ = 0; //without namespace
/// \brief SAX, shared_ptr
bool create_element_and_read(xml::sax * Reader,
......@@ -102,11 +119,12 @@ bool create_element_and_read(xml::sax * Reader,
bool isRoot = false);
#define CP_CREATE_ELEMENT_SIMPLE(ELEMENT) create_element_and_read(Reader, Ns, Name, (ELEMENT), Context)
#define CP_CREATE_ELEMENT(ELEMENT) create_element_and_read(Reader, Ns, Name, (ELEMENT), getContext())
#define _CPDOCCORE_CREATE_ELEMENT_ROOT(ELEMENT) create_element_and_read(Reader, Ns, Name, (ELEMENT), getContext(), true)
#define CP_CREATE_ELEMENT_SIMPLE(ELEMENT) create_element_and_read(Reader, Ns, Name, (ELEMENT), Context)
#define CP_CREATE_ELEMENT(ELEMENT) create_element_and_read(Reader, Ns, Name, (ELEMENT), getContext())
#define _CPDOCCORE_CREATE_ELEMENT_ROOT(ELEMENT) create_element_and_read(Reader, Ns, Name, (ELEMENT), getContext(), true)
#define CP_CHECK_NAME(NS, NAME) ((NS) == Ns && (NAME) == Name)
#define CP_CHECK_NAME1(NAME) ((NAME) == Name)
void not_applicable_element(const office_element * CurrentElm, xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
void not_applicable_element(const std::wstring & Current, xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
......
......@@ -170,7 +170,48 @@ enum ElementType
typeOfficeDocumentSettings,
typeMath,
typeMathMath,
typeMathSemantics,
typeMathAnnotation,
typeMathAnnotationXml,
typeMN,
typeMI,
typeMS,
typeMSpace,
typeMO,
typeMText,
typeMGlyph,
typeMSqrt,
typeMRoot,
typeMFrac,
typeMRow,
typeMStyle,
typeMEnClose,
typeMFenced,
typeMPadded,
typeMError,
typeMPhantom,
typeMTable,
typeMAlignMark,
typeMAlignGroup,
typeMTd,
typeMLabelEdTr,
typeMTr,
typeMSub,
typeMSup,
typeMSubSup,
typeMNone,
typeMPreScripts,
typeMMultiScripts,
typeMUnderOver,
typeMOver,
typeMUnder,
typeMStack,
typeMSRow,
typeMSLine,
typeMSCarry,
typeMSCarries,
typeMSGroup,
typeMSLongDiv,
typeManifest,
typeManifestEntry,
......
......@@ -52,7 +52,7 @@ const wchar_t * text::name = L"";
void text::add_text(const std::wstring & Text)
{
text_ = Text;
};
}
void text::docx_convert(oox::docx_conversion_context & Context)
{
......@@ -347,7 +347,7 @@ void span::docx_convert(oox::docx_conversion_context & Context)
}
else
{
const std::wstring id = Context.get_style_map().get( styleInst->name(), styleInst->type() );
const std::wstring id = Context.styles_map_.get( styleInst->name(), styleInst->type() );
Context.add_new_run(id);
addNewRun = true;
}
......@@ -465,7 +465,7 @@ void a::docx_convert(oox::docx_conversion_context & Context)
}
else
{
const std::wstring id = Context.get_style_map().get( styleInst->name(), styleInst->type() );
const std::wstring id = Context.styles_map_.get( styleInst->name(), styleInst->type() );
tempStyleTextProp = style_text_properties_ptr( new style_text_properties(id) );
Context.push_text_properties( tempStyleTextProp.get() );
pushed = true;
......@@ -573,7 +573,7 @@ void note::docx_convert(oox::docx_conversion_context & Context)
= Context.root()->odf_context().styleContainer().style_by_name(styleName, style_family::Text,Context.process_headers_footers_)
)
{
const std::wstring id = Context.get_style_map().get( styleInst->name(), styleInst->type() );
const std::wstring id = Context.styles_map_.get( styleInst->name(), styleInst->type() );
Context.add_new_run(id);
addNewRun = true;
}
......
......@@ -833,7 +833,7 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
if (style_text_position_->has_font_size() && !noNeedSize)
{
const double mul = style_text_position_->font_size().get_value() / 100.0;
if (fontSizeVal > 0 && mul > 0)
if (fontSizeVal > 0)
{
const std::wstring fontSize = boost::lexical_cast<std::wstring>((int)(fontSizeVal * mul + 0.5));
if (!fontSize.empty())
......@@ -870,8 +870,7 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
if (fontSize>0)
{
std::wstring str_fontSize = boost::lexical_cast<std::wstring>(fontSize);
_rPr << L"<w:sz w:val=\"" << str_fontSize << "\" />";
_rPr << L"<w:sz w:val=\"" << fontSize << "\" />";
}
}
......
......@@ -1409,7 +1409,6 @@ xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\"
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
......@@ -1427,7 +1426,6 @@ xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
......
......@@ -119,7 +119,7 @@ int process_paragraph_attr(const paragraph_attrs & Attr, oox::docx_conversion_co
std::wstring id;
if (const style_instance * parentStyleContent = styleInst->parent())
{
id = Context.get_style_map().get( parentStyleContent->name(), parentStyleContent->type() );
id = Context.styles_map_.get( parentStyleContent->name(), parentStyleContent->type() );
}
Context.start_automatic_style(id);
......@@ -153,7 +153,7 @@ int process_paragraph_attr(const paragraph_attrs & Attr, oox::docx_conversion_co
}
else
{
const std::wstring id = Context.get_style_map().get( styleInst->name(), styleInst->type() );
const std::wstring id = Context.styles_map_.get( styleInst->name(), styleInst->type() );
std::wostream & _Wostream = Context.output_stream();
_Wostream << L"<w:pPr>";
_Wostream << Context.get_section_context().dump_;
......
......@@ -5,12 +5,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml_wrapper", "cpxml.vcproj
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFormatReaderLib", "cpodf.vcproj", "{50E20601-4A8D-4AFB-8870-63828D328429}"
ProjectSection(ProjectDependencies) = postProject
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{94954A67-A853-43B1-A727-6EF2774C5A6A} = {94954A67-A853-43B1-A727-6EF2774C5A6A}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{609ED938-3CA8-4BED-B363-25096D4C4812} = {609ED938-3CA8-4BED-B363-25096D4C4812}
{41BED424-4EAF-4053-8A5F-1E2A387D53D1} = {41BED424-4EAF-4053-8A5F-1E2A387D53D1}
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfCommon", "cpcommon.vcproj", "{609ED938-3CA8-4BED-B363-25096D4C4812}"
......@@ -29,9 +28,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeOdfFile", "..\ASCO
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeOdfFileTest", "..\Test\ASCOfficeOdfFileTest\ASCOfficeOdfFileTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}"
ProjectSection(ProjectDependencies) = postProject
{64B09C98-22DC-494E-A882-9E2D7D18557C} = {64B09C98-22DC-494E-A882-9E2D7D18557C}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\..\Common\DocxFormat\Source\XML\libxml2\win_build\libxml2.vcproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
EndProject
......
......@@ -1359,6 +1359,14 @@
RelativePath="..\src\odf\list.h"
>
</File>
<File
RelativePath="..\src\odf\math_elementaries.cpp"
>
</File>
<File
RelativePath="..\src\odf\math_elementaries.h"
>
</File>
<File
RelativePath="..\src\odf\math_elements.cpp"
>
......@@ -1375,6 +1383,38 @@
RelativePath="..\src\odf\math_elements.h"
>
</File>
<File
RelativePath="..\src\odf\math_layout_elements.cpp"
>
</File>
<File
RelativePath="..\src\odf\math_layout_elements.h"
>
</File>
<File
RelativePath="..\src\odf\math_limit_elements.cpp"
>
</File>
<File
RelativePath="..\src\odf\math_limit_elements.h"
>
</File>
<File
RelativePath="..\src\odf\math_table_elements.cpp"
>
</File>
<File
RelativePath="..\src\odf\math_table_elements.h"
>
</File>
<File
RelativePath="..\src\odf\math_token_elements.cpp"
>
</File>
<File
RelativePath="..\src\odf\math_token_elements.h"
>
</File>
<File
RelativePath="..\src\odf\note.cpp"
>
......
......@@ -7,23 +7,23 @@
class RtfDocument :public ItemContainer<RtfSectionPtr>
{
public:
RtfDocumentProperty m_oProperty;
RtfFontTable m_oFontTable;
RtfColorTable m_oColorTable;
RtfStyleTable m_oStyleTable;
RtfInformation m_oInformation;
RtfDocumentProperty m_oProperty;
RtfFontTable m_oFontTable;
RtfColorTable m_oColorTable;
RtfStyleTable m_oStyleTable;
RtfInformation m_oInformation;
RtfListTable m_oListTabel;
RtfListOverrideTable m_oListOverrideTabel;
RtfListTable m_oListTabel;
RtfListOverrideTable m_oListOverrideTabel;
RtfParagraphProperty m_oDefaultParagraphProp;
RtfCharProperty m_oDefaultCharProp;
RtfMathProperty m_oMathProp;
RtfParagraphProperty m_oDefaultParagraphProp;
RtfCharProperty m_oDefaultCharProp;
RtfMathProperty m_oMathProp;
TextItemContainerPtr m_oFootnoteSep;
TextItemContainerPtr m_oFootnoteCon;
TextItemContainerPtr m_oEndnoteSep;
TextItemContainerPtr m_oEndnoteCon;
TextItemContainerPtr m_oFootnoteSep;
TextItemContainerPtr m_oFootnoteCon;
TextItemContainerPtr m_oEndnoteSep;
TextItemContainerPtr m_oEndnoteCon;
//для того чтобы конвертировать старый формат List в Numbering
std::vector<RtfOldListPtr> m_aOldLists;
......
......@@ -1870,14 +1870,14 @@ public:
DEFAULT_PROPERTY( m_nWidth )
m_eMUWidth = mu_none;
m_nDefCellMarBottom = 0;
m_nDefCellMarRight = 108;
m_nDefCellMarLeft = 108;
m_nDefCellMarTop = 0;
//DEFAULT_PROPERTY( m_nDefCellMarBottom )
//DEFAULT_PROPERTY( m_nDefCellMarRight )
//DEFAULT_PROPERTY( m_nDefCellMarLeft )
//DEFAULT_PROPERTY( m_nDefCellMarTop )
//m_nDefCellMarBottom = 0;
//m_nDefCellMarRight = 108;
//m_nDefCellMarLeft = 108;
//m_nDefCellMarTop = 0;
DEFAULT_PROPERTY( m_nDefCellMarBottom )
DEFAULT_PROPERTY( m_nDefCellMarRight )
DEFAULT_PROPERTY( m_nDefCellMarLeft )
DEFAULT_PROPERTY( m_nDefCellMarTop )
m_nDefCellMarBottomUnits = 3;
m_nDefCellMarRightUnits = 3;
......@@ -2170,7 +2170,8 @@ public:
RtfBorder m_oBorderInsideH;
RtfBorder m_oBorderInsideV;
RtfShadingCell m_oShading;
RtfShadingCell m_oShading;
int m_nShadingPctFrom;
typedef enum{ ca_none,
ca_Top, //\clvertalt Text is top-aligned in cell (the default).
......@@ -2256,7 +2257,9 @@ public:
m_oBorderBottom.SetDefault();
m_oBorderInsideH.SetDefault();
m_oBorderInsideV.SetDefault();
m_oShading.SetDefault();
DEFAULT_PROPERTY( m_nShadingPctFrom )
m_eAlign = ca_none;
m_oCellFlow = cf_none;
......@@ -2324,6 +2327,7 @@ public:
m_oBorderInsideV.Merge( oCellPr.m_oBorderInsideV );
m_oShading.Merge( oCellPr.m_oShading );
MERGE_PROPERTY ( m_nShadingPctFrom, oCellPr)
MERGE_PROPERTY_DEF( m_eAlign, oCellPr, ca_none )
MERGE_PROPERTY_DEF( m_oCellFlow, oCellPr, cf_none )
......
......@@ -95,13 +95,39 @@ CString OOXDocumentWriter::CreateXmlEnd( )
OOXNumberingWriter* poNumberingWriter = static_cast<OOXNumberingWriter*>( m_oWriter.m_poNumberingWriter );
oNewParam.poRels = poNumberingWriter->m_oRelsWriter.get();
oNewParam.nType = RENDER_TO_OOX_PARAM_NUMBERING;
poNumberingWriter->AddNumbering( m_oDocument.m_oListTabel.RenderToOOX(oNewParam) );
poNumberingWriter->AddNumbering( m_oDocument.m_oListOverrideTabel.RenderToOOX(oNewParam) );
//style.xml
OOXStylesWriter* poStylesWriter = static_cast<OOXStylesWriter*>( m_oWriter.m_poStylesWriter );
oNewParam.poRels = poNumberingWriter->m_oRelsWriter.get();
oNewParam.nType = RENDER_TO_OOX_PARAM_NUMBERING;
oNewParam.nType = RENDER_TO_OOX_PARAM_STYLES;
CString sStyles;
CString sTempParaDef = m_oDocument.m_oDefaultParagraphProp.RenderToOOX(oNewParam);
CString sTempCharDef = m_oDocument.m_oDefaultCharProp.RenderToOOX(oNewParam);
if( false == sTempParaDef.IsEmpty() || false == sTempCharDef.IsEmpty() )
{
sStyles += _T("<w:docDefaults>");
if( false == sTempParaDef.IsEmpty() )
{
sStyles += _T("<w:pPrDefault><w:pPr>");
sStyles += sTempParaDef;
sStyles += _T("</w:pPr></w:pPrDefault>");
}
if( false == sTempCharDef.IsEmpty() )
{
sStyles += _T("<w:rPrDefault><w:rPr>");
sStyles += sTempCharDef ;
sStyles += _T("</w:rPr></w:rPrDefault>");
}
sStyles.Append(_T("</w:docDefaults>"));
}
sStyles += m_oDocument.m_oStyleTable.RenderToOOX(oNewParam);
poStylesWriter->AddContent(sStyles);
//core.xml
oNewParam.poRels = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment