From ef77086255821d61838a7e26fee9baadaca0b9e0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 19 Jun 2024 11:54:13 +0200 Subject: [PATCH] tdf#161631 writerfilter: move another member to SubstreamContext The problem is that the bugdoc contains a table in the footer, which causes m_bDummyParaAddedForTableInSection to be set, which erroneously causes the last paragraph in the body to be removed. (regression from commit 86ad08f9d25110e91e92a0badf6de75e785b3644) Change-Id: I148785c54c37dc25f7d239b5898aec9fb5455f40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169191 Reviewed-by: Michael Stahl Tested-by: Jenkins --- sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx | 4 +--- sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx index c50cf4212567..47ef07610ca7 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx @@ -373,7 +373,6 @@ DomainMapper_Impl::DomainMapper_Impl( m_bIsParaMarkerChange( false ), m_bIsParaMarkerMove( false ), m_bRedlineImageInPreviousRun( false ), - m_bDummyParaAddedForTableInSection( false ), m_bIsLastSectionGroup( false ), m_bUsingEnhancedFields( false ), m_nAnnotationId( -1 ), @@ -938,10 +937,9 @@ void DomainMapper_Impl::SetIsFirstParagraphInShape(bool bIsFirst) void DomainMapper_Impl::SetIsDummyParaAddedForTableInSection( bool bIsAdded ) { - m_bDummyParaAddedForTableInSection = bIsAdded; + m_StreamStateStack.top().bDummyParaAddedForTableInSection = bIsAdded; } - void DomainMapper_Impl::SetIsTextFrameInserted( bool bIsInserted ) { m_StreamStateStack.top().bTextFrameInserted = bIsInserted; diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx index c76d1f6dd5ba..1697ee9e849d 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx +++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx @@ -266,6 +266,7 @@ struct SubstreamContext bool bTextFrameInserted = false; bool bIsFirstRun = false; bool bIsOutsideAParagraph = true; + bool bDummyParaAddedForTableInSection = false; // tdf#161631 std::map deferredCharacterProperties; }; @@ -658,7 +659,6 @@ private: // text ZWSPs to keep the change tracking of the image in Writer.) bool m_bRedlineImageInPreviousRun; - bool m_bDummyParaAddedForTableInSection; bool m_bIsLastSectionGroup; bool m_bUsingEnhancedFields; @@ -770,7 +770,7 @@ public: void SetIsFirstParagraphInShape(bool bIsFirst); bool GetIsFirstParagraphInShape() const { return m_StreamStateStack.top().bIsFirstParaInShape; } void SetIsDummyParaAddedForTableInSection( bool bIsAdded ); - bool GetIsDummyParaAddedForTableInSection() const { return m_bDummyParaAddedForTableInSection;} + bool GetIsDummyParaAddedForTableInSection() const { return m_StreamStateStack.top().bDummyParaAddedForTableInSection; } /// Track if a textframe has been inserted into this section void SetIsTextFrameInserted( bool bIsInserted );