summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-07-14 14:20:36 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-08-13 15:15:54 +0200
commite99eb63aaa115d3e75f648101b766f74f7e00527 (patch)
tree38b0dfccae12aaf3ac75356c74ef00f660dce49f /sw/source
parent71b30d43a2ea763bfae500595ff76c4a04e13dbc (diff)
tdf#108524 sw: handle sections inside tables in SwFrame::GetPrevSctLeaf()
This addresses the sub-problem described in comment 12 of the bug, i.e. text frames are now moved to the first page from the second one when text frames are deleted on the first page. Change-Id: Ic0ede45381fb84b13d1ac02e4d1f39d817650616 Reviewed-on: https://gerrit.libreoffice.org/39946 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 850bf99e7d1abcf2e0cce731b6715f87420d0ee6) (cherry picked from commit af65d584b2c62752bfb37e39048ee76dffad525b)
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/layout/sectfrm.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 3754f55b1997..f36820c5316c 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1726,11 +1726,24 @@ SwLayoutFrame *SwFrame::GetPrevSctLeaf()
if( bJump ) // Did we skip a blank page?
SwFlowFrame::SetMoveBwdJump( true );
+ SwSectionFrame *pSect = FindSctFrame();
+ if (!pCol && pSect && IsInTab() && !IsInTableInSection(this))
+ {
+ // We don't have a previous section yet, and we're in a
+ // section-in-table.
+ if (SwFlowFrame* pPrecede = pSect->GetPrecede())
+ {
+ // Our section has a precede, work with that.
+ if (pPrecede->GetFrame().IsLayoutFrame())
+ pCol = static_cast<SwLayoutFrame*>(&pPrecede->GetFrame());
+ }
+ }
+
// Within sections in tables or section in headers/footers there can
// be only one column change be made, one of the above shortcuts should
// have applied, also when the section has a pPrev.
// Now we even consider an empty column...
- OSL_ENSURE( FindSctFrame(), "GetNextSctLeaf: Missing SectionFrame" );
+ OSL_ENSURE( pSect, "GetNextSctLeaf: Missing SectionFrame" );
if( ( IsInTab() && !IsTabFrame() ) || FindFooterOrHeader() )
return pCol;
@@ -1738,7 +1751,6 @@ SwLayoutFrame *SwFrame::GetPrevSctLeaf()
// Precondition, which needs to be hold, is that the <this> frame can be
// inside a table, but then the found section frame <pSect> is also inside
// this table.
- SwSectionFrame *pSect = FindSctFrame();
// #i95698#
// A table cell containing directly a section does not break - see lcl_FindSectionsInRow(..)