Kaydet (Commit) 6f57c09a authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Miklos Vajna

tdf#108944 writerfilter: fix missing footnote separator

Fix regression from e79ef12b
   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/40551Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 8302f334
......@@ -117,6 +117,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")
......
......@@ -992,17 +992,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
......@@ -1406,6 +1402,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment