Compare commits

...

6 Commits

Author SHA1 Message Date
c727f0cba8 Merge remote-tracking branch 'origin/hotfix/v5.2.5' into develop 2018-12-21 13:08:59 +03:00
181f613893 OdfFormatReader - fix bug #39979 2018-12-20 19:30:45 +03:00
8c4d1cde6c . 2018-12-20 15:18:14 +03:00
6e515a1ee5 . 2018-12-19 19:19:17 +03:00
3532d4088d OdfFormat - fix after testing 2018-12-19 18:03:24 +03:00
eec7ab20fd XlsFormat - fix bug #40065 2018-12-19 18:02:40 +03:00
20 changed files with 369 additions and 160 deletions

View File

@ -152,8 +152,8 @@ std::wstring mediaitems::create_file_name(const std::wstring & uri, RelsType typ
if (sExt.empty())
{
int n = uri.find(L"ObjectReplacements");
if (n >= 0)
size_t n = uri.find(L"ObjectReplacements");
if (n != std::wstring::npos)
{
if (!isInternal) return L"";
@ -164,9 +164,9 @@ std::wstring mediaitems::create_file_name(const std::wstring & uri, RelsType typ
if (sExt.empty())
{
//то что есть ..
int n = uri.rfind(L".");
if (n > 0)
sExt = uri.substr(n);
size_t n = uri.rfind(L".");
if (n != std::wstring::npos)
sExt = XmlUtils::GetLower(uri.substr(n));
}
}
@ -193,7 +193,7 @@ std::wstring mediaitems::detectImageFileExtension(const std::wstring &fileName)
if (!sExt.empty()) sExt = std::wstring(L".") + sExt;
}
return sExt;
return XmlUtils::GetLower(sExt);
}
std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, bool & isInternal, std::wstring & ref)
@ -268,8 +268,8 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
}
else if ( type == typeImage)
{
int n_svm = outputPath.rfind (L".svm");
if ( n_svm >= 0 )
size_t n_svm = outputPath.rfind (L".svm");
if ( n_svm != std::wstring::npos )
{
outputPath = outputPath.substr(0, n_svm) + L".png";
}

View File

@ -112,7 +112,10 @@ static const std::wstring _ooxShapeType[]=
L"curvedConnector3",
L"",//3-D shape
L"",
L"polyline"
L"polyline",
L"cube",
L"ellipse", //sphere
L""
};
@ -427,7 +430,7 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
shapeGeomPreset = L"rect";
}
}
else if (sub_type <= 14 && sub_type >= 0)
else if (sub_type <= 16 && sub_type >= 0)
{
shapeGeomPreset = _ooxShapeType[sub_type]; //odf -> oox
}
@ -522,15 +525,6 @@ void _oox_drawing::serialize_xfrm(std::wostream & strm, const std::wstring & nam
_CP_OPT(double) dSkewY;
odf_reader::GetProperty(additional, L"svg:skewY", dSkewY);
//if (dRotate)
//{
// double new_x = (cx / 2 * cos(-(*dRotate)) - cy / 2 * sin(-(*dRotate)) ) - cx / 2;
// double new_y = (cx / 2 * sin(-(*dRotate)) + cy / 2 * cos(-(*dRotate)) ) - cy / 2;
//
// x += new_x;
// y += new_y;
//}
CP_XML_NODE(xfrm)
{
if (dRotate)
@ -539,7 +533,7 @@ void _oox_drawing::serialize_xfrm(std::wostream & strm, const std::wstring & nam
CP_XML_ATTR(L"rot", (int)( d * 60000) ); //60 000 per 1 gr - 19.5.5 oox
}
_CP_OPT(bool)bVal;
if (odf_reader::GetProperty(additional,L"flipH", bVal))
if (odf_reader::GetProperty(additional, L"flipH", bVal))
CP_XML_ATTR(L"flipH", bVal.get());
if (odf_reader::GetProperty(additional,L"flipV", bVal))

View File

@ -42,7 +42,7 @@ namespace oox {
struct _pptx_comment
{
size_t x_, y_;
int x_, y_;
int author_id_;
int idx_;

View File

@ -510,7 +510,7 @@ public:
_CP_OPT(std::wstring) draw_id_;
_CP_OPT(std::wstring) draw_layer_;
_CP_OPT(std::wstring) draw_transform_;
_CP_OPT(int) draw_z_index_;
_CP_OPT(unsigned int) draw_z_index_;
_CP_OPT(std::wstring) drawooo_display_;
};

View File

@ -574,11 +574,7 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties,
const graphic_format_properties & graphicProperties,
const std::vector<odf_reader::_property> & additional)
{
// TODO : recursive result!!!
const _CP_OPT(anchor_type) anchor =
attlists_.shape_with_text_and_styles_.
common_text_anchor_attlist_.
type_;
const _CP_OPT(anchor_type) anchor = attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_;
//todooo пока не ясно как привязать к определеной странице в документе ...
//const _CP_OPT(unsigned int) anchor_page_number =
@ -589,6 +585,15 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties,
_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_;
if (!styleVerticalRel && anchor)
{
switch(anchor->get_type())
{
case anchor_type::Paragraph: styleVerticalRel = vertical_rel::Paragraph; break;
case anchor_type::Page: styleVerticalRel = vertical_rel::Page; break;
}
}
_CP_OPT(double) dVal;
GetProperty(additional, L"svg:translate_y", dVal);
@ -817,14 +822,31 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
}
_CP_OPT(run_through) styleRunThrough = graphicProperties.style_run_through_;
_CP_OPT(anchor_type) anchor = attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_;
drawing->styleHorizontalRel = graphicProperties.common_horizontal_rel_attlist_.style_horizontal_rel_;
drawing->styleHorizontalPos = graphicProperties.common_horizontal_pos_attlist_.style_horizontal_pos_;
drawing->styleVerticalPos = graphicProperties.common_vertical_pos_attlist_.style_vertical_pos_;
drawing->styleVerticalRel = graphicProperties.common_vertical_rel_attlist_.style_vertical_rel_;
_CP_OPT(anchor_type) anchor = attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_;
if (!drawing->styleVerticalRel && anchor)
{
switch(anchor->get_type())
{
case anchor_type::Paragraph: drawing->styleVerticalRel = vertical_rel::Paragraph; break;
case anchor_type::Page: drawing->styleVerticalRel = vertical_rel::Page; break;
case anchor_type::Char: drawing->styleVerticalRel = vertical_rel::Char; break;
}
}
if (!drawing->styleHorizontalRel && anchor)
{
switch(anchor->get_type())
{
case anchor_type::Paragraph: drawing->styleHorizontalRel = horizontal_rel::Paragraph; break;
case anchor_type::Page: drawing->styleHorizontalRel = horizontal_rel::Page; break;
case anchor_type::Char: drawing->styleHorizontalRel = horizontal_rel::Char; break;
}
}
int level_drawing = Context.get_drawing_context().get_current_level();
if (drawing->parallel == 1 || anchor && anchor->get_type() == anchor_type::AsChar || level_drawing >1 )
@ -852,7 +874,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
if (!drawing->styleWrap)
drawing->styleWrap = style_wrap(style_wrap::Parallel);//у опен офис и мс разные дефолты
_CP_OPT(int) zIndex = attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_z_index_;
_CP_OPT(unsigned int) zIndex = attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_z_index_;
if (zIndex)//порядок отрисовки объектов
{
@ -887,7 +909,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
}
drawing->number_wrapped_paragraphs = graphicProperties.style_number_wrapped_paragraphs_.
get_value_or( integer_or_nolimit( integer_or_nolimit::NoLimit) ).get_value();
if (anchor && anchor->get_type() == anchor_type::AsChar && drawing->posOffsetV< 0)
if (anchor && anchor->get_type() == anchor_type::AsChar && drawing->posOffsetV < 0)
{
drawing->posOffsetV = (int)(length(0.01, length::cm).get_value_unit(length::emu));
}
@ -936,14 +958,41 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
drawing->cx = get_value_emu(attlists_.rel_size_.common_draw_size_attlist_.svg_width_);
drawing->cy = get_value_emu(attlists_.rel_size_.common_draw_size_attlist_.svg_height_);
_CP_OPT(double) dVal;
GetProperty(drawing->additional, L"svg:rotate", dVal);
if (dVal)
{
double new_x = (drawing->cx / 2 * cos(-(*dVal)) - drawing->cy / 2 * sin(-(*dVal)) ) - drawing->cx / 2;
double new_y = (drawing->cx / 2 * sin(-(*dVal)) + drawing->cy / 2 * cos(-(*dVal)) ) - drawing->cy / 2;
drawing->x += new_x;
drawing->y += new_y;
}
GetProperty(drawing->additional, L"svg:scale_x",dVal);
if (dVal)drawing->cx = (int)(0.5 + drawing->cx * dVal.get());
GetProperty(drawing->additional, L"svg:scale_y",dVal);
if (dVal)drawing->cy = (int)(0.5 + drawing->cy * dVal.get());
GetProperty(drawing->additional, L"svg:translate_x", dVal);
if (dVal)
{
drawing->x += get_value_emu(dVal.get());
}
GetProperty(drawing->additional, L"svg:translate_y", dVal);
if (dVal)
{
drawing->y += get_value_emu(dVal.get());
}
if (drawing->cx < 0) //frame textbox int WORD_EXAMPLE.odt = 45 inch !!!!
{
drawing->cx = -drawing->cx;
drawing->additional.push_back(_property(L"fit-to-size", true));
}
if (drawing->cy < 0)
drawing->cy = 0;
////////////////////////////////////////////////////////////////////////////////////////////////////
if ((drawing->styleWrap) && (drawing->styleWrap->get_type() == style_wrap::Dynamic)) //автоподбор
{
@ -988,34 +1037,6 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
//}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
_CP_OPT(double) dVal;
GetProperty(drawing->additional, L"svg:scale_x",dVal);
if (dVal)drawing->cx = (int)(0.5 + drawing->cx * dVal.get());
GetProperty(drawing->additional, L"svg:scale_y",dVal);
if (dVal)drawing->cy = (int)(0.5 + drawing->cy * dVal.get());
GetProperty(drawing->additional, L"svg:translate_x", dVal);
if (dVal)
{
drawing->x = get_value_emu(dVal.get());
}
GetProperty(drawing->additional, L"svg:translate_x", dVal);
if (dVal)
{
drawing->y = get_value_emu(dVal.get());
}
GetProperty(drawing->additional, L"svg:rotate", dVal);
if (dVal)
{
double new_x = (drawing->cx / 2 * cos(-(*dVal)) - drawing->cy / 2 * sin(-(*dVal)) ) - drawing->cx / 2;
double new_y = (drawing->cx / 2 * sin(-(*dVal)) + drawing->cy / 2 * cos(-(*dVal)) ) - drawing->cy / 2;
drawing->x += new_x;
drawing->y += new_y;
}
if (drawing->inGroup && drawing->type != oox::typeGroupShape)
{
_INT32 x_group_offset, y_group_offset;

View File

@ -88,7 +88,7 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
common_shape_draw_attlist &common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_;
common_presentation_attlist &common_presentation_attlist_= common_draw_attlists_.shape_with_text_and_styles_.common_presentation_attlist_;
const int z_index = common_draw_attlist_.draw_z_index_.get_value_or(0);
const unsigned int z_index = common_draw_attlist_.draw_z_index_.get_value_or(0);
const std::wstring name = common_draw_attlist_.draw_name_.get_value_or(L"");
const std::wstring textStyleName = common_draw_attlist_.draw_text_style_name_.get_value_or(L"");

View File

@ -73,8 +73,8 @@ void draw_g::xlsx_convert(oox::xlsx_conversion_context & Context)
{
common_draw_shape_with_text_and_styles_attlist common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_;
const int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
const std::wstring name = common_draw_attlist_.common_shape_draw_attlist_.draw_name_.get_value_or(L"");
const unsigned int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
const std::wstring name = common_draw_attlist_.common_shape_draw_attlist_.draw_name_.get_value_or(L"");
//////////////////////////////////////////////////////////////////////////
Context.get_drawing_context().start_group( name);
@ -118,7 +118,7 @@ void draw_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
{
common_draw_shape_with_text_and_styles_attlist common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_;
const int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
const unsigned int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
const std::wstring name = common_draw_attlist_.common_shape_draw_attlist_.draw_name_.get_value_or(L"");
const std::wstring styleName = common_draw_attlist_.common_shape_draw_attlist_.draw_style_name_.get_value_or(L"");
const std::wstring textStyleName = common_draw_attlist_.common_shape_draw_attlist_.draw_text_style_name_.get_value_or(L"");

View File

@ -492,6 +492,8 @@ void draw_enhanced_geometry_attlist::add_attributes( const xml::attributes_wc_pt
CP_APPLY_ATTR(L"draw:enhanced-path" , draw_enhanced_path_);
CP_APPLY_ATTR(L"drawooo:enhanced-path" , drawooo_enhanced_path_);
CP_APPLY_ATTR(L"drawooo:sub-view-size" , drawooo_sub_view_size_);
CP_APPLY_ATTR(L"draw:mirror-horizontal" , draw_mirror_horizontal_);
CP_APPLY_ATTR(L"draw:mirror-vertical" , draw_mirror_vertical_);
}
//-------------------------------------------------------------------------------------------
// draw:enhanced_geometry
@ -501,7 +503,7 @@ const wchar_t * draw_enhanced_geometry::name = L"enhanced-geometry";
void draw_enhanced_geometry::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
draw_enhanced_geometry_attlist_.add_attributes(Attributes);
attlist_.add_attributes(Attributes);
CP_APPLY_ATTR(L"svg:viewBox", svg_viewbox_);
}
@ -525,20 +527,20 @@ void draw_enhanced_geometry::add_child_element( xml::sax * Reader, const std::ws
}
void draw_enhanced_geometry::find_draw_type_oox()
{
word_art_ = false;
bOoxType_ = false;
word_art_ = false;
bOoxType_ = false;
if (draw_enhanced_geometry_attlist_.draw_text_path_ &&
*draw_enhanced_geometry_attlist_.draw_text_path_ == true)
if (attlist_.draw_text_path_ &&
*attlist_.draw_text_path_ == true)
{
draw_type_oox_index_ = 0;
word_art_ = true;
sub_type_ = 1;
}
if (draw_enhanced_geometry_attlist_.draw_type_)
if (attlist_.draw_type_)
{
std::wstring odf_type = draw_enhanced_geometry_attlist_.draw_type_.get();
std::wstring odf_type = attlist_.draw_type_.get();
if (word_art_)
{
@ -561,7 +563,7 @@ void draw_enhanced_geometry::find_draw_type_oox()
if (pos == std::wstring::npos)
{
for (long i = 0; i< count; i++)
for (long i = 0; i < count; i++)
{
if (_OO_OOX_custom_shapes[i].odf_reader == odf_type)
{
@ -762,6 +764,38 @@ void dr3d_light::add_attributes( const xml::attributes_wc_ptr & Attributes )
CP_APPLY_ATTR(L"dr3d:enabled", dr3d_enabled_);
}
//-------------------------------------------------------------------------------------------
// dr3d:cube
//-------------------------------------------------------------------------------------------
const wchar_t * dr3d_cube::ns = L"dr3d";
const wchar_t * dr3d_cube::name = L"cube";
void dr3d_cube::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
draw_shape::add_attributes(Attributes);
CP_APPLY_ATTR(L"dr3d:max-edge", dr3d_max_edge_);
CP_APPLY_ATTR(L"dr3d:min-edge", dr3d_min_edge_);
CP_APPLY_ATTR(L"dr3d:transform", dr3d_transform_);
sub_type_ = 15;
}
//-------------------------------------------------------------------------------------------
// dr3d:sphere
//-------------------------------------------------------------------------------------------
const wchar_t * dr3d_sphere::ns = L"dr3d";
const wchar_t * dr3d_sphere::name = L"sphere";
void dr3d_sphere::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
draw_shape::add_attributes(Attributes);
CP_APPLY_ATTR(L"dr3d:size", dr3d_size_); //vector3D
CP_APPLY_ATTR(L"dr3d:center", dr3d_center_); //vector3D
CP_APPLY_ATTR(L"dr3d:transform",dr3d_transform_);
sub_type_ = 16;
}
//-------------------------------------------------------------------------------------------
// draw:control
//-------------------------------------------------------------------------------------------
const wchar_t * draw_control::ns = L"draw";

View File

@ -455,6 +455,8 @@ public:
_CP_OPT(std::wstring) draw_enhanced_path_;
_CP_OPT(std::wstring) drawooo_enhanced_path_;
_CP_OPT(std::wstring) drawooo_sub_view_size_;
_CP_OPT(bool) draw_mirror_horizontal_;
_CP_OPT(bool) draw_mirror_vertical_;
};
/////////////////////////////////////////////////////////////////////////
class draw_enhanced_geometry : public office_element_impl<draw_enhanced_geometry>
@ -476,7 +478,7 @@ public:
void find_draw_type_oox();
draw_enhanced_geometry_attlist draw_enhanced_geometry_attlist_;
draw_enhanced_geometry_attlist attlist_;
_CP_OPT(int) sub_type_;
_CP_OPT(int) draw_type_oox_index_;
@ -641,13 +643,61 @@ public:
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context);
_CP_OPT(std::wstring) dr3d_diffuse_color_;
_CP_OPT(std::wstring) dr3d_direction_;
_CP_OPT(std::wstring) dr3d_specular_;
_CP_OPT(odf_types::Bool)dr3d_enabled_;
_CP_OPT(std::wstring) dr3d_diffuse_color_;
_CP_OPT(std::wstring) dr3d_direction_;
_CP_OPT(odf_types::Bool) dr3d_specular_;
_CP_OPT(odf_types::Bool) dr3d_enabled_;
};
CP_REGISTER_OFFICE_ELEMENT2(dr3d_light);
//------------------------------------------------------------------------------------------------------------
class dr3d_cube : public draw_shape
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const ElementType type = typeDr3dCube;
static const xml::NodeType xml_type = xml::typeElement;
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context);
_CP_OPT(std::wstring) dr3d_max_edge_;
_CP_OPT(std::wstring) dr3d_min_edge_;
_CP_OPT(std::wstring) dr3d_transform_;
};
CP_REGISTER_OFFICE_ELEMENT2(dr3d_cube);
//------------------------------------------------------------------------------------------------------------
class dr3d_sphere : public draw_shape
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const ElementType type = typeDr3dSphere;
static const xml::NodeType xml_type = xml::typeElement;
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context);
_CP_OPT(std::wstring) dr3d_size_; //vector3D
_CP_OPT(std::wstring) dr3d_center_; //vector3D
_CP_OPT(std::wstring) dr3d_transform_;
};
CP_REGISTER_OFFICE_ELEMENT2(dr3d_sphere);
//----------------------------------------------------------------------------------------------
class draw_control : public draw_shape
{

View File

@ -288,6 +288,14 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
bool set_shape = false;
if (attlist_.draw_mirror_horizontal_)
{
shape->additional_.push_back(_property(L"flipH", *attlist_.draw_mirror_horizontal_));
}
if (attlist_.draw_mirror_vertical_)
{
shape->additional_.push_back(_property(L"flipV", *attlist_.draw_mirror_vertical_));
}
if (draw_type_oox_index_)
{
shape->additional_.push_back(_property(L"oox-geom-index", draw_type_oox_index_.get()));
@ -305,10 +313,10 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
set_shape = true;
}
std::wstring odf_path; //общая часть - объединить ...
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
if (attlist_.drawooo_enhanced_path_)
odf_path = attlist_.drawooo_enhanced_path_.get();
else if (attlist_.draw_enhanced_path_)
odf_path = attlist_.draw_enhanced_path_.get();
if (!odf_path.empty())
{
@ -339,10 +347,10 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
int w = 0;
int h = 0;
if (draw_enhanced_geometry_attlist_.drawooo_sub_view_size_)
if (attlist_.drawooo_sub_view_size_)
{
std::vector< std::wstring > splitted;
boost::algorithm::split(splitted, *draw_enhanced_geometry_attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
boost::algorithm::split(splitted, *attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
if (splitted.size() == 2)
{
@ -375,10 +383,10 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
}
}
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
if (attlist_.draw_modifiers_)
{
if (bOoxType_)
shape->additional_.push_back(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
shape->additional_.push_back(_property(L"oox-draw-modifiers", attlist_.draw_modifiers_.get()));
else
{
}
@ -406,6 +414,14 @@ void dr3d_scene::docx_convert(oox::docx_conversion_context & Context)
void dr3d_light::docx_convert(oox::docx_conversion_context & Context)
{
}
void dr3d_cube::docx_convert(oox::docx_conversion_context & Context)
{
}
void dr3d_sphere::docx_convert(oox::docx_conversion_context & Context)
{
}
}
}

View File

@ -68,7 +68,7 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context)
common_shape_draw_attlist &common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_;
common_presentation_attlist &common_presentation_attlist_= common_draw_attlists_.shape_with_text_and_styles_.common_presentation_attlist_;
const int z_index = common_draw_attlist_.draw_z_index_.get_value_or(0);
const unsigned int z_index = common_draw_attlist_.draw_z_index_.get_value_or(0);
const std::wstring name = common_draw_attlist_.draw_name_.get_value_or(L"");
const std::wstring textStyleName = common_draw_attlist_.draw_text_style_name_.get_value_or(L"");
@ -340,6 +340,14 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
bool set_shape = false;
if (attlist_.draw_mirror_horizontal_)
{
Context.get_slide_context().set_property(_property(L"flipH", *attlist_.draw_mirror_horizontal_));
}
if (attlist_.draw_mirror_vertical_)
{
Context.get_slide_context().set_property(_property(L"flipV", *attlist_.draw_mirror_vertical_));
}
if (draw_type_oox_index_)
{
Context.get_slide_context().set_property(_property(L"oox-geom-index", draw_type_oox_index_.get()));
@ -357,10 +365,10 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
}
std::wstring odf_path;
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
if (attlist_.drawooo_enhanced_path_)
odf_path = attlist_.drawooo_enhanced_path_.get();
else if (attlist_.draw_enhanced_path_)
odf_path = attlist_.draw_enhanced_path_.get();
if (!odf_path.empty())
{
@ -388,10 +396,10 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
set_shape = true;
if (draw_enhanced_geometry_attlist_.drawooo_sub_view_size_)
if (attlist_.drawooo_sub_view_size_)
{
std::vector< std::wstring > splitted;
boost::algorithm::split(splitted, *draw_enhanced_geometry_attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
boost::algorithm::split(splitted, *attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
if (splitted.size() == 2)
{
@ -412,10 +420,10 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
}
}
}
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
if (attlist_.draw_modifiers_)
{
if (bOoxType_)
Context.get_slide_context().set_property(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
Context.get_slide_context().set_property(_property(L"oox-draw-modifiers", attlist_.draw_modifiers_.get()));
else
{
}
@ -446,6 +454,14 @@ void dr3d_scene::pptx_convert(oox::pptx_conversion_context & Context)
void dr3d_light::pptx_convert(oox::pptx_conversion_context & Context)
{
}
void dr3d_cube::pptx_convert(oox::pptx_conversion_context & Context)
{
Context.get_slide_context().start_shape(sub_type_); //reset type
}
void dr3d_sphere::pptx_convert(oox::pptx_conversion_context & Context)
{
Context.get_slide_context().start_shape(sub_type_); //reset type
}
}
}

View File

@ -71,7 +71,7 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
common_draw_shape_with_text_and_styles_attlist common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_;
const int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
const unsigned int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
const std::wstring name = common_draw_attlist_.common_shape_draw_attlist_.draw_name_.get_value_or(L"");
const std::wstring styleName = common_draw_attlist_.common_shape_draw_attlist_.draw_style_name_.get_value_or(L"");
const std::wstring textStyleName = common_draw_attlist_.common_shape_draw_attlist_.draw_text_style_name_.get_value_or(L"");
@ -276,6 +276,14 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
{
find_draw_type_oox();
if (attlist_.draw_mirror_horizontal_)
{
Context.get_drawing_context().set_property(_property(L"flipH", *attlist_.draw_mirror_horizontal_));
}
if (attlist_.draw_mirror_vertical_)
{
Context.get_drawing_context().set_property(_property(L"flipV", *attlist_.draw_mirror_vertical_));
}
if (draw_type_oox_index_)
{
Context.get_drawing_context().set_property(_property(L"oox-geom-index", draw_type_oox_index_.get()));
@ -291,10 +299,10 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
}
std::wstring odf_path;
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
if (attlist_.drawooo_enhanced_path_)
odf_path = attlist_.drawooo_enhanced_path_.get();
else if (attlist_.draw_enhanced_path_)
odf_path = attlist_.draw_enhanced_path_.get();
if (!odf_path.empty())
{
@ -320,10 +328,10 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
::svg_path::oox_serialize(output_, o_Polyline);
Context.get_drawing_context().set_property(odf_reader::_property(L"custom_path", output_.str()));
if (draw_enhanced_geometry_attlist_.drawooo_sub_view_size_)
if (attlist_.drawooo_sub_view_size_)
{
std::vector< std::wstring > splitted;
boost::algorithm::split(splitted, *draw_enhanced_geometry_attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
boost::algorithm::split(splitted, *attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
if (splitted.size() == 2)
{
@ -348,10 +356,10 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
draw_type_oox_index_ = 0;
}
}
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
if (attlist_.draw_modifiers_)
{
if (bOoxType_)
Context.get_drawing_context().set_property(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
Context.get_drawing_context().set_property(_property(L"oox-draw-modifiers", attlist_.draw_modifiers_.get()));
else
{
}
@ -371,6 +379,15 @@ void dr3d_scene::xlsx_convert(oox::xlsx_conversion_context & Context)
void dr3d_light::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
void dr3d_cube::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.get_drawing_context().start_shape(sub_type_); //reset type
}
void dr3d_sphere::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.get_drawing_context().start_shape(sub_type_); //reset type
}
void draw_control::xlsx_convert(oox::xlsx_conversion_context & Context)
{

View File

@ -268,7 +268,7 @@ void officeooo_annotation::pptx_convert(oox::pptx_conversion_context & Context)
}
id_idx = Context.add_author_comments(author);
Context.get_comments_context().start_comment(x, y,id_idx.first,id_idx.second);//author & idx (uniq number for author
Context.get_comments_context().start_comment(x, y, id_idx.first, id_idx.second);//author & idx (uniq number for author
Context.get_text_context().start_comment_content();
for (size_t i = 0; i < content_.size(); i++)//текст + текстовый стиль

View File

@ -1854,7 +1854,7 @@ void odf_drawing_context::set_horizontal_pos(int align)
}
void odf_drawing_context::set_horizontal_pos(double offset_pt)
{
impl_->anchor_settings_.style_horizontal_pos_svg_x_ = length(length(offset_pt,length::pt).get_value_unit(length::cm),length::cm);
impl_->anchor_settings_.style_horizontal_pos_svg_x_ = length(length(offset_pt, length::pt).get_value_unit(length::cm), length::cm);
impl_->x = offset_pt;
}
void odf_drawing_context::set_default_wrap_style()

View File

@ -74,6 +74,7 @@ namespace odf_writer
count_rows = 0;
table_width = 0;
table_height = 0;
}
std::vector<odf_row_state> rows;
std::vector<odf_column_state> columns;
@ -91,6 +92,8 @@ namespace odf_writer
bool styled;
double table_width;
double table_height;
std::wstring default_cell_properties;
_CP_OPT(std::wstring) border_inside_v_;
@ -103,30 +106,34 @@ class odf_table_context::Impl
public:
Impl(odf_conversion_context *odf_context) :odf_context_(odf_context)
{
default_column_width = -1;
default_column_width = boost::none;
default_row_height = boost::none;
optimal_column_width = false;
}
odf_table_state & current_table() {return tables_.back();}
bool empty () {return tables_.size() >0 ? false : true; }
bool empty () {return (false == tables_.empty()) ? false : true; }
void start_table(odf_table_state & state) {tables_.push_back(state);}
void end_table()
{
if (tables_.size() > 0) tables_.pop_back();
if (false == tables_.empty()) tables_.pop_back();
default_column_width = -1; // todo .. in level ???
default_column_width = boost::none; // todo .. in level ???
default_row_height = boost::none;
default_cell_properties = L"";
optimal_column_width = false;
}
odf_style_context * styles_context() {return odf_context_->styles_context();}
odf_style_context *styles_context() {return odf_context_->styles_context();}
odf_conversion_context *odf_context_;
double default_column_width;
bool optimal_column_width;
_CP_OPT(double) default_row_height;
_CP_OPT(double) default_column_width;
bool optimal_column_width;
std::wstring default_cell_properties; // для предустановки ..
private:
@ -252,7 +259,7 @@ void odf_table_context::end_row()
// start_cell(cell,false);
// end_cell();
//}
impl_->current_table().current_column =0;
impl_->current_table().current_column = 0;
}
@ -312,16 +319,25 @@ void odf_table_context::set_default_cell_properties(std::wstring style_name)
{
impl_->default_cell_properties = style_name;
}
double odf_table_context::get_table_width()
_CP_OPT(double) odf_table_context::get_table_width()
{
if (impl_->empty()) return -1;
if (impl_->empty()) return boost::none;
else return impl_->current_table().table_width;
}
_CP_OPT(double) odf_table_context::get_table_height()
{
if (impl_->empty()) return boost::none;
else return impl_->current_table().table_height;
}
std::wstring odf_table_context::get_default_cell_properties()
{
if (impl_->empty()) return impl_->default_cell_properties;
else return impl_->current_table().default_cell_properties;
}
void odf_table_context::set_default_row_height(double height)
{
impl_->default_row_height = height;
}
void odf_table_context::set_default_column_width(double width)
{
impl_->default_column_width = width;
@ -347,7 +363,7 @@ void odf_table_context::set_column_optimal(bool val)
void odf_table_context::change_current_column_width(double width)
{
if (impl_->empty()) return;
if (impl_->current_table().columns.size() < 1)return;
if (impl_->current_table().columns.empty())return;
int index = impl_->current_table().current_column ;
if (index < 0) return;
@ -368,7 +384,7 @@ void odf_table_context::change_current_column_width(double width)
style_table_column_properties *properties = style_->content_.get_style_table_column_properties();
if (properties == NULL) return;
length length_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
length length_ = length(length(width, length::pt).get_value_unit(length::cm), length::cm);
if (!properties->style_table_column_properties_attlist_.style_column_width_)
properties->style_table_column_properties_attlist_.style_column_width_ = length_;
@ -383,39 +399,68 @@ void odf_table_context::change_current_column_width(double width)
void odf_table_context::set_column_width(double width)
{
if (impl_->empty()) return;
if (impl_->current_table().columns.size() < 1)return;
if (impl_->current_table().columns.empty())return;
style *style_ = dynamic_cast<style*>(impl_->current_table().columns.back().style_elm.get());
if (style_ == NULL) return;
style_table_column_properties *properties = style_->content_.get_style_table_column_properties();
if (properties == NULL) return;
style_table_column_properties *properties = style_ ? style_->content_.get_style_table_column_properties() : NULL;
if (width > 0)
{
properties->style_table_column_properties_attlist_.style_column_width_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
//properties->style_table_column_properties_attlist_.style_rel_column_width_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
if (impl_->optimal_column_width)
if (properties)
{
properties->style_table_column_properties_attlist_.style_use_optimal_column_width_ = true;
properties->style_table_column_properties_attlist_.style_column_width_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
//properties->style_table_column_properties_attlist_.style_rel_column_width_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
if (impl_->optimal_column_width)
{
properties->style_table_column_properties_attlist_.style_use_optimal_column_width_ = true;
}
}
impl_->current_table().table_width += width;
}
else
{
properties->style_table_column_properties_attlist_.style_use_optimal_column_width_ = true;
if (impl_->default_column_width >= 0)
if (properties)
{
properties->style_table_column_properties_attlist_.style_column_width_ = length(length(impl_->default_column_width,length::pt).get_value_unit(length::cm),length::cm);
//properties->style_table_column_properties_attlist_.style_rel_column_width_ = length(length(impl_->current_table().table_width,length::pt).get_value_unit(length::cm),length::cm);
impl_->current_table().table_width += impl_->default_column_width;
properties->style_table_column_properties_attlist_.style_use_optimal_column_width_ = true;
if (impl_->default_column_width)
{
properties->style_table_column_properties_attlist_.style_column_width_ = length(length(impl_->default_column_width.get(), length::pt).get_value_unit(length::cm), length::cm);
//properties->style_table_column_properties_attlist_.style_rel_column_width_ = length(length(impl_->current_table().table_width,length::pt).get_value_unit(length::cm),length::cm);
}
}
impl_->current_table().table_width += impl_->default_column_width.get_value_or(0);
}
}
void odf_table_context::set_row_height(double height)
{
if (impl_->empty()) return;
if (height > 0)
{
//style *style_ = dynamic_cast<odf_writer::style*>(rows_.back().style_elm.get());
//if (style_)
//{
// style_table_row_properties *properties = style_->content_.get_style_table_row_properties();
// if (properties)
// {
// //properties->style_table_column_properties_attlist_.style_column_width_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
// }
//}
impl_->current_table().table_height += height;
if (!impl_->default_row_height)
impl_->default_row_height = height;
}
else
{
impl_->current_table().table_height += impl_->default_row_height.get_value_or(0);
}
}
int odf_table_context::current_column ()
{
if (impl_->empty()) return 0;

View File

@ -65,15 +65,17 @@ public:
void count_rows (int count);
void start_table(office_element_ptr &elm, bool styled = false);
void set_default_column_width(double width);
void set_default_column_width(double val);
void set_optimal_column_width(bool val);
void change_current_column_width(double width);
void change_current_column_width(double val);
void set_default_row_height(double val);
void end_table();
void set_default_cell_properties(std::wstring style_name);
std::wstring get_default_cell_properties();
double get_table_width();
_CP_OPT(double) get_table_width();
_CP_OPT(double) get_table_height();
void set_table_inside_v(_CP_OPT(std::wstring) border);
void set_table_inside_h(_CP_OPT(std::wstring) border);
@ -82,6 +84,7 @@ public:
_CP_OPT(std::wstring) get_table_inside_h();
void start_row(office_element_ptr &elm, bool styled = false);
void set_row_height(double val);
void end_row();
void start_cell(office_element_ptr &elm, bool styled = false);

View File

@ -1509,7 +1509,7 @@ void odt_conversion_context::end_table_columns()
void odt_conversion_context::start_table_header_rows()
{
office_element_ptr elm;
create_element(L"table", L"table-header-rows",elm,this);
create_element(L"table", L"table-header-rows", elm, this);
text_context()->start_element(elm);
}
@ -1520,11 +1520,11 @@ void odt_conversion_context::end_table_header_rows()
void odt_conversion_context::start_table_row(bool styled)
{
office_element_ptr elm;
create_element(L"table", L"table-row",elm,this);
create_element(L"table", L"table-row", elm, this);
if (styled)
{
styles_context()->create_style(L"",odf_types::style_family::TableRow, true, false, -1);
styles_context()->create_style(L"", odf_types::style_family::TableRow, true, false, -1);
}
text_context()->start_element(elm);
@ -1556,7 +1556,7 @@ void odt_conversion_context::end_table_cell()
}
void odt_conversion_context::end_table_row()
{
for (int i=table_context()->current_column() ; i < table_context()->count_columns(); i++)
for (int i = table_context()->current_column() ; i < table_context()->count_columns(); i++)
{
add_default_cell();
}

View File

@ -3980,7 +3980,14 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
odt_context->start_drawings();
_CP_OPT(double) width, height, x, y ;
if (oox_table->m_oTableProperties->m_oTblpPr->m_oTblpX.IsInit())
if (oox_table->m_oTableProperties->m_oTblpPr->m_oTblpXSpec.IsInit())
{
odt_context->drawing_context()->set_horizontal_pos(oox_table->m_oTableProperties->m_oTblpPr->m_oTblpXSpec->GetValue());
}
bool bRightAlignX = ((oox_table->m_oTableProperties->m_oTblpPr->m_oTblpXSpec.IsInit()) &&
(oox_table->m_oTableProperties->m_oTblpPr->m_oTblpXSpec->GetValue() == SimpleTypes::xalignRight));
if (!bRightAlignX && oox_table->m_oTableProperties->m_oTblpPr->m_oTblpX.IsInit())
x = oox_table->m_oTableProperties->m_oTblpPr->m_oTblpX->ToPoints();
if (oox_table->m_oTableProperties->m_oTblpPr->m_oTblpY.IsInit())
y = oox_table->m_oTableProperties->m_oTblpPr->m_oTblpY->ToPoints();
@ -3991,6 +3998,7 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
// else x = -*x + oox_table->m_oTableProperties->m_oTblpPr->m_oLeftFromText->ToPoints();
//}
odt_context->drawing_context()->set_drawings_rect(x, y, width, height);
odt_context->drawing_context()->set_anchor(in_frame_anchor);
@ -4021,10 +4029,11 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
if (oox_table->m_oTableProperties->m_oTblpPr->m_oRightFromText.IsInit())
{
if (!x) //x = *x + oox_table->m_oTableProperties->m_oTblpPr->m_oRightFromText->ToPoints();
if (!bRightAlignX && !x) //x = *x + oox_table->m_oTableProperties->m_oTblpPr->m_oRightFromText->ToPoints();
{
x = oox_table->m_oTableProperties->m_oTblpPr->m_oRightFromText->ToPoints();
odt_context->drawing_context()->set_horizontal_pos(*x);
odt_context->drawing_context()->set_horizontal_pos(*x);
}
}
if (oox_table->m_oTableProperties->m_oTblpPr->m_oTopFromText.IsInit())
{
@ -4038,7 +4047,7 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
odt_context->drawing_context()->start_text_box();
odt_context->drawing_context()->set_text_box_tableframe(true);
odt_context->drawing_context()->set_text_box_min_size(0, 1.);
odt_context->drawing_context()->set_z_order(0x7fffffff-1);
odt_context->drawing_context()->set_z_order(0x7fffffff - 1024/* + id_tables*/);
odt_context->drawing_context()->set_text_box_parent_style(L"Frame");
odt_context->drawing_context()->set_name(L"TableFrame");
odt_context->start_text_context();
@ -4046,7 +4055,7 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
odt_context->start_table(true);
_CP_OPT(std::wstring) border_inside_h,border_inside_v;
_CP_OPT(std::wstring) border_inside_h, border_inside_v;
if (styled_table)
{
@ -4100,10 +4109,11 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
if (in_frame)
{
_CP_OPT(double) width = odt_context->table_context()->get_table_width();
_CP_OPT(double) height;
_CP_OPT(double) height = odt_context->table_context()->get_table_height();
odt_context->drawing_context()->set_size(width, height);
odt_context->drawing_context()->set_text_box_min_size(-1,0);
odt_context->drawing_context()->set_text_box_min_size(-1, height.get_value_or(0));
}
odt_context->end_table();
@ -4295,7 +4305,7 @@ void DocxConverter::convert(OOX::Logic::CTc *oox_table_cell)
if (id_change_properties >= 0)
odt_context->end_change(id_change_properties, 3);
}
bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_properties * table_properties )
bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_properties *table_properties )
{
if (oox_table_pr == NULL) return false;
if (table_properties == NULL) return false;
@ -4397,7 +4407,7 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer
return true;
}
void DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_cell_properties * table_cell_properties)
void DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_cell_properties * table_cell_properties)
{
if (oox_table_pr == NULL || oox_table_pr == NULL) return;
@ -4450,24 +4460,27 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, bool base_
return true;
}
void DocxConverter::convert(OOX::Logic::CTableRowProperties *oox_table_row_pr, odf_writer::style_table_row_properties * table_row_properties)
void DocxConverter::convert(OOX::Logic::CTableRowProperties *oox_table_row_pr, odf_writer::style_table_row_properties *table_row_properties)
{
if (oox_table_row_pr == NULL) return;
if (table_row_properties == NULL) return;
if (oox_table_row_pr->m_oTblHeight.IsInit())
if ((oox_table_row_pr->m_oTblHeight.IsInit()) &&
(oox_table_row_pr->m_oTblHeight->m_oVal.IsInit()))
{
_CP_OPT(odf_types::length) length;
convert(dynamic_cast<SimpleTypes::CUniversalMeasure *>(oox_table_row_pr->m_oTblHeight->m_oVal.GetPointer()), length);
odt_context->table_context()->set_row_height(oox_table_row_pr->m_oTblHeight->m_oVal->ToPoints());
if (oox_table_row_pr->m_oTblHeight->m_oHRule.IsInit())
{
switch(oox_table_row_pr->m_oTblHeight->m_oHRule->GetValue())
{
case SimpleTypes::heightruleAtLeast:
table_row_properties->style_table_row_properties_attlist_.style_min_row_height_ = odf_types::length(length->get_value_unit(odf_types::length::cm),odf_types::length::cm); break;
table_row_properties->style_table_row_properties_attlist_.style_min_row_height_ = odf_types::length(length->get_value_unit(odf_types::length::cm), odf_types::length::cm); break;
case SimpleTypes::heightruleExact:
table_row_properties->style_table_row_properties_attlist_.style_row_height_ = odf_types::length(length->get_value_unit(odf_types::length::cm),odf_types::length::cm); break;
table_row_properties->style_table_row_properties_attlist_.style_row_height_ = odf_types::length(length->get_value_unit(odf_types::length::cm), odf_types::length::cm); break;
case SimpleTypes::heightruleAuto:
table_row_properties->style_table_row_properties_attlist_.style_use_optimal_row_height_ = true; break;
}
@ -4481,7 +4494,7 @@ void DocxConverter::convert(OOX::Logic::CTableRowProperties *oox_table_row_pr)
{
if (oox_table_row_pr == NULL) return;
odf_writer::style_table_row_properties * table_row_properties = odt_context->styles_context()->last_state()->get_table_row_properties();
odf_writer::style_table_row_properties *table_row_properties = odt_context->styles_context()->last_state()->get_table_row_properties();
if (oox_table_row_pr->m_oCnfStyle.IsInit())
{

View File

@ -686,7 +686,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CRow *oox_row, OOX::Spreadsheet::C
level = oox_row->m_oOutlineLevel->GetValue();
}
ods_context->start_row(row_number,1,level,_default);
ods_context->start_row(row_number, 1, level,_default);
if (oox_row->m_oHidden.IsInit()) ods_context->current_table().set_row_hidden(true);
if (oox_row->m_oCollapsed.IsInit()) ods_context->current_table().set_row_hidden(true);

View File

@ -128,7 +128,7 @@ void PtgRef3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool fu
}
if (ixti != 0xffff)
{
std::wstring link = global_info->arXti_External[ixti].link;
std::wstring link = ixti < global_info->arXti_External.size() ? global_info->arXti_External[ixti].link : L"";
if (!link.empty() && !cell_ref.empty())
link += L"!";