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

OdfFile правка багов по результатам тестирования переноса контента при конвертации

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63317 954022d7-b5bf-4e40-9824-e11837661b57
parent 512ba072
......@@ -354,6 +354,7 @@ void docx_serialize_shape(std::wostream & strm, _docx_drawing & val)
CP_XML_ATTR(L"noChangeAspect", 1);
}
}
CP_XML_NODE(L"wps:spPr")
{
oox_serialize_xfrm(CP_XML_STREAM(),val);
......
......@@ -22,6 +22,7 @@ public:
void start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
void end_row();
std::wstring current_row_style() const;
void start_cell();
void end_cell();
......
......@@ -58,6 +58,8 @@ std::wstring static get_default_file_name(mediaitems::Type type)
}
std::wstring mediaitems::create_file_name(const std::wstring & uri, mediaitems::Type type, size_t Num)
{
if (uri.empty()) return L"";
std::wstring sExt;
int n = uri.rfind(L".");
if (n>0) sExt = uri.substr(n);
......
......@@ -18,6 +18,8 @@ namespace media {
bool is_internal(const std::wstring & uri, const std::wstring & packetRoot)
{
if (uri.empty())return false;
std::wstring mediaPath = boost::regex_search(uri.begin(), uri.end(), boost::wregex(L"^/[A-Za-z]:"))
? std::wstring(uri.begin() + 1, uri.end())
: uri;
......
......@@ -108,14 +108,14 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
}
_CP_OPT(std::wstring) strVal;
if (dash_style.length() >0)
if (dash_style.length() >0 && dash_style != L"solid")
{
CP_XML_NODE(L"a:prstDash"){CP_XML_ATTR(L"val",dash_style);}
CP_XML_NODE(L"a:prstDash"){CP_XML_ATTR(L"val", dash_style);}
}
odf_reader::GetProperty(prop,L"marker-start",strVal);
odf_reader::GetProperty(prop,L"marker-start", strVal);
if (strVal)
{
CP_XML_NODE(L"a:headEnd"){CP_XML_ATTR(L"type",strVal.get());}
CP_XML_NODE(L"a:headEnd"){CP_XML_ATTR(L"type", strVal.get());}
}
odf_reader::GetProperty(prop,L"marker-end",strVal);
if (strVal)
......
......@@ -349,7 +349,8 @@ void oox_serialize_tcPr(std::wostream & strm, const odf_reader::style_instance*
odf_reader::graphic_format_properties style_graphic = odf_reader::calc_graphic_properties_content(instances);
odf_reader::Compute_GraphicFill(style_graphic.common_draw_fill_attlist_, Context.root()->odf_context().drawStyles() ,fill);
odf_reader::Compute_GraphicFill(style_graphic.common_draw_fill_attlist_, style_graphic.style_background_image_,
Context.root()->odf_context().drawStyles() ,fill);
if (fill.bitmap)
{
......
......@@ -342,7 +342,7 @@ void process_build_chart::ApplyGraphicProperties(std::wstring style,std::vector<
{
graphic_format_properties properties = calc_graphic_properties_content(styleInst);
Compute_GraphicFill(properties.common_draw_fill_attlist_, draw_styles_ , fill);
Compute_GraphicFill(properties.common_draw_fill_attlist_, properties.style_background_image_ , draw_styles_ , fill);
properties.apply_to(propertiesOut);
}
}
......
......@@ -272,7 +272,10 @@ bool common_xlink_attlist::add_attributes( const xml::attributes_wc_ptr & Attrib
CP_APPLY_ATTR(L"xlink:type", type_);
CP_APPLY_ATTR(L"xlink:show", show_);
CP_APPLY_ATTR(L"xlink:actuate", actuate_);
return true;
if (href_ || type_ || show_ || actuate_) return true;
return false;
}
void common_xlink_attlist::apply_from(const common_xlink_attlist & Other)
{
......@@ -292,24 +295,27 @@ void common_xlink_attlist::serialize(CP_ATTR_NODE)
bool common_value_and_type_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"office:value-type", office_value_type_);
CP_APPLY_ATTR(L"office:value", office_value_);
CP_APPLY_ATTR(L"office:currency", office_currency_);
CP_APPLY_ATTR(L"office:date-value", office_date_value_);
CP_APPLY_ATTR(L"office:time-value", office_time_value_);
CP_APPLY_ATTR(L"office:value-type" , office_value_type_);
CP_APPLY_ATTR(L"office:value" , office_value_);
CP_APPLY_ATTR(L"office:currency" , office_currency_);
CP_APPLY_ATTR(L"office:date-value" , office_date_value_);
CP_APPLY_ATTR(L"office:time-value" , office_time_value_);
CP_APPLY_ATTR(L"office:boolean-value", office_boolean_value_);
CP_APPLY_ATTR(L"office:string-value", office_string_value_);
return true;
if (office_value_type_ || office_value_ || office_currency_ || office_date_value_ || office_time_value_
|| office_boolean_value_ || office_string_value_) return true;
return false;
}
void common_value_and_type_attlist::apply_from(const common_value_and_type_attlist & Other)
{
_CP_APPLY_PROP(office_value_type_ , Other.office_value_type_);
_CP_APPLY_PROP(office_value_, Other.office_value_);
_CP_APPLY_PROP(office_currency_, Other.office_currency_);
_CP_APPLY_PROP(office_date_value_, Other.office_date_value_);
_CP_APPLY_PROP(office_time_value_, Other.office_time_value_);
_CP_APPLY_PROP(office_value_ , Other.office_value_);
_CP_APPLY_PROP(office_currency_ , Other.office_currency_);
_CP_APPLY_PROP(office_date_value_ , Other.office_date_value_);
_CP_APPLY_PROP(office_time_value_ , Other.office_time_value_);
_CP_APPLY_PROP(office_boolean_value_, Other.office_boolean_value_);
_CP_APPLY_PROP(office_string_value_, Other.office_string_value_);
_CP_APPLY_PROP(office_string_value_ , Other.office_string_value_);
}
void common_value_and_type_attlist::serialize(CP_ATTR_NODE)
{
......@@ -388,11 +394,11 @@ void common_border_line_width_attlist::serialize(CP_ATTR_NODE)
void common_padding_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"fo:padding", fo_padding_);
CP_APPLY_ATTR(L"fo:padding-top", fo_padding_top_);
CP_APPLY_ATTR(L"fo:padding-bottom", fo_padding_bottom_);
CP_APPLY_ATTR(L"fo:padding-left", fo_padding_left_);
CP_APPLY_ATTR(L"fo:padding-right", fo_padding_right_);
CP_APPLY_ATTR(L"fo:padding" , fo_padding_);
CP_APPLY_ATTR(L"fo:padding-top" , fo_padding_top_);
CP_APPLY_ATTR(L"fo:padding-bottom" , fo_padding_bottom_);
CP_APPLY_ATTR(L"fo:padding-left" , fo_padding_left_);
CP_APPLY_ATTR(L"fo:padding-right" , fo_padding_right_);
}
void common_padding_attlist::apply_from(const common_padding_attlist & Other)
{
......@@ -404,11 +410,11 @@ void common_padding_attlist::apply_from(const common_padding_attlist & Other)
}
void common_padding_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"fo:padding", fo_padding_);
CP_XML_ATTR_OPT(L"fo:padding-top", fo_padding_top_);
CP_XML_ATTR_OPT(L"fo:padding" , fo_padding_);
CP_XML_ATTR_OPT(L"fo:padding-top" , fo_padding_top_);
CP_XML_ATTR_OPT(L"fo:padding-bottom", fo_padding_bottom_);
CP_XML_ATTR_OPT(L"fo:padding-left", fo_padding_left_);
CP_XML_ATTR_OPT(L"fo:padding-right", fo_padding_right_);
CP_XML_ATTR_OPT(L"fo:padding-left" , fo_padding_left_);
CP_XML_ATTR_OPT(L"fo:padding-right" , fo_padding_right_);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
......
#include <ostream>
#include <sstream>
#include <string>
......@@ -15,6 +13,8 @@
#include "draw_common.h"
#include "style_paragraph_properties.h"
#include "datatypes/length.h"
#include "datatypes/borderstyle.h"
#include "odfcontext.h"
......@@ -337,7 +337,7 @@ void Compute_GradientFill(draw_gradient * image_style,oox::oox_gradient_fill_ptr
}
void Compute_GraphicFill(const common_draw_fill_attlist & props, styles_lite_container &styles, oox::_oox_fill & fill)
void Compute_GraphicFill(const common_draw_fill_attlist & props, const office_element_ptr & style_image, styles_lite_container &styles, oox::_oox_fill & fill)
{
if (fill.type<1)fill.type = 0;
......@@ -374,27 +374,52 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, styles_lite_con
const std::wstring style_name = L"bitmap:" + *props.draw_fill_image_name_;
if (office_element_ptr style = styles.find_by_style_name(style_name))
{
if (draw_fill_image * image_style = dynamic_cast<draw_fill_image *>(style.get()))
if (draw_fill_image * fill_image = dynamic_cast<draw_fill_image *>(style.get()))
{
fill.bitmap = oox::oox_bitmap_fill::create();
fill.bitmap->xlink_href_ = fill_image->xlink_attlist_.href_.get_value_or(L"");
fill.bitmap->bTile = true;
}
}
}
if (style_image)
{
if (style_background_image * image = dynamic_cast<style_background_image *>(style_image.get()))
{
if ((image) && (image->common_xlink_attlist_))
{
fill.type = 2;
fill.bitmap = oox::oox_bitmap_fill::create();
fill.bitmap->xlink_href_ = image_style->xlink_attlist_.href_.get_value_or(L"");
fill.bitmap->xlink_href_ = image->common_xlink_attlist_->href_.get_value_or(L"");
if (image->style_repeat_)
{
switch(image->style_repeat_->get_type())
{
case style_repeat::Repeat : fill.bitmap->bTile = true; break;
case style_repeat::Stretch : fill.bitmap->bStretch = true; break;
}
}
if (image->draw_opacity_)
{
fill.opacity = image->draw_opacity_->get_value();
}
}
}
}
if (fill.bitmap)
{
if (props.style_repeat_)
{
switch(props.style_repeat_->get_type())
{
case style_repeat::Repeat : fill.bitmap->bTile = true;
break;
case style_repeat::Stretch :fill.bitmap->bStretch = true;
break;
case style_repeat::Repeat : fill.bitmap->bTile = true; break;
case style_repeat::Stretch : fill.bitmap->bStretch = true; break;
}
}else
}
else
{
fill.bitmap->bTile = true;// ????
if (props.draw_fill_image_width_ && props.draw_fill_image_height_)
{
if (props.draw_fill_image_width_->get_type() == odf_types::length_or_percent::Percent &&
......
......@@ -39,7 +39,8 @@ int Compute_BorderWidth(const graphic_format_properties & graphicProperties, Bor
int GetMargin(const graphic_format_properties & graphicProperties, BorderSide borderSide);//emu
void Compute_GraphicFill(const odf_types::common_draw_fill_attlist & props, styles_lite_container &styles, oox::_oox_fill & fill);
void Compute_GraphicFill(const odf_types::common_draw_fill_attlist & props,
const office_element_ptr & style_image, styles_lite_container &styles, oox::_oox_fill & fill);
typedef double double_4[4];
bool parse_clipping(std::wstring strClipping,std::wstring fileName,double_4 & clip_rect);
......
......@@ -137,6 +137,7 @@ void draw_frame::add_attributes( const xml::attributes_wc_ptr & Attributes )
idx_in_owner = -1;
common_presentation_attlist_.add_attributes(Attributes);
common_draw_attlists_.shape_with_text_and_styles_.add_attributes(Attributes);
common_draw_attlists_.position_.add_attributes(Attributes);
common_draw_attlists_.rel_size_.add_attributes(Attributes);
......
......@@ -105,7 +105,6 @@ public:
public:
_CP_OPT(std::wstring) draw_copy_of_;
};
......@@ -135,14 +134,14 @@ public:
odf_types::common_presentation_attlist common_presentation_attlist_;
odf_types::union_common_draw_attlists common_draw_attlists_;
odf_types::presentation_shape_attlist presentation_shape_attlist_;
draw_frame_attlist draw_frame_attlist_;
// draw-text-box, draw-image, draw-object, draw-object-ole, draw-applet, draw-floating-frame, draw-plugin
office_element_ptr_array content_;
office_element_ptr office_event_listeners_; // content -
office_element_ptr office_event_listeners_;
// content -
office_element_ptr draw_glue_point_;
office_element_ptr draw_image_map_;
//office_element_ptr draw_chart_map_;
......
......@@ -166,6 +166,7 @@ int ComputeMarginX(const style_page_layout_properties * pagePropertiesNode,
_CP_OPT(length) contextSubstractedValue(0, length::pt);
_CP_OPT(style_wrap) styleWrap = graphicProperties.style_wrap_;
if (!styleWrap ||
styleWrap->get_type() == style_wrap::None ||
styleWrap->get_type() == style_wrap::RunThrough)
......@@ -547,6 +548,14 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties,
common_text_anchor_attlist_.
type_;
//todooo ...
//const _CP_OPT(unsigned int) anchor_page_number =
// attlists_.shape_with_text_and_styles_.
// common_draw_shape_with_styles_attlist_.
// common_text_spreadsheet_shape_attlist_.
// common_text_anchor_attlist_.
// page_number_;
_CP_OPT(vertical_rel) styleVerticalRel = graphicProperties.common_vertical_rel_attlist_.style_vertical_rel_;
_CP_OPT(vertical_pos) styleVerticallPos = graphicProperties.common_vertical_pos_attlist_.style_vertical_pos_;
......@@ -697,6 +706,11 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties,
svgY = *attlists_.position_.svg_y_;
}
//if (anchor_page_number && pageHeight).... .. :(
//{
// svgY = length(svgY->get_value_unit(length::pt) + pageHeight->get_value_unit(length::pt) * (*anchor_page_number - 1), length::pt );
//}
return get_value_emu(svgY);
}
......@@ -802,7 +816,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
//////////////////////////////////////////////
graphicProperties.apply_to(drawing.additional);
//////////////////////////////////////////
Compute_GraphicFill(graphicProperties.common_draw_fill_attlist_, Context.root()->odf_context().drawStyles() ,drawing.fill);
Compute_GraphicFill(graphicProperties.common_draw_fill_attlist_, graphicProperties.style_background_image_, Context.root()->odf_context().drawStyles() ,drawing.fill);
if ((drawing.fill.bitmap) && (drawing.fill.bitmap->rId.length() < 1))
{
......
......@@ -131,7 +131,8 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
properties.apply_to(Context.get_slide_context().get_properties());
oox::_oox_fill fill;
Compute_GraphicFill(properties.common_draw_fill_attlist_, Context.root()->odf_context().drawStyles() ,fill);
Compute_GraphicFill(properties.common_draw_fill_attlist_, properties.style_background_image_,
Context.root()->odf_context().drawStyles() ,fill);
Context.get_slide_context().set_fill(fill);
Context.get_slide_context().set_property(odf_reader::_property(L"border_width_left", Compute_BorderWidth(properties, sideLeft)));
......
......@@ -121,7 +121,8 @@ void draw_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
Context.get_drawing_context().set_clipping(strRectClip.substr(5,strRectClip.length()-6));
}
oox::_oox_fill fill;
Compute_GraphicFill(properties.common_draw_fill_attlist_, Context.root()->odf_context().drawStyles() ,fill);
Compute_GraphicFill(properties.common_draw_fill_attlist_, properties.style_background_image_,
Context.root()->odf_context().drawStyles() ,fill);
Context.get_drawing_context().set_fill(fill);
////////////////////////////////////////////////
//BOOST_FOREACH(office_element_ptr const & elm, content_)
......
......@@ -118,7 +118,8 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
if (properties)
{
oox::_oox_fill fill;
Compute_GraphicFill(properties->content().common_draw_fill_attlist_, Context.root()->odf_context().drawStyles() ,fill);
Compute_GraphicFill(properties->content().common_draw_fill_attlist_, office_element_ptr(),
Context.root()->odf_context().drawStyles() ,fill);
Context.get_slide_context().add_background(fill);
//÷àñòü ñâîéñòâ ïåðåõîäîâ ìåæäó ñëàéäàìè òóòà
......
......@@ -113,7 +113,8 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context)
}
///////////////////////////////////////////////////////////////////////////////////////
oox::_oox_fill fill;
Compute_GraphicFill(properties.common_draw_fill_attlist_, Context.root()->odf_context().drawStyles() ,fill);
Compute_GraphicFill(properties.common_draw_fill_attlist_, properties.style_background_image_,
Context.root()->odf_context().drawStyles() ,fill);
Context.get_slide_context().set_fill(fill);
////////////////////////////////////////////////////////////////////////////////////
Context.get_text_context().start_object();
......
......@@ -101,7 +101,8 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
}
oox::_oox_fill fill;
Compute_GraphicFill(properties.common_draw_fill_attlist_, Context.root()->odf_context().drawStyles() ,fill);
Compute_GraphicFill(properties.common_draw_fill_attlist_, properties.style_background_image_,
Context.root()->odf_context().drawStyles() ,fill);
Context.get_drawing_context().set_fill(fill);
//////////////////////////////////////////////////////////////////////////////////////
Context.get_text_context().start_drawing_content();
......
......@@ -45,7 +45,7 @@ const wchar_t * text::name = L"";
::std::wostream & text::text_to_stream(::std::wostream & _Wostream) const
{
_Wostream << xml::utils::replace_xml_to_text( text_ );
_Wostream << xml::utils::replace_text_to_xml( text_ );
return _Wostream;
}
......
......@@ -130,6 +130,8 @@ void graphic_format_properties::apply_from(const graphic_format_properties & Oth
common_shadow_attlist_.apply_from(Other.common_shadow_attlist_);
common_background_color_attlist_.apply_from(Other.common_background_color_attlist_);
_CP_APPLY_PROP(style_background_image_, Other.style_background_image_);
}
......@@ -145,7 +147,10 @@ void style_graphic_properties::add_attributes( const xml::attributes_wc_ptr & At
void style_graphic_properties::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{
// CP_NOT_APPLICABLE_ELM();
if (L"style" == Ns && L"background-image" == Name)
{
CP_CREATE_ELEMENT(graphic_format_properties_.style_background_image_);
}
//if (CP_CHECK_NAME(L"text", L"list-style")
// styles_.add_child_element(Reader, Ns, Name, getContext()); ...
......
......@@ -405,7 +405,6 @@ void paragraph_format_properties::apply_from(const paragraph_format_properties &
_CP_APPLY_PROP(fo_background_color_, Other.fo_background_color_);
// TODO
_CP_APPLY_PROP(style_background_image_, Other.style_background_image_);
_CP_APPLY_PROP(fo_border_, Other.fo_border_);
......
......@@ -159,15 +159,12 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
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);
private:
_CP_OPT(odf_types::style_repeat) style_repeat_;
_CP_OPT(odf_types::style_position) style_position_;
_CP_OPT(std::wstring) filter_name_;
......@@ -192,7 +189,6 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
public:
// 15.5.1 fo:line-height
_CP_OPT(odf_types::line_width) fo_line_height_; // +
......
......@@ -387,7 +387,7 @@ void style_tab_stops::docx_convert(oox::docx_conversion_context & Context)
_pPr << L"<w:tabs>";
if (style_tab_stops_.size())
if (style_tab_stops_.size() > 0)
{
BOOST_FOREACH(const office_element_ptr & elm, style_tab_stops_)
{
......@@ -403,10 +403,18 @@ void style_tab_stop::docx_convert(oox::docx_conversion_context & Context)
_pPr << L"<w:tab ";
_pPr << L"w:pos=\"" << (int)( 20.0 * style_position_.get_value_unit(length::pt) ) << "\" ";
length def_tab = length(1.0, length::cm);// ms 0.8
int tab_pos = (int)( 20.0 * style_position_.get_value_unit(length::pt) ) ;
int min_tab_pos = (int)( 20.0 * def_tab.get_value_unit(length::pt) ) ;
if (tab_pos < min_tab_pos)
tab_pos = min_tab_pos;
_pPr << L"w:pos=\"" << tab_pos << "\" ";
{
std::wstring val = L"left";
std::wstring val = L"left"; //????
if (style_type_)
{
switch(style_type_->get_type())
......
......@@ -104,7 +104,13 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex
{
std::wstring w_val = L"left";
if (table_align_->get_type() == table_align::Margins)
w_val = L"left";
{
if (common_horizontal_margin_attlist_.fo_margin_left_ && common_horizontal_margin_attlist_.fo_margin_right_)
{
if (common_horizontal_margin_attlist_.fo_margin_left_->get_length() == common_horizontal_margin_attlist_.fo_margin_right_->get_length())
w_val = L"center";
}
}
else
w_val = boost::lexical_cast<std::wstring>(*table_align_);
......
......@@ -1446,7 +1446,8 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context)
if (properties)
{
oox::_oox_fill fill;
Compute_GraphicFill(properties->content().common_draw_fill_attlist_, Context.root()->odf_context().drawStyles() ,fill);
Compute_GraphicFill(properties->content().common_draw_fill_attlist_, office_element_ptr(),
Context.root()->odf_context().drawStyles() ,fill);
Context.get_slide_context().add_background(fill);
}
}
......@@ -1460,42 +1461,42 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context)
////////////////
const wchar_t * hdrHeader = L"<w:hdr \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
mc:Ignorable=\"w14 wp14\">";
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
mc:Ignorable=\"w14 wp14\">";
const wchar_t * ftrHeader = L"<w:ftr \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
mc:Ignorable=\"w14 wp14\">";
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
mc:Ignorable=\"w14 wp14\">";
void style_header::docx_convert(oox::docx_conversion_context & Context)
{
......
......@@ -37,6 +37,7 @@ void table_table_attlist::add_attributes( const xml::attributes_wc_ptr & Attribu
CP_APPLY_ATTR(L"table:use-banding-columns-styles", table_use_banding_columns_styles_,false);
CP_APPLY_ATTR(L"table:use-first-column-styles", table_use_first_column_styles_,false);
CP_APPLY_ATTR(L"table:is-sub-table", table_is_sub_table_);
}
// table-table-row-attlist
......
......@@ -23,6 +23,7 @@ public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
public:
_CP_OPT(bool) table_is_sub_table_;
_CP_OPT(std::wstring) table_name_;
_CP_OPT(odf_types::style_ref) table_style_name_;
_CP_OPT(std::wstring) table_template_name_;
......
......@@ -115,17 +115,20 @@ void table_rows_and_groups::docx_convert(oox::docx_conversion_context & Context)
void table_table::docx_convert(oox::docx_conversion_context & Context)
{
std::wostream & _Wostream = Context.output_stream();
_Wostream << L"<w:tbl>";
bool sub_table = table_table_attlist_.table_is_sub_table_.get_value_or(false);
//todooo sub- ( )
std::wstring tableStyleName = L"";
if (table_table_attlist_.table_style_name_)
tableStyleName = table_table_attlist_.table_style_name_->style_name() ;
_Wostream << L"<w:tbl>";
Context.get_table_context().start_table(tableStyleName);
style_instance * inst =
Context.root()->odf_context().styleContainer().style_by_name( tableStyleName , style_family::Table,Context.process_headers_footers_);
Context.root()->odf_context().styleContainer().style_by_name( tableStyleName , style_family::Table, Context.process_headers_footers_);
Context.get_styles_context().start();
......
......@@ -178,7 +178,8 @@ void table_table::pptx_convert(oox::pptx_conversion_context & Context)
{
const graphic_format_properties & style_graphic = inst->content()->get_style_graphic_properties()->content();
oox::_oox_fill fill;
Compute_GraphicFill(style_graphic.common_draw_fill_attlist_, Context.root()->odf_context().drawStyles() ,fill);
Compute_GraphicFill(style_graphic.common_draw_fill_attlist_, style_graphic.style_background_image_,
Context.root()->odf_context().drawStyles() ,fill);
if (fill.bitmap)
{
......
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