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) ...@@ -354,6 +354,7 @@ void docx_serialize_shape(std::wostream & strm, _docx_drawing & val)
CP_XML_ATTR(L"noChangeAspect", 1); CP_XML_ATTR(L"noChangeAspect", 1);
} }
} }
CP_XML_NODE(L"wps:spPr") CP_XML_NODE(L"wps:spPr")
{ {
oox_serialize_xfrm(CP_XML_STREAM(),val); oox_serialize_xfrm(CP_XML_STREAM(),val);
......
...@@ -22,7 +22,8 @@ public: ...@@ -22,7 +22,8 @@ public:
void start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName); void start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
void end_row(); void end_row();
std::wstring current_row_style() const; std::wstring current_row_style() const;
void start_cell();
void start_cell();
void end_cell(); void end_cell();
bool start_covered_cell(docx_conversion_context & Context); bool start_covered_cell(docx_conversion_context & Context);
...@@ -30,24 +31,24 @@ public: ...@@ -30,24 +31,24 @@ public:
int current_column() const; int current_column() const;
void set_columns_spanned(unsigned int Val); void set_columns_spanned(unsigned int Val);
unsigned int current_columns_spaned() const; unsigned int current_columns_spaned() const;
void set_rows_spanned(unsigned int Column, unsigned int Val, unsigned int ColumnsSpanned, const std::wstring & Style); void set_rows_spanned(unsigned int Column, unsigned int Val, unsigned int ColumnsSpanned, const std::wstring & Style);
unsigned int current_rows_spanned(unsigned int Column) const; unsigned int current_rows_spanned(unsigned int Column) const;
private: private:
docx_conversion_context & context_; docx_conversion_context & context_;
std::wstring table_style_; std::wstring table_style_;
std::list<std::wstring> table_row_style_stack_; std::list<std::wstring> table_row_style_stack_;
std::wstring default_row_cell_style_name_; std::wstring default_row_cell_style_name_;
int current_table_column_; int current_table_column_;
unsigned int columns_spanned_num_; unsigned int columns_spanned_num_;
std::wstring columns_spanned_style_; std::wstring columns_spanned_style_;
std::vector<table_row_spanned> rows_spanned_; std::vector<table_row_spanned> rows_spanned_;
bool close_table_covered_cell_; bool close_table_covered_cell_;
std::vector<unsigned int> columns_; std::vector<unsigned int> columns_;
std::vector<std::wstring> columnsDefaultCellStyleName_; std::vector<std::wstring> columnsDefaultCellStyleName_;
}; };
......
...@@ -58,6 +58,8 @@ std::wstring static get_default_file_name(mediaitems::Type type) ...@@ -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) std::wstring mediaitems::create_file_name(const std::wstring & uri, mediaitems::Type type, size_t Num)
{ {
if (uri.empty()) return L"";
std::wstring sExt; std::wstring sExt;
int n = uri.rfind(L"."); int n = uri.rfind(L".");
if (n>0) sExt = uri.substr(n); if (n>0) sExt = uri.substr(n);
......
...@@ -18,6 +18,8 @@ namespace media { ...@@ -18,6 +18,8 @@ namespace media {
bool is_internal(const std::wstring & uri, const std::wstring & packetRoot) 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 mediaPath = boost::regex_search(uri.begin(), uri.end(), boost::wregex(L"^/[A-Za-z]:"))
? std::wstring(uri.begin() + 1, uri.end()) ? std::wstring(uri.begin() + 1, uri.end())
: uri; : uri;
......
...@@ -108,14 +108,14 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope ...@@ -108,14 +108,14 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
} }
_CP_OPT(std::wstring) strVal; _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) 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); odf_reader::GetProperty(prop,L"marker-end",strVal);
if (strVal) if (strVal)
......
...@@ -349,7 +349,8 @@ void oox_serialize_tcPr(std::wostream & strm, const odf_reader::style_instance* ...@@ -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::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) if (fill.bitmap)
{ {
......
...@@ -342,7 +342,7 @@ void process_build_chart::ApplyGraphicProperties(std::wstring style,std::vector< ...@@ -342,7 +342,7 @@ void process_build_chart::ApplyGraphicProperties(std::wstring style,std::vector<
{ {
graphic_format_properties properties = calc_graphic_properties_content(styleInst); 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); properties.apply_to(propertiesOut);
} }
} }
......
...@@ -272,7 +272,10 @@ bool common_xlink_attlist::add_attributes( const xml::attributes_wc_ptr & Attrib ...@@ -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:type", type_);
CP_APPLY_ATTR(L"xlink:show", show_); CP_APPLY_ATTR(L"xlink:show", show_);
CP_APPLY_ATTR(L"xlink:actuate", actuate_); 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) void common_xlink_attlist::apply_from(const common_xlink_attlist & Other)
{ {
...@@ -292,24 +295,27 @@ void common_xlink_attlist::serialize(CP_ATTR_NODE) ...@@ -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 ) 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-type" , office_value_type_);
CP_APPLY_ATTR(L"office:value", office_value_); CP_APPLY_ATTR(L"office:value" , office_value_);
CP_APPLY_ATTR(L"office:currency", office_currency_); CP_APPLY_ATTR(L"office:currency" , office_currency_);
CP_APPLY_ATTR(L"office:date-value", office_date_value_); 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:time-value" , office_time_value_);
CP_APPLY_ATTR(L"office:boolean-value", office_boolean_value_); CP_APPLY_ATTR(L"office:boolean-value", office_boolean_value_);
CP_APPLY_ATTR(L"office:string-value", office_string_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) 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_type_ , Other.office_value_type_);
_CP_APPLY_PROP(office_value_, Other.office_value_); _CP_APPLY_PROP(office_value_ , Other.office_value_);
_CP_APPLY_PROP(office_currency_, Other.office_currency_); _CP_APPLY_PROP(office_currency_ , Other.office_currency_);
_CP_APPLY_PROP(office_date_value_, Other.office_date_value_); _CP_APPLY_PROP(office_date_value_ , Other.office_date_value_);
_CP_APPLY_PROP(office_time_value_, Other.office_time_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_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) void common_value_and_type_attlist::serialize(CP_ATTR_NODE)
{ {
...@@ -388,11 +394,11 @@ void common_border_line_width_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 ) 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" , fo_padding_);
CP_APPLY_ATTR(L"fo:padding-top", fo_padding_top_); 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-bottom" , fo_padding_bottom_);
CP_APPLY_ATTR(L"fo:padding-left", fo_padding_left_); 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-right" , fo_padding_right_);
} }
void common_padding_attlist::apply_from(const common_padding_attlist & Other) 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) ...@@ -404,11 +410,11 @@ void common_padding_attlist::apply_from(const common_padding_attlist & Other)
} }
void common_padding_attlist::serialize(CP_ATTR_NODE) void common_padding_attlist::serialize(CP_ATTR_NODE)
{ {
CP_XML_ATTR_OPT(L"fo:padding", fo_padding_); 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-top" , fo_padding_top_);
CP_XML_ATTR_OPT(L"fo:padding-bottom", fo_padding_bottom_); 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-left" , fo_padding_left_);
CP_XML_ATTR_OPT(L"fo:padding-right", fo_padding_right_); CP_XML_ATTR_OPT(L"fo:padding-right" , fo_padding_right_);
} }
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
......
...@@ -553,11 +553,11 @@ public: ...@@ -553,11 +553,11 @@ public:
void serialize(CP_ATTR_NODE); void serialize(CP_ATTR_NODE);
public: public:
_CP_OPT(std::wstring) table_end_cell_address_; _CP_OPT(std::wstring) table_end_cell_address_;
_CP_OPT(length) table_end_x_; _CP_OPT(length) table_end_x_;
_CP_OPT(length) table_end_y_; _CP_OPT(length) table_end_y_;
_CP_OPT(Bool) table_table_background_; _CP_OPT(Bool) table_table_background_;
common_text_anchor_attlist common_text_anchor_attlist_; common_text_anchor_attlist common_text_anchor_attlist_;
}; };
......
#include <ostream> #include <ostream>
#include <sstream> #include <sstream>
#include <string> #include <string>
...@@ -15,6 +13,8 @@ ...@@ -15,6 +13,8 @@
#include "draw_common.h" #include "draw_common.h"
#include "style_paragraph_properties.h"
#include "datatypes/length.h" #include "datatypes/length.h"
#include "datatypes/borderstyle.h" #include "datatypes/borderstyle.h"
#include "odfcontext.h" #include "odfcontext.h"
...@@ -337,7 +337,7 @@ void Compute_GradientFill(draw_gradient * image_style,oox::oox_gradient_fill_ptr ...@@ -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; if (fill.type<1)fill.type = 0;
...@@ -374,27 +374,52 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, styles_lite_con ...@@ -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_; 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 (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 = oox::oox_bitmap_fill::create();
fill.bitmap->xlink_href_ = image_style->xlink_attlist_.href_.get_value_or(L""); 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->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 (fill.bitmap)
{ {
if (props.style_repeat_) if (props.style_repeat_)
{ {
switch(props.style_repeat_->get_type()) switch(props.style_repeat_->get_type())
{ {
case style_repeat::Repeat : fill.bitmap->bTile = true; case style_repeat::Repeat : fill.bitmap->bTile = true; break;
break; case style_repeat::Stretch : fill.bitmap->bStretch = 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_ && props.draw_fill_image_height_)
{ {
if (props.draw_fill_image_width_->get_type() == odf_types::length_or_percent::Percent && 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 ...@@ -39,7 +39,8 @@ int Compute_BorderWidth(const graphic_format_properties & graphicProperties, Bor
int GetMargin(const graphic_format_properties & graphicProperties, BorderSide borderSide);//emu 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]; typedef double double_4[4];
bool parse_clipping(std::wstring strClipping,std::wstring fileName,double_4 & clip_rect); bool parse_clipping(std::wstring strClipping,std::wstring fileName,double_4 & clip_rect);
......
...@@ -137,7 +137,8 @@ void draw_frame::add_attributes( const xml::attributes_wc_ptr & Attributes ) ...@@ -137,7 +137,8 @@ void draw_frame::add_attributes( const xml::attributes_wc_ptr & Attributes )
idx_in_owner = -1; idx_in_owner = -1;
common_presentation_attlist_.add_attributes(Attributes); common_presentation_attlist_.add_attributes(Attributes);
common_draw_attlists_.shape_with_text_and_styles_.add_attributes(Attributes);
common_draw_attlists_.shape_with_text_and_styles_.add_attributes(Attributes);
common_draw_attlists_.position_.add_attributes(Attributes); common_draw_attlists_.position_.add_attributes(Attributes);
common_draw_attlists_.rel_size_.add_attributes(Attributes); common_draw_attlists_.rel_size_.add_attributes(Attributes);
......
...@@ -104,8 +104,7 @@ public: ...@@ -104,8 +104,7 @@ public:
void add_attributes( const xml::attributes_wc_ptr & Attributes ); void add_attributes( const xml::attributes_wc_ptr & Attributes );
public: public:
_CP_OPT(std::wstring) draw_copy_of_; _CP_OPT(std::wstring) draw_copy_of_;
}; };
...@@ -114,8 +113,8 @@ class draw_frame : public office_element_impl<draw_frame> ...@@ -114,8 +113,8 @@ class draw_frame : public office_element_impl<draw_frame>
public: public:
static const wchar_t * ns; static const wchar_t * ns;
static const wchar_t * name; static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement; static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawFrame; static const ElementType type = typeDrawFrame;
CPDOCCORE_DEFINE_VISITABLE(); CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context); virtual void docx_convert(oox::docx_conversion_context & Context);
...@@ -132,22 +131,22 @@ private: ...@@ -132,22 +131,22 @@ private:
public: public:
int idx_in_owner ; int idx_in_owner ;
odf_types::common_presentation_attlist common_presentation_attlist_; odf_types::common_presentation_attlist common_presentation_attlist_;
odf_types::union_common_draw_attlists common_draw_attlists_; odf_types::union_common_draw_attlists common_draw_attlists_;
odf_types::presentation_shape_attlist presentation_shape_attlist_; odf_types::presentation_shape_attlist presentation_shape_attlist_;
draw_frame_attlist draw_frame_attlist_; draw_frame_attlist draw_frame_attlist_;
// draw-text-box, draw-image, draw-object, draw-object-ole, draw-applet, draw-floating-frame, draw-plugin // 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_array content_;
office_element_ptr office_event_listeners_; // content - office_element_ptr office_event_listeners_;
office_element_ptr draw_glue_point_; // content -
office_element_ptr draw_image_map_; office_element_ptr draw_glue_point_;
office_element_ptr draw_image_map_;
//office_element_ptr draw_chart_map_; //office_element_ptr draw_chart_map_;
office_element_ptr draw_contour_; // draw-contour-polygon or draw-contour-path office_element_ptr draw_contour_; // draw-contour-polygon or draw-contour-path
friend class odf_document; friend class odf_document;
friend class draw_image; friend class draw_image;
......
...@@ -166,7 +166,8 @@ int ComputeMarginX(const style_page_layout_properties * pagePropertiesNode, ...@@ -166,7 +166,8 @@ int ComputeMarginX(const style_page_layout_properties * pagePropertiesNode,
_CP_OPT(length) contextSubstractedValue(0, length::pt); _CP_OPT(length) contextSubstractedValue(0, length::pt);
_CP_OPT(style_wrap) styleWrap = graphicProperties.style_wrap_; _CP_OPT(style_wrap) styleWrap = graphicProperties.style_wrap_;
if (!styleWrap ||
if (!styleWrap ||
styleWrap->get_type() == style_wrap::None || styleWrap->get_type() == style_wrap::None ||
styleWrap->get_type() == style_wrap::RunThrough) styleWrap->get_type() == style_wrap::RunThrough)
{ {
...@@ -547,7 +548,15 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties, ...@@ -547,7 +548,15 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties,
common_text_anchor_attlist_. common_text_anchor_attlist_.
type_; type_;
_CP_OPT(vertical_rel) styleVerticalRel = graphicProperties.common_vertical_rel_attlist_.style_vertical_rel_; //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_; _CP_OPT(vertical_pos) styleVerticallPos = graphicProperties.common_vertical_pos_attlist_.style_vertical_pos_;
const _CP_OPT(length) pageHeight = pageProperties.fo_page_height_; const _CP_OPT(length) pageHeight = pageProperties.fo_page_height_;
...@@ -696,6 +705,11 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties, ...@@ -696,6 +705,11 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties,
if (attlists_.position_.svg_y_) if (attlists_.position_.svg_y_)
svgY = *attlists_.position_.svg_y_; 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); return get_value_emu(svgY);
} }
...@@ -802,7 +816,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio ...@@ -802,7 +816,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
////////////////////////////////////////////// //////////////////////////////////////////////
graphicProperties.apply_to(drawing.additional); 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)) if ((drawing.fill.bitmap) && (drawing.fill.bitmap->rId.length() < 1))
{ {
......
...@@ -131,7 +131,8 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -131,7 +131,8 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
properties.apply_to(Context.get_slide_context().get_properties()); properties.apply_to(Context.get_slide_context().get_properties());
oox::_oox_fill fill; 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_fill(fill);
Context.get_slide_context().set_property(odf_reader::_property(L"border_width_left", Compute_BorderWidth(properties, sideLeft))); 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) ...@@ -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)); Context.get_drawing_context().set_clipping(strRectClip.substr(5,strRectClip.length()-6));
} }
oox::_oox_fill fill; 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_drawing_context().set_fill(fill);
//////////////////////////////////////////////// ////////////////////////////////////////////////
//BOOST_FOREACH(office_element_ptr const & elm, content_) //BOOST_FOREACH(office_element_ptr const & elm, content_)
......
...@@ -118,7 +118,8 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -118,7 +118,8 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
if (properties) if (properties)
{ {
oox::_oox_fill fill; 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); Context.get_slide_context().add_background(fill);
//÷àñòü ñâîéñòâ ïåðåõîäîâ ìåæäó ñëàéäàìè òóòà //÷àñòü ñâîéñòâ ïåðåõîäîâ ìåæäó ñëàéäàìè òóòà
......
...@@ -113,7 +113,8 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context) ...@@ -113,7 +113,8 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context)
} }
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
oox::_oox_fill fill; 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_fill(fill);
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
Context.get_text_context().start_object(); Context.get_text_context().start_object();
......
...@@ -101,7 +101,8 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -101,7 +101,8 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
} }
oox::_oox_fill fill; 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_drawing_context().set_fill(fill);
////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////
Context.get_text_context().start_drawing_content(); Context.get_text_context().start_drawing_content();
......
...@@ -45,7 +45,7 @@ const wchar_t * text::name = L""; ...@@ -45,7 +45,7 @@ const wchar_t * text::name = L"";
::std::wostream & text::text_to_stream(::std::wostream & _Wostream) const ::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; return _Wostream;
} }
......
...@@ -130,6 +130,8 @@ void graphic_format_properties::apply_from(const graphic_format_properties & Oth ...@@ -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_shadow_attlist_.apply_from(Other.common_shadow_attlist_);
common_background_color_attlist_.apply_from(Other.common_background_color_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 ...@@ -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) 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") //if (CP_CHECK_NAME(L"text", L"list-style")
// styles_.add_child_element(Reader, Ns, Name, getContext()); ... // styles_.add_child_element(Reader, Ns, Name, getContext()); ...
......
...@@ -405,7 +405,6 @@ void paragraph_format_properties::apply_from(const paragraph_format_properties & ...@@ -405,7 +405,6 @@ void paragraph_format_properties::apply_from(const paragraph_format_properties &
_CP_APPLY_PROP(fo_background_color_, Other.fo_background_color_); _CP_APPLY_PROP(fo_background_color_, Other.fo_background_color_);
// TODO
_CP_APPLY_PROP(style_background_image_, Other.style_background_image_); _CP_APPLY_PROP(style_background_image_, Other.style_background_image_);
_CP_APPLY_PROP(fo_border_, Other.fo_border_); _CP_APPLY_PROP(fo_border_, Other.fo_border_);
......
...@@ -159,22 +159,19 @@ public: ...@@ -159,22 +159,19 @@ public:
CPDOCCORE_DEFINE_VISITABLE(); CPDOCCORE_DEFINE_VISITABLE();
public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const; virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ); 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_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_text(const std::wstring & Text); virtual void add_text(const std::wstring & Text);
private: _CP_OPT(odf_types::style_repeat) style_repeat_;
_CP_OPT(odf_types::style_repeat) style_repeat_; _CP_OPT(odf_types::style_position) style_position_;
_CP_OPT(odf_types::style_position) style_position_; _CP_OPT(std::wstring) filter_name_;
_CP_OPT(std::wstring) filter_name_; _CP_OPT(odf_types::percent) draw_opacity_;
_CP_OPT(odf_types::percent) draw_opacity_;
_CP_OPT(odf_types::common_xlink_attlist) common_xlink_attlist_; _CP_OPT(odf_types::common_xlink_attlist) common_xlink_attlist_;
office_element_ptr office_binary_data_; office_element_ptr office_binary_data_;
}; };
...@@ -192,7 +189,6 @@ public: ...@@ -192,7 +189,6 @@ public:
void docx_convert(oox::docx_conversion_context & Context); void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context); void pptx_convert(oox::pptx_conversion_context & Context);
public:
// 15.5.1 fo:line-height // 15.5.1 fo:line-height
_CP_OPT(odf_types::line_width) 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) ...@@ -387,7 +387,7 @@ void style_tab_stops::docx_convert(oox::docx_conversion_context & Context)
_pPr << L"<w:tabs>"; _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_) BOOST_FOREACH(const office_element_ptr & elm, style_tab_stops_)
{ {
...@@ -402,11 +402,19 @@ void style_tab_stop::docx_convert(oox::docx_conversion_context & Context) ...@@ -402,11 +402,19 @@ void style_tab_stop::docx_convert(oox::docx_conversion_context & Context)
std::wstringstream & _pPr = Context.get_styles_context().paragraph_nodes(); std::wstringstream & _pPr = Context.get_styles_context().paragraph_nodes();
_pPr << L"<w:tab "; _pPr << L"<w:tab ";
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=\"" << (int)( 20.0 * style_position_.get_value_unit(length::pt) ) << "\" "; _pPr << L"w:pos=\"" << tab_pos << "\" ";
{ {
std::wstring val = L"left"; std::wstring val = L"left"; //????
if (style_type_) if (style_type_)
{ {
switch(style_type_->get_type()) switch(style_type_->get_type())
......
...@@ -104,7 +104,13 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex ...@@ -104,7 +104,13 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex
{ {
std::wstring w_val = L"left"; std::wstring w_val = L"left";
if (table_align_->get_type() == table_align::Margins) 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 else
w_val = boost::lexical_cast<std::wstring>(*table_align_); w_val = boost::lexical_cast<std::wstring>(*table_align_);
......
...@@ -1446,7 +1446,8 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -1446,7 +1446,8 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context)
if (properties) if (properties)
{ {
oox::_oox_fill fill; 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); Context.get_slide_context().add_background(fill);
} }
} }
...@@ -1460,42 +1461,42 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -1460,42 +1461,42 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context)
//////////////// ////////////////
const wchar_t * hdrHeader = L"<w:hdr \ const wchar_t * hdrHeader = L"<w:hdr \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \ xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \ xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \ xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \ xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \ xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \ xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \ xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \ xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \ xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \ xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \ xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \ xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \ xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \ xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \ xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \ xmlns:v=\"urn:schemas-microsoft-com:vml\" \
mc:Ignorable=\"w14 wp14\">"; mc:Ignorable=\"w14 wp14\">";
const wchar_t * ftrHeader = L"<w:ftr \ const wchar_t * ftrHeader = L"<w:ftr \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \ xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \ xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \ xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \ xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \ xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \ xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \ xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \ xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \ xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \ xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \ xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \ xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \ xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \ xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \ xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \ xmlns:v=\"urn:schemas-microsoft-com:vml\" \
mc:Ignorable=\"w14 wp14\">"; mc:Ignorable=\"w14 wp14\">";
void style_header::docx_convert(oox::docx_conversion_context & Context) 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 ...@@ -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-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: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 // table-table-row-attlist
......
...@@ -23,19 +23,20 @@ public: ...@@ -23,19 +23,20 @@ public:
void add_attributes( const xml::attributes_wc_ptr & Attributes ); void add_attributes( const xml::attributes_wc_ptr & Attributes );
public: public:
_CP_OPT(bool) table_is_sub_table_;
_CP_OPT(std::wstring) table_name_; _CP_OPT(std::wstring) table_name_;
_CP_OPT(odf_types::style_ref) table_style_name_; _CP_OPT(odf_types::style_ref) table_style_name_;
_CP_OPT(std::wstring) table_template_name_; _CP_OPT(std::wstring) table_template_name_;
bool table_protected_; // default false bool table_protected_; // default false
_CP_OPT(std::wstring) table_protection_key_; _CP_OPT(std::wstring) table_protection_key_;
bool table_print_; // default true bool table_print_; // default true
_CP_OPT(std::wstring) table_print_ranges_; _CP_OPT(std::wstring) table_print_ranges_;
bool table_use_first_row_styles_; // default false; bool table_use_first_row_styles_; // default false;
bool table_use_banding_rows_styles_; //defualt false; bool table_use_banding_rows_styles_; //defualt false;
bool table_use_first_column_styles_;//defualt false; bool table_use_first_column_styles_;//defualt false;
bool table_use_banding_columns_styles_; //defualt false; bool table_use_banding_columns_styles_; //defualt false;
friend class table_table; friend class table_table;
}; };
...@@ -682,14 +683,14 @@ private: ...@@ -682,14 +683,14 @@ private:
virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name); virtual void add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name);
public: public:
table_table_attlist table_table_attlist_; table_table_attlist table_table_attlist_;
office_element_ptr table_table_source_;//table-table-source office_element_ptr table_table_source_;//table-table-source
//office-dde-source //office-dde-source
//table-scenario //table-scenario
//office-forms //office-forms
office_element_ptr table_shapes_; office_element_ptr table_shapes_;
table_columns_and_groups table_columns_and_groups_;//table-columns-and-groups table_columns_and_groups table_columns_and_groups_;//table-columns-and-groups
table_rows_and_groups table_rows_and_groups_; table_rows_and_groups table_rows_and_groups_;
}; };
......
...@@ -115,33 +115,36 @@ void table_rows_and_groups::docx_convert(oox::docx_conversion_context & Context) ...@@ -115,33 +115,36 @@ void table_rows_and_groups::docx_convert(oox::docx_conversion_context & Context)
void table_table::docx_convert(oox::docx_conversion_context & Context) void table_table::docx_convert(oox::docx_conversion_context & Context)
{ {
std::wostream & _Wostream = Context.output_stream(); std::wostream & _Wostream = Context.output_stream();
_Wostream << L"<w:tbl>";
std::wstring tableStyleName = L""; bool sub_table = table_table_attlist_.table_is_sub_table_.get_value_or(false);
if (table_table_attlist_.table_style_name_) //todooo sub- ( )
tableStyleName = table_table_attlist_.table_style_name_->style_name() ;
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); Context.get_table_context().start_table(tableStyleName);
style_instance * inst = 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(); Context.get_styles_context().start();
if (inst && inst->content()) if (inst && inst->content())
inst->content()->docx_convert(Context); inst->content()->docx_convert(Context);
Context.get_styles_context().docx_serialize_table_style(_Wostream);
_Wostream << L"<w:tblGrid>"; Context.get_styles_context().docx_serialize_table_style(_Wostream);
table_columns_and_groups_.docx_convert(Context);
_Wostream << L"</w:tblGrid>"; _Wostream << L"<w:tblGrid>";
table_columns_and_groups_.docx_convert(Context);
_Wostream << L"</w:tblGrid>";
table_rows_and_groups_.docx_convert(Context); table_rows_and_groups_.docx_convert(Context);
Context.get_table_context().end_table(); Context.get_table_context().end_table();
_Wostream << L"</w:tbl>"; _Wostream << L"</w:tbl>";
if (office_element * elm = Context.get_section_properties_in_table()) if (office_element * elm = Context.get_section_properties_in_table())
{ {
......
...@@ -178,7 +178,8 @@ void table_table::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -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(); const graphic_format_properties & style_graphic = inst->content()->get_style_graphic_properties()->content();
oox::_oox_fill fill; 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) 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