Kaydet (Commit) 9107b719 authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) jan iversen

tdf#103025 sw: don't format header/footer in SwPageFrame::PreparePage()

This has always been dead code because it used wrong constants
FRMTYPE_HEADER|FRMTYPE_FOOTER which is actually Page|Column and
SwPageFrame and SwColumnFrame are not direct children of SwPageFrame.

Then commit 901e5c3a fixed the
constants but somehow the early formatting of header/footer results
in wrong expansion of variable text fields, so just remove this code.

(cherry picked from commit f933da55)

Change-Id: I0af13168970f26355a1b247e071235166d08b7a4
Reviewed-on: https://gerrit.libreoffice.org/29558Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 63ba0dc9)
Reviewed-on: https://gerrit.libreoffice.org/29667Reviewed-by: 's avatarjan iversen <jani@documentfoundation.org>
Tested-by: 's avatarjan iversen <jani@documentfoundation.org>
üst 4839eeb8
...@@ -631,6 +631,15 @@ DECLARE_ODFIMPORT_TEST(testBnc800714, "bnc800714.fodt") ...@@ -631,6 +631,15 @@ DECLARE_ODFIMPORT_TEST(testBnc800714, "bnc800714.fodt")
CPPUNIT_ASSERT(getProperty<bool>(getParagraph(2), "ParaKeepTogether")); 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") DECLARE_ODFIMPORT_TEST(testTdf96113, "tdf96113.odt")
{ {
// Background of the formula frame was white (0xffffff), not green. // Background of the formula frame was white (0xffffff), not green.
......
...@@ -465,22 +465,6 @@ void SwPageFrame::PreparePage( bool bFootnote ) ...@@ -465,22 +465,6 @@ void SwPageFrame::PreparePage( bool bFootnote )
if ( GetPrev() && static_cast<SwPageFrame*>(GetPrev())->IsEmptyPage() ) if ( GetPrev() && static_cast<SwPageFrame*>(GetPrev())->IsEmptyPage() )
lcl_MakeObjs( *pDoc->GetSpzFrameFormats(), static_cast<SwPageFrame*>(GetPrev()) ); lcl_MakeObjs( *pDoc->GetSpzFrameFormats(), static_cast<SwPageFrame*>(GetPrev()) );
lcl_MakeObjs( *pDoc->GetSpzFrameFormats(), this ); lcl_MakeObjs( *pDoc->GetSpzFrameFormats(), this );
// format footer/ header
SwLayoutFrame *pLow = static_cast<SwLayoutFrame*>(Lower());
while ( pLow )
{
if ( pLow->GetType() & (FRM_HEADER|FRM_FOOTER) )
{
SwContentFrame *pContent = pLow->ContainsContent();
while ( pContent && pLow->IsAnLower( pContent ) )
{
pContent->OptCalc(); // not the predecessors
pContent = pContent->GetNextContentFrame();
}
}
pLow = static_cast<SwLayoutFrame*>(pLow->GetNext());
}
} }
} }
......
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