diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-09-09 11:08:32 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2020-09-09 15:56:08 +0200 |
commit | a0d2e45f2efbe4e82b78c777d21b5eabec3a0924 (patch) | |
tree | 9d62d41f4802c3511c38c44090f14b5a80e96d8c /writerfilter | |
parent | cdd670e1ad26f066a6b03f7063bfc26cae74a8a8 (diff) |
tdf#136589 writerfilter: reset ParaHadField
::finishParagraph normally resets this, but it exited
early because of m_bDiscardHeaderFooter, so the setting
spilled over into the following paragraph.
This is a bit of a bandaid - likely stacks of paragraphs
and sections need to be used so each can hold its
own settings and not worry about them being clobbered.
But this particular case seems to a single level problem,
isolated to headers/footers, so the change should
both be enough and regression-safe.
Change-Id: I84c9a5d6bf95c35c4996a9b31e53f18c05ade727
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102314
Tested-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index e7b571de687b..e7ecfffd4338 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -313,6 +313,7 @@ DomainMapper_Impl::DomainMapper_Impl( m_bIsActualParagraphFramed( false ), m_vTextFramesForChaining(), m_bParaHadField(false), + m_bSaveParaHadField(false), m_bParaAutoBefore(false), m_bFirstParagraphInCell(true), m_bSaveFirstParagraphInCell(false), @@ -2438,6 +2439,7 @@ void DomainMapper_Impl::appendGlossaryEntry() void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::PageType eType) { + m_bSaveParaHadField = m_bParaHadField; m_aHeaderFooterStack.push(HeaderFooterContext(m_bTextInserted, m_nTableDepth)); m_bTextInserted = false; m_nTableDepth = 0; @@ -2538,6 +2540,8 @@ void DomainMapper_Impl::PopPageHeaderFooter() m_nTableDepth = m_aHeaderFooterStack.top().getTableDepth(); m_aHeaderFooterStack.pop(); } + + m_bParaHadField = m_bSaveParaHadField; } void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote ) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 33ec662c5feb..1a9f9340bac6 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -1074,6 +1074,7 @@ private: std::vector<css::uno::Reference< css::drawing::XShape > > m_vTextFramesForChaining ; /// Current paragraph had at least one field in it. bool m_bParaHadField; + bool m_bSaveParaHadField; css::uno::Reference<css::beans::XPropertySet> m_xPreviousParagraph; /// Current paragraph has automatic before spacing. bool m_bParaAutoBefore; |