Commit 4fda6101 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatWriter - convert smart art

parent 99822fb5
......@@ -465,7 +465,7 @@ public:
void serialize(CP_ATTR_NODE);
_CP_OPT(horizontal_pos) style_horizontal_pos_;
_CP_OPT(length) svg_x_;
_CP_OPT(length) svg_x_;
};
......@@ -477,10 +477,10 @@ public:
void apply_from(const common_draw_style_name_attlist & Other);
void serialize(CP_ATTR_NODE);
_CP_OPT(style_ref) draw_style_name_;
_CP_OPT(std::wstring) draw_class_names_;
_CP_OPT(style_ref) presentation_style_name_;
_CP_OPT(std::wstring) presentation_class_names_;
_CP_OPT(style_ref) draw_style_name_;
_CP_OPT(std::wstring) draw_class_names_;
_CP_OPT(style_ref) presentation_style_name_;
_CP_OPT(std::wstring) presentation_class_names_;
};
......@@ -606,8 +606,8 @@ public:
void apply_from(const common_draw_shape_with_text_and_styles_attlist & Other);
void serialize(CP_ATTR_NODE);
common_draw_shape_with_styles_attlist common_draw_shape_with_styles_attlist_;
common_draw_text_style_name_attlist common_draw_text_style_name_attlist_;
common_draw_shape_with_styles_attlist common_draw_shape_with_styles_attlist_;
common_draw_text_style_name_attlist common_draw_text_style_name_attlist_;
};
/// presentation-shape-attlist
......@@ -618,9 +618,9 @@ public:
void apply_from(const presentation_shape_attlist & Other);
void serialize(CP_ATTR_NODE);
_CP_OPT(std::wstring) presentation_class_;
_CP_OPT(Bool) presentation_placeholder_;
_CP_OPT(Bool) presentation_user_transformed_;
_CP_OPT(std::wstring) presentation_class_;
_CP_OPT(Bool) presentation_placeholder_;
_CP_OPT(Bool) presentation_user_transformed_;
};
......
......@@ -80,7 +80,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"" , 7}, // shapetypeChartX,
{ L"chevron" , 7}, // shapetypeChevron,
{ L"" , 7}, // shapetypeChord,
{ L"circular-arrow" , 7}, // shapetypeCircularArrow,
{ L"" , 7}, // shapetypeCircularArrow,
{ L"cloud" , 7}, // shapetypeCloud,
{ L"cloud-callout" , 7}, // shapetypeCloudCallout,
{ L"" , 7}, // shapetypeCorner,
......
......@@ -29,6 +29,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../oox_shape_defines.h"
// shapetypeAccentBorderCallout1,
// shapetypeAccentBorderCallout2,
// shapetypeAccentBorderCallout3,
......@@ -29,6 +29,333 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
// shapetypeLeftCircularArrow,
#include "../oox_shape_defines.h"
// +shapetypeLeftCircularArrow,
// shapetypeLeftRightCircularArrow,
// shapetypeSwooshArrow,
\ No newline at end of file
// shapetypeSwooshArrow,
// +shapetypeCircularArrow
namespace cpdoccore
{
class oox_shape_LeftCircularArrow : public oox_shape
{
public:
oox_shape_LeftCircularArrow()
{
odf_type_name =L"ooxml-leftCircularArrow";
enhanced_path = L"M 529769 128373 L 570534 225808 A ?f91 ?f92 ?f93 ?f94 570534 225808 ?f88 ?f90 W ?f95 ?f96 ?f97 ?f98 570534 225808 ?f88 ?f90 L 246425 854941 139301 967187 5691 907641 74093 892667 A ?f138 ?f139 ?f140 ?f141 74093 892667 ?f135 ?f137 W ?f142 ?f143 ?f144 ?f145 74093 892667 ?f135 ?f137 Z N";
text_areas = L"?f48 ?f50 ?f49 ?f51";
glue_points = L"?f40 ?f41 ?f42 ?f43 ?f44 ?f45 ?f46 ?f47";
view_box = L"0 0 1637004 1637004";
add(L"f0", L"10800000");
add(L"f1", L"5400000");
add(L"f2", L"left");
add(L"f3", L"right");
add(L"f4", L"top");
add(L"f5", L"bottom");
add(L"f6", L"?f5 - ?f4");
add(L"f7", L"?f3 - ?f2");
add(L"f8", L"5419351 / 1725033");
add(L"f9", L"180");
add(L"f10", L"?f7 / 1637004");
add(L"f11", L"?f6 / 1637004");
add(L"f12", L"139301 - 818502");
add(L"f13", L"967187 - 818502");
add(L"f14", L"sqrt(?f12 * ?f12 + ?f13 * ?f13 + 0 * 0)");
add(L"f15", L"atan2(?f12, ?f13)");
add(L"f16", L"?f15 + ?f1");
add(L"f17", L"?f16 * ?f9 / ?f0");
add(L"f18", L"0 - ?f17");
add(L"f19", L"529769 - 818502");
add(L"f20", L"128373 - 818502");
add(L"f21", L"sqrt(?f19 * ?f19 + ?f20 * ?f20 + 0 * 0)");
add(L"f22", L"atan2(?f19, ?f20)");
add(L"f23", L"?f22 + ?f1");
add(L"f24", L"?f23 * ?f9 / ?f0");
add(L"f25", L"0 - ?f24");
add(L"f26", L"74093 - 818502");
add(L"f27", L"892667 - 818502");
add(L"f28", L"sqrt(?f26 * ?f26 + ?f27 * ?f27 + 0 * 0)");
add(L"f29", L"atan2(?f26, ?f27)");
add(L"f30", L"?f29 + ?f1");
add(L"f31", L"?f30 * ?f9 / ?f0");
add(L"f32", L"0 - ?f31");
add(L"f33", L"246425 - 818502");
add(L"f34", L"854941 - 818502");
add(L"f35", L"sqrt(?f33 * ?f33 + ?f34 * ?f34 + 0 * 0)");
add(L"f36", L"atan2(?f33, ?f34)");
add(L"f37", L"?f36 + ?f1");
add(L"f38", L"?f37 * ?f9 / ?f0");
add(L"f39", L"0 - ?f38");
add(L"f40", L"550151 / ?f10");
add(L"f41", L"177091 / ?f11");
add(L"f42", L"5691 / ?f10");
add(L"f43", L"907641 / ?f11");
add(L"f44", L"139301 / ?f10");
add(L"f45", L"967187 / ?f11");
add(L"f46", L"246425 / ?f10");
add(L"f47", L"854941 / ?f11");
add(L"f48", L"289519 / ?f10");
add(L"f49", L"1347485 / ?f10");
add(L"f50", L"289519 / ?f11");
add(L"f51", L"1347485 / ?f11");
add(L"f52", L"21550000 - -4313128");
add(L"f53", L"if(?f52, -4313128, 21550000)");
add(L"f54", L"-21550000 - ?f53");
add(L"f55", L"if(?f54, -21550000, ?f53)");
add(L"f56", L"14837806 + ?f55");
add(L"f57", L"14837806 + ?f1");
add(L"f58", L"?f57 * ?f8 / ?f0");
add(L"f59", L"0 - ?f58");
add(L"f60", L"cos(?f59)");
add(L"f61", L"0 - ?f60");
add(L"f62", L"?f61 * 642475");
add(L"f63", L"sin(?f59)");
add(L"f64", L"0 - ?f63");
add(L"f65", L"?f64 * 642475");
add(L"f66", L"sqrt(?f62 * ?f62 + ?f65 * ?f65 + 0 * 0)");
add(L"f67", L"642475 * 642475 / ?f66");
add(L"f68", L"?f64 * ?f67");
add(L"f69", L"570534 - ?f68");
add(L"f70", L"?f61 * ?f67");
add(L"f71", L"225808 - ?f70");
add(L"f72", L"?f69 - 642475");
add(L"f73", L"?f71 - 642475");
add(L"f74", L"?f69 + 642475");
add(L"f75", L"?f71 + 642475");
add(L"f76", L"?f56 + ?f1");
add(L"f77", L"?f76 * ?f8 / ?f0");
add(L"f78", L"0 - ?f77");
add(L"f79", L"cos(?f78)");
add(L"f80", L"0 - ?f79");
add(L"f81", L"?f80 * 642475");
add(L"f82", L"sin(?f78)");
add(L"f83", L"0 - ?f82");
add(L"f84", L"?f83 * 642475");
add(L"f85", L"sqrt(?f81 * ?f81 + ?f84 * ?f84 + 0 * 0)");
add(L"f86", L"642475 * 642475 / ?f85");
add(L"f87", L"?f83 * ?f86");
add(L"f88", L"?f69 + ?f87");
add(L"f89", L"?f80 * ?f86");
add(L"f90", L"?f71 + ?f89");
add(L"f91", L"if(?f55, 570534, ?f72)");
add(L"f92", L"if(?f55, 225808, ?f73)");
add(L"f93", L"if(?f55, 570534, ?f74)");
add(L"f94", L"if(?f55, 225808, ?f75)");
add(L"f95", L"if(?f55, ?f72, ?f88)");
add(L"f96", L"if(?f55, ?f73, ?f90)");
add(L"f97", L"if(?f55, ?f74, ?f88)");
add(L"f98", L"if(?f55, ?f75, ?f90)");
add(L"f99", L"21550000 - 4379179");
add(L"f100", L"if(?f99, 4379179, 21550000)");
add(L"f101", L"-21550000 - ?f100");
add(L"f102", L"if(?f101, -21550000, ?f100)");
add(L"f103", L"10458627 + ?f102");
add(L"f104", L"10458627 + ?f1");
add(L"f105", L"?f104 * ?f8 / ?f0");
add(L"f106", L"0 - ?f105");
add(L"f107", L"cos(?f106)");
add(L"f108", L"0 - ?f107");
add(L"f109", L"?f108 * 748094");
add(L"f110", L"sin(?f106)");
add(L"f111", L"0 - ?f110");
add(L"f112", L"?f111 * 748094");
add(L"f113", L"sqrt(?f109 * ?f109 + ?f112 * ?f112 + 0 * 0)");
add(L"f114", L"748094 * 748094 / ?f113");
add(L"f115", L"?f111 * ?f114");
add(L"f116", L"74093 - ?f115");
add(L"f117", L"?f108 * ?f114");
add(L"f118", L"892667 - ?f117");
add(L"f119", L"?f116 - 748094");
add(L"f120", L"?f118 - 748094");
add(L"f121", L"?f116 + 748094");
add(L"f122", L"?f118 + 748094");
add(L"f123", L"?f103 + ?f1");
add(L"f124", L"?f123 * ?f8 / ?f0");
add(L"f125", L"0 - ?f124");
add(L"f126", L"cos(?f125)");
add(L"f127", L"0 - ?f126");
add(L"f128", L"?f127 * 748094");
add(L"f129", L"sin(?f125)");
add(L"f130", L"0 - ?f129");
add(L"f131", L"?f130 * 748094");
add(L"f132", L"sqrt(?f128 * ?f128 + ?f131 * ?f131 + 0 * 0)");
add(L"f133", L"748094 * 748094 / ?f132");
add(L"f134", L"?f130 * ?f133");
add(L"f135", L"?f116 + ?f134");
add(L"f136", L"?f127 * ?f133");
add(L"f137", L"?f118 + ?f136");
add(L"f138", L"if(?f102, 74093, ?f119)");
add(L"f139", L"if(?f102, 892667, ?f120)");
add(L"f140", L"if(?f102, 74093, ?f121)");
add(L"f141", L"if(?f102, 892667, ?f122)");
add(L"f142", L"if(?f102, ?f119, ?f135)");
add(L"f143", L"if(?f102, ?f120, ?f137)");
add(L"f144", L"if(?f102, ?f121, ?f135)");
add(L"f145", L"if(?f102, ?f122, ?f137)");
/////////////////////////////////////////////////////////
}
};
class oox_shape_CircularArrow : public oox_shape
{
public:
oox_shape_CircularArrow()
{
odf_type_name =L"ooxml-circularArrow";
enhanced_path = L"M 832838 101692 A ?f91 ?f92 ?f93 ?f94 832838 101692 ?f88 ?f90 W ?f95 ?f96 ?f97 ?f98 832838 101692 ?f88 ?f90 L 1755675 1929758 1616897 1879250 1618409 1725100 1657499 1783381 A ?f138 ?f139 ?f140 ?f141 1657499 1783381 ?f135 ?f137 W ?f142 ?f143 ?f144 ?f145 1657499 1783381 ?f135 ?f137 Z N";
text_areas = L"?f48 ?f50 ?f49 ?f51";
glue_points = L"?f40 ?f41 ?f42 ?f43 ?f44 ?f45 ?f46 ?f47";
view_box = L"0 0 2165070 2165070";
add(L"f0", L"10800000");
add(L"f1", L"5400000");
add(L"f2", L"left");
add(L"f3", L"right");
add(L"f4", L"top");
add(L"f5", L"bottom");
add(L"f6", L"?f5 - ?f4");
add(L"f7", L"?f3 - ?f2");
add(L"f8", L"5419351 / 1725033");
add(L"f9", L"180");
add(L"f10", L"?f7 / 2165070");
add(L"f11", L"?f6 / 2165070");
add(L"f12", L"1616897 - 1082535");
add(L"f13", L"1879250 - 1082535");
add(L"f14", L"sqrt(?f12 * ?f12 + ?f13 * ?f13 + 0 * 0)");
add(L"f15", L"atan2(?f12, ?f13)");
add(L"f16", L"?f15 + ?f1");
add(L"f17", L"?f16 * ?f9 / ?f0");
add(L"f18", L"0 - ?f17");
add(L"f19", L"832838 - 1082535");
add(L"f20", L"101692 - 1082535");
add(L"f21", L"sqrt(?f19 * ?f19 + ?f20 * ?f20 + 0 * 0)");
add(L"f22", L"atan2(?f19, ?f20)");
add(L"f23", L"?f22 + ?f1");
add(L"f24", L"?f23 * ?f9 / ?f0");
add(L"f25", L"0 - ?f24");
add(L"f26", L"1716572 - 1082535");
add(L"f27", L"1871457 - 1082535");
add(L"f28", L"sqrt(?f26 * ?f26 + ?f27 * ?f27 + 0 * 0)");
add(L"f29", L"atan2(?f26, ?f27)");
add(L"f30", L"?f29 + ?f1");
add(L"f31", L"?f30 * ?f9 / ?f0");
add(L"f32", L"0 - ?f31");
add(L"f33", L"1618409 - 1082535");
add(L"f34", L"1725100 - 1082535");
add(L"f35", L"sqrt(?f33 * ?f33 + ?f34 * ?f34 + 0 * 0)");
add(L"f36", L"atan2(?f33, ?f34)");
add(L"f37", L"?f36 + ?f1");
add(L"f38", L"?f37 * ?f9 / ?f0");
add(L"f39", L"0 - ?f38");
add(L"f40", L"845866 / ?f10");
add(L"f41", L"152866 / ?f11");
add(L"f42", L"1755675 / ?f10");
add(L"f43", L"1929758 / ?f11");
add(L"f44", L"1616897 / ?f10");
add(L"f45", L"1879250 / ?f11");
add(L"f46", L"1618409 / ?f10");
add(L"f47", L"1725100 / ?f11");
add(L"f48", L"366853 / ?f10");
add(L"f49", L"1798217 / ?f10");
add(L"f50", L"366853 / ?f11");
add(L"f51", L"1798217 / ?f11");
add(L"f52", L"21550000 - 9329679");
add(L"f53", L"if(?f52, 9329679, 21550000)");
add(L"f54", L"-21550000 - ?f53");
add(L"f55", L"if(?f54, -21550000, ?f53)");
add(L"f56", L"15343043 + ?f55");
add(L"f57", L"15343043 + ?f1");
add(L"f58", L"?f57 * ?f8 / ?f0");
add(L"f59", L"0 - ?f58");
add(L"f60", L"cos(?f59)");
add(L"f61", L"0 - ?f60");
add(L"f62", L"?f61 * 1012127");
add(L"f63", L"sin(?f59)");
add(L"f64", L"0 - ?f63");
add(L"f65", L"?f64 * 1012127");
add(L"f66", L"sqrt(?f62 * ?f62 + ?f65 * ?f65 + 0 * 0)");
add(L"f67", L"1012127 * 1012127 / ?f66");
add(L"f68", L"?f64 * ?f67");
add(L"f69", L"832838 - ?f68");
add(L"f70", L"?f61 * ?f67");
add(L"f71", L"101692 - ?f70");
add(L"f72", L"?f69 - 1012127");
add(L"f73", L"?f71 - 1012127");
add(L"f74", L"?f69 + 1012127");
add(L"f75", L"?f71 + 1012127");
add(L"f76", L"?f56 + ?f1");
add(L"f77", L"?f76 * ?f8 / ?f0");
add(L"f78", L"0 - ?f77");
add(L"f79", L"cos(?f78)");
add(L"f80", L"0 - ?f79");
add(L"f81", L"?f80 * 1012127");
add(L"f82", L"sin(?f78)");
add(L"f83", L"0 - ?f82");
add(L"f84", L"?f83 * 1012127");
add(L"f85", L"sqrt(?f81 * ?f81 + ?f84 * ?f84 + 0 * 0)");
add(L"f86", L"1012127 * 1012127 / ?f85");
add(L"f87", L"?f83 * ?f86");
add(L"f88", L"?f69 + ?f87");
add(L"f89", L"?f80 * ?f86");
add(L"f90", L"?f71 + ?f89");
add(L"f91", L"if(?f55, 832838, ?f72)");
add(L"f92", L"if(?f55, 101692, ?f73)");
add(L"f93", L"if(?f55, 832838, ?f74)");
add(L"f94", L"if(?f55, 101692, ?f75)");
add(L"f95", L"if(?f55, ?f72, ?f88)");
add(L"f96", L"if(?f55, ?f73, ?f90)");
add(L"f97", L"if(?f55, ?f74, ?f88)");
add(L"f98", L"if(?f55, ?f75, ?f90)");
add(L"f99", L"21550000 - -9295060");
add(L"f100", L"if(?f99, -9295060, 21550000)");
add(L"f101", L"-21550000 - ?f100");
add(L"f102", L"if(?f101, -21550000, ?f100)");
add(L"f103", L"3038103 + ?f102");
add(L"f104", L"3038103 + ?f1");
add(L"f105", L"?f104 * ?f8 / ?f0");
add(L"f106", L"0 - ?f105");
add(L"f107", L"cos(?f106)");
add(L"f108", L"0 - ?f107");
add(L"f109", L"?f108 * 906515");
add(L"f110", L"sin(?f106)");
add(L"f111", L"0 - ?f110");
add(L"f112", L"?f111 * 906515");
add(L"f113", L"sqrt(?f109 * ?f109 + ?f112 * ?f112 + 0 * 0)");
add(L"f114", L"906515 * 906515 / ?f113");
add(L"f115", L"?f111 * ?f114");
add(L"f116", L"1657499 - ?f115");
add(L"f117", L"?f108 * ?f114");
add(L"f118", L"1783381 - ?f117");
add(L"f119", L"?f116 - 906515");
add(L"f120", L"?f118 - 906515");
add(L"f121", L"?f116 + 906515");
add(L"f122", L"?f118 + 906515");
add(L"f123", L"?f103 + ?f1");
add(L"f124", L"?f123 * ?f8 / ?f0");
add(L"f125", L"0 - ?f124");
add(L"f126", L"cos(?f125)");
add(L"f127", L"0 - ?f126");
add(L"f128", L"?f127 * 906515");
add(L"f129", L"sin(?f125)");
add(L"f130", L"0 - ?f129");
add(L"f131", L"?f130 * 906515");
add(L"f132", L"sqrt(?f128 * ?f128 + ?f131 * ?f131 + 0 * 0)");
add(L"f133", L"906515 * 906515 / ?f132");
add(L"f134", L"?f130 * ?f133");
add(L"f135", L"?f116 + ?f134");
add(L"f136", L"?f127 * ?f133");
add(L"f137", L"?f118 + ?f136");
add(L"f138", L"if(?f102, 1657499, ?f119)");
add(L"f139", L"if(?f102, 1783381, ?f120)");
add(L"f140", L"if(?f102, 1657499, ?f121)");
add(L"f141", L"if(?f102, 1783381, ?f122)");
add(L"f142", L"if(?f102, ?f119, ?f135)");
add(L"f143", L"if(?f102, ?f120, ?f137)");
add(L"f144", L"if(?f102, ?f121, ?f135)");
add(L"f145", L"if(?f102, ?f122, ?f137)");
/////////////////////////////////////////////////////////
}
};
}
\ No newline at end of file
......@@ -37,9 +37,9 @@
// shapetypeDiagStripe,
// shapetypeDodecagon,
//+ shapetypeDoubleWave,
// shapetypeFunnel,
// shapetypeGear6,
// shapetypeGear9,
//+ shapetypeFunnel,
//+ shapetypeGear6,
//+ shapetypeGear9,
// shapetypeHalfFrame,
// shapetypeHeptagon,
// shapetypeNonIsoscelesTrapezoid,
......@@ -323,4 +323,439 @@ public:
/////////////////////////////////////////////////////////
}
};
class oox_shape_Gear6 : public oox_shape
{
public:
oox_shape_Gear6()
{
odf_type_name =L"ooxml-gear6";
enhanced_path = L"M 541172 212681 L 631103 156982 683808 209688 628111 299619 C 649564 336513 660802 378456 660671 421135 L 753871 471167 734580 543164 628849 539893 C 607623 576919 576919 607624 539893 628849 L 543164 734581 471167 753872 421134 660670 C 378456 660802 336513 649563 299618 628110 L 209688 683809 156983 631103 212680 541172 C 191227 504278 179989 462335 180120 419656 L 86920 369624 106211 297627 211942 300898 C 233168 263872 263872 233167 300898 211942 L 297627 106210 369624 86919 419657 180121 C 462335 179989 504278 191228 541173 212681 L 541172 212681 Z N";
text_areas = L"?f68 ?f70 ?f69 ?f71";
glue_points = L"?f38 ?f39 ?f40 ?f41 ?f42 ?f43 ?f44 ?f45 ?f44 ?f46 ?f42 ?f47 ?f40 ?f48 ?f38 ?f49 ?f50 ?f51 ?f52 ?f53 ?f54 ?f53 ?f55 ?f51 ?f56 ?f49 ?f57 ?f48 ?f58 ?f47 ?f59 ?f60 ?f59 ?f61 ?f58 ?f43 ?f57 ?f41 ?f62 ?f39 ?f63 ?f64 ?f54 ?f65 ?f52 ?f65 ?f66 ?f64 ?f67 ?f39 ?f38 ?f39";
view_box = L"0 0 840791 840791";
add(L"f0", L"left");
add(L"f1", L"right");
add(L"f2", L"top");
add(L"f3", L"bottom");
add(L"f4", L"?f3 - ?f2");
add(L"f5", L"?f1 - ?f0");
add(L"f6", L"?f5 / 840791");
add(L"f7", L"?f4 / 840791");
add(L"f8", L"629119 * ?f5 / 840791");
add(L"f9", L"212951 * ?f4 / 840791");
add(L"f10", L"753164 * ?f5 / 840791");
add(L"f11", L"175566 * ?f4 / 840791");
add(L"f12", L"798808 * ?f5 / 840791");
add(L"f13", L"254624 * ?f4 / 840791");
add(L"f14", L"704410 * ?f5 / 840791");
add(L"f15", L"343358 * ?f4 / 840791");
add(L"f16", L"497434 * ?f4 / 840791");
add(L"f17", L"586167 * ?f4 / 840791");
add(L"f18", L"665225 * ?f4 / 840791");
add(L"f19", L"627840 * ?f4 / 840791");
add(L"f20", L"495685 * ?f5 / 840791");
add(L"f21", L"704878 * ?f4 / 840791");
add(L"f22", L"466040 * ?f5 / 840791");
add(L"f23", L"830997 * ?f4 / 840791");
add(L"f24", L"374751 * ?f5 / 840791");
add(L"f25", L"345105 * ?f5 / 840791");
add(L"f26", L"211671 * ?f5 / 840791");
add(L"f27", L"87627 * ?f5 / 840791");
add(L"f28", L"41983 * ?f5 / 840791");
add(L"f29", L"136381 * ?f5 / 840791");
add(L"f30", L"497433 * ?f4 / 840791");
add(L"f31", L"343357 * ?f4 / 840791");
add(L"f32", L"211672 * ?f5 / 840791");
add(L"f33", L"345106 * ?f5 / 840791");
add(L"f34", L"135913 * ?f4 / 840791");
add(L"f35", L"9794 * ?f4 / 840791");
add(L"f36", L"495686 * ?f5 / 840791");
add(L"f37", L"629120 * ?f5 / 840791");
add(L"f38", L"?f8 / ?f6");
add(L"f39", L"?f9 / ?f7");
add(L"f40", L"?f10 / ?f6");
add(L"f41", L"?f11 / ?f7");
add(L"f42", L"?f12 / ?f6");
add(L"f43", L"?f13 / ?f7");
add(L"f44", L"?f14 / ?f6");
add(L"f45", L"?f15 / ?f7");
add(L"f46", L"?f16 / ?f7");
add(L"f47", L"?f17 / ?f7");
add(L"f48", L"?f18 / ?f7");
add(L"f49", L"?f19 / ?f7");
add(L"f50", L"?f20 / ?f6");
add(L"f51", L"?f21 / ?f7");
add(L"f52", L"?f22 / ?f6");
add(L"f53", L"?f23 / ?f7");
add(L"f54", L"?f24 / ?f6");
add(L"f55", L"?f25 / ?f6");
add(L"f56", L"?f26 / ?f6");
add(L"f57", L"?f27 / ?f6");
add(L"f58", L"?f28 / ?f6");
add(L"f59", L"?f29 / ?f6");
add(L"f60", L"?f30 / ?f7");
add(L"f61", L"?f31 / ?f7");
add(L"f62", L"?f32 / ?f6");
add(L"f63", L"?f33 / ?f6");
add(L"f64", L"?f34 / ?f7");
add(L"f65", L"?f35 / ?f7");
add(L"f66", L"?f36 / ?f6");
add(L"f67", L"?f37 / ?f6");
add(L"f68", L"?f0 / ?f6");
add(L"f69", L"?f1 / ?f6");
add(L"f70", L"?f2 / ?f7");
add(L"f71", L"?f3 / ?f7");
/////////////////////////////////////////////////////////
}
};
class oox_shape_Gear9 : public oox_shape
{
public:
oox_shape_Gear9()
{
odf_type_name =L"ooxml-gear9";
enhanced_path = L"M 837517 188126 L 929297 111109 1002618 172633 942709 276392 C 985308 324313 1017696 380410 1037897 441262 L 1157709 441259 1174330 535519 1061742 576495 C 1063572 640586 1052324 704378 1028684 763978 L 1120467 840989 1072610 923880 960025 882899 C 920230 933172 870608 974809 814189 1005270 L 834997 1123262 745055 1155998 685151 1052236 C 622351 1065167 557575 1065167 494775 1052236 L 434872 1155998 344930 1123262 365739 1005270 C 309319 974809 259698 933172 219903 882899 L 107317 923880 59460 840989 151243 763978 C 127603 704378 116355 640586 118185 576495 L 5597 535519 22218 441259 142030 441262 C 162231 380410 194619 324312 237218 276392 L 177309 172633 250630 111109 342410 188126 C 397000 154496 457869 132341 521305 123014 L 542106 5021 637821 5021 658623 123013 C 722058 132340 782928 154495 837518 188125 L 837517 188126 Z N";
text_areas = L"?f122 ?f124 ?f123 ?f125";
glue_points = L"?f65 ?f66 ?f67 ?f68 ?f69 ?f70 ?f71 ?f72 ?f73 ?f74 ?f75 ?f76 ?f77 ?f78 ?f79 ?f80 ?f81 ?f82 ?f83 ?f84 ?f85 ?f86 ?f87 ?f88 ?f89 ?f90 ?f91 ?f92 ?f93 ?f94 ?f95 ?f96 ?f97 ?f96 ?f98 ?f94 ?f99 ?f92 ?f100 ?f90 ?f101 ?f88 ?f102 ?f86 ?f103 ?f84 ?f104 ?f82 ?f105 ?f80 ?f106 ?f78 ?f107 ?f76 ?f108 ?f74 ?f109 ?f72 ?f110 ?f70 ?f111 ?f68 ?f112 ?f66 ?f113 ?f114 ?f115 ?f116 ?f117 ?f116 ?f118 ?f119 ?f120 ?f121 ?f65 ?f66";
view_box = L"0 0 1179927 1179927";
add(L"f0", L"left");
add(L"f1", L"right");
add(L"f2", L"top");
add(L"f3", L"bottom");
add(L"f4", L"?f3 - ?f2");
add(L"f5", L"?f1 - ?f0");
add(L"f6", L"?f5 / 1179927");
add(L"f7", L"?f4 / 1179927");
add(L"f8", L"837517 * ?f5 / 1179927");
add(L"f9", L"188126 * ?f4 / 1179927");
add(L"f10", L"929297 * ?f5 / 1179927");
add(L"f11", L"111109 * ?f4 / 1179927");
add(L"f12", L"1002618 * ?f5 / 1179927");
add(L"f13", L"172633 * ?f4 / 1179927");
add(L"f14", L"942709 * ?f5 / 1179927");
add(L"f15", L"276392 * ?f4 / 1179927");
add(L"f16", L"1037897 * ?f5 / 1179927");
add(L"f17", L"441262 * ?f4 / 1179927");
add(L"f18", L"1157709 * ?f5 / 1179927");
add(L"f19", L"441259 * ?f4 / 1179927");
add(L"f20", L"1174330 * ?f5 / 1179927");
add(L"f21", L"535519 * ?f4 / 1179927");
add(L"f22", L"1061742 * ?f5 / 1179927");
add(L"f23", L"576495 * ?f4 / 1179927");
add(L"f24", L"1028684 * ?f5 / 1179927");
add(L"f25", L"763978 * ?f4 / 1179927");
add(L"f26", L"1120467 * ?f5 / 1179927");
add(L"f27", L"840989 * ?f4 / 1179927");
add(L"f28", L"1072610 * ?f5 / 1179927");
add(L"f29", L"923880 * ?f4 / 1179927");
add(L"f30", L"960025 * ?f5 / 1179927");
add(L"f31", L"882899 * ?f4 / 1179927");
add(L"f32", L"814189 * ?f5 / 1179927");
add(L"f33", L"1005270 * ?f4 / 1179927");
add(L"f34", L"834997 * ?f5 / 1179927");
add(L"f35", L"1123262 * ?f4 / 1179927");
add(L"f36", L"745055 * ?f5 / 1179927");
add(L"f37", L"1155998 * ?f4 / 1179927");
add(L"f38", L"685151 * ?f5 / 1179927");
add(L"f39", L"1052236 * ?f4 / 1179927");
add(L"f40", L"494775 * ?f5 / 1179927");
add(L"f41", L"434872 * ?f5 / 1179927");
add(L"f42", L"344930 * ?f5 / 1179927");
add(L"f43", L"365739 * ?f5 / 1179927");
add(L"f44", L"219903 * ?f5 / 1179927");
add(L"f45", L"107317 * ?f5 / 1179927");
add(L"f46", L"59460 * ?f5 / 1179927");
add(L"f47", L"151243 * ?f5 / 1179927");
add(L"f48", L"118185 * ?f5 / 1179927");
add(L"f49", L"5597 * ?f5 / 1179927");
add(L"f50", L"22218 * ?f5 / 1179927");
add(L"f51", L"142030 * ?f5 / 1179927");
add(L"f52", L"237218 * ?f5 / 1179927");
add(L"f53", L"177309 * ?f5 / 1179927");
add(L"f54", L"250630 * ?f5 / 1179927");
add(L"f55", L"342410 * ?f5 / 1179927");
add(L"f56", L"521305 * ?f5 / 1179927");
add(L"f57", L"123014 * ?f4 / 1179927");
add(L"f58", L"542106 * ?f5 / 1179927");
add(L"f59", L"5021 * ?f4 / 1179927");
add(L"f60", L"637821 * ?f5 / 1179927");
add(L"f61", L"658623 * ?f5 / 1179927");
add(L"f62", L"123013 * ?f4 / 1179927");
add(L"f63", L"837518 * ?f5 / 1179927");
add(L"f64", L"188125 * ?f4 / 1179927");
add(L"f65", L"?f8 / ?f6");
add(L"f66", L"?f9 / ?f7");
add(L"f67", L"?f10 / ?f6");
add(L"f68", L"?f11 / ?f7");
add(L"f69", L"?f12 / ?f6");
add(L"f70", L"?f13 / ?f7");
add(L"f71", L"?f14 / ?f6");
add(L"f72", L"?f15 / ?f7");
add(L"f73", L"?f16 / ?f6");
add(L"f74", L"?f17 / ?f7");
add(L"f75", L"?f18 / ?f6");
add(L"f76", L"?f19 / ?f7");
add(L"f77", L"?f20 / ?f6");
add(L"f78", L"?f21 / ?f7");
add(L"f79", L"?f22 / ?f6");
add(L"f80", L"?f23 / ?f7");
add(L"f81", L"?f24 / ?f6");
add(L"f82", L"?f25 / ?f7");
add(L"f83", L"?f26 / ?f6");
add(L"f84", L"?f27 / ?f7");
add(L"f85", L"?f28 / ?f6");
add(L"f86", L"?f29 / ?f7");
add(L"f87", L"?f30 / ?f6");
add(L"f88", L"?f31 / ?f7");
add(L"f89", L"?f32 / ?f6");
add(L"f90", L"?f33 / ?f7");
add(L"f91", L"?f34 / ?f6");
add(L"f92", L"?f35 / ?f7");
add(L"f93", L"?f36 / ?f6");
add(L"f94", L"?f37 / ?f7");
add(L"f95", L"?f38 / ?f6");
add(L"f96", L"?f39 / ?f7");
add(L"f97", L"?f40 / ?f6");
add(L"f98", L"?f41 / ?f6");
add(L"f99", L"?f42 / ?f6");
add(L"f100", L"?f43 / ?f6");
add(L"f101", L"?f44 / ?f6");
add(L"f102", L"?f45 / ?f6");
add(L"f103", L"?f46 / ?f6");
add(L"f104", L"?f47 / ?f6");
add(L"f105", L"?f48 / ?f6");
add(L"f106", L"?f49 / ?f6");
add(L"f107", L"?f50 / ?f6");
add(L"f108", L"?f51 / ?f6");
add(L"f109", L"?f52 / ?f6");
add(L"f110", L"?f53 / ?f6");
add(L"f111", L"?f54 / ?f6");
add(L"f112", L"?f55 / ?f6");
add(L"f113", L"?f56 / ?f6");
add(L"f114", L"?f57 / ?f7");
add(L"f115", L"?f58 / ?f6");
add(L"f116", L"?f59 / ?f7");
add(L"f117", L"?f60 / ?f6");
add(L"f118", L"?f61 / ?f6");
add(L"f119", L"?f62 / ?f7");
add(L"f120", L"?f63 / ?f6");
add(L"f121", L"?f64 / ?f7");
add(L"f122", L"?f0 / ?f6");
add(L"f123", L"?f1 / ?f6");
add(L"f124", L"?f2 / ?f7");
add(L"f125", L"?f3 / ?f7");
/////////////////////////////////////////////////////////
}
};
class oox_shape_Funnel : public oox_shape
{
public:
oox_shape_Funnel()
{
odf_type_name =L"ooxml-funnel";
enhanced_path = L"M ?f50 ?f51 A ?f99 ?f100 ?f101 ?f102 ?f50 ?f51 ?f96 ?f98 W ?f103 ?f104 ?f105 ?f106 ?f50 ?f51 ?f96 ?f98 L ?f65 ?f67 A ?f137 ?f138 ?f139 ?f140 ?f65 ?f67 ?f134 ?f136 W ?f141 ?f142 ?f143 ?f144 ?f65 ?f67 ?f134 ?f136 Z M ?f68 ?f7 A ?f184 ?f185 ?f186 ?f187 ?f68 ?f7 ?f181 ?f183 W ?f188 ?f189 ?f190 ?f191 ?f68 ?f7 ?f181 ?f183 Z N";
text_areas = L"?f2 ?f4 ?f3 ?f5";
view_box = L"0 0 21600 21600";
add(L"f0", L"10800000");
add(L"f1", L"5400000");
add(L"f2", L"left");
add(L"f3", L"right");
add(L"f4", L"top");
add(L"f5", L"bottom");
add(L"f6", L"?f5 - ?f4");
add(L"f7", L"?f6 / 4");
add(L"f8", L"?f3 - ?f2");
add(L"f9", L"?f8 / 2");
add(L"f10", L"?f2 + ?f9");
add(L"f11", L"min(?f8, ?f6)");
add(L"f12", L"5419351 / 1725033");
add(L"f13", L"?f11 / 20");
add(L"f14", L"?f9 - ?f13");
add(L"f15", L"?f7 - ?f13");
add(L"f16", L"480000 + ?f1");
add(L"f17", L"?f16 * ?f12 / ?f0");
add(L"f18", L"0 - ?f17");
add(L"f19", L"sin(?f18)");
add(L"f20", L"0 - ?f19");
add(L"f21", L"?f20 * ?f9");
add(L"f22", L"cos(?f18)");
add(L"f23", L"0 - ?f22");
add(L"f24", L"?f23 * ?f7");
add(L"f25", L"0 - ?f21");
add(L"f26", L"0 - ?f24");
add(L"f27", L"atan2(?f25, ?f26)");
add(L"f28", L"0 - ?f27");
add(L"f29", L"?f28 * ?f0 / ?f12");
add(L"f30", L"?f29 - ?f1");
add(L"f31", L"?f30 * 2");
add(L"f32", L"?f0 - ?f30");
add(L"f33", L"?f0 + ?f31");
add(L"f34", L"?f0 - ?f31");
add(L"f35", L"?f9 / 4");
add(L"f36", L"?f7 / 4");
add(L"f37", L"?f32 + ?f1");
add(L"f38", L"?f37 * ?f12 / ?f0");
add(L"f39", L"0 - ?f38");
add(L"f40", L"sin(?f39)");
add(L"f41", L"0 - ?f40");
add(L"f42", L"?f41 * ?f7");
add(L"f43", L"cos(?f39)");
add(L"f44", L"0 - ?f43");
add(L"f45", L"?f44 * ?f9");
add(L"f46", L"sqrt(?f42 * ?f42 + ?f45 * ?f45 + 0 * 0)");
add(L"f47", L"?f9 * ?f7 / ?f46");
add(L"f48", L"?f41 * ?f47");
add(L"f49", L"?f44 * ?f47");
add(L"f50", L"?f10 + ?f48");
add(L"f51", L"?f7 + ?f49");
add(L"f52", L"?f30 + ?f1");
add(L"f53", L"?f52 * ?f12 / ?f0");
add(L"f54", L"0 - ?f53");
add(L"f55", L"sin(?f54)");
add(L"f56", L"0 - ?f55");
add(L"f57", L"?f56 * ?f36");
add(L"f58", L"cos(?f54)");
add(L"f59", L"0 - ?f58");
add(L"f60", L"?f59 * ?f35");
add(L"f61", L"sqrt(?f57 * ?f57 + ?f60 * ?f60 + 0 * 0)");
add(L"f62", L"?f35 * ?f36 / ?f61");
add(L"f63", L"?f56 * ?f62");
add(L"f64", L"?f59 * ?f62");
add(L"f65", L"?f10 + ?f63");
add(L"f66", L"?f5 - ?f36");
add(L"f67", L"?f66 + ?f64");
add(L"f68", L"?f9 - ?f14");
add(L"f69", L"21550000 - ?f33");
add(L"f70", L"if(?f69, ?f33, 21550000)");
add(L"f71", L"-21550000 - ?f70");
add(L"f72", L"if(?f71, -21550000, ?f70)");
add(L"f73", L"?f32 + ?f72");
add(L"f74", L"sqrt(?f45 * ?f45 + ?f42 * ?f42 + 0 * 0)");
add(L"f75", L"?f9 * ?f7 / ?f74");
add(L"f76", L"?f41 * ?f75");
add(L"f77", L"?f50 - ?f76");
add(L"f78", L"?f44 * ?f75");
add(L"f79", L"?f51 - ?f78");
add(L"f80", L"?f77 - ?f9");
add(L"f81", L"?f79 - ?f7");
add(L"f82", L"?f77 + ?f9");
add(L"f83", L"?f79 + ?f7");
add(L"f84", L"?f73 + ?f1");
add(L"f85", L"?f84 * ?f12 / ?f0");
add(L"f86", L"0 - ?f85");
add(L"f87", L"cos(?f86)");
add(L"f88", L"0 - ?f87");
add(L"f89", L"?f88 * ?f9");
add(L"f90", L"sin(?f86)");
add(L"f91", L"0 - ?f90");
add(L"f92", L"?f91 * ?f7");
add(L"f93", L"sqrt(?f89 * ?f89 + ?f92 * ?f92 + 0 * 0)");
add(L"f94", L"?f9 * ?f7 / ?f93");
add(L"f95", L"?f91 * ?f94");
add(L"f96", L"?f77 + ?f95");
add(L"f97", L"?f88 * ?f94");
add(L"f98", L"?f79 + ?f97");
add(L"f99", L"if(?f72, ?f50, ?f80)");
add(L"f100", L"if(?f72, ?f51, ?f81)");
add(L"f101", L"if(?f72, ?f50, ?f82)");
add(L"f102", L"if(?f72, ?f51, ?f83)");
add(L"f103", L"if(?f72, ?f80, ?f96)");
add(L"f104", L"if(?f72, ?f81, ?f98)");
add(L"f105", L"if(?f72, ?f82, ?f96)");
add(L"f106", L"if(?f72, ?f83, ?f98)");
add(L"f107", L"21550000 - ?f34");
add(L"f108", L"if(?f107, ?f34, 21550000)");
add(L"f109", L"-21550000 - ?f108");
add(L"f110", L"if(?f109, -21550000, ?f108)");
add(L"f111", L"?f30 + ?f110");
add(L"f112", L"sqrt(?f60 * ?f60 + ?f57 * ?f57 + 0 * 0)");
add(L"f113", L"?f35 * ?f36 / ?f112");
add(L"f114", L"?f56 * ?f113");
add(L"f115", L"?f65 - ?f114");
add(L"f116", L"?f59 * ?f113");
add(L"f117", L"?f67 - ?f116");
add(L"f118", L"?f115 - ?f35");
add(L"f119", L"?f117 - ?f36");
add(L"f120", L"?f115 + ?f35");
add(L"f121", L"?f117 + ?f36");
add(L"f122", L"?f111 + ?f1");
add(L"f123", L"?f122 * ?f12 / ?f0");
add(L"f124", L"0 - ?f123");
add(L"f125", L"cos(?f124)");
add(L"f126", L"0 - ?f125");
add(L"f127", L"?f126 * ?f35");
add(L"f128", L"sin(?f124)");
add(L"f129", L"0 - ?f128");
add(L"f130", L"?f129 * ?f36");
add(L"f131", L"sqrt(?f127 * ?f127 + ?f130 * ?f130 + 0 * 0)");
add(L"f132", L"?f35 * ?f36 / ?f131");
add(L"f133", L"?f129 * ?f132");
add(L"f134", L"?f115 + ?f133");
add(L"f135", L"?f126 * ?f132");
add(L"f136", L"?f117 + ?f135");
add(L"f137", L"if(?f110, ?f65, ?f118)");
add(L"f138", L"if(?f110, ?f67, ?f119)");
add(L"f139", L"if(?f110, ?f65, ?f120)");
add(L"f140", L"if(?f110, ?f67, ?f121)");
add(L"f141", L"if(?f110, ?f118, ?f134)");
add(L"f142", L"if(?f110, ?f119, ?f136)");
add(L"f143", L"if(?f110, ?f120, ?f134)");
add(L"f144", L"if(?f110, ?f121, ?f136)");
add(L"f145", L"21550000 - -21600000");
add(L"f146", L"if(?f145, -21600000, 21550000)");
add(L"f147", L"-21550000 - ?f146");
add(L"f148", L"if(?f147, -21550000, ?f146)");
add(L"f149", L"?f0 + ?f148");
add(L"f150", L"?f0 + ?f1");
add(L"f151", L"?f150 * ?f12 / ?f0");
add(L"f152", L"0 - ?f151");
add(L"f153", L"cos(?f152)");
add(L"f154", L"0 - ?f153");
add(L"f155", L"?f154 * ?f14");
add(L"f156", L"sin(?f152)");
add(L"f157", L"0 - ?f156");
add(L"f158", L"?f157 * ?f15");
add(L"f159", L"sqrt(?f155 * ?f155 + ?f158 * ?f158 + 0 * 0)");
add(L"f160", L"?f14 * ?f15 / ?f159");
add(L"f161", L"?f157 * ?f160");
add(L"f162", L"?f68 - ?f161");
add(L"f163", L"?f154 * ?f160");
add(L"f164", L"?f7 - ?f163");
add(L"f165", L"?f162 - ?f14");
add(L"f166", L"?f164 - ?f15");
add(L"f167", L"?f162 + ?f14");
add(L"f168", L"?f164 + ?f15");
add(L"f169", L"?f149 + ?f1");
add(L"f170", L"?f169 * ?f12 / ?f0");
add(L"f171", L"0 - ?f170");
add(L"f172", L"cos(?f171)");
add(L"f173", L"0 - ?f172");
add(L"f174", L"?f173 * ?f14");
add(L"f175", L"sin(?f171)");
add(L"f176", L"0 - ?f175");
add(L"f177", L"?f176 * ?f15");
add(L"f178", L"sqrt(?f174 * ?f174 + ?f177 * ?f177 + 0 * 0)");
add(L"f179", L"?f14 * ?f15 / ?f178");
add(L"f180", L"?f176 * ?f179");
add(L"f181", L"?f162 + ?f180");
add(L"f182", L"?f173 * ?f179");
add(L"f183", L"?f164 + ?f182");
add(L"f184", L"if(?f148, ?f68, ?f165)");
add(L"f185", L"if(?f148, ?f7, ?f166)");
add(L"f186", L"if(?f148, ?f68, ?f167)");
add(L"f187", L"if(?f148, ?f7, ?f168)");
add(L"f188", L"if(?f148, ?f165, ?f181)");
add(L"f189", L"if(?f148, ?f166, ?f183)");
add(L"f190", L"if(?f148, ?f167, ?f181)");
add(L"f191", L"if(?f148, ?f168, ?f183)");
/////////////////////////////////////////////////////////
}
};
}
......@@ -344,7 +344,7 @@ void odf_chart_context::start_chart(office_element_ptr & root)
std::wstring style_name;
odf_element_state state={chart_elm, style_name, style_elm, level};
odf_chart_level_state level_state = {NULL,NULL,NULL,NULL,chart_elm};
odf_chart_level_state level_state = {NULL, NULL, NULL, NULL, chart_elm};
style* style_ = dynamic_cast<style*>(style_elm.get());
if (style_)
......@@ -366,18 +366,18 @@ void odf_chart_context::start_chart(office_element_ptr & root)
impl_->current_chart_state_.elements_.push_back(state);
}
void odf_chart_context::set_chart_size(double width_pt, double height_pt)
void odf_chart_context::set_chart_size(_CP_OPT(double) width_pt, _CP_OPT(double) height_pt)
{
if (width_pt <0.01 || height_pt < 0.01)return;
if (!width_pt && !height_pt) return;
impl_->current_chart_state_.chart_height_pt = height_pt;
impl_->current_chart_state_.chart_width_pt = width_pt;
impl_->current_chart_state_.chart_height_pt = *height_pt;
impl_->current_chart_state_.chart_width_pt = *width_pt;
chart_chart *chart = impl_->get_current_chart();
if (!chart)return;
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_width_ = length(length(width_pt,length::pt).get_value_unit(length::cm),length::cm);
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_height_ = length(length(height_pt,length::pt).get_value_unit(length::cm),length::cm);
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_width_ = length(length(*width_pt,length::pt).get_value_unit(length::cm), length::cm);
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_height_ = length(length(*height_pt,length::pt).get_value_unit(length::cm), length::cm);
}
void odf_chart_context::set_chart_type(std::wstring type)
{
......
......@@ -58,19 +58,19 @@ public:
odf_drawing_context *drawing_context();
odf_text_context *text_context();
void start_chart(office_element_ptr & root);
void set_chart_type(std::wstring type);
void set_chart_3D(bool Val);
void set_chart_size(double width_pt, double height_pt);
void set_chart_colored(bool val);
void set_chart_grouping(int type);
void set_chart_scatter_type(int type);
void set_chart_bar_grouping(int type);
void start_chart (office_element_ptr & root);
void set_chart_type (std::wstring type);
void set_chart_3D (bool Val);
void set_chart_size (_CP_OPT(double) width_pt, _CP_OPT(double) height_pt);
void set_chart_colored (bool val);
void set_chart_grouping (int type);
void set_chart_scatter_type (int type);
void set_chart_bar_grouping (int type);
void set_chart_bar_direction(int type);
void set_chart_bar_type(int type);
void set_chart_bar_type (int type);
void set_chart_bar_gap_width(std::wstring val);
void set_chart_bar_overlap(std::wstring val);
void set_chart_radar_type(int type);
void set_chart_bar_overlap (std::wstring val);
void set_chart_radar_type (int type);
void set_chart_stock_candle_stick(bool val);
void set_marker_size(int size);
......@@ -81,26 +81,26 @@ public:
void start_group_series();
void add_axis_group_series(unsigned int id);
void start_series(std::wstring type);
void set_series_value_formula(std::wstring oox_formula);
void set_series_label_formula(std::wstring oox_formula);
void set_category_axis_formula(std::wstring oox_formula,int type);
void start_data_point_series(int count);
void start_series (std::wstring type);
void set_series_value_formula (std::wstring oox_formula);
void set_series_label_formula (std::wstring oox_formula);
void set_category_axis_formula (std::wstring oox_formula,int type);
void start_data_point_series (int count);
long get_count_data_points_series();
void set_series_pie_explosion(int val);
void end_series();
void end_group_series();
void set_label_name(std::wstring name);
void set_label_delete(bool val);
void set_label_show_bubble_size(bool val);
void set_label_show_cat_name(bool val);
void set_label_show_leader_line(bool val);
void set_label_show_legend_key(bool val);
void set_label_show_percent(bool val);
void set_label_show_ser_name(bool val);
void set_label_show_values(bool val);
void set_label_name (std::wstring name);
void set_label_delete (bool val);
void set_label_show_bubble_size (bool val);
void set_label_show_cat_name (bool val);
void set_label_show_leader_line (bool val);
void set_label_show_legend_key (bool val);
void set_label_show_percent (bool val);
void set_label_show_ser_name( bool val);
void set_label_show_values (bool val);
void start_axis();
void set_axis_id(unsigned int id);
......
......@@ -177,6 +177,8 @@ struct odf_drawing_state
svg_width_ = boost::none;
name_ = L"";
description_ = L"";
hidden_ = false;
z_order_ = -1;
rotateAngle = boost::none;
......@@ -201,9 +203,10 @@ struct odf_drawing_state
_CP_OPT(length) svg_height_;
_CP_OPT(length) svg_width_;
std::wstring name_;
int z_order_;
std::wstring name_;
std::wstring description_;
int z_order_;
bool hidden_;
_CP_OPT(double) rotateAngle;
......@@ -342,10 +345,12 @@ void odf_drawing_context::start_group()
if (group== NULL)return;
//если группа топовая - то данные если не записать - сотруться
if (impl_->current_drawing_state_.name_.length() > 0)
if (!impl_->current_drawing_state_.name_.empty())
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_name_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
if (impl_->current_drawing_state_.z_order_ >= 0)
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_z_index_attlist_.draw_z_index_ = impl_->current_drawing_state_.z_order_;
if (!impl_->current_drawing_state_.name_.empty())
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_name_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
impl_->current_drawing_state_.name_ = L"";
impl_->current_drawing_state_.z_order_ = -1;
......@@ -956,9 +961,9 @@ void odf_drawing_context::end_frame()
/////////////////////
void odf_drawing_context::start_element(office_element_ptr & elm, office_element_ptr style_elm)
{
int level = impl_->current_level_.size();
int level = (int)impl_->current_level_.size();
if (impl_->current_level_.size()>0)
if (impl_->current_level_.size() > 0)
impl_->current_level_.back()->add_child_element(elm);
std::wstring style_name;
......@@ -968,13 +973,13 @@ void odf_drawing_context::start_element(office_element_ptr & elm, office_element
style_name = style_->style_name_;
impl_->current_graphic_properties = style_->style_content_.get_style_graphic_properties();
if (impl_->current_drawing_state_.name_.length() < 1)
if (impl_->current_drawing_state_.name_.empty())
{
impl_->current_drawing_state_.name_ = std::wstring(L"Object_") + style_name;
}
}
odf_element_state state={elm, style_name, style_elm, level};
odf_element_state state = {elm, style_name, style_elm, level};
impl_->current_drawing_state_.elements_.push_back(state);
impl_->current_level_.push_back(elm);
......@@ -1009,10 +1014,18 @@ void odf_drawing_context::end_line_properties()
// impl_->current_drawing_part_ = Unknown;
//}
////////////////////////////////////////////////////////////////////
void odf_drawing_context::set_name(std::wstring name)
void odf_drawing_context::set_name(const std::wstring & name)
{
impl_->current_drawing_state_.name_ = name;
}
void odf_drawing_context::set_description (const std::wstring & description)
{
impl_->current_drawing_state_.description_ = description;
}
void odf_drawing_context::set_hidden (bool bVal)
{
impl_->current_drawing_state_.hidden_ = bVal;
}
void odf_drawing_context::set_opacity(double percent_)
{
if (!impl_->current_graphic_properties)return;
......@@ -1125,7 +1138,7 @@ void odf_drawing_context::set_path(std::wstring path_string)
//boost::replace_all(path_string, L",", L"0"); // нужен разбор
//impl_->current_drawing_state_.path_ = path_string;
}
void odf_drawing_context::add_path_element(std::wstring command, std::wstring & strE)
void odf_drawing_context::add_path_element(std::wstring command, const std::wstring & strE)
{
if (command != impl_->current_drawing_state_.path_last_command_)
{
......@@ -1500,7 +1513,19 @@ void odf_drawing_context::set_position_line(_CP_OPT(double) & x_pt, _CP_OPT(doub
if (y2_pt && !line->draw_line_attlist_.svg_y2_) line->draw_line_attlist_.svg_y2_ = length(length(*y2_pt,length::pt).get_value_unit(length::cm),length::cm);
}
void odf_drawing_context::get_position(_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt)
{
if (impl_->current_drawing_state_.svg_x_ && impl_->current_drawing_state_.svg_y_)
{
x_pt = impl_->current_drawing_state_.svg_x_->get_value_unit(length::pt);
y_pt = impl_->current_drawing_state_.svg_y_->get_value_unit(length::pt);
}
else if (impl_->anchor_settings_.svg_x_ && impl_->anchor_settings_.svg_y_)
{
x_pt = impl_->anchor_settings_.svg_x_->get_value_unit(length::pt);
y_pt = impl_->anchor_settings_.svg_y_->get_value_unit(length::pt);
}
}
void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt)
{
if (x_pt)
......@@ -1516,7 +1541,7 @@ void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) &
}
if (!impl_->current_drawing_state_.svg_x_ || impl_->current_drawing_state_.in_group)
{
impl_->current_drawing_state_.svg_x_ = length(length(x , length::pt).get_value_unit(length::cm),length::cm);
impl_->current_drawing_state_.svg_x_ = length(length(x , length::pt).get_value_unit(length::cm), length::cm);
}
}
......@@ -1538,7 +1563,7 @@ void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) &
}
}
}
void odf_drawing_context::get_size( double & width_pt, double & height_pt)
void odf_drawing_context::get_size( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt)
{
if (impl_->current_drawing_state_.svg_width_ && impl_->current_drawing_state_.svg_height_)
{
......@@ -1550,7 +1575,6 @@ void odf_drawing_context::get_size( double & width_pt, double & height_pt)
width_pt = impl_->anchor_settings_.svg_width_->get_value_unit(length::pt);
height_pt = impl_->anchor_settings_.svg_height_->get_value_unit(length::pt);
}
}
void odf_drawing_context::set_size( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt)
{
......@@ -1840,14 +1864,14 @@ void odf_drawing_context::set_textarea_writing_mode(int mode)
}
void odf_drawing_context::set_textarea_padding(double left,double top, double right,double bottom)//in cm
void odf_drawing_context::set_textarea_padding(_CP_OPT(double) & left, _CP_OPT(double) & top, _CP_OPT(double) & right, _CP_OPT(double) & bottom)//in cm
{
if (!impl_->current_graphic_properties)return;
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_left_ = length(left, length::cm);
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_top_ = length(top, length::cm);
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_right_ = length(right, length::cm);
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_bottom_ = length(bottom,length::cm);
if (left) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_left_ = length(*left, length::cm);
if (top) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_top_ = length(*top, length::cm);
if (right) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_right_ = length(*right,length::cm);
if (bottom) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_bottom_ = length(*bottom,length::cm);
}
......
......@@ -142,7 +142,7 @@ public:
bool is_exist_content();
//////////////////////////////////////////////////////////////////////////////////////
void set_path (std::wstring path_string);
void add_path_element (std::wstring command, std::wstring & elm);
void add_path_element (std::wstring command, const std::wstring & elm);
void add_modifier (std::wstring modifier);
void set_viewBox (double W, double H);
......@@ -151,14 +151,17 @@ public:
///////////////////////////////////////////////////////////////////////////////////////
void set_size ( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt);
void get_position (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt);
void set_position (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt);
void set_position_line (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt, _CP_OPT(double) & x1_pt, _CP_OPT(double) & y1_pt);
void get_size ( double & width_pt, double & height_pt);
void get_size ( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt);
void set_size ( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt);
void set_name (std::wstring name);
void set_name (const std::wstring & name);
void set_description (const std::wstring & descr);
void set_hidden (bool bVal);
void set_z_order (int id);
void set_flip_H (bool bVal);
......@@ -191,7 +194,7 @@ public:
void set_text (odf_text_context* text_context);
void set_textarea_vertical_align(int align);
void set_textarea_padding (double left,double top,double right,double bottom);//in cm
void set_textarea_padding (_CP_OPT(double) & left, _CP_OPT(double) & top, _CP_OPT(double) & right, _CP_OPT(double) & bottom);//in cm
void set_textarea_writing_mode (int mode);
void set_textarea_wrap (bool val);
void set_textarea_fontcolor (std::wstring hexColor);
......
......@@ -54,26 +54,31 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
{
switch (ooxPrstGeomType)
{
case SimpleTypes::shapetypeMathMultiply: return boost::make_shared<oox_shape_mathMultiply>();
case SimpleTypes::shapetypeSun: return boost::make_shared<oox_shape_sun>();
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>();
case SimpleTypes::shapetypeSnip1Rect: return boost::make_shared<oox_shape_snip1Rect>();
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::shapetypeCurvedLeftArrow: return boost::make_shared<oox_shape_curvedLeftArrow>();
case SimpleTypes::shapetypeCurvedDownArrow: return boost::make_shared<oox_shape_curvedDownArrow>();
case SimpleTypes::shapetypeMathMultiply: return boost::make_shared<oox_shape_mathMultiply>();
case SimpleTypes::shapetypeSun: return boost::make_shared<oox_shape_sun>();
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>();
case SimpleTypes::shapetypeSnip1Rect: return boost::make_shared<oox_shape_snip1Rect>();
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::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::shapetypeLeftCircularArrow: return boost::make_shared<oox_shape_LeftCircularArrow>();
case SimpleTypes::shapetypePlaque: return boost::make_shared<oox_shape_Plaque>();
case SimpleTypes::shapetypeDoubleWave: return boost::make_shared<oox_shape_DoubleWave>();
case SimpleTypes::shapetypePlaque: return boost::make_shared<oox_shape_Plaque>();
case SimpleTypes::shapetypeDoubleWave: return boost::make_shared<oox_shape_DoubleWave>();
//case (2001 + SimpleTypes::textshapetypeTextArchDown):
......
......@@ -36,10 +36,19 @@
#include "../../../Common/DocxFormat/Source/Common/SimpleTypes_Drawing.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h"
#include "../OdfFormat/odf_conversion_context.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SrgbClr.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Colors/PrstClr.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.h"
#include "../../../Common/DocxFormat/Source/Common/SimpleTypes_Word.h"
#include "../OdfFormat/odf_conversion_context.h"
#include "../OdfFormat/odf_text_context.h"
#include "../OdfFormat/odf_drawing_context.h"
#include "../OdfFormat/style_text_properties.h"
#include "../OdfFormat/style_paragraph_properties.h"
#define ARGB(a, r, g, b) ((unsigned int)( ( (unsigned char)(a) )| ( ( (unsigned char)(r) ) << 8 ) | ( ( (unsigned char)(g) ) << 16 ) | ( (unsigned char)(b) << 24 ) ) )
using namespace cpdoccore;
......@@ -53,16 +62,10 @@ void OoxConverter::convert(PPTX::Logic::SpTree *oox_shape_tree)
{
if (oox_shape_tree == NULL) return;
odf_context()->drawing_context()->start_group();
cpdoccore::_CP_OPT(double) x, y , ch_x , ch_y ;
odf_context()->drawing_context()->set_group_position(x, y, ch_x, ch_y);
for (long i=0 ;i < oox_shape_tree->SpTreeElems.size(); i++)
for (size_t i = 0; i < oox_shape_tree->SpTreeElems.size(); i++)
{
convert(oox_shape_tree->SpTreeElems[i].GetElem().operator->());
}
odf_context()->drawing_context()->end_group();
}
void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
......@@ -103,7 +106,7 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
{
odf_context()->start_text_context();
for (long i=0 ; i < oox_shape->txBody->Paragrs.size();i++)
for (size_t i = 0; i < oox_shape->txBody->Paragrs.size();i++)
{
convert(&oox_shape->txBody->Paragrs[i]);
}
......@@ -129,7 +132,6 @@ void OoxConverter::convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle*
{
if (oox_spPr == NULL) return;
bool use_fill_from_style = false;
bool use_line_from_style = false;
if (oox_spPr->xfrm.IsInit()) //CTransform2D
......@@ -162,23 +164,7 @@ void OoxConverter::convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle*
odf_context()->drawing_context()->start_area_properties();
{
PPTX::Logic::NoFill* noFill = &oox_spPr->Fill.as<PPTX::Logic::NoFill>();
PPTX::Logic::BlipFill* blipFill = &oox_spPr->Fill.as<PPTX::Logic::BlipFill>();
PPTX::Logic::GradFill* gradFill = &oox_spPr->Fill.as<PPTX::Logic::GradFill>();
PPTX::Logic::SolidFill* solidFill = &oox_spPr->Fill.as<PPTX::Logic::SolidFill>();
PPTX::Logic::PattFill* pattFill = &oox_spPr->Fill.as<PPTX::Logic::PattFill>();
if (solidFill) convert(solidFill);
else if (blipFill) convert(blipFill);
else if (gradFill) convert(gradFill);
else if (pattFill) convert(pattFill);
else if (noFill) odf_context()->drawing_context()->set_no_fill();
else use_fill_from_style = true;
if ( use_fill_from_style && oox_sp_style )
{
convert(&oox_sp_style->fillRef);
}
convert(&oox_spPr->Fill, oox_sp_style);
}
odf_context()->drawing_context()->end_area_properties();
......@@ -207,6 +193,32 @@ void OoxConverter::convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle*
//nullable<OOX::Drawing::CShape3D> Sp3D;
//-----------------------------------------------------------------------------------------------------------------------------
}
void OoxConverter::convert(PPTX::Logic::UniFill *oox_fill, PPTX::Logic::ShapeStyle* oox_sp_style)
{
if (oox_fill == NULL) return;
bool use_fill_from_style = false;
PPTX::Logic::NoFill* noFill = &oox_fill->as<PPTX::Logic::NoFill>();
PPTX::Logic::BlipFill* blipFill = &oox_fill->as<PPTX::Logic::BlipFill>();
PPTX::Logic::GradFill* gradFill = &oox_fill->as<PPTX::Logic::GradFill>();
PPTX::Logic::SolidFill* solidFill = &oox_fill->as<PPTX::Logic::SolidFill>();
PPTX::Logic::PattFill* pattFill = &oox_fill->as<PPTX::Logic::PattFill>();
if (solidFill) convert(solidFill);
else if (blipFill) convert(blipFill);
else if (gradFill) convert(gradFill);
else if (pattFill) convert(pattFill);
else if (noFill) odf_context()->drawing_context()->set_no_fill();
else use_fill_from_style = true;
if ( use_fill_from_style && oox_sp_style )
{
convert(&oox_sp_style->fillRef);
}
}
int OoxConverter::convert(PPTX::Logic::PrstTxWarp *oox_text_preset)
{
if (oox_text_preset == NULL) return -1;
......@@ -214,4 +226,619 @@ int OoxConverter::convert(PPTX::Logic::PrstTxWarp *oox_text_preset)
return 2001 + oox_text_preset->prst.GetBYTECode();
}
void OoxConverter::convert(PPTX::Logic::PrstGeom *oox_geom)
{
if (!oox_geom) return;
for (size_t i = 0; i < oox_geom->avLst.size(); i++)
{
if (oox_geom->avLst[i].fmla.IsInit())
odf_context()->drawing_context()->add_modifier(oox_geom->avLst[i].fmla.get());
}
}
void OoxConverter::convert(PPTX::Logic::CustGeom *oox_cust_geom)
{
if (!oox_cust_geom) return;
for (size_t i = 0; i < oox_cust_geom->pathLst.size(); i++)
{
convert(&oox_cust_geom->pathLst[i]);
}
}
void OoxConverter::convert(PPTX::Logic::Path2D *oox_geom_path)
{
if (!oox_geom_path) return;
odf_context()->drawing_context()->set_viewBox(oox_geom_path->w.get_value_or(0), oox_geom_path->h.get_value_or(0));
for (size_t i = 0 ; i < oox_geom_path->Paths.size(); i++)
{
PPTX::Logic::PathBase* pathBase = &oox_geom_path->Paths[i].Path2D.as<PPTX::Logic::PathBase>();
convert(pathBase);
}
odf_context()->drawing_context()->add_path_element(std::wstring(L"N"), L"");
}
void OoxConverter::convert(PPTX::Logic::PathBase *oox_path)
{
if (!oox_path) return;
PPTX::Logic::MoveTo* moveTo = static_cast<PPTX::Logic::MoveTo*> (oox_path);
PPTX::Logic::LineTo* lineTo = static_cast<PPTX::Logic::LineTo*> (oox_path);
PPTX::Logic::CubicBezTo* cubicBezTo = static_cast<PPTX::Logic::CubicBezTo*> (oox_path);
PPTX::Logic::Close* close = static_cast<PPTX::Logic::Close*> (oox_path);
PPTX::Logic::ArcTo* arcTo = static_cast<PPTX::Logic::ArcTo*> (oox_path);
PPTX::Logic::QuadBezTo* quadBezTo = static_cast<PPTX::Logic::QuadBezTo*> (oox_path);
if (moveTo)
{
std::wstring path_elm = moveTo->x + L" " + moveTo->y;
odf_context()->drawing_context()->add_path_element(std::wstring(L"M"), path_elm);
}
if (lineTo)
{
std::wstring path_elm = lineTo->x + L" " + lineTo->y;
odf_context()->drawing_context()->add_path_element(std::wstring(L"L"), path_elm);
}
if (cubicBezTo)
{
std::wstring path_elm = cubicBezTo->x1 + L" " + cubicBezTo->y1 + L" " +
cubicBezTo->x2 + L" " + cubicBezTo->y2 + L" " +
cubicBezTo->x3 + L" " + cubicBezTo->y3;
odf_context()->drawing_context()->add_path_element(std::wstring(L"C"), path_elm);
}
if (quadBezTo)
{
std::wstring path_elm = quadBezTo->x1 + L" " + quadBezTo->y1 + L" " +
quadBezTo->x2 + L" " + quadBezTo->y2;
odf_context()->drawing_context()->add_path_element(std::wstring(L"S"), path_elm);
}
if (arcTo)
{
}
if (close)
{
std::wstring path_elm ;
odf_context()->drawing_context()->add_path_element(std::wstring(L"Z"), path_elm);
}
}
void OoxConverter::convert(PPTX::Logic::BlipFill *oox_fill)
{
if (!oox_fill) return;
}
void OoxConverter::convert(PPTX::Logic::GradFill *oox_grad_fill)
{
if (!oox_grad_fill) return;
odf_context()->drawing_context()->start_gradient_style();
{
odf_types::gradient_style::type grad_style = odf_types::gradient_style::linear;
if ( (oox_grad_fill->lin.IsInit()) && (oox_grad_fill->lin->ang.IsInit()))
{
odf_context()->drawing_context()->set_gradient_angle(oox_grad_fill->lin->ang.get()/60000.);
}
if ( (oox_grad_fill->path.IsInit()) && (oox_grad_fill->path->path.IsInit()))
{
grad_style = odf_types::gradient_style::linear;
switch(oox_grad_fill->path->path->GetBYTECode())
{
case SimpleTypes::pathshadetypeCircle: grad_style = odf_types::gradient_style::radial; break;
case SimpleTypes::pathshadetypeRect: grad_style = odf_types::gradient_style::rectangular; break;
case SimpleTypes::pathshadetypeShape: grad_style = odf_types::gradient_style::square; break;
}
if (oox_grad_fill->path->rect.IsInit())
{
odf_context()->drawing_context()->set_gradient_rect( XmlUtils::GetInteger(oox_grad_fill->path->rect->l.get_value_or(L"")),
XmlUtils::GetInteger(oox_grad_fill->path->rect->t.get_value_or(L"")),
XmlUtils::GetInteger(oox_grad_fill->path->rect->r.get_value_or(L"")),
XmlUtils::GetInteger(oox_grad_fill->path->rect->b.get_value_or(L"")));
}
}
odf_context()->drawing_context()->set_gradient_type(grad_style);
if (oox_grad_fill->GsLst.size() > 1)
{
std::wstring hexColorStart, hexColorEnd;
_CP_OPT(double) opacityStart, opacityEnd;
convert(&oox_grad_fill->GsLst[0].color,hexColorEnd, opacityEnd);
convert(&oox_grad_fill->GsLst[oox_grad_fill->GsLst.size()-1].color,hexColorStart, opacityStart);
odf_context()->drawing_context()->set_gradient_start(hexColorStart, opacityStart);
odf_context()->drawing_context()->set_gradient_end (hexColorEnd, opacityEnd);
if (opacityStart || opacityEnd)
{
if (!opacityStart) opacityStart = 100;
if (!opacityEnd) opacityEnd = 100;
if (*opacityStart == *opacityEnd)
{
odf_context()->drawing_context()->set_opacity(*opacityStart);
}
else
{
odf_context()->drawing_context()->start_opacity_style();
odf_context()->drawing_context()->set_opacity_type (grad_style);
odf_context()->drawing_context()->set_opacity_start (*opacityStart);
odf_context()->drawing_context()->set_opacity_end (*opacityEnd);
if (grad_style == odf_types::gradient_style::linear)
{
odf_context()->drawing_context()->set_opacity_angle(oox_grad_fill->lin->ang.get()/60000.);
}
else
{
odf_context()->drawing_context()->set_opacity_rect ( XmlUtils::GetInteger(oox_grad_fill->path->rect->l.get_value_or(L"")),
XmlUtils::GetInteger(oox_grad_fill->path->rect->t.get_value_or(L"")),
XmlUtils::GetInteger(oox_grad_fill->path->rect->r.get_value_or(L"")),
XmlUtils::GetInteger(oox_grad_fill->path->rect->b.get_value_or(L"")));
}
odf_context()->drawing_context()->end_opacity_style();
}
}
}
}
odf_context()->drawing_context()->end_gradient_style();
}
void OoxConverter::convert(PPTX::Logic::UniColor * color, std::wstring & hexString, _CP_OPT(double) & opacity)
{
if (!color) return;
PPTX::Logic::SrgbClr *rgb = &color->as<PPTX::Logic::SrgbClr>();
PPTX::Logic::SchemeClr *scheme = &color->as<PPTX::Logic::SchemeClr>();
if (scheme)
{
int theme_ind = scheme->val.GetBYTECode();
BYTE ucA = 0, ucG = 0, ucB = 0, ucR = 0;
bool result = convert(theme_ind, ucA, ucG, ucB, ucR);
if (result == true)
{
scheme->SetRGB(ucR, ucG, ucB);
DWORD dwColor = scheme->ApplyModifiers(PPTX::Logic::ColorBase::ctARGB);
hexString = XmlUtils::IntToString(dwColor & 0x00FFFFFF, L"#%06X");
if ((dwColor >> 24) != 0xff)
{
opacity = ((dwColor >> 24) /255.) * 100.;
}
}
}
if (rgb)
{
}
}
void OoxConverter::convert(PPTX::Logic::SolidFill *oox_fill)
{
if (!oox_fill) return;
std::wstring hexString;
_CP_OPT(double) opacity;
convert(&oox_fill->Color, hexString, opacity);
odf_context()->drawing_context()->set_solid_fill(hexString);
if (opacity)
{
odf_context()->drawing_context()->set_opacity(*opacity);
}
}
void OoxConverter::convert(PPTX::Logic::PattFill *oox_fill)
{
if (!oox_fill) return;
}
void OoxConverter::convert(PPTX::Logic::EffectLst *oox_effect_lst)
{
if (!oox_effect_lst) return;
}
void OoxConverter::convert(PPTX::Logic::Ln *oox_line_prop)
{
if (!oox_line_prop) return;
convert (&oox_line_prop->Fill);
if (oox_line_prop->w.IsInit())
{
odf_context()->drawing_context()->set_line_width(oox_line_prop->w.get() / 12700.); //pt
}
if (oox_line_prop->headEnd.IsInit())
{
if (oox_line_prop->headEnd->len.IsInit() || oox_line_prop->headEnd->type.IsInit() || oox_line_prop->headEnd->w.IsInit())
{
int type = 0, w=1, len =1;//medium arrow
if (oox_line_prop->headEnd->len.IsInit()) len = oox_line_prop->headEnd->len->GetBYTECode();
if (oox_line_prop->headEnd->type.IsInit()) type = oox_line_prop->headEnd->type->GetBYTECode();
if (oox_line_prop->headEnd->w.IsInit()) w = oox_line_prop->headEnd->w->GetBYTECode();
odf_context()->drawing_context()->set_line_head(type, len, w);
}
}
if (oox_line_prop->tailEnd.IsInit())
{
if (oox_line_prop->tailEnd->len.IsInit() || oox_line_prop->tailEnd->type.IsInit() || oox_line_prop->tailEnd->w.IsInit())
{
int type =0, w=1, len =1;//medium arrow
if (oox_line_prop->tailEnd->len.IsInit()) len = oox_line_prop->tailEnd->len->GetBYTECode();
if (oox_line_prop->tailEnd->type.IsInit()) type = oox_line_prop->tailEnd->type->GetBYTECode();
if (oox_line_prop->tailEnd->w.IsInit()) w = oox_line_prop->tailEnd->w->GetBYTECode();
odf_context()->drawing_context()->set_line_tail(type, len, w);
}
}
//if (oox_line_prop->custDash.IsInit())
//{
// //через задание стиля и описание геометрии
//}
if (oox_line_prop->prstDash.IsInit() && oox_line_prop->prstDash->val.IsInit())
{
odf_context()->drawing_context()->set_line_dash_preset(oox_line_prop->prstDash->val->GetBYTECode());
}
//nullable<SimpleTypes::CPenAlignment<>> m_oAlgn;
//nullable<SimpleTypes::CLineCap<>> m_oCap;
//nullable<SimpleTypes::CCompoundLine<>> m_oCmpd;
//ELineJoinType m_eJoinType; // Тип соединения линий
//nullable<OOX::Drawing::CLineJoinBevel> m_oBevel;
//nullable<OOX::Drawing::CLineJoinMiterProperties> m_oMiter;
//nullable<OOX::Drawing::CLineJoinRound> m_oRound;
}
void OoxConverter::convert(PPTX::Logic::BodyPr *oox_bodyPr)
{
if (!oox_bodyPr) return;
if (oox_bodyPr->vert.IsInit())
{
odf_context()->drawing_context()->set_textarea_writing_mode (oox_bodyPr->vert->GetBYTECode());
}
if (oox_bodyPr->anchor.IsInit())
{
odf_context()->drawing_context()->set_textarea_vertical_align (oox_bodyPr->anchor->GetBYTECode());
}
_CP_OPT(double) lIns, tIns, rIns, bIns;
if (oox_bodyPr->lIns.IsInit()) lIns = oox_bodyPr->lIns.get() / 12700. / 28.34467120181406; //cm
if (oox_bodyPr->tIns.IsInit()) tIns = oox_bodyPr->tIns.get() / 12700. / 28.34467120181406;
if (oox_bodyPr->rIns.IsInit()) rIns = oox_bodyPr->rIns.get() / 12700. / 28.34467120181406;
if (oox_bodyPr->bIns.IsInit()) bIns = oox_bodyPr->bIns.get() / 12700. / 28.34467120181406;
odf_context()->drawing_context()->set_textarea_padding (lIns, tIns, rIns, bIns);
if (oox_bodyPr->wrap.IsInit())
odf_context()->drawing_context()->set_textarea_wrap(oox_bodyPr->wrap->GetBYTECode());
if ((oox_bodyPr->numCol.IsInit()) && (oox_bodyPr->numCol.get() > 1))
{
//+ style section
//+element text:section в котором параграфы
}
//if (oox_bodyPr->spAutoFit.IsInit())
//{
// //изменяемы размеры
// odf_context()->drawing_context()->set_text_box_min_size(true);//уже выставленые в min
//}
if (oox_bodyPr->fromWordArt.IsInit() && oox_bodyPr->prstTxWarp.IsInit())
{
for (size_t i = 0; i < oox_bodyPr->prstTxWarp->avLst.size(); i++)
{
if (oox_bodyPr->prstTxWarp->avLst[i].fmla.IsInit())
{
odf_context()->drawing_context()->add_modifier(oox_bodyPr->prstTxWarp->avLst[i].fmla.get());
}
}
}
}
void OoxConverter::convert(PPTX::Logic::NvSpPr *oox_nvSpPr)
{
if (!oox_nvSpPr) return;
convert (&oox_nvSpPr->cNvPr);
convert (&oox_nvSpPr->cNvSpPr);
convert (&oox_nvSpPr->nvPr);
}
void OoxConverter::convert(PPTX::Logic::CNvPr *oox_cnvPr)
{
if (!oox_cnvPr) return;
odf_context()->drawing_context()->set_name(oox_cnvPr->name);
if (oox_cnvPr->descr.IsInit())
{
odf_context()->drawing_context()->set_description(oox_cnvPr->descr.get());
}
if (oox_cnvPr->hidden.IsInit())
{
odf_context()->drawing_context()->set_hidden(oox_cnvPr->hidden.get());
}
if (oox_cnvPr->hlinkClick.IsInit())
{
}
//nullable_string title;
//nullable<Hyperlink> hlinkHover;
}
void OoxConverter::convert(PPTX::Logic::CNvSpPr *oox_cnvSpPr)
{
if (!oox_cnvSpPr) return;
}
void OoxConverter::convert(PPTX::Logic::NvPr *oox_nvPr)
{
if (!oox_nvPr) return;
}
void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph)
{
if (!oox_paragraph)return;
bool styled = false;
if (oox_paragraph->pPr.IsInit())
{
odf_writer::style_paragraph_properties * paragraph_properties = odf_context()->text_context()->get_paragraph_properties();
//свойства могут быть приписаны не только к параграфу, но и к самому объекту
if (!paragraph_properties)
{
odf_context()->styles_context()->create_style(L"",odf_types::style_family::Paragraph, true, false, -1);
paragraph_properties = odf_context()->styles_context()->last_state()->get_paragraph_properties();
styled = true;
}
convert(oox_paragraph->pPr.GetPointer(), paragraph_properties);
}
odf_context()->text_context()->start_paragraph(styled);
for (size_t i=0; i< oox_paragraph->RunElems.size();i++)
{
convert(&oox_paragraph->RunElems[i].as<OOX::WritingElement>());
}
odf_context()->text_context()->end_paragraph();
}
void OoxConverter::convert(PPTX::Logic::TextParagraphPr *oox_paragraph_pr, odf_writer::style_paragraph_properties * paragraph_properties)
{
if (!oox_paragraph_pr) return;
if (!paragraph_properties) return;
if (oox_paragraph_pr->lnSpc.IsInit())
{
odf_types::length_or_percent length;
convert(oox_paragraph_pr->lnSpc.GetPointer(), length);
paragraph_properties->content().fo_line_height_ = odf_types::line_width(length);
}
if (oox_paragraph_pr->spcAft.IsInit())
{
odf_types::length_or_percent length;
convert(oox_paragraph_pr->spcAft.GetPointer(), length);
paragraph_properties->content().fo_margin_bottom_ = length;
}
if (oox_paragraph_pr->spcBef.IsInit())
{
odf_types::length_or_percent length;
convert(oox_paragraph_pr->spcBef.GetPointer(), length);
paragraph_properties->content().fo_margin_top_ = length;
}
if (oox_paragraph_pr->algn.IsInit())
{
switch(oox_paragraph_pr->algn->GetBYTECode())
{
case 0 : paragraph_properties->content().fo_text_align_ = odf_types::text_align(odf_types::text_align::Center); break;
case 1 :
case 2 :
case 3 : paragraph_properties->content().fo_text_align_ = odf_types::text_align(odf_types::text_align::Justify); break;
case 5 : paragraph_properties->content().fo_text_align_ = odf_types::text_align(odf_types::text_align::Right); break;
case 4 :
default:
paragraph_properties->content().fo_text_align_ = odf_types::text_align(odf_types::text_align::Left); break;
}
}
if (oox_paragraph_pr->marL.IsInit())
{
paragraph_properties->content().fo_margin_left_ = odf_types::length_or_percent(odf_types::length(oox_paragraph_pr->marL.get() / 12700., odf_types::length::pt));
}
if (oox_paragraph_pr->marR.IsInit())
{
paragraph_properties->content().fo_margin_right_ = odf_types::length_or_percent(odf_types::length(oox_paragraph_pr->marR.get() / 12700., odf_types::length::pt));
}
if (oox_paragraph_pr->indent.IsInit())
{
paragraph_properties->content().fo_text_indent_ = odf_types::length_or_percent(odf_types::length(oox_paragraph_pr->indent.get() / 12700., odf_types::length::pt));
}
if (oox_paragraph_pr->rtl.IsInit())
{
}
//nullable<SimpleTypes::CDecimalNumber<> > m_oLvl;
//nullable<SimpleTypes::CCoordinate32<> > m_oDefTabSz;
//nullable<SimpleTypes::CTextFontAlignType<>> m_oFontAlgn;
if (oox_paragraph_pr->defRPr.IsInit())//может быть пустым !!!
{
odf_writer::style_text_properties * text_properties = odf_context()->text_context()->get_text_properties();
if (text_properties)
convert(oox_paragraph_pr->defRPr.GetPointer(), text_properties);
//надо подумать как брать последний по family !!!
//convert(oox_paragraph_pr->m_oDefRunProperty.GetPointer());
//odf_context()->text_context()->set_parent_span_style(odf_context()->styles_context()->last_state().get_name());
}
}
void OoxConverter::convert(PPTX::Logic::TextSpacing *oox_spacing, cpdoccore::odf_types::length_or_percent & length_or_percent)
{
if (!oox_spacing) return;
if ( oox_spacing->spcPct.IsInit() )
{
odf_types::percent percent = odf_types::percent(oox_spacing->GetVal());
length_or_percent = odf_types::length_or_percent(percent);
}
if ( oox_spacing->spcPts.IsInit() )
{
odf_types::length length = odf_types::length(oox_spacing->GetVal() / 12700., odf_types::length::pt);
length_or_percent = odf_types::length_or_percent(length);
}}
void OoxConverter::convert(PPTX::Logic::RunProperties *oox_run_pr, odf_writer::style_text_properties * text_properties)
{
if (!oox_run_pr) return;
if (!text_properties) return;
if (oox_run_pr->b.IsInit())
{
if (oox_run_pr->b.get() == true)
text_properties->content().fo_font_weight_ = odf_types::font_weight(odf_types::font_weight::WBold);
else
text_properties->content().fo_font_weight_ = odf_types::font_weight(odf_types::font_weight::WNormal);
}
PPTX::Logic::SolidFill* solidFill = &oox_run_pr->Fill.as<PPTX::Logic::SolidFill>();
if (solidFill)
{
std::wstring hexColor;
_CP_OPT(double) opacity;
convert(&solidFill->Color, hexColor, opacity);
text_properties->content().fo_color_ = odf_types::color(std::wstring(L"#") + hexColor);
}
if (oox_run_pr->i.IsInit())
{
if (oox_run_pr->i.get() ==true)
text_properties->content().fo_font_style_ = odf_types::font_style(odf_types::font_style::Italic);
else
text_properties->content().fo_font_style_ = odf_types::font_style(odf_types::font_style::Normal);
}
if (oox_run_pr->sz.IsInit())
{
convert(oox_run_pr->sz.get()/100., text_properties->content().fo_font_size_);
convert(oox_run_pr->sz.get()/100., text_properties->content().style_font_size_asian_);
convert(oox_run_pr->sz.get()/100., text_properties->content().style_font_size_complex_);
}
if (oox_run_pr->latin.IsInit())
{
if (!oox_run_pr->latin->typeface.empty())
text_properties->content().fo_font_family_ = oox_run_pr->latin->typeface;
else
{
text_properties->content().fo_font_family_ = L"Calibri";//default_font; ????
}
}
if (oox_run_pr->ea.IsInit())
{
if (!oox_run_pr->ea->typeface.empty())
text_properties->content().style_font_family_asian_ = oox_run_pr->ea->typeface;
else
{
}
}
if (oox_run_pr->cs.IsInit())
{
if (!oox_run_pr->cs->typeface.empty())
text_properties->content().style_font_family_complex_ = oox_run_pr->cs->typeface;
else
{
}
}
if (oox_run_pr->lang.IsInit())
{
std::wstring oox_language = oox_run_pr->lang.get(), oox_country;
int res = oox_language.find(L"-");
if (res >= 0)
{
oox_country = oox_language.substr(res);
oox_language = oox_language.substr(0, res);
}
text_properties->content().fo_language_ = oox_language;
if (oox_country.length() > 0)
text_properties->content().fo_country_ = oox_country;
}
if (oox_run_pr->spc.IsInit())
{
text_properties->content().fo_letter_spacing_ = odf_types::letter_spacing(odf_types::length(oox_run_pr->spc.get()/100., odf_types::length::pt));
}
if (oox_run_pr->u.IsInit())
{
text_properties->content().style_text_underline_style_ = odf_types::line_style (odf_types::line_style::Solid);
text_properties->content().style_text_underline_type_ = odf_types::line_type (odf_types::line_type::Single);
switch(oox_run_pr->u->GetBYTECode())
{
case SimpleTypes::underlineNone :
text_properties->content().style_text_underline_type_= odf_types::line_type(odf_types::line_type::None);break;
case SimpleTypes::underlineDash :
case SimpleTypes::underlineDashedHeavy:
text_properties->content().style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Dash);break;
case SimpleTypes::underlineDotDash :
case SimpleTypes::underlineDashDotHeavy:
text_properties->content().style_text_underline_style_ = odf_types::line_style(odf_types::line_style::DotDash);break;
case SimpleTypes::underlineDashLong:
case SimpleTypes::underlineDashLongHeavy:
text_properties->content().style_text_underline_style_ = odf_types::line_style(odf_types::line_style::LongDash);break;
case SimpleTypes::underlineDotDotDash:
case SimpleTypes::underlineDashDotDotHeavy :
text_properties->content().style_text_underline_style_ = odf_types::line_style(odf_types::line_style::DotDotDash);break;
case SimpleTypes::underlineDotted:
case SimpleTypes::underlineDottedHeavy:
text_properties->content().style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Dotted);break;
case SimpleTypes::underlineWave :
case SimpleTypes::underlineWavyHeavy :
text_properties->content().style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Wave);break;
case SimpleTypes::underlineDouble :
case SimpleTypes::underlineThick :
text_properties->content().style_text_underline_type_= odf_types::line_type(odf_types::line_type::Double);break;
case SimpleTypes::underlineWavyDouble :
text_properties->content().style_text_underline_type_= odf_types::line_type(odf_types::line_type::Double);
text_properties->content().style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Wave);break;
}
}
}
void OoxConverter::convert(PPTX::Logic::Run *oox_run)
{
if (!oox_run) return;
bool styled = false;
if (oox_run->rPr.IsInit())
{
odf_writer::style_text_properties * text_properties = odf_context()->text_context()->get_text_properties();
if (!text_properties)
{
odf_context()->styles_context()->create_style(L"", odf_types::style_family::Text, true, false, -1);
text_properties = odf_context()->styles_context()->last_state()->get_text_properties();
styled = true;
}
convert(oox_run->rPr.GetPointer(), text_properties);
}
odf_context()->text_context()->start_span(styled);
odf_context()->text_context()->add_text_content( oox_run->GetText());
odf_context()->text_context()->end_span();
}
void OoxConverter::convert(PPTX::Logic::Fld *oox_fld)
{
if (!oox_fld) return;
}
void OoxConverter::convert(PPTX::Logic::Br *oox_br)
{
if (!oox_br) return;
}
void OoxConverter::convert(PPTX::Logic::MathParaWrapper *oox_math)
{
if (!oox_math) return;
}
}
......@@ -643,10 +643,14 @@ void OoxConverter::convert(OOX::Vml::CTextbox *vml_textbox)
if (vml_textbox->m_oInsetMode.GetValue() == SimpleTypes::insetmodeCustom)
{
odf_context()->drawing_context()->set_textarea_padding(odf_types::length(vml_textbox->m_oInset.GetLeft(0), odf_types::length::pt).get_value_unit(odf_types::length::cm),
odf_types::length(vml_textbox->m_oInset.GetTop(0), odf_types::length::pt).get_value_unit(odf_types::length::cm),
odf_types::length(vml_textbox->m_oInset.GetRight(0), odf_types::length::pt).get_value_unit(odf_types::length::cm),
odf_types::length(vml_textbox->m_oInset.GetBottom(0), odf_types::length::pt).get_value_unit(odf_types::length::cm));
_CP_OPT(double) lIns, tIns, rIns, bIns;
lIns = odf_types::length(vml_textbox->m_oInset.GetLeft(0),odf_types::length::pt).get_value_unit(odf_types::length::cm);
tIns = odf_types::length(vml_textbox->m_oInset.GetTop(0), odf_types::length::pt).get_value_unit(odf_types::length::cm);
rIns = odf_types::length(vml_textbox->m_oInset.GetRight(0), odf_types::length::pt).get_value_unit(odf_types::length::cm);
bIns = odf_types::length(vml_textbox->m_oInset.GetBottom(0), odf_types::length::pt).get_value_unit(odf_types::length::cm);
odf_context()->drawing_context()->set_textarea_padding (lIns, tIns, rIns, bIns);
}
odf_context()->drawing_context()->set_textarea_wrap(true);
......
......@@ -262,13 +262,6 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
{
//бяка
}break;
//et_p_spPr, // <p:spPr>
//et_p_style, // <p:style>
//et_p_groupSpPr, // <p:grpSpPr>
//et_p_NvGrpSpPr,
//et_p_cNvPr,
//et_p_xfrm,
case OOX::et_p_ShapeTree:
{
PPTX::Logic::SpTree *spTree = static_cast<PPTX::Logic::SpTree *>(oox_unknown);
......@@ -280,7 +273,26 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
PPTX::Logic::Shape *shape = static_cast<PPTX::Logic::Shape *>(oox_unknown);
convert(shape);
}break;
case OOX::et_p_r:
{
PPTX::Logic::Run* pRun= static_cast<PPTX::Logic::Run*>(oox_unknown);
convert(pRun);
}break;
case OOX::et_p_fld:
{
PPTX::Logic::Fld* pFld= static_cast<PPTX::Logic::Fld*>(oox_unknown);
convert(pFld);
}break;
case OOX::et_p_br:
{
PPTX::Logic::Br* pBr= static_cast<PPTX::Logic::Br*>(oox_unknown);
convert(pBr);
}break;
case OOX::et_p_MathPara:
{
PPTX::Logic::MathParaWrapper* pMathPara= static_cast<PPTX::Logic::MathParaWrapper*>(oox_unknown);
convert(pMathPara);
}break;
default:
{
_CP_LOG << L"[warning] : no convert element(" << oox_unknown->getType() << L")\n";
......@@ -339,7 +351,7 @@ void OoxConverter::convert(OOX::Drawing::CShape *oox_shape)
odf_context()->start_text_context();
convert(oox_shape->m_oTxSp->m_oTxBody->m_oBodyPr.GetPointer());
for (unsigned int i=0 ; i < oox_shape->m_oTxSp->m_oTxBody->m_arrItems.size();i++)
for (size_t i=0 ; i < oox_shape->m_oTxSp->m_oTxBody->m_arrItems.size();i++)
{
convert(oox_shape->m_oTxSp->m_oTxBody->m_arrItems[i]);
}
......@@ -367,7 +379,7 @@ void OoxConverter::convert(OOX::Drawing::CDiagrammParts *oox_diagramm)
if ((pDiagData) && (pDiagData->m_oExtLst.IsInit()))
{
for (int i = 0 ; i < pDiagData->m_oExtLst->m_arrExt.size(); i++)
for (size_t i = 0 ; i < pDiagData->m_oExtLst->m_arrExt.size(); i++)
{
if ( pDiagData->m_oExtLst->m_arrExt[i]->m_oDataModelExt.IsInit())
{
......@@ -383,12 +395,23 @@ void OoxConverter::convert(OOX::Drawing::CDiagrammParts *oox_diagramm)
if (oFile.is_init() && OOX::FileTypes::DiagDrawing == oFile->type())
{
OOX::CDiagramDrawing * diag_drawing = dynamic_cast<OOX::CDiagramDrawing*>(oFile.operator->());
_CP_OPT(double) x, y, width, height, cx = 0, cy = 0;
odf_context()->drawing_context()->get_size (width, height);
odf_context()->drawing_context()->get_position (x, y);
OOX::CDiagramDrawing * diag_drawing = dynamic_cast<OOX::CDiagramDrawing*>(oFile.operator->());
oox_current_child_document = diag_drawing;
odf_context()->drawing_context()->start_group();
odf_context()->drawing_context()->set_group_size (width, height, width, height);
odf_context()->drawing_context()->set_group_position (x, y, cx, cy);
convert(diag_drawing->m_oShapeTree.GetPointer());
odf_context()->drawing_context()->end_group();
oox_current_child_document = NULL;
}
}
......@@ -408,7 +431,7 @@ void OoxConverter::convert(OOX::Drawing::CLockedCanvas *oox_canvas)
convert(oox_canvas->m_oGroupSpPr.GetPointer());
convert(oox_canvas->m_oSpPr.GetPointer());
for (unsigned int i=0; i < oox_canvas->m_arrItems.size(); i++)
for (size_t i = 0; i < oox_canvas->m_arrItems.size(); i++)
{
convert(oox_canvas->m_arrItems[i]);
}
......@@ -455,7 +478,6 @@ void OoxConverter::convert(OOX::Drawing::CGroupShapeProperties * oox_group_spP
if (oox_group_spPr->m_oXfrm->m_oRot.GetValue() > 0)
odf_context()->drawing_context()->set_group_rotate(oox_group_spPr->m_oXfrm->m_oRot.GetValue());
}
}
void OoxConverter::convert(OOX::Drawing::CFontReference *style_font_ref)
{
......@@ -604,13 +626,13 @@ void OoxConverter::convert(OOX::Drawing::CShapeProperties * oox_spPr, OOX::Dra
}
switch(oox_spPr->m_eGeomType)
{
case OOX::Drawing::geomtypeCustom :
case OOX::Drawing::geomtypeCustom :
if(oox_spPr->m_oCustGeom.IsInit())convert(oox_spPr->m_oCustGeom.GetPointer());break;
case OOX::Drawing::geomtypePreset:
case OOX::Drawing::geomtypePreset:
if(oox_spPr->m_oPrstGeom.IsInit())convert(oox_spPr->m_oPrstGeom.GetPointer());break;
case OOX::Drawing::geomtypeUnknown:
default:
break;
case OOX::Drawing::geomtypeUnknown:
default:
break;
}
odf_context()->drawing_context()->start_area_properties();
{
......@@ -668,16 +690,16 @@ void OoxConverter::convert(OOX::Drawing::CNonVisualDrawingProps * oox_cnvPr)
odf_context()->drawing_context()->set_name(name);
}
//nullable<std::wstring> m_sDescr;
//nullable<SimpleTypes::COnOff<>> m_oHidden;
//nullable<std::wstring> m_sTitle;
//nullable<std::wstring> m_sDescr;
//nullable<SimpleTypes::COnOff<>> m_oHidden;
//nullable<std::wstring> m_sTitle;
}
void OoxConverter::convert(OOX::Drawing::CCustomGeometry2D *oox_cust_geom)
{
if (!oox_cust_geom)return;
for (unsigned int i=0; i< oox_cust_geom->m_oPthLst.m_arrPath.size();i++)
for (size_t i = 0; i < oox_cust_geom->m_oPthLst.m_arrPath.size(); i++)
{
convert(oox_cust_geom->m_oPthLst.m_arrPath[i]);
}
......@@ -704,9 +726,9 @@ void OoxConverter::convert(OOX::Drawing::CLineProperties *oox_line_prop, std::ws
if (oox_line_prop->m_oHeadEnd->m_oLen.IsInit() || oox_line_prop->m_oHeadEnd->m_oType.IsInit() || oox_line_prop->m_oHeadEnd->m_oW.IsInit())
{
int type = 0, w=1, len =1;//medium arrow
if (oox_line_prop->m_oHeadEnd->m_oLen.IsInit()) len = oox_line_prop->m_oHeadEnd->m_oLen->GetValue();
if (oox_line_prop->m_oHeadEnd->m_oType.IsInit()) type = oox_line_prop->m_oHeadEnd->m_oType->GetValue();
if (oox_line_prop->m_oHeadEnd->m_oW.IsInit()) w=oox_line_prop->m_oHeadEnd->m_oW->GetValue();
if (oox_line_prop->m_oHeadEnd->m_oLen.IsInit()) len = oox_line_prop->m_oHeadEnd->m_oLen->GetValue();
if (oox_line_prop->m_oHeadEnd->m_oType.IsInit()) type = oox_line_prop->m_oHeadEnd->m_oType->GetValue();
if (oox_line_prop->m_oHeadEnd->m_oW.IsInit()) w = oox_line_prop->m_oHeadEnd->m_oW->GetValue();
odf_context()->drawing_context()->set_line_head(type, len, w);
}
......@@ -716,9 +738,9 @@ void OoxConverter::convert(OOX::Drawing::CLineProperties *oox_line_prop, std::ws
if (oox_line_prop->m_oTailEnd->m_oLen.IsInit() || oox_line_prop->m_oTailEnd->m_oType.IsInit() || oox_line_prop->m_oTailEnd->m_oW.IsInit())
{
int type =0, w=1, len =1;//medium arrow
if (oox_line_prop->m_oTailEnd->m_oLen.IsInit()) len = oox_line_prop->m_oTailEnd->m_oLen->GetValue();
if (oox_line_prop->m_oTailEnd->m_oType.IsInit()) type = oox_line_prop->m_oTailEnd->m_oType->GetValue();
if (oox_line_prop->m_oTailEnd->m_oW.IsInit()) w = oox_line_prop->m_oTailEnd->m_oW->GetValue();
if (oox_line_prop->m_oTailEnd->m_oLen.IsInit()) len = oox_line_prop->m_oTailEnd->m_oLen->GetValue();
if (oox_line_prop->m_oTailEnd->m_oType.IsInit()) type = oox_line_prop->m_oTailEnd->m_oType->GetValue();
if (oox_line_prop->m_oTailEnd->m_oW.IsInit()) w = oox_line_prop->m_oTailEnd->m_oW->GetValue();
odf_context()->drawing_context()->set_line_tail(type, len, w);
}
......@@ -750,7 +772,7 @@ void OoxConverter::convert(OOX::Drawing::CPresetGeometry2D *oox_prst_geom)
if (oox_prst_geom->m_oAvLst.IsInit())
{
for (unsigned int i=0; i<oox_prst_geom->m_oAvLst->m_arrGd.size(); i++)
for (size_t i = 0; i < oox_prst_geom->m_oAvLst->m_arrGd.size(); i++)
{
if (oox_prst_geom->m_oAvLst->m_arrGd[i] == NULL) continue;
odf_context()->drawing_context()->add_modifier(oox_prst_geom->m_oAvLst->m_arrGd[i]->m_oFmla.GetValue());
......@@ -763,13 +785,12 @@ void OoxConverter::convert(OOX::Drawing::CPath2D *oox_geom_path)
odf_context()->drawing_context()->set_viewBox(oox_geom_path->m_oW.GetValue(), oox_geom_path->m_oH.GetValue());
for (size_t i =0 ; i< oox_geom_path->m_arrItems.size(); i++)
for (size_t i = 0 ; i < oox_geom_path->m_arrItems.size(); i++)
{
convert(oox_geom_path->m_arrItems[i]);
}
std::wstring path_elm ;
odf_context()->drawing_context()->add_path_element(std::wstring(L"N"), path_elm);
odf_context()->drawing_context()->add_path_element(std::wstring(L"N"), L"");
}
//-----------------------------------------------------------------------------------------------------------------
......@@ -777,7 +798,7 @@ void OoxConverter::convert(OOX::Drawing::CEffectList *oox_effect_list, std::wstr
{
if (oox_effect_list == NULL) return;
for (unsigned int i=0;i< oox_effect_list->m_arrEffects.size(); i++)
for (size_t i = 0; i < oox_effect_list->m_arrEffects.size(); i++)
{
switch(oox_effect_list->m_arrEffects[i]->getType())
{
......@@ -875,7 +896,7 @@ void OoxConverter::convert(OOX::Drawing::CBlipFillProperties *oox_bitmap_fill, s
sID = oox_bitmap_fill->m_oBlip->m_oLink.GetValue();
//...
}
for (unsigned int i=0 ; i < oox_bitmap_fill->m_oBlip->m_arrEffects.size(); i++)
for (size_t i = 0 ; i < oox_bitmap_fill->m_oBlip->m_arrEffects.size(); i++)
convert(oox_bitmap_fill->m_oBlip->m_arrEffects[i]);
}
if (oox_bitmap_fill->m_oSrcRect.IsInit() && Width >0 && Height >0)//часть изображения
......@@ -1037,7 +1058,7 @@ void OoxConverter::convert(OOX::Drawing::CPatternFillProperties *oox_pattern_fil
odf_context()->drawing_context()->end_hatch_style();
}
void OoxConverter::convert(OOX::Drawing::CSolidColorFillProperties *oox_solid_fill,std::wstring & hexColor , _CP_OPT(double) &opacity)
void OoxConverter::convert(OOX::Drawing::CSolidColorFillProperties *oox_solid_fill, std::wstring & hexColor , _CP_OPT(double) &opacity)
{
switch( oox_solid_fill->m_eType )
{
......@@ -1049,7 +1070,7 @@ void OoxConverter::convert(OOX::Drawing::CSolidColorFillProperties *oox_solid_fi
case OOX::Drawing::colorSys: convert(&oox_solid_fill->m_oSysClr, hexColor, opacity); break;
}
}
void OoxConverter::convert(OOX::Drawing::CColor *oox_color,std::wstring & hexColor , _CP_OPT(double) &opacity)
void OoxConverter::convert(OOX::Drawing::CColor *oox_color, std::wstring & hexColor , _CP_OPT(double) &opacity)
{
switch( oox_color->m_eType )
{
......@@ -1081,7 +1102,7 @@ void OoxConverter::convert(OOX::Drawing::CSolidColorFillProperties *oox_solid_fi
}
}
void OoxConverter::convert(OOX::Drawing::Colors::CColorTransform *oox_Clr, std::wstring & hexString, _CP_OPT(double) &opacity)
void OoxConverter::convert(OOX::Drawing::Colors::CColorTransform *oox_Clr, std::wstring & hexString, _CP_OPT(double) &opacity)
{
if (!oox_Clr)return;
BYTE ucA=0, ucG=0, ucB=0, ucR =0;
......@@ -1095,18 +1116,15 @@ void OoxConverter::convert(OOX::Drawing::Colors::CColorTransform *oox_Clr, s
}
if (ucA !=255)opacity = (ucA/255.)* 100.;
}
void OoxConverter::convert(OOX::Drawing::CSchemeColor *oox_ShemeClr, std::wstring & hexString, _CP_OPT(double) &opacity)
bool OoxConverter::convert(int indexSchemeColor, BYTE& ucA, BYTE& ucG, BYTE& ucB, BYTE& ucR)
{
OOX::CTheme * theme= oox_theme();
if (!oox_ShemeClr || !theme)return;
int theme_ind = oox_ShemeClr->m_oVal.GetValue();
BYTE ucA=0, ucG=0, ucB=0, ucR =0;
if (!theme)return false;
bool result = false;
switch(theme_ind)
switch(indexSchemeColor)
{
case SimpleTypes::shemecolorvalLt1:
case SimpleTypes::shemecolorvalBg1:
......@@ -1137,6 +1155,17 @@ void OoxConverter::convert(OOX::Drawing::CSchemeColor *oox_ShemeClr, std::ws
case SimpleTypes::shemecolorvalHlink:
result = theme->m_oThemeElements.m_oClrScheme.m_oHlink.tryGetRgb(ucR, ucG, ucB, ucA); break;
}
return result;
}
void OoxConverter::convert(OOX::Drawing::CSchemeColor *oox_ShemeClr, std::wstring & hexString, _CP_OPT(double) &opacity)
{
if (!oox_ShemeClr)return;
int theme_ind = oox_ShemeClr->m_oVal.GetValue();
BYTE ucA = 0, ucG = 0, ucB = 0, ucR = 0;
bool result = convert(theme_ind, ucA, ucG, ucB, ucR);
if (result == true)
{
oox_ShemeClr->SetRGBA(ucR,ucG,ucB,ucA);
......@@ -1148,7 +1177,7 @@ void OoxConverter::convert(OOX::Drawing::CSchemeColor *oox_ShemeClr, std::ws
hexString = oRgbColor->ToString().substr(2);//.Right(6);
delete oRgbColor;
}
if (ucA !=255)opacity = (ucA/255.)* 100.;
if ( ucA != 0xff )opacity = (ucA / 255.) * 100.;
}
}
void OoxConverter::convert(OOX::Drawing::CPath2DLineTo *oox_geom_path)
......@@ -1173,8 +1202,8 @@ void OoxConverter::convert(OOX::Drawing::CPath2DArcTo *oox_geom_path)
{
if (!oox_geom_path) return;
//std::wstring path_elm = std::to_wstring ((int)pt2emu(oox_geom_path->m_oPt.m_oX.GetValue())) +
// std::wstring(L" ")+ std::to_wstring ((int)pt2emu(oox_geom_path->m_oPt.m_oY.GetValue()));
//std::wstring path_elm = std::to_wstring ((int)pt2emu(oox_geom_path->m_oPt.m_oX.GetValue())) +
// std::wstring(L" ")+ std::to_wstring ((int)pt2emu(oox_geom_path->m_oPt.m_oY.GetValue()));
//
//odf_context()->drawing_context()->add_path_element(std::wstring(L"A"), path_elm);
}
......@@ -1217,10 +1246,15 @@ void OoxConverter::convert(OOX::Drawing::CTextBodyProperties *oox_bodyPr)
odf_context()->drawing_context()->set_textarea_writing_mode (oox_bodyPr->m_oVert.GetValue());
odf_context()->drawing_context()->set_textarea_vertical_align (oox_bodyPr->m_oAnchor.GetValue());
odf_context()->drawing_context()->set_textarea_padding (oox_bodyPr->m_oLIns.ToCm(),
oox_bodyPr->m_oTIns.ToCm(),
oox_bodyPr->m_oRIns.ToCm(),
oox_bodyPr->m_oBIns.ToCm());
_CP_OPT(double) lIns, tIns, rIns, bIns;
lIns = oox_bodyPr->m_oLIns.ToCm();
tIns = oox_bodyPr->m_oTIns.ToCm();
rIns = oox_bodyPr->m_oRIns.ToCm();
bIns = oox_bodyPr->m_oBIns.ToCm();
odf_context()->drawing_context()->set_textarea_padding (lIns, tIns, rIns, bIns);
odf_context()->drawing_context()->set_textarea_wrap(oox_bodyPr->m_oWrap.GetValue());
if (oox_bodyPr->m_oNumCol.GetValue() > 1)
......@@ -1236,7 +1270,7 @@ void OoxConverter::convert(OOX::Drawing::CTextBodyProperties *oox_bodyPr)
}
if (oox_bodyPr->m_oFromWordArt.ToBool() && oox_bodyPr->m_oPrstTxWrap.IsInit())
{
for (unsigned int i=0; i< oox_bodyPr->m_oPrstTxWrap->m_oAvLst->m_arrGd.size(); i++)
for (size_t i = 0; i < oox_bodyPr->m_oPrstTxWrap->m_oAvLst->m_arrGd.size(); i++)
{
if (oox_bodyPr->m_oPrstTxWrap->m_oAvLst->m_arrGd[i] == NULL) continue;
odf_context()->drawing_context()->add_modifier(oox_bodyPr->m_oPrstTxWrap->m_oAvLst->m_arrGd[i]->m_oFmla.GetValue());
......@@ -1367,7 +1401,7 @@ void OoxConverter::convert(OOX::Drawing::CRunProperty * oox_run_pr, odf_writer::
}
}
}
void OoxConverter::convert(OOX::Drawing::CRun *oox_run)
void OoxConverter::convert(OOX::Drawing::CRun *oox_run)
{
if (!oox_run)return;
......@@ -1497,7 +1531,7 @@ void OoxConverter::convert(OOX::Drawing::CParagraph *oox_paragraph)
odf_context()->text_context()->start_paragraph(styled);
for (unsigned int i=0; i< oox_paragraph->m_arrItems.size();i++)
for (size_t i=0; i< oox_paragraph->m_arrItems.size();i++)
{
convert(oox_paragraph->m_arrItems[i]);
}
......
......@@ -273,11 +273,6 @@ namespace OOX
class CRichText;
class CTextProperties;
}
//namespace Diagram
//{
// class CShape;
// class CShapeTree;
//}
namespace Vml
{
class CShapeType;
......@@ -322,6 +317,32 @@ namespace PPTX
class SpPr;
class ShapeStyle;
class PrstTxWarp;
class PrstGeom;
class CustGeom;
class BlipFill;
class GradFill;
class SolidFill;
class PattFill;
class EffectLst;
class Ln;
class Path2D;
class PathBase;
class TxBody;
class BodyPr;
class UniFill;
class UniColor;
class NvSpPr;
class CNvPr;
class CNvSpPr;
class NvPr;
class Paragraph;
class TextParagraphPr;
class TextSpacing;
class RunProperties;
class Run;
class Fld;
class Br;
class MathParaWrapper;
}
}
......@@ -358,16 +379,17 @@ public:
OOX::Spreadsheet::IFileContainer *oox_current_child_document_spreadsheet;
OOX::IFileContainer *oox_current_child_document;
void convert (double oox_font_size, cpdoccore::_CP_OPT(cpdoccore::odf_types::font_size) & odf_font_size);
bool convert (int indexSchemeColor, BYTE& ucA, BYTE& ucG, BYTE& ucB, BYTE& ucR);
//.......................................................................................................................
void convert(OOX::WritingElement *oox_unknown);
void convert(double oox_font_size, cpdoccore::_CP_OPT(cpdoccore::odf_types::font_size) & odf_font_size);
//.drawing......................................................................................................................
void convert(OOX::Drawing::CDiagrammParts *oox_diagramm);
void convert(OOX::Drawing::CLockedCanvas *oox_canvas);
void convert(OOX::Drawing::CShape *oox_shape);
void convert(OOX::Drawing::CNonVisualDrawingProps *oox_cnvPr);
void convert(OOX::Drawing::CShapeProperties *oox_spPr, OOX::Drawing::CShapeStyle* oox_sp_style = NULL);
void convert(OOX::Drawing::CShapeProperties *oox_spPr, OOX::Drawing::CShapeStyle* oox_sp_style = NULL);
void convert(OOX::Drawing::CGroupShapeProperties *oox_groupSpPr);
void convert(OOX::Drawing::CTextBodyProperties *oox_bodyPr);
......@@ -406,11 +428,36 @@ public:
void convert(OOX::Drawing::CRun *oox_run);
void convert(OOX::Drawing::CRunProperty *oox_run_pr, cpdoccore::odf_writer::style_text_properties * text_properties);
void convert(OOX::Drawing::CLineSpacing *oox_spacing, cpdoccore::odf_types::length_or_percent & length_or_percent);
//.diagram(pptx)................................................................................................................................
//.diagram & pptx................................................................................................................................
void convert(PPTX::Logic::TextSpacing *oox_spacing, cpdoccore::odf_types::length_or_percent & length_or_percent);
void convert(PPTX::Logic::SpTree *oox_shape_tree);
void convert(PPTX::Logic::Shape *oox_shape);
void convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle* oox_sp_style = NULL);
int convert(PPTX::Logic::PrstTxWarp *oox_text_preset);
void convert(PPTX::Logic::PrstGeom *oox_geom);
void convert(PPTX::Logic::CustGeom *oox_geom);
void convert(PPTX::Logic::BlipFill *oox_fill);
void convert(PPTX::Logic::GradFill *oox_fill);
void convert(PPTX::Logic::SolidFill *oox_fill);
void convert(PPTX::Logic::PattFill *oox_fill);
void convert(PPTX::Logic::EffectLst *oox_effect_lst);
void convert(PPTX::Logic::Ln *oox_line);
void convert(PPTX::Logic::Path2D *oox_path2D);
void convert(PPTX::Logic::PathBase *oox_path);
void convert(PPTX::Logic::BodyPr *oox_bodyPr);
void convert(PPTX::Logic::UniFill *oox_fill, PPTX::Logic::ShapeStyle* oox_sp_style = NULL);
void convert(PPTX::Logic::UniColor *color, std::wstring & hexString, cpdoccore::_CP_OPT(double) & opacity);
void convert(PPTX::Logic::NvSpPr *oox_nvSpPr);
void convert(PPTX::Logic::CNvPr *oox_cnvPr);
void convert(PPTX::Logic::CNvSpPr *oox_cnvSpPr);
void convert(PPTX::Logic::NvPr *oox_nvPr);
void convert(PPTX::Logic::Paragraph *oox_para);
void convert(PPTX::Logic::TextParagraphPr *oox_para_props, cpdoccore::odf_writer::style_paragraph_properties * paragraph_properties);
void convert(PPTX::Logic::RunProperties *oox_run_props, cpdoccore::odf_writer::style_text_properties * text_properties);
void convert(PPTX::Logic::Run *oox_run);
void convert(PPTX::Logic::Fld *oox_fld);
void convert(PPTX::Logic::Br *oox_br);
void convert(PPTX::Logic::MathParaWrapper *oox_math);
//.chart............................................................................................................................
void convert(OOX::Spreadsheet::CT_ChartSpace *oox_chart);
void convert(OOX::Spreadsheet::CT_Title *ct_title);
......
......@@ -80,7 +80,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CRichText* rich)
odf_context()->chart_context()->start_text();
OoxConverter::convert(rich->m_oBodyPr.GetPointer());
for (unsigned int i=0 ; i < rich->m_arrItems.size();i++)
for (size_t i = 0; i < rich->m_arrItems.size();i++)
{
OoxConverter::convert(rich->m_arrItems[i]);
}
......@@ -93,7 +93,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CTextProperties* txPr)
odf_context()->chart_context()->start_text();
OoxConverter::convert(txPr->m_oBodyPr.GetPointer());
for (unsigned int i=0 ; i < txPr->m_arrItems.size();i++)
for (size_t i = 0; i < txPr->m_arrItems.size();i++)
{
OoxConverter::convert(txPr->m_arrItems[i]);
}
......@@ -167,7 +167,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_PlotArea* ct_plotArea)
convert(ct_plotArea->m_layout);
///////////////////////
for (unsigned int i=0; i< ct_plotArea->m_Items1.size(); i++)
for (size_t i = 0; i < ct_plotArea->m_Items1.size(); i++)
{
if (!ct_plotArea->m_ItemsElementName1[i]) continue;
switch(*ct_plotArea->m_ItemsElementName1[i])
......@@ -178,7 +178,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_PlotArea* ct_plotArea)
case OOX::Spreadsheet::itemschoicetype6VALAX: convert((OOX::Spreadsheet::CT_ValAx*)ct_plotArea->m_Items1[i]);break;
}
}
for (unsigned int i=0; i< ct_plotArea->m_Items.size(); i++)//
for (size_t i=0; i< ct_plotArea->m_Items.size(); i++)//
{
if (!ct_plotArea->m_ItemsElementName0[i]) continue;
switch(*ct_plotArea->m_ItemsElementName0[i])
......@@ -406,7 +406,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Area3DChart *chart)
if (chart->m_grouping && chart->m_grouping->m_val)
odf_context()->chart_context()->set_chart_grouping(*chart->m_grouping->m_val);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
......@@ -425,11 +425,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_AreaChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i=0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
for (unsigned int i=0; i< chart->m_axId.size(); i++)
for (size_t i=0; i < chart->m_axId.size(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
......@@ -460,11 +460,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Bar3DChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
for (unsigned int i=0; i< chart->m_axId.size(); i++)
for (size_t i = 0; i < chart->m_axId.size(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
......@@ -491,11 +491,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_BarChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
for (unsigned int i=0; i< chart->m_axId.size(); i++)
for (size_t i = 0; i < chart->m_axId.size(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
......@@ -513,11 +513,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Line3DChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
for (unsigned int i=0; i< chart->m_axId.size(); i++)
for (size_t i = 0; i < chart->m_axId.size(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
......@@ -539,11 +539,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_LineChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
for (unsigned int i=0; i< chart->m_axId.size(); i++)
for (size_t i = 0; i < chart->m_axId.size(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
......@@ -558,11 +558,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Pie3DChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
//for (long i=0; i< chart->m_axId.size(); i++)
//for (size_t i = 0; i < chart->m_axId.size(); i++)
//{
// odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
//}
......@@ -576,11 +576,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_PieChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
//for (long i=0; i< chart->m_axId.size(); i++)
//for (size_t i = 0; i < chart->m_axId.size(); i++)
//{
// odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
//}
......@@ -594,11 +594,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Surface3DChart *chart)
odf_context()->chart_context()->set_chart_3D(true);
odf_context()->chart_context()->start_group_series();
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
for (unsigned int i=0; i< chart->m_axId.size(); i++)
for (size_t i = 0; i < chart->m_axId.size(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
......@@ -611,11 +611,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_SurfaceChart *chart)
odf_context()->chart_context()->set_chart_type(L"surface");
odf_context()->chart_context()->start_group_series();
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
for (unsigned int i=0; i< chart->m_axId.size(); i++)
for (size_t i = 0; i < chart->m_axId.size(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
......@@ -629,11 +629,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_BubbleChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
for (unsigned int i=0; i< chart->m_axId.size(); i++)
for (size_t i = 0; i < chart->m_axId.size(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
......@@ -649,7 +649,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_DoughnutChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
......@@ -668,11 +668,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ScatterChart *chart)
odf_context()->chart_context()->start_group_series();
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
for (unsigned int i=0; i< chart->m_axId.size(); i++)
for (size_t i = 0; i < chart->m_axId.size(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
......@@ -689,11 +689,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_RadarChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
//for (long i=0; i< chart->m_axId.size(); i++)
//for (size_t i = 0; i < chart->m_axId.size(); i++)
//{
// odf_context()->chart_context()->add_axis_group_series(**chart->m_axId[i]->m_val->m_val);
//}
......@@ -707,11 +707,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_StockChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
for (unsigned int i=0; i< chart->m_axId.size(); i++)
for (size_t i = 0; i < chart->m_axId.size(); i++)
{
odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
}
......@@ -755,11 +755,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_OfPieChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (unsigned int i=0; i< chart->m_ser.size(); i++)
for (size_t i = 0; i < chart->m_ser.size(); i++)
{
convert(chart->m_ser[i]);
}
//for (long i=0; i< chart->m_axId.size(); i++)
//for (size_t i = 0; i < chart->m_axId.size(); i++)
//{
// odf_context()->chart_context()->add_axis_group_series(*chart->m_axId[i]->m_val);
//}
......@@ -954,7 +954,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Marker* marker, std::vector<OOX:
long count_point = odf_context()->chart_context()->get_count_data_points_series();
long current_point = 0;
long set_point;
for (unsigned int i =0 ;i < dPt.size(); i++)
for (size_t i = 0; i < dPt.size(); i++)
{
if (dPt[i] == NULL)continue;
......@@ -996,7 +996,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_DLbls* ser_lbls)
{
if (ser_lbls == NULL)return;
for (unsigned int i=0; i< ser_lbls->m_Items.size(); i++)
for (size_t i = 0; i < ser_lbls->m_Items.size(); i++)
{
bool boolVal = false;
......@@ -1140,7 +1140,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_NumData *num_data, bool categori
//std::vector<double> data;
std::vector<std::wstring> data;
for (unsigned int i=0; i < num_data->m_pt.size(); i++)
for (size_t i = 0; i < num_data->m_pt.size(); i++)
{
if (num_data->m_pt[i] && num_data->m_pt[i]->m_v)
{
......@@ -1166,7 +1166,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_StrData *str_data, bool categori
if (str_data == NULL)return;
std::vector<std::wstring> data;
for (unsigned int i=0; i < str_data->m_pt.size(); i++)
for (size_t i = 0; i < str_data->m_pt.size(); i++)
{
if (str_data->m_pt[i] && str_data->m_pt[i]->m_v)
data.push_back(*str_data->m_pt[i]->m_v);
......
......@@ -2859,7 +2859,7 @@ void DocxConverter::convert(OOX::Drawing::CChart * oox_chart)
odt_context->drawing_context()->start_drawing();
odt_context->drawing_context()->start_object(odf_context()->get_next_name_object());
double width =0, height =0;
_CP_OPT(double) width, height;
odt_context->drawing_context()->get_size(width, height);
OoxConverter::convert(pChart->m_oChartSpace.m_oSpPr.GetPointer());
......
......@@ -1923,59 +1923,49 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGraphicFrame* oox_graphic_frame)
////////////////////////////////////////////////////////////////////////////////
ods_context->drawing_context()->start_drawing();
if (oox_graphic_frame->m_oNvGraphicFramePr.IsInit())
{
OoxConverter::convert(oox_graphic_frame->m_oNvGraphicFramePr->m_oCNvPr.GetPointer());
}
if ( OOX::Drawing::graphictypeChart == oox_graphic_frame->m_oGraphic->m_oGraphicData->m_eGraphicType)
{
ods_context->drawing_context()->start_object(ods_context->get_next_name_object());
{
double width = 0, height = 0;
ods_context->drawing_context()->get_size(width, height);
if (oox_graphic_frame->m_oNvGraphicFramePr.IsInit())
{
OoxConverter::convert(oox_graphic_frame->m_oNvGraphicFramePr->m_oCNvPr.GetPointer());
}
convert(oox_graphic_frame->m_oGraphic->m_oGraphicData->m_oChart.GetPointer(), width, height);
}
ods_context->drawing_context()->end_object();
convert(oox_graphic_frame->m_oGraphic->m_oGraphicData->m_oChart.GetPointer());
}
else if ( OOX::Drawing::graphictypeDiagram == oox_graphic_frame->m_oGraphic->m_oGraphicData->m_eGraphicType)
{
double width = 0, height = 0;
ods_context->drawing_context()->get_size(width, height);
if (oox_graphic_frame->m_oNvGraphicFramePr.IsInit())
{
OoxConverter::convert(oox_graphic_frame->m_oNvGraphicFramePr->m_oCNvPr.GetPointer());
}
OoxConverter::convert(oox_graphic_frame->m_oGraphic->m_oGraphicData->m_oDiagrammParts.GetPointer());
}
ods_context->drawing_context()->end_drawing();
}
void XlsxConverter::convert(OOX::Spreadsheet::CGraphicChart *oox_chart, double width, double height)
void XlsxConverter::convert(OOX::Spreadsheet::CGraphicChart *oox_chart)
{
if (!oox_chart) return;
if( !oox_chart->m_oRId.IsInit()) return;
std::wstring sId = oox_chart->m_oRId->GetValue();
_CP_OPT(double) width, height;
odf_context()->drawing_context()->get_size (width, height);
smart_ptr<OOX::File> oFile = xlsx_current_drawing->Find(sId);
smart_ptr<OOX::File> oFile = xlsx_current_drawing->Find(oox_chart->m_oRId->GetValue());
if (oFile.IsInit() && OOX::Spreadsheet::FileTypes::Charts == oFile->type())
{
OOX::Spreadsheet::CChartSpace* pChart = (OOX::Spreadsheet::CChartSpace*)oFile.operator->();
if (pChart)
{
OoxConverter::convert(pChart->m_oChartSpace.m_oSpPr.GetPointer());
oox_current_child_document_spreadsheet = dynamic_cast<OOX::Spreadsheet::IFileContainer*>(pChart);
odf_context()->start_chart();
odf_context()->chart_context()->set_chart_size(width, height);
OoxConverter::convert(&pChart->m_oChartSpace);
odf_context()->end_chart();
oox_current_child_document_spreadsheet = dynamic_cast<OOX::Spreadsheet::IFileContainer*>(pChart);
odf_context()->drawing_context()->start_object(ods_context->get_next_name_object());
{
odf_context()->start_chart();
odf_context()->chart_context()->set_chart_size(width, height);
OoxConverter::convert(pChart->m_oChartSpace.m_oSpPr.GetPointer());
OoxConverter::convert(&pChart->m_oChartSpace);
odf_context()->end_chart();
}
odf_context()->drawing_context()->end_object();
oox_current_child_document_spreadsheet = NULL;
}
}
......
......@@ -201,7 +201,7 @@ namespace Oox2Odf
void convert(OOX::Spreadsheet::CConnShape *oox_conn_shape);
void convert(OOX::Spreadsheet::CGraphicFrame *oox_graphic_frame);
void convert(OOX::Spreadsheet::CGroupShape *oox_group_shape);
void convert(OOX::Spreadsheet::CGraphicChart *oox_chart, double width, double height);
void convert(OOX::Spreadsheet::CGraphicChart *oox_chart);
void convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_fmt);
void convert(OOX::Spreadsheet::CConditionalFormattingRule *oox_cond_rule);
......
......@@ -198,7 +198,7 @@ namespace PPTX
public:
int id;
std::wstring name;
std::wstring name;
nullable_string descr;
nullable_bool hidden;
nullable_string title;
......
......@@ -116,16 +116,6 @@ namespace PPTX
//Надо сделать примерно также для "origin color" и setter'ы
//Нет, нет и нет!!! Setter'ы делать только в УниКолор, т.к. при установке цвета меняется его тип!
protected:
//origin color
unsigned char alpha;
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char hue;
unsigned char saturation;
unsigned char luminance;
enum ColorType {ctRGBA, ctARGB, ctBGRA, ctABGR};
virtual DWORD ApplyModifiers(const ColorType ct)const
{
......@@ -389,6 +379,15 @@ namespace PPTX
return 0;
}
protected:
//origin color
unsigned char alpha;
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char hue;
unsigned char saturation;
unsigned char luminance;
//Эти функции использовать для заполнения "origin color"
void SetRGB2HSL()
{
......
......@@ -341,7 +341,7 @@ namespace PPTX
public:
nullable<TextParagraphPr> pPr;
std::vector<RunElem> RunElems;
std::vector<RunElem> RunElems;
nullable<RunProperties> endParaRPr;
protected:
virtual void FillParentPointersForChilds()
......
......@@ -70,7 +70,6 @@ namespace PPTX
return Elem->toXML();
return _T("");
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
if (is_init())
......
......@@ -53,7 +53,10 @@ namespace PPTX
rPr = oSrc.rPr;
return *this;
}
virtual OOX::EElementType getType () const
{
return OOX::et_p_br;
}
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
......
......@@ -59,7 +59,10 @@ namespace PPTX
return *this;
}
virtual OOX::EElementType getType () const
{
return OOX::et_p_fld;
}
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
......
......@@ -54,7 +54,11 @@ namespace PPTX
MathParaWrapper& operator=(const MathParaWrapper& oSrc);
public:
virtual OOX::EElementType getType () const
{
return OOX::et_p_MathPara;
}
virtual void fromXML(XmlUtils::CXmlNode& node);
virtual std::wstring toXML() const;
......@@ -64,10 +68,10 @@ namespace PPTX
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
virtual void fromPPTY(BYTE type, NSBinPptxRW::CBinaryFileReader* pReader);
virtual std::wstring GetText() const;
public:
nullable<OOX::Logic::COMathPara> m_oMathPara;
nullable<OOX::Logic::COMath> m_oMath;
nullable_string m_oXml;
nullable<OOX::Logic::COMathPara> m_oMathPara;
nullable<OOX::Logic::COMath> m_oMath;
nullable_string m_oXml;
protected:
virtual void FillParentPointersForChilds(){}
};
......
......@@ -55,7 +55,10 @@ namespace PPTX
return *this;
}
virtual OOX::EElementType getType () const
{
return OOX::et_p_r;
}
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
......
......@@ -2587,7 +2587,7 @@ namespace OOX
public:
// Attributes
nullable<std::wstring> m_oId;
nullable<std::wstring> m_oId;
nullable<SimpleTypes::Vml::CCssStyle> m_oStyle;
SimpleTypes::Vml::CVml_TextBoxInset m_oInset;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oSingleClick;
......
......@@ -335,9 +335,9 @@ namespace OOX
et_dsp_cNvPr,
et_dsp_txXfrm,
et_p_cNvPicPr, // <p:cNvPicPr>
et_p_cNvPr, // <p:cNvPr>
et_p_pic, // <p:pic>
et_p_cNvPicPr, // <p:cNvPicPr>
et_p_cNvPr, // <p:cNvPr>
et_p_pic, // <p:pic>
et_p_Shape, // <p:sp>
et_p_ShapeTree, // <p:spTree>
et_p_spPr, // <p:spPr>
......@@ -345,18 +345,22 @@ namespace OOX
et_p_groupSpPr, // <p:grpSpPr>
et_p_NvGrpSpPr,
et_p_xfrm,
et_a_p, // <a:p>
et_a_pPr, // <a:pPr>
et_a_r, // <a:p>
et_a_rPr, // <a:pPr>
et_a_t, // <a:t>
et_a_br, // <a:br>
et_a_spcPts, // <a:spcPts>
et_a_spcPct, // <a:spcPct>
et_a_spcAft, // <a:spcAft>
et_a_spcBef, // <a:spcBef>
et_a_lnSpc, // <a:lnSpc>
et_p_r,
et_p_fld,
et_p_br,
et_p_MathPara,
et_a_p, // <a:p>
et_a_pPr, // <a:pPr>
et_a_r, // <a:p>
et_a_rPr, // <a:pPr>
et_a_t, // <a:t>
et_a_br, // <a:br>
et_a_spcPts, // <a:spcPts>
et_a_spcPct, // <a:spcPct>
et_a_spcAft, // <a:spcAft>
et_a_spcBef, // <a:spcBef>
et_a_lnSpc, // <a:lnSpc>
et_ds_schemaRef, // <ds:shemeRef>
et_ds_schemaRefs, // <ds:schemaRefs>
......
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