From 20a8de9440b463ed6127a71bd7acdc4b399f9d51 Mon Sep 17 00:00:00 2001 From: Kamil Kerimov Date: Wed, 4 Sep 2024 16:32:52 +0500 Subject: [PATCH] Fix bug #69988 --- OdfFile/Reader/Format/office_text.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/OdfFile/Reader/Format/office_text.cpp b/OdfFile/Reader/Format/office_text.cpp index 72812030f1..5b8476f142 100644 --- a/OdfFile/Reader/Format/office_text.cpp +++ b/OdfFile/Reader/Format/office_text.cpp @@ -39,6 +39,7 @@ #include "serialize_elements.h" #include "odfcontext.h" +#include "style_paragraph_properties.h" namespace cpdoccore { namespace odf_reader { @@ -240,9 +241,21 @@ void office_text::docx_convert(oox::docx_conversion_context & Context) } } - if (!Context.get_master_page_name().empty() && !next_masterPageName) + style_instance* next_style_instance = Context.root()->odf_context().styleContainer().style_by_name(text___, odf_types::style_family::Paragraph, false); + if (next_style_instance) { - Context.next_dump_page_properties(true); + style_content* next_style_content = next_style_instance->content(); + if (next_style_content) + { + style_paragraph_properties* next_para_props = next_style_content->get_style_paragraph_properties(); + if (next_para_props) + { + if (next_para_props->content_.fo_break_before_ && next_para_props->content_.fo_break_before_->get_type() == odf_types::fo_break::Page) + { + Context.next_dump_page_properties(true); + } + } + } } } content_[i]->docx_convert(Context);