Commit 48ac9e7b authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

(1.2.0.153): ASCOfficeOdfFileW


git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58134 954022d7-b5bf-4e40-9824-e11837661b57
parent 05669f2a
......@@ -330,7 +330,12 @@ void common_border_attlist::add_attributes( const xml::attributes_wc_ptr & Attri
}
void common_border_attlist::apply_from(const common_border_attlist & Other)
{
_CP_APPLY_PROP(fo_border_, Other.fo_border_);
if (fo_border_ && !Other.fo_border_)
{
fo_border_top_ = fo_border_bottom_ = fo_border_left_ = fo_border_right_ = fo_border_;
fo_border_ = Other.fo_border_;
}
_CP_APPLY_PROP(fo_border_, Other.fo_border_);
_CP_APPLY_PROP(fo_border_top_, Other.fo_border_top_);
_CP_APPLY_PROP(fo_border_bottom_, Other.fo_border_bottom_);
_CP_APPLY_PROP(fo_border_left_, Other.fo_border_left_);
......
......@@ -59,8 +59,8 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"mso-spt38" , 7}, // shapetypeCurvedConnector3,
{ L"mso-spt39" , 7}, // shapetypeCurvedConnector4,
{ L"mso-spt40" , 7}, // shapetypeCurvedConnector5,
{ L"mso-spt105" , 7}, // shapetypeCurvedDownArrow,
{ L"mso-spt103" , 7}, // shapetypeCurvedLeftArrow,
{ L"" , 7}, // shapetypeCurvedDownArrow,
{ L"" , 7}, // shapetypeCurvedLeftArrow,
{ L"mso-spt102" , 7}, // shapetypeCurvedRightArrow,
{ L"mso-spt104" , 7}, // shapetypeCurvedUpArrow,
{ L"" , 7}, // shapetypeDecagon,
......
// shapetypeCurvedConnector2,
// shapetypeCurvedConnector3,
// shapetypeCurvedConnector4,
// shapetypeCurvedConnector5,
//+ shapetypeCurvedDownArrow,
//+ shapetypeCurvedLeftArrow,
// shapetypeCurvedRightArrow,
// shapetypeCurvedUpArrow,
#include "..\oox_shape_defines.h"
namespace cpdoccore
{
class oox_shape_curvedLeftArrow : public oox_shape
{
public:
oox_shape_curvedLeftArrow()
{
odf_type_name =L"ooxml-curvedLeftArrow";
//modifiers = L"23520";
enhanced_path = L"M ?f2 ?f8 A ?f65 ?f66 ?f67 ?f68 ?f2 ?f8 ?f62 ?f64 W ?f69 ?f70 ?f71 ?f72 ?f2 ?f8 ?f62 ?f64 Z N";
text_areas = L"?f22 ?f24 ?f23 ?f25";
glue_points = L"?f22 ?f24 ?f22 ?f25 ?f23 ?f25 ?f23 ?f24";
view_box = L"0 0 21600 21600";
add(L"f0", L"10800000");
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 / 2");
add(L"f8", L"?f4 + ?f7");
add(L"f9", L"?f3 - ?f2");
add(L"f10", L"?f9 / 2");
add(L"f11", L"?f2 + ?f10");
add(L"f12", L"5419351 / 1725033");
add(L"f13", L"2700000 + ?f1");
add(L"f14", L"?f13 * ?f12 / ?f0");
add(L"f15", L"0 - ?f14");
add(L"f16", L"sin(?f15)");
add(L"f17", L"0 - ?f16");
add(L"f18", L"?f17 * ?f10");
add(L"f19", L"cos(?f15)");
add(L"f20", L"0 - ?f19");
add(L"f21", L"?f20 * ?f7");
add(L"f22", L"?f11 - ?f18");
add(L"f23", L"?f11 + ?f18");
add(L"f24", L"?f8 - ?f21");
add(L"f25", L"?f8 + ?f21");
add(L"f26", L"21550000 - 21600000");
add(L"f27", L"if(?f26, 21600000, 21550000)");
add(L"f28", L"-21550000 - ?f27");
add(L"f29", L"if(?f28, -21550000, ?f27)");
add(L"f30", L"?f0 + ?f29");
add(L"f31", L"?f0 + ?f1");
add(L"f32", L"?f31 * ?f12 / ?f0");
add(L"f33", L"0 - ?f32");
add(L"f34", L"cos(?f33)");
add(L"f35", L"0 - ?f34");
add(L"f36", L"?f35 * ?f10");
add(L"f37", L"sin(?f33)");
add(L"f38", L"0 - ?f37");
add(L"f39", L"?f38 * ?f7");
add(L"f40", L"sqrt(?f36 * ?f36 + ?f39 * ?f39 + 0 * 0)");
add(L"f41", L"?f10 * ?f7 / ?f40");
add(L"f42", L"?f38 * ?f41");
add(L"f43", L"?f2 - ?f42");
add(L"f44", L"?f35 * ?f41");
add(L"f45", L"?f8 - ?f44");
add(L"f46", L"?f43 - ?f10");
add(L"f47", L"?f45 - ?f7");
add(L"f48", L"?f43 + ?f10");
add(L"f49", L"?f45 + ?f7");
add(L"f50", L"?f30 + ?f1");
add(L"f51", L"?f50 * ?f12 / ?f0");
add(L"f52", L"0 - ?f51");
add(L"f53", L"cos(?f52)");
add(L"f54", L"0 - ?f53");
add(L"f55", L"?f54 * ?f10");
add(L"f56", L"sin(?f52)");
add(L"f57", L"0 - ?f56");
add(L"f58", L"?f57 * ?f7");
add(L"f59", L"sqrt(?f55 * ?f55 + ?f58 * ?f58 + 0 * 0)");
add(L"f60", L"?f10 * ?f7 / ?f59");
add(L"f61", L"?f57 * ?f60");
add(L"f62", L"?f43 + ?f61");
add(L"f63", L"?f54 * ?f60");
add(L"f64", L"?f45 + ?f63");
add(L"f65", L"if(?f29, ?f2, ?f46)");
add(L"f66", L"if(?f29, ?f8, ?f47)");
add(L"f67", L"if(?f29, ?f2, ?f48)");
add(L"f68", L"if(?f29, ?f8, ?f49)");
add(L"f69", L"if(?f29, ?f46, ?f62)");
add(L"f70", L"if(?f29, ?f47, ?f64)");
add(L"f71", L"if(?f29, ?f48, ?f62)");
add(L"f72", L"if(?f29, ?f49, ?f64)");
/////////////////////////////////////////////////////////
_handle h;
h.position = L"0 ?f2";
h.y_maximum= L"51965";
h.y_minimum= L"0";
handles.push_back(h);
}
};
class oox_shape_curvedDownArrow : public oox_shape
{
public:
oox_shape_curvedDownArrow()
{
odf_type_name =L"ooxml-curvedDownArrow";
//modifiers = L"23520";
enhanced_path = L"M ?f2 ?f8 A ?f65 ?f66 ?f67 ?f68 ?f2 ?f8 ?f62 ?f64 W ?f69 ?f70 ?f71 ?f72 ?f2 ?f8 ?f62 ?f64 Z N";
text_areas = L"?f22 ?f24 ?f23 ?f25";
glue_points = L"?f22 ?f24 ?f22 ?f25 ?f23 ?f25 ?f23 ?f24";
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 / 2");
add(L"f8", L"?f4 + ?f7");
add(L"f9", L"?f3 - ?f2");
add(L"f10", L"?f9 / 2");
add(L"f11", L"?f2 + ?f10");
add(L"f12", L"5419351 / 1725033");
add(L"f13", L"2700000 + ?f1");
add(L"f14", L"?f13 * ?f12 / ?f0");
add(L"f15", L"0 - ?f14");
add(L"f16", L"sin(?f15)");
add(L"f17", L"0 - ?f16");
add(L"f18", L"?f17 * ?f10");
add(L"f19", L"cos(?f15)");
add(L"f20", L"0 - ?f19");
add(L"f21", L"?f20 * ?f7");
add(L"f22", L"?f11 - ?f18");
add(L"f23", L"?f11 + ?f18");
add(L"f24", L"?f8 - ?f21");
add(L"f25", L"?f8 + ?f21");
add(L"f26", L"21550000 - 21600000");
add(L"f27", L"if(?f26, 21600000, 21550000)");
add(L"f28", L"-21550000 - ?f27");
add(L"f29", L"if(?f28, -21550000, ?f27)");
add(L"f30", L"?f0 + ?f29");
add(L"f31", L"?f0 + ?f1");
add(L"f32", L"?f31 * ?f12 / ?f0");
add(L"f33", L"0 - ?f32");
add(L"f34", L"cos(?f33)");
add(L"f35", L"0 - ?f34");
add(L"f36", L"?f35 * ?f10");
add(L"f37", L"sin(?f33)");
add(L"f38", L"0 - ?f37");
add(L"f39", L"?f38 * ?f7");
add(L"f40", L"sqrt(?f36 * ?f36 + ?f39 * ?f39 + 0 * 0)");
add(L"f41", L"?f10 * ?f7 / ?f40");
add(L"f42", L"?f38 * ?f41");
add(L"f43", L"?f2 - ?f42");
add(L"f44", L"?f35 * ?f41");
add(L"f45", L"?f8 - ?f44");
add(L"f46", L"?f43 - ?f10");
add(L"f47", L"?f45 - ?f7");
add(L"f48", L"?f43 + ?f10");
add(L"f49", L"?f45 + ?f7");
add(L"f50", L"?f30 + ?f1");
add(L"f51", L"?f50 * ?f12 / ?f0");
add(L"f52", L"0 - ?f51");
add(L"f53", L"cos(?f52)");
add(L"f54", L"0 - ?f53");
add(L"f55", L"?f54 * ?f10");
add(L"f56", L"sin(?f52)");
add(L"f57", L"0 - ?f56");
add(L"f58", L"?f57 * ?f7");
add(L"f59", L"sqrt(?f55 * ?f55 + ?f58 * ?f58 + 0 * 0)");
add(L"f60", L"?f10 * ?f7 / ?f59");
add(L"f61", L"?f57 * ?f60");
add(L"f62", L"?f43 + ?f61");
add(L"f63", L"?f54 * ?f60");
add(L"f64", L"?f45 + ?f63");
add(L"f65", L"if(?f29, ?f2, ?f46)");
add(L"f66", L"if(?f29, ?f8, ?f47)");
add(L"f67", L"if(?f29, ?f2, ?f48)");
add(L"f68", L"if(?f29, ?f8, ?f49)");
add(L"f69", L"if(?f29, ?f46, ?f62)");
add(L"f70", L"if(?f29, ?f47, ?f64)");
add(L"f71", L"if(?f29, ?f48, ?f62)");
add(L"f72", L"if(?f29, ?f49, ?f64)");
/////////////////////////////////////////////////////////
_handle h;
h.position = L"0 ?f2";
h.y_maximum= L"51965";
h.y_minimum= L"0";
handles.push_back(h);
}
};
}
\ No newline at end of file
......@@ -202,7 +202,7 @@ office_element_ptr odf_conversion_context::start_tabs()
return temporary_.elm;
}
void odf_conversion_context::add_tab(_CP_OPT(int) type, _CP_OPT(length) _length)
void odf_conversion_context::add_tab(_CP_OPT(int) type, _CP_OPT(length) _length, _CP_OPT(int) leader)
{
if (!temporary_.elm) return;
......@@ -230,6 +230,29 @@ void odf_conversion_context::add_tab(_CP_OPT(int) type, _CP_OPT(length) _length)
case 8: tab->style_type_ = style_type::Left; break;//tabjcLeft = 8
}
}
if (leader)
{
switch(*leader)
{
case 0: tab->style_leader_type_ = line_type::Single ;
tab->style_leader_style_= line_style::Dotted;
break; // tabtlcDot = 0,
case 1: tab->style_leader_type_ = line_type::Single ;
tab->style_leader_style_= line_style::Wave;
break; // tabtlcHeavy = 1,
case 2: tab->style_leader_type_ = line_type::Single ;
tab->style_leader_style_= line_style::Dash;
break; // tabtlcHyphen = 2,
case 3: tab->style_leader_type_ = line_type::Single ;
tab->style_leader_style_= line_style::LongDash;
break; // tabtlcMiddleDot = 3,
case 4: tab->style_leader_type_ = line_type::None;
break; // tabtlcNone = 4,
case 5: tab->style_leader_type_ = line_type::Single;
tab->style_leader_style_= line_style::Solid;
break; // tabtlcUnderscore = 5
}
}
temporary_.elm->add_child_element(elm);
}
}
......
......@@ -74,7 +74,7 @@ public:
office_element_ptr & get_current_object_element();
office_element_ptr start_tabs();
void add_tab(_CP_OPT(int) type, _CP_OPT(length) length);
void add_tab(_CP_OPT(int) type, _CP_OPT(length) length, _CP_OPT(int) leader);
void end_tabs();
private:
......
......@@ -327,6 +327,7 @@ void odf_drawing_context::start_group()
impl_->anchor_settings_.anchor_type_ = boost::none;
}
set_group_position(impl_->x, impl_->y,impl_->x, impl_->y);
//
}
......@@ -1076,7 +1077,7 @@ void odf_drawing_context::set_anchor(int type)
}
anchor_type::type odf_drawing_context::get_anchor()
{
if (impl_->anchor_settings_.anchor_type_) impl_->anchor_settings_.anchor_type_->get_type();
if (impl_->anchor_settings_.anchor_type_) return impl_->anchor_settings_.anchor_type_->get_type();
else return anchor_type::AsChar;
}
//////////////////////////////////////////////////////////////////////////////////////
......@@ -1088,8 +1089,8 @@ void odf_drawing_context::set_vertical_rel(int from)
{
case 0: type = vertical_rel::Baseline; break;// relfromvBottomMargin ???
case 1: type = vertical_rel::PageContent; break;// relfromvInsideMargin ???
case 2: type = vertical_rel::Baseline; break;// relfromvLine
case 3: type = vertical_rel::PageContent; break;// relfromvMargin
case 2: type = vertical_rel::Baseline; break;// relfromvLine
case 3: type = vertical_rel::PageContent;set_anchor(anchor_type::Paragraph);break;// relfromvMargin
case 4: type = vertical_rel::Baseline; break;// relfromvOutsideMargin ???
case 5: type = vertical_rel::Page; set_anchor(anchor_type::Page); break;// relfromvPage
case 6: type = vertical_rel::Paragraph; set_anchor(anchor_type::Paragraph); break;// relfromvParagraph
......@@ -1334,33 +1335,31 @@ void odf_drawing_context::set_position_line(_CP_OPT(double) & x_pt, _CP_OPT(doub
draw_line* line = dynamic_cast<draw_line*>(impl_->current_level_.back().get());
if (line == NULL) return;
if (impl_->current_drawing_state_.in_group && impl_->current_group_)
{
if (x_pt) x_pt = *x_pt * impl_->current_group_->scale_cx + impl_->current_group_->shift_x ;
if (impl_->current_drawing_state_.in_group && impl_->current_group_ && x_pt)
x_pt = *x_pt * impl_->current_group_->scale_cx + impl_->current_group_->shift_x ;
// + (impl_->current_group_->flipH ? (impl_->current_group_->cx - 2 * x_pt): 0);
}
if (x_pt && !line->draw_line_attlist_.svg_x1_) line->draw_line_attlist_.svg_x1_ = length(length(*x_pt,length::pt).get_value_unit(length::cm),length::cm);
if (x_pt && !line->draw_line_attlist_.svg_x1_)
line->draw_line_attlist_.svg_x1_ = length(length(*x_pt,length::pt).get_value_unit(length::cm),length::cm);
if (impl_->current_drawing_state_.in_group && impl_->current_group_)
{
if (y_pt) y_pt = *y_pt * impl_->current_group_->scale_cy + impl_->current_group_->shift_y;
if (impl_->current_drawing_state_.in_group && impl_->current_group_ && y_pt)
y_pt = *y_pt * impl_->current_group_->scale_cy + impl_->current_group_->shift_y;
//+ (impl_->current_group_->flipV ? (impl_->current_group_->cy - 2 * y_pt): 0);
}
if (y_pt && !line->draw_line_attlist_.svg_y1_) line->draw_line_attlist_.svg_y1_ = length(length(*y_pt,length::pt).get_value_unit(length::cm),length::cm);
if (y_pt && !line->draw_line_attlist_.svg_y1_)
line->draw_line_attlist_.svg_y1_ = length(length(*y_pt,length::pt).get_value_unit(length::cm),length::cm);
///////////////////////////////////////
if (impl_->current_drawing_state_.in_group && impl_->current_group_)
{
if (x2_pt) x_pt = *x2_pt * impl_->current_group_->scale_cx + impl_->current_group_->shift_x ;
if (impl_->current_drawing_state_.in_group && impl_->current_group_ && x2_pt)
x2_pt = *x2_pt * impl_->current_group_->scale_cx + impl_->current_group_->shift_x ;
// + (impl_->current_group_->flipH ? (impl_->current_group_->cx - 2 * x_pt): 0);
}
if (x2_pt && !line->draw_line_attlist_.svg_x2_) line->draw_line_attlist_.svg_x2_ = length(length(*x2_pt,length::pt).get_value_unit(length::cm),length::cm);
if (impl_->current_drawing_state_.in_group && impl_->current_group_)
{
if (y2_pt) y_pt = *y2_pt * impl_->current_group_->scale_cy + impl_->current_group_->shift_y;
if (impl_->current_drawing_state_.in_group && impl_->current_group_ && y2_pt)
y2_pt = *y2_pt * impl_->current_group_->scale_cy + impl_->current_group_->shift_y;
//+ (impl_->current_group_->flipV ? (impl_->current_group_->cy - 2 * y_pt): 0);
}
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);
}
......@@ -1369,24 +1368,24 @@ void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) &
{
double x = x_pt ? *x_pt : 0;
double y = y_pt ? *y_pt : 0;
if (!impl_->current_drawing_state_.svg_x_ || impl_->current_drawing_state_.in_group)
if (impl_->current_drawing_state_.in_group && impl_->current_group_ && x_pt)
{
if (impl_->current_drawing_state_.in_group && impl_->current_group_)
{
if (x_pt) x_pt = *x_pt * impl_->current_group_->scale_cx + impl_->current_group_->shift_x ;
// + (impl_->current_group_->flipH ? (impl_->current_group_->cx - 2 * x_pt): 0);
}
if (x_pt) impl_->current_drawing_state_.svg_x_ = length(length(*x_pt,length::pt).get_value_unit(length::cm),length::cm);
x_pt = *x_pt * impl_->current_group_->scale_cx + impl_->current_group_->shift_x ;
// + (impl_->current_group_->flipH ? (impl_->current_group_->cx - 2 * x_pt): 0);
}
if (!impl_->current_drawing_state_.svg_y_ || impl_->current_drawing_state_.in_group)
if (impl_->current_drawing_state_.in_group && impl_->current_group_ && y_pt)
{
if (impl_->current_drawing_state_.in_group && impl_->current_group_)
{
if (y_pt) y_pt = *y_pt * impl_->current_group_->scale_cy + impl_->current_group_->shift_y;
//+ (impl_->current_group_->flipV ? (impl_->current_group_->cy - 2 * y_pt): 0);
}
if (y_pt) impl_->current_drawing_state_.svg_y_ = length(length(*y_pt,length::pt).get_value_unit(length::cm),length::cm);
y_pt = *y_pt * impl_->current_group_->scale_cy + impl_->current_group_->shift_y;
//+ (impl_->current_group_->flipV ? (impl_->current_group_->cy - 2 * y_pt): 0);
}
if (!impl_->current_drawing_state_.svg_x_ || impl_->current_drawing_state_.in_group && x_pt)
{
impl_->current_drawing_state_.svg_x_ = length(length(*x_pt,length::pt).get_value_unit(length::cm),length::cm);
}
if (!impl_->current_drawing_state_.svg_y_ || impl_->current_drawing_state_.in_group && y_pt)
{
impl_->current_drawing_state_.svg_y_ = length(length(*y_pt,length::pt).get_value_unit(length::cm),length::cm);
}
}
void odf_drawing_context::get_size( double & width_pt, double & height_pt)
......@@ -1407,13 +1406,21 @@ void odf_drawing_context::set_size( _CP_OPT(double) & width_pt, _CP_OPT(double)
{
if (impl_->current_drawing_state_.in_group)
{
if (width_pt) width_pt = *width_pt * impl_->group_list_.back()->scale_cx;
if (height_pt)height_pt = *height_pt * impl_->group_list_.back()->scale_cy;
if (width_pt)
{
width_pt = *width_pt * impl_->group_list_.back()->scale_cx;
impl_->current_drawing_state_.svg_width_ = length(length(*width_pt,length::pt).get_value_unit(length::cm),length::cm);
}
if (height_pt)
{
height_pt = *height_pt * impl_->group_list_.back()->scale_cy;
impl_->current_drawing_state_.svg_height_= length(length(*height_pt,length::pt).get_value_unit(length::cm),length::cm);
}
}else
{
if (!impl_->current_drawing_state_.svg_width_) impl_->current_drawing_state_.svg_width_ = length(length(*width_pt,length::pt).get_value_unit(length::cm),length::cm);
if (!impl_->current_drawing_state_.svg_height_) impl_->current_drawing_state_.svg_height_= length(length(*height_pt,length::pt).get_value_unit(length::cm),length::cm);
}
//if (!impl_->current_drawing_state_.svg_width_)
if (width_pt) impl_->current_drawing_state_.svg_width_ = length(length(*width_pt,length::pt).get_value_unit(length::cm),length::cm);
//if (!impl_->current_drawing_state_.svg_height_)
if (height_pt) impl_->current_drawing_state_.svg_height_= length(length(*height_pt,length::pt).get_value_unit(length::cm),length::cm);
}
void odf_drawing_context::set_line_width(double pt)
{
......
......@@ -505,6 +505,85 @@ void odf_page_layout_context::set_page_size(_CP_OPT(length) width, _CP_OPT(lengt
props->style_page_layout_properties_attlist_.fo_page_height_ =
length(height->get_value_unit(length::cm),length::cm);
}
void odf_page_layout_context::set_page_number_format(_CP_OPT(int) & type, _CP_OPT(int) & start)
{
if (!type && ! start) return;
if (layout_state_list_.size() < 1) return;
office_element_ptr elm;
if (type)
{
switch(*type)
{
case 0: break; //numberformatAiueo = 0,
case 1: break; //numberformatAiueoFullWidth = 1,
case 2: break; //numberformatArabicAbjad = 2,
case 3: break; //numberformatArabicAlpha = 3,
case 4: break; //numberformatBahtText = 4,
case 5: break; //numberformatBullet = 5,
case 6: break; //numberformatCardinalText = 6,
case 7: break; //numberformatChicago = 7,
case 8: break; //numberformatChineseCounting = 8,
case 9: break; //numberformatChineseCountingThousand = 9,
case 10: break; //numberformatChineseLegalSimplified = 10,
case 11: break; //numberformatChosung = 11,
case 12: break; //numberformatCustom = 12,
case 13: break; //numberformatDecimal = 13,
case 14: break; //numberformatDecimalEnclosedCircle = 14,
case 15: break; //numberformatDecimalEnclosedCircleChinese = 15,
case 16: break; //numberformatDecimalEnclosedFullstop = 16,
case 17: break; //numberformatDecimalEnclosedParen = 17,
case 18: break; //numberformatDecimalFullWidth = 18,
case 19: break; //numberformatDecimalFullWidth2 = 19,
case 20: break; //numberformatDecimalHalfWidth = 20,
case 21: break; //numberformatDecimalZero = 21,
case 22: break; //numberformatDollarText = 22,
case 23: break; //numberformatGanada = 23,
case 24: break; //numberformatHebrew1 = 24,
case 25: break; //numberformatHebrew2 = 25,
case 26: break; //numberformatHex = 26,
case 27: break; //numberformatHindiConsonants = 27,
case 28: break; //numberformatHindiCounting = 28,
case 29: break; //numberformatHindinumbers = 29,
case 30: break; //numberformatHindiVowels = 30,
case 31: break; //numberformatIdeographDigital = 31,
case 32: break; //numberformatIdeographEnclosedCircle = 32,
case 33: break; //numberformatIdeographLegalTraditional = 33,
case 34: break; //numberformatIdeographTraditional = 34,
case 35: break; //numberformatIdeographZodiac = 35,
case 36: break; //numberformatIdeographZodiacTraditional = 36,
case 37: break; //numberformatIroha = 37,
case 38: break; //numberformatIrohaFullWidth = 38,
case 39: break; //numberformatJapaneseCounting = 39,
case 40: break; //numberformatJapaneseDigitalTenThousand = 40,
case 41: break; //numberformatJapaneseLegal = 41,
case 42: break; //numberformatKoreanCounting = 42,
case 43: break; //numberformatKoreanDigital = 43,
case 44: break; //numberformatKoreanDigital2 = 44,
case 45: break; //numberformatKoreanLegal = 45,
case 46: layout_state_list_.back().page_number_format = L"a"; break; //numberformatLowerLetter = 46,
case 47: layout_state_list_.back().page_number_format = L"i"; break; //numberformatLowerRoman = 47,
case 48: break; //numberformatNone = 48,
case 49: break; //numberformatnumberInDash = 49,
case 50: break; //numberformatOrdinal = 50,
case 51: break; //numberformatOrdinalText = 51,
case 52: break; //numberformatRussianLower = 52,
case 53: break; //numberformatRussianUpper = 53,
case 54: break; //numberformatTaiwaneseCounting = 54,
case 55: break; //numberformatTaiwaneseCountingThousand = 55,
case 56: break; //numberformatTaiwaneseDigital = 56,
case 57: break; //numberformatThaiCounting = 57,
case 58: break; //numberformatThaiLetters = 58,
case 59: break; //numberformatThainumbers = 59,
case 60: layout_state_list_.back().page_number_format = L"A"; break; //numberformatUpperLetter = 60,
case 61: layout_state_list_.back().page_number_format = L"I"; break; //numberformatUpperRoman = 61,
case 62: break; //numberformatVietnameseCounting = 62
default:
break;
}
}
}
void odf_page_layout_context::set_pages_mirrored(bool val)
{
......
......@@ -71,6 +71,8 @@ public:
void set_background(_CP_OPT(color) & color, int type);
void set_page_number_format(_CP_OPT(int) & type, _CP_OPT(int) & start);
double current_page_width_;
private:
......
......@@ -75,6 +75,8 @@ public:
_CP_OPT(length) header_size_;
_CP_OPT(length) footer_size_;
_CP_OPT(std::wstring) page_number_format;
private:
std::wstring style_oox_name_;
......
......@@ -426,6 +426,12 @@ void odf_text_context::start_field(int type)
if (page_numb)
{
page_numb->text_select_page_ = L"current";
if ((odf_context_->page_layout_context()) && (odf_context_->page_layout_context()->last_layout().page_number_format))
{
page_numb->common_num_format_attlist_.style_num_format_ = odf_context_->page_layout_context()->last_layout().page_number_format;
}
}
}
if (type == 3)
......
......@@ -12,6 +12,7 @@
#include "Shapes\oox_shapeRibbons.h"
#include "Shapes\oox_shapeConnectors.h"
#include "Shapes\oox_shapeWordArt.h"
#include "Shapes\oox_shapeCurvedArrows.h"
#include "..\..\..\Common\DocxFormat\Source\Common\SimpleTypes_Drawing.h"
......@@ -37,6 +38,8 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
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::shapetypePlaque: return boost::make_shared<oox_shape_Plaque>();
case SimpleTypes::shapetypeDoubleWave: return boost::make_shared<oox_shape_DoubleWave>();
......
......@@ -52,6 +52,8 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
_CP_OPT(double) width_pt, height_pt, x, y;
bool position_set = false;
for (unsigned int i=0; i < vml_style->m_arrProperties.size(); i++)
{
if (vml_style->m_arrProperties[i] == NULL) continue;
......@@ -96,6 +98,7 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
case SimpleTypes::Vml::cssmsoposhorInside: odf_context()->drawing_context()->set_horizontal_pos(1); break;
case SimpleTypes::Vml::cssmsoposhorOutside : odf_context()->drawing_context()->set_horizontal_pos(3); break;
}
position_set = true;
break;
case SimpleTypes::Vml::cssptMsoPositionHorizontalRelative:
switch(vml_style->m_arrProperties[i]->get_Value().eMsoPosHorRel)
......@@ -105,6 +108,7 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
case SimpleTypes::Vml::cssmsoposhorrelText: odf_context()->drawing_context()->set_horizontal_rel(1); break;
case SimpleTypes::Vml::cssmsoposhorrelChar: odf_context()->drawing_context()->set_horizontal_rel(0); break;
}
position_set = true;
break;
case SimpleTypes::Vml::cssptMsoPositionVertical:
switch(vml_style->m_arrProperties[i]->get_Value().eMsoPosVer)
......@@ -116,6 +120,7 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
case SimpleTypes::Vml::cssmsoposverInside: odf_context()->drawing_context()->set_vertical_pos(2); break;//??
case SimpleTypes::Vml::cssmsoposverOutside: odf_context()->drawing_context()->set_vertical_pos(3); break;//??
}
position_set = true;
break;
case SimpleTypes::Vml::cssptMsoPositionVerticalRelative:
switch(vml_style->m_arrProperties[i]->get_Value().eMsoPosVerRel)
......@@ -125,6 +130,7 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
case SimpleTypes::Vml::cssmsoposverrelText: odf_context()->drawing_context()->set_vertical_rel(6); break;
case SimpleTypes::Vml::cssmsoposverrelLine: odf_context()->drawing_context()->set_vertical_rel(2); break;
}
position_set = true;
break;
case SimpleTypes::Vml::cssptZIndex:
{
......@@ -165,6 +171,7 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
}break;
}
}
if (x || y) position_set = true;
if (group)
{
_CP_OPT(double) not_set;
......@@ -177,7 +184,9 @@ void OoxConverter::convert(SimpleTypes::Vml::CCssStyle *vml_style, bool group)
odf_context()->drawing_context()->set_size (width_pt, height_pt);
odf_context()->drawing_context()->set_position (x, y);
if (x && y)
if (!position_set)
odf_context()->drawing_context()->set_anchor(4);
else if (x && y)
odf_context()->drawing_context()->set_anchor(2);
}
......@@ -619,21 +628,26 @@ void OoxConverter::convert(OOX::Vml::CVmlCommonElements *vml_common)
odf_context()->drawing_context()->end_line_properties();
odf_context()->drawing_context()->start_area_properties();
{
if (vml_common->m_oFillColor.IsInit() && vml_common->m_oFilled.GetValue())
if (vml_common->m_oFilled.IsInit() && vml_common->m_oFilled->GetValue() == SimpleTypes::booleanFalse)
{
unsigned char ucA=0, ucR=0, ucG=0, ucB=0;
ucR = vml_common->m_oFillColor->Get_R();
ucB = vml_common->m_oFillColor->Get_B();
ucG = vml_common->m_oFillColor->Get_G();
SimpleTypes::CHexColor<> *oRgbColor = new SimpleTypes::CHexColor<>(ucR,ucG,ucB);
if (oRgbColor)
{
odf_context()->drawing_context()->set_solid_fill(string2std_string(oRgbColor->ToString().Right(6)));
delete oRgbColor;
}
}
else if (vml_common->m_oFilled.GetValue() == SimpleTypes::booleanFalse)
odf_context()->drawing_context()->set_no_fill();
}
else
{
if (vml_common->m_oFillColor.IsInit())
{
unsigned char ucA=0, ucR=0, ucG=0, ucB=0;
ucR = vml_common->m_oFillColor->Get_R();
ucB = vml_common->m_oFillColor->Get_B();
ucG = vml_common->m_oFillColor->Get_G();
SimpleTypes::CHexColor<> *oRgbColor = new SimpleTypes::CHexColor<>(ucR,ucG,ucB);
if (oRgbColor)
{
odf_context()->drawing_context()->set_solid_fill(string2std_string(oRgbColor->ToString().Right(6)));
delete oRgbColor;
}
}
}
}
odf_context()->drawing_context()->end_area_properties();
for (unsigned int i=0 ; i < vml_common->m_arrItems.size();i++)
......
......@@ -755,14 +755,24 @@ void DocxConverter::convert(OOX::Logic::CParagraphProperty *oox_paragraph_pr, cp
odt_context->text_context()->set_type_break(1, 0); //page, clear_all
}
if (oox_paragraph_pr->m_oKeepNext.IsInit()& odt_context->table_context()->empty())
if (oox_paragraph_pr->m_oKeepNext.IsInit() && odt_context->table_context()->empty()/* && !oox_paragraph_pr->m_oFramePr.IsInit()*/)
{
odt_context->text_context()->set_KeepNextParagraph(true);
}
convert(oox_paragraph_pr->m_oFramePr.GetPointer(), paragraph_properties); //
convert(oox_paragraph_pr->m_oSectPr.GetPointer());
if (oox_paragraph_pr->m_oSectPr.IsInit())
{
if (oox_paragraph_pr->m_oSectPr->m_oPgNumType.IsInit())
{
if (oox_paragraph_pr->m_oSectPr->m_oPgNumType->m_oStart.IsInit())
paragraph_properties->content().style_page_number_ = oox_paragraph_pr->m_oSectPr->m_oPgNumType->m_oStart->GetValue();
//paragraph//style:page-number=
}
convert(oox_paragraph_pr->m_oSectPr.GetPointer());
}
if (oox_paragraph_pr->m_oTabs.IsInit())
{
......@@ -771,15 +781,19 @@ void DocxConverter::convert(OOX::Logic::CParagraphProperty *oox_paragraph_pr, cp
{
if (oox_paragraph_pr->m_oTabs->m_arrTabs[i] == NULL) continue;
_CP_OPT(int) type;
_CP_OPT(int) leader;
_CP_OPT(odf::length) length;
if (oox_paragraph_pr->m_oTabs->m_arrTabs[i]->m_oVal.IsInit())
type = oox_paragraph_pr->m_oTabs->m_arrTabs[i]->m_oVal->GetValue();
if (type == 2) continue; //clear tab
convert(oox_paragraph_pr->m_oTabs->m_arrTabs[i]->m_oPos.GetPointer(), length);
if (oox_paragraph_pr->m_oTabs->m_arrTabs[i]->m_oLeader.IsInit())
leader = oox_paragraph_pr->m_oTabs->m_arrTabs[i]->m_oLeader->GetValue();
convert(oox_paragraph_pr->m_oTabs->m_arrTabs[i]->m_oPos.GetPointer(), length );
odf_context()->add_tab(type, length);
odf_context()->add_tab(type, length, leader);
}
odf_context()->end_tabs();
}
......@@ -1005,8 +1019,19 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oRtlGutter;
//nullable<ComplexTypes::Word::CVerticalJc > m_oVAlign;
//nullable<ComplexTypes::Word::CPageNumber > m_oPgNumType;
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oTitlePg;
if (oox_section_pr->m_oPgNumType.IsInit())
{
_CP_OPT(int) format;
_CP_OPT(int) start;
if (oox_section_pr->m_oPgNumType->m_oFmt.IsInit()) format = oox_section_pr->m_oPgNumType->m_oFmt->GetValue();
if (oox_section_pr->m_oPgNumType->m_oStart.IsInit())start = oox_section_pr->m_oPgNumType->m_oStart->GetValue();
odt_context->page_layout_context()->set_page_number_format( format, start);
//nullable<SimpleTypes::CChapterSep<> > m_oChapSep;
//nullable<SimpleTypes::CDecimalNumber<> > m_oChapStyle;
}
for (unsigned int i=0; i< oox_section_pr->m_arrHeaderReference.size(); i++)
{
......@@ -2186,10 +2211,13 @@ void DocxConverter::convert(OOX::Drawing::CDiagrammParts *oox_diagramm)
{
OOX::CDiagramDrawing * diag_drawing = (OOX::CDiagramDrawing*)oFile.operator->();
oox_current_child_document = diag_drawing;
for (unsigned int i=0; i < diag_drawing->m_arrShapeTree.size(); i++)
{
OoxConverter::convert(diag_drawing->m_arrShapeTree[i]);
}
oox_current_child_document = NULL;
}
}
......@@ -2529,7 +2557,30 @@ void DocxConverter::convert_styles()
for (unsigned int i=0; i< docx_styles->m_arrStyle.size(); i++)
{
if (docx_styles->m_arrStyle[i] == NULL) continue;
convert(docx_styles->m_arrStyle[i]);
if (i == 0 && docx_styles->m_arrStyle[i]->m_oDefault.IsInit() && docx_styles->m_arrStyle[i]->m_oDefault->ToBool())
{
//NADIE_COMO_TU.docx , Normal
odf::odf_style_state_ptr def_style_state;
odf::style_paragraph_properties * def_para_properties = NULL;
odf::style_text_properties * def_text_properties = NULL;
if (odt_context->styles_context()->find_odf_default_style_state(odf::style_family::Paragraph, def_style_state) && def_style_state)
{
def_para_properties = def_style_state->get_paragraph_properties();
def_text_properties = def_style_state->get_text_properties();
odf::style_paragraph_properties * para_properties = odt_context->styles_context()->last_state()->get_paragraph_properties();
odf::style_text_properties * text_properties = odt_context->styles_context()->last_state()->get_text_properties();
def_para_properties->apply_from(para_properties);
def_text_properties->apply_from(text_properties);
}
}
}
}
......@@ -3278,10 +3329,9 @@ void DocxConverter::convert(OOX::Logic::CTblGrid *oox_table_grid)
odt_context->add_table_column(width);
if (width > 0 && width < 5)
if (width > 0 && width < 5) //2222010_53102Reader final.docx -
{
odt_context->table_context()->set_column_optimal(true);
width *=10;
//odt_context->table_context()->set_column_optimal(true);
//2222010_53102Reader final.docx
}
......@@ -3707,7 +3757,7 @@ bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr,
if (cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_top_ && del_border>=0)
cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_top_ = boost::none;
else if (!cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_top_ && del_border<0)
else if (border_inside_h && del_border<0)
cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_top_ = *border_inside_h;
}
if (row != odt_context->table_context()->count_rows())
......@@ -3715,7 +3765,7 @@ bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr,
if (cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_bottom_ && del_border>=0)
cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_bottom_ = boost::none;
else if (!cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_bottom_ && del_border<0)
else if (border_inside_h && del_border<0)
cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_bottom_ = *border_inside_h;
}
}
......@@ -3727,7 +3777,7 @@ bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr,
if (cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_left_ && del_border>=0)
cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_left_ = boost::none;
else if (!cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_left_ && del_border<0)
else if (border_inside_h && del_border<0)
cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_left_ = *border_inside_h;
}
if (col != odt_context->table_context()->count_columns())
......@@ -3735,7 +3785,7 @@ bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr,
if (cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_right_ && del_border>=0)
cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_right_ = boost::none;
else if (!cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_right_ && del_border<0)
else if (border_inside_h && del_border<0)
cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_right_ = *border_inside_h;
}
}
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//151
#define INTVER 1,2,0,151
#define STRVER "1,2,0,151\0"
//153
#define INTVER 1,2,0,153
#define STRVER "1,2,0,153\0"
#pragma once
#include "../IFileContainer.h"
#include "../FileTypes.h"
#include "../File.h"
#include "../../Base/Nullable.h"
......@@ -152,7 +153,7 @@ namespace Diagram
nullable<Drawing::CGroupShapeProperties> m_oGroupShapeProperties;
};
}
class CDiagramDrawing : public OOX::File
class CDiagramDrawing : public OOX::File, public OOX::IFileContainer
{
public:
CDiagramDrawing()
......@@ -172,6 +173,7 @@ namespace Diagram
virtual void read(const CPath& oFilePath)
{
IFileContainer::Read( oFilePath );
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
......
......@@ -503,8 +503,7 @@ namespace OOX
ComplexTypes_WriteAttribute ( _T("chromakey=\""), m_oChromaKey );
if ( SimpleTypes::booleanTrue != m_oFilled.GetValue() )
sResult += _T("filled=\"false\" ");
ComplexTypes_WriteAttribute ( _T("filled=\""), m_oFilled );
ComplexTypes_WriteAttribute ( _T("fillcolor=\""), m_oFillColor );
ComplexTypes_WriteAttribute ( _T("opacity=\""), m_oOpacity );
......
......@@ -81,7 +81,7 @@ namespace OOX
// 2 AG_AllShapeAttributes
// 2.1 AG_ShapeAttributes
nullable<SimpleTypes::CColorType<>> m_oChromaKey;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oFilled;
nullable<SimpleTypes::CTrueFalse<>> m_oFilled;
nullable<SimpleTypes::CColorType<>> m_oFillColor;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oOpacity;
nullable<SimpleTypes::CTrueFalse<>> m_oStroked;
......
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