[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 6 commits - sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Jun 30 01:07:24 PDT 2015
sw/source/core/crsr/crsrsh.cxx | 2 -
sw/source/core/crsr/crstrvl.cxx | 6 +--
sw/source/core/crsr/swcrsr.cxx | 4 +-
sw/source/core/crsr/trvlcol.cxx | 2 -
sw/source/core/doc/notxtfrm.cxx | 2 -
sw/source/core/edit/autofmt.cxx | 3 +
sw/source/core/frmedt/fews.cxx | 4 +-
sw/source/core/frmedt/tblsel.cxx | 4 +-
sw/source/core/inc/flyfrm.hxx | 2 -
sw/source/core/inc/frame.hxx | 9 +----
sw/source/core/layout/anchoreddrawobject.cxx | 4 +-
sw/source/core/layout/calcmove.cxx | 30 +++++++++---------
sw/source/core/layout/flowfrm.cxx | 16 ++++-----
sw/source/core/layout/fly.cxx | 17 ++++++----
sw/source/core/layout/flyincnt.cxx | 6 +--
sw/source/core/layout/flylay.cxx | 4 +-
sw/source/core/layout/frmtool.cxx | 2 -
sw/source/core/layout/ftnfrm.cxx | 40 ++++++++++++------------
sw/source/core/layout/hffrm.cxx | 2 -
sw/source/core/layout/layact.cxx | 27 +++++++++-------
sw/source/core/layout/objectformatter.cxx | 3 +
sw/source/core/layout/objectformattertxtfrm.cxx | 11 +++---
sw/source/core/layout/pagechg.cxx | 13 ++++---
sw/source/core/layout/paintfrm.cxx | 10 +++---
sw/source/core/layout/sectfrm.cxx | 31 ++++++++++--------
sw/source/core/layout/tabfrm.cxx | 24 ++++++++------
sw/source/core/layout/trvlfrm.cxx | 34 +++++++++++++-------
sw/source/core/layout/wsfrm.cxx | 7 ++--
sw/source/core/text/frmform.cxx | 16 ++++++---
sw/source/core/text/txtfrm.cxx | 3 +
sw/source/core/text/txthyph.cxx | 3 +
sw/source/core/unocore/unotbl.cxx | 4 +-
sw/source/core/view/pagepreviewlayout.cxx | 6 ++-
sw/source/core/view/viewsh.cxx | 30 +++++++++++++++---
sw/source/core/view/vprint.cxx | 2 -
35 files changed, 221 insertions(+), 162 deletions(-)
New commits:
commit cc12ac738eeb3e6f1fa7c3dd20febb313dfa33f4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 29 18:35:12 2015 +0200
SwViewShell::ImplEndAction: avoid direct paint
Commit 56dd27d9ed829ea0444b3b5932dcd0d431d6e251 (sw: invalidate after
keypresses when we have a callback, 2015-01-13) only enabled
invalidate-then-paint for the tiled rendering case, because the main
loop had no priorities back then.
This limitation went away with 48c2815dd20cf20eeec8bb4e003000f4a3d13291
(tdf#91727 - Unwind non-dispatch of idle handlers., 2015-06-10), so it's
not a problem to always do this panting inside the Paint() call.
Change-Id: I98ddfcc0f20f1553974b74ec3c859dde315612e4
Reviewed-on: https://gerrit.libreoffice.org/16587
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
(cherry picked from commit beb4aa21d61f0d66392d596be86fb57b4b167239)
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index fa443ab..13439a8 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -410,10 +410,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
if ( bPaintsFromSystem )
PaintDesktop(*GetOut(), aRect);
- if (!isTiledRendering())
- pCurrentLayout->Paint( *mpOut, aRect );
- else
- pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
+ pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
// #i75172# end DrawingLayer paint
DLPostPaint2(true);
commit b265e4e9d63d4603ec6985fedf6941bdbcba4d74
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 29 17:05:50 2015 +0200
SwViewShell::Paint: restore old render context at the end
The idea is that mpOut is only used for non-drawing purposes outside
Paint(), e.g. to do logic <-> pixel conversion.
Change-Id: Ia83cd32dd0a5152dcfc1644e92af08b4ddf4653c
Reviewed-on: https://gerrit.libreoffice.org/16584
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
(cherry picked from commit 98d2d985082114ec259c11788af7b8574f2c9b3d)
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 89940c6..fa443ab 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1664,9 +1664,32 @@ bool SwViewShell::CheckInvalidForPaint( const SwRect &rRect )
return bRet;
}
+namespace
+{
+/// Similar to comphelper::FlagRestorationGuard, but for vcl::RenderContext.
+class RenderContextGuard
+{
+ VclPtr<vcl::RenderContext>& m_pRef;
+ vcl::RenderContext* m_pOriginalValue;
+
+public:
+ RenderContextGuard(VclPtr<vcl::RenderContext>& pRef, vcl::RenderContext* pValue)
+ : m_pRef(pRef),
+ m_pOriginalValue(m_pRef)
+ {
+ m_pRef = pValue;
+ }
+
+ ~RenderContextGuard()
+ {
+ m_pRef = m_pOriginalValue;
+ }
+};
+}
+
void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect)
{
- mpOut = &rRenderContext;
+ RenderContextGuard aGuard(mpOut, &rRenderContext);
if ( mnLockPaint )
{
if ( Imp()->bSmoothUpdate )
commit 4a25cccd6419844c38a7a6eebb5cd484a0b48097
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 29 15:36:40 2015 +0200
SwFrm::Calc: use vcl::RenderContext
(cherry picked from commit 8527dfbd4d3f79de8b02c561e5f0fef0d54d3eeb)
Conflicts:
sw/source/core/layout/sectfrm.cxx
sw/source/core/text/frmform.cxx
sw/source/core/text/txtfrm.cxx
Change-Id: I98de3f5413756c494c677d592ea921155e4c08be
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 447ad41..3a0c666 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1785,7 +1785,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, bool bIdleEnd )
if( !(eFlags & SwCrsrShell::UPDOWN )) // delete old Pos. of Up/Down
{
- pFrm->Calc();
+ pFrm->Calc(GetOut());
m_nUpDownX = pFrm->IsVertical() ?
m_aCharRect.Top() - pFrm->Frm().Top() :
m_aCharRect.Left() - pFrm->Frm().Left();
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 99c8a56..d4190e87 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -83,7 +83,7 @@ void SwCrsrShell::MoveCrsrToNum()
SwContentFrm * pFrm = m_pCurCrsr->GetContentNode()->getLayoutFrm( GetLayout(), &aPt,
m_pCurCrsr->GetPoint() );
pFrm->GetCharRect( m_aCharRect, *m_pCurCrsr->GetPoint() );
- pFrm->Calc();
+ pFrm->Calc(GetOut());
if( pFrm->IsVertical() )
{
aPt.setX(m_aCharRect.Center().getX());
@@ -138,7 +138,7 @@ bool SwCrsrShell::GotoHeaderText()
SwCallLink aLk( *this ); // watch Crsr-Moves
SwCursor *pTmpCrsr = getShellCrsr( true );
SwCrsrSaveState aSaveState( *pTmpCrsr );
- pFrm->Calc();
+ pFrm->Calc(GetOut());
Point aPt( pFrm->Frm().Pos() + pFrm->Prt().Pos() );
pFrm->GetCrsrOfst( pTmpCrsr->GetPoint(), aPt );
if( !pTmpCrsr->IsSelOvr() )
@@ -170,7 +170,7 @@ bool SwCrsrShell::GotoFooterText()
// get position in footer
SwCallLink aLk( *this ); // watch Crsr-Moves
SwCrsrSaveState aSaveState( *pTmpCrsr );
- pLower->Calc();
+ pLower->Calc(GetOut());
Point aPt( pLower->Frm().Pos() + pLower->Prt().Pos() );
pLower->GetCrsrOfst( pTmpCrsr->GetPoint(), aPt );
if( !pTmpCrsr->IsSelOvr() )
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 9baa901..6140342 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1857,13 +1857,13 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt,
if ( pFrm->IsVertical() )
{
aPt.setX(aTmpRect.Center().getX());
- pFrm->Calc();
+ pFrm->Calc(pFrm->getRootFrm()->GetCurrShell()->GetOut());
aPt.setY(pFrm->Frm().Top() + nUpDownX);
}
else
{
aPt.setY(aTmpRect.Center().getY());
- pFrm->Calc();
+ pFrm->Calc(pFrm->getRootFrm()->GetCurrShell()->GetOut());
aPt.setX(pFrm->Frm().Left() + nUpDownX);
}
pFrm->GetCrsrOfst( GetPoint(), aPt, &eTmpState );
diff --git a/sw/source/core/crsr/trvlcol.cxx b/sw/source/core/crsr/trvlcol.cxx
index e5b5c86..8d8a12d 100644
--- a/sw/source/core/crsr/trvlcol.cxx
+++ b/sw/source/core/crsr/trvlcol.cxx
@@ -85,7 +85,7 @@ bool SwCrsrShell::MoveColumn( SwWhichColumn fnWhichCol, SwPosColumn fnPosCol )
SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
SwCrsrSaveState aSaveState( *m_pCurCrsr );
- pCnt->Calc();
+ pCnt->Calc(GetOut());
Point aPt( pCnt->Frm().Pos() + pCnt->Prt().Pos() );
if( fnPosCol == GetColumnEnd )
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 9b0e1c4..02a815b 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -506,7 +506,7 @@ bool SwNoTextFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos,
if ( &rPos.nNode.GetNode() != (SwNode*)GetNode() )
return false;
- Calc();
+ Calc(getRootFrm()->GetCurrShell()->GetOut());
SwRect aFrameRect( Frm() );
rRect = aFrameRect;
rRect.Pos( Frm().Pos() + Prt().Pos() );
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index af48083..c01199f 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -51,6 +51,7 @@
#include <swundo.hxx>
#include <poolfmt.hxx>
#include <ndtxt.hxx>
+#include <rootfrm.hxx>
#include <txtfrm.hxx>
#include <frminf.hxx>
#include <pagedesc.hxx>
@@ -246,7 +247,7 @@ SwTextFrm* SwAutoFormat::GetFrm( const SwTextNode& rTextNd ) const
{
SwRect aTmpFrm( pFrm->Frm() );
SwRect aTmpPrt( pFrm->Prt() );
- pFrm->Calc();
+ pFrm->Calc(pFrm->getRootFrm()->GetCurrShell()->GetOut());
if( pFrm->Frm() != aTmpFrm || pFrm->Prt() != aTmpPrt ||
( pFrm->IsTextFrm() && !const_cast<SwTextFrm*>(static_cast<const SwTextFrm*>(pFrm))->Paint().IsEmpty() ) )
pFrm->SetCompletePaint();
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 1a9dfd7..db791c8 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -113,9 +113,9 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
case RECT_PAGE : pFrm = pFrm->FindPageFrm();
break;
- case RECT_PAGE_CALC: pFrm->Calc();
+ case RECT_PAGE_CALC: pFrm->Calc(Imp()->GetShell()->GetOut());
pFrm = pFrm->FindPageFrm();
- pFrm->Calc();
+ pFrm->Calc(Imp()->GetShell()->GetOut());
break;
case RECT_FLY_PRT_EMBEDDED: bFrm = false; /* no break */
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 17f9877..dd997c3 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -392,7 +392,7 @@ void GetTableSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
if( pTable->IsValid() )
pTable->InvalidatePos();
pTable->SetONECalcLowers();
- pTable->Calc();
+ pTable->Calc(pTable->getRootFrm()->GetCurrShell()->GetOut());
pTable->SetCompletePaint();
if( 0 == (pTable = pTable->GetFollow()) )
break;
@@ -634,7 +634,7 @@ bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd )
if( pTable->IsValid() )
pTable->InvalidatePos();
pTable->SetONECalcLowers();
- pTable->Calc();
+ pTable->Calc(pTable->getRootFrm()->GetCurrShell()->GetOut());
pTable->SetCompletePaint();
if( 0 == (pTable = pTable->GetFollow()) )
break;
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index be422b4..5f4dc2f 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -278,7 +278,7 @@ public:
virtual void dumpAsXml( xmlTextWriterPtr writer ) const SAL_OVERRIDE { SwLayoutFrm::dumpAsXml( writer ); };
- virtual void Calc() const SAL_OVERRIDE;
+ virtual void Calc(vcl::RenderContext* pRenderContext) const SAL_OVERRIDE;
const Point& ContentPos() const { return m_aContentPos; }
Point& ContentPos() { return m_aContentPos; }
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 834b042..7a17a69 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -652,7 +652,7 @@ public:
inline SwLayoutFrm *GetPrevLayoutLeaf();
inline SwLayoutFrm *GetNextLayoutLeaf();
- virtual void Calc() const; // here might be "formatted"
+ virtual void Calc(vcl::RenderContext* pRenderContext) const; // here might be "formatted"
inline void OptCalc() const; // here we assume (for optimization) that
// the predecessors are already formatted
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 5a70d5b..7051a2a 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -396,7 +396,7 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
if ( bFormatAnchor )
{
// --> #i50356#
- GetAnchorFrmContainingAnchPos()->Calc();
+ GetAnchorFrmContainingAnchPos()->Calc(GetAnchorFrmContainingAnchPos()->getRootFrm()->GetCurrShell()->GetOut());
}
bool bOscillationDetected = false;
@@ -435,7 +435,7 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
if ( bFormatAnchor )
{
// --> #i50356#
- GetAnchorFrmContainingAnchPos()->Calc();
+ GetAnchorFrmContainingAnchPos()->Calc(GetAnchorFrmContainingAnchPos()->getRootFrm()->GetCurrShell()->GetOut());
}
// --> #i3317#
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index be8fbc9..6b4d8cb 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -244,7 +244,7 @@ void SwFrm::PrepareMake(vcl::RenderContext* pRenderContext)
if ( GetUpper() )
{
if ( lcl_IsCalcUpperAllowed( *this ) )
- GetUpper()->Calc();
+ GetUpper()->Calc(pRenderContext);
OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." );
if ( !GetUpper() )
return;
@@ -329,7 +329,7 @@ void SwFrm::PrepareMake(vcl::RenderContext* pRenderContext)
return;
if ( lcl_IsCalcUpperAllowed( *this ) )
- GetUpper()->Calc();
+ GetUpper()->Calc(pRenderContext);
OSL_ENSURE( GetUpper(), "Layout unstable (Upper gone III)." );
}
@@ -347,7 +347,7 @@ void SwFrm::OptPrepareMake()
!GetUpper()->IsFlyFrm() )
{
ForbidDelete();
- GetUpper()->Calc();
+ GetUpper()->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0);
AllowDelete();
OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." );
if ( !GetUpper() )
@@ -368,7 +368,7 @@ void SwFrm::PrepareCrsr()
if( GetUpper() && !GetUpper()->IsSctFrm() )
{
GetUpper()->PrepareCrsr();
- GetUpper()->Calc();
+ GetUpper()->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0);
OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." );
if ( !GetUpper() )
@@ -429,14 +429,14 @@ void SwFrm::PrepareCrsr()
if ( !GetUpper() )
return;
- GetUpper()->Calc();
+ GetUpper()->Calc(getRootFrm()->GetCurrShell()->GetOut());
OSL_ENSURE( GetUpper(), "Layout unstable (Upper gone III)." );
if ( bTab && !bOldTabLock )
::PrepareUnlock( static_cast<SwTabFrm*>(this) );
}
- Calc();
+ Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0);
}
// Here we return GetPrev(); however we will ignore empty SectionFrms
@@ -480,7 +480,7 @@ void SwFrm::MakePos()
!pPrv->GetAttrSet()->GetKeep().GetValue()
)
{
- pPrv->Calc(); // This may cause Prev to vanish!
+ pPrv->Calc(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0); // This may cause Prev to vanish!
}
else if ( pPrv->Frm().Top() == 0 )
{
@@ -542,7 +542,7 @@ void SwFrm::MakePos()
GetUpper()->IsColLocked() )
)
{
- GetUpper()->Calc();
+ GetUpper()->Calc(getRootFrm()->GetCurrShell()->GetOut());
}
pPrv = lcl_Prev( this, false );
if ( !bUseUpper && pPrv )
@@ -1405,7 +1405,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/)
}
if ( pNxt )
{
- pNxt->Calc();
+ pNxt->Calc(getRootFrm()->GetCurrShell()->GetOut());
if( mbValidPos && !GetIndNext() )
{
SwSectionFrm *pSct = FindSctFrm();
@@ -1498,7 +1498,7 @@ void SwContentFrm::MakeAll(vcl::RenderContext* /*pRenderContext*/)
( 0 == (pNxt->Prt().*fnRect->fnGetHeight)() ) &&
(!pNxt->IsTextFrm() ||!static_cast<SwTextFrm*>(pNxt)->IsHiddenNow());
- pNxt->Calc();
+ pNxt->Calc(getRootFrm()->GetCurrShell()->GetOut());
if ( !bMovedBwd &&
((bMoveFwdInvalid && !GetIndNext()) ||
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 41cac22..2a4c1f4 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -404,7 +404,7 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart )
bool bUnlock = !static_cast<SwFootnoteFrm*>(pLay)->IsBackMoveLocked();
static_cast<SwFootnoteFrm*>(pLay)->LockBackMove();
pLay->InvalidateSize();
- pLay->Calc();
+ pLay->Calc(pLay->getRootFrm()->GetCurrShell()->GetOut());
SwContentFrm *pCnt = pLay->ContainsContent();
while ( pCnt && pLay->IsAnLower( pCnt ) )
{
@@ -415,7 +415,7 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart )
if ( static_cast<SwTextFrm*>(pCnt)->IsLocked() ||
static_cast<SwTextFrm*>(pCnt)->GetFollow() == pStart )
break;
- pCnt->Calc();
+ pCnt->Calc(pCnt->getRootFrm()->GetCurrShell()->GetOut());
pCnt = pCnt->GetNextContentFrm();
}
if( bUnlock )
@@ -602,13 +602,13 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
// If we're in a column section, we'd rather not call Calc "from below"
if( !m_rThis.IsInSct() &&
( !m_rThis.IsInTab() || ( m_rThis.IsTabFrm() && !m_rThis.GetUpper()->IsInTab() ) ) )
- m_rThis.GetUpper()->Calc();
+ m_rThis.GetUpper()->Calc(m_rThis.getRootFrm()->GetCurrShell()->GetOut());
else if( m_rThis.GetUpper()->IsSctFrm() )
{
SwSectionFrm* pTmpSct = static_cast<SwSectionFrm*>(m_rThis.GetUpper());
bool bOld = pTmpSct->IsContentLocked();
pTmpSct->SetContentLock( true );
- pTmpSct->Calc();
+ pTmpSct->Calc(m_rThis.getRootFrm()->GetCurrShell()->GetOut());
if( !bOld )
pTmpSct->SetContentLock( false );
}
@@ -1858,14 +1858,14 @@ bool SwFlowFrm::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways )
{
bool bUnlock = !pSect->IsColLocked();
pSect->ColLock();
- pNewUpper->Calc();
+ pNewUpper->Calc(m_rThis.getRootFrm()->GetCurrShell()->GetOut());
if( bUnlock )
pSect->ColUnlock();
}
}
// Do not calculate split cell frames.
else if ( !pNewUpper->IsCellFrm() || static_cast<SwLayoutFrm*>(pNewUpper)->Lower() )
- pNewUpper->Calc();
+ pNewUpper->Calc(m_rThis.getRootFrm()->GetCurrShell()->GetOut());
SwFootnoteBossFrm *pNewBoss = pNewUpper->FindFootnoteBossFrm();
bool bBossChg = pNewBoss != pOldBoss;
@@ -2456,7 +2456,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat )
pSect->ColLock();
bFollow = pSect->HasFollow();
}
- pNewUpper->Calc();
+ pNewUpper->Calc(m_rThis.getRootFrm()->GetCurrShell()->GetOut());
m_rThis.Cut();
// optimization: format section, if its size is invalidated and if it's
@@ -2477,7 +2477,7 @@ bool SwFlowFrm::MoveBwd( bool &rbReformat )
m_rThis.Paste( pNewUpper );
// - optimization
if ( bFormatSect )
- pSect->Calc();
+ pSect->Calc(m_rThis.getRootFrm()->GetCurrShell()->GetOut());
SwPageFrm *pNewPage = m_rThis.FindPageFrm();
if( pNewPage != pOldPage )
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index c41d475..e767ef9 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1379,6 +1379,7 @@ void CalcContent( SwLayoutFrm *pLay,
bool bNoColl,
bool bNoCalcFollow )
{
+ vcl::RenderContext* pRenderContext = pLay->getRootFrm()->GetCurrShell()->GetOut();
SwSectionFrm* pSect;
bool bCollect = false;
if( pLay->IsSctFrm() )
@@ -1462,7 +1463,7 @@ void CalcContent( SwLayoutFrm *pLay,
if ( bNoCalcFollow && pFrm->IsTextFrm() )
static_cast<SwTextFrm*>(pFrm)->ForbidFollowFormat();
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
// OD 14.03.2003 #i11760# - reset control flag for follow format.
if ( pFrm->IsTextFrm() )
@@ -1589,7 +1590,7 @@ void CalcContent( SwLayoutFrm *pLay,
// are formatted, if the wrapping style influence has to be considered.
if ( pLay->GetFormat()->getIDocumentSettingAccess()->get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) )
{
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
}
if ( bAgain )
@@ -1688,10 +1689,11 @@ void SwFlyFrm::MakeObjPos()
{
if ( !mbValidPos )
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
mbValidPos = true;
// OD 29.10.2003 #113049# - use new class to position object
- GetAnchorFrm()->Calc();
+ GetAnchorFrm()->Calc(pRenderContext);
objectpositioning::SwToLayoutAnchoredObjectPosition
aObjPositioning( *GetVirtDrawObj() );
aObjPositioning.CalcPosition();
@@ -2457,6 +2459,7 @@ SwTwips SwFlyFrm::CalcAutoWidth() const
bool SwFlyFrm::GetContour( tools::PolyPolygon& rContour,
const bool _bForPaint ) const
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
bool bRet = false;
if( GetFormat()->GetSurround().IsContour() && Lower() &&
Lower()->IsNoTextFrm() )
@@ -2496,7 +2499,7 @@ bool SwFlyFrm::GetContour( tools::PolyPolygon& rContour,
// We need to include the scaling here
SwRect aClip;
SwRect aOrig;
- Lower()->Calc();
+ Lower()->Calc(pRenderContext);
static_cast<const SwNoTextFrm*>(Lower())->GetGrfArea( aClip, &aOrig, false );
// OD 16.04.2003 #i13147# - copy method code <SvxContourDlg::ScaleContour(..)>
// in order to avoid that graphic has to be loaded for contour scale.
@@ -2654,12 +2657,12 @@ SwFlyFrameFormat * SwFlyFrm::GetFormat()
return static_cast< SwFlyFrameFormat * >( GetDep() );
}
-void SwFlyFrm::Calc() const
+void SwFlyFrm::Calc(vcl::RenderContext* pRenderContext) const
{
if ( !m_bValidContentPos )
- const_cast<SwFlyFrm*>(this)->PrepareMake(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0);
+ const_cast<SwFlyFrm*>(this)->PrepareMake(pRenderContext);
else
- SwLayoutFrm::Calc();
+ SwLayoutFrm::Calc(pRenderContext);
}
SwTwips SwFlyFrm::CalcContentHeight(const SwBorderAttrs *pAttrs, const SwTwips nMinHeight, const SwTwips nUL)
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 3004cc1..4d813eb 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -82,7 +82,7 @@ void SwFlyInCntFrm::SetRefPoint( const Point& rPoint,
InvalidatePage();
mbValidPos = false;
bInvalid = true;
- Calc();
+ Calc(getRootFrm()->GetCurrShell()->GetOut());
delete pNotify;
}
}
@@ -136,7 +136,7 @@ void SwFlyInCntFrm::Format( vcl::RenderContext* pRenderContext, const SwBorderAt
Lock(); //don't format the anchor on the crook.
SwContentFrm *pContent = ContainsContent();
while ( pContent )
- { pContent->Calc();
+ { pContent->Calc(pRenderContext);
pContent = pContent->GetNextContentFrm();
}
Unlock();
@@ -193,7 +193,7 @@ void SwFlyInCntFrm::NotifyBackground( SwPageFrm *, const SwRect& rRect,
const Point SwFlyInCntFrm::GetRelPos() const
{
- Calc();
+ Calc(getRootFrm()->GetCurrShell()->GetOut());
return GetCurrRelPos();
}
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 6ba20dd..e493d13 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -430,9 +430,9 @@ void SwFlyFreeFrm::CheckClip( const SwFormatFrmSize &rSz )
SwFrm *pLow = Lower();
do
{
- pLow->Calc();
+ pLow->Calc(getRootFrm()->GetCurrShell()->GetOut());
// also calculate the (Column)BodyFrm
- static_cast<SwLayoutFrm*>(pLow)->Lower()->Calc();
+ static_cast<SwLayoutFrm*>(pLow)->Lower()->Calc(getRootFrm()->GetCurrShell()->GetOut());
pLow = pLow->GetNext();
} while ( pLow );
::CalcContent( this );
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 3855f33..6cbc38c 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -3317,7 +3317,7 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt1
{
SwObjectFormatter::FormatObj( *pFlyFrm );
}
- pTmpFrm->Calc();
+ pTmpFrm->Calc(pLayout->GetCurrShell()->GetOut());
}
// #127369#
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index daa8226..81eacff 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -1574,7 +1574,7 @@ void SwFootnoteBossFrm::AppendFootnote( SwContentFrm *pRef, SwTextFootnote *pAtt
SwContentFrm *pCnt = pNew->ContainsContent();
while ( pCnt && pCnt->FindFootnoteFrm()->GetAttr() == pAttr )
{
- pCnt->Calc();
+ pCnt->Calc(getRootFrm()->GetCurrShell()->GetOut());
// #i49383# - format anchored objects
if ( pCnt->IsTextFrm() && pCnt->IsValid() )
{
@@ -1596,7 +1596,7 @@ void SwFootnoteBossFrm::AppendFootnote( SwContentFrm *pRef, SwTextFootnote *pAtt
// #i57914# - adjust fix #i49383#
// enable lock of lower object position before format of footnote frame.
pNew->UnlockPosOfLowerObjs();
- pNew->Calc();
+ pNew->Calc(getRootFrm()->GetCurrShell()->GetOut());
// #i57914# - adjust fix #i49383#
if ( !bOldFootnoteFrmLocked && !pNew->GetLower() &&
!pNew->IsColLocked() && !pNew->IsBackMoveLocked() )
@@ -1944,8 +1944,8 @@ void SwFootnoteBossFrm::_MoveFootnotes( SwFootnoteFrms &rFootnoteArr, bool bCalc
}
(pFootnote->Frm().*fnRect->fnSetHeight)(0);
(pFootnote->Prt().*fnRect->fnSetHeight)(0);
- pFootnote->Calc();
- pFootnote->GetUpper()->Calc();
+ pFootnote->Calc(getRootFrm()->GetCurrShell()->GetOut());
+ pFootnote->GetUpper()->Calc(getRootFrm()->GetCurrShell()->GetOut());
if( bCalc )
{
@@ -1962,7 +1962,7 @@ void SwFootnoteBossFrm::_MoveFootnotes( SwFootnoteFrms &rFootnoteArr, bool bCalc
while ( pCnt && pCnt->FindFootnoteFrm()->GetAttr() == pAttr )
{
pCnt->_InvalidatePos();
- pCnt->Calc();
+ pCnt->Calc(getRootFrm()->GetCurrShell()->GetOut());
// #i49383# - format anchored objects
if ( pCnt->IsTextFrm() && pCnt->IsValid() )
{
@@ -2003,7 +2003,7 @@ void SwFootnoteBossFrm::_MoveFootnotes( SwFootnoteFrms &rFootnoteArr, bool bCalc
// #i57914# - adjust fix #i49383#
// enable lock of lower object position before format of footnote frame.
pFootnote->UnlockPosOfLowerObjs();
- pFootnote->Calc();
+ pFootnote->Calc(getRootFrm()->GetCurrShell()->GetOut());
}
}
}
@@ -2042,7 +2042,7 @@ void SwFootnoteBossFrm::_MoveFootnotes( SwFootnoteFrms &rFootnoteArr, bool bCalc
while ( pCnt && pCnt->FindFootnoteFrm()->GetAttr() == pAttr )
{
pCnt->_InvalidatePos();
- pCnt->Calc();
+ pCnt->Calc(getRootFrm()->GetCurrShell()->GetOut());
// #i49383# - format anchored objects
if ( pCnt->IsTextFrm() && pCnt->IsValid() )
{
@@ -2074,7 +2074,7 @@ void SwFootnoteBossFrm::_MoveFootnotes( SwFootnoteFrms &rFootnoteArr, bool bCalc
// #i57914# - adjust fix #i49383#
// enable lock of lower object position before format of footnote frame.
pNextFootnote->UnlockPosOfLowerObjs();
- pNextFootnote->Calc();
+ pNextFootnote->Calc(getRootFrm()->GetCurrShell()->GetOut());
}
}
}
@@ -2132,8 +2132,8 @@ void SwFootnoteBossFrm::RearrangeFootnotes( const SwTwips nDeadLine, const bool
{
bool bUnlock = !pFirst->IsBackMoveLocked();
pFirst->LockBackMove();
- pFirst->Calc();
- pContent->Calc();
+ pFirst->Calc(getRootFrm()->GetCurrShell()->GetOut());
+ pContent->Calc(getRootFrm()->GetCurrShell()->GetOut());
// #i49383# - format anchored objects
if ( pContent->IsTextFrm() && pContent->IsValid() )
{
@@ -2180,7 +2180,7 @@ void SwFootnoteBossFrm::RearrangeFootnotes( const SwTwips nDeadLine, const bool
// #i57914# - adjust fix #i49383#
// enable lock of lower object position before format of footnote frame.
pLastFootnoteFrm->UnlockPosOfLowerObjs();
- pLastFootnoteFrm->Calc();
+ pLastFootnoteFrm->Calc(getRootFrm()->GetCurrShell()->GetOut());
if ( !bLock && bUnlockLastFootnoteFrm &&
!pLastFootnoteFrm->GetLower() &&
!pLastFootnoteFrm->IsColLocked() &&
@@ -2215,8 +2215,8 @@ void SwFootnoteBossFrm::RearrangeFootnotes( const SwTwips nDeadLine, const bool
{
bool bUnlock = !pFootnoteFrm->IsBackMoveLocked();
pFootnoteFrm->LockBackMove();
- pFootnoteFrm->Calc();
- pCnt->Calc();
+ pFootnoteFrm->Calc(getRootFrm()->GetCurrShell()->GetOut());
+ pCnt->Calc(getRootFrm()->GetCurrShell()->GetOut());
// #i49383# - format anchored objects
if ( pCnt->IsTextFrm() && pCnt->IsValid() )
{
@@ -2245,8 +2245,8 @@ void SwFootnoteBossFrm::RearrangeFootnotes( const SwTwips nDeadLine, const bool
}
else
{
- pFootnoteFrm->Calc();
- pCnt->Calc();
+ pFootnoteFrm->Calc(getRootFrm()->GetCurrShell()->GetOut());
+ pCnt->Calc(getRootFrm()->GetCurrShell()->GetOut());
// #i49383# - format anchored objects
if ( pCnt->IsTextFrm() && pCnt->IsValid() )
{
@@ -2315,7 +2315,7 @@ void SwFootnoteBossFrm::RearrangeFootnotes( const SwTwips nDeadLine, const bool
// #i57914# - adjust fix #i49383#
// enable lock of lower object position before format of footnote frame.
pLastFootnoteFrm->UnlockPosOfLowerObjs();
- pLastFootnoteFrm->Calc();
+ pLastFootnoteFrm->Calc(getRootFrm()->GetCurrShell()->GetOut());
if ( !bLock && bUnlockLastFootnoteFrm &&
!pLastFootnoteFrm->GetLower() &&
!pLastFootnoteFrm->IsColLocked() &&
@@ -2389,14 +2389,14 @@ void SwPageFrm::UpdateFootnoteNum()
void SwFootnoteBossFrm::SetFootnoteDeadLine( const SwTwips nDeadLine )
{
SwFrm *pBody = FindBodyCont();
- pBody->Calc();
+ pBody->Calc(getRootFrm()->GetCurrShell()->GetOut());
SwFrm *pCont = FindFootnoteCont();
const SwTwips nMax = nMaxFootnoteHeight;// current should exceed MaxHeight
SWRECTFN( this )
if ( pCont )
{
- pCont->Calc();
+ pCont->Calc(getRootFrm()->GetCurrShell()->GetOut());
nMaxFootnoteHeight = -(pCont->Frm().*fnRect->fnBottomDist)( nDeadLine );
}
else
@@ -2680,7 +2680,7 @@ bool SwContentFrm::MoveFootnoteCntFwd( bool bMakePage, SwFootnoteBossFrm *pOldBo
if ( !( bSameBoss = (pNewBoss == pOldBoss) ) )
{
bSamePage = pOldBoss->FindPageFrm() == pNewBoss->FindPageFrm(); // page change?
- pNewUpper->Calc();
+ pNewUpper->Calc(getRootFrm()->GetCurrShell()->GetOut());
}
// The layout leaf of the footnote is either a footnote container or a footnote.
@@ -2712,7 +2712,7 @@ bool SwContentFrm::MoveFootnoteCntFwd( bool bMakePage, SwFootnoteBossFrm *pOldBo
while(pNx && !static_cast<SwFootnoteFrm*>(pNx)->GetAttr()->GetFootnote().IsEndNote())
pNx = pNx->GetNext();
pTmpFootnote->Paste( pCont, pNx );
- pTmpFootnote->Calc();
+ pTmpFootnote->Calc(getRootFrm()->GetCurrShell()->GetOut());
}
OSL_ENSURE( pTmpFootnote->GetAttr() == FindFootnoteFrm()->GetAttr(), "Wrong Footnote!" );
// areas inside of footnotes get a special treatment
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index a54fbbd..e12df3e 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -248,7 +248,7 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
}
while( pFrm )
{
- pFrm->Calc();
+ pFrm->Calc(getRootFrm()->GetCurrShell()->GetOut());
// #i43771# - format also object anchored
// at the frame
// #i46941# - frame has to be valid.
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 6a5f781..307a038 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -446,7 +446,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
{
OSL_ENSURE( pRoot->Lower()->IsPageFrm(), ":-( No page below the root.");
- pRoot->Calc();
+ pRoot->Calc(pRenderContext);
// Figure out the first invalid page or the first one to be formatted,
// respectively. A complete-action means the first invalid page.
@@ -812,7 +812,7 @@ bool SwLayAction::_TurboAction( const SwContentFrm *pCnt )
{
const SwRect aOldRect( pCnt->UnionFrm( true ) );
const long nOldBottom = pCnt->Frm().Top() + pCnt->Prt().Bottom();
- pCnt->Calc();
+ pCnt->Calc(pImp->GetShell()->GetOut());
if ( pCnt->Frm().Bottom() < aOldRect.Bottom() )
pCnt->SetRetouche();
@@ -1002,6 +1002,7 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage,
*/
bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
{
+ vcl::RenderContext* pRenderContext = pImp->GetShell()->GetOut();
bool bRet = false;
const SwViewShell *pSh = pRoot->GetCurrShell();
const bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
@@ -1017,11 +1018,11 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
// format its first lower.
// NOTE: In online layout (bBrowse == true) a page can contain
// a header frame and/or a footer frame beside the body frame.
- prPage->Calc();
+ prPage->Calc(pRenderContext);
SwFrm* pPageLowerFrm = prPage->Lower();
while ( pPageLowerFrm )
{
- pPageLowerFrm->Calc();
+ pPageLowerFrm->Calc(pRenderContext);
pPageLowerFrm = pPageLowerFrm->GetNext();
}
}
@@ -1097,7 +1098,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
const SwSectionFrm *pSct = ((SwFrm*)pContent)->ImplFindSctFrm();
if ( !pSct->IsValid() )
{
- pSct->Calc();
+ pSct->Calc(pRenderContext);
pSct->SetCompletePaint();
if ( IsAgain() )
return false;
@@ -1109,7 +1110,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
if ( !bPageChg && !pContent->IsValid() )
{
- pContent->Calc();
+ pContent->Calc(pRenderContext);
pContent->SetCompletePaint();
if ( IsAgain() )
return false;
@@ -1123,7 +1124,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
const SwTabFrm *pTab = ((SwFrm*)pContent)->ImplFindTabFrm();
if ( !pTab->IsValid() )
{
- pTab->Calc();
+ pTab->Calc(pRenderContext);
pTab->SetCompletePaint();
if ( IsAgain() )
return false;
@@ -1138,7 +1139,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
const SwSectionFrm *pSct = ((SwFrm*)pContent)->ImplFindSctFrm();
if ( !pSct->IsValid() )
{
- pSct->Calc();
+ pSct->Calc(pRenderContext);
pSct->SetCompletePaint();
if ( IsAgain() )
return false;
@@ -1239,7 +1240,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrm *pLay,
aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pRenderContext);
}
- pLay->Calc();
+ pLay->Calc(pRenderContext);
if ( aOldFrame != pLay->Frm() )
bChanged = true;
@@ -1427,6 +1428,7 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrm *pLay,
bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
{
+ vcl::RenderContext* pRenderContext = pImp->GetShell()->GetOut();
OSL_ENSURE( !IsAgain(), "Attention to the invalid page." );
if ( IsAgain() )
return false;
@@ -1438,7 +1440,7 @@ bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
{
// The Frame has changed, now it's getting formatted.
const SwRect aOldRect( pFly->Frm() );
- pFly->Calc();
+ pFly->Calc(pRenderContext);
bChanged = aOldRect != pFly->Frm();
if ( IsPaint() && (pFly->IsCompletePaint() || bChanged) &&
@@ -1482,6 +1484,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, bool bAddRect )
if ( IsAgain() || !pTab->Lower() )
return false;
+ vcl::RenderContext* pRenderContext = pImp->GetShell()->GetOut();
IDocumentTimerAccess *pTimerAccess = pRoot->GetFormat()->getIDocumentTimerAccess();
pTimerAccess->BlockIdling();
@@ -1504,7 +1507,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, bool bAddRect )
const SwRect aOldRect( pTab->Frm() );
pTab->SetLowersFormatted( false );
- pTab->Calc();
+ pTab->Calc(pRenderContext);
if ( aOldRect != pTab->Frm() )
{
bChanged = true;
diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx
index 24afe55..b49f9a7 100644
--- a/sw/source/core/layout/objectformatter.cxx
+++ b/sw/source/core/layout/objectformatter.cxx
@@ -21,6 +21,7 @@
#include <objectformatterlayfrm.hxx>
#include <anchoreddrawobject.hxx>
#include <sortedobjs.hxx>
+#include <rootfrm.hxx>
#include <pagefrm.hxx>
#include <flyfrms.hxx>
#include <txtfrm.hxx>
@@ -239,7 +240,7 @@ bool SwObjectFormatter::FormatObj( SwAnchoredObject& _rAnchoredObj,
*/
void SwObjectFormatter::_FormatLayout( SwLayoutFrm& _rLayoutFrm )
{
- _rLayoutFrm.Calc();
+ _rLayoutFrm.Calc(_rLayoutFrm.getRootFrm()->GetCurrShell()->GetOut());
SwFrm* pLowerFrm = _rLayoutFrm.Lower();
while ( pLowerFrm )
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx
index dc6eee0..7e384a6 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -19,6 +19,7 @@
#include <objectformattertxtfrm.hxx>
#include <sortedobjs.hxx>
+#include <rootfrm.hxx>
#include <flyfrms.hxx>
#include <txtfrm.hxx>
#include <pagefrm.hxx>
@@ -652,7 +653,7 @@ static void lcl_FormatContentOfLayoutFrm( SwLayoutFrm* pLayFrm,
lcl_FormatContentOfLayoutFrm( static_cast<SwLayoutFrm*>(pLowerFrm),
pLastLowerFrm );
else
- pLowerFrm->Calc();
+ pLowerFrm->Calc(pLowerFrm->getRootFrm()->GetCurrShell()->GetOut());
pLowerFrm = pLowerFrm->GetNext();
}
@@ -699,7 +700,7 @@ void SwObjectFormatterTextFrm::FormatAnchorFrmAndItsPrevs( SwTextFrm& _rAnchorTe
if ( pFrm->IsLayoutFrm() )
lcl_FormatContentOfLayoutFrm( static_cast<SwLayoutFrm*>(pFrm) );
else
- pFrm->Calc();
+ pFrm->Calc(pFrm->getRootFrm()->GetCurrShell()->GetOut());
pFrm = pFrm->GetNext();
}
@@ -727,7 +728,7 @@ void SwObjectFormatterTextFrm::FormatAnchorFrmAndItsPrevs( SwTextFrm& _rAnchorTe
if ( pFrm->IsLayoutFrm() )
lcl_FormatContentOfLayoutFrm( static_cast<SwLayoutFrm*>(pFrm) );
else
- pFrm->Calc();
+ pFrm->Calc(pFrm->getRootFrm()->GetCurrShell()->GetOut());
pFrm = pFrm->GetNext();
}
@@ -745,11 +746,11 @@ void SwObjectFormatterTextFrm::FormatAnchorFrmAndItsPrevs( SwTextFrm& _rAnchorTe
if ( _rAnchorTextFrm.IsInTab() )
{
SwForbidFollowFormat aForbidFollowFormat( _rAnchorTextFrm );
- _rAnchorTextFrm.Calc();
+ _rAnchorTextFrm.Calc(_rAnchorTextFrm.getRootFrm()->GetCurrShell()->GetOut());
}
else
{
- _rAnchorTextFrm.Calc();
+ _rAnchorTextFrm.Calc(_rAnchorTextFrm.getRootFrm()->GetCurrShell()->GetOut());
}
}
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 9fe2e66..6e426b4 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -177,6 +177,7 @@ SwPageFrm::SwPageFrm( SwFrameFormat *pFormat, SwFrm* pSib, SwPageDesc *pPgDsc )
SwViewShell *pSh = getRootFrm()->GetCurrShell();
const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
+ vcl::RenderContext* pRenderContext = pSh ? pSh->GetOut() : 0;
if ( bBrowseMode )
{
Frm().Height( 0 );
@@ -193,11 +194,11 @@ SwPageFrm::SwPageFrm( SwFrameFormat *pFormat, SwFrm* pSib, SwPageDesc *pPgDsc )
if ( !(bEmptyPage = (pFormat == pDoc->GetEmptyPageFormat())) )
{
bEmptyPage = false;
- Calc(); // so that the PrtArea is correct
+ Calc(pRenderContext); // so that the PrtArea is correct
SwBodyFrm *pBodyFrm = new SwBodyFrm( pDoc->GetDfltFrameFormat(), this );
pBodyFrm->ChgSize( Prt().SSize() );
pBodyFrm->Paste( this );
- pBodyFrm->Calc(); // so that the columns can be inserted correctly
+ pBodyFrm->Calc(pRenderContext); // so that the columns can be inserted correctly
pBodyFrm->InvalidatePos();
if ( bBrowseMode )
@@ -341,6 +342,7 @@ void SwPageFrm::CheckDirection( bool bVert )
/// create specific Flys for this page and format generic content
static void lcl_FormatLay( SwLayoutFrm *pLay )
{
+ vcl::RenderContext* pRenderContext = pLay->getRootFrm()->GetCurrShell()->GetOut();
// format all LayoutFrms - no tables, Flys etc.
SwFrm *pTmp = pLay->Lower();
@@ -351,7 +353,7 @@ static void lcl_FormatLay( SwLayoutFrm *pLay )
::lcl_FormatLay( static_cast<SwLayoutFrm*>(pTmp) );
pTmp = pTmp->GetNext();
}
- pLay->Calc();
+ pLay->Calc(pRenderContext);
}
/// Create Flys or register draw objects
@@ -1861,6 +1863,7 @@ static void lcl_MoveAllLowers( SwFrm* pFrm, const Point& rOffset )
// Calculate how the pages have to be positioned
void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVisArea )
{
+ vcl::RenderContext* pRenderContext = GetCurrShell() ? GetCurrShell()->GetOut() : 0;
// #i91432#
// No calculation of page positions, if only an empty page is present.
// This situation occurs when <SwRootFrm> instance is in construction
@@ -1899,7 +1902,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
mbBookMode = false;
}
- Calc();
+ Calc(pRenderContext);
const bool bOldCallbackActionEnabled = IsCallbackActionEnabled();
SetCallbackActionEnabled( false );
@@ -2166,7 +2169,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
{
ChgSize( aNewSize );
::AdjustSizeChgNotify( this );
- Calc();
+ Calc(pRenderContext);
SwViewShell* pSh = GetCurrShell();
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 23b1933..3f681f1 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3529,11 +3529,13 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
static void lcl_EmergencyFormatFootnoteCont( SwFootnoteContFrm *pCont )
{
+ vcl::RenderContext* pRenderContext = pCont->getRootFrm()->GetCurrShell()->GetOut();
+
//It's possible that the Cont will get destroyed.
SwContentFrm *pCnt = pCont->ContainsContent();
while ( pCnt && pCnt->IsInFootnote() )
{
- pCnt->Calc();
+ pCnt->Calc(pRenderContext);
pCnt = pCnt->GetNextContentFrm();
}
}
@@ -3598,7 +3600,7 @@ void SwLayoutFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect,
SwShortCut aShortCut( *pFrm, rRect );
bool bCnt;
if ( (bCnt = pFrm->IsContentFrm()) )
- pFrm->Calc();
+ pFrm->Calc(&rRenderContext);
if ( pFrm->IsFootnoteContFrm() )
{
@@ -3660,7 +3662,7 @@ void SwLayoutFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect,
gProp.pSGlobalShell->InvalidateWindows( aPaintRect );
pFrm = pFrm->GetNext();
if ( pFrm && (bCnt = pFrm->IsContentFrm()) )
- pFrm->Calc();
+ pFrm->Calc(&rRenderContext);
continue;
}
}
@@ -3692,7 +3694,7 @@ void SwLayoutFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect,
pFrm = pFrm->GetNext();
if ( pFrm && (bCnt = pFrm->IsContentFrm()) )
- pFrm->Calc();
+ pFrm->Calc(&rRenderContext);
}
}
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index dcb7fbe..bef77ba 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -904,6 +904,7 @@ static SwFootnoteFrm* lcl_FindEndnote( SwSectionFrm* &rpSect, bool &rbEmpty,
static void lcl_ColumnRefresh( SwSectionFrm* pSect, bool bFollow )
{
+ vcl::RenderContext* pRenderContext = pSect->getRootFrm()->GetCurrShell()->GetOut();
while( pSect )
{
bool bOldLock = pSect->IsColLocked();
@@ -915,8 +916,8 @@ static void lcl_ColumnRefresh( SwSectionFrm* pSect, bool bFollow )
{ pCol->_InvalidateSize();
pCol->_InvalidatePos();
((SwLayoutFrm*)pCol)->Lower()->_InvalidateSize();
- pCol->Calc(); // calculation of column and
- ((SwLayoutFrm*)pCol)->Lower()->Calc(); // body
+ pCol->Calc(pRenderContext); // calculation of column and
+ ((SwLayoutFrm*)pCol)->Lower()->Calc(pRenderContext); // body
pCol = static_cast<SwColumnFrm*>(pCol->GetNext());
} while ( pCol );
}
@@ -1139,6 +1140,7 @@ class ExtraFormatToPositionObjs
void FormatSectionToPositionObjs()
{
+ vcl::RenderContext* pRenderContext = mpSectFrm->getRootFrm()->GetCurrShell()->GetOut();
// perform extra format for multi-columned section.
if ( mpSectFrm->Lower() && mpSectFrm->Lower()->IsColumnFrm() &&
mpSectFrm->Lower()->GetNext() )
@@ -1163,11 +1165,11 @@ class ExtraFormatToPositionObjs
SwColumnFrm* pColFrm = static_cast<SwColumnFrm*>(mpSectFrm->Lower());
while ( pColFrm )
{
- pColFrm->Calc();
- pColFrm->Lower()->Calc();
+ pColFrm->Calc(pRenderContext);
+ pColFrm->Lower()->Calc(pRenderContext);
if ( pColFrm->Lower()->GetNext() )
{
- pColFrm->Lower()->GetNext()->Calc();
+ pColFrm->Lower()->GetNext()->Calc(pRenderContext);
}
pColFrm = static_cast<SwColumnFrm*>(pColFrm->GetNext());
@@ -1207,7 +1209,7 @@ class ExtraFormatToPositionObjs
};
/// "formats" the frame; Frm and PrtArea
-void SwSectionFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderAttrs *pAttr )
+void SwSectionFrm::Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttr )
{
if( !pSection ) // via DelEmpty
{
@@ -1295,7 +1297,7 @@ void SwSectionFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorde
// Check the width of the columns and adjust if necessary
if ( bHasColumns && ! Lower()->GetNext() && bMaximize )
- static_cast<SwColumnFrm*>(Lower())->Lower()->Calc();
+ static_cast<SwColumnFrm*>(Lower())->Lower()->Calc(pRenderContext);
if ( !bMaximize )
{
@@ -1328,9 +1330,9 @@ void SwSectionFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorde
{
if( pFrm->IsColumnFrm() )
{
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
pFrm = static_cast<SwColumnFrm*>(pFrm)->Lower();
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
pFrm = static_cast<SwLayoutFrm*>(pFrm)->Lower();
CalcFootnoteContent();
}
@@ -1381,9 +1383,9 @@ void SwSectionFrm::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorde
{
pFrm->_InvalidateSize();
pFrm->_InvalidatePos();
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
pFrm = static_cast<SwColumnFrm*>(pFrm)->Lower();
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
pFrm = static_cast<SwLayoutFrm*>(pFrm)->Lower();
CalcFootnoteContent();
}
@@ -2508,18 +2510,19 @@ long SwSectionFrm::Undersize( bool bOverSize )
void SwSectionFrm::CalcFootnoteContent()
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
SwFootnoteContFrm* pCont = ContainsFootnoteCont();
if( pCont )
{
SwFrm* pFrm = pCont->ContainsAny();
if( pFrm )
- pCont->Calc();
+ pCont->Calc(pRenderContext);
while( pFrm && IsAnLower( pFrm ) )
{
SwFootnoteFrm* pFootnote = pFrm->FindFootnoteFrm();
if( pFootnote )
- pFootnote->Calc();
- pFrm->Calc();
+ pFootnote->Calc(pRenderContext);
+ pFrm->Calc(pRenderContext);
if( pFrm->IsSctFrm() )
{
SwFrm *pTmp = static_cast<SwSectionFrm*>(pFrm)->ContainsAny();
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 81af7b4..4f80e08 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -610,6 +610,7 @@ static bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
{
bool bRet = true;
+ vcl::RenderContext* pRenderContext = rLastLine.getRootFrm()->GetCurrShell()->GetOut();
SwTabFrm& rTab = static_cast<SwTabFrm&>(*rLastLine.GetUpper());
// If there are nested cells in rLastLine, the recalculation of the last
@@ -657,7 +658,7 @@ static bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
// #115759# - force a format of the last line in order to
// get the correct height.
rLastLine.InvalidateSize();
- rLastLine.Calc();
+ rLastLine.Calc(pRenderContext);
// Unlock this tab frame and its follow
if ( bUnlockFollow )
@@ -1355,6 +1356,7 @@ bool SwContentFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
if ( !pLay )
return true;
+ vcl::RenderContext* pRenderContext = pLay->getRootFrm()->GetCurrShell()->GetOut();
// LONG_MAX == nBottom means we have to calculate all
bool bAll = LONG_MAX == nBottom;
bool bRet = false;
@@ -1393,7 +1395,7 @@ bool SwContentFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
// #i26945# - no extra invalidation of floating
// screen objects needed.
// Thus, delete call of method <SwFrm::InvalidateObjs( true )>
- pCnt->Calc();
+ pCnt->Calc(pRenderContext);
// OD 2004-05-11 #i28701# - usage of new method <::FormatObjsAtFrm(..)>
// to format the floating screen objects
// #i46941# - frame has to be valid
@@ -1429,7 +1431,7 @@ bool SwContentFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
#endif
}
}
- pCnt->GetUpper()->Calc();
+ pCnt->GetUpper()->Calc(pRenderContext);
}
if( ! bAll && (*fnRect->fnYDiff)((pCnt->Frm().*fnRect->fnGetTop)(), nBottom) > 0 )
break;
@@ -1444,6 +1446,7 @@ static bool lcl_InnerCalcLayout( SwFrm *pFrm,
long nBottom,
bool _bOnlyRowsAndCells )
{
+ vcl::RenderContext* pRenderContext = pFrm->getRootFrm()->GetCurrShell() ? pFrm->getRootFrm()->GetCurrShell()->GetOut() : 0;
// LONG_MAX == nBottom means we have to calculate all
bool bAll = LONG_MAX == nBottom;
bool bRet = false;
@@ -1460,7 +1463,7 @@ static bool lcl_InnerCalcLayout( SwFrm *pFrm,
// not be calculated => It will not become valid =>
// Loop in lcl_RecalcRow(). Therefore we do not consider them for bRet.
bRet |= !pFrm->IsValid() && ( !pFrm->IsTabFrm() || !static_cast<SwTabFrm*>(pFrm)->IsJoinLocked() );
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
if( static_cast<SwLayoutFrm*>(pFrm)->Lower() )
bRet |= lcl_InnerCalcLayout( static_cast<SwLayoutFrm*>(pFrm)->Lower(), nBottom);
@@ -1470,7 +1473,7 @@ static bool lcl_InnerCalcLayout( SwFrm *pFrm,
{
SwCellFrm& rToCalc = const_cast<SwCellFrm&>(pThisCell->FindStartEndOfRowSpanCell( true, true ));
bRet |= !rToCalc.IsValid();
- rToCalc.Calc();
+ rToCalc.Calc(pRenderContext);
if ( rToCalc.Lower() )
bRet |= lcl_InnerCalcLayout( rToCalc.Lower(), nBottom);
}
@@ -1643,6 +1646,7 @@ static bool lcl_NoPrev( const SwFrm& rFrm )
// Precondition: The given table frame hasn't a follow and isn't a follow.
SwFrm* sw_FormatNextContentForKeep( SwTabFrm* pTabFrm )
{
+ vcl::RenderContext* pRenderContext = pTabFrm->getRootFrm()->GetCurrShell()->GetOut();
// find next content, table or section
SwFrm* pNxt = pTabFrm->FindNext();
@@ -1667,7 +1671,7 @@ SwFrm* sw_FormatNextContentForKeep( SwTabFrm* pTabFrm )
if ( pTabFrm->GetUpper()->IsInTab() )
pNxt->MakeAll(pNxt->getRootFrm()->GetCurrShell()->GetOut());
else
- pNxt->Calc();
+ pNxt->Calc(pRenderContext);
}
return pNxt;
@@ -2092,7 +2096,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext)
//Displace the footnotes!
if ( bMoveFootnotes )
if ( static_cast<SwLayoutFrm*>(pRowToMove)->MoveLowerFootnotes( 0, pOldBoss, FindFootnoteBossFrm( true ), true ) )
- GetUpper()->Calc();
+ GetUpper()->Calc(pRenderContext);
pRowToMove = pNextRow;
}
@@ -2413,7 +2417,7 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext)
}
if ( bCalcNxt )
{
- pNxt->Calc();
+ pNxt->Calc(pRenderContext);
}
}
}
@@ -2461,8 +2465,8 @@ void SwTabFrm::MakeAll(vcl::RenderContext* pRenderContext)
//To avoid oscillations now invalid master should drop behind.
SwTabFrm *pTab = FindMaster();
if ( pTab->GetUpper() )
- pTab->GetUpper()->Calc();
- pTab->Calc();
+ pTab->GetUpper()->Calc(pRenderContext);
+ pTab->Calc(pRenderContext);
pTab->SetLowersFormatted( false );
}
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 76fe704..bbb4e16 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -142,11 +142,12 @@ static SwCrsrOszControl aOszCtrl = { 0, 0, 0 };
bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS, bool ) const
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
bool bRet = false;
const SwFrm *pFrm = Lower();
while ( !bRet && pFrm )
{
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
// #i43742# New function
const bool bContentCheck = pFrm->IsTextFrm() && pCMS && pCMS->bContentCheck;
@@ -464,6 +465,7 @@ bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS, bool ) const
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
// cell frame does not necessarily have a lower (split table cell)
if ( !Lower() )
return false;
@@ -488,13 +490,13 @@ bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
return SwLayoutFrm::GetCrsrOfst( pPos, rPoint, pCMS );
else
{
- Calc();
+ Calc(pRenderContext);
bool bRet = false;
const SwFrm *pFrm = Lower();
while ( pFrm && !bRet )
{
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
if ( pFrm->Frm().IsInside( rPoint ) )
{
bRet = pFrm->GetCrsrOfst( pPos, rPoint, pCMS );
@@ -531,12 +533,13 @@ bool SwCellFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
SwCrsrMoveState* pCMS, bool ) const
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
aOszCtrl.Entry( this );
//If the Points lies inside the Fly, we try hard to set the Crsr inside it.
//However if the Point sits inside a Fly which is completely located inside
//the current one, we call GetCrsrOfst for it.
- Calc();
+ Calc(pRenderContext);
bool bInside = Frm().IsInside( rPoint ) && Lower();
bool bRet = false;
@@ -575,7 +578,7 @@ bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
const SwFrm *pFrm = Lower();
while ( pFrm && !bRet )
{
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
if ( pFrm->Frm().IsInside( rPoint ) )
{
bRet = pFrm->GetCrsrOfst( pPos, rPoint, pCMS );
@@ -975,6 +978,7 @@ sal_uInt16 SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
*/
sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum )
{
+ vcl::RenderContext* pRenderContext = GetCurrShell() ? GetCurrShell()->GetOut() : 0;
OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "No page available." );
SwPageFrm *pPage = static_cast<SwPageFrm*>(Lower());
@@ -988,7 +992,7 @@ sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum )
const SwContentFrm *pContent = pPage->ContainsContent();
while ( pContent && pPage->IsAnLower( pContent ) )
{
- pContent->Calc();
+ pContent->Calc(pRenderContext);
pContent = pContent->GetNextContentFrm();
}
//Either this is a new page or we found the last page.
@@ -1177,6 +1181,7 @@ const SwContentFrm *SwLayoutFrm::GetContentPos( Point& rPoint,
const SwCrsrMoveState *pCMS,
const bool bDefaultExpand ) const
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
//Determine the first ContentFrm.
const SwLayoutFrm *pStart = (!bDontLeave && bDefaultExpand && GetPrev()) ?
static_cast<const SwLayoutFrm*>(GetPrev()) : this;
@@ -1215,7 +1220,7 @@ const SwContentFrm *SwLayoutFrm::GetContentPos( Point& rPoint,
if ( !pContent->IsTextFrm() || !static_cast<const SwTextFrm*>(pContent)->IsHiddenNow() )
{
if ( bCalc )
- pContent->Calc();
+ pContent->Calc(pRenderContext);
SwRect aCntFrm( pContent->UnionFrm() );
if ( aCntFrm.IsInside( rPoint ) )
@@ -1356,7 +1361,7 @@ const SwContentFrm *SwLayoutFrm::GetContentPos( Point& rPoint,
//Bring the Point in to the PrtArea
if ( bCalc )
- pActual->Calc();
+ pActual->Calc(pRenderContext);
const SwRect aRect( pActual->Frm().Pos() + pActual->Prt().Pos(),
aActualSize );
if ( aPoint.Y() < aRect.Top() )
@@ -1489,6 +1494,7 @@ class DisableCallbackAction
*/
Point SwRootFrm::GetNextPrevContentPos( const Point& rPoint, bool bNext ) const
{
+ vcl::RenderContext* pRenderContext = GetCurrShell() ? GetCurrShell()->GetOut() : 0;
// #123110# - disable creation of an action by a callback
// event during processing of this method. Needed because formatting is
// triggered by this method.
@@ -1508,7 +1514,7 @@ Point SwRootFrm::GetNextPrevContentPos( const Point& rPoint, bool bNext ) const
if ( !pCnt )
return Point( 0, 0 );
- pCnt->Calc();
+ pCnt->Calc(pRenderContext);
if( !bNext )
{
// As long as the point lies before the first ContentFrm and there are
@@ -1525,7 +1531,7 @@ Point SwRootFrm::GetNextPrevContentPos( const Point& rPoint, bool bNext ) const
else
return ContainsContent()->UnionFrm().Pos();
}
- pCnt->Calc();
+ pCnt->Calc(pRenderContext);
}
}
@@ -1561,7 +1567,7 @@ Point SwRootFrm::GetNextPrevContentPos( const Point& rPoint, bool bNext ) const
//If the next ContentFrm lies behind the point then it is the one we
//searched.
const SwTabFrm* pTFrm;
- pNxt->Calc();
+ pNxt->Calc(pRenderContext);
if( pNxt->Frm().Top() > rPoint.Y() &&
!lcl_IsInRepeatedHeadline( pCnt, &pTFrm ) &&
( !pTFrm || pNxt->Frm().Left() > rPoint.X() ))
@@ -1786,10 +1792,10 @@ bool SwFrm::OnFirstPage() const
return bRet;
}
-void SwFrm::Calc() const
+void SwFrm::Calc(vcl::RenderContext* pRenderContext) const
{
if ( !mbValidPos || !mbValidPrtArea || !mbValidSize )
- const_cast<SwFrm*>(this)->PrepareMake(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0);
+ const_cast<SwFrm*>(this)->PrepareMake(pRenderContext);
}
Point SwFrm::GetRelPos() const
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 41d943a..e96d33d 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -3180,6 +3180,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
bool bBackLock = false;
SwViewShell *pSh = getRootFrm()->GetCurrShell();
SwViewShellImp *pImp = pSh ? pSh->Imp() : 0;
+ vcl::RenderContext* pRenderContext = pSh ? pSh->GetOut() : 0;
{
// Underlying algorithm
// We try to find the optimal height for the column.
@@ -3296,11 +3297,11 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
for ( sal_uInt16 i = 0; i < nNumCols; ++i )
{
- pCol->Calc();
+ pCol->Calc(pRenderContext);
// ColumnFrms have a BodyFrm now, which needs to be calculated
- pCol->Lower()->Calc();
+ pCol->Lower()->Calc(pRenderContext);
if( pCol->Lower()->GetNext() )
- pCol->Lower()->GetNext()->Calc(); // SwFootnoteCont
+ pCol->Lower()->GetNext()->Calc(pRenderContext); // SwFootnoteCont
pCol = static_cast<SwLayoutFrm*>(pCol->GetNext());
}
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index dea5367..263c05f 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -78,6 +78,7 @@ void ValidateText( SwFrm *pFrm ) // Friend of frame
void SwTextFrm::ValidateFrm()
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
// Validate surroundings to avoid oscillation
SWAP_IF_SWAPPED( this )
@@ -94,7 +95,7 @@ void SwTextFrm::ValidateFrm()
}
SwFrm *pUp = GetUpper();
- pUp->Calc();
+ pUp->Calc(pRenderContext);
if( pSct )
pSct->ColUnlock();
}
@@ -115,17 +116,18 @@ void SwTextFrm::ValidateFrm()
// First we search outwards, on the way back we calculate everything.
void _ValidateBodyFrm( SwFrm *pFrm )
{
+ vcl::RenderContext* pRenderContext = pFrm ? pFrm->getRootFrm()->GetCurrShell()->GetOut() : 0;
if( pFrm && !pFrm->IsCellFrm() )
{
if( !pFrm->IsBodyFrm() && pFrm->GetUpper() )
_ValidateBodyFrm( pFrm->GetUpper() );
if( !pFrm->IsSctFrm() )
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
else
{
const bool bOld = static_cast<SwSectionFrm*>(pFrm)->IsContentLocked();
static_cast<SwSectionFrm*>(pFrm)->SetContentLock( true );
- pFrm->Calc();
+ pFrm->Calc(pRenderContext);
if( !bOld )
static_cast<SwSectionFrm*>(pFrm)->SetContentLock( false );
}
@@ -186,6 +188,7 @@ const SwBodyFrm *SwTextFrm::FindBodyFrm() const
bool SwTextFrm::CalcFollow( const sal_Int32 nTextOfst )
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
SWAP_IF_SWAPPED( this )
OSL_ENSURE( HasFollow(), "CalcFollow: missing Follow." );
@@ -283,13 +286,13 @@ bool SwTextFrm::CalcFollow( const sal_Int32 nTextOfst )
}
}
- pMyFollow->Calc();
+ pMyFollow->Calc(pRenderContext);
// The Follow can tell from its Frm().Height() that something went wrong
OSL_ENSURE( !pMyFollow->GetPrev(), "SwTextFrm::CalcFollow: cheesy follow" );
if( pMyFollow->GetPrev() )
{
pMyFollow->Prepare( PREP_CLEAR );
- pMyFollow->Calc();
+ pMyFollow->Calc(pRenderContext);
OSL_ENSURE( !pMyFollow->GetPrev(), "SwTextFrm::CalcFollow: very cheesy follow" );
}
@@ -350,6 +353,7 @@ bool SwTextFrm::CalcFollow( const sal_Int32 nTextOfst )
void SwTextFrm::AdjustFrm( const SwTwips nChgHght, bool bHasToFit )
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
if( IsUndersized() )
{
if( GetOfst() && !IsFollow() ) // A scrolled paragraph (undersized)
@@ -404,7 +408,7 @@ void SwTextFrm::AdjustFrm( const SwTwips nChgHght, bool bHasToFit )
{
SwFrm *pPre = GetUpper()->Lower();
do
- { pPre->Calc();
+ { pPre->Calc(pRenderContext);
pPre = pPre->GetNext();
} while ( pPre && pPre != this );
}
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 636c18c..886cec5 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2066,6 +2066,7 @@ sal_uInt16 SwTextFrm::GetParHeight() const
*/
SwTextFrm* SwTextFrm::GetFormatted( bool bForceQuickFormat )
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
SWAP_IF_SWAPPED( this )
// The IdleCollector could've removed my cached information
@@ -2075,7 +2076,7 @@ SwTextFrm* SwTextFrm::GetFormatted( bool bForceQuickFormat )
{
// Calc() must be called, because frame position can be wrong
const bool bFormat = GetValidSizeFlag();
- Calc();
+ Calc(pRenderContext);
// It could be that Calc() did not trigger Format(), because
// we've been asked by the IdleCollector to throw away our
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 9ae675f..7742a3d 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -57,6 +57,7 @@ Reference< XHyphenatedWord > SwTextFormatInfo::HyphWord(
*/
bool SwTextFrm::Hyphenate( SwInterHyphInfo &rHyphInf )
{
+ vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
OSL_ENSURE( ! IsVertical() || ! IsSwapped(),"swapped frame at SwTextFrm::Hyphenate" );
if( !g_pBreakIt->GetBreakIter().is() )
@@ -66,7 +67,7 @@ bool SwTextFrm::Hyphenate( SwInterHyphInfo &rHyphInf )
OSL_ENSURE( !IsLocked(), "SwTextFrm::Hyphenate: this is locked" );
// The frame::Frame must have a valid SSize!
- Calc();
+ Calc(pRenderContext);
GetFormatted();
bool bRet = false;
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 933743f..622d40b 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -52,6 +52,7 @@
#include <fmtpdsc.hxx>
#include <pagedesc.hxx>
#include <viewsh.hxx>
+#include <rootfrm.hxx>
#include <tabfrm.hxx>
#include <redline.hxx>
#include <unoport.hxx>
@@ -591,6 +592,7 @@ static bool lcl_FormatTable(SwFrameFormat* pTableFormat)
SwIterator<SwFrm,SwFormat> aIter( *pTableFormat );
for(SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next())
{
+ vcl::RenderContext* pRenderContext = pFrm->getRootFrm()->GetCurrShell()->GetOut();
// mba: no TYPEINFO for SwTabFrm
if(!pFrm->IsTabFrm())
continue;
@@ -598,7 +600,7 @@ static bool lcl_FormatTable(SwFrameFormat* pTableFormat)
if(pTabFrm->IsValid())
pTabFrm->InvalidatePos();
pTabFrm->SetONECalcLowers();
- pTabFrm->Calc();
+ pTabFrm->Calc(pRenderContext);
bHasFrames = true;
}
return bHasFrames;
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index e24f1c0..2450450 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -122,6 +122,7 @@ void SwPagePreviewLayout::_ClearPreviewPageData()
*/
void SwPagePreviewLayout::_CalcPreviewLayoutSizes()
{
+ vcl::RenderContext* pRenderContext = mrParentViewShell.GetOut();
// calculate maximal page size; calculate also number of pages
const SwPageFrm* pPage = static_cast<const SwPageFrm*>(mrLayoutRootFrm.Lower());
@@ -134,7 +135,7 @@ void SwPagePreviewLayout::_CalcPreviewLayoutSizes()
}
++mnPages;
- pPage->Calc();
+ pPage->Calc(pRenderContext);
const Size& rPageSize = pPage->Frm().SSize();
if ( rPageSize.Width() > maMaxPageSize.Width() )
maMaxPageSize.Width() = rPageSize.Width();
@@ -547,6 +548,7 @@ void SwPagePreviewLayout::_CalcDocPreviewPaintRect()
*/
void SwPagePreviewLayout::_CalcPreviewPages()
{
+ vcl::RenderContext* pRenderContext = mrParentViewShell.GetOut();
_ClearPreviewPageData();
if ( mbNoPageVisible )
@@ -589,7 +591,7 @@ void SwPagePreviewLayout::_CalcPreviewPages()
continue;
}
- pPage->Calc();
+ pPage->Calc(pRenderContext);
// consider only pages, which have to be painted.
if ( nCurrCol < mnPaintStartCol )
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index c9dd0d4..0176505 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -303,7 +303,7 @@ void SwViewShell::CalcPagesForPrint( sal_uInt16 nMax )
pMyLayout->StartAllAction();
for ( sal_uInt16 i = 1; pPage && i <= nMax; pPage = pPage->GetNext(), ++i )
{
- pPage->Calc();
+ pPage->Calc(GetOut());
SwRect aOldVis( VisArea() );
maVisArea = pPage->Frm();
Imp()->SetFirstVisPageInvalid();
commit 680514c0f838840077df5bbee4bcbcc107cebb40
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 29 09:58:52 2015 +0200
coverity#1308430 pSh may be 0 here
Change-Id: I2aaee946bdc5a22cf5a83e1e50714556260280f3
(cherry picked from commit 7192cb0f32632ba4095ba0316109cc2eb7f1b218)
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index f43ce61..6a5f781 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1026,7 +1026,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
}
}
else
- FormatLayout( pSh->GetOut(), prPage );
+ FormatLayout( pSh ? pSh->GetOut() : 0, prPage );
if ( IsAgain() )
return false;
}
commit dcc013badafab9406739dc5a9bdf7b8601f650eb
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 29 09:14:05 2015 +0200
SwFrm::PrepareMake: use vcl::RenderContext
Change-Id: I34306bb1622c79489eb647ed45f398ad2634c144
(cherry picked from commit ea1ea3b910dea72c901cd655af9a3abd501f4e60)
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index f971809..834b042 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -370,7 +370,7 @@ protected:
void setRootFrm( SwRootFrm* pRoot ) { mpRoot = pRoot; }
SwPageFrm *InsertPage( SwPageFrm *pSibling, bool bFootnote );
- void PrepareMake();
+ void PrepareMake(vcl::RenderContext* pRenderContext);
void OptPrepareMake();
void MakePos();
// Format next frame of table frame to assure keeping attributes.
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 39bb508..be8fbc9 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -238,7 +238,7 @@ static bool lcl_IsCalcUpperAllowed( const SwFrm& rFrm )
*
* @see MakeAll()
*/
-void SwFrm::PrepareMake()
+void SwFrm::PrepareMake(vcl::RenderContext* pRenderContext)
{
StackHack aHack;
if ( GetUpper() )
@@ -274,7 +274,7 @@ void SwFrm::PrepareMake()
const SwTextFrm* pMaster = static_cast<SwContentFrm*>(this)->FindMaster();
if ( pMaster && pMaster->IsLocked() )
{
- MakeAll(IsRootFrm() ? 0 : getRootFrm()->GetCurrShell()->GetOut());
+ MakeAll(pRenderContext);
return;
}
}
@@ -303,7 +303,7 @@ void SwFrm::PrepareMake()
(SwFlowFrm::CastFlowFrm(pFrm))->IsAnFollow( pThis ) )
break;
- pFrm->MakeAll(IsRootFrm() ? 0 : getRootFrm()->GetCurrShell()->GetOut());
+ pFrm->MakeAll(pRenderContext);
if( IsSctFrm() && !static_cast<SwSectionFrm*>(this)->GetSection() )
break;
}
@@ -337,7 +337,7 @@ void SwFrm::PrepareMake()
if ( bTab && !bOldTabLock )
::PrepareUnlock( static_cast<SwTabFrm*>(this) );
}
- MakeAll(IsRootFrm() ? 0 : getRootFrm()->GetCurrShell()->GetOut());
+ MakeAll(pRenderContext);
}
void SwFrm::OptPrepareMake()
@@ -354,7 +354,7 @@ void SwFrm::OptPrepareMake()
return;
}
if ( GetPrev() && !GetPrev()->IsValid() )
- PrepareMake();
+ PrepareMake(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0);
else
{
StackHack aHack;
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 7abc004..c41d475 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2657,7 +2657,7 @@ SwFlyFrameFormat * SwFlyFrm::GetFormat()
void SwFlyFrm::Calc() const
{
if ( !m_bValidContentPos )
- const_cast<SwFlyFrm*>(this)->PrepareMake();
+ const_cast<SwFlyFrm*>(this)->PrepareMake(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0);
else
SwLayoutFrm::Calc();
}
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 035d12c..76fe704 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -1789,7 +1789,7 @@ bool SwFrm::OnFirstPage() const
void SwFrm::Calc() const
{
if ( !mbValidPos || !mbValidPrtArea || !mbValidSize )
- const_cast<SwFrm*>(this)->PrepareMake();
+ const_cast<SwFrm*>(this)->PrepareMake(getRootFrm()->GetCurrShell() ? getRootFrm()->GetCurrShell()->GetOut() : 0);
}
Point SwFrm::GetRelPos() const
commit cd69dddcf94b6347f37297632101f57321c52204
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 29 09:13:36 2015 +0200
sw: outline SwFrm::Calc()
Change-Id: I9c59116828585c9645bc415ef5fffe65a24d09ee
(cherry picked from commit 533e97947d82f780d5b1b7a02138d738b2435a56)
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 9677a5f..f971809 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -998,11 +998,6 @@ inline void SwFrm::InvalidateNextPos( bool bNoFootnote )
ImplInvalidateNextPos( bNoFootnote );
}
-inline void SwFrm::Calc() const
-{
- if ( !mbValidPos || !mbValidPrtArea || !mbValidSize )
- const_cast<SwFrm*>(this)->PrepareMake();
-}
inline void SwFrm::OptCalc() const
{
if ( !mbValidPos || !mbValidPrtArea || !mbValidSize )
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 578192f..035d12c 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -1786,6 +1786,12 @@ bool SwFrm::OnFirstPage() const
return bRet;
}
+void SwFrm::Calc() const
+{
+ if ( !mbValidPos || !mbValidPrtArea || !mbValidSize )
+ const_cast<SwFrm*>(this)->PrepareMake();
+}
+
Point SwFrm::GetRelPos() const
{
Point aRet( maFrm.Pos() );
More information about the Libreoffice-commits
mailing list