diff --git a/sw/qa/core/header_footer/HeaderFooterTest.cxx b/sw/qa/core/header_footer/HeaderFooterTest.cxx index 763012652c7c..acfd77f1270e 100644 --- a/sw/qa/core/header_footer/HeaderFooterTest.cxx +++ b/sw/qa/core/header_footer/HeaderFooterTest.cxx @@ -525,19 +525,6 @@ CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testTdf145998_firstHeader) CPPUNIT_ASSERT_EQUAL(u"Normal Header"_ustr, parseDump("/root/page[2]/header/txt"_ostr)); } -CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testTdf1159013_firstHeaderCopy) -{ - // given a document with a first-header-section, a non-first-section, then a first-link-section - createSwDoc("tdf1159013_firstHeaderCopy.docx"); - saveAndReload(u"Office Open XML Text"_ustr); - - // Sanity check - always good to test when dealing with page styles and breaks. - CPPUNIT_ASSERT_EQUAL(5, getPages()); - - // This was copying the non-first-section header instead of "linking" to the first - CPPUNIT_ASSERT_EQUAL(u"First Page header"_ustr, parseDump("/root/page[5]/header/txt"_ostr)); -} - CPPUNIT_TEST_FIXTURE(HeaderFooterTest, testEvenPageOddPageFooter_Import) { // Related tdf#135216 diff --git a/sw/qa/core/header_footer/data/tdf1159013_firstHeaderCopy.docx b/sw/qa/core/header_footer/data/tdf1159013_firstHeaderCopy.docx deleted file mode 100644 index fa2c84cbe4cd..000000000000 Binary files a/sw/qa/core/header_footer/data/tdf1159013_firstHeaderCopy.docx and /dev/null differ diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx index 5e01071bfa62..a6bbf5302f89 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx @@ -3993,16 +3993,6 @@ void DomainMapper_Impl::PopPageHeaderFooter(PagePartType ePagePartType, PageType if (pSectionContext) { pSectionContext->clearHeaderFooterLinkToPrevious(ePagePartType, eType); - - // remember most recent "first page" header/footer so follow sections can "link" to them - if (eType == PageType::FIRST) - { - if (ePagePartType == PagePartType::Header) - m_pLastFirstHeader = pSectionContext->GetPageStyle(*this); - else if (ePagePartType == PagePartType::Footer) - m_pLastFirstFooter = pSectionContext->GetPageStyle(*this); - } - m_HeaderFooterSeen.emplace(ePagePartType, eType); } diff --git a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx index 86df252b8ff9..9ab2e6f789f8 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx +++ b/sw/source/writerfilter/dmapper/DomainMapper_Impl.hxx @@ -617,8 +617,6 @@ private: PropertyMapPtr m_pTopContext; tools::SvRef m_pLastSectionContext; - rtl::Reference m_pLastFirstHeader; // last page style with different first header - rtl::Reference m_pLastFirstFooter; // last page style with different first footer PropertyMapPtr m_pLastCharacterContext; ::std::vector m_aCurrentTabStops; @@ -718,16 +716,6 @@ public: return m_pLastSectionContext.get( ); } - const rtl::Reference& GetLastFirstHeader() const - { - return m_pLastFirstHeader; - } - - const rtl::Reference& GetLastFirstFooter() const - { - return m_pLastFirstFooter; - } - css::uno::Reference const & GetPageStyles(); OUString GetUnusedPageStyleName(); css::uno::Reference const & GetCharacterStyles(); diff --git a/sw/source/writerfilter/dmapper/PropertyMap.cxx b/sw/source/writerfilter/dmapper/PropertyMap.cxx index 76e195eeb486..ea840aa6b536 100644 --- a/sw/source/writerfilter/dmapper/PropertyMap.cxx +++ b/sw/source/writerfilter/dmapper/PropertyMap.cxx @@ -1064,8 +1064,7 @@ void copyHeaderFooter(const DomainMapper_Impl& rDM_Impl, if (bCopyLeftHeader && bEvenAndOdd) copyHeaderFooterTextProperty(xPreviousStyle, xStyle, PROP_HEADER_TEXT_LEFT); if (bCopyFirstHeader && bTitlePage) - copyHeaderFooterTextProperty(rDM_Impl.GetLastFirstHeader(), xStyle, - PROP_HEADER_TEXT_FIRST); + copyHeaderFooterTextProperty(xPreviousStyle, xStyle, PROP_HEADER_TEXT_FIRST); } if (bPreviousHasFooter && bCopyFooter) @@ -1075,8 +1074,7 @@ void copyHeaderFooter(const DomainMapper_Impl& rDM_Impl, if (bCopyLeftFooter && bEvenAndOdd) copyHeaderFooterTextProperty(xPreviousStyle, xStyle, PROP_FOOTER_TEXT_LEFT); if (bCopyFirstFooter && bTitlePage) - copyHeaderFooterTextProperty(rDM_Impl.GetLastFirstFooter(), xStyle, - PROP_FOOTER_TEXT_FIRST); + copyHeaderFooterTextProperty(xPreviousStyle, xStyle, PROP_FOOTER_TEXT_FIRST); } xStyle->setPropertyValue(sHeaderIsOn, uno::Any(bPreviousHasHeader || bHasHeader));