Commit ffefc7ba authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

(1.0.0.142): ASCOfficeOdfFile

презентации: стили теста, параграфов,списков

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52956 954022d7-b5bf-4e40-9824-e11837661b57
parent 4e5d17e4
......@@ -309,6 +309,10 @@
RelativePath=".\src\odf\style_paragraph_properties_docx.cpp"
>
</File>
<File
RelativePath=".\src\odf\style_paragraph_properties_pptx.cpp"
>
</File>
<File
RelativePath=".\src\odf\style_presentation.cpp"
>
......
......@@ -515,7 +515,7 @@ void docx_conversion_context::end_process_style_content()
void docx_conversion_context::docx_serialize_paragraph_style(std::wostream & strm, const std::wstring & ParentId)
{
std::wstringstream & paragraph_style = get_styles_context().paragraph_style();
std::wstringstream & paragraph_style = get_styles_context().paragraph_nodes();
if (!paragraph_style.str().empty() || !ParentId.empty())
{
CP_XML_WRITER(strm)
......
#ifndef _CPDOCCORE_DOCX_CONVERSIONCONTEXT_H_
#define _CPDOCCORE_DOCX_CONVERSIONCONTEXT_H_
#pragma once
#include "../odf/stylefamily.h"
#include "../odf/length.h"
#include <boost/unordered_map.hpp>
......@@ -565,5 +565,3 @@ private:
}
}
#endif
......@@ -26,8 +26,11 @@ void styles_context::start()
text_style_.str( std::wstring() );
text_style_.clear();
paragraph_style_.str( std::wstring() );
paragraph_style_.clear();
paragraph_nodes_.str( std::wstring() );
paragraph_nodes_.clear();
paragraph_attr_.str( std::wstring() );
paragraph_attr_.clear();
table_style_.str( std::wstring() );
table_style_.clear();
......@@ -44,9 +47,14 @@ std::wstringstream & styles_context::text_style()
return text_style_;
}
std::wstringstream & styles_context::paragraph_style()
std::wstringstream & styles_context::paragraph_nodes()
{
return paragraph_nodes_;
}
std::wstringstream & styles_context::paragraph_attr()
{
return paragraph_style_;
return paragraph_attr_;
}
std::wstringstream & styles_context::table_style()
......
......@@ -16,7 +16,8 @@ public:
void start();
std::wstringstream & text_style();
std::wstringstream & paragraph_style();
std::wstringstream & paragraph_nodes();
std::wstringstream & paragraph_attr();
std::wstringstream & table_style();
std::wstringstream & list_style();
......@@ -35,7 +36,8 @@ private:
std::wstringstream list_style_;
std::wstringstream text_style_;
std::wstringstream paragraph_style_;
std::wstringstream paragraph_nodes_;
std::wstringstream paragraph_attr_;
std::wstringstream table_style_;
};
......
......@@ -55,14 +55,14 @@ static const std::wstring _ooxDashStyle[]=
L"sysDashDotDot"
};
void oox_serialize_ln(std::wostream & strm, const std::vector<odf::_property> & properties)
void oox_serialize_ln(std::wostream & strm, const std::vector<odf::_property> & prop)
{
_CP_OPT(std::wstring) strVal;
_CP_OPT(int) iVal;
_CP_OPT(double) dVal;
odf::GetProperty(properties,L"stroke-color",strVal);
odf::GetProperty(properties,L"stroke",iVal);
odf::GetProperty(properties,L"stroke-width",dVal);
odf::GetProperty(prop,L"stroke-color",strVal);
odf::GetProperty(prop,L"stroke",iVal);
odf::GetProperty(prop,L"stroke-width",dVal);
if (!strVal && !iVal && !dVal)return;
CP_XML_WRITER(strm)
......@@ -93,7 +93,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf::_property> &
CP_XML_NODE(L"a:srgbClr")
{
CP_XML_ATTR(L"val",color);
odf::GetProperty(properties,L"stroke-opacity",strVal);
odf::GetProperty(prop,L"stroke-opacity",strVal);
if (strVal)CP_XML_NODE(L"a:alpha"){CP_XML_ATTR(L"val",strVal.get());}
}
......@@ -103,12 +103,12 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf::_property> &
{
CP_XML_NODE(L"a:prstDash"){CP_XML_ATTR(L"val",dash_style);}
}
odf::GetProperty(properties,L"marker-start",strVal);
odf::GetProperty(prop,L"marker-start",strVal);
if (strVal)
{
CP_XML_NODE(L"a:headEnd"){CP_XML_ATTR(L"type",strVal.get());}
}
odf::GetProperty(properties,L"marker-end",strVal);
odf::GetProperty(prop,L"marker-end",strVal);
if (strVal)
{
CP_XML_NODE(L"a:tailEnd"){CP_XML_ATTR(L"type",strVal.get());}
......@@ -116,10 +116,10 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf::_property> &
}
}
}
void oox_serialize_aLst(std::wostream & strm, const std::vector<odf::_property> & properties)
void oox_serialize_aLst(std::wostream & strm, const std::vector<odf::_property> & prop)
{
_CP_OPT(int) iShapeIndex;
odf::GetProperty(properties,L"draw-type-index",iShapeIndex);
odf::GetProperty(prop,L"draw-type-index",iShapeIndex);
if (!iShapeIndex)return;
......@@ -128,7 +128,7 @@ void oox_serialize_aLst(std::wostream & strm, const std::vector<odf::_property>
CP_XML_NODE(L"a:avLst")
{
_CP_OPT(std::wstring) strVal;
if (odf::GetProperty(properties,L"draw-modifiers",strVal))
if (odf::GetProperty(prop,L"draw-modifiers",strVal))
{
std::vector< std::wstring > values;
boost::algorithm::split(values, strVal.get(), boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
......@@ -139,8 +139,8 @@ void oox_serialize_aLst(std::wostream & strm, const std::vector<odf::_property>
int i=1;
_CP_OPT(int) iMax,iMin;
odf::GetProperty(properties,L"draw-modifiers-min",iMin);
odf::GetProperty(properties,L"draw-modifiers-max",iMax);
odf::GetProperty(prop,L"draw-modifiers-min",iMin);
odf::GetProperty(prop,L"draw-modifiers-max",iMax);
values.resize(_OO_OOX_custom_shapes[*iShapeIndex].count_values);
BOOST_FOREACH(std::wstring & v, values)
......@@ -174,6 +174,37 @@ void oox_serialize_aLst(std::wostream & strm, const std::vector<odf::_property>
}
}
}
void oox_serialize_bodyPr(std::wostream & strm, const std::vector<odf::_property> & prop)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:bodyPr")
{
_CP_OPT(int) iAlign;
odf::GetProperty(prop,L"textalign-horizontal",iAlign);
//if (iAlign) CP_XML_ATTR(L"name", val.name);
odf::GetProperty(prop,L"textalign-vertiacal",iAlign);
if (iAlign)
{
switch (iAlign.get())
{
case 0://Baseline,
CP_XML_ATTR(L"anchor", L"dist");break;
case 1://Top,
case 4://Auto,
CP_XML_ATTR(L"anchor", L"t");break;
case 2://Middle,
CP_XML_ATTR(L"anchor", L"ctr");break;
case 3://Bottom,
CP_XML_ATTR(L"anchor", L"b");break;
case 5://Justify
CP_XML_ATTR(L"anchor", L"just");break;
}
}
}
}
}
void oox_serialize_shape(std::wostream & strm, _oox_drawing const & val)
{
_CP_OPT(std::wstring) strVal;
......
......@@ -65,7 +65,7 @@ struct _oox_drawing
friend void oox_serialize_ln (std::wostream & _Wostream, const std::vector<odf::_property> & val);
friend void oox_serialize_hlink (std::wostream & _Wostream, const std::vector<_hlink_desc> & val);
friend void oox_serialize_clipping(std::wostream & strm, _oox_drawing const & val);
friend void oox_serialize_bodyPr(std::wostream & strm, const std::vector<odf::_property> & val);
};
}
......
......@@ -32,7 +32,7 @@ void pptx_serialize_text(std::wostream & strm, const std::vector<odf::_property>
{
CP_XML_NODE(L"p:txBody")
{
CP_XML_NODE(L"a:bodyPr");
oox_serialize_bodyPr(CP_XML_STREAM(),properties);
if (strTextContent)
{
......
......@@ -39,6 +39,7 @@ public:
std::wstring end_drawing_content();
void ApplyTextProperties(std::wstring style,odf::text_format_properties_content & propertiesOut, odf::style_family::type Type);
void ApplyParagraphProperties(std::wstring style,odf::paragraph_format_properties & propertiesOut, odf::style_family::type Type);
void set_local_styles_container(odf::styles_container* local_styles_);//
......@@ -50,6 +51,7 @@ public:
void start_list_item(bool restart = false);
void end_list_item();
bool in_list_;
private:
styles_context styles_context_;
......@@ -59,7 +61,6 @@ private:
bool in_span;
bool in_paragraph;
bool in_list;
odf::styles_container * local_styles_ptr_;
......@@ -131,8 +132,6 @@ void pptx_text_context::Impl::start_paragraph(const std::wstring & styleName)
}
styles_paragraph_ = styleName;
in_paragraph = true;
get_styles_context().start();
}
void pptx_text_context::Impl::end_paragraph()
......@@ -154,8 +153,10 @@ void pptx_text_context::Impl::start_span(const std::wstring & styleName)//
void pptx_text_context::Impl::end_span()
{
dump_run();
styles_span_ = L"";
in_span=false;
in_span = false;
}
std::wstring pptx_text_context::Impl::end_span2()
......@@ -175,50 +176,82 @@ void pptx_text_context::Impl::end_hyperlink(std::wstring hId)
{
hyperlink_hId = hId;
}
void pptx_text_context::Impl::ApplyTextProperties(std::wstring style,odf::text_format_properties_content & propertiesOut, odf::style_family::type Type)
{
std::vector<const odf::style_instance *> instances;
odf::style_instance * defaultStyle = NULL;
odf::style_instance* styleInst = NULL;
if (local_styles_ptr_)
{
odf::style_instance * defaultStyle = local_styles_ptr_->style_default_by_type(Type);
if (defaultStyle)instances.push_back(defaultStyle);
defaultStyle = local_styles_ptr_->style_default_by_type(Type);
odf::style_instance* styleInst = local_styles_ptr_->style_by_name(style, Type,false/*process_headers_footers_*/);
if(styleInst)instances.push_back(styleInst);
styleInst = local_styles_ptr_->style_by_name(style, Type,false/*process_headers_footers_*/);
}
else
{
odf::style_instance * defaultStyle = odf_context_.styleContainer().style_default_by_type(Type);
if (defaultStyle)instances.push_back(defaultStyle);
defaultStyle = odf_context_.styleContainer().style_default_by_type(Type);
odf::style_instance* styleInst = odf_context_.styleContainer().style_by_name(style, Type,false/*process_headers_footers_*/);
if(styleInst)instances.push_back(styleInst);
styleInst = odf_context_.styleContainer().style_by_name(style, Type,false/*process_headers_footers_*/);
}
if (defaultStyle)instances.push_back(defaultStyle);
if(styleInst)instances.push_back(styleInst);
get_styles_context().start_process_style(styleInst);
propertiesOut.apply_from(calc_text_properties_content(instances));
}
void pptx_text_context::Impl::write_pPr(std::wostream & strm)
void pptx_text_context::Impl::ApplyParagraphProperties(std::wstring style,odf::paragraph_format_properties & propertiesOut, odf::style_family::type Type)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:pPr")
std::vector<const odf::style_instance *> instances;
odf::style_instance* styleInst = NULL;
odf::style_instance * defaultStyle = NULL;
if (local_styles_ptr_)
{
if (!list_style_stack_.empty())
defaultStyle = local_styles_ptr_->style_default_by_type(Type);
styleInst = local_styles_ptr_->style_by_name(style, Type,false/*process_headers_footers_*/);
}
else
{
int level = list_style_stack_.size()-1;
CP_XML_ATTR(L"lvl",level);
//if (styles_paragraph_.length()>0)
defaultStyle = odf_context_.styleContainer().style_default_by_type(Type);
styleInst = odf_context_.styleContainer().style_by_name(style, Type,false/*process_headers_footers_*/);
}
if (defaultStyle)instances.push_back(defaultStyle);
if(styleInst)instances.push_back(styleInst);
get_styles_context().start_process_style(styleInst);
propertiesOut.apply_from(calc_paragraph_properties_content(instances));
}
void pptx_text_context::Impl::write_pPr(std::wostream & strm)
{
get_styles_context().start();
//CP_XML_WRITER(strm)
//{
// if (odf::style_instance * styleInst= odf_context_.styleContainer().style_by_name(styles_paragraph_, odf::style_family::Paragraph,false) )
// CP_XML_NODE(L"a:pPr")
// {
// }
//}
//write_list_properties(strm);
strm << L"<a:pPr ";
int level = list_style_stack_.size()-1;
if (level>=0)
strm << L"lvl=\"" << level << L"\" ";
odf::paragraph_format_properties paragraph_format_properties_;
ApplyParagraphProperties (styles_paragraph_, paragraph_format_properties_,odf::style_family::Paragraph);
paragraph_format_properties_.pptx_convert(pptx_context_);
strm << get_styles_context().paragraph_attr().str();
strm << ">";
strm << get_styles_context().paragraph_nodes().str();
odf::list_style_container & list_styles = odf_context_.listStyleContainer();
if (!list_styles.empty())
if (!list_styles.empty() && level>=0)
{
odf::text_list_style * s = list_styles.list_style_by_name(list_style_stack_.back());
if (s)
......@@ -228,21 +261,13 @@ void pptx_text_context::Impl::write_pPr(std::wostream & strm)
{
elm->pptx_convert(pptx_context_);
}
CP_XML_STREAM() << get_styles_context().list_style().str();
}
strm << get_styles_context().list_style().str();
}
}
//else
//{
// if (style_text_properties * textProperties = dynamic_cast<style_text_properties *>(style_text_properties_.get()))
// {
// textProperties->content().pptx_convert(Context);
// CP_XML_STREAM() << get_styles_context().text_style().str();
strm << L"</a:pPr>";
// }
//}
}
}
}
void pptx_text_context::Impl::write_rPr(std::wostream & strm)
......@@ -260,65 +285,11 @@ void pptx_text_context::Impl::write_rPr(std::wostream & strm)
text_properties_.apply_from(text_properties_paragraph_);
text_properties_.apply_from(text_properties_span_);
get_styles_context().start();
text_properties_.pptx_convert(pptx_context_);
strm << get_styles_context().text_style().str();
//_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_)
// sValFontFamily=text_properties_.fo_font_family_.get();
////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)
// {
// //oox_serialize_style_text(strm,text_properties_);
// //oox_serialize_style_text(strm,odf::text_format_properties_content & properties);
// CP_XML_NODE(L"a:rPr")
// {
// // 3197
// if (dValFontSize) {CP_XML_ATTR(L"sz", (int)(dValFontSize.get()*100));}
// if ((iValFontStyle) && (iValFontStyle.get() >0)) {CP_XML_ATTR(L"i", "true");}
// if ((iValFontWeight) && (iValFontWeight.get() >0)) {CP_XML_ATTR(L"b", "true");}
// if (sValFontFamily) {CP_XML_ATTR(L"typeface", sValFontFamily.get());}
//
// if (sValFontColor){CP_XML_NODE(L"a:solidFill") {CP_XML_NODE(L"a:srgbClr"){CP_XML_ATTR(L"val", sValFontColor.get());}}}
// if (hyperlink_hId.length()>0)
// {
// 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", hyperlink_hId);
// }
// }
// }
//CP_XML_NODE(L"charset")
//{
// CP_XML_ATTR(L"val",204);
//}
//CP_XML_NODE(L"family")
//{
// CP_XML_ATTR(L"val",2);
//}
//}
}
std::wstring pptx_text_context::Impl::dump_paragraph()
{
......@@ -379,8 +350,6 @@ void pptx_text_context::Impl::start_drawing_content()
styles_paragraph_ = L"";
styles_span_ = L"";
get_styles_context().start();
}
std::wstring pptx_text_context::Impl::end_drawing_content()
......@@ -403,7 +372,7 @@ std::wstring pptx_text_context::Impl::end_drawing_content()
}
void pptx_text_context::Impl::start_list_item(bool restart)
{
in_list = true;
in_list_ = true;
first_element_list_item_ = true;
if (restart && !list_style_stack_.empty())
......@@ -438,7 +407,7 @@ void pptx_text_context::Impl::start_list(const std::wstring & StyleName, bool Co
void pptx_text_context::Impl::end_list()
{
in_list = false;
in_list_ = false;
list_style_stack_.pop_back();// .. lstStyles -
}
......@@ -465,7 +434,7 @@ void pptx_text_context::Impl::end_list_item()
paragraphs_cout_--;
styles_paragraph_ = L"";
in_list = false;
in_list_ = false;
}
void pptx_text_context::Impl::write_list_properties(std::wostream & strm)
......@@ -495,9 +464,6 @@ void pptx_text_context::Impl::write_list_styles(std::wostream & strm)//defaults
if (list_styles.empty())
return;
get_styles_context().start();
get_styles_context().extern_node() = L"a:defRPr";
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:lstStyle");
......@@ -545,7 +511,10 @@ void pptx_text_context::add_text(const std::wstring & text)
{
return impl_->add_text(text);
}
bool pptx_text_context::in_list()
{
return impl_->in_list_;
}
void pptx_text_context::start_paragraph(const std::wstring & styleName)
{
return impl_->start_paragraph(styleName);
......
......@@ -46,7 +46,7 @@ public:
void start_hyperlink();
void end_hyperlink(std::wstring hId);
bool is_drawing_context();
bool in_list();
void start_list(const std::wstring & StyleName, bool Continue = false);
void end_list();
......
......@@ -184,13 +184,6 @@ public:
}
}
}
//_Wostream << L"<borders count=\"" << inst_array.size() << "\" >";
//BOOST_FOREACH(const xlsx_border & border, inst_array)
//{
// ::cpdoccore::oox::xlsx_serialize(_Wostream, border);
//}
//_Wostream << L"</borders>";
}
private:
......
......@@ -31,7 +31,7 @@ void xlsx_serialize_text(std::wostream & strm, const std::vector<odf::_property>
{
CP_XML_NODE(L"xdr:txBody")
{
CP_XML_NODE(L"a:bodyPr");
oox_serialize_bodyPr(CP_XML_STREAM(),properties);
CP_XML_NODE(L"a:lstStyle");
CP_XML_NODE(L"a:p")
{
......
......@@ -169,7 +169,8 @@ style_instance * styles_container::style_by_name(const std::wstring & Name, styl
if (res != map_.end())
{
return instances_[res->second].get();
int index = res->second;
return instances_[index].get();
}
else
return NULL;
......
#ifndef _CPDOCCORE_ODF_OFFCIE_ELEMENTS_H_
#define _CPDOCCORE_ODF_OFFCIE_ELEMENTS_H_
#ifdef _MSC_VER
#pragma once
#endif
#include <vector>
......@@ -131,4 +126,3 @@ public:
}
}
#endif // #ifndef _CPDOCCORE_ODF_OFFCIE_ELEMENTS_H_
......@@ -22,6 +22,8 @@ void graphic_format_properties::add_attributes( const xml::attributes_wc_ptr & A
CP_APPLY_ATTR(L"draw:marker-end", draw_marker_end_);
CP_APPLY_ATTR(L"draw:opacity", draw_opacity_);
CP_APPLY_ATTR(L"draw:wrap-influence-on-position", draw_wrap_influence_on_position_);
CP_APPLY_ATTR(L"draw:textarea-horizontal-align", draw_textarea_horizontal_align_);
CP_APPLY_ATTR(L"draw:textarea-vertical-align", draw_textarea_vertical_align_);
CP_APPLY_ATTR(L"svg:stroke-color", svg_stroke_color_);
CP_APPLY_ATTR(L"svg:stroke-width", svg_stroke_width_);
......@@ -65,22 +67,20 @@ void graphic_format_properties::add_attributes( const xml::attributes_wc_ptr & A
void graphic_format_properties::apply_to(std::vector<_property> & properties)
{
if (draw_fill_color_) properties.push_back(_property(L"fill-color", draw_fill_color_.get().get_hex_value() ));
if (svg_stroke_color_) properties.push_back(_property(L"stroke-color", svg_stroke_color_.get().get_hex_value() ));
if (draw_fill_color_) properties.push_back(_property(L"fill-color", draw_fill_color_->get_hex_value() ));
if (svg_stroke_color_) properties.push_back(_property(L"stroke-color", svg_stroke_color_->get_hex_value() ));
if (draw_fill_) properties.push_back(_property(L"fill", draw_fill_.get()));
if (draw_stroke_) properties.push_back(_property(L"stroke", draw_stroke_.get().get_type() ));
if (draw_stroke_) properties.push_back(_property(L"stroke", draw_stroke_->get_type() ));
if (draw_stroke_dash_) properties.push_back(_property(L"stroke-dash", draw_stroke_dash_.get()));
if (svg_stroke_width_) properties.push_back(_property(L"stroke-width", svg_stroke_width_.get().get_length().get_value_unit(odf::length::pt) ));
if (draw_opacity_) properties.push_back(_property(L"opacity", draw_opacity_.get().get_percent().get_value()));
if (svg_stroke_opacity_)properties.push_back(_property(L"stroke-opacity",svg_stroke_opacity_.get().get_percent().get_value()));
if (draw_marker_start_) properties.push_back(_property(L"marker-start", draw_marker_start_.get().get() ));
if (draw_marker_end_) properties.push_back(_property(L"marker-end", draw_marker_end_.get().get() ));
if (svg_stroke_width_) properties.push_back(_property(L"stroke-width", svg_stroke_width_->get_length().get_value_unit(odf::length::pt) ));
if (draw_opacity_) properties.push_back(_property(L"opacity", draw_opacity_->get_percent().get_value()));
if (svg_stroke_opacity_)properties.push_back(_property(L"stroke-opacity",svg_stroke_opacity_->get_percent().get_value()));
if (draw_marker_start_) properties.push_back(_property(L"marker-start", draw_marker_start_->get() ));
if (draw_marker_end_) properties.push_back(_property(L"marker-end", draw_marker_end_->get() ));
if (draw_textarea_horizontal_align_)properties.push_back(_property(L"textalign-horizontal", draw_textarea_horizontal_align_->get_type() ));
if (draw_textarea_vertical_align_)properties.push_back(_property(L"textalign-vertical", draw_textarea_vertical_align_->get_type() ));
//if (draw_fill_gradient_name_)
//{
// //parsing
//}
}
void graphic_format_properties::apply_from(const graphic_format_properties & Other)
{
......@@ -91,6 +91,8 @@ void graphic_format_properties::apply_from(const graphic_format_properties & Oth
_CP_APPLY_PROP2(draw_marker_start_);
_CP_APPLY_PROP2(draw_marker_end_);
_CP_APPLY_PROP2(draw_opacity_);
_CP_APPLY_PROP2(draw_textarea_horizontal_align_);
_CP_APPLY_PROP2(draw_textarea_vertical_align_);
_CP_APPLY_PROP2(svg_stroke_color_);
_CP_APPLY_PROP2(svg_stroke_width_);
......@@ -148,9 +150,5 @@ void style_graphic_properties::add_child_element( xml::sax * Reader, const ::std
CP_NOT_APPLICABLE_ELM();
}
void style_graphic_properties::docx_convert(oox::docx_conversion_context & Context)
{
}
}
}
......@@ -22,6 +22,8 @@
#include "runthrough.h"
#include "linestyle.h"
#include "markerstyle.h"
#include "verticalalign.h"
namespace cpdoccore {
namespace odf {
......@@ -39,10 +41,8 @@ public:
// 1
common_draw_rel_size_attlist common_draw_rel_size_attlist_;
_CP_OPT(length_or_percent) fo_min_width_;
// 2
_CP_OPT(length_or_percent) fo_min_height_;
// 3
_CP_OPT(length_or_percent) fo_max_width_;
_CP_OPT(length_or_percent) fo_max_height_;
......@@ -60,85 +60,61 @@ public:
_CP_OPT(marker_style) draw_marker_end_;
_CP_OPT(marker_style) draw_marker_start_;
// 4
_CP_OPT(text_align) draw_textarea_horizontal_align_;
_CP_OPT(vertical_align) draw_textarea_vertical_align_;
common_horizontal_margin_attlist common_horizontal_margin_attlist_;
// 5
common_vertical_margin_attlist common_vertical_margin_attlist_;
// 6
common_margin_attlist common_margin_attlist_;
// 7
_CP_OPT(bool) style_print_content_;
// 8
_CP_OPT(std::wstring) style_protect_;
// 9
common_horizontal_pos_attlist common_horizontal_pos_attlist_;
// 10
common_horizontal_rel_attlist common_horizontal_rel_attlist_;
// 11
common_vertical_pos_attlist common_vertical_pos_attlist_;
// 12
common_vertical_rel_attlist common_vertical_rel_attlist_;
// 13
common_text_anchor_attlist common_text_anchor_attlist_;
// 14
common_border_attlist common_border_attlist_;
// 15
common_border_line_width_attlist common_border_line_width_attlist_;
// 16
common_padding_attlist common_padding_attlist_;
// 17
common_shadow_attlist common_shadow_attlist_;
// 18
common_background_color_attlist common_background_color_attlist_;
// 20
_CP_OPT(bool) style_editable_;
// 21
_CP_OPT(style_wrap) style_wrap_;
// 22
_CP_OPT(unsigned int) style_wrap_dynamic_treshold_;
// 23
_CP_OPT(integer_or_nolimit) style_number_wrapped_paragraphs_;
// 24
_CP_OPT(bool) style_wrap_contour_;
// 25
_CP_OPT(wrap_contour_mode) style_wrap_contour_mode_;
// 26
_CP_OPT(run_through) style_run_through_;
// 27
_CP_OPT(bool) style_flow_with_text_;
// 28
_CP_OPT(std::wstring) style_overflow_behavior_;
// 29
_CP_OPT(std::wstring) style_mirror_;
// 30
_CP_OPT(std::wstring) fo_clip_;
// 31
_CP_OPT(std::wstring) draw_wrap_influence_on_position_;
office_element_ptr style_background_image_;
......@@ -156,11 +132,9 @@ public:
static const ElementType type = typeStyleGraphicPropertis;
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context) ;
const graphic_format_properties & content() const { return graphic_format_properties_; }
//std::vector<_property> content_;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
......
......@@ -2,6 +2,10 @@
#include <iosfwd>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/CPOptional.h>
#include "office_elements.h"
#include "office_elements_create.h"
#include "linewidth.h"
#include "length.h"
......@@ -33,11 +37,19 @@
#include "office_binary_data.h"
#include "common_attlists.h"
#include "office_elements.h"
#include "office_elements_create.h"
#include "../docx/docx_conversion_context.h"
//#include "office_elements.h"
//#include "office_elements_create.h"
namespace cpdoccore { namespace odf {
namespace cpdoccore{
namespace oox{
class docx_conversion_context;
class pptx_conversion_context;
};
namespace odf {
/// \class style_tab_stop
class style_tab_stop : public office_element_impl<style_tab_stop>
......@@ -50,10 +62,9 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
......@@ -90,10 +101,9 @@ public:
size_t size() const { return style_tab_stops_.size(); }
public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
private:
......@@ -130,8 +140,6 @@ private:
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
_CP_OPT(common_draw_data_attlist) common_draw_data_attlist_;
};
......@@ -181,6 +189,7 @@ public:
void apply_from(const paragraph_format_properties & Other);
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
public:
// 15.5.1 fo:line-height
......@@ -362,8 +371,8 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
const paragraph_format_properties & content() const { return style_paragraph_properties_content_; }
......
......@@ -2,6 +2,9 @@
#include <iostream>
#include "style_paragraph_properties.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "../docx/docx_conversion_context.h"
#include "borderstyle.h"
......@@ -98,50 +101,12 @@ std::wstring process_margin(const _CP_OPT(length_or_percent) & margin, double Mu
}
/*
(from http://www.schemacentral.com/sc/ooxml/e-w_pPr-2.html)
[ ] w:pStyle Referenced Paragraph Style
[+] w:keepNext Keep Paragraph With Next Paragraph
[+] w:keepLines Keep All Lines On One Page
[+] w:pageBreakBefore Start Paragraph on Next Page
[ ] w:framePr Text Frame Properties
[+] w:widowControl Allow First/Last Line to Display on a Separate Page
[ ] w:numPr Numbering Definition Instance Reference
[ ] w:suppressLineNumbers Suppress Line Numbers for Paragraph
[+] w:pBdr Paragraph Borders
[ ] w:shd Paragraph Shading
[+] w:tabs Set of Custom Tab Stops
[+] w:suppressAutoHyphens Suppress Hyphenation for Paragraph
[ ] w:kinsoku Use East Asian Typography Rules for First and Last Character per Line
[ ] w:wordWrap Allow Line Breaking At Character Level
[ ] w:overflowPunct Allow Punctuation to Extent Past Text Extents
[ ] w:topLinePunct Compress Punctuation at Start of a Line
[ ] w:autoSpaceDE Automatically Adjust Spacing of Latin and East Asian Text
[ ] w:autoSpaceDN Automatically Adjust Spacing of East Asian Text and Numbers
[ ] w:bidi Right to Left Paragraph Layout
[ ] w:adjustRightInd Automatically Adjust Right Indent When Using Document Grid
[ ] w:snapToGrid Use Document Grid Settings for Inter-Line Paragraph Spacing
[+] w:spacing Spacing Between Lines and Above/Below Paragraph
[+] w:ind Paragraph Indentation
[ ] w:contextualSpacing Ignore Spacing Above and Below When Using Identical Styles
[ ] w:mirrorIndents Use Left/Right Indents as Inside/Outside Indents
[ ] w:suppressOverlap Prevent Text Frames From Overlapping
[+] w:jc Paragraph Alignment
[ ] w:textDirection Paragraph Text Flow Direction
[+] w:ment Vertical Character Alignment on Line
[ ] w:textboxTightWrap Allow Surrounding Paragraphs to Tight Wrap to Text Box Contents
[ ] w:outlineLvl Associated Outline Level
[ ] w:divId Associated HTML div ID
[ ] w:cnfStyle Paragraph Conditional Formatting
[ ] w:rPr Run Properties for the Paragraph Mark
[ ] w:sectPr Section Properties
[ ] w:pPrChange Revision Information for Paragraph Properties
*/
void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Context)
{
std::wstringstream & _pPr = Context.get_styles_context().paragraph_style();
std::wstringstream & _pPr = Context.get_styles_context().paragraph_nodes();
CP_XML_WRITER(_pPr)
{
if (style_writing_mode_)
{
writing_mode::type type = style_writing_mode_->get_type();
......@@ -164,22 +129,17 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
{
case text_align::Start:
case text_align::Left:
jc = L"left";
break;
jc = L"left"; break;
case text_align::End:
case text_align::Right:
jc = L"right";
break;
jc = L"right"; break;
case text_align::Center:
jc = L"center";
break;
jc = L"center"; break;
case text_align::Justify:
jc = L"both";
break;
jc = L"both"; break;
}
if (!jc.empty())
_pPr << L"<w:jc w:val=\"" << jc << L"\" />";
if (!jc.empty()) CP_XML_NODE(L"w:jc"){CP_XML_ATTR(L"w:val", jc );}
}
else if (fo_keep_with_next_) //&& Context.get_drop_cap_context().state() != 2
{
......@@ -189,10 +149,8 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
else if (fo_keep_with_next_->get_type() == keep_together::Auto)
val = L"false";
if (!val.empty())
_pPr << L"<w:keepNext w:val=\"" << val << L"\" />";
if (!val.empty())CP_XML_NODE(L"w:keepNext"){CP_XML_ATTR(L"w:val", val );}
}
if (fo_keep_together_)
{
std::wstring val;
......@@ -201,29 +159,36 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
else if (fo_keep_together_->get_type() == keep_together::Auto)
val = L"false";
if (!val.empty())
_pPr << L"<w:keepLines w:val=\"" << val << L"\" />";
if (!val.empty())CP_XML_NODE(L"w:keepLines"){CP_XML_ATTR(L"w:val", val );}
}
if (Context.get_drop_cap_context().state() == 2)
{
_pPr << L"<w:keepNext/> ";
_pPr << L"<w:framePr w:hAnchor=\"text\" w:vAnchor=\"text\" w:wrap=\"around\" w:dropCap=\"drop\" ";
_pPr << L"w:hSpace=\"" << Context.get_drop_cap_context().Space << "\" ";
_pPr << L"w:lines=\"" << Context.get_drop_cap_context().Scale << "\" ";
_pPr << L"/> ";
CP_XML_NODE(L"w:keepNext");
CP_XML_NODE(L"w:framePr")
{
CP_XML_ATTR(L"w:hAnchor", L"text");
CP_XML_ATTR(L"w:vAnchor", L"text");
CP_XML_ATTR(L"w:wrap", L"around");
CP_XML_ATTR(L"w:dropCap", L"drop");
CP_XML_ATTR(L"w:hSpace", Context.get_drop_cap_context().Space);
CP_XML_ATTR(L"w:lines",Context.get_drop_cap_context().Scale);
}
_pPr << L"<w:spacing w:after=\"0\" w:lineRule=\"exact\" ";
CP_XML_NODE(L"w:spacing")
{
CP_XML_ATTR(L"w:after", 0);
CP_XML_ATTR(L"w:lineRule", L"exact");
if (Context.get_drop_cap_context().FontSize>0)
_pPr << L"w:line=\"" << Context.get_drop_cap_context().FontSize << L"\" ";
CP_XML_ATTR(L"w:line", Context.get_drop_cap_context().FontSize);
else
_pPr << L"w:line=\"240\" ";
_pPr << L"/> ";
_pPr << L"<w:textAlignment w:val=\"baseline\" />";
CP_XML_ATTR(L"w:line", 240);
}
CP_XML_NODE(L"w:textAlignment"){CP_XML_ATTR(L"w:val", L"baseline");}
}
if (Context.check_page_break_before())
{
_pPr << L"<w:pageBreakBefore w:val=\"true\" />";
CP_XML_NODE(L"w:pageBreakBefore"){CP_XML_ATTR(L"w:val", L"true"); }
}
else if (fo_break_before_)
{
......@@ -234,19 +199,12 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
val = L"true";
if (!val.empty())
_pPr << L"<w:pageBreakBefore w:val=\"" << val << L"\" />";
CP_XML_NODE(L"w:pageBreakBefore"){CP_XML_ATTR(L"w:val", val);}
}
if (fo_widows_)
{
std::wstring val;
if (*fo_widows_ > 0)
val = L"true";
else
val = L"false";
_pPr << L"<w:widowControl w:val=\"" << val << L"\" />";
CP_XML_NODE(L"w:widowControl"){CP_XML_ATTR(L"w:val", bool (*fo_widows_ > 0));}
}
if (fo_border_ || fo_border_top_ || fo_border_bottom_ || fo_border_left_ || fo_border_right_)
{
std::wstring w_shadow;
......@@ -268,29 +226,24 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
{
if (fo_border_top_)
w_top = process_border(*fo_border_top_, style_border_line_width_top_, fo_padding_top_, w_shadow);
if (fo_border_bottom_)
w_bottom = process_border(*fo_border_bottom_, style_border_line_width_bottom_, fo_padding_bottom_, w_shadow);
if (fo_border_left_)
w_left = process_border(*fo_border_left_, style_border_line_width_left_, fo_padding_left_, w_shadow);
if (fo_border_right_)
w_right = process_border(*fo_border_right_, style_border_line_width_right_, fo_padding_right_, w_shadow);
}
_pPr << L"<w:pBdr>";
CP_XML_NODE(L"w:pBdr")
{
if (!w_top.empty())
_pPr << L"<w:top " << w_top << L" />";
CP_XML_STREAM() << L"<w:top " << w_top << L" />";
if (!w_left.empty())
_pPr << L"<w:left " << w_left << L" />";
CP_XML_STREAM() << L"<w:left " << w_left << L" />";
if (!w_right.empty())
_pPr << L"<w:right " << w_right << L" />";
CP_XML_STREAM() << L"<w:right " << w_right << L" />";
if (!w_bottom.empty())
_pPr << L"<w:bottom " << w_bottom << L" />";
_pPr << L"</w:pBdr>";
CP_XML_STREAM() << L"<w:bottom " << w_bottom << L" />";
}
}
if ((style_line_height_at_least_ || fo_line_height_ || style_line_spacing_ ||
fo_margin_top_ || fo_margin_bottom_ || fo_margin_) && Context.get_drop_cap_context().state() != 2)
......@@ -331,20 +284,18 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
w_lineRule = L"auto";
w_line = boost::lexical_cast<std::wstring>( (int)(0.5 + 240.0 + 20.0 * style_line_spacing_->get_value_unit(length::pt)) );
}
_pPr << L"<w:spacing ";
CP_XML_NODE(L"w:spacing")
{
if (!w_after.empty())
_pPr << "w:after=\"" << w_after << "\" ";
CP_XML_STREAM() << "w:after=\"" << w_after << "\" ";
if (!w_before.empty())
_pPr << "w:before=\"" << w_before << "\" ";
CP_XML_STREAM() << "w:before=\"" << w_before << "\" ";
if (!w_lineRule.empty())
_pPr << "w:lineRule=\"" << w_lineRule << "\" ";
CP_XML_STREAM() << "w:lineRule=\"" << w_lineRule << "\" ";
if (!w_line.empty())
_pPr << "w:line=\"" << w_line << "\" ";
_pPr << L" />";
CP_XML_STREAM() << "w:line=\"" << w_line << "\" ";
}
}
if (fo_margin_left_ || //? +
fo_margin_right_ ||
(fo_text_indent_ && Context.get_drop_cap_context().state() != 1))
......@@ -360,21 +311,20 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
if (w_right.empty()) w_right = L"0";
if (w_firstLine.empty()) w_hanging = L"0";
_pPr << L"<w:ind ";
_pPr << L"w:left=\"" << w_left << L"\" ";
_pPr << L"w:right=\"" << w_right << L"\" ";
CP_XML_NODE(L"w:ind")
{
CP_XML_ATTR(L"w:left", w_left);
CP_XML_ATTR(L"w:right", w_right);
if (Context.get_drop_cap_context().state() != 1 )// - ,
{
if (!w_firstLine.empty())
_pPr << L"w:firstLine=\"" << w_firstLine << L"\" ";
CP_XML_ATTR(L"w:firstLine", w_firstLine);
if (!w_hanging.empty())
_pPr << L"w:hanging=\"" << w_hanging << L"\" ";
CP_XML_ATTR(L"w:hanging", w_hanging);
}
}
_pPr << L" />";
}
if (style_vertical_align_ && Context.get_drop_cap_context().state() != 2)
......@@ -382,27 +332,16 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
std::wstring w_val;
switch(style_vertical_align_->get_type())
{
case vertical_align::Baseline:
w_val = L"baseline";
break;
case vertical_align::Top:
w_val = L"top";
break;
case vertical_align::Middle:
w_val = L"center";
break;
case vertical_align::Bottom:
w_val = L"bottom";
break;
case vertical_align::Auto:
w_val = L"auto";
break;
case vertical_align::Baseline: w_val = L"baseline";break;
case vertical_align::Top: w_val = L"top"; break;
case vertical_align::Middle: w_val = L"center"; break;
case vertical_align::Bottom: w_val = L"bottom"; break;
case vertical_align::Auto: w_val = L"auto"; break;
}
if (!w_val.empty())
_pPr << L"<w:textAlignment w:val=\"" << w_val << "\" />";
CP_XML_NODE(L"w:textAlignment"){CP_XML_ATTR(L"w:val", w_val);}
}
if (style_punctuation_wrap_)
{
std::wstring w_val;
......@@ -412,16 +351,20 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
w_val = L"true";
if (!w_val.empty())
_pPr << L"<w:kinsoku w:val=\"" << w_val << "\" />";
CP_XML_NODE(L"w:kinsoku"){CP_XML_ATTR(L"w:val", w_val);}
}
if (fo_background_color_)
{
const std::wstring w_fill = (fo_background_color_->get_type() == background_color::Enabled
? fo_background_color_->get_color().get_hex_value() : L"auto");
_pPr << L"<w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"" << w_fill << L"\" />";
CP_XML_NODE(L"w:shd")
{
CP_XML_ATTR(L"w:val", L"clear");
CP_XML_ATTR(L"w:color", L"auto");
CP_XML_ATTR(L"w:fill", w_fill );
}
}
}
if (fo_break_after_ && fo_break_after_->get_type() == fo_break::Page)
{
if (Context.in_automatic_style())
......@@ -429,28 +372,15 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
Context.add_page_break_after();
}
}
if (
/*style_tab_stop_distance_ || */
(style_tab_stops_ && dynamic_cast<style_tab_stops*>(style_tab_stops_.get())->size() )
)
{
_pPr << L"<w:tabs>";
/*if (style_tab_stop_distance_)
{
_pPr << L"<w:tab w:pos=\"" << (int)( 20.0 * style_tab_stop_distance_->get_value_unit(length::pt) ) << "\" w:val=\"left\" />";
}*/
if (style_tab_stops_)
style_tab_stops_->docx_convert(Context);
_pPr << L"</w:tabs>";
}
}
void style_tab_stops::docx_convert(oox::docx_conversion_context & Context)
{
std::wstringstream & _pPr = Context.get_styles_context().paragraph_style();
if (style_tab_stops_.size()<1)return;
std::wstringstream & _pPr = Context.get_styles_context().paragraph_nodes();
_pPr << L"<w:tabs>";
if (style_tab_stops_.size())
{
......@@ -459,11 +389,12 @@ void style_tab_stops::docx_convert(oox::docx_conversion_context & Context)
elm->docx_convert(Context);
}
}
_pPr << L"</w:tabs>";
}
void style_tab_stop::docx_convert(oox::docx_conversion_context & Context)
{
std::wstringstream & _pPr = Context.get_styles_context().paragraph_style();
std::wstringstream & _pPr = Context.get_styles_context().paragraph_nodes();
_pPr << L"<w:tab ";
......
#include "precompiled_cpodf.h"
#include <iostream>
#include "style_paragraph_properties.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "../docx/pptx_conversion_context.h"
#include "borderstyle.h"
namespace cpdoccore {
namespace odf {
using xml::xml_char_wc;
namespace {
std::wstring process_border(const border_style & borderStyle,
const _CP_OPT(border_widths) & borderLineWidths,
const _CP_OPT(length) & borderPadding, const std::wstring & Shadow = L"")
{
std::wstring w_sz;
std::wstring w_color;
std::wstring w_val = L"single";
std::wstring w_space;
if (!borderStyle.initialized() || borderStyle.is_none())
{
w_val = L"none";
}
else if (borderStyle.initialized())
{
double width = borderStyle.get_length().get_value_unit(length::pt);
//borderLineWidths ? borderLineWidths->get_summ_unit(length::pt) : borderStyle.get_length().get_value_unit(length::pt);
int szInt = (int)(0.5 + 8.0 * width);
if (szInt <= 0)
szInt = 1;
w_sz = boost::lexical_cast<std::wstring>( szInt );
w_color = boost::lexical_cast<std::wstring>( borderStyle.get_color().get_hex_value() );
if (borderPadding)
w_space = boost::lexical_cast<std::wstring>((int)(borderPadding->get_value_unit(length::pt) + 0.5) );
const std::wstring borderStyleStr = borderStyle.get_style();
if (szInt == 0)
w_val = L"none";
else if (borderStyleStr == L"solid"
|| borderStyleStr == L"single")
w_val = L"single";
else if (borderStyleStr == L"double")
w_val = L"double";
else if (borderStyleStr == L"dotted")
w_val = borderStyleStr;
else if (borderStyleStr == L"dashed")
w_val = borderStyleStr;
else if (borderStyleStr == L"groove")
w_val = L"thinThickMediumGap";
else if (borderStyleStr == L"ridge")
w_val = L"thickThinMediumGap";
else if (borderStyleStr == L"inset")
w_val = L"inset";
else if (borderStyleStr == L"outset")
w_val = L"outset";
else if (borderStyleStr == L"hidden")
w_val = L"nil";
}
std::wstring res;
if (!w_val.empty())
res += L" a:val=\"" + w_val + L"\" ";
if (!w_sz.empty())
res += L"a:sz=\"" + w_sz + L"\" ";
if (!w_color.empty())
res += L"a:color=\"" + w_color + L"\" ";
if (!w_space.empty())
res += L"a:space=\"" + w_space + L"\" ";
if (!Shadow.empty())
res += L"a:shadow=\"" + Shadow + L"\" ";
return res;
}
std::wstring process_margin(const _CP_OPT(length_or_percent) & margin, double Mul)
{
if (margin)
{
if (margin->get_type() == length_or_percent::Length)
{
int val = (int)(0.5 + Mul * margin->get_length().get_value_unit(length::pt));
return boost::lexical_cast<std::wstring>( val );
}
else
{
#ifdef _DEBUG
_CP_LOG(info) << L"[pptx_convert] convert margin warning: invalid type (percent)\n";
#endif
}
}
return L"";
}
}
void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Context)
{
std::wstringstream & _pPr = Context.get_text_context().get_styles_context().paragraph_attr();
// pPr defPPr
if (fo_text_align_)
{
std::wstring jc;
switch(fo_text_align_->get_type())
{
case text_align::Start:
case text_align::Left:
jc = L"l"; break;
case text_align::End:
case text_align::Right:
jc = L"r"; break;
case text_align::Center:
jc = L"ctr"; break;
case text_align::Justify:
jc = L"just"; break;
}
if (jc.length()>0) _pPr << L"algn=\"" << jc << "\" ";
}
if (fo_margin_left_ || fo_margin_right_ || fo_text_indent_ )
{
// TODO auto indent
std::wstring w_left, w_right, w_hanging, w_firstLine;
w_left = process_margin(fo_margin_left_, 20.0);
w_right = process_margin(fo_margin_right_, 20.0);
w_firstLine = process_margin(fo_text_indent_, 20.0);
if (w_left.empty()) w_left = L"0";
if (w_right.empty()) w_right = L"0";
if (w_firstLine.empty()) w_hanging = L"0";
_pPr << L"marL=\"" << w_left << "\" ";
_pPr << L"marR=\"" << w_right << "\" ";
if (!w_firstLine.empty())
_pPr << L"indent=\"" << w_firstLine << "\" ";
if (!w_hanging.empty())
_pPr << L"hangingPunct=\"" << w_hanging << "\" ";
}
if (style_vertical_align_)
{
std::wstring w_val;
switch(style_vertical_align_->get_type())
{
case vertical_align::Baseline: w_val = L"base";break;
case vertical_align::Top: w_val = L"t"; break;
case vertical_align::Middle: w_val = L"ctr"; break;
case vertical_align::Bottom: w_val = L"b"; break;
case vertical_align::Auto: w_val = L"auto"; break;
}
if (!w_val.empty())
_pPr << L"fontAlgn=\"" << w_val << "\" ";
}
//if (style_writing_mode_)
//{
// writing_mode::type type = style_writing_mode_->get_type();
// switch(type)
// {
// case writing_mode::RlTb:
// case writing_mode::TbRl:
// case writing_mode::Rl:
// Context.set_rtl(true);
// break;
// default:
// Context.set_rtl(false);
// }
//}
////////////////////////////////////////////////////////////////////////
// nodes pPr defPPr
CP_XML_WRITER(Context.get_text_context().get_styles_context().paragraph_nodes())
{
//if (fo_keep_with_next_) //&& Context.get_drop_cap_context().state() != 2
//{
// std::wstring val;
// if (fo_keep_with_next_->get_type() == keep_together::Always)
// val = L"true";
// else if (fo_keep_with_next_->get_type() == keep_together::Auto)
// val = L"false";
// if (!val.empty())CP_XML_NODE(L"a:keepNext"){CP_XML_ATTR(L"a:val", val );}
//}
//if (fo_keep_together_)
//{
// std::wstring val;
// if (fo_keep_together_->get_type() == keep_together::Always)
// val = L"true";
// else if (fo_keep_together_->get_type() == keep_together::Auto)
// val = L"false";
// if (!val.empty())CP_XML_NODE(L"a:keepLines"){CP_XML_ATTR(L"a:val", val );}
//}
//if (fo_widows_)
//{
// CP_XML_NODE(L"a:widowControl"){CP_XML_ATTR(L"a:val", bool (*fo_widows_ > 0));}
//}
//if (fo_border_ || fo_border_top_ || fo_border_bottom_ || fo_border_left_ || fo_border_right_)
//{
// std::wstring w_shadow;
//
// if (style_shadow_)
// w_shadow = style_shadow_->get_type() != shadow_type::None ? L"1" : L"0";
// std::wstring w_top, w_left, w_right, w_bottom, w_between;
//
// if (fo_border_)
// {
// w_top = w_left = w_right = w_bottom = process_border(*fo_border_, style_border_line_width_, fo_padding_, w_shadow);
// if (style_join_border_ && *style_join_border_)
// {
// w_between = w_top;
// }
// }
// else
// {
// if (fo_border_top_)
// w_top = process_border(*fo_border_top_, style_border_line_width_top_, fo_padding_top_, w_shadow);
// if (fo_border_bottom_)
// w_bottom = process_border(*fo_border_bottom_, style_border_line_width_bottom_, fo_padding_bottom_, w_shadow);
// if (fo_border_left_)
// w_left = process_border(*fo_border_left_, style_border_line_width_left_, fo_padding_left_, w_shadow);
// if (fo_border_right_)
// w_right = process_border(*fo_border_right_, style_border_line_width_right_, fo_padding_right_, w_shadow);
// }
// CP_XML_NODE(L"a:pBdr")
// {
// if (!w_top.empty())
// CP_XML_STREAM() << L"<a:top " << w_top << L" />";
// if (!w_left.empty())
// CP_XML_STREAM() << L"<a:left " << w_left << L" />";
// if (!w_right.empty())
// CP_XML_STREAM() << L"<a:right " << w_right << L" />";
// if (!w_bottom.empty())
// CP_XML_STREAM() << L"<a:bottom " << w_bottom << L" />";
// }
//}
if (style_line_height_at_least_ || fo_line_height_ || style_line_spacing_)
{
std::wstring w_line, w_lineRule;
if (fo_line_height_)
{
if (fo_line_height_->get_type() == line_width::Percent)
{
w_line = boost::lexical_cast<std::wstring>( (int)( 0.5 + fo_line_height_->get_percent().get_value() *1000. ) );
w_lineRule = L"a:spcPct";
}
//else if(fo_line_height_->get_type() == line_width::Normal)
//{
//}
else if (fo_line_height_->get_type() == line_width::PositiveLength)
{
w_line = boost::lexical_cast<std::wstring>((int)(0.5 + 100.0 * fo_line_height_->get_positive_length().get_value_unit(length::pt)));
w_lineRule = L"a:spcPts";
}
}
else if (style_line_height_at_least_)
{
w_lineRule = L"a:spcPts";
w_line = boost::lexical_cast<std::wstring>((int)(0.5 + 100.0 * style_line_height_at_least_->get_value_unit(length::pt)));
}
else if (style_line_spacing_)
{
w_lineRule = L"a:spcPts";
w_line = boost::lexical_cast<std::wstring>( (int)(0.5 + 240.0 + 100.0 * style_line_spacing_->get_value_unit(length::pt)) );
}
CP_XML_NODE(L"a:lnSpc")
{
CP_XML_NODE(w_lineRule)
{
CP_XML_ATTR(L"val",w_line);
}
}
}
if (fo_margin_top_ || fo_margin_)
{
std::wstring w_before = process_margin(fo_margin_top_, 1000.0);
CP_XML_NODE(L"a:spcBef")
{
CP_XML_NODE(L"a:spcPct")
{
CP_XML_ATTR(L"val",w_before);
}
}
}
if (fo_margin_bottom_ || fo_margin_)
{
std::wstring w_after = process_margin(fo_margin_bottom_, 1000.0);
CP_XML_NODE(L"a:spcAft")
{
CP_XML_NODE(L"a:spcPct")
{
CP_XML_ATTR(L"val",w_after);
}
}
}
//if (style_punctuation_wrap_)
//{
// std::wstring w_val;
// if (style_punctuation_wrap_->get_type() == punctuation_wrap::Simple)
// w_val = L"false";
// else if (style_punctuation_wrap_->get_type() == punctuation_wrap::Hanging)
// w_val = L"true";
//
// if (!w_val.empty())
// CP_XML_NODE(L"a:kinsoku"){CP_XML_ATTR(L"a:val", w_val);}
//}
//if (fo_background_color_)
//{
// const std::wstring w_fill = (fo_background_color_->get_type() == background_color::Enabled
// ? fo_background_color_->get_color().get_hex_value() : L"auto");
// CP_XML_NODE(L"a:shd")
// {
// CP_XML_ATTR(L"a:val", L"clear");
// CP_XML_ATTR(L"a:color", L"auto");
// CP_XML_ATTR(L"a:fill", w_fill );
// }
//}
}
//if (style_tab_stops_)
// style_tab_stops_->pptx_convert(Context);
}
void style_tab_stops::pptx_convert(oox::pptx_conversion_context & Context)
{
//if (style_tab_stops_.size()<1)return;
//std::wstringstream & _pPr = Context.get_text_context().get_styles_context().paragraph_nodes();
//
// _pPr << L"<a:tabLst>";
//if (style_tab_stops_.size())
//{
// BOOST_FOREACH(const office_element_ptr & elm, style_tab_stops_)
// {
// elm->pptx_convert(Context);
// }
//}
// _pPr << L"</a:tabLst>";
}
void style_tab_stop::pptx_convert(oox::pptx_conversion_context & Context)
{
//std::wstringstream & _pPr = Context.get_text_context().get_styles_context().paragraph_nodes();
//_pPr << L"<a:tab ";
//
//_pPr << L"a:pos=\"" << (int)( 20.0 * style_position_.get_value_unit(length::pt) ) << "\" ";
//
//{
// std::wstring val = L"left";
// if (style_type_)
// {
// switch(style_type_->get_type())
// {
// case style_type::Left:
// val = L"left";
// break;
// case style_type::Center:
// val = L"center";
// break;
// case style_type::Right:
// val = L"right";
// break;
// case style_type::Char:
// val = L"decimal";
// break;
// }
// }
// if (!val.empty())
// _pPr << L"a:val=\"" << val << "\" ";
//}
//{
// std::wstring leader;
// if (style_leader_type_ && style_leader_type_->get_type() == line_type::None ||
// style_leader_style_ && style_leader_style_->get_type() == line_style::None)
// {
// leader = L"none";
// }
// else if (
// !style_leader_type_ ||
// style_leader_type_ && style_leader_type_->get_type() != line_type::None
// )
// {
// if (style_leader_style_)
// {
// _CP_LOG(info) << L"[pptx_convert] convert warning (a:tab/@a:leader)\n";
// switch(style_leader_style_->get_type())
// {
// case line_style::None:
// leader = L"";
// break;
// case line_style::Solid:
// if (style_leader_text_)
// {
// if (*style_leader_text_ == L"-")
// leader = L"hyphen";
// else if (*style_leader_text_ == L"_")
// leader = L"underscore";
// }
// break;
// case line_style::Dotted:
// leader = L"dot";
// break;
// case line_style::Dash:
// leader = L"hyphen";
// break;
// case line_style::LongDash:
// leader = L"middleDot";
// break;
// case line_style::DotDash:
// leader = L"middleDot";
// break;
// case line_style::DotDotDash:
// leader = L"middleDot";
// break;
// case line_style::Wave:
// leader = L"middleDot";
// break;
// }
// }
// }
// if (!leader.empty())
// _pPr << L"a:leader=\"" << leader << "\" ";
//}
//
//_pPr << L" />";
}
void style_paragraph_properties::pptx_convert(oox::pptx_conversion_context & Context)
{
style_paragraph_properties_content_.pptx_convert(Context);
}
}
}
#ifndef _CPDOCCORE_ODF_STYLE_TABLE_PROPERTIES_H_
#define _CPDOCCORE_ODF_STYLE_TABLE_PROPERTIES_H_
#pragma once
#include <iosfwd>
#include <cpdoccore/xml/attributes.h>
......@@ -322,5 +321,3 @@ CP_REGISTER_OFFICE_ELEMENT2(style_table_cell_properties);
}
}
#endif
......@@ -188,48 +188,6 @@ void text_format_properties_content::add_attributes( const xml::attributes_wc_pt
}
/*
[ ] w:rStyle Referenced Character Style
[+] w:rFonts Run Fonts
[+] w:b Bold
[+] w:bCs Complex Script Bold
[+] w:i Italics
[+] w:iCs Complex Script Italics
[+] w:caps Display All Characters As Capital Letters
[+] w:smallCaps Small Caps
[+] w:strike Single Strikethrough
[+] w:dstrike Double Strikethrough
[+] w:outline Display Character Outline
[+] w:shadow Shadow
[+] w:emboss Embossing
[+] w:imprint Imprinting
[ ] w:noProof Do Not Check Spelling or Grammar
[ ] w:snapToGrid Use Document Grid Settings For Inter-Character Spacing
[+] w:vanish Hidden Text
[ ] w:webHidden Web Hidden Text
[+] w:color Run Content Color
[+] w:spacing Character Spacing Adjustment
[+] w:w Expanded/Compressed Text
[ ] w:kern Font Kerning
[+] w:position Vertically Raised or Lowered Text
[+] w:sz Font Size
[+] w:szCs Complex Script Font Size
[+] w:highlight Text Highlighting
[+] w:u Underline
[*] w:effect Animated Text Effect
[ ] w:bdr Text Border
[ ] w:shd Run Shading
[ ] w:fitText Manual Run Width
[+] w:vertAlign Subscript/Superscript Text
[ ] w:rtl Right To Left Text
[ ] w:cs Use Complex Script Formatting on Run
[+] w:em Emphasis Mark
[+] w:lang Languages for Run Content
[ ] w:eastAsianLayout East Asian Typography Settings
[ ] w:specVanish Paragraph Mark Is Always Hidden
[ ] w:oMath Office Open XML Math
[ ] w:rPrChange
*/
int text_format_properties_content::process_font_size(const _CP_OPT(font_size) & FontSize, const style_instance * currnetStyle, bool Complex, double Mul)
{
......@@ -302,6 +260,88 @@ int text_format_properties_content::process_font_style(const optional<font_style
}
return 0;
}
void text_format_properties_content::pptx_convert_as_list(oox::pptx_conversion_context & Context)
{
styles_context & styles_context_ = Context.get_text_context().get_styles_context();
CP_XML_WRITER(styles_context_.text_style())
{
if (fo_color_)
{
CP_XML_NODE(L"a:buClr")
{
CP_XML_NODE(L"a:srgbClr"){CP_XML_ATTR(L"val",fo_color_->get_hex_value());}
}
}
if (fo_font_size_)
{
if(fo_font_size_->get_type() == font_size::Percent)
{
double fontSizePct = fo_font_size_->get_percent().get_value();
CP_XML_NODE(L"a:buSzPct")
{
CP_XML_ATTR(L"val", int(fontSizePct * 1000 + 0.5));//% * 1000
}
}
else
{
double fontSizePt = fo_font_size_->get_length().get_value();
CP_XML_NODE(L"a:buSzPts")
{
CP_XML_ATTR(L"val", (int)(fontSizePt * 100 + 0.5));//pt * 100
}
}
}
//const int fontStyle = process_font_style(fo_font_style_);
//if (fontStyle>0)CP_XML_ATTR(L"i",true);
//if (fo_language_ || style_language_asian_ || style_language_complex_)
//{
// std::wstring w_val;
// if (fo_language_) w_val = *fo_language_;
// else if (fo_country_) w_val = *fo_country_;
// else if (style_country_asian_)w_val = *style_country_asian_;
// else if (style_language_asian_)w_val = *style_language_asian_;
// else if (style_language_complex_)w_val = *style_language_complex_;
// else if (style_country_complex_)w_val = *style_country_complex_;
// CP_XML_ATTR(L"lang", w_val);
//}
if (style_font_name_ || style_font_name_asian_ || style_font_name_complex_ || fo_font_family_)
{
std::wstring w_font = (fo_font_family_ ? *fo_font_family_: L"");
if (w_font.length() < 1)
{
std::wstring w_ascii = (style_font_name_ ? *style_font_name_: L"");
std::wstring w_eastAsia = (style_font_name_asian_ ? *style_font_name_asian_: L"");
std::wstring w_cs = (style_font_name_complex_ ? *style_font_name_complex_: L"");
fonts_container & fonts = Context.root()->odf_context().fontContainer();
font_instance * font = fonts.font_by_style_name(w_ascii);
if (font == NULL)font = fonts.font_by_style_name(w_eastAsia);
if (font == NULL)font = fonts.font_by_style_name(w_cs);
if (font)w_font = font->name();
}
if (w_font.length()>0)
{
CP_XML_NODE(L"a:buFont")
{
CP_XML_ATTR(L"typeface",w_font);
if ((style_font_charset_))
{
if ((*style_font_charset_!=L"x-symbol")) CP_XML_ATTR(L"charset",(*style_font_charset_));
//else CP_XML_ATTR(L"charset",0x02);
}
}
}
}
}
}
void text_format_properties_content::pptx_convert(oox::pptx_conversion_context & Context)
{
styles_context & styles_context_ = Context.get_text_context().get_styles_context();
......@@ -309,13 +349,14 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
{
CP_XML_NODE(styles_context_.extern_node())
{
const int W = process_font_weight(fo_font_weight_);
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);
double fontSizeVal = (fo_font_size_) ? process_font_size_impl(fo_font_size_, styles_context_.get_current_processed_style()) :
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 mul = 1;
if ((style_text_position_) && (style_text_position_->has_font_size()))
......@@ -324,7 +365,7 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
}
if (fontSizeVal > 0)
{
CP_XML_ATTR(L"sz", (int)(fontSizeVal * mul + 0.5));
CP_XML_ATTR(L"sz", (int)(fontSizeVal/2. * mul *100 + 0.5));//in pt *100
}
if (fo_font_variant_)
{
......@@ -333,16 +374,7 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
CP_XML_ATTR(L"cap", "small");
}
}
//if (fo_text_transform_)
//{
// if (fo_text_transform_->get_type() == text_transform::Uppercase)
// CP_XML_ATTR(L"cap", "all");
// else if (fo_text_transform_->get_type() == text_transform::Lowercase)
// CP_XML_ATTR(L"cap", "small");
// else if (fo_text_transform_->get_type() == text_transform::None)
// CP_XML_ATTR(L"cap", "none");
//}
{// 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;
......@@ -404,7 +436,7 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
}
}
if (!underline.empty())CP_XML_ATTR(L"u", underline);
}
if (style_text_line_through_type_)
{
if (style_text_line_through_type_->get_type() == line_type::Single)
......@@ -416,7 +448,7 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
{
CP_XML_ATTR(L"strike", L"sngStrike");
}
else CP_XML_ATTR(L"strike",L"none");
else CP_XML_ATTR(L"strike",L"noStrike");
if ((fo_letter_spacing_) && (fo_letter_spacing_->get_type() != letter_spacing::Normal))
{
......@@ -435,7 +467,7 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
CP_XML_ATTR(L"lang", w_val);
}
}
if (style_font_name_ || style_font_name_asian_ || style_font_name_complex_)
{
std::wstring w_eastAsia;
......@@ -463,13 +495,6 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
}
if (fo_color_)
{
CP_XML_NODE(L"solidFill")
{
CP_XML_NODE(L"srgbClr"){CP_XML_ATTR(L"val",fo_color_->get_hex_value());}
}
}
//else if (style_use_window_font_color_ && *style_use_window_font_color_)
//{
// _rPr << L"<w:color w:val=\"auto\" />";
......@@ -494,13 +519,20 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
// CP_XML_ATTR(L"r:id", hyperlink_hId);
// }
//}
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());}
}
}
}
}
}
void text_format_properties_content::docx_convert(oox::docx_conversion_context & Context)
{
std::wostream & _pPr = Context.get_styles_context().paragraph_style();
std::wostream & _pPr = Context.get_styles_context().paragraph_nodes();
// to paragraph properties
if (fo_hyphenate_)
......
......@@ -47,6 +47,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
void pptx_convert_as_list(oox::pptx_conversion_context & Context);
void apply_from(const text_format_properties_content & Other);
void apply_to(std::vector<_property> & properties);
......@@ -57,7 +58,6 @@ private:
static double process_font_size_impl(const _CP_OPT(font_size) & FontSize, const style_instance * currnetStyle, bool Complex = false, double Mul = 1.0);
static int process_font_weight(const optional<font_weight>::Type & FontWeight);
static int process_font_style(const optional<font_style>::Type & FontStyle);
public:
_CP_OPT(std::wstring) r_style_;
......
......@@ -90,10 +90,8 @@ void text_list_level_style_number::add_child_element( xml::sax * Reader, const :
{
if (L"style" == Ns && L"list-level-properties" == Name)
CP_CREATE_ELEMENT(style_list_level_properties_);
else if (L"style" == Ns && L"style-text-properties" == Name)
CP_CREATE_ELEMENT(style_text_properties_);
else if (L"style" == Ns && L"text-properties" == Name)
CP_CREATE_ELEMENT(text_properties_);
CP_CREATE_ELEMENT(style_text_properties_);
else
{
CP_NOT_APPLICABLE_ELM();
......@@ -388,7 +386,29 @@ void text_list_level_style_number::pptx_convert(oox::pptx_conversion_context & C
if (text_list_level_style_attr_.get_text_level() - 1 >= 9)
return;
std::wostream & strm = Context.get_text_context().get_styles_context().list_style();
style_list_level_properties * listLevelProperties = dynamic_cast<style_list_level_properties *>( style_list_level_properties_.get() );
style_list_level_label_alignment * labelAlignment = listLevelProperties ?
dynamic_cast<style_list_level_label_alignment *>(listLevelProperties->style_list_level_label_alignment_.get()) : NULL;
//int level = text_list_level_style_attr_.get_text_level();
CP_XML_WRITER(strm)
{
if (style_text_properties * textProperties = dynamic_cast<style_text_properties *>(style_text_properties_.get()))///
// !!!
{
textProperties->content().pptx_convert_as_list(Context);
strm << Context.get_text_context().get_styles_context().text_style().str();
}
CP_XML_NODE(L"a:buAutoNum")//ms !! .. , - 2010 !!!
{
CP_XML_ATTR(L"startAt",text_list_level_style_number_attr_.text_start_value_);
CP_XML_ATTR(L"type",L"arabicParenBoth");
}
}
}
namespace
......@@ -509,7 +529,6 @@ void text_list_level_style_bullet::docx_convert(oox::docx_conversion_context & C
textProperties->content().docx_convert(Context);
Context.get_styles_context().docx_serialize_text_style(CP_XML_STREAM());
}
}
}
}
......@@ -522,33 +541,32 @@ void text_list_level_style_bullet::pptx_convert(oox::pptx_conversion_context & C
std::wostream & strm = Context.get_text_context().get_styles_context().list_style();
style_list_level_properties * listLevelProperties = dynamic_cast<style_list_level_properties *>( style_list_level_properties_.get() );
style_list_level_label_alignment * labelAlignment = listLevelProperties ?
dynamic_cast<style_list_level_label_alignment *>(listLevelProperties->style_list_level_label_alignment_.get()) : NULL;
// style_list_level_properties * listLevelProperties = dynamic_cast<style_list_level_properties *>( style_list_level_properties_.get() );
//
//style_list_level_label_alignment * labelAlignment = listLevelProperties ?
// dynamic_cast<style_list_level_label_alignment *>(listLevelProperties->style_list_level_label_alignment_.get()) : NULL;
int level = text_list_level_style_attr_.get_text_level();
//std::wstring nodeLevel = L"a:lvl" + boost::lexical_cast<std::wstring>(level) + L"pPr";
//int level = text_list_level_style_attr_.get_text_level();
CP_XML_WRITER(strm)
{
//CP_XML_NODE(nodeLevel)
{
//CP_XML_ATTR(L"lvl",level - 1);
//attr ident
//attr marL
style_text_properties * textProperties = dynamic_cast<style_text_properties *>(style_text_properties_.get());
wchar_t bullet = text_list_level_style_bullet_attr_.text_bullet_char_.get_value_or(L'\x2022');
const wchar_t bullet = text_list_level_style_bullet_attr_.text_bullet_char_.get_value_or(L'\x2022');
CP_XML_NODE(L"a:buChar")
if (textProperties)///
// !!!
{
CP_XML_ATTR(L"char",convert_bullet_char(bullet));
textProperties->content().pptx_convert_as_list(Context);
strm << Context.get_text_context().get_styles_context().text_style().str();
}
if (style_text_properties * textProperties = dynamic_cast<style_text_properties *>(style_text_properties_.get()))
CP_XML_NODE(L"a:buChar")
{
textProperties->content().pptx_convert(Context);
strm << Context.get_text_context().get_styles_context().text_style().str();
}
//if ((textProperties) && (textProperties->content().style_font_charset_))
//{
// if (textProperties->content().style_font_charset_.get() == L"x-xsymbol")bullet = bullet + 0xf000;
//}
CP_XML_ATTR(L"char",bullet/*convert_bullet_char(bullet)*/);
}
}
}
......
......@@ -181,7 +181,6 @@ private:
office_element_ptr style_list_level_properties_;
office_element_ptr style_text_properties_;
office_element_ptr text_properties_;
};
......
#ifndef _CPDOCCORE_ODF_TEXTALIGN_H_
#define _CPDOCCORE_ODF_TEXTALIGN_H_
#ifdef _MSC_VER
#pragma once
#endif
#include <iosfwd>
#include <string>
#include "odfattributes.h"
namespace cpdoccore { namespace odf {
namespace cpdoccore {
namespace odf {
// text_align horizontal_align . ..
class text_align
{
public:
......@@ -48,5 +45,3 @@ std::wostream & operator << (std::wostream & _Wostream, const text_align & _Val)
APPLY_PARSE_XML_ATTRIBUTES(odf::text_align);
}
#endif
#ifndef _CPDOCCORE_ODF_VERTICALALIGN_H_
#define _CPDOCCORE_ODF_VERTICALALIGN_H_
#ifdef _MSC_VER
#pragma once
#endif
#include <iosfwd>
#include <string>
......@@ -34,7 +30,6 @@ public:
{
return type_;
};
static vertical_align parse(const std::wstring & Str);
private:
......@@ -50,4 +45,3 @@ APPLY_PARSE_XML_ATTRIBUTES(odf::vertical_align);
}
#endif
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