summaryrefslogtreecommitdiffstats
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.cxx218
1 files changed, 142 insertions, 76 deletions
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 36d74c245623..8e425948d0c6 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -129,8 +129,11 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch
mbRightToLeft = false;
}
- Frame().Width( rFrameSize.GetWidth() );
- Frame().Height( rFrameSize.GetHeightSizeType() == ATT_VAR_SIZE ? MINFLY : rFrameSize.GetHeight() );
+ {
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aFrm.Width( rFrameSize.GetWidth() );
+ aFrm.Height( rFrameSize.GetHeightSizeType() == ATT_VAR_SIZE ? MINFLY : rFrameSize.GetHeight() );
+ }
// Fixed or variable Height?
if ( rFrameSize.GetHeightSizeType() == ATT_MIN_SIZE )
@@ -151,8 +154,9 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch
InsertCnt();
// Put it somewhere outside so that out document is not formatted unnecessarily often
- Frame().Pos().setX(FAR_AWAY);
- Frame().Pos().setY(FAR_AWAY);
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aFrm.Pos().setX(FAR_AWAY);
+ aFrm.Pos().setY(FAR_AWAY);
}
void SwFlyFrame::Chain( SwFrame* _pAnch )
@@ -224,8 +228,12 @@ void SwFlyFrame::InsertColumns()
{
// Start off PrtArea to be as large as Frame, so that we can put in the columns
// properly. It'll adjust later on.
- Prt().Width( Frame().Width() );
- Prt().Height( Frame().Height() );
+ {
+ SwFrameRect::PrintWriteAccess aPrt(*this);
+ aPrt.Width( getSwFrame().Width() );
+ aPrt.Height( getSwFrame().Height() );
+ }
+
const SwFormatCol aOld; // ChgColumns() also needs an old value passed
ChgColumns( aOld, rCol );
}
@@ -386,7 +394,7 @@ void SwFlyFrame::ChainFrames( SwFlyFrame *pMaster, SwFlyFrame *pFollow )
const long nBottom = aRectFnSet.GetPrtBottom(*pMaster);
while ( pInva )
{
- if( aRectFnSet.BottomDist( pInva->Frame(), nBottom ) <= 0 )
+ if( aRectFnSet.BottomDist( pInva->getSwFrame(), nBottom ) <= 0 )
{
pInva->InvalidateSize();
pInva->Prepare();
@@ -525,7 +533,7 @@ SwFrame *SwFlyFrame::FindLastLower()
bool SwFlyFrame::FrameSizeChg( const SwFormatFrameSize &rFrameSize )
{
bool bRet = false;
- SwTwips nDiffHeight = Frame().Height();
+ SwTwips nDiffHeight = getSwFrame().Height();
if ( rFrameSize.GetHeightSizeType() == ATT_VAR_SIZE )
mbFixSize = m_bMinHeight = false;
else
@@ -549,14 +557,24 @@ bool SwFlyFrame::FrameSizeChg( const SwFormatFrameSize &rFrameSize )
if ( Lower()->IsColumnFrame() )
{
const SwRect aOld( GetObjRectWithSpaces() );
- const Size aOldSz( Prt().SSize() );
- const SwTwips nDiffWidth = Frame().Width() - rFrameSize.GetWidth();
- maFrame.Height( maFrame.Height() - nDiffHeight );
- maFrame.Width ( maFrame.Width() - nDiffWidth );
+ const Size aOldSz( getSwPrint().SSize() );
+ const SwTwips nDiffWidth = getSwFrame().Width() - rFrameSize.GetWidth();
+
+ {
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aFrm.Height( aFrm.Height() - nDiffHeight );
+ aFrm.Width ( aFrm.Width() - nDiffWidth );
+ }
+
// #i68520#
InvalidateObjRectWithSpaces();
- maPrt.Height( maPrt.Height() - nDiffHeight );
- maPrt.Width ( maPrt.Width() - nDiffWidth );
+
+ {
+ SwFrameRect::PrintWriteAccess aPrt(*this);
+ aPrt.Height( aPrt.Height() - nDiffHeight );
+ aPrt.Width ( aPrt.Width() - nDiffWidth );
+ }
+
ChgLowersProp( aOldSz );
::Notify( this, FindPageFrame(), aOld );
mbValidPos = false;
@@ -740,7 +758,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
if ( RES_FMT_CHG == nWhich )
{
SwRect aNew( GetObjRectWithSpaces() );
- SwRect aOld( maFrame );
+ SwRect aOld( getSwFrame() );
const SvxULSpaceItem &rUL = static_cast<const SwFormatChg*>(pOld)->pChangedFormat->GetULSpace();
aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) );
aOld.SSize().Height()+= rUL.GetLower();
@@ -800,7 +818,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
GetVirtDrawObj()->SetResizeProtect( rP.IsSizeProtected() );
if ( pSh )
- pSh->InvalidateWindows( Frame() );
+ pSh->InvalidateWindows( getSwFrame() );
const IDocumentDrawModelAccess& rIDDMA = GetFormat()->getIDocumentDrawModelAccess();
const SdrLayerID nId = GetFormat()->GetOpaque().GetValue() ?
rIDDMA.GetHeavenId() :
@@ -838,7 +856,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
getRootFrame()->InvalidateBrowseWidth();
SwRect aNew( GetObjRectWithSpaces() );
- SwRect aOld( maFrame );
+ SwRect aOld( getSwFrame() );
if (pNew)
{
if ( RES_UL_SPACE == nWhich )
@@ -880,7 +898,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
case RES_OPAQUE:
{
if ( pSh )
- pSh->InvalidateWindows( Frame() );
+ pSh->InvalidateWindows( getSwFrame() );
const IDocumentDrawModelAccess& rIDDMA = GetFormat()->getIDocumentDrawModelAccess();
const SdrLayerID nId = static_cast<const SvxOpaqueItem*>(pNew)->GetValue() ?
@@ -909,12 +927,12 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
static_cast<const SwFormatURL*>(pNew)->GetMap() && static_cast<const SwFormatURL*>(pOld)->GetMap() )
{
const SwFormatFrameSize &rSz = GetFormat()->GetFrameSize();
- if ( rSz.GetHeight() != Frame().Height() ||
- rSz.GetWidth() != Frame().Width() )
+ if ( rSz.GetHeight() != getSwFrame().Height() ||
+ rSz.GetWidth() != getSwFrame().Width() )
{
SwFormatURL aURL( GetFormat()->GetURL() );
- Fraction aScaleX( Frame().Width(), rSz.GetWidth() );
- Fraction aScaleY( Frame().Height(), rSz.GetHeight() );
+ Fraction aScaleX( getSwFrame().Width(), rSz.GetWidth() );
+ Fraction aScaleY( getSwFrame().Height(), rSz.GetHeight() );
aURL.GetMap()->Scale( aScaleX, aScaleY );
SwFrameFormat *pFormat = GetFormat();
pFormat->LockModify();
@@ -1068,7 +1086,7 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos )
{
if( pAutoFrame == GetAnchorFrame() )
nTmpY += pAutoFrame->GetRelPos().Y();
- nTmpY -= pAutoFrame->GetUpper()->Prt().Height();
+ nTmpY -= pAutoFrame->GetUpper()->getSwPrint().Height();
pAutoFrame = pAutoFrame->GetFollow();
}
nTmpY = static_cast<SwFlyAtContentFrame*>(this)->GetRelCharY(pAutoFrame)-nTmpY;
@@ -1150,11 +1168,15 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
if ( !mbValidSize )
{
- if ( Frame().Top() == FAR_AWAY && Frame().Left() == FAR_AWAY )
+ if ( getSwFrame().Top() == FAR_AWAY && getSwFrame().Left() == FAR_AWAY )
{
// Remove safety switch (see SwFrame::CTor)
- Frame().Pos().setX(0);
- Frame().Pos().setY(0);
+ {
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aFrm.Pos().setX(0);
+ aFrm.Pos().setY(0);
+ }
+
// #i68520#
InvalidateObjRectWithSpaces();
}
@@ -1193,9 +1215,18 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
if ( nRemaining < MINFLY )
nRemaining = MINFLY;
- aRectFnSet.SetHeight( Prt(), nRemaining );
- nRemaining -= aRectFnSet.GetHeight(Frame());
- aRectFnSet.AddBottom( Frame(), nRemaining + nUL );
+ {
+ SwFrameRect::PrintWriteAccess aPrt(*this);
+ aRectFnSet.SetHeight( aPrt, nRemaining );
+ }
+
+ nRemaining -= aRectFnSet.GetHeight(getSwFrame());
+
+ {
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aRectFnSet.AddBottom( aFrm, nRemaining + nUL );
+ }
+
// #i68520#
if ( nRemaining + nUL != 0 )
{
@@ -1210,7 +1241,7 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
if (SdrObjCustomShape* pCustomShape = dynamic_cast<SdrObjCustomShape*>( pShape) )
{
// The shape is a customshape: then inform it about the calculated fly size.
- Size aSize(aRectFnSet.GetWidth(Frame()), aRectFnSet.GetHeight(Frame()));
+ Size aSize(aRectFnSet.GetWidth(getSwFrame()), aRectFnSet.GetHeight(getSwFrame()));
pCustomShape->SuggestTextFrameSize(aSize);
// Do the calculations normally done after touching editeng text of the shape.
pCustomShape->NbcSetOutlinerParaObjectForText(nullptr, nullptr);
@@ -1225,9 +1256,19 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
nNewSize -= nUL;
if( nNewSize < MINFLY )
nNewSize = MINFLY;
- aRectFnSet.SetHeight( Prt(), nNewSize );
- nNewSize += nUL - aRectFnSet.GetHeight(Frame());
- aRectFnSet.AddBottom( Frame(), nNewSize );
+
+ {
+ SwFrameRect::PrintWriteAccess aPrt(*this);
+ aRectFnSet.SetHeight( aPrt, nNewSize );
+ }
+
+ nNewSize += nUL - aRectFnSet.GetHeight(getSwFrame());
+
+ {
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aRectFnSet.AddBottom( aFrm, nNewSize );
+ }
+
// #i68520#
if ( nNewSize != 0 )
{
@@ -1257,9 +1298,19 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
if( nNewSize < MINFLY )
nNewSize = MINFLY;
- aRectFnSet.SetWidth( Prt(), nNewSize );
- nNewSize += nLR - aRectFnSet.GetWidth(Frame());
- aRectFnSet.AddRight( Frame(), nNewSize );
+
+ {
+ SwFrameRect::PrintWriteAccess aPrt(*this);
+ aRectFnSet.SetWidth( aPrt, nNewSize );
+ }
+
+ nNewSize += nLR - aRectFnSet.GetWidth(getSwFrame());
+
+ {
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aRectFnSet.AddRight( aFrm, nNewSize );
+ }
+
// #i68520#
if ( nNewSize != 0 )
{
@@ -1342,8 +1393,8 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl )
{
pLast = pFrame;
if( pFrame->IsVertical() ?
- ( pFrame->GetUpper()->Prt().Height() != pFrame->Frame().Height() )
- : ( pFrame->GetUpper()->Prt().Width() != pFrame->Frame().Width() ) )
+ ( pFrame->GetUpper()->getSwPrint().Height() != pFrame->getSwFrame().Height() )
+ : ( pFrame->GetUpper()->getSwPrint().Width() != pFrame->getSwFrame().Width() ) )
{
pFrame->Prepare( PREP_FIXSIZE_CHG );
pFrame->InvalidateSize_();
@@ -1604,9 +1655,13 @@ void SwFlyFrame::MakeObjPos()
// update relative position
SetCurrRelPos( aObjPositioning.GetRelPos() );
- SwRectFnSet aRectFnSet(GetAnchorFrame());
- maFrame.Pos( aObjPositioning.GetRelPos() );
- maFrame.Pos() += aRectFnSet.GetPos(GetAnchorFrame()->Frame());
+ {
+ SwRectFnSet aRectFnSet(GetAnchorFrame());
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aFrm.Pos( aObjPositioning.GetRelPos() );
+ aFrm.Pos() += aRectFnSet.GetPos(GetAnchorFrame()->getSwFrame());
+ }
+
// #i69335#
InvalidateObjRectWithSpaces();
}
@@ -1642,7 +1697,7 @@ void SwFlyFrame::MakeContentPos( const SwBorderAttrs &rAttrs )
nMinHeight = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height();
Point aNewContentPos;
- aNewContentPos = Prt().Pos();
+ aNewContentPos = getSwPrint().Pos();
const SdrTextVertAdjust nAdjust = GetFormat()->GetTextVertAdjust().GetValue();
if( nAdjust != SDRTEXTVERTADJUST_TOP )
@@ -1651,7 +1706,7 @@ void SwFlyFrame::MakeContentPos( const SwBorderAttrs &rAttrs )
SwTwips nDiff = 0;
if( nContentHeight != 0)
- nDiff = aRectFnSet.GetHeight(Prt()) - nContentHeight;
+ nDiff = aRectFnSet.GetHeight(getSwPrint()) - nContentHeight;
if( nDiff > 0 )
{
@@ -1697,7 +1752,7 @@ SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst )
SwRectFnSet aRectFnSet(this);
if ( Lower() && !IsColLocked() && !HasFixSize() )
{
- SwTwips nSize = aRectFnSet.GetHeight(Frame());
+ SwTwips nSize = aRectFnSet.GetHeight(getSwFrame());
if( nSize > 0 && nDist > ( LONG_MAX - nSize ) )
nDist = LONG_MAX - nSize;
@@ -1776,7 +1831,7 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst )
if( Lower() && !IsColLocked() && !HasFixSize() )
{
SwRectFnSet aRectFnSet(this);
- SwTwips nHeight = aRectFnSet.GetHeight(Frame());
+ SwTwips nHeight = aRectFnSet.GetHeight(getSwFrame());
if ( nDist > nHeight )
nDist = nHeight;
@@ -1798,14 +1853,25 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst )
if ( !bTst )
{
SwRect aOld( GetObjRectWithSpaces() );
- aRectFnSet.SetHeight( Frame(), nHeight - nVal );
+
+ {
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aRectFnSet.SetHeight( aFrm, nHeight - nVal );
+ }
+
// #i68520#
if ( nHeight - nVal != 0 )
{
InvalidateObjRectWithSpaces();
}
- nHeight = aRectFnSet.GetHeight(Prt());
- aRectFnSet.SetHeight( Prt(), nHeight - nVal );
+
+ nHeight = aRectFnSet.GetHeight(getSwPrint());
+
+ {
+ SwFrameRect::PrintWriteAccess aPrt(*this);
+ aRectFnSet.SetHeight( aPrt, nHeight - nVal );
+ }
+
InvalidatePos_();
InvalidateSize();
::Notify( this, FindPageFrame(), aOld );
@@ -1895,7 +1961,7 @@ Size SwFlyFrame::ChgSize( const Size& aNewSize )
}
}
}
- if ( aAdjustedNewSize != Frame().SSize() )
+ if ( aAdjustedNewSize != getSwFrame().SSize() )
{
SwFrameFormat *pFormat = GetFormat();
SwFormatFrameSize aSz( pFormat->GetFrameSize() );
@@ -1906,7 +1972,7 @@ Size SwFlyFrame::ChgSize( const Size& aNewSize )
return aSz.GetSize();
}
else
- return Frame().SSize();
+ return getSwFrame().SSize();
}
bool SwFlyFrame::IsLowerOf( const SwLayoutFrame* pUpperFrame ) const
@@ -2174,7 +2240,7 @@ void SwLayoutFrame::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
{
SwFlyFrame* pFly = static_cast<SwFlyFrame*>(pObj);
- if ( pFly->Frame().Left() == FAR_AWAY )
+ if ( pFly->getSwFrame().Left() == FAR_AWAY )
continue;
if ( pFly->IsAnLower( this ) )
@@ -2249,11 +2315,11 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize &rSz ) const
nRelWidth = pSh->GetBrowseWidth();
nRelHeight = pSh->VisArea().Height();
Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
- long nDiff = nRelWidth - pRel->Prt().Width();
+ long nDiff = nRelWidth - pRel->getSwPrint().Width();
if ( nDiff > 0 )
nRelWidth -= nDiff;
nRelHeight -= 2*aBorder.Height();
- nDiff = nRelHeight - pRel->Prt().Height();
+ nDiff = nRelHeight - pRel->getSwPrint().Height();
if ( nDiff > 0 )
nRelHeight -= nDiff;
}
@@ -2261,9 +2327,9 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize &rSz ) const
// At the moment only the "== PAGE_FRAME" and "!= PAGE_FRAME" cases are handled.
// When size is a relative to page size, ignore size of SwBodyFrame.
if (rSz.GetWidthPercentRelation() != text::RelOrientation::PAGE_FRAME)
- nRelWidth = std::min( nRelWidth, pRel->Prt().Width() );
+ nRelWidth = std::min( nRelWidth, pRel->getSwPrint().Width() );
if (rSz.GetHeightPercentRelation() != text::RelOrientation::PAGE_FRAME)
- nRelHeight = std::min( nRelHeight, pRel->Prt().Height() );
+ nRelHeight = std::min( nRelHeight, pRel->getSwPrint().Height() );
if( !pRel->IsPageFrame() )
{
const SwPageFrame* pPage = FindPageFrame();
@@ -2271,14 +2337,14 @@ Size SwFlyFrame::CalcRel( const SwFormatFrameSize &rSz ) const
{
if (rSz.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME)
// Ignore margins of pPage.
- nRelWidth = std::min( nRelWidth, pPage->Frame().Width() );
+ nRelWidth = std::min( nRelWidth, pPage->getSwFrame().Width() );
else
- nRelWidth = std::min( nRelWidth, pPage->Prt().Width() );
+ nRelWidth = std::min( nRelWidth, pPage->getSwPrint().Width() );
if (rSz.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME)
// Ignore margins of pPage.
- nRelHeight = std::min( nRelHeight, pPage->Frame().Height() );
+ nRelHeight = std::min( nRelHeight, pPage->getSwFrame().Height() );
else
- nRelHeight = std::min( nRelHeight, pPage->Prt().Height() );
+ nRelHeight = std::min( nRelHeight, pPage->getSwPrint().Height() );
}
}
@@ -2334,8 +2400,8 @@ static SwTwips lcl_CalcAutoWidth( const SwLayoutFrame& rFrame )
const SwPageFrame* pPage = rFrame.FindPageFrame();
// auto width table
nMin = pFrame->GetUpper()->IsVertical() ?
- pPage->Prt().Height() :
- pPage->Prt().Width();
+ pPage->getSwPrint().Height() :
+ pPage->getSwPrint().Width();
}
else
{
@@ -2490,7 +2556,7 @@ const SwFrameFormat& SwFlyFrame::GetFrameFormat() const
const SwRect SwFlyFrame::GetObjRect() const
{
- return Frame();
+ return getSwFrame();
}
// #i70122#
@@ -2503,17 +2569,17 @@ const SwRect SwFlyFrame::GetObjBoundRect() const
// #i68520#
bool SwFlyFrame::SetObjTop_( const SwTwips _nTop )
{
- const bool bChanged( Frame().Pos().getY() != _nTop );
-
- Frame().Pos().setY(_nTop);
+ const bool bChanged( getSwFrame().Pos().getY() != _nTop );
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aFrm.Pos().setY(_nTop);
return bChanged;
}
bool SwFlyFrame::SetObjLeft_( const SwTwips _nLeft )
{
- const bool bChanged( Frame().Pos().getX() != _nLeft );
-
- Frame().Pos().setX(_nLeft);
+ const bool bChanged( getSwFrame().Pos().getX() != _nLeft );
+ SwFrameRect::FrameWriteAccess aFrm(*this);
+ aFrm.Pos().setX(_nLeft);
return bChanged;
}
@@ -2572,18 +2638,18 @@ SwTwips SwFlyFrame::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips
if ( Lower()->IsColumnFrame() )
{
FormatWidthCols( *pAttrs, nUL, nMinHeight );
- nHeight = aRectFnSet.GetHeight(Lower()->Frame());
+ nHeight = aRectFnSet.GetHeight(Lower()->getSwFrame());
}
else
{
SwFrame *pFrame = Lower();
while ( pFrame )
{
- nHeight += aRectFnSet.GetHeight(pFrame->Frame());
+ nHeight += aRectFnSet.GetHeight(pFrame->getSwFrame());
if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() )
// This TextFrame would like to be a bit larger
nHeight += static_cast<SwTextFrame*>(pFrame)->GetParHeight()
- - aRectFnSet.GetHeight(pFrame->Prt());
+ - aRectFnSet.GetHeight(pFrame->getSwPrint());
else if( pFrame->IsSctFrame() && static_cast<SwSectionFrame*>(pFrame)->IsUndersized() )
nHeight += static_cast<SwSectionFrame*>(pFrame)->Undersize();
pFrame = pFrame->GetNext();
@@ -2592,9 +2658,9 @@ SwTwips SwFlyFrame::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips
if ( GetDrawObjs() )
{
const size_t nCnt = GetDrawObjs()->size();
- SwTwips nTop = aRectFnSet.GetTop(Frame());
- SwTwips nBorder = aRectFnSet.GetHeight(Frame()) -
- aRectFnSet.GetHeight(Prt());
+ SwTwips nTop = aRectFnSet.GetTop(getSwFrame());
+ SwTwips nBorder = aRectFnSet.GetHeight(getSwFrame()) -
+ aRectFnSet.GetHeight(getSwPrint());
for ( size_t i = 0; i < nCnt; ++i )
{
SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i];
@@ -2604,10 +2670,10 @@ SwTwips SwFlyFrame::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips
// OD 06.11.2003 #i22305# - consider
// only Writer fly frames, which follow the text flow.
if ( pFly->IsFlyLayFrame() &&
- pFly->Frame().Top() != FAR_AWAY &&
+ pFly->getSwFrame().Top() != FAR_AWAY &&
pFly->GetFormat()->GetFollowTextFlow().GetValue() )
{
- SwTwips nDist = -aRectFnSet.BottomDist( pFly->Frame(), nTop );
+ SwTwips nDist = -aRectFnSet.BottomDist( pFly->getSwFrame(), nTop );
if( nDist > nBorder + nHeight )
nHeight = nDist - nBorder;
}