From c505aced48b09fce763ab925d72dbbae01d71ead Mon Sep 17 00:00:00 2001 From: ElenaSubbotina Date: Sat, 22 Apr 2017 18:34:10 +0300 Subject: [PATCH] . --- .../source/OdfFormat/odf_drawing_context.cpp | 4 +-- .../Oox2OdfConverter/ConvertDrawing.cpp | 33 +++++++++++++------ .../source/Oox2OdfConverter/PptxConverter.cpp | 5 +-- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp b/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp index 6e213fa48c..2e9255c205 100644 --- a/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp +++ b/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp @@ -1747,8 +1747,8 @@ void odf_drawing_context::set_group_position(_CP_OPT(double) x, _CP_OPT(double) impl_->current_group_->x = *change_x ; impl_->current_group_->y = *change_y ; - impl_->current_group_->shift_x = (*x - *change_x) ; - impl_->current_group_->shift_y = (*y - *change_y) ; + impl_->current_group_->shift_x = (*x /impl_->current_group_->scale_cx - *change_x) ; + impl_->current_group_->shift_y = (*y /impl_->current_group_->scale_cy - *change_y) ; } void odf_drawing_context::set_group_size( _CP_OPT(double) cx, _CP_OPT(double) cy, _CP_OPT(double) change_cx, _CP_OPT(double) change_cy) diff --git a/ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp b/ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp index 0b3034bd37..b45d963114 100644 --- a/ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp +++ b/ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp @@ -1147,8 +1147,6 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro } if (bullet.is()) { - odf_list_type = 1000; - const PPTX::Logic::BuBlip & buBlip = bullet.as(); std::wstring odf_ref; @@ -1158,6 +1156,9 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro { std::wstring sID = buBlip.blip.embed->get(); std::wstring pathImage = find_link_by_id(sID, 1); + + if (pathImage.empty()) + pathImage = buBlip.blip.GetFullPicName(); // only for presentation merge shapes !! odf_ref = odf_context()->add_image(pathImage); } @@ -1167,8 +1168,18 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro bEmbedded = false; } - odf_context()->styles_context()->lists_styles().start_style_level(level, odf_list_type ); - odf_context()->styles_context()->lists_styles().set_bullet_image(odf_ref); + if (!odf_ref.empty()) + { + odf_list_type = 1000; + odf_context()->styles_context()->lists_styles().start_style_level(level, odf_list_type ); + odf_context()->styles_context()->lists_styles().set_bullet_image(odf_ref); + } + else + { + odf_list_type = 5; + odf_context()->styles_context()->lists_styles().start_style_level(level, odf_list_type ); + odf_context()->styles_context()->lists_styles().set_bullet_char(L"\x2022"); + } } //odf_writer::style_list_level_label_alignment * aligment_props = odf_context()->styles_context()->lists_styles().get_list_level_alignment_properties(); @@ -1177,7 +1188,7 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro convert(oox_para_props->defRPr.GetPointer(), text_properties); - if (oox_para_props->indent.IsInit()) + if (oox_para_props->indent.IsInit() && level_props) { level_props->text_min_label_width_ = odf_types::length(- oox_para_props->indent.get() / 12700., odf_types::length::pt); level_props->text_space_before_ = odf_types::length(1, odf_types::length::pt); @@ -1204,7 +1215,7 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro { int res = 0; if ((res = hexColor.find(L"#")) < 0) hexColor = std::wstring(L"#") + hexColor; - text_properties->content_.fo_color_ = odf_types::color(hexColor); + if (text_properties) text_properties->content_.fo_color_ = odf_types::color(hexColor); } } //----------------------------------- @@ -1295,7 +1306,7 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T bool list_present = false; std::wstring list_style_name; - int list_level = -1; + int list_level = 0;//-1; NSCommon::nullable paraPr; @@ -1346,7 +1357,7 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T if (odf_context()->drawing_context()->is_wordart()) odf_context()->drawing_context()->set_paragraph_properties(paragraph_properties); } - list_level++; + //list_level++; if (oox_paragraph->RunElems.empty() && list_present) list_present = false; // ms не обозначает присутствие списка, libra - показывает значек @@ -1370,7 +1381,7 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T _CP_OPT(bool) inStyles = odf_context()->drawing_context()->get_presentation(); odf_context()->styles_context()->lists_styles().start_style(inStyles && *inStyles); - convert_list_level(oox_paragraph->pPr.GetPointer(), list_level - 1); + convert_list_level(oox_paragraph->pPr.GetPointer(), list_level /*- 1*/); odf_context()->styles_context()->lists_styles().end_style(); } @@ -1379,6 +1390,8 @@ void OoxConverter::convert(PPTX::Logic::Paragraph *oox_paragraph, PPTX::Logic::T //odf_context()->text_context()->start_list(list_style_name); } + list_level++; + if (odf_context()->text_context()->list_state_.levels.size() < list_level) { while (odf_context()->text_context()->list_state_.levels.size() < list_level) @@ -1756,7 +1769,7 @@ void OoxConverter::convert(PPTX::Logic::TextListStyle *oox_list_style) odf_context()->styles_context()->lists_styles().start_style(inStyles && *inStyles); for (int i = 0; i < 9; i++) { - OoxConverter::convert_list_level(oox_list_style->levels[0].GetPointer(), i); + OoxConverter::convert_list_level(oox_list_style->levels[i].GetPointer(), i); } odf_context()->styles_context()->lists_styles().end_style(); } diff --git a/ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp b/ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp index e100ce5cc5..77c505fd05 100644 --- a/ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp +++ b/ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp @@ -341,7 +341,7 @@ void PptxConverter::convert_slides() if (slide->Layout->clrMapOvr.IsInit() && slide->Layout->clrMapOvr->overrideClrMapping.IsInit()) current_clrMap = slide->Layout->clrMapOvr->overrideClrMapping.GetPointer(); - //current_slide = slide->Layout.operator->(); + current_slide = slide->Layout.operator->(); convert_slide(&slide->Layout->cSld, current_txStyles, true); //add note master odp_context->end_master_slide(); @@ -999,8 +999,9 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS } pShape->Merge(update_shape); - OoxConverter::convert(&update_shape); + + //OoxConverter::convert(pShape.operator->()); } else {