[Libreoffice-commits] core.git: sw/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Jun 29 06:40:29 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                    |    2 -
 sw/source/core/layout/anchoreddrawobject.cxx    |    4 +-
 sw/source/core/layout/calcmove.cxx              |   20 ++++++------
 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                |   25 ++++++++-------
 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               |   32 +++++++++++--------
 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/vprint.cxx                  |    2 -
 34 files changed, 185 insertions(+), 147 deletions(-)

New commits:
commit 8527dfbd4d3f79de8b02c561e5f0fef0d54d3eeb
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Jun 29 15:36:40 2015 +0200

    SwFrm::Calc: use vcl::RenderContext
    
    Change-Id: I98de3f5413756c494c677d592ea921155e4c08be

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 6c09f61..f7406cb 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1776,7 +1776,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 de64caf..721d755 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 8b8358e..db22a27 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 811f97b..e2c35db 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() != static_cast<SwNode const *>(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 c9d7b30..c3f8283 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 0c46506..811e388 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 93f8378..e9570d5 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 1f7ebb2..5755f6a 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 7a29307..a66cd33 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 197a68d..26c5fe8 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 b28041c..a52f82f 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 1d3f841..882ae50 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 b99f8ba..fe9bb3d 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -434,9 +434,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 50b063b..6a7e0c2 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 be7de21..bdb7bde 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 a29191b..1275893 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 = const_cast<SwFrm*>(static_cast<SwFrm const *>(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 = const_cast<SwFrm*>(static_cast<SwFrm const *>(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 = const_cast<SwFrm*>(static_cast<SwFrm const *>(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;
@@ -1428,6 +1429,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;
@@ -1439,7 +1441,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) &&
@@ -1483,6 +1485,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();
 
@@ -1505,7 +1508,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 a0101ec..6cd72b0 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 7298ec2..a91cef3 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -178,6 +178,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 );
@@ -194,11 +195,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 )
@@ -342,6 +343,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();
@@ -352,7 +354,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
@@ -1862,6 +1864,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
@@ -1900,7 +1903,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
         mbBookMode = false;
     }
 
-    Calc();
+    Calc(pRenderContext);
 
     const bool bOldCallbackActionEnabled = IsCallbackActionEnabled();
     SetCallbackActionEnabled( false );
@@ -2167,7 +2170,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 67e6e15..49a0773 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3530,11 +3530,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();
     }
 }
@@ -3599,7 +3601,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() )
     {
@@ -3661,7 +3663,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;
                 }
             }
@@ -3693,7 +3695,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 5b48867..ef889db 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();
                 static_cast<SwLayoutFrm*>(pCol)->Lower()->_InvalidateSize();
-                pCol->Calc();   // calculation of column and
-                static_cast<SwLayoutFrm*>(pCol)->Lower()->Calc();  // body
+                pCol->Calc(pRenderContext);   // calculation of column and
+                static_cast<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 8b56e39..4399799 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 552a171..bf1b5f2 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 918dd95..9ab790c 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 44a3db0..43a9589 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 swap( this );
 
@@ -94,7 +95,7 @@ void SwTextFrm::ValidateFrm()
         }
 
         SwFrm *pUp = GetUpper();
-        pUp->Calc();
+        pUp->Calc(pRenderContext);
         if( pSct )
             pSct->ColUnlock();
     }
@@ -113,17 +114,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 );
         }
@@ -179,6 +181,7 @@ const SwBodyFrm *SwTextFrm::FindBodyFrm() const
 
 bool SwTextFrm::CalcFollow( const sal_Int32 nTextOfst )
 {
+    vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
     SWAP_IF_SWAPPED swap( this );
 
     OSL_ENSURE( HasFollow(), "CalcFollow: missing Follow." );
@@ -276,13 +279,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" );
                     }
 
@@ -340,6 +343,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)
@@ -393,7 +397,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 7687086..9ed3750 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2058,6 +2058,7 @@ sal_uInt16 SwTextFrm::GetParHeight() const
  */
 SwTextFrm* SwTextFrm::GetFormatted( bool bForceQuickFormat )
 {
+    vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
     SWAP_IF_SWAPPED swap( this );
 
     // The IdleCollector could've removed my cached information
@@ -2067,7 +2068,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 5bf7d25..3841ea0 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 8edd361..68366e8 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 9d91d13..a2c98a8 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 4bec7c6..ac331b6 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();


More information about the Libreoffice-commits mailing list