summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/fly.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/layout/fly.cxx')
-rw-r--r--sw/source/core/layout/fly.cxx40
1 files changed, 30 insertions, 10 deletions
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 190e799dbc56..2b6973d14e97 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -165,7 +165,7 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch
// First the Init, then the Content:
// This is due to the fact that the Content may have Objects/Frames,
// which are then registered
- InitDrawObj();
+ InitDrawObj(*pAnch);
Chain( pAnch );
@@ -361,10 +361,10 @@ void SwFlyFrame::DeleteCnt()
InvalidatePage();
}
-void SwFlyFrame::InitDrawObj()
+void SwFlyFrame::InitDrawObj(SwFrame const& rAnchorFrame)
{
// OD 2004-03-22 #i26791#
- SetDrawObj(*SwFlyDrawContact::CreateNewRef(this, GetFormat()));
+ SetDrawObj(*SwFlyDrawContact::CreateNewRef(this, GetFormat(), rAnchorFrame));
// Set the right Layer
// OD 2004-01-19 #110582#
@@ -1469,6 +1469,7 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl )
do
{
pLast = pFrame;
+ bool const wasFrameLowerOfLay(pLay->IsAnLower(pFrame));
if( pFrame->IsVertical() ?
( pFrame->GetUpper()->getFramePrintArea().Height() != pFrame->getFrameArea().Height() )
: ( pFrame->GetUpper()->getFramePrintArea().Width() != pFrame->getFrameArea().Width() ) )
@@ -1528,11 +1529,13 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl )
{
bool bAgain = false;
bool bRestartLayoutProcess = false;
- SwPageFrame* pPageFrame = pFrame->FindPageFrame();
size_t nCnt = pFrame->GetDrawObjs()->size();
size_t i = 0;
while ( i < nCnt )
{
+ // pFrame can move to a different page in FormatObj()
+ SwPageFrame *const pPageFrame = pFrame->FindPageFrame();
+
// #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrame->GetDrawObjs())[i];
assert(pAnchoredObj);
@@ -1610,7 +1613,10 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl )
// #i28701# - restart layout process, if
// requested by floating screen object formatting
- if ( bRestartLayoutProcess )
+ if (bRestartLayoutProcess
+ // tdf#142080 if it was aleady on next page, and still is,
+ // ignore restart, as restart could cause infinite loop
+ && (wasFrameLowerOfLay || pLay->IsAnLower(pFrame)))
{
pFrame = pLay->ContainsAny();
pAgainObj1 = nullptr;
@@ -1653,8 +1659,17 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl )
}
if ( pFrame->IsTabFrame() )
{
- if ( static_cast<SwTabFrame*>(pFrame)->IsFollow() )
+ if (static_cast<SwTabFrame*>(pFrame)->m_bLockBackMove)
+ {
+ assert(static_cast<SwTabFrame*>(pFrame)->IsFollow());
static_cast<SwTabFrame*>(pFrame)->m_bLockBackMove = false;
+ // tdf#150606 encourage it to move back in FormatLayout()
+ if (static_cast<SwTabFrame*>(pFrame)->m_bWantBackMove)
+ {
+ static_cast<SwTabFrame*>(pFrame)->m_bWantBackMove = false;
+ pFrame->InvalidatePos();
+ }
+ }
}
pFrame = bPrevInvalid ? pTmpPrev : pFrame->FindNext();
@@ -1674,10 +1689,10 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl )
pFrame->InvalidatePos_();
}
}
- // Stay in the pLay
- // Except for SectionFrames with Follow: the first ContentFrame of the Follow
- // will be formatted, so that it gets a chance to load in the pLay.
- // As long as these Frames are loading in pLay, we continue
+ // Stay in the pLay.
+ // Except for SectionFrames with Follow: the first ContentFrame of the
+ // Follow will be formatted, so that it gets a chance to move back
+ // into the pLay. Continue as long as these Frames land in pLay.
} while ( pFrame &&
( pLay->IsAnLower( pFrame ) ||
( pSect &&
@@ -2839,6 +2854,11 @@ void SwFlyFrame::RegisterAtCorrectPage()
// default behaviour is to do nothing.
}
+void SwFlyFrame::RegisterAtPage(SwPageFrame &)
+{
+ // default behaviour is to do nothing.
+}
+
/** method to determine, if a <MakeAll()> on the Writer fly frame is possible
OD 2004-05-11 #i28701#