From 12083905dc9119d2392a97b223423d26c717bee3 Mon Sep 17 00:00:00 2001 From: Elena Subbotina Date: Fri, 14 Nov 2025 10:46:48 +0300 Subject: [PATCH] fix bug #78248 --- OdfFile/Reader/Converter/docx_drawing.cpp | 12 +++++++++++- OdfFile/Reader/Converter/docx_drawing.h | 1 + OdfFile/Reader/Format/draw_frame_docx.cpp | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/OdfFile/Reader/Converter/docx_drawing.cpp b/OdfFile/Reader/Converter/docx_drawing.cpp index 6df700fc0b..e5e7c0909d 100644 --- a/OdfFile/Reader/Converter/docx_drawing.cpp +++ b/OdfFile/Reader/Converter/docx_drawing.cpp @@ -159,7 +159,17 @@ void serialize_wrap(std::wostream & strm, _docx_drawing const & val) case odf_types::style_wrap::None: serialize_wrap_top_bottom(strm, val); break; - case odf_types::style_wrap::Dynamic: //Présentation_de_tib.odt + case odf_types::style_wrap::Dynamic: + { + //if (val.styleWrapContour && *val.styleWrapContour == false) + //{ + // CP_XML_NODE(L"wp:wrapTopAndBottom"); + //} + //else + { + serialize_wrap_square(strm, val); + } + }break; default: CP_XML_NODE(L"wp:wrapTopAndBottom"); break; diff --git a/OdfFile/Reader/Converter/docx_drawing.h b/OdfFile/Reader/Converter/docx_drawing.h index 5a5353c5cb..1902396a5c 100644 --- a/OdfFile/Reader/Converter/docx_drawing.h +++ b/OdfFile/Reader/Converter/docx_drawing.h @@ -59,6 +59,7 @@ public: _CP_OPT(odf_types::vertical_rel) styleVerticalRel; _CP_OPT(odf_types::style_wrap) styleWrap; + _CP_OPT(bool) styleWrapContour; int number_wrapped_paragraphs; diff --git a/OdfFile/Reader/Format/draw_frame_docx.cpp b/OdfFile/Reader/Format/draw_frame_docx.cpp index 0db0bdcd91..1b5c93a9a6 100644 --- a/OdfFile/Reader/Format/draw_frame_docx.cpp +++ b/OdfFile/Reader/Format/draw_frame_docx.cpp @@ -191,6 +191,7 @@ int ComputeMarginX(const style_page_layout_properties * pagePropertiesNode, _CP_OPT(horizontal_rel) styleHorizontalRel; _CP_OPT(horizontal_pos) styleHorizontalPos; _CP_OPT(style_wrap) styleWrap; + _CP_OPT(bool) styleWrapContour; _CP_OPT(length) frameMarginLeft; _CP_OPT(length) frameMarginRight; @@ -199,6 +200,7 @@ int ComputeMarginX(const style_page_layout_properties * pagePropertiesNode, styleHorizontalRel = graphicProperties->common_horizontal_rel_attlist_.style_horizontal_rel_; styleHorizontalPos = graphicProperties->common_horizontal_pos_attlist_.style_horizontal_pos_; styleWrap = graphicProperties->style_wrap_; + styleWrapContour = graphicProperties->style_wrap_contour_; frameMarginLeft = GetOnlyLength(graphicProperties->common_horizontal_margin_attlist_.fo_margin_left_); frameMarginRight = GetOnlyLength(graphicProperties->common_horizontal_margin_attlist_.fo_margin_right_); } @@ -837,6 +839,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm if (graphicProperties) { drawing->styleWrap = graphicProperties->style_wrap_; + drawing->styleWrapContour = graphicProperties->style_wrap_contour_; if (drawing->styleWrap && drawing->styleWrap->get_type() == style_wrap::Parallel) {