summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-06-07 14:53:09 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-06-07 14:58:51 +0200
commit5fa1474768859d4f3ab8e97f0fc30db08f2d9487 (patch)
treefa260a8adf3a7b9cee781cfe70bd9c383bf10714 /sw
parent7a0495b871d82217a88f3211f10f757ee5b678b9 (diff)
Revert "tdf#103025 sw: don't format header/footer in ...
... SwPageFrame::PreparePage()" A customer document breaks with this, revert the commit for now till a public reproducer and a proper fix is created. This reverts commit 9107b719fcaf1a7ecf89e3964e670de782b07f82. Change-Id: I6d7a6737f47313fb00955b431d8967bb533ccbae
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/odfimport/data/tdf103025.odtbin5694 -> 0 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx9
-rw-r--r--sw/source/core/layout/pagechg.cxx16
3 files changed, 16 insertions, 9 deletions
diff --git a/sw/qa/extras/odfimport/data/tdf103025.odt b/sw/qa/extras/odfimport/data/tdf103025.odt
deleted file mode 100644
index bd1e57314d88..000000000000
--- a/sw/qa/extras/odfimport/data/tdf103025.odt
+++ /dev/null
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index f8dc61d68d81..a72d6a54c546 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -631,15 +631,6 @@ DECLARE_ODFIMPORT_TEST(testBnc800714, "bnc800714.fodt")
CPPUNIT_ASSERT(getProperty<bool>(getParagraph(2), "ParaKeepTogether"));
}
-DECLARE_ODFIMPORT_TEST(testTdf103025, "tdf103025.odt")
-{
- CPPUNIT_ASSERT_EQUAL(OUString("2014-01"), parseDump("/root/page[1]/header/tab[2]/row[2]/cell[3]/txt/Special", "rText"));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-01"), parseDump("/root/page[2]/header/tab[2]/row[2]/cell[3]/txt/Special", "rText"));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-02"), parseDump("/root/page[3]/header/tab[2]/row[2]/cell[3]/txt/Special", "rText"));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-03"), parseDump("/root/page[4]/header/tab[2]/row[2]/cell[3]/txt/Special", "rText"));
- CPPUNIT_ASSERT_EQUAL(OUString("2014-03"), parseDump("/root/page[5]/header/tab[2]/row[2]/cell[3]/txt/Special", "rText"));
-}
-
DECLARE_ODFIMPORT_TEST(testTdf96113, "tdf96113.odt")
{
// Background of the formula frame was white (0xffffff), not green.
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index d498ffbdbf44..7ea397522d83 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -467,6 +467,22 @@ void SwPageFrame::PreparePage( bool bFootnote )
if ( GetPrev() && static_cast<SwPageFrame*>(GetPrev())->IsEmptyPage() )
lcl_MakeObjs( *pDoc->GetSpzFrameFormats(), static_cast<SwPageFrame*>(GetPrev()) );
lcl_MakeObjs( *pDoc->GetSpzFrameFormats(), this );
+
+ // format footer/ header
+ SwLayoutFrame *pLow = static_cast<SwLayoutFrame*>(Lower());
+ while ( pLow )
+ {
+ if ( pLow->GetType() & (SwFrameType::Header|SwFrameType::Footer) )
+ {
+ SwContentFrame *pContent = pLow->ContainsContent();
+ while ( pContent && pLow->IsAnLower( pContent ) )
+ {
+ pContent->OptCalc(); // not the predecessors
+ pContent = pContent->GetNextContentFrame();
+ }
+ }
+ pLow = static_cast<SwLayoutFrame*>(pLow->GetNext());
+ }
}
}