Commit fb1fc019 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormat - extended elements for smart arts

parent 4651ae1b
......@@ -128,7 +128,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
_CP_OPT(std::wstring) strStrokeColor;
_CP_OPT(int) iStroke;
_CP_OPT(double) dStrokeWidth;
_CP_OPT(double) dStrokeOpacity;
_CP_OPT(double) dStrokeOpacity;
_CP_OPT(bool) bWordArt;
odf_reader::GetProperty(prop, L"wordArt", bWordArt);
......@@ -203,69 +203,33 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
}
void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
{
_CP_OPT(int) iShapeIndex;
_CP_OPT(bool) bWordArt;
odf_reader::GetProperty(prop, L"wordArt" , bWordArt);
odf_reader::GetProperty(prop, L"odf-custom-draw-index" , iShapeIndex);
int count_values = 0, min_value = 0, max_value = 0;
if (!bWordArt && iShapeIndex)
{
count_values = _OO_OOX_custom_shapes[*iShapeIndex].count_values;
min_value = _OO_OOX_custom_shapes[*iShapeIndex].min;
max_value = _OO_OOX_custom_shapes[*iShapeIndex].max;
}
else if (iShapeIndex)
{
count_values = _OO_OOX_wordart[*iShapeIndex].count_values;
min_value = _OO_OOX_wordart[*iShapeIndex].min;
max_value = _OO_OOX_wordart[*iShapeIndex].max;
}
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:avLst")
{
_CP_OPT(std::wstring) strVal;
if (odf_reader::GetProperty(prop,L"draw-modifiers",strVal) && iShapeIndex)
_CP_OPT(bool) bModifiers;
_CP_OPT(std::wstring) strModifiers;
odf_reader::GetProperty(prop, L"bModifiers", bModifiers);
odf_reader::GetProperty(prop, L"oox-draw-modifiers", strModifiers);
if (strModifiers)
{
std::vector< std::wstring > values;
boost::algorithm::split(values, strVal.get(), boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
boost::algorithm::split(values, strModifiers.get(), boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
if( count_values >0 && values.size()>0 && count_values < 3)//временное ограниечение .. хз как там свойства путаются
{//если не заданы доп свойства - нефиг мучится
int i=1;
if (!values.empty() && values.back().empty()) values.pop_back();
_CP_OPT(int) iMax,iMin;
odf_reader::GetProperty(prop,L"draw-modifiers-min",iMin);
odf_reader::GetProperty(prop,L"draw-modifiers-max",iMax);
values.resize(count_values);
BOOST_FOREACH(std::wstring & v, values)
for (size_t i = 0; i < values.size(); i++)
{
if (values[i].empty()) continue;
CP_XML_NODE(L"a:gd")
{
CP_XML_NODE(L"a:gd")
{
if (values.size() >1)
CP_XML_ATTR(L"name",(L"adj" + boost::lexical_cast<std::wstring>(i++)));
else
CP_XML_ATTR(L"name",L"adj");
double val=0;
if (v.length()>0)val= boost::lexical_cast<double>(v);
if (iMin && iMax && iShapeIndex)
{
if (min_value < max_value)
{
double W = *iMax - *iMin;
val = (val- (*iMin))/W * (max_value - min_value) + min_value;
}
}
CP_XML_ATTR(L"fmla",L"val " + boost::lexical_cast<std::wstring>(static_cast<int>(val)));
}
if (values.size() > 1 || bModifiers)
//весьма странное .. для некоторых модификаторов (напр math...) нужно указывать множественность их
CP_XML_ATTR(L"name", L"adj" + std::to_wstring(i+1));
else
CP_XML_ATTR(L"name", L"adj");
CP_XML_ATTR(L"fmla", L"val " + values[i]);
}
}
}
......@@ -358,34 +322,34 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
void _oox_drawing::serialize_shape(std::wostream & strm)
{
_CP_OPT(std::wstring) strVal, strPath;
_CP_OPT(double) dVal;
std::wstring shapeType;
_CP_OPT(bool) bWordArt;
_CP_OPT(int) iOoxShapeIndex;
_CP_OPT(bool) bWordArt, bOoxShape;
_CP_OPT(std::wstring) sCustomPath;
odf_reader::GetProperty(additional,L"wordArt", bWordArt);
odf_reader::GetProperty(additional, L"custom_path", strPath);
odf_reader::GetProperty(additional, L"wordArt", bWordArt);
odf_reader::GetProperty(additional, L"oox-geom-index", iOoxShapeIndex);
odf_reader::GetProperty(additional, L"oox-geom", bOoxShape);
odf_reader::GetProperty(additional, L"custom_path", sCustomPath);
std::wstring shapeGeomPreset;
if (sub_type == 7)//custom
{
_CP_OPT(int) iVal;
odf_reader::GetProperty(additional, L"odf-custom-draw-index",iVal);
if (iVal)
shapeType = _OO_OOX_custom_shapes[*iVal].oox;
else
if (iOoxShapeIndex)
shapeGeomPreset = _OO_OOX_custom_shapes[*iOoxShapeIndex].oox;
else if (sCustomPath)
sub_type = 6; //path
if (shapeType == L"textBox")
if (shapeGeomPreset == L"textBox")
{
sub_type = 1;
shapeType = L"rect";
shapeGeomPreset = L"rect";
}
}
else if (sub_type < 9 && sub_type >= 0)
{
shapeType = _ooxShapeType[sub_type];
shapeGeomPreset = _ooxShapeType[sub_type]; //odf -> oox
}
if (bWordArt) sub_type = 1;
......@@ -393,7 +357,7 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
CP_XML_WRITER(strm)
{
if ((sub_type == 6 || sub_type == 8) && strPath && !strPath->empty())
if (sub_type == 6 || sub_type == 8)
{
CP_XML_NODE(L"a:custGeom")
{
......@@ -420,22 +384,29 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
CP_XML_ATTR(L"w", w ? *w : cx);
CP_XML_ATTR(L"h", h ? *h : cy);
CP_XML_STREAM() << *strPath;
CP_XML_STREAM() << *sCustomPath;
}
}
}
}
else
{
if (shapeType.empty())
if (shapeGeomPreset.empty())
{
shapeType = L"rect";
shapeGeomPreset = L"rect";
sub_type = 2;
}
CP_XML_NODE(L"a:prstGeom")//автофигура
{
CP_XML_ATTR(L"prst", shapeType);
if (!bWordArt) oox_serialize_aLst(CP_XML_STREAM(), additional);
CP_XML_ATTR(L"prst", shapeGeomPreset);
if (!bWordArt)
{
if (std::wstring::npos != shapeGeomPreset.find(L"mathPlus"))
{
additional.push_back(odf_reader::_property(L"bModifiers", true));
}
oox_serialize_aLst(CP_XML_STREAM(), additional);
}
}
}
if (bWordArt)
......
......@@ -421,8 +421,8 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
int col = -1, row = -1;
try
{
col = boost::lexical_cast<int>(s_col);
row = boost::lexical_cast<int>(s_row);
if (!s_col.empty()) col = boost::lexical_cast<int>(s_col);
if (!s_row.empty()) row = boost::lexical_cast<int>(s_row);
}
catch(...){}
......
......@@ -251,7 +251,11 @@ static const _shape_converter _OO_OOX_custom_shapes[]=
{L"" ,L"accentBorderCallout3",0 ,0 ,0 },
{L"" ,L"accentBorderCallout2",0 ,0 ,0 },
{L"" ,L"accentBorderCallout1",0 ,0 ,0 },
{L"" ,L"halfFrame" ,0 ,0 ,0 }
{L"" ,L"halfFrame" ,0 ,0 ,0 },
{L"" ,L"leftCircularArrow",0 ,0 ,0 },
{L"" ,L"leftRightRibbon",0 ,0 ,0 },
{L"" ,L"pieWedge",0 ,0 ,0 },
{L"" ,L"swooshArrow",0 ,0 ,0 }
};
......
......@@ -163,10 +163,10 @@ void draw_line::add_attributes( const xml::attributes_wc_ptr & Attributes )
}
void draw_line::reset_svg_attributes()
{
double x1=draw_line_attlist_.svg_x1_.get_value_or(length(0)).get_value_unit(length::pt);
double y1=draw_line_attlist_.svg_y1_.get_value_or(length(0)).get_value_unit(length::pt);
double x2=draw_line_attlist_.svg_x2_.get_value_or(length(0)).get_value_unit(length::pt);
double y2=draw_line_attlist_.svg_y2_.get_value_or(length(0)).get_value_unit(length::pt);
double x1 = draw_line_attlist_.svg_x1_.get_value_or(length(0)).get_value_unit(length::pt);
double y1 = draw_line_attlist_.svg_y1_.get_value_or(length(0)).get_value_unit(length::pt);
double x2 = draw_line_attlist_.svg_x2_.get_value_or(length(0)).get_value_unit(length::pt);
double y2 = draw_line_attlist_.svg_y2_.get_value_or(length(0)).get_value_unit(length::pt);
if (x1 > x2)
{
......@@ -431,8 +431,8 @@ void draw_equation::add_attributes( const xml::attributes_wc_ptr & Attributes )
}
int draw_enhanced_geometry::parsing(_CP_OPT(std::wstring) val)
{
int pos=0, res=-1;
if (!val)return res;
int pos = 0, res = -1;
if (!val) return res;
BOOST_FOREACH(wchar_t c, val.get())
{
......@@ -533,12 +533,12 @@ void draw_enhanced_geometry::find_draw_type_oox()
}
else
{
bOoxType_ = true;
std::wstring oox_type = odf_type.substr(pos + 6);
for (long i = 0; i< count; i++)
{
if (_OO_OOX_custom_shapes[i].oox == oox_type)
{
bOoxType_ = true;
draw_type_oox_index_ = i;
break;
}
......@@ -550,38 +550,36 @@ void draw_enhanced_geometry::find_draw_type_oox()
}
}
}
std::wstringstream str;
for (size_t i = 0; i < draw_handle_.size(); i++)
{
draw_handle * handle = dynamic_cast<draw_handle *>(draw_handle_[i].get());
if (!handle) continue;
int min = -1, max = -1;
try
{
min = parsing(handle->draw_handle_attlist_.draw_handle_range_y_minimum_);//пока статик .. и выдается только цыфровое значение
if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_range_x_minimum_);
if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_minimum_);
}
catch(...)
{
}
if (min < 0 ) min=0;
try
{
max = parsing(handle->draw_handle_attlist_.draw_handle_range_y_maximum_);
if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_range_x_maximum_);
if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_maximum_);
}
catch(...)
{
}
draw_handle_geometry elm = {min, max};
draw_handle_geometry_.push_back(elm);
}
// for (size_t i = 0; i < draw_handle_.size(); i++)
// {
//draw_handle * handle = dynamic_cast<draw_handle *>(draw_handle_[i].get());
//if (!handle) continue;
//int min = -1, max = -1;
//
//try
//{
// min = parsing(handle->draw_handle_attlist_.draw_handle_range_y_minimum_);//пока статик .. и выдается только цыфровое значение
// if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_range_x_minimum_);
// if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_minimum_);
//}
//catch(...)
//{
//}
//if (min < 0 ) min=0;
//try
//{
// max = parsing(handle->draw_handle_attlist_.draw_handle_range_y_maximum_);
// if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_range_x_maximum_);
// if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_maximum_);
//}
//catch(...)
//{
//}
//draw_handle_geometry elm = {min, max};
//draw_handle_geometry_.push_back(elm);
// }
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// draw-caption-attlist
......
......@@ -246,7 +246,8 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
if (draw_type_oox_index_)
{
shape->additional_.push_back(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
shape->additional_.push_back(_property(L"oox-geom-index", draw_type_oox_index_.get()));
shape->additional_.push_back(_property(L"oox-geom", bOoxType_));
if (shape->word_art_ == true)
shape->additional_.push_back(_property(L"wordArt", true));
......@@ -317,14 +318,10 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
{
shape->additional_.push_back(_property(L"draw-modifiers",draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
if (draw_handle_geometry_.size()>0)
if (bOoxType_)
shape->additional_.push_back(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
else
{
if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
{
shape->additional_.push_back(_property(L"draw-modifiers-min", draw_handle_geometry_[0].min));
shape->additional_.push_back(_property(L"draw-modifiers-max", draw_handle_geometry_[0].max));
}
}
}
......
......@@ -312,8 +312,9 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
if (draw_type_oox_index_)
{
Context.get_slide_context().set_property(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
Context.get_slide_context().set_property(_property(L"oox-geom-index", draw_type_oox_index_.get()));
Context.get_slide_context().set_property(_property(L"oox-geom", bOoxType_));
if (word_art_ == true)
Context.get_slide_context().set_property(_property(L"wordArt", true));
......@@ -381,16 +382,20 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
}
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
{
Context.get_slide_context().set_property(_property(L"draw-modifiers",draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
if (draw_handle_geometry_.size()>0)
if (bOoxType_)
Context.get_slide_context().set_property(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
else
{
if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
{
Context.get_slide_context().set_property(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min));
Context.get_slide_context().set_property(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max));
}
}
//if (draw_handle_geometry_.size()>0)
//{
// if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
// {
// Context.get_slide_context().set_property(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min));
// Context.get_slide_context().set_property(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max));
// }
//}
}
if (!set_shape)
{
......
......@@ -258,7 +258,8 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
if (draw_type_oox_index_)
{
Context.get_drawing_context().set_property(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
Context.get_drawing_context().set_property(_property(L"oox-geom-index", draw_type_oox_index_.get()));
Context.get_drawing_context().set_property(_property(L"oox-geom", bOoxType_));
if (word_art_ == true)
Context.get_drawing_context().set_property(_property(L"wordArt", true));
......@@ -327,15 +328,10 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
}
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
{
Context.get_drawing_context().set_property(_property(L"draw-modifiers",draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
if (draw_handle_geometry_.size()>0)
if (bOoxType_)
Context.get_drawing_context().set_property(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
else
{
if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
{
Context.get_drawing_context().set_property(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min));
Context.get_drawing_context().set_property(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max));
}
}
}
}
......
......@@ -225,7 +225,7 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
{
CP_XML_NODE(L"a:spcBef")
{
if (fo_margin_bottom_->get_type() == length_or_percent::Length)
if (fo_margin_top_->get_type() == length_or_percent::Length)
{
std::wstring w_before = pptx_process_margin(fo_margin_top_, length::pt, 100.0);
CP_XML_NODE(L"a:spcPts")
......@@ -235,11 +235,10 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
}
else
{
std::wstringstream s;
s << fo_margin_top_;
double pct = fo_margin_top_->get_percent().get_value();
CP_XML_NODE(L"a:spcPct")
{
CP_XML_ATTR(L"val", s.str());
CP_XML_ATTR(L"val", (int)(pct * 1000));
}
}
}
......@@ -258,11 +257,11 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
}
else
{
std::wstringstream s;
s << fo_margin_bottom_;
double pct = fo_margin_bottom_->get_percent().get_value();
CP_XML_NODE(L"a:spcPct")
{
CP_XML_ATTR(L"val", s.str());
CP_XML_ATTR(L"val", (int)(pct * 1000));
}
}
}
......@@ -468,11 +467,11 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
}
else
{
std::wstringstream s;
s << fo_margin_top_;
double pct = fo_margin_top_->get_percent().get_value();
CP_XML_NODE(L"a:spcPct")
{
CP_XML_ATTR(L"val", s.str());
CP_XML_ATTR(L"val", (int)(pct * 1000));
}
}
}
......@@ -491,11 +490,11 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
}
else
{
std::wstringstream s;
s << fo_margin_bottom_;
double pct = fo_margin_bottom_->get_percent().get_value();
CP_XML_NODE(L"a:spcPct")
{
CP_XML_ATTR(L"val", s.str());
CP_XML_ATTR(L"val", (int)(pct * 1000));
}
}
}
......
......@@ -57,13 +57,13 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"mso-spt200" , 7}, // shapetypeActionButtonMovie,
{ L"mso-spt197" , 7}, // shapetypeActionButtonReturn,
{ L"mso-spt199" , 7}, // shapetypeActionButtonSound,
{ L"ooxml-arc" , 7}, // shapetypeArc,
{ L"" , 7}, // shapetypeArc,
{ L"mso-spt91" , 7}, // shapetypeBentArrow,
{ L"mso-spt33" , 7}, // shapetypeBentConnector2,
{ L"mso-spt34" , 7}, // shapetypeBentConnector3,
{ L"mso-spt35" , 7}, // shapetypeBentConnector4,
{ L"mso-spt36" , 7}, // shapetypeBentConnector5,
{ L"mso-spt90" , 7}, // shapetypeBentUpArrow,
{ L"" , 7}, // shapetypeBentUpArrow,
{ L"quad-bevel" , 7}, // shapetypeBevel,
{ L"" , 7}, // shapetypeBlockArc,
{ L"mso-spt49" , 7}, // shapetypeBorderCallout1,
......@@ -78,7 +78,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"" , 7}, // shapetypeChartPlus,
{ L"" , 7}, // shapetypeChartStar,
{ L"" , 7}, // shapetypeChartX,
{ L"chevron" , 7}, // shapetypeChevron,
{ L"" , 7}, // shapetypeChevron,
{ L"" , 7}, // shapetypeChord,
{ L"" , 7}, // shapetypeCircularArrow,
{ L"cloud" , 7}, // shapetypeCloud,
......@@ -92,16 +92,16 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"mso-spt40" , 7}, // shapetypeCurvedConnector5,
{ L"" , 7}, // shapetypeCurvedDownArrow,
{ L"" , 7}, // shapetypeCurvedLeftArrow,
{ L"mso-spt102" , 7}, // shapetypeCurvedRightArrow,
{ L"" , 7}, // shapetypeCurvedRightArrow,
{ L"mso-spt104" , 7}, // shapetypeCurvedUpArrow,
{ L"" , 7}, // shapetypeDecagon,
{ L"" , 7}, // shapetypeDiagStripe,
{ L"diamond" , 7}, // shapetypeDiamond,
{ L"" , 7}, // shapetypeDiamond,
{ L"" , 7}, // shapetypeDodecagon,
{ L"" , 7}, // shapetypeDonut,
{ L"" , 7}, // shapetypeDoubleWave,
{ L"down-arrow" , 7}, // shapetypeDownArrow,
{ L"down-arrow-callout" , 7}, // shapetypeDownArrowCallout,
{ L"" , 7}, // shapetypeDownArrow,
{ L"" , 7}, // shapetypeDownArrowCallout,
{ L"ellipse" , 3}, // shapetypeEllipse,
{ L"mso-spt107" , 7}, // shapetypeEllipseRibbon,
{ L"mso-spt108" , 7}, // shapetypeEllipseRibbon2,
......@@ -112,7 +112,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"flowchart-delay" , 7}, // shapetypeFlowChartDelay,
{ L"flowchart-display" , 7}, // shapetypeFlowChartDisplay,
{ L"flowchart-document" , 7}, // shapetypeFlowChartDocument,
{ L"flowchart-extract" , 7}, // shapetypeFlowChartExtract,
{ L"" , 7}, // shapetypeFlowChartExtract,
{ L"flowchart-data" , 7}, // shapetypeFlowChartInputOutput,
{ L"flowchart-internal-storage" , 7}, // shapetypeFlowChartInternalStorage,
{ L"flowchart-magnetic-disk" , 7}, // shapetypeFlowChartMagneticDisk,
......@@ -135,7 +135,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"flowchart-summing-junction" , 7}, // shapetypeFlowChartSummingJunction,
{ L"flowchart-terminator" , 7}, // shapetypeFlowChartTerminator,
{ L"paper" , 7}, // shapetypeFoldedCorner,
{ L"frame" , 7}, // shapetypeFrame,
{ L"" , 7}, // shapetypeFrame,
{ L"" , 7}, // shapetypeFunnel,
{ L"" , 7}, // shapetypeGear6,
{ L"" , 7}, // shapetypeGear9,
......@@ -143,21 +143,21 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"heart" , 7}, // shapetypeHeart,
{ L"" , 7}, // shapetypeHeptagon,
{ L"hexagon" , 7}, // shapetypeHexagon,
{ L"pentagon-right" , 7}, // shapetypeHomePlate,
{ L"" , 7}, // shapetypeHomePlate,
{ L"horizontal-scroll" , 7}, // shapetypeHorizontalScroll,
{ L"" , 7}, // shapetypeIrregularSeal1,
{ L"" , 7}, // shapetypeIrregularSeal2,
{ L"left-arrow" , 7}, // shapetypeLeftArrow,
{ L"left-arrow-callout" , 7}, // shapetypeLeftArrowCallout,
{ L"" , 7}, // shapetypeLeftArrow,
{ L"" , 7}, // shapetypeLeftArrowCallout,
{ L"left-brace" , 7}, // shapetypeLeftBrace,
{ L"left-bracket" , 7}, // shapetypeLeftBracket,
{ L"" , 7}, // shapetypeLeftCircularArrow,
{ L"left-right-arrow" , 7}, // shapetypeLeftRightArrow,
{ L"" , 7}, // shapetypeLeftRightArrow,
{ L"left-right-arrow-callout" , 7}, // shapetypeLeftRightArrowCallout,
{ L"" , 7}, // shapetypeLeftRightCircularArrow,
{ L"" , 7}, // shapetypeLeftRightRibbon,
{ L"mso-spt182" , 7}, // shapetypeLeftRightUpArrow,
{ L"mso-spt89" , 7}, // shapetypeLeftUpArrow,
{ L"" , 7}, // shapetypeLeftUpArrow,
{ L"lightning" , 7}, // shapetypeLightningBolt,
{ L"" , 5}, // shapetypeLine,
{ L"" , 7}, // shapetypeLineInv,
......@@ -166,33 +166,33 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"" , 7}, // shapetypeMathMinus,
{ L"" , 7}, // shapetypeMathMultiply,
{ L"" , 7}, // shapetypeMathNotEqual,
{ L"cross" , 7}, // shapetypeMathPlus,
{ L"" , 7}, // shapetypeMathPlus,
{ L"moon" , 7}, // shapetypeMoon,
{ L"" , 7}, // shapetypeNonIsoscelesTrapezoid,
{ L"forbidden" , 7}, // shapetypeNoSmoking,
{ L"notched-right-arrow" , 7}, // shapetypeNotchedRightArrow,
{ L"" , 7}, // shapetypeNotchedRightArrow,
{ L"octagon" , 7}, // shapetypeOctagon,
{ L"parallelogram" , 7}, // shapetypeParallelogram,
{ L"" , 7}, // shapetypeParallelogram,
{ L"pentagon" , 7}, // shapetypePentagon,
{ L"" , 7}, // shapetypePie,
{ L"" , 7}, // shapetypePieWedge,
{ L"" , 7}, // shapetypePlaque,
{ L"" , 7}, // shapetypePlaqueTabs,
{ L"cross" , 7}, // shapetypePlus,
{ L"" , 7}, // shapetypePlus,
{ L"quad-arrow" , 7}, // shapetypeQuadArrow,
{ L"quad-arrow-callout" , 7}, // shapetypeQuadArrowCallout,
{ L"rectangle" , 2}, // shapetypeRect,
{ L"mso-spt53" , 7}, // shapetypeRibbon,
{ L"mso-spt54" , 7}, // shapetypeRibbon2,
{ L"right-arrow" , 7}, // shapetypeRightArrow,
{ L"right-arrow-callout" , 7}, // shapetypeRightArrowCallout,
{ L"" , 7}, // shapetypeRightArrow,
{ L"" , 7}, // shapetypeRightArrowCallout,
{ L"right-brace" , 7}, // shapetypeRightBrace,
{ L"right-bracket" , 7}, // shapetypeRightBracket,
{ L"" , 7}, // shapetypeRound1Rect,
{ L"" , 7}, // shapetypeRound2DiagRect,
{ L"" , 7}, // shapetypeRound2SameRect,
{ L"round-rectangle" , 7}, // shapetypeRoundRect,
{ L"right-triangle" , 7}, // shapetypeRtTriangle,
{ L"" , 7}, // shapetypeRoundRect,
{ L"" , 7}, // shapetypeRtTriangle,
{ L"smiley" , 7}, // shapetypeSmileyFace,
{ L"" , 7}, // shapetypeSnip1Rect,
{ L"" , 7}, // shapetypeSnip2DiagRect,
......@@ -214,11 +214,11 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"" , 7}, // shapetypeSun,
{ L"" , 7}, // shapetypeSwooshArrow,
{ L"" , 7}, // shapetypeTeardrop,
{ L"trapezoid" , 7}, // shapetypeTrapezoid,
{ L"isosceles-triangle" , 7}, // shapetypeTriangle,
{ L"up-arrow" , 7}, // shapetypeUpArrow,
{ L"up-arrow-callout" , 7}, // shapetypeUpArrowCallout,
{ L"up-down-arrow" , 7}, // shapetypeUpDownArrow,
{ L"" , 7}, // shapetypeTrapezoid,
{ L"" , 7}, // shapetypeTriangle,
{ L"" , 7}, // shapetypeUpArrow,
{ L"" , 7}, // shapetypeUpArrowCallout,
{ L"" , 7}, // shapetypeUpDownArrow,
{ L"up-down-arrow-callout" , 7}, // shapetypeUpDownArrowCallout,
{ L"mso-spt101" , 7}, // shapetypeUturnArrow,
{ L"vertical-scroll" , 7}, // shapetypeVerticalScroll,
......
......@@ -30,6 +30,12 @@
*
*/
#include "../oox_shape_defines.h"
// shapetypeAccentBorderCallout1,
// shapetypeAccentBorderCallout2,
// shapetypeAccentBorderCallout3,
namespace cpdoccore
{
}
\ No newline at end of file
......@@ -29,3 +29,9 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../oox_shape_defines.h"
namespace cpdoccore
{
}
\ No newline at end of file
......@@ -29,3 +29,67 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../oox_shape_defines.h"
//+ shapetypeBentUpArrow
// shapetypeBentArrow,
// shapetypeBentConnector2,
// shapetypeBentConnector3,
// shapetypeBentConnector4,
// shapetypeBentConnector5,
namespace cpdoccore
{
class oox_shape_BentUpArrow : public oox_shape
{
public:
oox_shape_BentUpArrow()
{
odf_type_name =L"ooxml-bentUpArrow";
enhanced_path = L"M 0 ?f13 L ?f10 ?f13 ?f10 ?f4 ?f6 ?f4 ?f8 0 ?f18 ?f4 ?f11 ?f4 ?f11 ?f17 0 ?f17 Z N";
text_areas = L"0 ?f13 ?f11 ?f17";
view_box = L"0 0 0 0";
modifiers = L"25000 25000 25000";
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
add(L"f1", L"if(0-$1 ,0,if(50000-$1 ,$1 ,50000))");
add(L"f2", L"if(0-$2 ,0,if(50000-$2 ,$2 ,50000))");
add(L"f3", L"min(logwidth,logheight)");
add(L"f4", L"?f3 *?f2 /100000");
add(L"f5", L"?f3 *?f1 /50000");
add(L"f6", L"logwidth+0-?f5 ");
add(L"f7", L"?f3 *?f1 /100000");
add(L"f8", L"logwidth+0-?f7 ");
add(L"f9", L"?f3 *?f0 /200000");
add(L"f10", L"?f8 +0-?f9 ");
add(L"f11", L"?f8 +?f9 -0");
add(L"f12", L"?f3 *?f0 /100000");
add(L"f13", L"logheight+0-?f12 ");
add(L"f14", L"?f11 *1/2");
add(L"f15", L"(?f13 +logheight)/2");
add(L"f16", L"(?f4 +logheight)/2");
add(L"f17", L"logheight");
add(L"f18", L"logwidth");
/////////////////////////////////////////////////////////
_handle h1, h2;
h1.position = L"0 ?f13";
h1.y_maximum= L"50000";
h1.y_minimum= L"0";
handles.push_back(h1);
h2.position = L"?f6 0";
h2.x_maximum= L"50000";
h2.x_minimum= L"0";
handles.push_back(h2);
h1.position = L"?f10 ?f4";
h1.y_maximum= L"50000";
h1.y_minimum= L"0";
handles.push_back(h1);
}
};
}
\ No newline at end of file
......@@ -29,3 +29,253 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../oox_shape_defines.h"
//+ shapetypeLeftArrowCallout
//+ shapetypeRightArrowCallout
//+ shapetypeUpArrowCallout
//+ shapetypeDownArrowCallout
namespace cpdoccore
{
class oox_shape_LeftArrowCallout : public oox_shape
{
public:
oox_shape_LeftArrowCallout()
{
odf_type_name =L"ooxml-leftArrowCallout";
enhanced_path = L"M 0 ?f12 L ?f17 ?f13 ?f17 ?f14 ?f19 ?f14 ?f19 0 ?f22 0 ?f22 ?f21 ?f19 ?f21 ?f19 ?f15 ?f17 ?f15 ?f17 ?f16 Z N";
text_areas = L"?f19 0 ?f22 ?f21";
view_box = L"0 0 0 0";
modifiers = L"25000 25000 25000 64977";
add(L"f0", L"min(logwidth,logheight)");
add(L"f1", L"50000*logheight/?f0 ");
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
add(L"f3", L"?f2 *2/1");
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
add(L"f5", L"100000*logwidth/?f0 ");
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
add(L"f7", L"?f6 *?f0 /logwidth");
add(L"f8", L"100000+0-?f7 ");
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
add(L"f10", L"?f0 *?f2 /100000");
add(L"f11", L"?f0 *?f4 /200000");
add(L"f12", L"logheight/2");
add(L"f13", L"?f12 +0-?f10 ");
add(L"f14", L"?f12 +0-?f11 ");
add(L"f15", L"?f12 +?f11 -0");
add(L"f16", L"?f12 +?f10 -0");
add(L"f17", L"?f0 *?f6 /100000");
add(L"f18", L"logwidth*?f9 /100000");
add(L"f19", L"logwidth+0-?f18 ");
add(L"f20", L"(?f19 +logwidth)/2");
add(L"f21", L"logheight");
add(L"f22", L"logwidth");
/////////////////////////////////////////////////////////
_handle h1, h2;
h2.position = L"?f17 ?f14";
h2.y_maximum= L"?f3";
h2.y_minimum= L"0";
handles.push_back(h2);
h2.position = L"0 ?f13";
h2.y_maximum= L"?f1";
h2.y_minimum= L"0";
handles.push_back(h2);
h1.position = L"?f17 0";
h1.x_maximum= L"?f5";
h1.x_minimum= L"0";
handles.push_back(h1);
h1.position = L"?f19 ?f21";
h1.x_maximum= L"?f8";
h1.x_minimum= L"0";
handles.push_back(h1);
}
};
class oox_shape_RightArrowCallout : public oox_shape
{
public:
oox_shape_RightArrowCallout()
{
odf_type_name = L"ooxml-rightArrowCallout";
enhanced_path = L"M 0 0 L ?f19 0 ?f19 ?f14 ?f18 ?f14 ?f18 ?f13 ?f21 ?f12 ?f18 ?f16 ?f18 ?f15 ?f19 ?f15 ?f19 ?f22 0 ?f22 Z N";
text_areas = L"0 0 ?f19 ?f22";
view_box = L"0 0 0 0";
modifiers = L"25000 25000 25000 64977";
add(L"f0", L"min(logwidth,logheight)");
add(L"f1", L"50000*logheight/?f0 ");
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
add(L"f3", L"?f2 *2/1");
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
add(L"f5", L"100000*logwidth/?f0 ");
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
add(L"f7", L"?f6 *?f0 /logwidth");
add(L"f8", L"100000+0-?f7 ");
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
add(L"f10", L"?f0 *?f2 /100000");
add(L"f11", L"?f0 *?f4 /200000");
add(L"f12", L"logheight/2");
add(L"f13", L"?f12 +0-?f10 ");
add(L"f14", L"?f12 +0-?f11 ");
add(L"f15", L"?f12 +?f11 -0");
add(L"f16", L"?f12 +?f10 -0");
add(L"f17", L"?f0 *?f6 /100000");
add(L"f18", L"logwidth+0-?f17 ");
add(L"f19", L"logwidth*?f9 /100000");
add(L"f20", L"?f19 *1/2");
add(L"f21", L"logwidth");
add(L"f22", L"logheight");
/////////////////////////////////////////////////////////
_handle h1, h2;
h2.position = L"?f18 ?f14";
h2.y_maximum= L"?f3";
h2.y_minimum= L"0";
handles.push_back(h2);
h2.position = L"?f21 ?f13";
h2.y_maximum= L"?f1";
h2.y_minimum= L"0";
handles.push_back(h2);
h1.position = L"?f18 0";
h1.x_maximum= L"?f5";
h1.x_minimum= L"0";
handles.push_back(h1);
h1.position = L"?f19 ?f22";
h1.x_maximum= L"?f8";
h1.x_minimum= L"0";
handles.push_back(h1);
}
};
class oox_shape_UpArrowCallout : public oox_shape
{
public:
oox_shape_UpArrowCallout()
{
odf_type_name =L"ooxml-upArrowCallout";
enhanced_path = L"M 0 ?f19 L ?f14 ?f19 ?f14 ?f17 ?f13 ?f17 ?f12 0 ?f16 ?f17 ?f15 ?f17 ?f15 ?f19 ?f21 ?f19 ?f21 ?f22 0 ?f22 Z N";
text_areas = L"0 ?f19 ?f21 ?f22";
view_box = L"0 0 0 0";
modifiers = L"25000 25000 25000 64977";
add(L"f0", L"min(logwidth,logheight)");
add(L"f1", L"50000*logwidth/?f0 ");
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
add(L"f3", L"?f2 *2/1");
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
add(L"f5", L"100000*logheight/?f0 ");
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
add(L"f7", L"?f6 *?f0 /logheight");
add(L"f8", L"100000+0-?f7 ");
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
add(L"f10", L"?f0 *?f2 /100000");
add(L"f11", L"?f0 *?f4 /200000");
add(L"f12", L"logwidth/2");
add(L"f13", L"?f12 +0-?f10 ");
add(L"f14", L"?f12 +0-?f11 ");
add(L"f15", L"?f12 +?f11 -0");
add(L"f16", L"?f12 +?f10 -0");
add(L"f17", L"?f0 *?f6 /100000");
add(L"f18", L"logheight*?f9 /100000");
add(L"f19", L"logheight+0-?f18 ");
add(L"f20", L"(?f19 +logheight)/2");
add(L"f21", L"logwidth");
add(L"f22", L"logheight");
/////////////////////////////////////////////////////////
_handle h1, h2;
h1.position = L"?f14 ?f17";
h1.x_maximum= L"?f3";
h1.x_minimum= L"0";
handles.push_back(h1);
h1.position = L"?f13 0";
h1.x_maximum= L"?f1";
h1.x_minimum= L"0";
handles.push_back(h1);
h2.position = L"?f21 ?f17";
h2.y_maximum= L"?f5";
h2.y_minimum= L"0";
handles.push_back(h2);
h2.position = L"0 ?f19";
h2.y_maximum= L"?f8";
h2.y_minimum= L"0";
handles.push_back(h2);
}
};
class oox_shape_DownArrowCallout : public oox_shape
{
public:
oox_shape_DownArrowCallout()
{
odf_type_name =L"ooxml-downArrowCallout";
enhanced_path = L"M 0 0 L ?f22 0 ?f22 ?f19 ?f15 ?f19 ?f15 ?f18 ?f16 ?f18 ?f12 ?f21 ?f13 ?f18 ?f14 ?f18 ?f14 ?f19 0 ?f19 Z N";
text_areas = L"0 0 ?f22 ?f19";
view_box = L"0 0 0 0";
modifiers = L"25000 25000 25000 64977";
add(L"f0", L"min(logwidth,logheight)");
add(L"f1", L"50000*logwidth/?f0 ");
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
add(L"f3", L"?f2 *2/1");
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
add(L"f5", L"100000*logheight/?f0 ");
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
add(L"f7", L"?f6 *?f0 /logheight");
add(L"f8", L"100000+0-?f7 ");
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
add(L"f10", L"?f0 *?f2 /100000");
add(L"f11", L"?f0 *?f4 /200000");
add(L"f12", L"logwidth/2");
add(L"f13", L"?f12 +0-?f10 ");
add(L"f14", L"?f12 +0-?f11 ");
add(L"f15", L"?f12 +?f11 -0");
add(L"f16", L"?f12 +?f10 -0");
add(L"f17", L"?f0 *?f6 /100000");
add(L"f18", L"logheight+0-?f17 ");
add(L"f19", L"logheight*?f9 /100000");
add(L"f20", L"?f19 *1/2");
add(L"f21", L"logheight");
add(L"f22", L"logwidth");
/////////////////////////////////////////////////////////
_handle h1, h2;
h1.position = L"?f14 ?f18";
h1.x_maximum= L"?f3";
h1.x_minimum= L"0";
handles.push_back(h1);
h1.position = L"?f13 ?f21";
h1.x_maximum= L"?f1";
h1.x_minimum= L"0";
handles.push_back(h1);
h2.position = L"?f22 ?f18";
h2.y_maximum= L"?f5";
h2.y_minimum= L"0";
handles.push_back(h2);
h2.position = L"0 ?f19";
h2.y_maximum= L"?f8";
h2.y_minimum= L"0";
handles.push_back(h2);
}
};
}
\ No newline at end of file
......@@ -29,6 +29,32 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../oox_shape_defines.h"
// shapetypeChartPlus,
// shapetypeChartStar,
// shapetypeChartX,
\ No newline at end of file
// shapetypeChartX
//+ shapetypeFlowChartExtract
namespace cpdoccore
{
class oox_shape_FlowChartExtract : public oox_shape
{
public:
oox_shape_FlowChartExtract()
{
odf_type_name =L"ooxml-flowChartExtract";
enhanced_path = L"M 0 2 L 1 0 2 2 Z N";
text_areas = L"?f2 ?f3 ?f0 ?f4";
view_box = L"0 0 0 0";
add(L"f0", L"logwidth*3/4");
add(L"f1", L"logwidth/2");
add(L"f2", L"logwidth/4");
add(L"f3", L"logheight/2");
add(L"f4", L"logheight");
}
};
}
\ No newline at end of file
......@@ -29,3 +29,9 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../oox_shape_defines.h"
namespace cpdoccore
{
}
\ No newline at end of file
......@@ -30,11 +30,12 @@
*
*/
#include "../oox_shape_defines.h"
// shapetypeMathDivide,
//+ shapetypeMathDivide,
//+ shapetypeMathEqual,
// shapetypeMathMinus,
//+ shapetypeMathMinus,
//+ shapetypeMathMultiply,
// shapetypeMathNotEqual,
//+ shapetypeMathPlus,
//+ shapetypeMathNotEqual,
namespace cpdoccore
{
class oox_shape_mathMultiply : public oox_shape
......@@ -160,4 +161,216 @@ public:
handles.push_back(h);
}
};
class oox_shape_mathDivide : public oox_shape
{
public:
oox_shape_mathDivide()
{
odf_type_name =L"ooxml-mathDivide";
enhanced_path = L"M ?f20 ?f18 G ?f11 ?f11 ?f25 ?f26 Z M ?f20 ?f19 G ?f11 ?f11 ?f27 ?f28 Z M ?f21 ?f14 L ?f22 ?f14 ?f22 ?f15 ?f21 ?f15 Z N";
text_areas = L"?f21 ?f14 ?f22 ?f15";
view_box = L"0 0 0 0";
modifiers = L"23520 5880 11760";
add(L"f0", L"if(1000-$0 ,1000,if(36745-$0 ,$0 ,36745))");
add(L"f1", L"0+0-?f0 ");
add(L"f2", L"(73490+?f1 )/4");
add(L"f3", L"36745*logwidth/logheight");
add(L"f4", L"min(?f2 ,?f3 )");
add(L"f5", L"if(1000-$2 ,1000,if(?f4 -$2 ,$2 ,?f4 ))");
add(L"f6", L"-4*?f5 /1");
add(L"f7", L"73490+?f6 -?f0 ");
add(L"f8", L"if(0-$1 ,0,if(?f7 -$1 ,$1 ,?f7 ))");
add(L"f9", L"logheight*?f0 /200000");
add(L"f10", L"logheight*?f8 /100000");
add(L"f11", L"logheight*?f5 /100000");
add(L"f12", L"logwidth*73490/200000");
add(L"f13", L"logheight/2");
add(L"f14", L"?f13 +0-?f9 ");
add(L"f15", L"?f13 +?f9 -0");
add(L"f16", L"?f10 +?f11 -0");
add(L"f17", L"?f14 +0-?f16 ");
add(L"f18", L"?f17 +0-?f11 ");
add(L"f19", L"logheight+0-?f18 ");
add(L"f20", L"logwidth/2");
add(L"f21", L"?f20 +0-?f12 ");
add(L"f22", L"?f20 +?f12 -0");
add(L"f23", L"?f20 +0-?f11 ");
add(L"f24", L"logwidth");
add(L"f25", L"(16200000)/60000.0");
add(L"f26", L"(21600000)/60000.0");
add(L"f27", L"(5400000)/60000.0");
add(L"f28", L"(21600000)/60000.0");
/////////////////////////////////////////////////////////
_handle h, h1;
h.position = L"0 ?f14";
h.y_maximum= L"36745";
h.y_minimum= L"1000";
handles.push_back(h);
h.position = L"?f24 ?f17";
h.y_maximum= L"?f7";
h.y_minimum= L"0";
handles.push_back(h);
h1.position = L"?f23 0";
h1.x_maximum= L"?f4";
h1.x_minimum= L"1000";
handles.push_back(h1);
}
};
class oox_shape_mathNotEqual : public oox_shape
{
public:
oox_shape_mathNotEqual()
{
odf_type_name =L"ooxml-mathNotEqual";
enhanced_path = L"M ?f9 ?f14 L ?f24 ?f14 ?f43 ?f47 ?f42 ?f46 ?f34 ?f14 ?f10 ?f14 ?f10 ?f12 ?f35 ?f12 ?f36 ?f13 ?f10 ?f13 ?f10 ?f15 ?f37 ?f15 ?f49 ?f51 ?f48 ?f50 ?f30 ?f15 ?f9 ?f15 ?f9 ?f13 ?f28 ?f13 ?f26 ?f12 ?f9 ?f12 Z N";
text_areas = L"?f9 ?f14 ?f10 ?f15";
view_box = L"0 0 0 0";
modifiers = L"23520 6600000 11760";
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
add(L"f1", L"if(4200000-$1 ,4200000,if(6600000-$1 ,$1 ,6600000))");
add(L"f2", L"?f0 *2/1");
add(L"f3", L"100000+0-2");
add(L"f4", L"if(0-$2 ,0,if(?f3 -$2 ,$2 ,?f3 ))");
add(L"f5", L"logheight*?f0 /100000");
add(L"f6", L"logheight*?f4 /200000");
add(L"f7", L"logwidth*73490/200000");
add(L"f8", L"logwidth/2");
add(L"f9", L"?f8 +0-?f7 ");
add(L"f10", L"?f8 +?f7 -0");
add(L"f11", L"logheight/2");
add(L"f12", L"?f11 +0-?f6 ");
add(L"f13", L"?f11 +?f6 -0");
add(L"f14", L"?f12 +0-?f5 ");
add(L"f15", L"?f13 +?f5 -0");
add(L"f16", L"?f1 +0-5400000");
add(L"f17", L"logheight/2");
add(L"f18", L"?f17 *tan(pi*(?f16 )/10800000)");
add(L"f19", L"sqrt(?f18 *?f18 +?f17 *?f17 +0*0)");
add(L"f20", L"?f19 *?f5 /?f17 ");
add(L"f21", L"?f20 *1/2");
add(L"f22", L"?f8 +?f18 -?f21 ");
add(L"f23", L"?f18 *?f14 /?f17 ");
add(L"f24", L"?f22 +0-?f23 ");
add(L"f25", L"?f18 *?f12 /?f17 ");
add(L"f26", L"?f22 +0-?f25 ");
add(L"f27", L"?f18 *?f13 /?f17 ");
add(L"f28", L"?f22 +0-?f27 ");
add(L"f29", L"?f18 *?f15 /?f17 ");
add(L"f30", L"?f22 +0-?f29 ");
add(L"f31", L"?f18 *2/1");
add(L"f32", L"?f22 +0-?f31 ");
add(L"f33", L"?f22 +?f20 -0");
add(L"f34", L"?f24 +?f20 -0");
add(L"f35", L"?f26 +?f20 -0");
add(L"f36", L"?f28 +?f20 -0");
add(L"f37", L"?f30 +?f20 -0");
add(L"f38", L"?f32 +?f20 -0");
add(L"f39", L"?f5 *?f17 /?f19 ");
add(L"f40", L"?f22 +?f39 -0");
add(L"f41", L"?f33 +0-?f39 ");
add(L"f42", L"if(?f16 ,?f40 ,?f33 )");
add(L"f43", L"if(?f16 ,?f22 ,?f41 )");
add(L"f44", L"?f5 *?f18 /?f19 ");
add(L"f45", L"0+0-?f44 ");
add(L"f46", L"if(?f16 ,?f44 ,0)");
add(L"f47", L"if(?f16 ,0,?f45 )");
add(L"f48", L"logwidth+0-?f42 ");
add(L"f49", L"logwidth+0-?f43 ");
add(L"f50", L"logheight+0-?f46 ");
add(L"f51", L"logheight+0-?f47 ");
add(L"f52", L"(?f42 +?f43 )/2");
add(L"f53", L"(?f49 +?f48 )/2");
add(L"f54", L"(?f46 +?f47 )/2");
add(L"f55", L"(?f14 +?f12 )/2");
add(L"f56", L"(?f13 +?f15 )/2");
add(L"f57", L"(?f51 +?f50 )/2");
add(L"f58", L"logwidth");
/////////////////////////////////////////////////////////
_handle h, h1;
h.position = L"0 ?f14";
h.y_maximum= L"50000";
h.y_minimum= L"0";
handles.push_back(h);
h1.position = L"?f43 0";
handles.push_back(h1);
h.position = L"?f58 ?f12";
h.y_maximum= L"?f3";
h.y_minimum= L"0";
handles.push_back(h);
}
};
class oox_shape_mathPlus : public oox_shape
{
public:
oox_shape_mathPlus()
{
odf_type_name =L"ooxml-mathPlus";
enhanced_path = L"?f6 ?f12 L ?f7 ?f12 ?f7 ?f11 ?f8 ?f11 ?f8 ?f12 ?f9 ?f12 ?f9 ?f13 ?f8 ?f13 ?f8 ?f14 ?f7 ?f14 ?f7 ?f13 ?f6 ?f13 Z N";
text_areas = L"?f6 ?f12 ?f9 ?f13";
view_box = L"0 0 0 0";
modifiers = L"23520";
add(L"f0", L"if(0-$0 ,0,if(73490-$0 ,$0 ,73490))");
add(L"f1", L"logwidth*73490/200000");
add(L"f2", L"logheight*73490/200000");
add(L"f3", L"min(logwidth,logheight)");
add(L"f4", L"?f3 *?f0 /200000");
add(L"f5", L"logwidth/2");
add(L"f6", L"?f5 +0-?f1 ");
add(L"f7", L"?f5 +0-?f4 ");
add(L"f8", L"?f5 +?f4 -0");
add(L"f9", L"?f5 +?f1 -0");
add(L"f10", L"logheight/2");
add(L"f11", L"?f10 +0-?f2 ");
add(L"f12", L"?f10 +0-?f4 ");
add(L"f13", L"?f10 +?f4 -0");
add(L"f14", L"?f10 +?f2 -0");
/////////////////////////////////////////////////////////
_handle h;
h.position = L"0 ?f12";
h.y_maximum= L"73490";
h.y_minimum= L"0";
handles.push_back(h);
}
};
class oox_shape_mathMinus : public oox_shape
{
public:
oox_shape_mathMinus()
{
odf_type_name =L"ooxml-mathMinus";
enhanced_path = L"M ?f7 ?f4 L ?f8 ?f4 ?f8 ?f5 ?f7 ?f5 Z N";
text_areas = L"?f7 ?f4 ?f8 ?f5";
view_box = L"0 0 0 0";
modifiers = L"23520";
add(L"f0", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
add(L"f1", L"logheight*?f0 /200000");
add(L"f2", L"logwidth*73490/200000");
add(L"f3", L"logheight/2");
add(L"f4", L"?f3 +0-?f1 ");
add(L"f5", L"?f3 +?f1 -0");
add(L"f6", L"logwidth/2");
add(L"f7", L"?f6 +0-?f2 ");
add(L"f8", L"?f6 +?f2 -0");
/////////////////////////////////////////////////////////
_handle h;
h.position = L"0 ?f4";
h.y_maximum= L"100000";
h.y_minimum= L"0";
handles.push_back(h);
}
};
}
......@@ -719,4 +719,45 @@ public:
add(L"f198", L"if(?f26, ?f175, ?f190)");
}
};
class oox_shape_roundRect : public oox_shape
{
public:
oox_shape_roundRect()
{
odf_type_name =L"ooxml-roundRect";
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";
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");
//-----------------------------------------------------------------
_handle h1;
h1.position = L"?f2 0";
h1.x_maximum= L"50000";
h1.x_minimum= L"0";
handles.push_back(h1);
}
};
}
......@@ -958,7 +958,8 @@ void odf_drawing_context::end_shape()
{
oox_shape_ptr shape_define = oox_shape::create(impl_->current_drawing_state_.oox_shape_preset_);
if (!shape_define) shape_define = impl_->current_drawing_state_.oox_shape_;
if (!shape_define)
shape_define = impl_->current_drawing_state_.oox_shape_;
if (shape_define)
{
......
......@@ -44,6 +44,8 @@
#include "Shapes/oox_shapeConnectors.h"
#include "Shapes/oox_shapeWordArt.h"
#include "Shapes/oox_shapeCurvedArrows.h"
#include "Shapes/oox_shapeCallouts.h"
#include "Shapes/oox_shapeBents.h"
#include "../../../Common/DocxFormat/Source/Common/SimpleTypes_Drawing.h"
......@@ -61,7 +63,12 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
{
case SimpleTypes::shapetypeMathMultiply: return boost::make_shared<oox_shape_mathMultiply>();
case SimpleTypes::shapetypeMathEqual: return boost::make_shared<oox_shape_mathEqual>();
case SimpleTypes::shapetypeSun: return boost::make_shared<oox_shape_sun>();
case SimpleTypes::shapetypeMathPlus: return boost::make_shared<oox_shape_mathPlus>();
case SimpleTypes::shapetypeMathNotEqual: return boost::make_shared<oox_shape_mathNotEqual>();
case SimpleTypes::shapetypeMathDivide: return boost::make_shared<oox_shape_mathDivide>();
case SimpleTypes::shapetypeMathMinus: return boost::make_shared<oox_shape_mathMinus>();
case SimpleTypes::shapetypeRoundRect: return boost::make_shared<oox_shape_roundRect>();
case SimpleTypes::shapetypeRound1Rect: return boost::make_shared<oox_shape_round1Rect>();
case SimpleTypes::shapetypeRound2DiagRect: return boost::make_shared<oox_shape_round2DiagRect>();
case SimpleTypes::shapetypeRound2SameRect: return boost::make_shared<oox_shape_round2SameRect>();
......@@ -69,23 +76,46 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
case SimpleTypes::shapetypeSnip2DiagRect: return boost::make_shared<oox_shape_snip2DiagRect>();
case SimpleTypes::shapetypeSnip2SameRect: return boost::make_shared<oox_shape_snip2SameRect>();
case SimpleTypes::shapetypeSnipRoundRect: return boost::make_shared<oox_shape_snipRoundRect>();
case SimpleTypes::shapetypeStar6: return boost::make_shared<oox_shape_star6>();
case SimpleTypes::shapetypeStar7: return boost::make_shared<oox_shape_star7>();
case SimpleTypes::shapetypeStar10: return boost::make_shared<oox_shape_star10>();
case SimpleTypes::shapetypeStar12: return boost::make_shared<oox_shape_star12>();
case SimpleTypes::shapetypeStar16: return boost::make_shared<oox_shape_star16>();
case SimpleTypes::shapetypeStar32: return boost::make_shared<oox_shape_star32>();
case SimpleTypes::shapetypeFunnel: return boost::make_shared<oox_shape_Funnel>();
case SimpleTypes::shapetypeGear6: return boost::make_shared<oox_shape_Gear6>();
case SimpleTypes::shapetypeGear9: return boost::make_shared<oox_shape_Gear9>();
case SimpleTypes::shapetypeSun: return boost::make_shared<oox_shape_sun>();
case SimpleTypes::shapetypeCircularArrow: return boost::make_shared<oox_shape_CircularArrow>();
case SimpleTypes::shapetypeCurvedLeftArrow: return boost::make_shared<oox_shape_curvedLeftArrow>();
case SimpleTypes::shapetypeCurvedDownArrow: return boost::make_shared<oox_shape_curvedDownArrow>();
case SimpleTypes::shapetypeCurvedLeftArrow: return boost::make_shared<oox_shape_CurvedLeftArrow>();
case SimpleTypes::shapetypeCurvedRightArrow: return boost::make_shared<oox_shape_CurvedRightArrow>();
case SimpleTypes::shapetypeCurvedDownArrow: return boost::make_shared<oox_shape_CurvedDownArrow>();
case SimpleTypes::shapetypeLeftCircularArrow: return boost::make_shared<oox_shape_LeftCircularArrow>();
case SimpleTypes::shapetypeSwooshArrow: return boost::make_shared<oox_shape_SwooshArrow>();
case SimpleTypes::shapetypeLeftArrow: return boost::make_shared<oox_shape_LeftArrow>();
case SimpleTypes::shapetypeLeftRightArrow: return boost::make_shared<oox_shape_LeftRightArrow>();
case SimpleTypes::shapetypeLeftUpArrow: return boost::make_shared<oox_shape_LeftUpArrow>();
case SimpleTypes::shapetypeUpDownArrow: return boost::make_shared<oox_shape_UpDownArrow>();
case SimpleTypes::shapetypeRightArrow: return boost::make_shared<oox_shape_RightArrow>();
case SimpleTypes::shapetypeDownArrow: return boost::make_shared<oox_shape_DownArrow>();
case SimpleTypes::shapetypeUpArrow: return boost::make_shared<oox_shape_UpArrow>();
case SimpleTypes::shapetypeNotchedRightArrow: return boost::make_shared<oox_shape_NotchedRightArrow>();
case SimpleTypes::shapetypeFunnel: return boost::make_shared<oox_shape_Funnel>();
case SimpleTypes::shapetypeGear6: return boost::make_shared<oox_shape_Gear6>();
case SimpleTypes::shapetypeGear9: return boost::make_shared<oox_shape_Gear9>();
case SimpleTypes::shapetypeBlockArc: return boost::make_shared<oox_shape_BlockArc>();
case SimpleTypes::shapetypeCorner: return boost::make_shared<oox_shape_Corner>();
case SimpleTypes::shapetypeChord: return boost::make_shared<oox_shape_Chord>();
case SimpleTypes::shapetypeChevron: return boost::make_shared<oox_shape_Chevron>();
case SimpleTypes::shapetypeHomePlate: return boost::make_shared<oox_shape_HomePlate>();
case SimpleTypes::shapetypeBevel: return boost::make_shared<oox_shape_Bevel>();
case SimpleTypes::shapetypeArc: return boost::make_shared<oox_shape_Arc>();
case SimpleTypes::shapetypeTrapezoid: return boost::make_shared<oox_shape_Trapezoid>();
case SimpleTypes::shapetypeTriangle: return boost::make_shared<oox_shape_Triangle>();
case SimpleTypes::shapetypeRtTriangle: return boost::make_shared<oox_shape_RtTriangle>();
case SimpleTypes::shapetypeParallelogram: return boost::make_shared<oox_shape_Parallelogram>();
case SimpleTypes::shapetypeDiamond: return boost::make_shared<oox_shape_Diamond>();
case SimpleTypes::shapetypePlus: return boost::make_shared<oox_shape_Plus>();
case SimpleTypes::shapetypePlaque: return boost::make_shared<oox_shape_Plaque>();
case SimpleTypes::shapetypeDoubleWave: return boost::make_shared<oox_shape_DoubleWave>();
......@@ -93,7 +123,15 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
case SimpleTypes::shapetypePie: return boost::make_shared<oox_shape_Pie>();
case SimpleTypes::shapetypeDonut: return boost::make_shared<oox_shape_Donut>();
case SimpleTypes::shapetypeLeftRightRibbon: return boost::make_shared<oox_shape_LeftRightRibbon>();
case SimpleTypes::shapetypeFlowChartExtract: return boost::make_shared<oox_shape_FlowChartExtract>();
case SimpleTypes::shapetypeLeftArrowCallout: return boost::make_shared<oox_shape_LeftArrowCallout>();
case SimpleTypes::shapetypeRightArrowCallout: return boost::make_shared<oox_shape_RightArrowCallout>();
case SimpleTypes::shapetypeUpArrowCallout: return boost::make_shared<oox_shape_UpArrowCallout>();
case SimpleTypes::shapetypeDownArrowCallout: return boost::make_shared<oox_shape_DownArrowCallout>();
case SimpleTypes::shapetypeBentUpArrow: return boost::make_shared<oox_shape_BentUpArrow>();
//case (2001 + SimpleTypes::textshapetypeTextArchDown):
//case (2001 + SimpleTypes::textshapetypeTextArchDownPour):
......
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