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

OdfFile еще кучка несоответствий переноса контента убрана

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63386 954022d7-b5bf-4e40-9824-e11837661b57
parent 252537dd
......@@ -410,17 +410,20 @@ mc:Ignorable=\"w14 wp14\">";
std::vector<int> numIds;
BOOST_FOREACH(odf_reader::list_style_instance_ptr & inst, list_styles.instances())
{
//const int abstractNumId = list_context_.add_list_style(inst->get_text_list_style()->get_style_name());
const int abstractNumId = list_styles.id_by_name(inst->get_style_name());
strm << L"<w:abstractNum w:abstractNumId=\"" << abstractNumId << "\">";
numIds.push_back(abstractNumId);
odf_reader::office_element_ptr_array & content = inst->get_text_list_style()->get_content();
if (content.size() < 1)
continue;
const int abstractNumId = list_styles.id_by_name(inst->get_style_name());
BOOST_FOREACH(odf_reader::office_element_ptr & elm, content)
strm << L"<w:abstractNum w:abstractNumId=\"" << abstractNumId << "\">";
numIds.push_back(abstractNumId);
for (int i = 0; i < (std::min)( content.size(), (unsigned int)9); i++)
{
start_text_list_style(inst->get_text_list_style()->get_style_name());
elm->docx_convert(*this);
content[i]->docx_convert(*this);
// TODO
end_text_list_style();
}
......@@ -621,7 +624,8 @@ void docx_conversion_context::docx_serialize_paragraph_style(std::wostream & str
{
CP_XML_NODE(L"w:rPr")
{
CP_XML_STREAM() << run_style.str();
const std::wstring & test_str = run_style.str();
CP_XML_STREAM() << test_str;
}
}
}
......
......@@ -158,10 +158,11 @@ void serialize_wrap(std::wostream & strm, _docx_drawing const & val)
void docx_serialize_text(std::wostream & strm, const std::vector<odf_reader::_property> & properties)
{
CP_XML_WRITER(strm)
{
_CP_OPT(std::wstring) strTextContent;
odf_reader::GetProperty(properties,L"text-content",strTextContent);
_CP_OPT(std::wstring) strTextContent;
odf_reader::GetProperty(properties,L"text-content",strTextContent);
CP_XML_WRITER(strm)
{
if (strTextContent)
{
CP_XML_NODE(L"wps:txbx")
......@@ -172,55 +173,12 @@ void docx_serialize_text(std::wostream & strm, const std::vector<odf_reader::_pr
CP_XML_STREAM() << test_string;
}
}
CP_XML_NODE(L"wps:bodyPr")
{
_CP_OPT(bool) bWordArt;
odf_reader::GetProperty(properties, L"wordArt", bWordArt);
_CP_OPT(int) iAlign;
odf_reader::GetProperty(properties, L"textarea-vertical_align", 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;
}
}
//else CP_XML_ATTR(L"anchor", L"dist");break;
if (bWordArt)
{
_CP_OPT(int) iVal;
odf_reader::GetProperty(properties, L"odf-custom-draw-index", iVal);
if (iVal)
{
int i = *iVal;
std::wstring shapeType = _OO_OOX_wordart[*iVal].oox;
CP_XML_ATTR(L"fromWordArt", "1");
CP_XML_NODE(L"a:prstTxWarp")
{
CP_XML_ATTR(L"prst", shapeType);
oox_serialize_aLst(CP_XML_STREAM(), properties);
}
}
}
}
}
else
CP_XML_NODE(L"wps:bodyPr");
}
}
oox_serialize_bodyPr(strm, properties, L"wps");
}
void docx_serialize_image(std::wostream & strm, _docx_drawing & val)
{
CP_XML_WRITER(strm)
......
......@@ -79,7 +79,8 @@ void styles_context::docx_serialize_text_style(std::wostream & strm, std::wstrin
{
CP_XML_STREAM() << L"<w:rStyle w:val=\"" << parenStyleId << L"\" />";
}
CP_XML_STREAM() << text_style_.str();
const std::wstring & test_str = text_style_.str();
CP_XML_STREAM() << test_str;
}
}
}
......
......@@ -198,14 +198,14 @@ void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_pro
}
}
}
void oox_serialize_bodyPr(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
void oox_serialize_bodyPr(std::wostream & strm, const std::vector<odf_reader::_property> & prop, const std::wstring & namespace_)
{
_CP_OPT(bool) bWordArt;
odf_reader::GetProperty(prop,L"wordArt", bWordArt);
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:bodyPr")
CP_XML_NODE(namespace_ + L":bodyPr")
{
_CP_OPT(double)dPaddingLeft, dPaddingRight, dPaddingTop, dPaddingBottom;
odf_reader::GetProperty(prop,L"text-padding-left" , dPaddingLeft);
......
......@@ -62,7 +62,7 @@ namespace oox {
void oox_serialize_shape (std::wostream & strm, _oox_drawing & val);
void oox_serialize_ln (std::wostream & strm, const std::vector<odf_reader::_property> & val, bool always_draw = false);
void oox_serialize_hlink (std::wostream & strm, const std::vector<_hlink_desc> & val);
void oox_serialize_bodyPr (std::wostream & strm, const std::vector<odf_reader::_property> & val);
void oox_serialize_bodyPr (std::wostream & strm, const std::vector<odf_reader::_property> & val, const std::wstring & namespace_ = L"a");
void oox_serialize_aLst (std::wostream & strm, const std::vector<odf_reader::_property> & val);
}
}
......@@ -73,7 +73,7 @@ void content_types_file::set_media(mediaitems & _Mediaitems)
{
BOOST_FOREACH( mediaitems::item & item, _Mediaitems.items() )
{
if (item.type == mediaitems::typeImage || item.type == mediaitems::typeMedia)
if ((item.type == mediaitems::typeImage || item.type == mediaitems::typeMedia) && item.mediaInternal)
{
int n = item.outputName.rfind(L".");
if (n > 0)
......
......@@ -262,7 +262,12 @@ void pptx_text_context::Impl::ApplyListProperties(odf_reader::paragraph_format_p
odf_reader::text_list_level_style_number* list_number = dynamic_cast<odf_reader::text_list_level_style_number *>(elm.get());
if (list_number)elm_list = list_number->style_list_level_properties_;
}
////////////////////
if (elm->get_type() == odf_reader::typeTextListLevelStyleImage)
{
odf_reader::text_list_level_style_image* list_image = dynamic_cast<odf_reader::text_list_level_style_image *>(elm.get());
if (list_image)elm_list = list_image->style_list_level_properties_;
}
////////////////////
if (elm_list)
{
list_properties = dynamic_cast<odf_reader::style_list_level_properties *>(elm_list.get());
......
......@@ -36,6 +36,8 @@ void draw_image_attlist::add_attributes( const xml::attributes_wc_ptr & Attribut
void draw_frame_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"draw:copy-of", draw_copy_of_);
CP_APPLY_ATTR(L"fo:min-width", fo_min_width_);
CP_APPLY_ATTR(L"fo:min-height", fo_min_height_);
}
/// draw-gframe-attlist
void draw_g_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
......
......@@ -104,7 +104,9 @@ public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
public:
_CP_OPT(std::wstring) draw_copy_of_;
_CP_OPT(std::wstring) draw_copy_of_;
_CP_OPT(odf_types::length_or_percent) fo_min_width_;
_CP_OPT(odf_types::length_or_percent) fo_min_height_;
};
......
......@@ -832,7 +832,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
if (graphicProperties.common_border_attlist_.fo_border_)
{
if (graphicProperties.common_border_attlist_.fo_border_->initialized())
if (graphicProperties.common_border_attlist_.fo_border_->is_none() == false)
{
drawing.additional.push_back(_property(L"stroke-color", graphicProperties.common_border_attlist_.fo_border_->get_color().get_hex_value() ));
drawing.additional.push_back(_property(L"stroke-width", graphicProperties.common_border_attlist_.fo_border_->get_length().get_value_unit(odf_types::length::pt) ));
......@@ -1122,15 +1122,29 @@ void draw_text_box::docx_convert(oox::docx_conversion_context & Context)
/////////
common_draw_docx_convert(Context, frame->common_draw_attlists_, drawing);
//+
bool auto_fit_text = false;
if (!draw_text_box_attlist_.fo_min_height_) draw_text_box_attlist_.fo_min_height_ = frame->draw_frame_attlist_.fo_min_height_;
if (!draw_text_box_attlist_.fo_min_width_) draw_text_box_attlist_.fo_min_width_ = frame->draw_frame_attlist_.fo_min_width_;
if ((draw_text_box_attlist_.fo_min_height_) && (draw_text_box_attlist_.fo_min_height_->get_type()==length_or_percent::Length))
{
size_t min_y = get_value_emu(draw_text_box_attlist_.fo_min_height_->get_length());
if (drawing.cy < min_y) drawing.cy = min_y;
if (drawing.cy < min_y)
{
drawing.cy = min_y;
auto_fit_text = true;
}
}
if ((draw_text_box_attlist_.fo_min_width_) && (draw_text_box_attlist_.fo_min_width_->get_type()==length_or_percent::Length))
{
size_t min_x = get_value_emu(draw_text_box_attlist_.fo_min_width_->get_length());
if (drawing.cx < min_x) drawing.cx = min_x;
if (drawing.cx < min_x)
{
drawing.cx = min_x;
auto_fit_text = true;
}
}
if ((draw_text_box_attlist_.fo_max_height_) && (draw_text_box_attlist_.fo_max_height_->get_type()==length_or_percent::Length))
{
......@@ -1142,6 +1156,8 @@ void draw_text_box::docx_convert(oox::docx_conversion_context & Context)
size_t max_x = get_value_emu(draw_text_box_attlist_.fo_max_width_->get_length());
if (drawing.cx > max_x) drawing.cy = max_x;
}
if (auto_fit_text)
drawing.additional.push_back(_property(L"fit-to-size", auto_fit_text));
///////////////////////////////////////////////////////////////////
......
......@@ -111,7 +111,9 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
odf_reader::style_instance* baseStyleInst =
Context.root()->odf_context().styleContainer().style_by_name(baseStyleName, odf_types::style_family::Presentation,Context.process_masters_);
if (baseStyleInst)//
if (baseStyleInst && ((!presentation_shape_attlist_.presentation_user_transformed_) ||
((presentation_shape_attlist_.presentation_user_transformed_) &&
(presentation_shape_attlist_.presentation_user_transformed_->get()== false))))//
{
style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Presentation);
if (defaultStyle)instances.push_back(defaultStyle);
......
......@@ -241,6 +241,10 @@ void draw_polygon_attlist::add_attributes( const xml::attributes_wc_ptr & Attrib
const wchar_t * draw_polygon::ns = L"draw";
const wchar_t * draw_polygon::name = L"polygon";
// draw:contour-polygon
const wchar_t * draw_contour_polygon::ns = L"draw";
const wchar_t * draw_contour_polygon::name = L"contour-polygon";
void draw_polygon::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
draw_polygon_attlist_.add_attributes(Attributes);
......
......@@ -219,7 +219,9 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(draw_path);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//draw:polygon
class draw_polygon_attlist
{
public:
......@@ -251,6 +253,19 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(draw_polygon);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//draw:contour-polygon
class draw_contour_polygon : public draw_polygon
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const ElementType type = typeDrawContourPolygon;
static const xml::NodeType xml_type = xml::typeElement;
};
CP_REGISTER_OFFICE_ELEMENT2(draw_contour_polygon);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
class draw_polyline_attlist
{
......
......@@ -194,6 +194,7 @@ void draw_polygon::pptx_convert(oox::pptx_conversion_context & Context)
Context.get_slide_context().end_shape();
}
void draw_polyline::pptx_convert(oox::pptx_conversion_context & Context)
{
reset_polyline_path();
......
......@@ -420,7 +420,7 @@ const std::wstring & font_instance::style_name() const
const std::wstring & font_instance::name() const
{
static const std::wstring Symbol = L"Wingdings";
static const std::wstring Symbol = L"Symbol";
if (name_ == L"StarSymbol")
return Symbol;
else
......
......@@ -30,6 +30,7 @@ enum ElementType
typeTextOfficeAnnotation,
typeTextTitle,
typeTextChapter,
typeTextSubject,
typeTextPlaceholder,
typeTextPageNumber,
typeTextPageCount,
......@@ -83,7 +84,8 @@ enum ElementType
typeTextListStyle,
typeTextListLevelStyleNumber,
typeTextListLevelStyleBullet,
typeStyleListLevelProperties,
typeTextListLevelStyleImage,
typeStyleListLevelProperties,
typeStyleListLevelLabelAlignment,
typeStyleTabStop,
......@@ -194,6 +196,7 @@ enum ElementType
typeDrawEllipse,
typeDrawLine,
typeDrawPolygon,
typeDrawContourPolygon,
typeDrawPolyline,
typeDrawRegularPolyline,
typeDrawPath,
......
......@@ -112,7 +112,7 @@ void s::docx_convert(oox::docx_conversion_context & Context)
Context.add_element_to_run();
std::wostream & _Wostream = Context.output_stream();
_Wostream << L"<w:t xml:space=\"preserve\">";
this->text_to_stream(_Wostream);
text_to_stream(_Wostream);
_Wostream << L"</w:t>";
}
......@@ -695,7 +695,7 @@ void title::docx_convert(oox::docx_conversion_context & Context)
std::wostream & _Wostream = Context.output_stream();
_Wostream << L"<w:t xml:space=\"preserve\">";
this->text_to_stream(_Wostream);
text_to_stream(_Wostream);
_Wostream << L"</w:t>";
Context.finish_run();
......@@ -705,10 +705,69 @@ void title::docx_convert(oox::docx_conversion_context & Context)
void title::xlsx_convert(oox::xlsx_conversion_context & Context)
{
std::wstringstream val;
this->text_to_stream(val);
text_to_stream(val);
Context.get_text_context().add_text(val.str());
}
void title::pptx_convert(oox::pptx_conversion_context & Context)
{
std::wstringstream val;
text_to_stream(val);
Context.get_text_context().add_text(val.str());
}
// text:chapter
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * subject::ns = L"text";
const wchar_t * subject::name = L"subject";
std::wostream & subject::text_to_stream(::std::wostream & _Wostream) const
{
BOOST_FOREACH(const office_element_ptr & parElement, content_)
{
parElement->text_to_stream(_Wostream);
}
return _Wostream;
}
void subject::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
common_field_fixed_attlist_.add_attributes(Attributes);
}
void subject::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void subject::add_text(const std::wstring & Text)
{
office_element_ptr elm = text::create(Text) ;
content_.push_back( elm );
}
void subject::docx_convert(oox::docx_conversion_context & Context)
{
std::wostream & strm = Context.output_stream();
Context.finish_run();
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\" /></w:r>";
strm << L"<w:r><w:instrText>SUBJECT</w:instrText></w:r><w:r><w:fldChar w:fldCharType=\"separate\" /></w:r>";
Context.add_new_run();
std::wostream & _Wostream = Context.output_stream();
_Wostream << L"<w:t xml:space=\"preserve\">";
text_to_stream(_Wostream);
_Wostream << L"</w:t>";
Context.finish_run();
strm << L"<w:r><w:fldChar w:fldCharType=\"end\" /></w:r>";
}
void subject::xlsx_convert(oox::xlsx_conversion_context & Context)
{
std::wstringstream val;
this->text_to_stream(val);
Context.get_text_context().add_text(val.str());
}
void subject::pptx_convert(oox::pptx_conversion_context & Context)
{
std::wstringstream val;
this->text_to_stream(val);
......@@ -753,7 +812,7 @@ void chapter::docx_convert(oox::docx_conversion_context & Context)
std::wostream & _Wostream = Context.output_stream();
_Wostream << L"<w:t xml:space=\"preserve\">";
this->text_to_stream(_Wostream);
text_to_stream(_Wostream);
_Wostream << L"</w:t>";
Context.finish_run();
......
......@@ -556,13 +556,40 @@ 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);
common_field_fixed_attlist common_field_fixed_attlist_;
office_element_ptr_array content_;
common_field_fixed_attlist common_field_fixed_attlist_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(chapter);
//text:subject
//////////////////////////////////////////////////////////////////////////////////////////////////
class subject : public paragraph_content_element<subject>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSubject;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(::std::wostream & _Wostream) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text);
common_field_fixed_attlist common_field_fixed_attlist_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(subject);
// text:placeholder
//////////////////////////////////////////////////////////////////////////////////////////////////
class text_placeholder : public paragraph_content_element<text_placeholder>
......
......@@ -118,22 +118,22 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
Context.set_rtl(false);
}
}
if (Context.rtl()) // !!
{
_pPr << L"<w:bidi/>";
}
if (fo_text_align_)
{
std::wstring jc;
switch(fo_text_align_->get_type())
{
case text_align::Start:
case text_align::Left:
jc = L"left"; break;
case text_align::End:
case text_align::Right:
jc = L"right"; break;
case text_align::Center:
jc = L"center"; break;
case text_align::Justify:
jc = L"both"; break;
case text_align::Left: jc = L"left"; break;
case text_align::Right: jc = L"right"; break;
case text_align::Center: jc = L"center"; break;
case text_align::Justify: jc = L"both"; break;
case text_align::Start: jc = Context.rtl() ? L"end": L"start"; break;
case text_align::End: jc = Context.rtl() ? L"start": L"end"; break;
}
if (!jc.empty()) CP_XML_NODE(L"w:jc"){CP_XML_ATTR(L"w:val", jc );}
......@@ -360,7 +360,7 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
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)
......
......@@ -573,7 +573,7 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
std::wostream & _rPr = Context.get_styles_context().text_style();
if (Context.rtl())
{
_rPr << L"<w:rtl w:val=\"true\" />";
_rPr << L"<w:rtl/>";/* w:val=\"true\" */
}
if (r_style_)
......
......@@ -38,11 +38,13 @@ void text_list_style::add_attributes( const xml::attributes_wc_ptr & Attributes
void text_list_style::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
if (L"text" == Ns && L"list-level-style-number" == Name)
if (L"text" == Ns && L"list-level-style-number" == Name)
CP_CREATE_ELEMENT(text_list_style_content_);
else if (L"text" == Ns && L"list-level-style-bullet" == Name)
CP_CREATE_ELEMENT(text_list_style_content_);
else
else if (L"text" == Ns && L"list-level-style-image" == Name)
CP_CREATE_ELEMENT(text_list_style_content_);
else
{
CP_NOT_APPLICABLE_ELM();
}
......@@ -79,6 +81,15 @@ void text_list_level_style_bullet_attr::add_attributes( const xml::attributes_wc
CP_APPLY_ATTR(L"text:bullet-relative-size", text_bullet_relative_size_);
}
// text_list_level_style_image_attr
//////////////////////////////////////////////////////////////////////////////////////////////////
void text_list_level_style_image_attr::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
common_xlink_attlist_.add_attributes(Attributes);
}
// text:list-level-style-number
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_list_level_style_number::ns = L"text";
......@@ -102,6 +113,29 @@ void text_list_level_style_number::add_child_element( xml::sax * Reader, const :
}
}
//text:list-level-style-image
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * text_list_level_style_image::ns = L"text";
const wchar_t * text_list_level_style_image::name = L"list-level-style-image";
void text_list_level_style_image::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
text_list_level_style_attr_.add_attributes(Attributes);
text_list_level_style_image_attr_.add_attributes(Attributes);
}
void text_list_level_style_image::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
if (L"style" == Ns && L"list-level-properties" == Name)
CP_CREATE_ELEMENT(style_list_level_properties_);
else if (L"style" == Ns && L"text-properties" == Name)
CP_CREATE_ELEMENT(style_text_properties_);
else
{
CP_NOT_APPLICABLE_ELM();
}
}
// style:list-level-properties
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_list_level_properties::ns = L"style";
......@@ -342,6 +376,8 @@ void text_list_level_style_number::docx_convert(oox::docx_conversion_context & C
}
CP_XML_NODE(L"w:pPr")
{
if (Context.rtl()) CP_XML_NODE(L"w:bidi");
if (labelAlignment)
{
docx_serialize_label_alignment_props(CP_XML_STREAM(), labelAlignment);
......@@ -533,6 +569,8 @@ void text_list_level_style_bullet::docx_convert(oox::docx_conversion_context & C
CP_XML_NODE(L"w:pPr")
{
if (Context.rtl()) CP_XML_NODE(L"w:bidi");
if (labelAlignment)
{
docx_serialize_label_alignment_props(CP_XML_STREAM(), labelAlignment);
......@@ -615,5 +653,143 @@ void text_list_level_style_bullet::pptx_convert(oox::pptx_conversion_context & C
}
}
void text_list_level_style_image::docx_convert(oox::docx_conversion_context & Context)
{
if (text_list_level_style_attr_.get_text_level() - 1 > 10)
return;
std::wostream & strm = Context.output_stream();
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;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"w:lvl")
{
CP_XML_ATTR(L"w:ilvl",(text_list_level_style_attr_.get_text_level() - 1));
CP_XML_NODE(L"w:numFmt"){CP_XML_ATTR(L"w:val",L"bullet");}
CP_XML_NODE(L"w:suff")
{
if ((labelAlignment) && (labelAlignment->text_label_followed_by_))
{
CP_XML_ATTR(L"w:val",labelAlignment->text_label_followed_by_.get() );
}
else
CP_XML_ATTR(L"w:val",L"tab");
}
const wchar_t bullet = L'\x2022';
CP_XML_NODE(L"w:lvlText")
{
CP_XML_ATTR(L"w:val",convert_bullet_char(bullet));
}
docx_serialize_level_justification(CP_XML_STREAM(), listLevelProperties);
double spaceBeforeTwip = 0.0;
if (listLevelProperties && listLevelProperties->text_space_before_)
{
spaceBeforeTwip = 20.0 * listLevelProperties->text_space_before_->get_value_unit(length::pt);
}
double minLabelWidthTwip = 0.0;
if (listLevelProperties && listLevelProperties->text_min_label_width_)
{
minLabelWidthTwip = 20.0 * listLevelProperties->text_min_label_width_->get_value_unit(length::pt);
}
double minLabelDistanceTwip = 0.0;
CP_XML_NODE(L"w:pPr")
{
if (Context.rtl()) CP_XML_NODE(L"w:bidi");
if (labelAlignment)
{
docx_serialize_label_alignment_props(CP_XML_STREAM(), labelAlignment);
}
else
{
CP_XML_NODE(L"w:ind")
{
CP_XML_ATTR(L"w:left",((int)(minLabelWidthTwip + spaceBeforeTwip + 0.5)));
if (spaceBeforeTwip < 0.0)
{
CP_XML_ATTR(L"w:firstLine",((int)(minLabelWidthTwip + 0.5)));
}
else
{
double hanging = 0.0;
if ( (int)minLabelWidthTwip == 0)
{
if (spaceBeforeTwip < 0)
hanging = spaceBeforeTwip;
else
hanging = -spaceBeforeTwip;
}
else
{
hanging = minLabelWidthTwip;
}
CP_XML_ATTR(L"w:hanging" ,((int)( hanging + 0.5)));
}
}
}
}
if (style_text_properties * textProperties = dynamic_cast<style_text_properties *>(style_text_properties_.get()))
{
Context.get_styles_context().start();
textProperties->content().docx_convert(Context);
Context.get_styles_context().docx_serialize_text_style(CP_XML_STREAM(), _T(""));
}
}
}
}
void text_list_level_style_image::pptx_convert(oox::pptx_conversion_context & Context)
{
if (text_list_level_style_attr_.get_text_level() - 1 > 10)
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)
{
style_text_properties * textProperties = dynamic_cast<style_text_properties *>(style_text_properties_.get());
wchar_t bullet = L'\x2022';
if (textProperties)///
// !!!
{
textProperties->content().pptx_convert_as_list(Context);
strm << Context.get_text_context().get_styles_context().text_style().str();
}
CP_XML_NODE(L"a:buChar")
{
//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)*/);
}
}
}
}
}
......@@ -6,7 +6,6 @@
#include <cpdoccore/CPSharedPtr.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/nodetype.h>
#include "office_elements.h"
......@@ -31,7 +30,6 @@ private:
};
/// \class text_list_style
/// text:list-style (text-list-style)
class text_list_style : public office_element_impl<text_list_style>
{
......@@ -57,7 +55,6 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(text_list_style);
/// \class text_list_level_style_number_attr
/// text-list-level-style-number-attr
class text_list_level_style_number_attr
{
......@@ -92,8 +89,7 @@ private:
};
/// \class style_list_level_properties
/// style:list-level-properties (style-list-level-properties)
/// style:list-level-properties (style-list-level-properties)
class style_list_level_properties : public office_element_impl<style_list_level_properties>
{
public:
......@@ -125,13 +121,10 @@ public:
odf_types::common_vertical_pos_attlist common_vertical_pos_attlist_;
office_element_ptr style_list_level_label_alignment_;
};
CP_REGISTER_OFFICE_ELEMENT2(style_list_level_properties);
/// \class style_list_level_label_alignment
/// style:list-level-label-alignment (style-list-level-label-alignment)
class style_list_level_label_alignment : public office_element_impl<style_list_level_label_alignment>
{
......@@ -162,7 +155,6 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(style_list_level_label_alignment);
/// \class text_list_level_style_number
/// text:list-level-style-number
class text_list_level_style_number : public office_element_impl<text_list_level_style_number>
{
......@@ -175,24 +167,19 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
office_element_ptr style_list_level_properties_;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
private:
text_list_level_style_attr text_list_level_style_attr_;
text_list_level_style_number_attr text_list_level_style_number_attr_;
office_element_ptr style_list_level_properties_;
office_element_ptr style_text_properties_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_list_level_style_number);
/// \class text_list_level_style_bullet_attr
/// text-list-level-style-bullet-attr
class text_list_level_style_bullet_attr
{
......@@ -200,16 +187,15 @@ public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
private:
_CP_OPT(odf_types::style_ref) text_style_name_;
optional<wchar_t>::Type text_bullet_char_;
odf_types::common_num_format_prefix_suffix_attlist common_num_format_prefix_suffix_attlist_;
optional<odf_types::percent>::Type text_bullet_relative_size_;
_CP_OPT(odf_types::style_ref) text_style_name_;
optional<wchar_t>::Type text_bullet_char_;
odf_types::common_num_format_prefix_suffix_attlist common_num_format_prefix_suffix_attlist_;
optional<odf_types::percent>::Type text_bullet_relative_size_;
friend class text_list_level_style_bullet;
};
/// \class text_list_level_style_bullet
/// text:list-level-style-bullet
class text_list_level_style_bullet : public office_element_impl<text_list_level_style_bullet>
{
......@@ -222,21 +208,55 @@ public:
void docx_convert(oox::docx_conversion_context & Context) ;
void pptx_convert(oox::pptx_conversion_context & Context) ;
office_element_ptr style_list_level_properties_;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
private:
text_list_level_style_attr text_list_level_style_attr_;
text_list_level_style_bullet_attr text_list_level_style_bullet_attr_;
text_list_level_style_attr text_list_level_style_attr_;
text_list_level_style_bullet_attr text_list_level_style_bullet_attr_;
office_element_ptr style_text_properties_;
office_element_ptr style_list_level_properties_;
office_element_ptr style_text_properties_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_list_level_style_bullet);
/// text-list-level-style-image-attr
class text_list_level_style_image_attr
{
public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
private:
odf_types::common_xlink_attlist common_xlink_attlist_;
friend class text_list_level_style_image;
};
/// text:list-level-style-image
class text_list_level_style_image : public office_element_impl<text_list_level_style_image>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListLevelStyleImage;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context) ;
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
text_list_level_style_attr text_list_level_style_attr_;
text_list_level_style_image_attr text_list_level_style_image_attr_;
office_element_ptr style_list_level_properties_;
office_element_ptr style_text_properties_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_list_level_style_image);
} }
......@@ -17,6 +17,8 @@
#include "style_text_properties.h"
#include "documentcontext.h"
#include "calcs_styles.h"
namespace cpdoccore {
using namespace odf_types;
......@@ -116,12 +118,35 @@ int process_paragraph_attr(const paragraph_attrs & Attr, oox::docx_conversion_co
{
std::wstring id;
if (const style_instance * parentStyleContent = styleInst->parent())
{
id = Context.get_style_map().get( parentStyleContent->name(), parentStyleContent->type() );
}
Context.start_automatic_style(id);
{// rtl c !! - !!
paragraph_format_properties properties = calc_paragraph_properties_content(styleInst);
if (properties.style_writing_mode_)
{
writing_mode::type type = properties.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);
}
}
}
styleContent->docx_convert(Context);
Context.end_automatic_style();
Context.push_text_properties(styleContent->get_style_text_properties());
return 1;
}
......
......@@ -631,6 +631,8 @@ void odf_drawing_context::end_shape()
if (impl_->current_drawing_state_.oox_shape_preset == 3000) return end_image();
//,
bool line_always_present = false;
draw_path* path = dynamic_cast<draw_path*>(impl_->current_drawing_state_.elements_[0].elm.get());
if (path)
{
......@@ -640,6 +642,8 @@ void odf_drawing_context::end_shape()
if (impl_->current_drawing_state_.path_.length()>1) path->draw_path_attlist_.svg_d_ = impl_->current_drawing_state_.path_;
if (impl_->current_drawing_state_.view_box_.length()>1) path->draw_path_attlist_.svg_viewbox_ = impl_->current_drawing_state_.view_box_;
line_always_present = true;
}
////////////////////////////////////////////////////////////////////////////////////////////
draw_line* line = dynamic_cast<draw_line*>(impl_->current_level_.back().get());
......@@ -676,6 +680,8 @@ void odf_drawing_context::end_shape()
line->draw_line_attlist_.svg_x1_ = line->draw_line_attlist_.svg_x2_;
line->draw_line_attlist_.svg_x2_ = tmp;
}
line_always_present = true;
}
////////////////////////////////////////////////////////////////////////////////////
......@@ -683,6 +689,7 @@ void odf_drawing_context::end_shape()
if (connector)
{
if (!connector->draw_connector_attlist_.draw_type_) connector->draw_connector_attlist_.draw_type_ = L"line";
line_always_present = true;
}
//////////////////////////////////////////////////////////////////////////////////////////////////
......@@ -701,7 +708,10 @@ void odf_drawing_context::end_shape()
text_shape = true;
}
else
{
sub_type = L"polyline";
line_always_present = true;
}
office_element_ptr enhanced_elm;
create_element(L"draw", L"enhanced-geometry", enhanced_elm, impl_->odf_context_);
......@@ -797,7 +807,24 @@ void odf_drawing_context::end_shape()
}
end_element();
}
void odf_drawing_context::corrected_line_fill()
{
if (!impl_->current_graphic_properties)return;
if ( !impl_->current_graphic_properties->content().draw_stroke_ &&
!impl_->current_graphic_properties->content().svg_stroke_color_ &&
!impl_->current_graphic_properties->content().draw_stroke_dash_ &&
!impl_->current_graphic_properties->content().svg_stroke_width_ &&
!impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_ &&
!impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_color_ &&
!impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_image_name_ &&
!impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_hatch_name_ &&
!impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_gradient_name_)
{
impl_->current_graphic_properties->content().svg_stroke_width_ = length(length(1. ,length::pt).get_value_unit(length::cm),length::cm);
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_ = draw_fill::none;;
}
}
void odf_drawing_context::start_frame()
{
impl_->create_draw_base(0);
......
......@@ -89,6 +89,8 @@ public:
void start_object(std::wstring name);
void end_object();
void corrected_line_fill();
office_element_ptr & get_root_element();
void start_element(office_element_ptr & elm, office_element_ptr style_elm = office_element_ptr());
......
......@@ -31,29 +31,31 @@ void graphic_format_properties::serialize(std::wostream & _Wostream ,const wchar
CP_XML_ATTR_OPT(L"draw:textarea-vertical-align", draw_textarea_vertical_align_);
CP_XML_ATTR_OPT(L"draw:auto-grow-height", draw_auto_grow_height_);
CP_XML_ATTR_OPT(L"draw:auto-grow-width", draw_auto_grow_width_);
CP_XML_ATTR_OPT(L"draw:fit-to-size", draw_fit_to_size_);
CP_XML_ATTR_OPT(L"draw:fit-to-contour", draw_fit_to_contour_);
CP_XML_ATTR_OPT(L"draw:stroke", draw_stroke_);
CP_XML_ATTR_OPT(L"draw:stroke-dash", draw_stroke_dash_);
CP_XML_ATTR_OPT(L"draw:marker-start", draw_marker_start_);
CP_XML_ATTR_OPT(L"draw:marker-end", draw_marker_end_);
CP_XML_ATTR_OPT(L"draw:marker-start-width", draw_marker_start_width_);
CP_XML_ATTR_OPT(L"draw:marker-end-width", draw_marker_end_width_);
CP_XML_ATTR_OPT(L"svg:stroke-color", svg_stroke_color_);
CP_XML_ATTR_OPT(L"svg:stroke-width", svg_stroke_width_);
CP_XML_ATTR_OPT(L"svg:stroke-opacity", svg_stroke_opacity_);
CP_XML_ATTR_OPT(L"draw:stroke", draw_stroke_);
CP_XML_ATTR_OPT(L"draw:stroke-dash", draw_stroke_dash_);
CP_XML_ATTR_OPT(L"draw:marker-start", draw_marker_start_);
CP_XML_ATTR_OPT(L"draw:marker-end", draw_marker_end_);
CP_XML_ATTR_OPT(L"draw:marker-start-width", draw_marker_start_width_);
CP_XML_ATTR_OPT(L"draw:marker-end-width", draw_marker_end_width_);
CP_XML_ATTR_OPT(L"svg:stroke-color", svg_stroke_color_);
CP_XML_ATTR_OPT(L"svg:stroke-width", svg_stroke_width_);
CP_XML_ATTR_OPT(L"svg:stroke-opacity", svg_stroke_opacity_);
CP_XML_ATTR_OPT(L"fo:min-width", fo_min_width_);
CP_XML_ATTR_OPT(L"fo:min-height", fo_min_height_);
CP_XML_ATTR_OPT(L"fo:max-width", fo_max_width_);
CP_XML_ATTR_OPT(L"fo:max-height", fo_max_height_);
CP_XML_ATTR_OPT(L"fo:clip", fo_clip_);
CP_XML_ATTR_OPT(L"fo:wrap-option", fo_wrap_option_);
CP_XML_ATTR_OPT(L"fo:min-width", fo_min_width_);
CP_XML_ATTR_OPT(L"fo:min-height", fo_min_height_);
CP_XML_ATTR_OPT(L"fo:max-width", fo_max_width_);
CP_XML_ATTR_OPT(L"fo:max-height", fo_max_height_);
CP_XML_ATTR_OPT(L"fo:clip", fo_clip_);
CP_XML_ATTR_OPT(L"fo:wrap-option", fo_wrap_option_);
CP_XML_ATTR_OPT(L"style:print-content", style_print_content_);
CP_XML_ATTR_OPT(L"style:protect", style_protect_);
CP_XML_ATTR_OPT(L"style:editable", style_editable_);
CP_XML_ATTR_OPT(L"style:wrap", style_wrap_);
CP_XML_ATTR_OPT(L"style:wrap-dynamic-treshold", style_wrap_dynamic_treshold_);
CP_XML_ATTR_OPT(L"style:wrap-dynamic-treshold", style_wrap_dynamic_treshold_);
CP_XML_ATTR_OPT(L"style:number-wrapped-paragraphs", style_number_wrapped_paragraphs_);
CP_XML_ATTR_OPT(L"style:wrap-contour", style_wrap_contour_);
CP_XML_ATTR_OPT(L"style:wrap-contour-mode", style_wrap_contour_mode_);
......@@ -61,7 +63,6 @@ void graphic_format_properties::serialize(std::wostream & _Wostream ,const wchar
CP_XML_ATTR_OPT(L"style:flow-with-text", style_flow_with_text_);
CP_XML_ATTR_OPT(L"style:overflow-behavior", style_overflow_behavior_);
CP_XML_ATTR_OPT(L"style:mirror", style_mirror_);
CP_XML_ATTR_OPT(L"draw:fit-to-size", draw_fit_to_size_);
//common_shadow_attlist_.serialize(CP_GET_XML_NODE());
......
......@@ -90,7 +90,7 @@ public:
odf_types::common_text_animation_attlist common_text_animation_attlist_;
odf_types::common_border_attlist common_border_attlist_;
odf_types::common_border_line_width_attlist common_border_line_width_attlist_;
odf_types::common_border_line_width_attlist common_border_line_width_attlist_;
odf_types::common_shadow_attlist common_shadow_attlist_;
......
......@@ -116,8 +116,8 @@ public:
virtual void serialize(std::wostream & strm);
_CP_OPT(odf_types::drop_cap_length) style_length_;
_CP_OPT(unsigned int) style_lines_;
_CP_OPT(odf_types::drop_cap_length) style_length_;
_CP_OPT(unsigned int) style_lines_;
_CP_OPT(odf_types::length) style_distance_;
_CP_OPT(odf_types::style_ref) style_style_name_;
_CP_OPT(odf_types::common_xlink_attlist) common_xlink_attlist_;
......@@ -169,166 +169,68 @@ public:
void clear();
public:
// 15.5.1 fo:line-height
_CP_OPT(odf_types::line_width) fo_line_height_; // +
// 15.5.2 style:line-height-at-least
_CP_OPT(odf_types::length) style_line_height_at_least_; // +
// 15.5.3 style:line-spacing
_CP_OPT(odf_types::length_or_percent) style_line_spacing_; // +
// 15.5.4 style:font-independent-line-spacing
_CP_OPT(odf_types::Bool) style_font_independent_line_spacing_; // ???
// 15.5.5 fo:text-align
_CP_OPT(odf_types::text_align) fo_text_align_; // +
// 15.5.6 fo:text-align-last
_CP_OPT(odf_types::text_align) fo_text_align_last_;
// 15.5.7 style:justify-single-word
_CP_OPT(odf_types::Bool) style_justify_single_word_;
// 15.5.8 fo:keep-together
_CP_OPT(odf_types::keep_together) fo_keep_together_; // +
// 15.5.9 fo:widows
_CP_OPT(unsigned int) fo_widows_; // +
// 15.5.10 fo:orphans
_CP_OPT(unsigned int) fo_orphans_;
// 15.5.11 <style:tab-stops>
office_element_ptr style_tab_stops_; // +
// 15.5.12 style:tab-stop-distance
_CP_OPT(odf_types::length) style_tab_stop_distance_;
// 15.5.13 fo:hyphenation-keep
_CP_OPT(odf_types::hyphenation_keep) fo_hyphenation_keep_;
// 15.5.14 fo:hyphenation-ladder-count
_CP_OPT(odf_types::integer_or_nolimit) fo_hyphenation_ladder_count_;
// 15.5.15 <style:drop-cap>
office_element_ptr style_drop_cap_;
// 15.5.16 style:register-true
_CP_OPT(odf_types::Bool) style_register_true_;
// 15.5.17 fo:margin-left
_CP_OPT(odf_types::length_or_percent) fo_margin_left_; // +
// fo:margin-right
_CP_OPT(odf_types::length_or_percent) fo_margin_right_; // +
// 15.5.18 fo:text-indent
_CP_OPT(odf_types::length_or_percent) fo_text_indent_; // +
// 15.5.19 style:auto-text-indent
_CP_OPT(odf_types::Bool) style_auto_text_indent_; // ???
// 15.5.20 fo:margin-top
_CP_OPT(odf_types::length_or_percent) fo_margin_top_; // +
// fo:margin-bottom
_CP_OPT(odf_types::length_or_percent) fo_margin_bottom_; // +
// 15.5.21 fo:margin
_CP_OPT(odf_types::length_or_percent) fo_margin_;
// 15.5.22 fo:break-before
_CP_OPT(odf_types::fo_break) fo_break_before_; // +
// fo:break-after
_CP_OPT(odf_types::fo_break) fo_break_after_;
// 15.5.23 fo:background-color
_CP_OPT(odf_types::background_color) fo_background_color_;
// 15.5.24 <style:background-image>
office_element_ptr style_background_image_;
odf_types::common_border_attlist common_border_attlist_;
// 15.5.26
// style:border-line-width
_CP_OPT( odf_types::border_widths ) style_border_line_width_; // +
// style:border-line-width-top
_CP_OPT( odf_types::border_widths ) style_border_line_width_top_; // +
// style:border-line-width-bottom
_CP_OPT( odf_types::border_widths ) style_border_line_width_bottom_;// +
// style:border-line-width-left
_CP_OPT( odf_types::border_widths ) style_border_line_width_left_; // +
// style:border-line-width-right
_CP_OPT( odf_types::border_widths ) style_border_line_width_right_; // +
// 15.5.27
// fo:padding
_CP_OPT(odf_types::length) fo_padding_; // +
// fo:padding-top
_CP_OPT(odf_types::length) fo_padding_top_; // +
// fo:padding-bottom
_CP_OPT(odf_types::length) fo_padding_bottom_; // +
// fo:padding-left
_CP_OPT(odf_types::length) fo_padding_left_; // +
// fo:padding-right
_CP_OPT(odf_types::length) fo_padding_right_; // +
// 15.5.28 style:shadow
_CP_OPT(std::wstring) style_shadow_;
// 15.5.29 fo:keep-with-next
_CP_OPT(odf_types::keep_together) fo_keep_with_next_; // +
// 15.5.30 text:number-lines
_CP_OPT(odf_types::Bool) text_number_lines_;
// 15.5.31 text:line-number
_CP_OPT(unsigned int) text_line_number_;
// 15.5.32 style:text-autospace
_CP_OPT(odf_types::text_autospace) style_text_autospace_;
// 15.5.33 style:punctuation-wrap
_CP_OPT(odf_types::punctuation_wrap) style_punctuation_wrap_;
// 15.5.34 style:line-break
_CP_OPT(odf_types::line_break) style_line_break_;
// 15.5.35 style:vertical-align
_CP_OPT(odf_types::vertical_align) style_vertical_align_; // +
// 15.5.36 style:writing-mode
_CP_OPT(odf_types::writing_mode) style_writing_mode_;
// 15.5.37 style:writing-mode-automatic
_CP_OPT(odf_types::Bool) style_writing_mode_automatic_;
// 15.5.38 style:snap-to-layout-grid
_CP_OPT(odf_types::Bool) style_snap_to_layout_grid_;
// 15.5.39 style:page-number
_CP_OPT(unsigned int) style_page_number_;
// 15.5.40 style:background-transparency
_CP_OPT(odf_types::percent) style_background_transparency_;
//
_CP_OPT(odf_types::Bool) style_join_border_;
_CP_OPT(odf_types::Bool) style_contextual_spacing_;
_CP_OPT(odf_types::length) style_line_height_at_least_;
_CP_OPT(odf_types::length_or_percent) style_line_spacing_;
_CP_OPT(odf_types::Bool) style_font_independent_line_spacing_;
_CP_OPT(odf_types::Bool) style_justify_single_word_;
office_element_ptr style_tab_stops_; // +
_CP_OPT(odf_types::length) style_tab_stop_distance_;
office_element_ptr style_drop_cap_;
_CP_OPT(odf_types::Bool) style_register_true_;
_CP_OPT(odf_types::Bool) style_auto_text_indent_;
office_element_ptr style_background_image_;
_CP_OPT( odf_types::border_widths ) style_border_line_width_;
_CP_OPT( odf_types::border_widths ) style_border_line_width_top_;
_CP_OPT( odf_types::border_widths ) style_border_line_width_bottom_;
_CP_OPT( odf_types::border_widths ) style_border_line_width_left_;
_CP_OPT( odf_types::border_widths ) style_border_line_width_right_;
_CP_OPT(std::wstring) style_shadow_;
_CP_OPT(odf_types::text_autospace) style_text_autospace_;
_CP_OPT(odf_types::punctuation_wrap) style_punctuation_wrap_;
_CP_OPT(odf_types::line_break) style_line_break_;
_CP_OPT(odf_types::vertical_align) style_vertical_align_;
_CP_OPT(odf_types::writing_mode) style_writing_mode_;
_CP_OPT(odf_types::Bool) style_writing_mode_automatic_;
_CP_OPT(odf_types::Bool) style_snap_to_layout_grid_;
_CP_OPT(unsigned int) style_page_number_;
_CP_OPT(odf_types::percent) style_background_transparency_;
_CP_OPT(odf_types::Bool) style_join_border_;
_CP_OPT(odf_types::Bool) style_contextual_spacing_;
_CP_OPT(odf_types::text_align) fo_text_align_;
_CP_OPT(odf_types::line_width) fo_line_height_;
_CP_OPT(odf_types::text_align) fo_text_align_last_;
_CP_OPT(odf_types::keep_together) fo_keep_together_;
_CP_OPT(unsigned int) fo_widows_;
_CP_OPT(unsigned int) fo_orphans_;
_CP_OPT(odf_types::hyphenation_keep) fo_hyphenation_keep_;
_CP_OPT(odf_types::integer_or_nolimit) fo_hyphenation_ladder_count_;
_CP_OPT(odf_types::length_or_percent) fo_margin_left_;
_CP_OPT(odf_types::length_or_percent) fo_margin_right_;
_CP_OPT(odf_types::length_or_percent) fo_margin_top_;
_CP_OPT(odf_types::length_or_percent) fo_margin_bottom_;
_CP_OPT(odf_types::length_or_percent) fo_text_indent_;
_CP_OPT(odf_types::length_or_percent) fo_margin_ ;
_CP_OPT(odf_types::fo_break) fo_break_before_;
_CP_OPT(odf_types::fo_break) fo_break_after_;
_CP_OPT(odf_types::length) fo_padding_;
_CP_OPT(odf_types::length) fo_padding_top_;
_CP_OPT(odf_types::length) fo_padding_bottom_;
_CP_OPT(odf_types::length) fo_padding_left_;
_CP_OPT(odf_types::length) fo_padding_right_;
_CP_OPT(odf_types::background_color) fo_background_color_;
_CP_OPT(odf_types::keep_together) fo_keep_with_next_;
odf_types::common_border_attlist common_border_attlist_;
_CP_OPT(odf_types::Bool) text_number_lines_;
_CP_OPT(unsigned int) text_line_number_;
//-----------------------------------------------------------------------------
//not writing elements - used in other place
//-----------------------------------------------------------------------------
_CP_OPT(unsigned int) outline_level_;
_CP_OPT(unsigned int) outline_level_;
};
......
......@@ -367,14 +367,14 @@ void OoxConverter::convert(OOX::Vml::CFill *vml_fill)
if (vml_fill->m_oOpacity.IsInit() && vml_fill->m_oOpacity2.IsInit() )
{
odf_context()->drawing_context()->start_opacity_style();
odf_context()->drawing_context()->set_opacity_start(100 - vml_fill->m_oOpacity->GetValue() * 100);
odf_context()->drawing_context()->set_opacity_end (100 - vml_fill->m_oOpacity2->GetValue() * 100);
odf_context()->drawing_context()->set_opacity_start(vml_fill->m_oOpacity->GetValue() * 100);
odf_context()->drawing_context()->set_opacity_end (vml_fill->m_oOpacity2->GetValue() * 100);
//.....
odf_context()->drawing_context()->end_opacity_style();
}
else if (vml_fill->m_oOpacity.IsInit())
{
odf_context()->drawing_context()->set_opacity(100 - vml_fill->m_oOpacity->GetValue() * 100);
odf_context()->drawing_context()->set_opacity(vml_fill->m_oOpacity->GetValue() * 100);
}
else if (vml_fill->m_oOpacity2.IsInit())
{
......@@ -561,7 +561,8 @@ void OoxConverter::convert(OOX::Vml::CTextbox *vml_textbox)
{
for (unsigned int i=0 ; i < vml_textbox->m_oTxtbxContent->m_arrItems.size();i++)
{
if (docx_converter)docx_converter->convert(vml_textbox->m_oTxtbxContent->m_arrItems[i]);
if (docx_converter)
docx_converter->convert(vml_textbox->m_oTxtbxContent->m_arrItems[i]);
}
odf_context()->drawing_context()->set_text( odf_context()->text_context());
}
......
......@@ -1822,6 +1822,7 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
OoxConverter::convert(oox_pic->m_oShape.GetPointer());
OoxConverter::convert(oox_pic->m_oShapeOval.GetPointer());
odf_context()->drawing_context()->corrected_line_fill();
odf_context()->drawing_context()->end_shape();
}
else if (oox_pic->m_oShapeCurve.IsInit())
......@@ -1866,6 +1867,7 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
OoxConverter::convert(oox_pic->m_oShape.GetPointer());
OoxConverter::convert(oox_pic->m_oShapeArc.GetPointer());
odf_context()->drawing_context()->corrected_line_fill();
odf_context()->drawing_context()->end_shape();
}
else if (oox_pic->m_oShapeRect.IsInit())
......@@ -1888,6 +1890,7 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
OoxConverter::convert(oox_pic->m_oShape.GetPointer());
OoxConverter::convert(oox_pic->m_oShapeRect.GetPointer());
odf_context()->drawing_context()->corrected_line_fill();
odf_context()->drawing_context()->end_shape();
}
}
......@@ -1899,6 +1902,7 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
OoxConverter::convert(oox_pic->m_oShape.GetPointer());
OoxConverter::convert(oox_pic->m_oShapeRoundRect.GetPointer());
odf_context()->drawing_context()->corrected_line_fill();
odf_context()->drawing_context()->end_shape();
}
else if (oox_pic->m_oShapeType.IsInit())
......@@ -2873,7 +2877,12 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
}
}
}
//nullable<ComplexTypes::Word::CDecimalNumber > m_oStart;
if ((oox_num_lvl->m_oStart.IsInit()) && (oox_num_lvl->m_oStart->m_oVal.IsInit()))
{
int start_value = oox_num_lvl->m_oStart->m_oVal->GetValue();
if (start_value > 1)
odt_context->styles_context()->lists_styles().set_start_number(start_value);
}
if (oox_num_lvl->m_oSuffix.IsInit())
{
}
......
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