diff options
author | Justin Luth <justin_luth@sil.org> | 2016-06-11 21:58:11 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-07-04 17:45:04 +0200 |
commit | 24bb46f4b6d8c0c7c0e56270a8a5daa79244feac (patch) | |
tree | da35d5d8d4843df633e883ec324cfc645fb8e2a0 | |
parent | e4197fbec8abe21a8bb0d222ac6e06664798ce1d (diff) |
tdf#76322 writer: allow column breaks in headers/footers
The code blocking this came in the original OpenOffice flowfrm.
Either IsInSct() or FindFooterOrHeader() works to resolve
this bug. I chose FindFooterOrHeader because it seemed
to match the existing targets (docbody, flyframe) better.
Reviewed-on: https://gerrit.libreoffice.org/26208
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 121109610f9af0b294cf042c6ae5abc6fcc4f326)
Change-Id: I51fc3bdc51c76e290b47ec7b9044780e5b67136c
-rwxr-xr-x | sw/qa/extras/odfimport/data/tdf76322_columnBreakInHeader.docx | bin | 0 -> 11357 bytes | |||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/sw/qa/extras/odfimport/data/tdf76322_columnBreakInHeader.docx b/sw/qa/extras/odfimport/data/tdf76322_columnBreakInHeader.docx Binary files differnew file mode 100755 index 000000000000..6c050ae80b0b --- /dev/null +++ b/sw/qa/extras/odfimport/data/tdf76322_columnBreakInHeader.docx diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 5c60935174b2..61911a4b9d1a 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -613,6 +613,12 @@ DECLARE_ODFIMPORT_TEST(testTdf92586, "tdf92586.odt") CPPUNIT_ASSERT_EQUAL(drawing::BitmapMode_STRETCH, getProperty<drawing::BitmapMode>(xPageStyle, "FillBitmapMode")); } +DECLARE_ODFIMPORT_TEST(testTdf76322_columnBreakInHeader, "tdf76322_columnBreakInHeader.docx") +{ +// column breaks were ignored. First line should start in column 2 + CPPUNIT_ASSERT_EQUAL( OUString("Test1"), parseDump("/root/page[1]/header/section/column[2]/body/txt/text()") ); +} + DECLARE_ODFIMPORT_TEST(testTdf96113, "tdf96113.odt") { // Background of the formula frame was white (0xffffff), not green. diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 5320fd1fa410..0afeacf08efe 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1161,7 +1161,7 @@ bool SwFlowFrm::IsColBreak( bool bAct ) const { // Determine predecessor const SwFrm *pPrev = m_rThis.FindPrev(); - while( pPrev && ( ( !pPrev->IsInDocBody() && !m_rThis.IsInFly() ) || + while( pPrev && ( ( !pPrev->IsInDocBody() && !m_rThis.IsInFly() && !m_rThis.FindFooterOrHeader() ) || ( pPrev->IsTextFrm() && static_cast<const SwTextFrm*>(pPrev)->IsHiddenNow() ) ) ) pPrev = pPrev->FindPrev(); |