summaryrefslogtreecommitdiff
path: root/sw/source/core/layout
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-10-26 10:40:43 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2017-10-30 12:13:14 +0100
commitf6edddfa230d6478571ef67ebdc506c54f589648 (patch)
tree02c90218c08315726943bb42a03e1a167fee9ac6 /sw/source/core/layout
parent46d233c026fd104f449bb99c1c6f80de34c9a4c6 (diff)
Migrated from SwFrame::PrintWA to setPrint
Change-Id: Ieea3b467f296a190de5b5f47721bef148bebf60b
Diffstat (limited to 'sw/source/core/layout')
-rw-r--r--sw/source/core/layout/calcmove.cxx70
-rw-r--r--sw/source/core/layout/fly.cxx39
-rw-r--r--sw/source/core/layout/flylay.cxx14
-rw-r--r--sw/source/core/layout/ftnfrm.cxx37
-rw-r--r--sw/source/core/layout/hffrm.cxx45
-rw-r--r--sw/source/core/layout/pagechg.cxx34
-rw-r--r--sw/source/core/layout/sectfrm.cxx27
-rw-r--r--sw/source/core/layout/ssfrm.cxx44
-rw-r--r--sw/source/core/layout/tabfrm.cxx51
-rw-r--r--sw/source/core/layout/wsfrm.cxx31
10 files changed, 276 insertions, 116 deletions
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 8b90c935bc45..050aa16c65da 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -785,10 +785,13 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext)
aFrm.Width( 0 );
setFrame(aFrm);
- PrintWA().Height( 0 );
- PrintWA().Height( 0 );
- PrintWA().Left( 0 );
- PrintWA().Top( 0 );
+ SwRect aPrt(PrintRA());
+ aPrt.Height( 0 );
+ aPrt.Height( 0 );
+ aPrt.Left( 0 );
+ aPrt.Top( 0 );
+ setPrint(aPrt);
+
mbValidSize = mbValidPrtArea = true;
}
else
@@ -843,10 +846,12 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext)
}
setFrame(aFrm);
- PrintWA().Left ( pAttrs->CalcLeftLine() + aBorder.Width() );
- PrintWA().Top ( nTop );
- PrintWA().Width( FrameRA().Width() - ( PrintRA().Left() + pAttrs->CalcRightLine() + aBorder.Width() ) );
- PrintWA().Height( FrameRA().Height() - (nTop + nBottom) );
+ SwRect aPrt(PrintRA());
+ aPrt.Left ( pAttrs->CalcLeftLine() + aBorder.Width() );
+ aPrt.Top ( nTop );
+ aPrt.Width( FrameRA().Width() - ( aPrt.Left() + pAttrs->CalcRightLine() + aBorder.Width() ) );
+ aPrt.Height( FrameRA().Height() - (nTop + nBottom) );
+ setPrint(aPrt);
mbValidSize = mbValidPrtArea = true;
continue;
@@ -869,8 +874,11 @@ void SwPageFrame::MakeAll(vcl::RenderContext* pRenderContext)
if (height > 0)
{
ChgSize(Size(FrameRA().Width(), height));
- PrintWA().Top(0);
- PrintWA().Height(height);
+
+ SwRect aPrt(PrintRA());
+ aPrt.Top(0);
+ aPrt.Height(height);
+ setPrint(aPrt);
mbValidSize = mbValidPrtArea = true;
continue;
@@ -1033,11 +1041,17 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs )
static_cast<SwTextFrame*>(this)->JoinFrame();
if( aRectFnSet.GetHeight(PrintRA()) )
+ {
static_cast<SwTextFrame*>(this)->HideHidden();
- PrintWA().Pos().setX(0);
- PrintWA().Pos().setY(0);
- aRectFnSet.SetWidth( PrintWA(), aRectFnSet.GetWidth(FrameRA()) );
- aRectFnSet.SetHeight( PrintWA(), 0 );
+ }
+
+ SwRect aPrt(PrintRA());
+ aPrt.Pos().setX(0);
+ aPrt.Pos().setY(0);
+ aRectFnSet.SetWidth( aPrt, aRectFnSet.GetWidth(FrameRA()) );
+ aRectFnSet.SetHeight( aPrt, 0 );
+ setPrint(aPrt);
+
nUpper = -( aRectFnSet.GetHeight(FrameRA()) );
}
else
@@ -1087,18 +1101,26 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs )
nWidth -= aRectFnSet.GetLeft(PrintRA());
nWidth -= rAttrs.CalcRightLine();
nWidth = std::max( nMinWidth, nWidth );
- aRectFnSet.SetWidth( PrintWA(), std::min( nWidth, aRectFnSet.GetWidth(PrintRA()) ) );
+
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetWidth( aPrt, std::min( nWidth, aRectFnSet.GetWidth(aPrt) ) );
+ setPrint(aPrt);
}
if ( aRectFnSet.GetWidth(PrintRA()) <= MINLAY )
{
// The PrtArea should already be at least MINLAY wide, matching the
// minimal values of the UI
- aRectFnSet.SetWidth( PrintWA(), std::min( long(MINLAY), aRectFnSet.GetWidth(FrameRA()) ) );
- SwTwips nTmp = aRectFnSet.GetWidth(FrameRA()) -
- aRectFnSet.GetWidth(PrintRA());
- if( aRectFnSet.GetLeft(PrintRA()) > nTmp )
- aRectFnSet.SetLeft( PrintWA(), nTmp );
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetWidth( aPrt, std::min( long(MINLAY), aRectFnSet.GetWidth(FrameRA()) ) );
+ SwTwips nTmp = aRectFnSet.GetWidth(FrameRA()) - aRectFnSet.GetWidth(aPrt);
+
+ if( aRectFnSet.GetLeft(aPrt) > nTmp )
+ {
+ aRectFnSet.SetLeft( aPrt, nTmp );
+ }
+
+ setPrint(aPrt);
}
// The following rules apply for VarSize:
@@ -1121,10 +1143,12 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs )
nLower=0;
}
- aRectFnSet.SetPosY( PrintWA(), (!aRectFnSet.IsVert() || mbReverse) ? nUpper : nLower);
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetPosY( aPrt, (!aRectFnSet.IsVert() || mbReverse) ? nUpper : nLower);
+ setPrint(aPrt);
+
nUpper += nLower;
- nUpper -= aRectFnSet.GetHeight(FrameRA()) -
- aRectFnSet.GetHeight(PrintRA());
+ nUpper -= aRectFnSet.GetHeight(FrameRA()) - aRectFnSet.GetHeight(PrintRA());
}
// If there's a difference between old and new size, call Grow() or
// Shrink() respectively.
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index cf4afef72fac..870cbdf36362 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -227,8 +227,11 @@ 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.
- PrintWA().Width( FrameRA().Width() );
- PrintWA().Height( FrameRA().Height() );
+ SwRect aPrt(PrintRA());
+ aPrt.Width( FrameRA().Width() );
+ aPrt.Height( FrameRA().Height() );
+ setPrint(aPrt);
+
const SwFormatCol aOld; // ChgColumns() also needs an old value passed
ChgColumns( aOld, rCol );
}
@@ -561,8 +564,12 @@ bool SwFlyFrame::FrameSizeChg( const SwFormatFrameSize &rFrameSize )
// #i68520#
InvalidateObjRectWithSpaces();
- PrintWA().Height( PrintRA().Height() - nDiffHeight );
- PrintWA().Width ( PrintRA().Width() - nDiffWidth );
+
+ SwRect aPrt(PrintRA());
+ aPrt.Height( aPrt.Height() - nDiffHeight );
+ aPrt.Width ( aPrt.Width() - nDiffWidth );
+ setPrint(aPrt);
+
ChgLowersProp( aOldSz );
::Notify( this, FindPageFrame(), aOld );
mbValidPos = false;
@@ -1202,7 +1209,10 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
if ( nRemaining < MINFLY )
nRemaining = MINFLY;
- aRectFnSet.SetHeight( PrintWA(), nRemaining );
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetHeight( aPrt, nRemaining );
+ setPrint(aPrt);
+
nRemaining -= aRectFnSet.GetHeight(FrameRA());
SwRect aFrm(FrameRA());
@@ -1238,7 +1248,11 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
nNewSize -= nUL;
if( nNewSize < MINFLY )
nNewSize = MINFLY;
- aRectFnSet.SetHeight( PrintWA(), nNewSize );
+
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetHeight( aPrt, nNewSize );
+ setPrint(aPrt);
+
nNewSize += nUL - aRectFnSet.GetHeight(FrameRA());
SwRect aFrm(FrameRA());
@@ -1274,7 +1288,11 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
if( nNewSize < MINFLY )
nNewSize = MINFLY;
- aRectFnSet.SetWidth( PrintWA(), nNewSize );
+
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetWidth( aPrt, nNewSize );
+ setPrint(aPrt);
+
nNewSize += nLR - aRectFnSet.GetWidth(FrameRA());
SwRect aFrm(FrameRA());
@@ -1832,8 +1850,13 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst )
{
InvalidateObjRectWithSpaces();
}
+
nHeight = aRectFnSet.GetHeight(PrintRA());
- aRectFnSet.SetHeight( PrintWA(), nHeight - nVal );
+
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetHeight( aPrt, nHeight - nVal );
+ setPrint(aPrt);
+
InvalidatePos_();
InvalidateSize();
::Notify( this, FindPageFrame(), aOld );
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index f49909a16e86..937f2cf9bd7b 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -441,12 +441,14 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz )
aFrm.Width ( std::max( long(MINLAY), aFrameRect.Width() ) );
setFrame(aFrm);
+ SwRect aPrt(PrintRA());
+
if ( Lower() && Lower()->IsColumnFrame() )
{
ColLock(); //lock grow/shrink
- const Size aTmpOldSize( PrintRA().SSize() );
- PrintWA().Height( FrameRA().Height() - nPrtHeightDiff );
- PrintWA().Width ( FrameRA().Width() - nPrtWidthDiff );
+ const Size aTmpOldSize( aPrt.SSize() );
+ aPrt.Height( FrameRA().Height() - nPrtHeightDiff );
+ aPrt.Width ( FrameRA().Width() - nPrtWidthDiff );
ChgLowersProp( aTmpOldSize );
SwFrame *pLow = Lower();
do
@@ -463,9 +465,11 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz )
}
else
{
- PrintWA().Height( FrameRA().Height() - nPrtHeightDiff );
- PrintWA().Width ( FrameRA().Width() - nPrtWidthDiff );
+ aPrt.Height( FrameRA().Height() - nPrtHeightDiff );
+ aPrt.Width ( FrameRA().Width() - nPrtWidthDiff );
}
+
+ setPrint(aPrt);
}
}
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index c332c975ad1f..3063c00d9a2f 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -191,11 +191,18 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const
if ( !mbValidPrtArea )
{
mbValidPrtArea = true;
- aRectFnSet.SetTop( PrintWA(), nBorder );
- aRectFnSet.SetWidth( PrintWA(), aRectFnSet.GetWidth(FrameRA()) );
- aRectFnSet.SetHeight(PrintWA(), aRectFnSet.GetHeight(FrameRA()) - nBorder );
- if( aRectFnSet.GetHeight(PrintRA()) < 0 && !pPage->IsFootnotePage() )
+ SwRect aPrt(PrintRA());
+
+ aRectFnSet.SetTop( aPrt, nBorder );
+ aRectFnSet.SetWidth( aPrt, aRectFnSet.GetWidth(FrameRA()) );
+ aRectFnSet.SetHeight(aPrt, aRectFnSet.GetHeight(FrameRA()) - nBorder );
+
+ if( aRectFnSet.GetHeight(aPrt) < 0 && !pPage->IsFootnotePage() )
+ {
mbValidSize = false;
+ }
+
+ setPrint(aPrt);
}
if ( !mbValidSize )
@@ -254,9 +261,11 @@ void SwFootnoteContFrame::Format( vcl::RenderContext* /*pRenderContext*/, const
SwTwips nPrtHeight = aRectFnSet.GetHeight(PrintRA());
if( nPrtHeight < 0 )
{
- const SwTwips nTmpDiff = std::max( aRectFnSet.GetTop(PrintRA()),
- -nPrtHeight );
- aRectFnSet.SubTop( PrintWA(), nTmpDiff );
+ const SwTwips nTmpDiff = std::max( aRectFnSet.GetTop(PrintRA()), -nPrtHeight );
+
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SubTop( aPrt, nTmpDiff );
+ setPrint(aPrt);
}
}
}
@@ -1921,7 +1930,10 @@ void SwFootnoteBossFrame::MoveFootnotes_( SwFootnoteFrames &rFootnoteArr, bool b
aRectFnSet.SetHeight(aFrm, 0);
pTmp->setFrame(aFrm);
- aRectFnSet.SetHeight(pTmp->PrintWA(), 0);
+ SwRect aPrt(pTmp->PrintRA());
+ aRectFnSet.SetHeight(aPrt, 0);
+ pTmp->setPrint(aPrt);
+
pTmp = pTmp->FindNext();
}
}
@@ -1934,7 +1946,10 @@ void SwFootnoteBossFrame::MoveFootnotes_( SwFootnoteFrames &rFootnoteArr, bool b
aRectFnSet.SetHeight(aFrm, 0);
pCnt->setFrame(aFrm);
- aRectFnSet.SetHeight(pCnt->PrintWA(), 0);
+ SwRect aPrt(pCnt->PrintRA());
+ aRectFnSet.SetHeight(aPrt, 0);
+ pCnt->setPrint(aPrt);
+
pCnt = pCnt->GetNext();
}
@@ -1942,7 +1957,9 @@ void SwFootnoteBossFrame::MoveFootnotes_( SwFootnoteFrames &rFootnoteArr, bool b
aRectFnSet.SetHeight(aFrm, 0);
pFootnote->setFrame(aFrm);
- aRectFnSet.SetHeight(pFootnote->PrintWA(), 0);
+ SwRect aPrt(pFootnote->PrintRA());
+ aRectFnSet.SetHeight(aPrt, 0);
+ pFootnote->setPrint(aPrt);
pFootnote->Calc(getRootFrame()->GetCurrShell()->GetOut());
pFootnote->GetUpper()->Calc(getRootFrame()->GetCurrShell()->GetOut());
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index af61a110736b..1b43d3b4009f 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -111,6 +111,8 @@ SwHeadFootFrame::SwHeadFootFrame( SwFrameFormat * pFormat, SwFrame* pSib, SwFram
void SwHeadFootFrame::FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs)
{
+ SwRect aPrt(PrintRA());
+
if (GetEatSpacing())
{
/* The minimal height of the print area is the minimal height of the
@@ -172,39 +174,48 @@ void SwHeadFootFrame::FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs)
// OD 23.01.2003 #106895# - add first parameter to <SwBorderAttrs::CalcRight(..)>
SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
- PrintWA().Left(pAttrs->CalcLeft(this));
+ aPrt.Left(pAttrs->CalcLeft(this));
if (IsHeaderFrame())
- PrintWA().Top(pAttrs->CalcTop());
+ {
+ aPrt.Top(pAttrs->CalcTop());
+ }
else
- PrintWA().Top(nSpace);
+ {
+ aPrt.Top(nSpace);
+ }
- PrintWA().Width(FrameRA().Width() - nLR);
+ aPrt.Width(FrameRA().Width() - nLR);
SwTwips nNewHeight;
if (nUL < FrameRA().Height())
+ {
nNewHeight = FrameRA().Height() - nUL;
+ }
else
+ {
nNewHeight = 0;
+ }
- PrintWA().Height(nNewHeight);
+ aPrt.Height(nNewHeight);
}
else
{
// Set position
- PrintWA().Left( pAttrs->CalcLeft( this ) );
- PrintWA().Top ( pAttrs->CalcTop() );
+ aPrt.Left( pAttrs->CalcLeft( this ) );
+ aPrt.Top ( pAttrs->CalcTop() );
// Set sizes - the sizes are given by the surrounding Frame, just
// subtract the borders.
// OD 23.01.2003 #106895# - add first parameter to <SwBorderAttrs::CalcRight(..)>
SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
- PrintWA().Width ( FrameRA().Width() - nLR );
- PrintWA().Height( FrameRA().Height()- nUL );
+ aPrt.Width ( FrameRA().Width() - nLR );
+ aPrt.Height( FrameRA().Height()- nUL );
}
+ setPrint(aPrt);
mbValidPrtArea = true;
}
@@ -373,7 +384,9 @@ void SwHeadFootFrame::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
aFrm.Bottom( nDeadLine );
setFrame(aFrm);
- PrintWA().SSize().Height() = FrameRA().Height() - nBorder;
+ SwRect aPrt(PrintRA());
+ aPrt.SSize().Height() = FrameRA().Height() - nBorder;
+ setPrint(aPrt);
}
}
mbValidSize = mbValidPrtArea = true;
@@ -478,8 +491,10 @@ SwTwips SwHeadFootFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
{
if (! IsHeaderFrame())
{
- PrintWA().Top(PrintRA().Top() - nEat);
- PrintWA().Height(PrintRA().Height() - nEat);
+ SwRect aPrt(PrintRA());
+ aPrt.Top(aPrt.Top() - nEat);
+ aPrt.Height(aPrt.Height() - nEat);
+ setPrint(aPrt);
}
InvalidateAll();
@@ -594,8 +609,10 @@ SwTwips SwHeadFootFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
{
if (! IsHeaderFrame() )
{
- PrintWA().Top(PrintRA().Top() + nShrink);
- PrintWA().Height(PrintRA().Height() - nShrink);
+ SwRect aPrt(PrintRA());
+ aPrt.Top(aPrt.Top() + nShrink);
+ aPrt.Height(aPrt.Height() - nShrink);
+ setPrint(aPrt);
}
InvalidateAll();
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 6d27aaea599c..9d8327c4d1ff 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -128,8 +128,9 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
nSize -= nBorder;
nBorder /= 2;
}
- aRectFnSet.SetPosX( PrintWA(), nBorder );
- aRectFnSet.SetWidth( PrintWA(), nSize );
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetPosX( aPrt, nBorder );
+ aRectFnSet.SetWidth( aPrt, nSize );
// Height of body frame:
nBorder = aRectFnSet.GetHeight(FrameRA());
@@ -148,17 +149,22 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
const bool bAdjust = static_cast<SwPageFrame*>(GetUpper())->GetFormat()->GetDoc()->
GetFootnoteIdxs().empty();
- aRectFnSet.SetPosY( PrintWA(), bAdjust ? nBorder : 0 );
- aRectFnSet.SetHeight( PrintWA(), nSize );
+ aRectFnSet.SetPosY( aPrt, bAdjust ? nBorder : 0 );
+ aRectFnSet.SetHeight( aPrt, nSize );
+ setPrint(aPrt);
}
}
+
if( bNoGrid )
{
- PrintWA().Pos().setX(0);
- PrintWA().Pos().setY(0);
- PrintWA().Height( FrameRA().Height() );
- PrintWA().Width( FrameRA().Width() );
+ SwRect aPrt(PrintRA());
+ aPrt.Pos().setX(0);
+ aPrt.Pos().setY(0);
+ aPrt.Height( FrameRA().Height() );
+ aPrt.Width( FrameRA().Width() );
+ setPrint(aPrt);
}
+
mbValidSize = mbValidPrtArea = true;
}
@@ -1605,10 +1611,14 @@ void SwRootFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
}
if ( !mbValidPrtArea )
- { mbValidPrtArea = true;
- PrintWA().Pos().setX(0);
- PrintWA().Pos().setY(0);
- PrintWA().SSize( FrameRA().SSize() );
+ {
+ mbValidPrtArea = true;
+
+ SwRect aPrt(PrintRA());
+ aPrt.Pos().setX(0);
+ aPrt.Pos().setY(0);
+ aPrt.SSize( FrameRA().SSize() );
+ setPrint(aPrt);
}
if ( !mbValidSize )
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index dd42553cbc2f..40107062d4ba 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -109,10 +109,11 @@ void SwSectionFrame::Init()
// #109700# LRSpace for sections
const SvxLRSpaceItem& rLRSpace = GetFormat()->GetLRSpace();
- aRectFnSet.SetLeft( PrintWA(), rLRSpace.GetLeft() );
- aRectFnSet.SetWidth( PrintWA(), nWidth - rLRSpace.GetLeft() -
- rLRSpace.GetRight() );
- aRectFnSet.SetHeight( PrintWA(), 0 );
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetLeft( aPrt, rLRSpace.GetLeft() );
+ aRectFnSet.SetWidth( aPrt, nWidth - rLRSpace.GetLeft() - rLRSpace.GetRight() );
+ aRectFnSet.SetHeight( aPrt, 0 );
+ setPrint(aPrt);
const SwFormatCol &rCol = GetFormat()->GetCol();
if( ( rCol.GetNumCols() > 1 || IsAnyNoteAtEnd() ) && !IsInFootnote() )
@@ -296,8 +297,11 @@ void SwSectionFrame::Cut_( bool bRemove )
aRectFnSet.SetHeight( aFrm, 0 );
setFrame(aFrm);
- aRectFnSet.SetHeight( PrintWA(), 0 );
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetHeight( aPrt, 0 );
+ setPrint(aPrt);
}
+
pUp->Shrink( nFrameHeight );
}
}
@@ -1338,14 +1342,15 @@ void SwSectionFrame::Format( vcl::RenderContext* pRenderContext, const SwBorderA
if( GetUpper() )
{
long nWidth = aRectFnSet.GetWidth(GetUpper()->PrintRA());
-
SwRect aFrm(FrameRA());
aRectFnSet.SetWidth( aFrm, nWidth );
setFrame(aFrm);
// #109700# LRSpace for sections
const SvxLRSpaceItem& rLRSpace = GetFormat()->GetLRSpace();
- aRectFnSet.SetWidth( PrintWA(), nWidth - rLRSpace.GetLeft() - rLRSpace.GetRight() );
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetWidth( aPrt, nWidth - rLRSpace.GetLeft() - rLRSpace.GetRight() );
+ setPrint(aPrt);
// OD 15.10.2002 #103517# - allow grow in online layout
// Thus, set <..IsBrowseMode()> as parameter <bGrow> on calling
@@ -2053,7 +2058,9 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst )
setFrame(aFrm);
long nPrtHeight = aRectFnSet.GetHeight(PrintRA()) + nGrow;
- aRectFnSet.SetHeight( PrintWA(), nPrtHeight );
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetHeight( aPrt, nPrtHeight );
+ setPrint(aPrt);
if( Lower() && Lower()->IsColumnFrame() && Lower()->GetNext() )
{
@@ -2140,7 +2147,9 @@ SwTwips SwSectionFrame::Shrink_( SwTwips nDist, bool bTst )
setFrame(aFrm);
long nPrtHeight = aRectFnSet.GetHeight(PrintRA()) - nDist;
- aRectFnSet.SetHeight( PrintWA(), nPrtHeight );
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetHeight( aPrt, nPrtHeight );
+ setPrint(aPrt);
// We do not allow a section frame to shrink the its upper
// footer frame. This is because in the calculation of a
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 6f965a25b721..03ca58569a98 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -59,7 +59,10 @@ bool SwFrame::SetMinLeft( long nDeadline )
aFrm.Left( nDeadline );
setFrame(aFrm);
- PrintWA().Width( PrintRA().Width() - nDiff );
+ SwRect aPrt(PrintRA());
+ aPrt.Width( aPrt.Width() - nDiff );
+ setPrint(aPrt);
+
return true;
}
return false;
@@ -74,7 +77,10 @@ bool SwFrame::SetMaxBottom( long nDeadline )
aFrm.Height( aFrm.Height() - nDiff );
setFrame(aFrm);
- PrintWA().Height( PrintRA().Height() - nDiff );
+ SwRect aPrt(PrintRA());
+ aPrt.Height( aPrt.Height() - nDiff );
+ setPrint(aPrt);
+
return true;
}
return false;
@@ -89,7 +95,10 @@ bool SwFrame::SetMinTop( long nDeadline )
aFrm.Top( nDeadline );
setFrame(aFrm);
- PrintWA().Height( PrintRA().Height() - nDiff );
+ SwRect aPrt(PrintRA());
+ aPrt.Height( aPrt.Height() - nDiff );
+ setPrint(aPrt);
+
return true;
}
return false;
@@ -104,7 +113,10 @@ bool SwFrame::SetMaxRight( long nDeadline )
aFrm.Width( aFrm.Width() - nDiff );
setFrame(aFrm);
- PrintWA().Width( PrintRA().Width() - nDiff );
+ SwRect aPrt(PrintRA());
+ aPrt.Width( aPrt.Width() - nDiff );
+ setPrint(aPrt);
+
return true;
}
return false;
@@ -206,26 +218,34 @@ void SwFrame::MakeRightPos( const SwFrame* pUp, const SwFrame* pPrv, bool bNotif
void SwFrame::SetTopBottomMargins( long nTop, long nBot )
{
- PrintWA().Top( nTop );
- PrintWA().Height( FrameRA().Height() - nTop - nBot );
+ SwRect aPrt(PrintRA());
+ aPrt.Top( nTop );
+ aPrt.Height( FrameRA().Height() - nTop - nBot );
+ setPrint(aPrt);
}
void SwFrame::SetBottomTopMargins( long nBot, long nTop )
{
- PrintWA().Top( nTop );
- PrintWA().Height( FrameRA().Height() - nTop - nBot );
+ SwRect aPrt(PrintRA());
+ aPrt.Top( nTop );
+ aPrt.Height( FrameRA().Height() - nTop - nBot );
+ setPrint(aPrt);
}
void SwFrame::SetLeftRightMargins( long nLeft, long nRight)
{
- PrintWA().Left( nLeft );
- PrintWA().Width( FrameRA().Width() - nLeft - nRight );
+ SwRect aPrt(PrintRA());
+ aPrt.Left( nLeft );
+ aPrt.Width( FrameRA().Width() - nLeft - nRight );
+ setPrint(aPrt);
}
void SwFrame::SetRightLeftMargins( long nRight, long nLeft)
{
- PrintWA().Left( nLeft );
- PrintWA().Width( FrameRA().Width() - nLeft - nRight );
+ SwRect aPrt(PrintRA());
+ aPrt.Left( nLeft );
+ aPrt.Width( FrameRA().Width() - nLeft - nRight );
+ setPrint(aPrt);
}
/// checks the layout direction and invalidates the lower frames recursively, if necessary.
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 91c5fabd7b99..c422b89fac71 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -357,8 +357,10 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow )
aRectFnSet.SetHeight(aFrm, 0);
pTmp->setFrame(aFrm);
- aRectFnSet.SetTop(pTmp->PrintWA(), 0);
- aRectFnSet.SetHeight(pTmp->PrintWA(), 0);
+ SwRect aPrt(pTmp->PrintRA());
+ aRectFnSet.SetTop(aPrt, 0);
+ aRectFnSet.SetHeight(aPrt, 0);
+ pTmp->setPrint(aPrt);
}
else
bAllLowersCollapsed = false;
@@ -366,11 +368,16 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow )
else
{
pTmp->Shrink(aRectFnSet.GetHeight(pTmp->FrameRA()));
- aRectFnSet.SetTop(pTmp->PrintWA(), 0);
- aRectFnSet.SetHeight(pTmp->PrintWA(), 0);
+ SwRect aPrt(pTmp->PrintRA());
+ aRectFnSet.SetTop(aPrt, 0);
+ aRectFnSet.SetHeight(aPrt, 0);
if (aRectFnSet.GetHeight(pTmp->FrameRA()) > 0)
+ {
bAllLowersCollapsed = false;
+ }
+
+ pTmp->setPrint(aPrt);
}
pTmp = pTmp->GetPrev();
@@ -389,8 +396,10 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow )
aRectFnSet.SetHeight(aFrm, 0);
pCurrMasterCell->setFrame(aFrm);
- aRectFnSet.SetTop(pCurrMasterCell->PrintWA(), 0);
- aRectFnSet.SetHeight(pCurrMasterCell->PrintWA(), 0);
+ SwRect aPrt(pCurrMasterCell->PrintRA());
+ aRectFnSet.SetTop(aPrt, 0);
+ aRectFnSet.SetHeight(aPrt, 0);
+ pCurrMasterCell->setPrint(aPrt);
}
else
bAllCellsCollapsed = false;
@@ -405,8 +414,10 @@ static void lcl_ShrinkCellsAndAllContent( SwRowFrame& rRow )
aRectFnSet.SetHeight(aFrm, 0);
rRow.setFrame(aFrm);
- aRectFnSet.SetTop(rRow.PrintWA(), 0);
- aRectFnSet.SetHeight(rRow.PrintWA(), 0);
+ SwRect aPrt(rRow.PrintRA());
+ aRectFnSet.SetTop(aPrt, 0);
+ aRectFnSet.SetHeight(aPrt, 0);
+ rRow.setPrint(aPrt);
}
}
@@ -1158,7 +1169,9 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK
aRectFnSet.SetLeft(aFrm, aRectFnSet.GetLeft(FrameRA()));
pFoll->setFrame(aFrm);
- aRectFnSet.AddWidth(pFoll->PrintWA(), aRectFnSet.GetWidth(PrintRA()));
+ SwRect aPrt(pFoll->PrintRA());
+ aRectFnSet.AddWidth(aPrt, aRectFnSet.GetWidth(PrintRA()));
+ pFoll->setPrint(aPrt);
// Insert the new follow table
pFoll->InsertBehind( GetUpper(), this );
@@ -2970,7 +2983,10 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
long nWidth = pSh->GetBrowseWidth();
nWidth -= PrintRA().Left();
nWidth -= pAttrs->CalcRightLine();
- PrintWA().Width( std::min( nWidth, PrintRA().Width() ) );
+
+ SwRect aPrt(PrintRA());
+ aPrt.Width( std::min( nWidth, aPrt.Width() ) );
+ setPrint(aPrt);
}
if ( nOldHeight != aRectFnSet.GetHeight(PrintRA()) )
@@ -4085,10 +4101,12 @@ void SwRowFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
//RowFrames don't have borders and so on therefore the PrtArea always
//matches the Frame.
mbValidPrtArea = true;
- PrintWA().Left( 0 );
- PrintWA().Top( 0 );
- PrintWA().Width ( FrameRA().Width() );
- PrintWA().Height( FrameRA().Height() );
+ SwRect aPrt(PrintRA());
+ aPrt.Left( 0 );
+ aPrt.Top( 0 );
+ aPrt.Width ( FrameRA().Width() );
+ aPrt.Height( FrameRA().Height() );
+ setPrint(aPrt);
// #i29550#
// Here we calculate the top-printing area for the lower cell frames
@@ -4974,7 +4992,10 @@ void SwCellFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
}
setFrame(aFrm);
- aRectFnSet.AddRight( PrintWA(), nDiff );
+
+ SwRect aPrt(PrintRA());
+ aRectFnSet.AddRight( aPrt, nDiff );
+ setPrint(aPrt);
//Adjust the height, it's defined through the content and the border.
const long nDiffHeight = nRemaining - aRectFnSet.GetHeight(FrameRA());
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 0a1b3876901d..dac44bbe35da 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -1225,8 +1225,10 @@ SwTwips SwFrame::Grow( SwTwips nDist, bool bTst, bool bInfo )
if( !bTst )
{
nPrtHeight = aRectFnSet.GetHeight(PrintRA());
- aRectFnSet.SetHeight( PrintWA(), nPrtHeight +
- ( IsContentFrame() ? nDist : nReal ) );
+
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetHeight( aPrt, nPrtHeight + ( IsContentFrame() ? nDist : nReal ) );
+ setPrint(aPrt);
}
return nReal;
}
@@ -1266,8 +1268,9 @@ SwTwips SwFrame::Shrink( SwTwips nDist, bool bTst, bool bInfo )
if( !bTst )
{
const SwTwips nPrtHeight = aRectFnSet.GetHeight(PrintRA());
- aRectFnSet.SetHeight( PrintWA(), nPrtHeight -
- ( IsContentFrame() ? nDist : nReal ) );
+ SwRect aPrt(PrintRA());
+ aRectFnSet.SetHeight( aPrt, nPrtHeight - ( IsContentFrame() ? nDist : nReal ) );
+ setPrint(aPrt);
}
return nReal;
}
@@ -1404,7 +1407,11 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst )
pUp->setFrame(aFrm);
}
- pUp->PrintWA().SSize().Height() += nChg;
+ {
+ SwRect aPrt(pUp->PrintRA());
+ aPrt.SSize().Height() += nChg;
+ pUp->setPrint(aPrt);
+ }
if ( pViewShell )
pViewShell->Imp()->SetFirstVisPageInvalid();
@@ -1430,18 +1437,26 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst )
const long nOldFrameHeight = FrameRA().Height();
const long nOldPrtHeight = PrintRA().Height();
const bool bOldComplete = IsCompletePaint();
+
if ( IsBodyFrame() )
- PrintWA().SSize().Height() = nOldFrameHeight;
+ {
+ SwRect aPrt(PrintRA());
+ aPrt.SSize().Height() = nOldFrameHeight;
+ setPrint(aPrt);
+ }
if ( pUp->GetUpper() )
+ {
static_cast<SwRootFrame*>(pUp->GetUpper())->CheckViewLayout( nullptr, nullptr );
- //static_cast<SwPageFrame*>(pUp)->AdjustRootSize( CHG_CHGPAGE, &aOldRect );
+ }
SwRect aFrm(FrameRA());
aFrm.SSize().Height() = nOldFrameHeight;
setFrame(aFrm);
- PrintWA().SSize().Height() = nOldPrtHeight;
+ SwRect aPrt(PrintRA());
+ aPrt.SSize().Height() = nOldPrtHeight;
+ setPrint(aPrt);
mbCompletePaint = bOldComplete;
}