Commit c9aee26f authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent 32d3c0e6
......@@ -144,7 +144,8 @@ void styles_context::docx_serialize_table_style(std::wostream & strm, std::wstri
}
namespace oox
{
math_context::math_context(odf_reader::fonts_container & fonts, bool graphic) : base_font_size_(12), fonts_container_(fonts)
math_context::math_context(odf_reader::fonts_container & fonts, bool graphic) :
base_font_size_(12), fonts_container_(fonts)
{
graphRPR_ = graphic;
......
......@@ -57,9 +57,25 @@ namespace svg_path
{
CP_XML_NODE(val.command)
{
for (size_t i = 0; i < val.points.size(); i++)
{
oox_serialize(CP_XML_STREAM(), val.points[i]);
if (val.command == L"a:ArcTo")
{
if (val.points.size() > 0)
{
CP_XML_ATTR(L"wR", (int)(val.points[0].x.get()));
CP_XML_ATTR(L"hR", (int)(val.points[0].y.get()));
}
if (val.points.size() > 1)
{
CP_XML_ATTR(L"stAng", (int)(val.points[1].x.get() * 60000));
CP_XML_ATTR(L"swAng", (int)(val.points[1].y.get() * 60000));
}
}
else
{
for (size_t i = 0; i < val.points.size(); i++)
{
oox_serialize(CP_XML_STREAM(), val.points[i]);
}
}
}
}
......@@ -342,13 +358,14 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
void _oox_drawing::serialize_shape(std::wostream & strm)
{
_CP_OPT(std::wstring) strVal;
_CP_OPT(std::wstring) strVal, strPath;
_CP_OPT(double) dVal;
std::wstring shapeType;
_CP_OPT(bool) bWordArt;
odf_reader::GetProperty(additional,L"wordArt", bWordArt);
odf_reader::GetProperty(additional, L"custom_path", strPath);
if (sub_type == 7)//custom
{
......@@ -373,9 +390,10 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
if (bWordArt) sub_type = 1;
CP_XML_WRITER(strm)
{
if (sub_type == 6 || sub_type == 8)
if ((sub_type == 6 || sub_type == 8) && strPath && !strPath->empty())
{
CP_XML_NODE(L"a:custGeom")
{
......@@ -391,31 +409,28 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
CP_XML_ATTR(L"t", 0);
}
//<a:rect b="b" l="0" r="r" t="0"/>
if (odf_reader::GetProperty(additional, L"custom_path", strVal))
{
_CP_OPT(int) w, h;
odf_reader::GetProperty(additional, L"custom_path_w", w);
odf_reader::GetProperty(additional, L"custom_path_h", h);
_CP_OPT(int) w, h;
odf_reader::GetProperty(additional, L"custom_path_w", w);
odf_reader::GetProperty(additional, L"custom_path_h", h);
CP_XML_NODE(L"a:pathLst")
{
CP_XML_NODE(L"a:path")
{
CP_XML_ATTR(L"w", w ? *w : cx);
CP_XML_ATTR(L"h", h ? *h : cy);
CP_XML_STREAM() << strVal.get();
}
CP_XML_NODE(L"a:pathLst")
{
CP_XML_NODE(L"a:path")
{
CP_XML_ATTR(L"w", w ? *w : cx);
CP_XML_ATTR(L"h", h ? *h : cy);
CP_XML_STREAM() << *strPath;
}
}
}
}
}
else
{
if (shapeType.length() < 1)
if (shapeType.empty())
{
shapeType = L"rect";
sub_type = 2;
shapeType = L"rect";
sub_type = 2;
}
CP_XML_NODE(L"a:prstGeom")//автофигура
{
......
......@@ -317,77 +317,58 @@ void xlsx_text_context::Impl::write_rPr(std::wostream & strm)
ApplyTextProperties (span_style_name_, paragraph_style_name_, text_properties_);
_CP_OPT(double) dValFontSize;
if (text_properties_.fo_font_size_)
dValFontSize=text_properties_.fo_font_size_->get_length().get_value();
_CP_OPT(std::wstring) sValFontFamily;
if (text_properties_.fo_font_family_)
if (in_draw)
{
std::wstring val =text_properties_.fo_font_family_.get();
//'Arial' глючит
removeCharsFromString(val, _T("'"));
sValFontFamily=text_properties_.fo_font_family_.get();
odf_reader::fonts_container fonts;
text_properties_.drawing_serialize(strm, L"a:rPr", fonts);
}
//else if (text_properties_.style_font_name_) - тут может быть отсылка к font_face)decl !!!!
// sValFontFamily=text_properties_.style_font_name_.get();
_CP_OPT(std::wstring) sValFontColor;
if (text_properties_.fo_color_)
sValFontColor=text_properties_.fo_color_->get_hex_value();
_CP_OPT(int) iValFontWeight;
if (text_properties_.fo_font_weight_)
iValFontWeight=text_properties_.fo_font_weight_->get_type();
_CP_OPT(int) iValFontStyle;
if(text_properties_.fo_font_style_)
iValFontStyle=text_properties_.fo_font_style_->get_type();
CP_XML_WRITER(strm)
{
if (in_draw)
else
{
CP_XML_WRITER(strm)
{
//oox_serialize_style_text(strm,text_properties_);
//oox_serialize_style_text(strm,odf_reader::text_format_properties_content & properties);
CP_XML_NODE(L"a:rPr")
CP_XML_NODE(L"rPr")
{
//стр 3197
if (dValFontSize) {CP_XML_ATTR(L"sz", (int)(dValFontSize.get()*100));}
if ((iValFontStyle) && (iValFontStyle.get() >0)) {CP_XML_ATTR(L"i", "1");} //"true");} Exercícios de Aprendizagem.ods
if ((iValFontWeight) && (iValFontWeight.get() >0)) {CP_XML_ATTR(L"b", "1");} //"true");} Exercícios de Aprendizagem.ods
if (sValFontColor)
if (text_properties_.fo_font_family_)
{
CP_XML_NODE(L"a:solidFill") {CP_XML_NODE(L"a:srgbClr"){CP_XML_ATTR(L"val", sValFontColor.get());}}
CP_XML_NODE(L"rFont")
{
CP_XML_ATTR(L"val", text_properties_.fo_font_family_.get());
}
}
if (sValFontFamily)
if (text_properties_.fo_font_size_)
{
CP_XML_NODE(L"a:latin"){CP_XML_ATTR(L"typeface", sValFontFamily.get());}
}
if (hyperlink_hId.length()>0)
CP_XML_NODE(L"sz")
{
CP_XML_ATTR(L"val", (int)text_properties_.fo_font_size_->get_length().get_value());
}
}
if (text_properties_.fo_color_)
{
CP_XML_NODE(L"a:hlinkClick ")
CP_XML_NODE(L"color")
{
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR(L"r:id", hyperlink_hId);
CP_XML_ATTR(L"rgb", text_properties_.fo_color_->get_hex_value());
}
}
if (text_properties_.fo_font_style_)
{
CP_XML_NODE(L"i")
{
if (text_properties_.fo_font_style_->get_type() > 0)
CP_XML_ATTR(L"val", "true");
else
CP_XML_ATTR(L"val", "false");
}
}
if (text_properties_.fo_font_weight_)
{
CP_XML_NODE(L"b")
{
if (text_properties_.fo_font_weight_->get_type() > 0)
CP_XML_ATTR(L"val", "true");
else
CP_XML_ATTR(L"val", "false");
}
}
}
}
else
{
CP_XML_NODE(L"rPr")
{
if (sValFontFamily) {CP_XML_NODE(L"rFont") {CP_XML_ATTR(L"val", sValFontFamily.get());}}
if (dValFontSize) {CP_XML_NODE(L"sz") {CP_XML_ATTR(L"val", (int)(dValFontSize.get()));}}
if (sValFontColor) {CP_XML_NODE(L"color") {CP_XML_ATTR(L"rgb", sValFontColor.get());}}
if ((iValFontStyle) &&
(iValFontStyle.get() >0)) {CP_XML_NODE(L"i") {CP_XML_ATTR(L"val", "true");}}
if ((iValFontWeight) &&
(iValFontWeight.get() >0)) {CP_XML_NODE(L"b") {CP_XML_ATTR(L"val", "true");}}
}
}
}
......
......@@ -54,10 +54,9 @@ class xlsx_conversion_context;
class xlsx_text_context: boost::noncopyable
{
public:
//xlsx_text_context();
xlsx_text_context(odf_reader::styles_container & styles_);
~xlsx_text_context();
public:
xlsx_text_context (odf_reader::styles_container & styles_);
~xlsx_text_context ();
void set_local_styles_container (odf_reader::styles_container *local_styles_);
void set_cell_text_properties (odf_reader::text_format_properties_content *text_properties);
......
......@@ -259,7 +259,7 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
shape->sub_type_ = sub_type_.get();
set_shape = true;
}
std::wstring odf_path;
std::wstring odf_path; //общая часть - объединить ...
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
......@@ -280,7 +280,7 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
res = false;
}
if (o_Polyline.size() > 1 && res )
if (!o_Polyline.empty() && res )
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std::wstringstream output_;
......
......@@ -325,7 +325,13 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
set_shape = true;
}
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
std::wstring odf_path;
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
if (!odf_path.empty())
{
std::vector<::svg_path::_polyline> o_Polyline;
......@@ -333,7 +339,7 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
try
{
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
res = ::svg_path::parseSvgD(o_Polyline, odf_path, true);
}
catch(...)
{
......
......@@ -269,7 +269,13 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
Context.get_drawing_context().start_shape(sub_type_.get());
}
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
std::wstring odf_path;
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
if (!odf_path.empty())
{
std::vector<::svg_path::_polyline> o_Polyline;
......@@ -277,7 +283,7 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
try
{
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
res = ::svg_path::parseSvgD(o_Polyline, odf_path, true);
}
catch(...)
{
......
......@@ -292,7 +292,7 @@ void math_mstyle::oox_convert(oox::math_context & Context)
{
CP_XML_NODE(L"m:ctrlPr")
{
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
}
}
}
......@@ -317,7 +317,7 @@ void math_mstyle::oox_convert(oox::math_context & Context)
{
CP_XML_NODE(L"m:ctrlPr")
{
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
}
}
}
......
......@@ -114,7 +114,7 @@ void math_mi::oox_convert(oox::math_context & Context)
}
}
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
CP_XML_NODE(L"m:t")
{
......@@ -162,7 +162,7 @@ void math_mo::oox_convert(oox::math_context & Context)
{
// + доп стили текста ... todoooo
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
CP_XML_NODE(L"m:t")
{
......@@ -203,7 +203,7 @@ void math_mn::oox_convert(oox::math_context & Context)
{
// + доп стили текста ... todoooo
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
CP_XML_NODE(L"m:t")
{
......
......@@ -311,25 +311,23 @@ void text_format_properties_content::pptx_convert_as_list(oox::pptx_conversion_c
}
}
}
void text_format_properties_content::pptx_convert(oox::pptx_conversion_context & Context)
void text_format_properties_content::drawing_serialize(std::wostream & strm, std::wstring node, fonts_container & fonts, const odf_reader::style_instance *current_style, std::wstring hlink)
{
styles_context & styles_context_ = Context.get_text_context().get_styles_context();
CP_XML_WRITER(styles_context_.text_style())//a:rPr & a:defRPr
CP_XML_WRITER(strm)
{
CP_XML_NODE(styles_context_.extern_node())
CP_XML_NODE(node)//a:rPr & a:defRPr
{
//attr
const int W = process_font_weight(fo_font_weight_);
if (W>0)CP_XML_ATTR(L"b",true);
if (W > 0) CP_XML_ATTR(L"b", true);
const int fontStyle = process_font_style(fo_font_style_);
if (fontStyle>0)CP_XML_ATTR(L"i",true);
if (fontStyle > 0) CP_XML_ATTR(L"i", true);
double fontSizeVal = (fo_font_size_) ? process_font_size_impl(fo_font_size_, styles_context_.get_current_processed_style()):
process_font_size_impl(font_size(percent(100.0)), styles_context_.get_current_processed_style());
double fontSizeVal = (fo_font_size_) ? process_font_size_impl(fo_font_size_, current_style) :
process_font_size_impl(font_size(percent(100.0)), current_style);
double mul = 1;
if ((style_text_position_) && (style_text_position_->has_font_size()))
{
mul = style_text_position_->font_size().get_value() / 100.0;
......@@ -356,7 +354,7 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
CP_XML_ATTR(L"cap", "small");
}
}
// underline
// underline
line_width under = style_text_underline_width_.get_value_or(line_width::Auto);
bool underlineBold = under.get_type() == line_width::Bold ||
under.get_type() == line_width::Thick;
......@@ -375,7 +373,7 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
switch (style_text_underline_type_->get_type())
{
case line_type::Single: underline = L"sng"; break;
case line_type::Single: underline = L"sng"; break;
case line_type::Double: underline = L"dbl"; break;
}
}
......@@ -447,18 +445,31 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
CP_XML_ATTR(L"lang", w_val);
}
if (style_text_position_)
{
if (style_text_position_->get_type() == text_position::Percent)
{
CP_XML_ATTR(L"baseline", style_text_position_->get_position().get_value() * 1000);
}
else if (style_text_position_->get_type() == text_position::Sub)
{
CP_XML_ATTR(L"baseline", -30000);
}
else if (style_text_position_->get_type() == text_position::Super)
{
CP_XML_ATTR(L"baseline", +30000);
}
}
//nodes
if (fo_color_)
{
CP_XML_NODE(L"a:solidFill")
{
CP_XML_NODE(L"a:srgbClr"){CP_XML_ATTR(L"val",fo_color_->get_hex_value());}
CP_XML_NODE(L"a:srgbClr") {CP_XML_ATTR(L"val",fo_color_->get_hex_value());}
}
}
if (style_font_name_ || style_font_name_asian_ || style_font_name_complex_ || fo_font_family_)
{
fonts_container & fonts = Context.root()->odf_context().fontContainer();
std::wstring w_eastAsia;
std::wstring w_hAnsi;
std::wstring w_cs;
......@@ -499,38 +510,432 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
}
}
//else if (style_use_window_font_color_ && *style_use_window_font_color_)
//{
// _rPr << L"<w:color w:val=\"auto\" />";
//}
//if (fo_background_color_)
//{
// std::wstring w_fill;
// if (fo_background_color_->get_type() == background_color::Transparent)
// w_fill = L"auto";
// else
// w_fill = fo_background_color_->get_color().get_hex_value();
// _rPr << L"<w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"" << w_fill << "\" />";
//}
if (styles_context_.hlinkClick().length()>0)
if (!hlink.empty())
{
CP_XML_NODE(L"a:hlinkClick")
{
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR(L"r:id",styles_context_.hlinkClick());
CP_XML_ATTR(L"r:id", hlink);
}
}
}
}
}
void text_format_properties_content::docx_serialize(std::wostream & _rPr, fonts_container & fonts)
{//упрощенный вариант
_rPr << L"<w:rPr>";
const int W = process_font_weight (fo_font_weight_);
const int fontStyle = process_font_style (fo_font_style_);
const int WCs = process_font_weight (style_font_weight_complex_);
if (r_style_)
{
_rPr << L"<w:rStyle w:val=\"" << *r_style_ << L"\" />";
}
if (W)
{
if (W > 0)
_rPr << L"<w:b/>";
else
_rPr << L"<w:b w:val=\"false\" />";
}
if (WCs)
{
if (WCs > 0)
_rPr << L"<w:bCs/>";
else
_rPr << L"<w:bCs w:val=\"false\" />";
}
if (fo_text_transform_)
{
_rPr << (fo_text_transform_->get_type() == text_transform::Uppercase ? L"<w:caps w:val=\"true\" />" : L"<w:caps w:val=\"false\" />");
}
if (fontStyle)
{
if (fontStyle > 0)
_rPr << L"<w:i />";
else
_rPr << L"<w:i w:val=\"false\" />";
}
const int fontStyleComplex = process_font_style(style_font_style_complex_);
if (fontStyleComplex)
{
if (fontStyleComplex > 0)
_rPr << L"<w:iCs />";
else
_rPr << L"<w:iCs w:val=\"false\" />";
}
if (fo_font_variant_)
{
_rPr << (fo_font_variant_->get_type() == font_variant::SmallCaps ? L"<w:smallCaps w:val=\"true\" />" :
L"<w:smallCaps w:val=\"false\" />" );
}
if (style_font_relief_)
{
if (style_font_relief_->get_type() == font_relief::Embossed)
_rPr << L"<w:emboss w:val=\"true\" />";
else if (style_font_relief_->get_type() == font_relief::Engraved)
_rPr << L"<w:imprint w:val=\"true\" />";
else
{
_rPr << L"<w:emboss w:val=\"false\" />";
_rPr << L"<w:imprint w:val=\"false\" />";
}
}
if (style_text_outline_)
{
_rPr << ((*style_text_outline_ == true) ? L"<w:outline w:val=\"true\" />" : L"<w:outline w:val=\"false\" />" );
}
if (fo_text_shadow_)
{
_rPr << ((fo_text_shadow_->get_type() == shadow_type::Enable) ? L"<w:shadow w:val=\"true\" />" : L"<w:shadow w:val=\"false\" />" );
}
if (text_display_)
{
if (text_display_->get_type() == text_display::None)
_rPr << L"<w:vanish />";
}
// underline
{
line_width under = style_text_underline_width_.get_value_or(line_width::Auto);
bool underlineBold = under.get_type() == line_width::Bold ||
under.get_type() == line_width::Thick;
std::wstring underline = L"";
void text_format_properties_content::docx_convert(oox::docx_conversion_context & Context)
if ((style_text_underline_type_ && style_text_underline_type_->get_type() == line_type::None) ||
(style_text_underline_style_ && style_text_underline_style_->get_type() == line_style::None))
{
// подчеркивание выключено
underline = L"none";
}
else if (style_text_underline_type_ &&
(!style_text_underline_style_ || style_text_underline_style_ && style_text_underline_style_->get_type() == line_style::Solid) )
{
if (underlineBold)
underline = L"thick";
switch (style_text_underline_type_->get_type())
{
case line_type::Single:
underline = L"single";
break;
case line_type::Double:
underline = L"dbl";
break;
}
}
else if (style_text_underline_style_)
{
switch (style_text_underline_style_->get_type())
{
case line_style::Solid:
if (underlineBold)
underline = L"thick";
else
underline = L"single";
break;
case line_style::Dotted:
if (underlineBold)
underline = L"dottedHeavy";
else
underline = L"dotted";
break;
case line_style::Dash:
if (underlineBold)
underline = L"dashedHeavy";
else
underline = L"dash";
break;
case line_style::LongDash:if (underlineBold)
underline = L"dashLongHeavy";
else
underline = L"dashLong";
break;
case line_style::DotDash:
if (underlineBold)
underline = L"dashDotHeavy";
else
underline = L"dotDash";
break;
case line_style::DotDotDash:
if (underlineBold)
underline = L"dashDotDotHeavy";
else
underline = L"dotDotDash";
break;
case line_style::Wave:
if (underlineBold)
underline = L"wavyHeavy";
else if (style_text_underline_type_.get_value_or( line_type(line_type::Single) ).get_type() == line_type::Double)
underline = L"wavyDbl";
else
underline = L"wavy";
break;
}
}
std::wstring color = L"";
if (style_text_underline_color_ &&
style_text_underline_color_->get_type() == underline_color::Enabled)
{
color = style_text_underline_color_->get_color().get_color();
}
if (!underline.empty())
{
_rPr << L"<w:u w:val=\"" << underline << "\" ";
if (!color.empty())
_rPr << L"w:color=\"" << color << L"\" ";
_rPr << L"/>";
}
}
if ((style_text_line_through_type_ && style_text_line_through_type_->get_type() == line_type::None) ||
(style_text_line_through_style_ && style_text_line_through_style_->get_type() == line_style::None))
{
_rPr << L"<w:dstrike w:val=\"false\" />";
_rPr << L"<w:strike w:val=\"false\" />";
}
else if (style_text_line_through_type_)
{
if (style_text_line_through_type_->get_type() == line_type::Single)
_rPr << L"<w:strike w:val=\"true\" />";
else if (style_text_line_through_type_->get_type() == line_type::Double)
_rPr << L"<w:dstrike w:val=\"true\" />";
}
else if (style_text_line_through_style_ && style_text_line_through_style_->get_type() != line_style::None)
{
_rPr << L"<w:strike w:val=\"true\" />";
}
bool needProcessFontSize = true;
if (style_text_position_)
{
bool noNeedSize = false;
if (style_text_position_->get_type() == text_position::Sub)
{
_rPr << L"<w:vertAlign w:val=\"subscript\" />";
noNeedSize = true;
}
if (style_text_position_->get_type() == text_position::Super)
{
_rPr << L"<w:vertAlign w:val=\"superscript\" />";
noNeedSize = true;
}
double fontSizeVal = (fo_font_size_) ? process_font_size_impl(fo_font_size_, NULL) :
process_font_size_impl(font_size(percent(100.0)), NULL);
if (style_text_position_->get_type() == text_position::Percent)
{
const double mul = style_text_position_->get_position().get_value() / 100.0;
if (fontSizeVal > 0)
{
const std::wstring position = boost::lexical_cast<std::wstring>( (int)(fontSizeVal * mul + 0.5));
if (!position.empty())
{
_rPr << L"<w:position w:val=\"" << position << "\" />";
}
}
}
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)
{
const std::wstring fontSize = boost::lexical_cast<std::wstring>((int)(fontSizeVal * mul + 0.5));
if (!fontSize.empty())
{
needProcessFontSize = false;
_rPr << L"<w:sz w:val=\"" << fontSize << "\" />";
}
}
}
}
if (style_text_rotation_angle_)
{
unsigned int value = (std::abs)(*style_text_rotation_angle_);
if (90 == value || 270 == value)
_rPr << L"<w:eastAsianLayout w:vert=\"true\" />";
}
if (style_text_scale_)
{
_rPr << L"<w:w w:val=\"" << style_text_scale_->get_value() << "\" />";
}
if (needProcessFontSize)
{
int fontSize = process_font_size(fo_font_size_, NULL);
if (fontSize > 0)
{
_rPr << L"<w:sz w:val=\"" << fontSize << "\" />";
}
}
int fontSizeComplex = process_font_size(style_font_size_complex_, NULL, true);
if (fontSizeComplex > 0)
_rPr << L"<w:szCs w:val=\"" << fontSizeComplex << "\" />";
if (fo_letter_spacing_)
{
if (fo_letter_spacing_->get_type() == letter_spacing::Normal)
_rPr << L"<w:spacing w:val=\"0\" />";
else
_rPr << L"<w:spacing w:val=\"" <<
(int)(20.0 * fo_letter_spacing_->get_length().get_value_unit(length::pt))
<< "\" />";
}
if (style_text_emphasize_)
{
std::wstring em = L"";
switch(style_text_emphasize_->get_type())
{
case text_emphasize::None:
em = L"none";
break;
case text_emphasize::Accent:
em = L"comma";
break;
case text_emphasize::Dot:
if (style_text_emphasize_->get_type_2() == text_emphasize::Above)
em = L"dot";
else
em = L"underDot";
break;
case text_emphasize::Circle:
em = L"circle";
break;
case text_emphasize::Disc:
em = L"dot"; // ?
break;
}
_rPr << L"<w:em w:val=\"" << em << "\" />";
}
if (style_font_name_ || style_font_name_asian_ || style_font_name_complex_ || fo_font_family_)
{
std::wstring w_eastAsia;
std::wstring w_hAnsi;
std::wstring w_cs;
std::wstring w_ascii = w_hAnsi = w_cs = (fo_font_family_ ? *fo_font_family_ : L"");
if (style_font_name_complex_)
{
font_instance * font = fonts.font_by_style_name(*style_font_name_complex_);
if (font)
w_cs = font->name();
}
if (style_font_name_asian_)
{
font_instance * font = fonts.font_by_style_name(*style_font_name_asian_);
if (font)
w_eastAsia = font->name();
}
if (style_font_name_)
{
font_instance * font = fonts.font_by_style_name(*style_font_name_);
if (font)
w_ascii = w_hAnsi = font->name();
}
_rPr << L"<w:rFonts";
if (!w_ascii.empty()) _rPr << L" w:ascii=\"" << w_ascii <<"\"";
if (!w_hAnsi.empty()) _rPr << L" w:hAnsi=\"" << w_hAnsi <<"\"";
if (!w_eastAsia.empty()) _rPr << L" w:eastAsia=\"" << w_eastAsia <<"\"";
if (!w_cs.empty()) _rPr << L" w:cs=\"" << w_cs <<"\"";
_rPr << L"/>";
}
_CP_OPT(color) color_text = fo_color_;
if (color_text)
{
_rPr << L"<w:color w:val=\"" << color_text->get_hex_value() << "\" />";
}
else if (style_use_window_font_color_ && *style_use_window_font_color_)
{
_rPr << L"<w:color w:val=\"auto\" />";
}
if (fo_background_color_)
{
std::wstring w_fill;
if (fo_background_color_->get_type() == background_color::Transparent)
w_fill = L"auto";
else
w_fill = fo_background_color_->get_color().get_hex_value();
_rPr << L"<w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"" << w_fill << "\" />";
}
if (fo_language_ || style_language_asian_ || style_language_complex_)
{
std::wstring w_val;
if (fo_language_)
{
w_val = *fo_language_;
if (fo_country_)
w_val += L"-" + *fo_country_;
}
std::wstring w_eastAsia;
if (style_language_asian_)
{
w_eastAsia = *style_language_asian_;
if (style_country_asian_)
w_eastAsia += L"-" + *style_country_asian_;
}
std::wstring w_bidi;
if (style_language_complex_)
{
w_bidi = *style_language_complex_;
if (style_country_complex_)
w_bidi += L"-" + *style_country_complex_;
}
_rPr << L"<w:lang ";
if (!w_val.empty())
_rPr << L"w:val=\"" << w_val << "\" ";
if (!w_eastAsia.empty())
_rPr << L"w:eastAsia=\"" << w_eastAsia << "\" ";
if (!w_bidi.empty())
_rPr << L"w:bidi=\"" << w_bidi << "\" ";
_rPr << L"/>";
}
if (style_text_blinking_)
{
std::wstring w_val = L"none";
if (*style_text_blinking_)
w_val = L"blinkBackground";
_rPr << L"<w:effect w:val=\"" << w_val << "\" />";
}
_rPr << L"</w:rPr>";
}
void text_format_properties_content::pptx_convert(oox::pptx_conversion_context & Context)
{
styles_context & styles_context_ = Context.get_text_context().get_styles_context();
fonts_container & fonts_ = Context.root()->odf_context().fontContainer();
drawing_serialize(styles_context_.text_style(), styles_context_.extern_node(), fonts_, styles_context_.get_current_processed_style(), styles_context_.hlinkClick());
}
void text_format_properties_content::docx_convert(oox::docx_conversion_context & Context)
{//расширенный вариант
std::wostream & _pPr = Context.get_styles_context().paragraph_nodes();
// to paragraph properties
......@@ -542,13 +947,13 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
_pPr << L"<w:suppressAutoHyphens w:val=\"true\" />";
}
std::wostream & _rPr = Context.get_styles_context().text_style();
std::wostream & _rPr = Context.get_styles_context().text_style();
fonts_container & fonts = Context.root()->odf_context().fontContainer();
if (Context.get_rtl())
{
_rPr << L"<w:rtl/>";/* w:val=\"true\" */
}
if (r_style_)
{
_rPr << L"<w:rStyle w:val=\"" << *r_style_ << L"\" />";
......@@ -601,7 +1006,8 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
}
if (fo_font_variant_)
{
_rPr << (fo_font_variant_->get_type() == font_variant::SmallCaps ? L"<w:smallCaps w:val=\"true\" />" : L"<w:smallCaps w:val=\"false\" />" );
_rPr << (fo_font_variant_->get_type() == font_variant::SmallCaps ? L"<w:smallCaps w:val=\"true\" />" :
L"<w:smallCaps w:val=\"false\" />" );
}
if (style_font_relief_)
{
......@@ -627,7 +1033,7 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
if (text_display_)
{
if (text_display_->get_type() == text_display::None)
_rPr << L"<w:vanish />";
_rPr << L"<w:vanish/>";
}
// underline
{
......@@ -746,7 +1152,7 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
bool needProcessFontSize = true;
// 17.3.2.42
if (Context.get_drop_cap_context().state()==2)
if (Context.get_drop_cap_context().state() == 2)
{
_rPr << L"<w:position w:val=\"-" << (2+Context.get_drop_cap_context().Scale*2-3)*2 << "\"/> ";//формула ачуметь !! - подбор вручную
}
......@@ -876,9 +1282,7 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
if (style_font_name_ || style_font_name_asian_ || style_font_name_complex_ || fo_font_family_)
{
fonts_container & fonts = Context.root()->odf_context().fontContainer();
std::wstring w_eastAsia;
std::wstring w_eastAsia;
std::wstring w_hAnsi;
std::wstring w_cs;
std::wstring w_ascii = w_hAnsi = w_cs = (fo_font_family_ ? *fo_font_family_ : L"");
......@@ -1013,454 +1417,15 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
}
void text_format_properties_content::oox_convert (std::wostream & _rPr, bool graphic, fonts_container & fonts)
void text_format_properties_content::oox_serialize(std::wostream & strm, bool graphic, fonts_container & fonts)
{
const int W = process_font_weight (fo_font_weight_);
const int fontStyle = process_font_style (fo_font_style_);
const int WCs = process_font_weight (style_font_weight_complex_);
if (graphic)
{
_rPr << L"<a:rPr";
int fontSize = process_font_size(fo_font_size_, NULL) / 2 * 100;
if (fontSize > 0)
{
_rPr << L" sz=\"" << fontSize << L"\"";
}
if (W)
{
if (W > 0) _rPr << L" b=\"1\"";
else _rPr << L" b=\"0\"";
}
if (fontStyle)
{
if (fontStyle > 0) _rPr << L" i=\"1\"";
else _rPr << L" i=\"0\"";
}
_rPr << L">";
_CP_OPT(color) color_text = fo_color_;
if (color_text)
{
_rPr << L"<a:solidFill><a:srgbClr val=\"" << color_text->get_hex_value() << "\"/></a:solidFill>";
}
//else if (style_use_window_font_color_ && *style_use_window_font_color_)
//{
// _rPr << L"<w:color w:val=\"auto\" />";
//}
//if (fo_background_color_)
//{
// std::wstring w_fill;
// if (fo_background_color_->get_type() == background_color::Transparent)
// w_fill = L"auto";
// else
// w_fill = fo_background_color_->get_color().get_hex_value();
// _rPr << L"<w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"" << w_fill << "\" />";
//}
if (style_font_name_)
{
_rPr << L"<a:latin typeface=\"" << style_font_name_.get() << "\"/>";
}
_rPr << L"</a:rPr>";
drawing_serialize(strm, L"a:rPr", fonts);
}
else
{
_rPr << L"<w:rPr>";
if (r_style_)
{
_rPr << L"<w:rStyle w:val=\"" << *r_style_ << L"\" />";
}
const int W = process_font_weight(fo_font_weight_);
if (W)
{
if (W > 0)
_rPr << L"<w:b/>";
else
_rPr << L"<w:b w:val=\"false\" />";
}
if (WCs)
{
if (WCs > 0)
_rPr << L"<w:bCs/>";
else
_rPr << L"<w:bCs w:val=\"false\" />";
}
if (fo_text_transform_)
{
_rPr << (fo_text_transform_->get_type() == text_transform::Uppercase ? L"<w:caps w:val=\"true\" />" : L"<w:caps w:val=\"false\" />");
}
if (fontStyle)
{
if (fontStyle > 0)
_rPr << L"<w:i />";
else
_rPr << L"<w:i w:val=\"false\" />";
}
const int fontStyleComplex = process_font_style(style_font_style_complex_);
if (fontStyleComplex)
{
if (fontStyleComplex > 0)
_rPr << L"<w:iCs />";
else
_rPr << L"<w:iCs w:val=\"false\" />";
}
if (fo_font_variant_)
{
_rPr << (fo_font_variant_->get_type() == font_variant::SmallCaps ? L"<w:smallCaps w:val=\"true\" />" : L"<w:smallCaps w:val=\"false\" />" );
}
if (style_font_relief_)
{
if (style_font_relief_->get_type() == font_relief::Embossed)
_rPr << L"<w:emboss w:val=\"true\" />";
else if (style_font_relief_->get_type() == font_relief::Engraved)
_rPr << L"<w:imprint w:val=\"true\" />";
else
{
_rPr << L"<w:emboss w:val=\"false\" />";
_rPr << L"<w:imprint w:val=\"false\" />";
}
}
if (style_text_outline_)
{
_rPr << ((*style_text_outline_ == true) ? L"<w:outline w:val=\"true\" />" : L"<w:outline w:val=\"false\" />" );
}
if (fo_text_shadow_)
{
_rPr << ((fo_text_shadow_->get_type() == shadow_type::Enable) ? L"<w:shadow w:val=\"true\" />" : L"<w:shadow w:val=\"false\" />" );
}
if (text_display_)
{
if (text_display_->get_type() == text_display::None)
_rPr << L"<w:vanish />";
}
// underline
{
line_width under = style_text_underline_width_.get_value_or(line_width::Auto);
bool underlineBold = under.get_type() == line_width::Bold ||
under.get_type() == line_width::Thick;
std::wstring underline = L"";
if ((style_text_underline_type_ && style_text_underline_type_->get_type() == line_type::None) ||
(style_text_underline_style_ && style_text_underline_style_->get_type() == line_style::None))
{
// подчеркивание выключено
underline = L"none";
}
else if (style_text_underline_type_ &&
(!style_text_underline_style_ || style_text_underline_style_ && style_text_underline_style_->get_type() == line_style::Solid) )
{
if (underlineBold)
underline = L"thick";
switch (style_text_underline_type_->get_type())
{
case line_type::Single:
underline = L"single";
break;
case line_type::Double:
underline = L"dbl";
break;
}
}
else if (style_text_underline_style_)
{
switch (style_text_underline_style_->get_type())
{
case line_style::Solid:
if (underlineBold)
underline = L"thick";
else
underline = L"single";
break;
case line_style::Dotted:
if (underlineBold)
underline = L"dottedHeavy";
else
underline = L"dotted";
break;
case line_style::Dash:
if (underlineBold)
underline = L"dashedHeavy";
else
underline = L"dash";
break;
case line_style::LongDash:if (underlineBold)
underline = L"dashLongHeavy";
else
underline = L"dashLong";
break;
case line_style::DotDash:
if (underlineBold)
underline = L"dashDotHeavy";
else
underline = L"dotDash";
break;
case line_style::DotDotDash:
if (underlineBold)
underline = L"dashDotDotHeavy";
else
underline = L"dotDotDash";
break;
case line_style::Wave:
if (underlineBold)
underline = L"wavyHeavy";
else if (style_text_underline_type_.get_value_or( line_type(line_type::Single) ).get_type() == line_type::Double)
underline = L"wavyDbl";
else
underline = L"wavy";
break;
}
}
std::wstring color = L"";
if (style_text_underline_color_ &&
style_text_underline_color_->get_type() == underline_color::Enabled)
{
color = style_text_underline_color_->get_color().get_color();
}
if (!underline.empty())
{
_rPr << L"<w:u w:val=\"" << underline << "\" ";
if (!color.empty())
_rPr << L"w:color=\"" << color << L"\" ";
_rPr << L"/>";
}
}
if ((style_text_line_through_type_ && style_text_line_through_type_->get_type() == line_type::None) ||
(style_text_line_through_style_ && style_text_line_through_style_->get_type() == line_style::None))
{
_rPr << L"<w:dstrike w:val=\"false\" />";
_rPr << L"<w:strike w:val=\"false\" />";
}
else if (style_text_line_through_type_)
{
if (style_text_line_through_type_->get_type() == line_type::Single)
_rPr << L"<w:strike w:val=\"true\" />";
else if (style_text_line_through_type_->get_type() == line_type::Double)
_rPr << L"<w:dstrike w:val=\"true\" />";
}
else if (style_text_line_through_style_ && style_text_line_through_style_->get_type() != line_style::None)
{
_rPr << L"<w:strike w:val=\"true\" />";
}
bool needProcessFontSize = true;
if (style_text_position_)
{
bool noNeedSize = false;
if (style_text_position_->get_type() == text_position::Sub)
{
_rPr << L"<w:vertAlign w:val=\"subscript\" />";
noNeedSize = true;
}
if (style_text_position_->get_type() == text_position::Super)
{
_rPr << L"<w:vertAlign w:val=\"superscript\" />";
noNeedSize = true;
}
double fontSizeVal = (fo_font_size_) ? process_font_size_impl(fo_font_size_, NULL) :
process_font_size_impl(font_size(percent(100.0)), NULL);
if (style_text_position_->get_type() == text_position::Percent)
{
const double mul = style_text_position_->get_position().get_value() / 100.0;
if (fontSizeVal > 0)
{
const std::wstring position = boost::lexical_cast<std::wstring>( (int)(fontSizeVal * mul + 0.5));
if (!position.empty())
{
_rPr << L"<w:position w:val=\"" << position << "\" />";
}
}
}
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)
{
const std::wstring fontSize = boost::lexical_cast<std::wstring>((int)(fontSizeVal * mul + 0.5));
if (!fontSize.empty())
{
needProcessFontSize = false;
_rPr << L"<w:sz w:val=\"" << fontSize << "\" />";
}
}
}
}
if (style_text_rotation_angle_)
{
unsigned int value = (std::abs)(*style_text_rotation_angle_);
if (90 == value || 270 == value)
_rPr << L"<w:eastAsianLayout w:vert=\"true\" />";
}
if (style_text_scale_)
{
_rPr << L"<w:w w:val=\"" << style_text_scale_->get_value() << "\" />";
}
if (needProcessFontSize)
{
int fontSize = process_font_size(fo_font_size_, NULL);
if (fontSize > 0)
{
_rPr << L"<w:sz w:val=\"" << fontSize << "\" />";
}
}
int fontSizeComplex = process_font_size(style_font_size_complex_, NULL, true);
if (fontSizeComplex > 0)
_rPr << L"<w:szCs w:val=\"" << fontSizeComplex << "\" />";
if (fo_letter_spacing_)
{
if (fo_letter_spacing_->get_type() == letter_spacing::Normal)
_rPr << L"<w:spacing w:val=\"0\" />";
else
_rPr << L"<w:spacing w:val=\"" <<
(int)(20.0 * fo_letter_spacing_->get_length().get_value_unit(length::pt))
<< "\" />";
}
if (style_text_emphasize_)
{
std::wstring em = L"";
switch(style_text_emphasize_->get_type())
{
case text_emphasize::None:
em = L"none";
break;
case text_emphasize::Accent:
em = L"comma";
break;
case text_emphasize::Dot:
if (style_text_emphasize_->get_type_2() == text_emphasize::Above)
em = L"dot";
else
em = L"underDot";
break;
case text_emphasize::Circle:
em = L"circle";
break;
case text_emphasize::Disc:
em = L"dot"; // ?
break;
}
_rPr << L"<w:em w:val=\"" << em << "\" />";
}
if (style_font_name_ || style_font_name_asian_ || style_font_name_complex_ || fo_font_family_)
{
std::wstring w_eastAsia;
std::wstring w_hAnsi;
std::wstring w_cs;
std::wstring w_ascii = w_hAnsi = w_cs = (fo_font_family_ ? *fo_font_family_ : L"");
if (style_font_name_complex_)
{
font_instance * font = fonts.font_by_style_name(*style_font_name_complex_);
if (font)
w_cs = font->name();
}
if (style_font_name_asian_)
{
font_instance * font = fonts.font_by_style_name(*style_font_name_asian_);
if (font)
w_eastAsia = font->name();
}
if (style_font_name_)
{
font_instance * font = fonts.font_by_style_name(*style_font_name_);
if (font)
w_ascii = w_hAnsi = font->name();
}
_rPr << L"<w:rFonts";
if (!w_ascii.empty()) _rPr << L" w:ascii=\"" << w_ascii <<"\"";
if (!w_hAnsi.empty()) _rPr << L" w:hAnsi=\"" << w_hAnsi <<"\"";
if (!w_eastAsia.empty()) _rPr << L" w:eastAsia=\"" << w_eastAsia <<"\"";
if (!w_cs.empty()) _rPr << L" w:cs=\"" << w_cs <<"\"";
_rPr << L"/>";
}
_CP_OPT(color) color_text = fo_color_;
if (color_text)
{
_rPr << L"<w:color w:val=\"" << color_text->get_hex_value() << "\" />";
}
else if (style_use_window_font_color_ && *style_use_window_font_color_)
{
_rPr << L"<w:color w:val=\"auto\" />";
}
if (fo_background_color_)
{
std::wstring w_fill;
if (fo_background_color_->get_type() == background_color::Transparent)
w_fill = L"auto";
else
w_fill = fo_background_color_->get_color().get_hex_value();
_rPr << L"<w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"" << w_fill << "\" />";
}
if (fo_language_ || style_language_asian_ || style_language_complex_)
{
std::wstring w_val;
if (fo_language_)
{
w_val = *fo_language_;
if (fo_country_)
w_val += L"-" + *fo_country_;
}
std::wstring w_eastAsia;
if (style_language_asian_)
{
w_eastAsia = *style_language_asian_;
if (style_country_asian_)
w_eastAsia += L"-" + *style_country_asian_;
}
std::wstring w_bidi;
if (style_language_complex_)
{
w_bidi = *style_language_complex_;
if (style_country_complex_)
w_bidi += L"-" + *style_country_complex_;
}
_rPr << L"<w:lang ";
if (!w_val.empty())
_rPr << L"w:val=\"" << w_val << "\" ";
if (!w_eastAsia.empty())
_rPr << L"w:eastAsia=\"" << w_eastAsia << "\" ";
if (!w_bidi.empty())
_rPr << L"w:bidi=\"" << w_bidi << "\" ";
_rPr << L"/>";
}
if (style_text_blinking_)
{
std::wstring w_val = L"none";
if (*style_text_blinking_)
w_val = L"blinkBackground";
_rPr << L"<w:effect w:val=\"" << w_val << "\" />";
}
_rPr << L"</w:rPr>";
docx_serialize(strm, fonts);
}
}
......
......@@ -80,7 +80,9 @@ public:
void pptx_convert (oox::pptx_conversion_context & Context);
void pptx_convert_as_list (oox::pptx_conversion_context & Context);
void oox_convert (std::wostream & stream, bool graphic, fonts_container & fonts);
void oox_serialize (std::wostream & stream, bool graphic, fonts_container & fonts);
void docx_serialize (std::wostream & stream, fonts_container & fonts);
void drawing_serialize (std::wostream & stream, std::wstring node, fonts_container & fonts, const odf_reader::style_instance *current_style = NULL, std::wstring hlink = L"");
void apply_from (const text_format_properties_content & Other);
void apply_to (std::vector<_property> & properties);
......
......@@ -455,6 +455,45 @@ namespace svg_path
}
}break;
case 'G':
{
nPos++;
skipSpaces(nPos, rSvgDStatement, nLen);
while(nPos < nLen && isOnNumberChar(rSvgDStatement, nPos))
{
double nX, nY;
double A1, A2;
if(!importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
if(!importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
if(!importDoubleAndSpaces(A1, nPos, rSvgDStatement, nLen)) return false;
if(!importDoubleAndSpaces(A2, nPos, rSvgDStatement, nLen)) return false;
if(bRelative)
{
nX += nLastX;
nY += nLastY;
}
aCurrPoly.command = L"a:ArcTo";
// append curved edge
aCurrPoly.points.push_back(_point(nX, nY));
aCurrPoly.points.push_back(_point(A1, A2));
Polyline.push_back(aCurrPoly);
aCurrPoly.points.clear();
// set last position
nLastX = nX;
nLastY = nY;
//keep control point
nLastControlX = nX;
nLastControlY = nY;
}
}break;
// #100617# quadratic beziers are imported as cubic ones
//case 'q' :
//{
......
......@@ -1528,13 +1528,13 @@ void OoxConverter::convert(PPTX::Logic::TextParagraphPr *oox_paragraph_pr , odf_
{
paragraph_properties->content_.fo_text_indent_ = odf_types::length_or_percent(odf_types::length(oox_paragraph_pr->indent.get() / 12700., odf_types::length::pt));
}
if (oox_paragraph_pr->rtl.IsInit())
if (oox_paragraph_pr->rtl.IsInit() && *oox_paragraph_pr->rtl)
{
paragraph_properties->content_.style_writing_mode_= odf_types::writing_mode(odf_types::writing_mode::RlTb);
}
}
//nullable<SimpleTypes::CDecimalNumber<> > m_oLvl;
//nullable<SimpleTypes::CCoordinate32<> > m_oDefTabSz;
//nullable<SimpleTypes::CTextFontAlignType<>> m_oFontAlgn;
//defTabSz;
//fontAlgn;
if (oox_paragraph_pr->defRPr.IsInit())
{
......@@ -1571,7 +1571,7 @@ void OoxConverter::convert(PPTX::Logic::RunProperties *oox_run_pr, odf_writer::s
//------------------------------------------------------
odf_writer::odf_drawing_context *drawing = odf_context()->drawing_context();
if (drawing) //from styles impossible(
if (drawing) //from styles drawing impossible( ... todoooo ???
{
if ((oox_run_pr->Fill.is<PPTX::Logic::GradFill>()) ||
((oox_run_pr->ln.IsInit()) && (oox_run_pr->ln->Fill.is_init() && oox_run_pr->ln->Fill.getType() != OOX::et_a_noFill)))
......@@ -1709,37 +1709,99 @@ void OoxConverter::convert(PPTX::Logic::RunProperties *oox_run_pr, odf_writer::s
{
text_properties->content_.style_text_underline_style_ = odf_types::line_style (odf_types::line_style::Solid);
text_properties->content_.style_text_underline_type_ = odf_types::line_type (odf_types::line_type::Single);
switch(oox_run_pr->u->GetBYTECode())
{
case SimpleTypes::underlineNone :
text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::None);break;
case SimpleTypes::underlineDash :
case SimpleTypes::underlineDashedHeavy:
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Dash);break;
case SimpleTypes::underlineDotDash :
case SimpleTypes::underlineDashDotHeavy:
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::DotDash);break;
case SimpleTypes::underlineDashLong:
case SimpleTypes::underlineDashLongHeavy:
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::LongDash);break;
case SimpleTypes::underlineDotDotDash:
case SimpleTypes::underlineDashDotDotHeavy :
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::DotDotDash);break;
case SimpleTypes::underlineDotted:
case SimpleTypes::underlineDottedHeavy:
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Dotted);break;
case SimpleTypes::underlineWave :
case SimpleTypes::underlineWavyHeavy :
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Wave);break;
case SimpleTypes::underlineDouble :
case SimpleTypes::underlineThick :
text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::Double);break;
case SimpleTypes::underlineWavyDouble :
text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::Double);
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Wave);break;
case 12:
text_properties->content_.style_text_underline_style_ = boost::none;
text_properties->content_.style_text_underline_type_ = odf_types::line_type(odf_types::line_type::None);break;
case 0:
case 1:
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Dash);break;
case 5:
case 6:
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::DotDash);break;
case 2:
case 3:
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::LongDash);break;
case 7:
case 8:
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::DotDotDash);break;
case 9:
case 10:
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Dotted);break;
case 14:
case 16:
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Wave);break;
case 4:
text_properties->content_.style_text_underline_type_ = odf_types::line_type(odf_types::line_type::Double);break;
case 15:
text_properties->content_.style_text_underline_type_ = odf_types::line_type(odf_types::line_type::Double);
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Wave);break;
}
PPTX::Logic::UniFill *fill = NULL;
if (oox_run_pr->uFillTx.IsInit()) fill = &oox_run_pr->uFillTx->Fill;
else if (oox_run_pr->uFill.IsInit()) fill = &oox_run_pr->uFill->Fill;
if (fill && fill->is<PPTX::Logic::SolidFill>() )
{
PPTX::Logic::SolidFill &solid = fill->as<PPTX::Logic::SolidFill>();
_CP_OPT(double) opacityText;
std::wstring hexColorText;
convert(&solid.Color, hexColorText, opacityText);
if (!hexColorText.empty())
{
text_properties->content_.style_text_underline_color_ = odf_types::color(hexColorText);
}
}
}
if (oox_run_pr->highlight.IsInit())
{
_CP_OPT(double) opacityText;
std::wstring hexColorText;
convert(&oox_run_pr->highlight->Color, hexColorText, opacityText);
text_properties->content_.fo_background_color_ = odf_types::color(hexColorText);
}
if (oox_run_pr->strike.IsInit())
{
switch(oox_run_pr->strike->GetBYTECode())
{
case 0:
text_properties->content_.style_text_line_through_style_ = odf_types::line_style (odf_types::line_style::Solid);
text_properties->content_.style_text_line_through_type_ = odf_types::line_type(odf_types::line_type::Double); break;
case 1:
text_properties->content_.style_text_line_through_style_ = boost::none;
text_properties->content_.style_text_line_through_type_ = odf_types::line_type(odf_types::line_type::None); break;
case 2:
text_properties->content_.style_text_line_through_style_ = odf_types::line_style (odf_types::line_style::Solid);
text_properties->content_.style_text_line_through_type_ = odf_types::line_type(odf_types::line_type::Single); break;
}
}
if (oox_run_pr->baseline.IsInit())
{
text_properties->content_.style_text_position_ = odf_types::text_position(*oox_run_pr->baseline / 1000.);
}
if (oox_run_pr->cap.IsInit())
{
switch(oox_run_pr->cap->GetBYTECode())
{
case 0:
text_properties->content_.fo_text_transform_ = odf_types::text_transform(odf_types::text_transform::Uppercase); break;
case 1:
text_properties->content_.fo_font_variant_ = odf_types::font_variant(odf_types::font_variant::SmallCaps); break;
case 2:
text_properties->content_.fo_font_variant_ = odf_types::font_variant(odf_types::font_variant::Normal); break;
}
}
if (oox_run_pr->normalizeH.IsInit() && *oox_run_pr->normalizeH)
{
text_properties->content_.fo_text_transform_ = odf_types::text_transform(odf_types::text_transform::Capitalize);
}
}
void OoxConverter::convert(PPTX::Logic::Run *oox_run)
{
......
......@@ -347,12 +347,18 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
}
/////////////////////////////////////////////////////////////////////////
convert(oox_sheet->m_oSheetViews.GetPointer());
convert(oox_sheet->m_oHeaderFooter.GetPointer());
convert(oox_sheet->m_oPageSetup.GetPointer());
convert(oox_sheet->m_oPageMargins.GetPointer());
convert(oox_sheet->m_oPicture.GetPointer());
xlsx_current_container = old_container;
}
void XlsxConverter::convert(OOX::Spreadsheet::CHeaderFooter * oox_header_footer)
{
if (!oox_header_footer) return;
}
void XlsxConverter::convert(OOX::Spreadsheet::CPictureWorksheet *oox_background)
{
if (!oox_background) return;
......
......@@ -89,6 +89,7 @@ namespace OOX
class CSi;
class CWorkbookView;
class CPictureWorksheet;
class CHeaderFooter;
}
}
......@@ -153,6 +154,7 @@ namespace Oox2Odf
void convert(OOX::Spreadsheet::CDefinedName *oox_defined);
void convert(OOX::Spreadsheet::CTable *oox_table_part);
void convert(OOX::Spreadsheet::CPictureWorksheet *oox_background);
void convert(OOX::Spreadsheet::CHeaderFooter *oox_header_footer);
void convert(OOX::Spreadsheet::CCol *oox_column);
void convert(OOX::Spreadsheet::CRow *oox_row);
......
......@@ -37,6 +37,7 @@
#include "./../Limit/TextCaps.h"
#include "./../Limit/TextStrike.h"
#include "./../Limit/TextUnderline.h"
#include "Ln.h"
#include "UniFill.h"
#include "TextFont.h"
......@@ -89,6 +90,194 @@ namespace PPTX
virtual void FillParentPointersForChilds(){};
};
class UFillTx : public WrapperWritingElement
{
public:
WritingElement_AdditionConstructors(UFillTx)
UFillTx(std::wstring name = L"a:uFillTx")
{
m_name = name;
}
virtual OOX::EElementType getType () const
{
return OOX::et_a_uFillTx;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
m_name = node.GetName();
Fill.GetFillFrom(node);
FillParentPointersForChilds();
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
m_name = oReader.GetName();
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
Fill.fromXML(oReader);
}
FillParentPointersForChilds();
}
void Merge(nullable<UFillTx>& uFillTx)const
{
if(!uFillTx.is_init())
uFillTx = UFillTx();
uFillTx->m_name = m_name;
if(Fill.is_init())
uFillTx->Fill = Fill;
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->WriteRecord1(0, Fill);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes
while (pReader->GetPos() < _end_rec)
{
BYTE _at = pReader->GetUChar();
switch (_at)
{
case 0:
{
Fill.fromPPTY(pReader);
break;
}
default:
{
pReader->SkipRecord();
}
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(m_name);
Fill.toXmlWriter(pWriter);
pWriter->EndNode(m_name);
}
UniFill Fill;
std::wstring m_name;
protected:
virtual void FillParentPointersForChilds()
{
Fill.SetParentPointer(this);
}
};
class Highlight : public WrapperWritingElement
{
public:
WritingElement_AdditionConstructors(Highlight)
Highlight()
{
}
virtual OOX::EElementType getType () const
{
return OOX::et_a_highlight;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
Color.GetColorFrom(node);
FillParentPointersForChilds();
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
Color.fromXML(oReader);
}
FillParentPointersForChilds();
}
void Merge(nullable<Highlight>& highlight)const
{
if(!highlight.is_init())
highlight = Highlight();
if(Color.is_init())
highlight->Color = Color;
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->WriteRecord1(0, Color);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes
while (pReader->GetPos() < _end_rec)
{
BYTE _at = pReader->GetUChar();
switch (_at)
{
case 0:
{
Color.fromPPTY(pReader);
break;
}
default:
{
pReader->SkipRecord();
}
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(L"a:highlight");
Color.toXmlWriter(pWriter);
pWriter->EndNode(L"a:highlight");
}
UniColor Color;
protected:
virtual void FillParentPointersForChilds()
{
Color.SetParentPointer(this);
}
};
class RunProperties : public WrapperWritingElement
{
public:
......@@ -125,21 +314,27 @@ namespace PPTX
{
Fill.fromXML(oReader);
}
else if ( _T("ln") == sName )
else if ( L"ln" == sName )
ln = oReader;
else if ( _T("cs") == sName )
else if ( L"cs" == sName )
cs = oReader;
else if ( _T("ea") == sName )
else if ( L"ea" == sName )
ea = oReader;
else if ( _T("latin") == sName )
else if ( L"latin" == sName )
latin = oReader;
else if ( _T("sym") == sName )
else if ( L"sym" == sName )
sym = oReader;
else if ( _T("hlinkClick") == sName )
else if ( L"uFill" == sName )
uFill = oReader;
else if ( L"uFillTx" == sName )
uFillTx = oReader;
else if ( L"hlinkClick" == sName )
hlinkClick = oReader;
else if (_T("hlinkMouseOver") == sName)
else if (L"hlinkMouseOver" == sName)
hlinkMouseOver = oReader;
else if ( _T("rtl") == sName )
else if ( L"rtl" == sName )
rtl = oReader;
else if ( L"rtl" == sName )
rtl = oReader;
else if ( L"effectDag" == sName ||
L"effectLst" == sName ||
......@@ -175,7 +370,7 @@ namespace PPTX
node.ReadAttributeBase(L"spc", spc);
XmlUtils::CXmlNodes oNodes;
if (node.GetNodes(_T("*"), oNodes))
if (node.GetNodes(L"*", oNodes))
{
int nCount = oNodes.GetCount();
for (int i = 0; i < nCount; ++i)
......@@ -185,22 +380,28 @@ namespace PPTX
std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());
if (_T("ln") == strName)
if (L"ln" == strName)
ln = oNode;
else if (_T("latin") == strName)
else if (L"latin" == strName)
latin = oNode;
else if (_T("ea") == strName)
else if (L"ea" == strName)
ea = oNode;
else if (_T("cs") == strName)
else if (L"cs" == strName)
cs = oNode;
else if (_T("sym") == strName)
else if (L"sym" == strName)
sym = oNode;
else if (_T("hlinkClick") == strName)
else if (L"hlinkClick" == strName)
hlinkClick = oNode;
else if (_T("hlinkMouseOver") == strName)
else if (L"hlinkMouseOver" == strName)
hlinkMouseOver = oNode;
else if (_T("rtl") == strName)
else if (L"rtl" == strName)
rtl = oNode;
else if (L"uFill" == strName)
uFill = oNode;
else if (L"uFillTx" == strName)
uFillTx = oNode;
else if (L"highlight" == strName)
highlight = oNode;
}
}
......@@ -214,25 +415,25 @@ namespace PPTX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start ( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("altLang"), altLang)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("b"), b)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("bmk"), bmk)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("cap"), cap)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("dirty"), dirty)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("err"), err)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("i"), i)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("kern"), kern)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("kumimoji"), kumimoji)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("lang"), lang)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("noProof"), noProof)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("normalizeH"), normalizeH)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("smtClean"), smtClean)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("smtId"), smtId)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("strike"), strike)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("sz"), sz)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("u"), u)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("baseline"), baseline)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("spc"), spc)
WritingElement_ReadAttributes_Read_if ( oReader, L"altLang", altLang)
WritingElement_ReadAttributes_Read_else_if( oReader, L"b", b)
WritingElement_ReadAttributes_Read_else_if( oReader, L"bmk", bmk)
WritingElement_ReadAttributes_Read_else_if( oReader, L"cap", cap)
WritingElement_ReadAttributes_Read_else_if( oReader, L"dirty", dirty)
WritingElement_ReadAttributes_Read_else_if( oReader, L"err", err)
WritingElement_ReadAttributes_Read_else_if( oReader, L"i", i)
WritingElement_ReadAttributes_Read_else_if( oReader, L"kern", kern)
WritingElement_ReadAttributes_Read_else_if( oReader, L"kumimoji", kumimoji)
WritingElement_ReadAttributes_Read_else_if( oReader, L"lang", lang)
WritingElement_ReadAttributes_Read_else_if( oReader, L"noProof", noProof)
WritingElement_ReadAttributes_Read_else_if( oReader, L"normalizeH", normalizeH)
WritingElement_ReadAttributes_Read_else_if( oReader, L"smtClean", smtClean)
WritingElement_ReadAttributes_Read_else_if( oReader, L"smtId", smtId)
WritingElement_ReadAttributes_Read_else_if( oReader, L"strike", strike)
WritingElement_ReadAttributes_Read_else_if( oReader, L"sz", sz)
WritingElement_ReadAttributes_Read_else_if( oReader, L"u", u)
WritingElement_ReadAttributes_Read_else_if( oReader, L"baseline", baseline)
WritingElement_ReadAttributes_Read_else_if( oReader, L"spc", spc)
WritingElement_ReadAttributes_End ( oReader )
Normalize();
......@@ -244,25 +445,25 @@ namespace PPTX
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("kumimoji"), kumimoji);
pWriter->WriteAttribute(_T("lang"), lang);
pWriter->WriteAttribute(_T("altLang"), altLang);
pWriter->WriteAttribute(_T("sz"), sz);
pWriter->WriteAttribute(_T("b"), b);
pWriter->WriteAttribute(_T("i"), i);
pWriter->WriteAttribute(_T("u"), u);
pWriter->WriteAttribute(_T("strike"), strike);
pWriter->WriteAttribute(_T("kern"), kern);
pWriter->WriteAttribute(_T("cap"), cap);
pWriter->WriteAttribute(_T("spc"), spc);
pWriter->WriteAttribute(_T("normalizeH"), normalizeH);
pWriter->WriteAttribute(_T("baseline"), baseline);
pWriter->WriteAttribute(_T("noProof"), noProof);
pWriter->WriteAttribute(_T("dirty"), dirty);
pWriter->WriteAttribute(_T("err"), err);
pWriter->WriteAttribute(_T("smtClean"), smtClean);
pWriter->WriteAttribute(_T("smtId"), smtId);
pWriter->WriteAttribute(_T("bmk"), bmk);
pWriter->WriteAttribute(L"kumimoji", kumimoji);
pWriter->WriteAttribute(L"lang", lang);
pWriter->WriteAttribute(L"altLang", altLang);
pWriter->WriteAttribute(L"sz", sz);
pWriter->WriteAttribute(L"b", b);
pWriter->WriteAttribute(L"i", i);
pWriter->WriteAttribute(L"u", u);
pWriter->WriteAttribute(L"strike", strike);
pWriter->WriteAttribute(L"kern", kern);
pWriter->WriteAttribute(L"cap", cap);
pWriter->WriteAttribute(L"spc", spc);
pWriter->WriteAttribute(L"normalizeH", normalizeH);
pWriter->WriteAttribute(L"baseline", baseline);
pWriter->WriteAttribute(L"noProof", noProof);
pWriter->WriteAttribute(L"dirty", dirty);
pWriter->WriteAttribute(L"err", err);
pWriter->WriteAttribute(L"smtClean", smtClean);
pWriter->WriteAttribute(L"smtId", smtId);
pWriter->WriteAttribute(L"bmk", bmk);
pWriter->EndAttributes();
......@@ -276,6 +477,10 @@ namespace PPTX
pWriter->Write(hlinkClick);
pWriter->Write(hlinkMouseOver);
pWriter->Write(rtl);
pWriter->Write(uFill);
pWriter->Write(uFillTx);
pWriter->Write(uFillTx);
pWriter->Write(highlight);
pWriter->EndNode(m_name);
}
......@@ -289,13 +494,18 @@ namespace PPTX
if(ln.is_init())
ln->Merge(props->ln);
if(Fill.is_init())
props->Fill = Fill;//.fromXML(Fill.toXML());
props->Fill = Fill;
if(uFill.is_init())
uFill->Merge(props->uFill);
if(uFillTx.is_init())
uFillTx->Merge(props->uFillTx);
if (highlight.is_init())
highlight->Merge(props->highlight);
// EffectProperties EffectList;
//highlight (Highlight Color) §21.1.2.3.4
//uLn (Underline Stroke) §21.1.2.3.14
//uLnTx (Underline Follows Text) §21.1.2.3.15
//uFill (Underline Fill) §21.1.2.3.12
//uFillTx (Underline Fill Properties Follow Text) §21.1.2.3.13
if(latin.is_init()) latin->Merge(props->latin);
if(ea.is_init()) ea->Merge(props->ea);
......@@ -304,53 +514,52 @@ namespace PPTX
/*
nullable_property<Hyperlink> hlinkClick;
nullable_property<Hyperlink> hlinkMouseOver;
//rtl (Right to Left Run) §21.1.2.2.8
*/
// Attributes
if(altLang.is_init()) props->altLang = *altLang;
if(b.is_init()) props->b = *b;
if(baseline.is_init()) props->baseline = *baseline;
if(bmk.is_init()) props->bmk = *bmk;
if(cap.is_init()) props->cap = *cap;
if(dirty.is_init()) props->dirty = *dirty;
if(err.is_init()) props->err = *err;
if(i.is_init()) props->i = *i;
if(kern.is_init()) props->kern = *kern;
if(kumimoji.is_init()) props->kumimoji = *kumimoji;
if(lang.is_init()) props->lang = *lang;
if(noProof.is_init()) props->noProof = *noProof;
if(normalizeH.is_init()) props->normalizeH = *normalizeH;
if(smtClean.is_init()) props->smtClean = *smtClean;
if(smtId.is_init()) props->smtId = *smtId;
if(spc.is_init()) props->spc = *spc;
if(strike.is_init()) props->strike = *strike;
if(sz.is_init()) props->sz = *sz;
if(u.is_init()) props->u = *u;
if(rtl.is_init()) props->rtl = new Logic::Rtl();
if(altLang.is_init()) props->altLang = *altLang;
if(b.is_init()) props->b = *b;
if(baseline.is_init()) props->baseline = *baseline;
if(bmk.is_init()) props->bmk = *bmk;
if(cap.is_init()) props->cap = *cap;
if(dirty.is_init()) props->dirty = *dirty;
if(err.is_init()) props->err = *err;
if(i.is_init()) props->i = *i;
if(kern.is_init()) props->kern = *kern;
if(kumimoji.is_init()) props->kumimoji = *kumimoji;
if(lang.is_init()) props->lang = *lang;
if(noProof.is_init()) props->noProof = *noProof;
if(normalizeH.is_init())props->normalizeH = *normalizeH;
if(smtClean.is_init()) props->smtClean = *smtClean;
if(smtId.is_init()) props->smtId = *smtId;
if(spc.is_init()) props->spc = *spc;
if(strike.is_init()) props->strike = *strike;
if(sz.is_init()) props->sz = *sz;
if(u.is_init()) props->u = *u;
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteString2(0, altLang);
pWriter->WriteBool2(1, b);
pWriter->WriteInt2(2, baseline);
pWriter->WriteString2(3, bmk);
pWriter->WriteLimit2(4, cap);
pWriter->WriteBool2(5, dirty);
pWriter->WriteBool2(6, err);
pWriter->WriteBool2(7, i);
pWriter->WriteInt2(8, kern);
pWriter->WriteBool2(9, kumimoji);
pWriter->WriteString2(10, lang);
pWriter->WriteBool2(11, noProof);
pWriter->WriteBool2(12, normalizeH);
pWriter->WriteBool2(13, smtClean);
pWriter->WriteInt2(14, smtId);
pWriter->WriteInt2(15, spc);
pWriter->WriteLimit2(16, strike);
pWriter->WriteInt2(17, sz);
pWriter->WriteLimit2(18, u);
pWriter->WriteString2(0, altLang);
pWriter->WriteBool2 (1, b);
pWriter->WriteInt2 (2, baseline);
pWriter->WriteString2(3, bmk);
pWriter->WriteLimit2(4, cap);
pWriter->WriteBool2 (5, dirty);
pWriter->WriteBool2 (6, err);
pWriter->WriteBool2 (7, i);
pWriter->WriteInt2 (8, kern);
pWriter->WriteBool2 (9, kumimoji);
pWriter->WriteString2(10, lang);
pWriter->WriteBool2 (11, noProof);
pWriter->WriteBool2 (12, normalizeH);
pWriter->WriteBool2 (13, smtClean);
pWriter->WriteInt2 (14, smtId);
pWriter->WriteInt2 (15, spc);
pWriter->WriteLimit2(16, strike);
pWriter->WriteInt2 (17, sz);
pWriter->WriteLimit2(18, u);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
......@@ -366,6 +575,11 @@ namespace PPTX
pWriter->WriteRecord2(7, hlinkClick);
pWriter->WriteRecord2(8, hlinkMouseOver);
pWriter->WriteRecord2(9, rtl);
pWriter->WriteRecord2(10, uFill);
pWriter->WriteRecord2(11, uFillTx);
pWriter->WriteRecord2(12, highlight);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
......@@ -503,35 +717,34 @@ namespace PPTX
}
case 2:
{
// TODO:
pReader->SkipRecord();
EffectList.fromPPTY(pReader);
break;
}
case 3:
{
latin = new Logic::TextFont();
latin->m_name = _T("a:latin");
latin->m_name = L"a:latin";
latin->fromPPTY(pReader);
break;
}
case 4:
{
ea = new Logic::TextFont();
ea->m_name = _T("a:ea");
ea->m_name = L"a:ea";
ea->fromPPTY(pReader);
break;
}
case 5:
{
cs = new Logic::TextFont();
cs->m_name = _T("a:cs");
cs->m_name = L"a:cs";
cs->fromPPTY(pReader);
break;
}
case 6:
{
sym = new Logic::TextFont();
sym->m_name = _T("a:sym");
sym->m_name = L"a:sym";
sym->fromPPTY(pReader);
break;
}
......@@ -546,6 +759,26 @@ namespace PPTX
hlinkMouseOver = new Logic::Hyperlink(L"hlinkMouseOver");
hlinkMouseOver->fromPPTY(pReader);
}
case 9:
{
rtl = new Logic::Rtl();
rtl->fromPPTY(pReader);
}
case 10:
{
uFill = new Logic::UFillTx(L"a:uFill");
uFill->fromPPTY(pReader);
}
case 11:
{
uFillTx = new Logic::UFillTx(L"a:uFillTx");
uFillTx->fromPPTY(pReader);
}
case 12:
{
highlight = new Logic::Highlight();
highlight->fromPPTY(pReader);
}
default:
{
pReader->SkipRecord();
......@@ -556,16 +789,15 @@ namespace PPTX
pReader->Seek(_end_rec);
}
public:
//Childs
//Childs
//uLn (Underline Stroke) §21.1.2.3.14
//uLnTx (Underline Follows Text) §21.1.2.3.15
nullable<Ln> ln;
UniFill Fill;
EffectProperties EffectList;
//highlight (Highlight Color) §21.1.2.3.4
//uLn (Underline Stroke) §21.1.2.3.14
//uLnTx (Underline Follows Text) §21.1.2.3.15
//uFill (Underline Fill) §21.1.2.3.12
//uFillTx (Underline Fill Properties Follow Text) §21.1.2.3.13
nullable<Highlight> highlight;
nullable<UFillTx> uFill;
nullable<UFillTx> uFillTx;
nullable<TextFont> latin;
nullable<TextFont> ea;
nullable<TextFont> cs;
......@@ -574,7 +806,7 @@ namespace PPTX
nullable<Hyperlink> hlinkMouseOver;
nullable<Rtl> rtl;
// Attributes
// Attributes
nullable_string altLang;
nullable_bool b;
nullable_int baseline;
......@@ -594,6 +826,7 @@ namespace PPTX
nullable_limit<Limit::TextStrike> strike;
nullable_int sz;
nullable_limit<Limit::TextUnderline> u;
std::wstring m_name;
protected:
virtual void FillParentPointersForChilds()
......@@ -614,6 +847,14 @@ namespace PPTX
hlinkClick->SetParentPointer(this);
if(hlinkMouseOver.is_init())
hlinkMouseOver->SetParentPointer(this);
if(rtl.is_init())
rtl->SetParentPointer(this);
if(uFill.is_init())
uFill->SetParentPointer(this);
if(uFillTx.is_init())
uFillTx->SetParentPointer(this);
if (highlight.is_init())
highlight->SetParentPointer(this);
}
AVSINLINE void Normalize()
......
......@@ -330,6 +330,8 @@ namespace OOX
et_a_txDef, // <a:txDef>
et_a_up, // <a:up>
et_a_xfrm, // <a:xfrm>
et_a_uFillTx,
et_a_highlight,
et_a_groupSpPr, // <a:groupSpPr>
et_a_Shape, // <a:sp>
......
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