From bcc36b18a76ca66f46dee97102fc0c516d969223 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Sat, 29 Jul 2017 11:38:10 -0400 Subject: tdf#108944 writerfilter: fix missing footnote separator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix regression from e79ef12b7a904f17d4147fa409d055c12b70f952 tdf#107033 DOCX import: fix unexpected missing footnote separator. Initially related to tdf#68787. If HandleMarginsHeaderFooter was called twice, then it automatically would have disabled the separator. Clearing the HasFtn/HasFtnSep flags also shouldn't be run when in the footnote sections. Reviewed-on: https://gerrit.libreoffice.org/40551 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna (cherry picked from commit 6f57c09aadd40009173f8ae3654004dd0cad9fb8) Change-Id: I00cbd1cbc8dc86edf426f852c59c3f943e373b13 Reviewed-on: https://gerrit.libreoffice.org/40590 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara (cherry picked from commit 234df2fb5901588ccf20cb35cb4c5922aeb89817) --- writerfilter/source/dmapper/PropertyMap.cxx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'writerfilter/source') diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 9f263ab22630..8b84e318bc67 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1037,17 +1037,12 @@ void SectionPropertyMap::HandleMarginsHeaderFooter(bool bFirstPage, DomainMapper if (rDM_Impl.m_oBackgroundColor) Insert(PROP_BACK_COLOR, uno::makeAny(*rDM_Impl.m_oBackgroundColor)); - if (rDM_Impl.m_bHasFtn) + // Check for missing footnote separator only in case there is at least + // one footnote. + if (rDM_Impl.m_bHasFtn && !rDM_Impl.m_bHasFtnSep) { - // Check for missing footnote separator only in case there is at least - // one footnote. - if (!rDM_Impl.m_bHasFtnSep) - { - // Set footnote line width to zero, document has no footnote separator. - Insert(PROP_FOOTNOTE_LINE_RELATIVE_WIDTH, uno::makeAny(sal_Int32(0))); - rDM_Impl.m_bHasFtn = false; - } - rDM_Impl.m_bHasFtnSep = false; + // Set footnote line width to zero, document has no footnote separator. + Insert(PROP_FOOTNOTE_LINE_RELATIVE_WIDTH, uno::makeAny(sal_Int32(0))); } /*** if headers/footers are available then the top/bottom margins of the @@ -1463,6 +1458,12 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) } rDM_Impl.SetIsLastSectionGroup(false); rDM_Impl.SetIsFirstParagraphInSection(true); + + if ( !rDM_Impl.IsInFootOrEndnote() ) + { + rDM_Impl.m_bHasFtn = false; + rDM_Impl.m_bHasFtnSep = false; + } } // Clear the flag that says we should take the header/footer content from -- cgit