summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/layout/data/tdf116848.odtbin0 -> 12329 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx9
-rw-r--r--sw/source/core/layout/findfrm.cxx5
3 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/layout/data/tdf116848.odt b/sw/qa/extras/layout/data/tdf116848.odt
new file mode 100644
index 000000000000..e3a96c78a521
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf116848.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 9a73e2025147..aa2146354fc0 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -19,11 +19,13 @@ public:
void testTdf116830();
void testTdf116925();
void testTdf117028();
+ void testTdf116848();
CPPUNIT_TEST_SUITE(SwLayoutWriter);
CPPUNIT_TEST(testTdf116830);
CPPUNIT_TEST(testTdf116925);
CPPUNIT_TEST(testTdf117028);
+ CPPUNIT_TEST(testTdf116848);
CPPUNIT_TEST_SUITE_END();
private:
@@ -108,6 +110,13 @@ void SwLayoutWriter::testTdf117028()
assertXPathContent(pXmlDoc, "//textarray/text", "Hello");
}
+void SwLayoutWriter::testTdf116848()
+{
+ SwDoc* pDoc = createDoc("tdf116848.odt");
+ // This resulted in a layout loop.
+ pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 60b37f363555..baca3edfa189 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1265,9 +1265,12 @@ static bool lcl_IsInSectionDirectly( const SwFrame *pUp )
else if( pUp->IsSctFrame() )
{
auto pSection = static_cast<const SwSectionFrame*>(pUp);
+ const SwFrame* pHeaderFooter = pSection->FindFooterOrHeader();
+ // When the section frame is not in header/footer:
// Allow move of frame in case our only column is not growable.
// Also allow if there is a previous section frame (to move back).
- return bSeenColumn || !pSection->Growable() || pSection->GetPrecede();
+ bool bAllowOutsideHeaderFooter = !pSection->Growable() || pSection->GetPrecede();
+ return bSeenColumn || (!pHeaderFooter && bAllowOutsideHeaderFooter);
}
else if( pUp->IsTabFrame() )
return false;