Commit a3369173 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatWriter - image bullet presentation list style

parent 8925ddee
...@@ -67,30 +67,41 @@ public: ...@@ -67,30 +67,41 @@ public:
odf_type_name =L"ooxml-snip2DiagRect"; odf_type_name =L"ooxml-snip2DiagRect";
modifiers = L"0 16667"; modifiers = L"0 16667";
enhanced_path = L"M ?f9 ?f2 L ?f13 ?f2 ?f1 ?f12 ?f1 ?f11 ?f10 ?f3 ?f12 ?f3 ?f0 ?f14 ?f0 ?f9 Z N"; enhanced_path = L"M ?f3 0 L ?f7 0 ?f14 ?f6 ?f14 ?f5 ?f4 ?f17 ?f6 ?f17 0 ?f8 0 ?f3 Z N";
text_areas = L"?f17 ?f17 ?f18 ?f19"; text_areas = L"?f11 ?f11 ?f12 ?f13";
view_box = L"0 0 21600 21600"; view_box = L"0 0 0 0";
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
add(L"f1", L"if(0-$1 ,0,if(50000-$1 ,$1 ,50000))");
add(L"f2", L"min(logwidth,logheight)");
add(L"f3", L"?f2 *?f0 /100000");
add(L"f4", L"logwidth+0-?f3 ");
add(L"f5", L"logheight+0-?f3 ");
add(L"f6", L"?f2 *?f1 /100000");
add(L"f7", L"logwidth+0-?f6 ");
add(L"f8", L"logheight+0-?f6 ");
add(L"f9", L"?f3 +0-?f6 ");
add(L"f10", L"if(?f9 ,?f3 ,?f6 )");
add(L"f11", L"?f10 *1/2");
add(L"f12", L"logwidth+0-?f11 ");
add(L"f13", L"logheight+0-?f11 ");
add(L"f14", L"logwidth");
add(L"f15", L"logheight/2");
add(L"f16", L"logwidth/2");
add(L"f17", L"logheight");
_handle h;
h.position = L"?f3 0";
h.x_maximum= L"50000";
h.x_minimum= L"0";
handles.push_back(h);
h.position = L"?f7 0";
h.x_maximum= L"50000";
h.x_minimum= L"0";
handles.push_back(h);
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"min(?f5, ?f4)");
add(L"f7", L"$0");
add(L"f8", L"$1");
add(L"f9", L"?f6 * ?f7 / 100000");
add(L"f10", L"?f1 - ?f9");
add(L"f11", L"?f3 - ?f9");
add(L"f12", L"?f6 * ?f8 / 100000");
add(L"f13", L"?f1 - ?f12");
add(L"f14", L"?f3 - ?f12");
add(L"f15", L"?f9 - ?f12");
add(L"f16", L"if(?f15, ?f9, ?f12)");
add(L"f17", L"?f16 / 2");
add(L"f18", L"?f1 - ?f17");
add(L"f19", L"?f3 - ?f17");
} }
}; };
class oox_shape_snip2SameRect : public oox_shape class oox_shape_snip2SameRect : public oox_shape
......
...@@ -289,7 +289,14 @@ office_element_ptr odf_conversion_context::start_tabs() ...@@ -289,7 +289,14 @@ office_element_ptr odf_conversion_context::start_tabs()
create_element(L"style", L"tab-stops", temporary_.elm, this,true); create_element(L"style", L"tab-stops", temporary_.elm, this,true);
return temporary_.elm; return temporary_.elm;
} }
std::wstring odf_conversion_context::add_image(const std::wstring & image_file_name)
{
std::wstring odf_ref_name ;
mediaitems()->add_or_find(image_file_name,_mediaitems::typeImage, odf_ref_name);
return odf_ref_name;
}
void odf_conversion_context::add_tab(_CP_OPT(int) type, _CP_OPT(length) _length, _CP_OPT(int) leader) void odf_conversion_context::add_tab(_CP_OPT(int) type, _CP_OPT(length) _length, _CP_OPT(int) leader)
{ {
if (!temporary_.elm) return; if (!temporary_.elm) return;
......
...@@ -95,7 +95,7 @@ public: ...@@ -95,7 +95,7 @@ public:
virtual void start_text_context() = 0; virtual void start_text_context() = 0;
virtual void end_text_context() = 0; virtual void end_text_context() = 0;
virtual void start_image(const std::wstring & image_file_name) = 0; std::wstring add_image(const std::wstring & image_file_name);
virtual odf_style_context * styles_context(); virtual odf_style_context * styles_context();
......
...@@ -125,7 +125,7 @@ public: ...@@ -125,7 +125,7 @@ public:
void start_frame (); void start_frame ();
void end_frame (); void end_frame ();
void start_image (std::wstring file_path); void start_image (std::wstring odf_file_path);
void end_image (); void end_image ();
bool change_text_box_2_wordart (); bool change_text_box_2_wordart ();
......
...@@ -560,8 +560,8 @@ void odf_lists_styles_context::set_bullet_image_size(double size) ...@@ -560,8 +560,8 @@ void odf_lists_styles_context::set_bullet_image_size(double size)
if(!props) return; if(!props) return;
props->fo_width_ = length(length(size,length::pt).get_value_unit(length::cm),length::cm); props->fo_width_ = length(length(size, length::pt).get_value_unit(length::cm), length::cm);
props->fo_height_ = length(length(size,length::pt).get_value_unit(length::cm),length::cm); props->fo_height_ = length(length(size, length::pt).get_value_unit(length::cm), length::cm);
} }
void odf_lists_styles_context::set_bullet_image (std::wstring ref) void odf_lists_styles_context::set_bullet_image (std::wstring ref)
{ {
...@@ -574,9 +574,9 @@ void odf_lists_styles_context::set_bullet_image (std::wstring ref) ...@@ -574,9 +574,9 @@ void odf_lists_styles_context::set_bullet_image (std::wstring ref)
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.href_ = ref; style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.href_ = ref;
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.type_= xlink_type::Simple; style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.type_ = xlink_type::Simple;
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.show_ = xlink_show::Embed; style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.show_ = xlink_show::Embed;
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.actuate_= xlink_actuate::OnLoad; style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.actuate_ = xlink_actuate::OnLoad;
} }
void odf_lists_styles_context::set_start_number(int val) void odf_lists_styles_context::set_start_number(int val)
{ {
......
...@@ -147,14 +147,7 @@ void odp_conversion_context::end_drawings() ...@@ -147,14 +147,7 @@ void odp_conversion_context::end_drawings()
{ {
current_slide().drawing_context()->clear(); current_slide().drawing_context()->clear();
} }
void odp_conversion_context::start_image(const std::wstring & image_file_name)
{
std::wstring odf_ref_name ;
mediaitems()->add_or_find(image_file_name,_mediaitems::typeImage,odf_ref_name);
current_slide().drawing_context()->start_image(odf_ref_name);
}
void odp_conversion_context::start_comment(int oox_comm_id) void odp_conversion_context::start_comment(int oox_comm_id)
{ {
office_element_ptr comm_elm; office_element_ptr comm_elm;
......
...@@ -72,8 +72,6 @@ public: ...@@ -72,8 +72,6 @@ public:
void start_drawings(); void start_drawings();
void end_drawings(); void end_drawings();
virtual void start_image(const std::wstring & image_file_name);
void start_comment (int oox_comment_id); void start_comment (int oox_comment_id);
void end_comment (); void end_comment ();
void start_comment_content (); void start_comment_content ();
......
...@@ -527,14 +527,7 @@ void ods_conversion_context::end_drawings() ...@@ -527,14 +527,7 @@ void ods_conversion_context::end_drawings()
{ {
current_table().drawing_context()->clear(); current_table().drawing_context()->clear();
} }
void ods_conversion_context::start_image(const std::wstring & image_file_name)
{
std::wstring odf_ref_name ;
mediaitems()->add_or_find(image_file_name,_mediaitems::typeImage,odf_ref_name);
current_table().drawing_context()->start_image(odf_ref_name);
}
double ods_conversion_context::convert_symbol_width(double val) double ods_conversion_context::convert_symbol_width(double val)
{ {
//width = ((int)((column_width * Digit_Width + 5) / Digit_Width * 256 )) / 256.; //width = ((int)((column_width * Digit_Width + 5) / Digit_Width * 256 )) / 256.;
......
...@@ -101,8 +101,6 @@ public: ...@@ -101,8 +101,6 @@ public:
void start_drawings(); void start_drawings();
void end_drawings(); void end_drawings();
virtual void start_image(const std::wstring & image_file_name);
double convert_symbol_width(double val); double convert_symbol_width(double val);
void add_defined_range (const std::wstring & name, const std::wstring & cell_range, int sheet_id, bool printable = false); void add_defined_range (const std::wstring & name, const std::wstring & cell_range, int sheet_id, bool printable = false);
......
...@@ -915,14 +915,6 @@ void odt_conversion_context::end_change (int id, int type) ...@@ -915,14 +915,6 @@ void odt_conversion_context::end_change (int id, int type)
// return (text_changes_state_.current_types.back() == 2); // return (text_changes_state_.current_types.back() == 2);
//} //}
//-------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------
void odt_conversion_context::start_image(const std::wstring & image_file_name)
{
std::wstring odf_ref_name ;
mediaitems()->add_or_find(image_file_name, _mediaitems::typeImage,odf_ref_name);
drawing_context()->start_image(odf_ref_name);
}
void odt_conversion_context::start_drop_cap(style_paragraph_properties *paragraph_properties) void odt_conversion_context::start_drop_cap(style_paragraph_properties *paragraph_properties)
{ {
......
...@@ -82,7 +82,6 @@ public: ...@@ -82,7 +82,6 @@ public:
void start_drawings (); void start_drawings ();
void end_drawings (); void end_drawings ();
virtual void start_image(const std::wstring & image_file_name);
void add_text_content (const std::wstring & text); void add_text_content (const std::wstring & text);
void start_paragraph (bool styled = false); void start_paragraph (bool styled = false);
......
...@@ -223,8 +223,10 @@ void OoxConverter::convert(PPTX::Logic::Pic *oox_picture) ...@@ -223,8 +223,10 @@ void OoxConverter::convert(PPTX::Logic::Pic *oox_picture)
pathImage = oox_picture->blipFill.blip->link->get(); pathImage = oox_picture->blipFill.blip->link->get();
} }
} }
std::wstring odf_ref = odf_context()->add_image(pathImage);
odf_context()->drawing_context()->start_drawing(); odf_context()->drawing_context()->start_drawing();
odf_context()->start_image(pathImage); odf_context()->drawing_context()->start_image(odf_ref);
{ {
double Width = 0, Height = 0; double Width = 0, Height = 0;
_graphics_utils_::GetResolution(pathImage.c_str(), Width, Height); _graphics_utils_::GetResolution(pathImage.c_str(), Width, Height);
...@@ -1120,18 +1122,19 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro ...@@ -1120,18 +1122,19 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro
if (bullet.is<PPTX::Logic::BuNone>())return; if (bullet.is<PPTX::Logic::BuNone>())return;
int odf_list_type = 13; // 1, 2, 3 ...
if (bullet.is<PPTX::Logic::BuAutoNum>()) if (bullet.is<PPTX::Logic::BuAutoNum>())
{ {
const PPTX::Logic::BuAutoNum & buAutoNum = bullet.as<PPTX::Logic::BuAutoNum>(); const PPTX::Logic::BuAutoNum & buAutoNum = bullet.as<PPTX::Logic::BuAutoNum>();
int type = 13;
int pptx_type = buAutoNum.type.GetBYTECode(); int pptx_type = buAutoNum.type.GetBYTECode();
if ( pptx_type < 3) type = 46; if ( pptx_type < 3) odf_list_type = 46;
if (pptx_type > 2 && pptx_type < 6) type = 60; if (pptx_type > 2 && pptx_type < 6) odf_list_type = 60;
if (pptx_type > 28 && pptx_type < 32) type = 47; if (pptx_type > 28 && pptx_type < 32) odf_list_type = 47;
if (pptx_type > 31 && pptx_type < 35) type = 61; if (pptx_type > 31 && pptx_type < 35) odf_list_type = 61;
odf_context()->styles_context()->lists_styles().start_style_level(level, type); odf_context()->styles_context()->lists_styles().start_style_level(level, odf_list_type);
if (buAutoNum.startAt.IsInit()) if (buAutoNum.startAt.IsInit())
{ {
...@@ -1142,18 +1145,34 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro ...@@ -1142,18 +1145,34 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro
} }
if (bullet.is<PPTX::Logic::BuChar>()) if (bullet.is<PPTX::Logic::BuChar>())
{ {
odf_list_type = 5;
const PPTX::Logic::BuChar & buChar = bullet.as<PPTX::Logic::BuChar>(); const PPTX::Logic::BuChar & buChar = bullet.as<PPTX::Logic::BuChar>();
odf_context()->styles_context()->lists_styles().start_style_level(level, 5 ); odf_context()->styles_context()->lists_styles().start_style_level(level, odf_list_type);
odf_context()->styles_context()->lists_styles().set_bullet_char(buChar.Char); odf_context()->styles_context()->lists_styles().set_bullet_char(buChar.Char);
} }
if (bullet.is<PPTX::Logic::BuBlip>()) if (bullet.is<PPTX::Logic::BuBlip>())
{ {
odf_list_type = 1000;
const PPTX::Logic::BuBlip & buBlip = bullet.as<PPTX::Logic::BuBlip>(); const PPTX::Logic::BuBlip & buBlip = bullet.as<PPTX::Logic::BuBlip>();
std::wstring pathImage;
std::wstring sID;
odf_context()->styles_context()->lists_styles().start_style_level(level, 1000 ); if (buBlip.blip.embed.IsInit())
{
sID = buBlip.blip.embed->get();
pathImage = find_link_by_id(sID, 1);
}
else if (buBlip.blip.link.IsInit())
{
pathImage = buBlip.blip.link->get();
}
std::wstring odf_ref = odf_context()->add_image(pathImage);
odf_context()->styles_context()->lists_styles().set_bullet_image(odf_context()->mediaitems()->items().back().odf_ref); odf_context()->styles_context()->lists_styles().start_style_level(level, odf_list_type );
odf_context()->styles_context()->lists_styles().set_bullet_image(odf_ref);
} }
//odf_writer::style_list_level_label_alignment * aligment_props = odf_context()->styles_context()->lists_styles().get_list_level_alignment_properties(); //odf_writer::style_list_level_label_alignment * aligment_props = odf_context()->styles_context()->lists_styles().get_list_level_alignment_properties();
...@@ -1164,8 +1183,8 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro ...@@ -1164,8 +1183,8 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro
if (oox_para_props->indent.IsInit()) if (oox_para_props->indent.IsInit())
{ {
level_props->text_space_before_ = odf_types::length(- oox_para_props->indent.get() / 12700., odf_types::length::pt); level_props->text_min_label_width_ = odf_types::length(- oox_para_props->indent.get() / 12700., odf_types::length::pt);
level_props->text_min_label_width_ = odf_types::length(1, odf_types::length::pt); level_props->text_space_before_ = odf_types::length(1, odf_types::length::pt);
}else }else
{ {
...@@ -1192,26 +1211,68 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro ...@@ -1192,26 +1211,68 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro
text_properties->content_.fo_color_ = odf_types::color(hexColor); text_properties->content_.fo_color_ = odf_types::color(hexColor);
} }
} }
//-----------------------------------
if (oox_para_props->buSize.is<PPTX::Logic::BuSzPts>())
{
const PPTX::Logic::BuSzPts & buSzPts = oox_para_props->buSize.as<PPTX::Logic::BuSzPts>();
if (buSzPts.val.IsInit())
{
if (text_properties)
text_properties->content_.fo_font_size_ = odf_types::length(*buSzPts.val, odf_types::length::pt);
else if (odf_list_type == 1000)
odf_context()->styles_context()->lists_styles().set_bullet_image_size(*buSzPts.val);
}
}
else
{
double size_pt = oox_para_props->defRPr.IsInit() ? (oox_para_props->defRPr->sz.IsInit() ? *oox_para_props->defRPr->sz /100. : 0) : 0;
if (size_pt < 0.001 && odf_list_type == 1000)
{
odf_writer::style_text_properties * text_props = odf_context()->styles_context()->last_state(odf_types::style_family::Paragraph)->get_text_properties();
if (text_props && text_props->content_.fo_font_size_)
{
size_pt = text_props->content_.fo_font_size_->get_length().get_value_unit(odf_types::length::pt);
}
if (size_pt < 0.001)
{
odf_writer::odf_style_state_ptr style_state;
odf_context()->styles_context()->find_odf_default_style_state(odf_types::style_family::Text, style_state);
if (style_state)
text_props = style_state->get_text_properties();
if (text_props && text_props->content_.fo_font_size_)
{
size_pt = text_props->content_.fo_font_size_->get_length().get_value_unit(odf_types::length::pt);
}
}
}
if (oox_para_props->buSize.is<PPTX::Logic::BuSzTx>()) if (oox_para_props->buSize.is<PPTX::Logic::BuSzTx>())
{ {
const PPTX::Logic::BuSzTx & buSzTx = oox_para_props->buSize.as<PPTX::Logic::BuSzTx>(); //equal tet size
} }
else if (oox_para_props->buSize.is<PPTX::Logic::BuSzPct>())
if (oox_para_props->buSize.is<PPTX::Logic::BuSzPct>())
{ {
const PPTX::Logic::BuSzPct & buSzPct = oox_para_props->buSize.as<PPTX::Logic::BuSzPct>(); const PPTX::Logic::BuSzPct & buSzPct = oox_para_props->buSize.as<PPTX::Logic::BuSzPct>();
if (buSzPct.val.IsInit()) if (buSzPct.val.IsInit())
{
if (text_properties)
text_properties->content_.fo_font_size_ = odf_types::percent(*buSzPct.val / 1000.); text_properties->content_.fo_font_size_ = odf_types::percent(*buSzPct.val / 1000.);
size_pt *= *buSzPct.val / 100000.;
} }
else }
if (text_properties && !text_properties->content_.fo_font_size_)
text_properties->content_.fo_font_size_ = odf_types::percent(100.); text_properties->content_.fo_font_size_ = odf_types::percent(100.);
else if (odf_list_type == 1000)
if (oox_para_props->buSize.is<PPTX::Logic::BuSzPts>())
{ {
const PPTX::Logic::BuSzPts & buSzPts = oox_para_props->buSize.as<PPTX::Logic::BuSzPts>(); odf_context()->styles_context()->lists_styles().set_bullet_image_size(size_pt);
if (buSzPts.val.IsInit())
text_properties->content_.fo_font_size_ = odf_types::length(*buSzPts.val, odf_types::length::pt);
} }
else if (oox_para_props->buTypeface.is<PPTX::Logic::BuFontTx>()) }
//----------------
if (oox_para_props->buTypeface.is<PPTX::Logic::BuFontTx>())
{ {
const PPTX::Logic::BuFontTx & buFontTx = oox_para_props->buTypeface.as<PPTX::Logic::BuFontTx>(); const PPTX::Logic::BuFontTx & buFontTx = oox_para_props->buTypeface.as<PPTX::Logic::BuFontTx>();
} }
...@@ -1221,7 +1282,8 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro ...@@ -1221,7 +1282,8 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro
std::wstring font = textFont.typeface; std::wstring font = textFont.typeface;
convert_font(theme, font); convert_font(theme, font);
if (!font.empty()) text_properties->content_.fo_font_family_ = font; if (!font.empty() && text_properties)
text_properties->content_.fo_font_family_ = font;
} }
odf_context()->styles_context()->lists_styles().end_style_level(); odf_context()->styles_context()->lists_styles().end_style_level();
...@@ -1245,6 +1307,7 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T ...@@ -1245,6 +1307,7 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T
bool styled = false; bool styled = false;
bool list_local = false;
bool list_present = false; bool list_present = false;
std::wstring list_style_name; std::wstring list_style_name;
...@@ -1252,10 +1315,14 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T ...@@ -1252,10 +1315,14 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T
NSCommon::nullable<PPTX::Logic::TextParagraphPr> paraPr; NSCommon::nullable<PPTX::Logic::TextParagraphPr> paraPr;
if (oox_paragraph->pPr.IsInit() && oox_paragraph->pPr->lvl.IsInit()) if (oox_paragraph->pPr.IsInit())
{ {
if (oox_paragraph->pPr->lvl.IsInit())
list_level = *oox_paragraph->pPr->lvl; list_level = *oox_paragraph->pPr->lvl;
if (oox_paragraph->pPr->ParagraphBullet.is_init())
list_local = true;
} }
if (oox_list_style && list_level >= 0 && list_level < 10) if (oox_list_style && list_level >= 0 && list_level < 10)
{ {
if (oox_list_style->levels[list_level].IsInit()) if (oox_list_style->levels[list_level].IsInit())
...@@ -1311,12 +1378,19 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T ...@@ -1311,12 +1378,19 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T
} }
if (odf_context()->text_context()->list_state_.started_list == false) if (odf_context()->text_context()->list_state_.started_list == false)
{
if (list_local)
{ {
odf_context()->styles_context()->lists_styles().start_style(); odf_context()->styles_context()->lists_styles().start_style();
convert_list_level(paraPr.GetPointer(), list_level - 1); convert_list_level(oox_paragraph->pPr.GetPointer(), list_level - 1);
odf_context()->styles_context()->lists_styles().end_style(); odf_context()->styles_context()->lists_styles().end_style();
list_style_name = odf_context()->styles_context()->lists_styles().get_style_name(); list_style_name = odf_context()->styles_context()->lists_styles().get_style_name(); //last added
}
else
{
// !!!
}
odf_context()->text_context()->start_list(list_style_name); odf_context()->text_context()->start_list(list_style_name);
} }
......
...@@ -3184,7 +3184,9 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl) ...@@ -3184,7 +3184,9 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
} }
if (type_list == 2 || type_list == 3) if (type_list == 2 || type_list == 3)
{
odt_context->styles_context()->lists_styles().set_bullet_image_size(size_bullet_number_marker); odt_context->styles_context()->lists_styles().set_bullet_image_size(size_bullet_number_marker);
}
if (oox_num_lvl->m_oLvlRestart.IsInit() && oox_num_lvl->m_oLvlRestart->m_oVal.IsInit() && type_list == 1) if (oox_num_lvl->m_oLvlRestart.IsInit() && oox_num_lvl->m_oLvlRestart->m_oVal.IsInit() && type_list == 1)
{ {
......
...@@ -1748,236 +1748,6 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFromTo* oox_from_to, oox_table_po ...@@ -1748,236 +1748,6 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFromTo* oox_from_to, oox_table_po
if (oox_from_to->m_oColOff.IsInit()) pos->col_off = oox_from_to->m_oColOff->GetValue();//pt if (oox_from_to->m_oColOff.IsInit()) pos->col_off = oox_from_to->m_oColOff->GetValue();//pt
} }
//void XlsxConverter::convert(OOX::Spreadsheet::CGroupShape* oox_group_shape)
//{
// if (!oox_group_shape)return;
// if (oox_group_shape->m_arrItems.size() < 1) return;
//
// ods_context->drawing_context()->start_group();
//
// if (oox_group_shape->m_oNvGroupSpPr.IsInit())
// {
// if (oox_group_shape->m_oNvGroupSpPr->m_oCNvPr.IsInit())
// {
// if (oox_group_shape->m_oNvGroupSpPr->m_oCNvPr->m_sName.IsInit())
// ods_context->drawing_context()->set_group_name(*oox_group_shape->m_oNvGroupSpPr->m_oCNvPr->m_sName);
// if (oox_group_shape->m_oNvGroupSpPr->m_oCNvPr->m_oId.IsInit())
// ods_context->drawing_context()->set_group_z_order(oox_group_shape->m_oNvGroupSpPr->m_oCNvPr->m_oId->GetValue());
// }
// }
//
// OoxConverter::convert(oox_group_shape->m_oGroupSpPr.GetPointer());
//
// for (unsigned int i=0; i < oox_group_shape->m_arrItems.size(); i++)
// {
// switch(oox_group_shape->m_arrItems[i]->getType())
// {
// case OOX::et_x_Shape:
// {
// OOX::Spreadsheet::CShape* item = dynamic_cast<OOX::Spreadsheet::CShape*>(oox_group_shape->m_arrItems[i]);
// convert(item);
// }break;
// case OOX::et_x_ConnShape:
// {
// OOX::Spreadsheet::CConnShape* item = dynamic_cast<OOX::Spreadsheet::CConnShape*>(oox_group_shape->m_arrItems[i]);
// convert(item);
// }break;
// case OOX::et_x_GroupShape:
// {
// OOX::Spreadsheet::CGroupShape* item = dynamic_cast<OOX::Spreadsheet::CGroupShape*>(oox_group_shape->m_arrItems[i]);
// convert(item);
// }break;
// case OOX::et_x_Pic:
// {
// OOX::Spreadsheet::CPic* item = dynamic_cast<OOX::Spreadsheet::CPic*>(oox_group_shape->m_arrItems[i]);
// convert(item);
// }break;
// }
// }
// ods_context->drawing_context()->end_group();
//}
//
//void XlsxConverter::convert(OOX::Spreadsheet::CShape* oox_shape)
//{
// if (!oox_shape)return;
// if (!oox_shape->m_oSpPr.IsInit()) return;
//
// ods_context->drawing_context()->start_drawing();
//
// int type = -1;
// if (oox_shape->m_oSpPr->m_oCustGeom.IsInit())
// {
// type = 1000;//6???
// }
// if (oox_shape->m_oSpPr->m_oPrstGeom.IsInit())
// {
// OOX::Drawing::CPresetGeometry2D * geometry = oox_shape->m_oSpPr->m_oPrstGeom.GetPointer();
// type =(geometry->m_oPrst.GetValue());
// }
//
// if ((oox_shape->m_oNvSpPr.IsInit()) && (oox_shape->m_oNvSpPr->m_oCNvSpPr.IsInit()))
// {
// if (oox_shape->m_oNvSpPr->m_oCNvSpPr->m_otxBox.GetValue() == 1)
// type = 2000; //textBox
// }
//
// if (type < 0)return;
///////////////////////////////////////////////////////////////////////////////////
// if (type == 2000) ods_context->drawing_context()->start_text_box();
// else ods_context->drawing_context()->start_shape(type);
//
// {
// OoxConverter::convert(oox_shape->m_oSpPr.GetPointer(), oox_shape->m_oShapeStyle.GetPointer());
//
// if (oox_shape->m_oNvSpPr.IsInit())
// {
// OoxConverter::convert(oox_shape->m_oNvSpPr->m_oCNvPr.GetPointer()); //имя, описалово, номер ...
// convert(oox_shape->m_oNvSpPr->m_oCNvSpPr.GetPointer()); //заблокированности ... todooo
// }
// if (oox_shape->m_oShapeStyle.IsInit())
// {
// //доп эффекты
//
// }
// if (oox_shape->m_oTxBody.IsInit())
// {
// ods_context->start_text_context();
// OoxConverter::convert(oox_shape->m_oTxBody->m_oBodyPr.GetPointer());
//
// for (unsigned int i=0 ; i < oox_shape->m_oTxBody->m_arrItems.size();i++)
// {
// OoxConverter::convert(oox_shape->m_oTxBody->m_arrItems[i]);
// }
// ods_context->drawing_context()->set_text( ods_context->text_context());
// ods_context->end_text_context();
//
// }
// }
// if (type == 2000)ods_context->drawing_context()->end_text_box();
// else ods_context->drawing_context()->end_shape();
//
// ods_context->drawing_context()->end_drawing();
//
//}
//
//void XlsxConverter::convert(OOX::Spreadsheet::CConnShape* oox_shape)
//{
// if (!oox_shape)return;
// if (!oox_shape->m_oSpPr.IsInit()) return;
//
// ods_context->drawing_context()->start_drawing();
//
// int type = -1;
// if (oox_shape->m_oSpPr->m_eGeomType == OOX::Drawing::geomtypeCustom)
// {
// type = 1000;//?????
// }
// else if (oox_shape->m_oSpPr->m_eGeomType == OOX::Drawing::geomtypePreset)
// {
// if (oox_shape->m_oSpPr->m_oPrstGeom.IsInit())
// {
// OOX::Drawing::CPresetGeometry2D * geometry = oox_shape->m_oSpPr->m_oPrstGeom.GetPointer();
// type = (int)(geometry->m_oPrst.GetValue());
// }
// }
// if (type < 0)return;
////////////////////////////////////////////////////////////////////////////////
// ods_context->drawing_context()->start_shape(type);
// {
// OoxConverter::convert(oox_shape->m_oSpPr.GetPointer(), oox_shape->m_oShapeStyle.GetPointer());
//
// //частенько приплывает из стиля заполенение объекта .. а он то одномерный :)
// odf_context()->drawing_context()->start_area_properties();
// odf_context()->drawing_context()->set_no_fill();
// odf_context()->drawing_context()->end_area_properties();
//
// if (oox_shape->m_oNvConnSpPr.IsInit())
// {
// if (oox_shape->m_oNvConnSpPr->m_oCNvPr.IsInit())
// {
// OoxConverter::convert(oox_shape->m_oNvConnSpPr->m_oCNvPr.GetPointer());
// }
//
// if (oox_shape->m_oNvConnSpPr->m_oCNvConnSpPr.IsInit())
// {
// }
// }
// //avLst
// }
// ods_context->drawing_context()->end_shape();
// ods_context->drawing_context()->end_drawing();
//}
//
//
//void XlsxConverter::convert(OOX::Spreadsheet::CPic* oox_picture)
//{
// if (!oox_picture)return;
// if (!oox_picture->m_oBlipFill.IsInit()) return; // невeрная структура оох
//
// ods_context->drawing_context()->start_drawing();
//
// std::wstring pathImage;
// double Width=0, Height = 0;
//
// if (oox_picture->m_oBlipFill->m_oBlip.IsInit())
// {
// std::wstring sID = oox_picture->m_oBlipFill->m_oBlip->m_oEmbed.GetValue();
// pathImage = find_link_by_id(sID,1);
//
// if (pathImage.empty())
// {
// sID = oox_picture->m_oBlipFill->m_oBlip->m_oLink.GetValue();
// //???
// }
// _graphics_utils_::GetResolution(pathImage.c_str(), Width, Height);
// }
// ods_context->start_image(pathImage);
// {
// if (oox_picture->m_oBlipFill->m_oTile.IsInit())
// {
// ods_context->drawing_context()->set_image_style_repeat(2);
// }
// if (oox_picture->m_oBlipFill->m_oStretch.IsInit())
// {
// ods_context->drawing_context()->set_image_style_repeat(1);
// }
// if (oox_picture->m_oBlipFill->m_oSrcRect.IsInit() && Width >0 && Height >0)
// {
// ods_context->drawing_context()->set_image_client_rect_inch(
// oox_picture->m_oBlipFill->m_oSrcRect->m_oL.GetValue()/100. * Width / currentSystemDPI ,
// oox_picture->m_oBlipFill->m_oSrcRect->m_oT.GetValue()/100. * Height / currentSystemDPI ,
// oox_picture->m_oBlipFill->m_oSrcRect->m_oR.GetValue()/100. * Width / currentSystemDPI ,
// oox_picture->m_oBlipFill->m_oSrcRect->m_oB.GetValue()/100. * Height / currentSystemDPI );
// }
// if (oox_picture->m_oNvPicPr.IsInit())
// {
// OoxConverter::convert(oox_picture->m_oNvPicPr->m_oCNvPr.GetPointer());
//
// if (oox_picture->m_oNvPicPr->m_oCNvPicPr.IsInit())
// {
// if (oox_picture->m_oNvPicPr->m_oCNvPicPr->m_oPicLocks.IsInit())
// {
// //if (oox_picture->m_oNvPicPr->m_oCNvPicPr->m_oPicLocks->m_oNoChangeAspect)
// //{
// //}
// //if (oox_picture->m_oNvPicPr->m_oCNvPicPr->m_oPicLocks->m_oNoCrop))
// //{
// //}
// //if (oox_picture->m_oNvPicPr->m_oCNvPicPr->m_oPicLocks->m_oNoResize)
// //{
// //}
// }
// //m_oExtLst
// }
// }
//
// OoxConverter::convert(oox_picture->m_oSpPr.GetPointer(), oox_picture->m_oShapeStyle.GetPointer());
//
// }
// ods_context->drawing_context()->end_image();
// ods_context->drawing_context()->end_drawing();
//}
//
void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_fmt) void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_fmt)
{ {
if (!oox_cond_fmt)return; if (!oox_cond_fmt)return;
......
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