summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/core/layout/data/tables-move-backwards.odtbin0 -> 9578 bytes
-rw-r--r--sw/source/core/layout/layact.cxx12
2 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/core/layout/data/tables-move-backwards.odt b/sw/qa/core/layout/data/tables-move-backwards.odt
new file mode 100644
index 000000000000..861dc4f4ad86
--- /dev/null
+++ b/sw/qa/core/layout/data/tables-move-backwards.odt
Binary files differ
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index c9bc309adb11..27820ca028eb 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1354,6 +1354,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa
while ( pLow && pLow->GetUpper() == pLay )
{
SwFrameDeleteGuard delG(pLow);
+ SwFrame* pNext = nullptr;
if ( pLow->IsLayoutFrame() )
{
if ( pLow->IsTabFrame() )
@@ -1364,6 +1365,11 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa
}
++m_nTabLevel;
+
+ // Remember what was the next of the lower. Formatting may move it to the previous
+ // page, in which case it looses its next.
+ pNext = pLow->GetNext();
+
bTabChanged |= FormatLayoutTab( static_cast<SwTabFrame*>(pLow), bAddRect );
--m_nTabLevel;
}
@@ -1378,7 +1384,11 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa
if ( IsAgain() )
return false;
- pLow = pLow->GetNext();
+ if (!pNext)
+ {
+ pNext = pLow->GetNext();
+ }
+ pLow = pNext;
}
// add complete frame area as paint area, if frame
// area has been already added and after formatting its lowers the frame area