Merge remote-tracking branch 'origin/fix/bug50186' into release/v8.0.0

This commit is contained in:
Elena.Subbotina
2023-12-11 12:45:59 +03:00
6 changed files with 74 additions and 46 deletions

View File

@ -1347,28 +1347,29 @@ class oox_shape_Triangle : public oox_shape
public:
oox_shape_Triangle()
{
odf_type_name =L"ooxml-triangle";
odf_type_name =L"isosceles-triangle";
enhanced_path = L"M 0 ?f6 L ?f2 0 ?f7 ?f6 Z N";
text_areas = L"?f1 ?f5 ?f4 ?f6";
view_box = L"0 0 0 0";
modifiers = L"50000";
enhanced_path = L"M ?f0 0 L 21600 21600 0 21600 Z N";
text_areas = L"?f1 10800 ?f2 18000 ?f3 7200 ?f4 21600";
view_box = L"0 0 21600 21600";
modifiers = L"10800";
glue_points = L"?f0 0 ?f1 10800 0 21600 10800 21600 21600 21600 ?f7 10800";
add(L"f0", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
add(L"f1", L"logwidth*?f0 /200000");
add(L"f2", L"logwidth*?f0 /100000");
add(L"f3", L"logwidth/2");
add(L"f4", L"?f1 +?f3 -0");
add(L"f5", L"logheight/2");
add(L"f6", L"logheight");
add(L"f7", L"logwidth");
add(L"f0", L"$0 ");
add(L"f1", L"$0 /2");
add(L"f2", L"?f1 +10800");
add(L"f3", L"$0 *2/3");
add(L"f4", L"?f3 +7200");
add(L"f5", L"21600-?f0 ");
add(L"f6", L"?f5 /2");
add(L"f7", L"21600-?f6 ");
/////////////////////////////////////////////////////////
_handle h;
h.position = L"?f2 0";
h.position = L"$0 top";
h.x_minimum = L"0";
h.x_maximum = L"100000";
h.x_maximum = L"21600";
handles.push_back(h);
}
};

View File

@ -724,39 +724,33 @@ class oox_shape_roundRect : public oox_shape
public:
oox_shape_roundRect()
{
odf_type_name =L"ooxml-roundRect";
odf_type_name =L"round-rectangle";
enhanced_path = L"M 0 ?f2 G ?f2 ?f2 ?f12 ?f13 L ?f3 0 G ?f2 ?f2 ?f14 ?f15 L ?f11 ?f4 G ?f2 ?f2 ?f16 ?f17 L ?f2 ?f10 G ?f2 ?f2 ?f18 ?f19 Z N";
text_areas = L"?f5 ?f5 ?f6 ?f7";
view_box = L"0 0 0 0";
modifiers = L"16667";
enhanced_path = L"M ?f7 0 X 0 ?f8 L 0 ?f9 Y ?f7 21600 L ?f10 21600 X 21600 ?f9 L 21600 ?f8 Y ?f10 0 Z N";
text_areas = L"?f3 ?f4 ?f5 ?f6";
view_box = L"0 0 21600 21600";
modifiers = L"3600";
path_stretchpoint_x = L"10800";
path_stretchpoint_y = L"10800";
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
add(L"f1", L"min(logwidth,logheight)");
add(L"f2", L"?f1 *?f0 /100000");
add(L"f3", L"logwidth+0-?f2 ");
add(L"f4", L"logheight+0-?f2 ");
add(L"f5", L"?f2 *29289/100000");
add(L"f6", L"logwidth+0-?f5 ");
add(L"f7", L"logheight+0-?f5 ");
add(L"f8", L"logwidth/2");
add(L"f9", L"logheight/2");
add(L"f10", L"logheight");
add(L"f11", L"logwidth");
add(L"f12", L"(10800000)/60000.0");
add(L"f13", L"(5400000)/60000.0");
add(L"f14", L"(16200000)/60000.0");
add(L"f15", L"(5400000)/60000.0");
add(L"f16", L"(0)/60000.0");
add(L"f17", L"(5400000)/60000.0");
add(L"f18", L"(5400000)/60000.0");
add(L"f19", L"(5400000)/60000.0");
add(L"f0", L"45");
add(L"f1", L"$0 *sin(?f0 *(pi/180))");
add(L"f2", L"?f1 *3163/7636 ");
add(L"f3", L"left+?f2 ");
add(L"f4", L"top+?f2 ");
add(L"f5", L"right-?f2 ");
add(L"f6", L"bottom-?f2 ");
add(L"f7", L"left+$0 ");
add(L"f8", L"top+$0 ");
add(L"f9", L"bottom-$0 ");
add(L"f10", L"right-$0 ");
//-----------------------------------------------------------------
_handle h1;
h1.position = L"?f2 0";
h1.x_maximum= L"50000";
h1.x_minimum= L"0";
h1.position = L"$0 top";
h1.x_minimum = L"0";
h1.x_maximum = L"10800";
h1.handle_swiched = true;
handles.push_back(h1);
}
};

View File

@ -435,6 +435,9 @@ void draw_enhanced_geometry_attlist::serialize(CP_ATTR_NODE)
CP_XML_ATTR_OPT(L"draw:text-path-mode", draw_text_path_mode_);
CP_XML_ATTR_OPT(L"draw:text-path-scale", draw_text_path_scale_);
CP_XML_ATTR_OPT(L"draw:text-path-same-letter-heights", draw_text_path_same_letter_heights_);
CP_XML_ATTR_OPT(L"draw:path-stretchpoint-x", draw_path_stretchpoint_x_);
CP_XML_ATTR_OPT(L"draw:path-stretchpoint-y", draw_path_stretchpoint_y_);
}
//-------------------------------------------------------------------------------------------
// draw:enhanced_geometry

View File

@ -323,6 +323,9 @@ public:
_CP_OPT(std::wstring) draw_text_path_scale_;
_CP_OPT(int) draw_text_rotate_angle_;
_CP_OPT(std::wstring) draw_path_stretchpoint_x_;
_CP_OPT(std::wstring) draw_path_stretchpoint_y_;
void serialize(CP_ATTR_NODE);
};

View File

@ -1179,7 +1179,14 @@ void odf_drawing_context::end_shape()
enhanced->attlist_.draw_glue_points_ = shape_define->glue_points;
enhanced->attlist_.draw_sub_view_size_ = shape_define->sub_view_size;
if (impl_->current_drawing_state_.oox_shape_ && !impl_->current_drawing_state_.oox_shape_->modifiers.empty())
enhanced->attlist_.draw_path_stretchpoint_x_ = shape_define->path_stretchpoint_x;
enhanced->attlist_.draw_path_stretchpoint_y_ = shape_define->path_stretchpoint_y;
if (!shape_define->modifiers.empty())
{
enhanced->attlist_.draw_modifiers_ = shape_define->modifiers;
}
else if (impl_->current_drawing_state_.oox_shape_ && !impl_->current_drawing_state_.oox_shape_->modifiers.empty())
{
enhanced->attlist_.draw_modifiers_ = impl_->current_drawing_state_.oox_shape_->modifiers;
}
@ -1693,10 +1700,25 @@ int GetFormulaType2(const WCHAR& c1, const WCHAR& c2)
return 0;
}
static std::wstring replace_textarea(std::wstring textarea_coord)
{
XmlUtils::replace_all(textarea_coord, L"t", L"top");
XmlUtils::replace_all(textarea_coord, L"l", L"left");
XmlUtils::replace_all(textarea_coord, L"r", L"right");
XmlUtils::replace_all(textarea_coord, L"b", L"bottom");
return textarea_coord;
}
void odf_drawing_context::set_textarea (std::wstring l, std::wstring t, std::wstring r, std::wstring b)
{
if (!impl_->current_drawing_state_.oox_shape_) return;
l = replace_textarea(l);
t = replace_textarea(t);
r = replace_textarea(r);
b = replace_textarea(b);
impl_->current_drawing_state_.oox_shape_->text_areas = l + L" " + t + L" " + r + L" " + b;
XmlUtils::replace_all(impl_->current_drawing_state_.oox_shape_->text_areas, L"gd", L"?f");
@ -1826,8 +1848,8 @@ void odf_drawing_context::add_formula (std::wstring name, std::wstring fmla)
}
XmlUtils::replace_all(odf_fmla, L"gd", L"?f");
XmlUtils::replace_all(odf_fmla, L"h", L"logheight");
XmlUtils::replace_all(odf_fmla, L"w", L"logwidth");
XmlUtils::replace_all(odf_fmla, L"h", L"(bottom-top)");
XmlUtils::replace_all(odf_fmla, L"w", L"(right-left)");
XmlUtils::replace_all(odf_fmla, L"adj", L"$");
//XmlUtils::replace_all(name, L"gd", L"f");

View File

@ -66,6 +66,8 @@ namespace cpdoccore
_CP_OPT(std::wstring) x_maximum;
_CP_OPT(std::wstring) r_minimum;
_CP_OPT(std::wstring) r_maximum;
_CP_OPT(bool) handle_swiched;
};
void add(std::wstring name,std::wstring frmla);
@ -81,6 +83,9 @@ namespace cpdoccore
_CP_OPT(std::wstring) sub_view_size;
_CP_OPT(std::wstring) glue_points;
std::wstring path_stretchpoint_x;
std::wstring path_stretchpoint_y;
std::wstring odf_type_name;
};
};