[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sw/qa writerfilter/source
Justin Luth
justin_luth at sil.org
Wed Aug 2 08:29:06 UTC 2017
sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 3 +++
writerfilter/source/dmapper/PropertyMap.cxx | 22 ++++++++++++----------
2 files changed, 15 insertions(+), 10 deletions(-)
New commits:
commit 6d77bfc9b2cf5a30a06a97c69ed814e3a97ed685
Author: Justin Luth <justin_luth at sil.org>
Date: Sat Jul 29 11:38:10 2017 -0400
tdf#108944 writerfilter: fix missing footnote separator
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.
Change-Id: I00cbd1cbc8dc86edf426f852c59c3f943e373b13
Reviewed-on: https://gerrit.libreoffice.org/40551
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
(cherry picked from commit 6f57c09aadd40009173f8ae3654004dd0cad9fb8)
Reviewed-on: https://gerrit.libreoffice.org/40588
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index ea7135058c53..af9b7769fbbd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -118,6 +118,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92470_footnoteRestart, "tdf92470_footnoteRestart
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
CPPUNIT_ASSERT( pDoc );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Footnote doesn't restart every Page", FTNNUM_PAGE, pDoc->GetFootnoteInfo().eNum );
+
+ uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(25), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth"));
}
DECLARE_OOXMLEXPORT_TEST(testCharacterBorder, "charborder.odt")
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index a4e092973539..26f481f2ad5b 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1001,17 +1001,13 @@ void SectionPropertyMap::HandleMarginsHeaderFooter( bool bFirstPage, DomainMappe
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
@@ -1416,6 +1412,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
More information about the Libreoffice-commits
mailing list