[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 19 commits - sw/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Jun 26 00:34:03 PDT 2015


 sw/source/core/crsr/crsrsh.cxx               |    4 -
 sw/source/core/crsr/viscrs.cxx               |    2 
 sw/source/core/doc/notxtfrm.cxx              |    2 
 sw/source/core/draw/dpage.cxx                |    2 
 sw/source/core/frmedt/fews.cxx               |    2 
 sw/source/core/inc/frmtool.hxx               |    2 
 sw/source/core/inc/layact.hxx                |    6 -
 sw/source/core/inc/pagefrm.hxx               |    4 -
 sw/source/core/inc/viewimp.hxx               |   20 -----
 sw/source/core/layout/anchoreddrawobject.cxx |    4 -
 sw/source/core/layout/layact.cxx             |   39 +++++------
 sw/source/core/layout/pagechg.cxx            |    4 -
 sw/source/core/layout/paintfrm.cxx           |   93 +++++++++++++--------------
 sw/source/core/text/frmform.cxx              |   12 +--
 sw/source/core/text/inftxt.cxx               |   64 ++++++++++++++++--
 sw/source/core/text/inftxt.hxx               |   49 ++------------
 sw/source/core/text/txtfly.cxx               |    2 
 sw/source/core/text/txtfrm.cxx               |    8 +-
 sw/source/core/text/txtftn.cxx               |    2 
 sw/source/core/text/txthyph.cxx              |    3 
 sw/source/core/unocore/unoflatpara.cxx       |    2 
 sw/source/core/view/pagepreviewlayout.cxx    |    8 +-
 sw/source/core/view/viewimp.cxx              |   22 +++++-
 sw/source/core/view/viewsh.cxx               |   18 ++---
 sw/source/core/view/vprint.cxx               |    2 
 sw/source/uibase/docvw/PageBreakWin.cxx      |    2 
 26 files changed, 198 insertions(+), 180 deletions(-)

New commits:
commit 783361da4efa20422769dcda64c59b615c31c6d6
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 17:38:24 2015 +0200

    SwTextFormatInfo::SwTextFormatInfo: use vcl::RenderContext
    
    (cherry picked from commit 54106fae68149c0b1dbb4f6ece133fefacacc322)
    
    Conflicts:
    	sw/source/core/text/frmform.cxx
    
    Change-Id: I8ff1647bdf8c46d395c398c97b97066d7b128cdb

diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 1434a49..3f91ead 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -504,7 +504,7 @@ com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > SwTextFrm::Get
     com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > tabs(1);
     ::com::sun::star::style::TabStop ts;
 
-    SwTextFormatInfo     aInf( this );
+    SwTextFormatInfo     aInf( getRootFrm()->GetCurrShell()->GetOut(), this );
     SwTextFormatter      aLine( this, &aInf );
     SwTextCursor         TextCursor( this, &aInf );
     const Point aCharPos( TextCursor.GetTopLeft() );
@@ -868,8 +868,8 @@ bool SwTextFrm::CalcPreps()
 
             SWAP_IF_NOT_SWAPPED( this )
 
-            SwTextFormatInfo aInf( this );
-            SwTextFormatter aLine( this, &aInf );
+                SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this );
+                SwTextFormatter aLine( this, &aInf );
 
             WidowsAndOrphans aFrmBreak( this );
             // Whatever the attributes say: we split the paragraph in
@@ -1665,7 +1665,7 @@ void SwTextFrm::_Format( SwParaPortion *pPara )
     if ( IsVertical() )
         SwapWidthAndHeight();
 
-    SwTextFormatInfo aInf( this );
+    SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this );
     SwTextFormatter  aLine( this, &aInf );
 
     HideAndShowObjects();
@@ -1892,7 +1892,7 @@ bool SwTextFrm::FormatQuick( bool bForceQuickFormat )
     SwFrmSwapper aSwapper( this, true );
 
     TextFrmLockGuard aLock(this);
-    SwTextFormatInfo aInf( this, false, true );
+    SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, false, true );
     if( 0 != aInf.MaxHyph() )   // Respect MaxHyphen!
         return false;
 
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 741bef7..ae679c3 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1467,10 +1467,10 @@ void SwTextFormatInfo::Init()
     SetPaintOfst(0);
 }
 
-SwTextFormatInfo::SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL,
+SwTextFormatInfo::SwTextFormatInfo(OutputDevice* pRenderContext, SwTextFrm *pFrame, const bool bInterHyphL,
                                    const bool bQuickL, const bool bTst)
 {
-    CtorInitTextFormatInfo(pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame, bInterHyphL, bQuickL, bTst);
+    CtorInitTextFormatInfo(pRenderContext, pFrame, bInterHyphL, bQuickL, bTst);
 }
 
 /**
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index fc28a0a..9c09bfc 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -563,7 +563,7 @@ class SwTextFormatInfo : public SwTextPaintInfo
 public:
     void CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrm *pFrm, const bool bInterHyph = false,
         const bool bQuick = false, const bool bTst = false );
-    SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false,
+    SwTextFormatInfo(OutputDevice* pRenderContext, SwTextFrm *pFrame, const bool bInterHyphL = false,
             const bool bQuickL = false, const bool bTst = false);
 
     // For the formatting inside a double line in a line (multi-line portion)
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index bc3e656..d51b613 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -758,7 +758,7 @@ void SwTextFrm::CalcLineSpace()
 
     Size aNewSize( Prt().SSize() );
 
-    SwTextFormatInfo aInf( this );
+    SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this );
     SwTextFormatter aLine( this, &aInf );
     if( aLine.GetDropLines() )
     {
@@ -1882,7 +1882,7 @@ SwTestFormat::SwTestFormat( SwTextFrm* pTextFrm, const SwFrm* pPre, SwTwips nMax
     if ( pFrm->IsVertical() )
         pFrm->SwapWidthAndHeight();
 
-    SwTextFormatInfo aInf( pFrm, false, true, true );
+    SwTextFormatInfo aInf( pFrm->getRootFrm()->GetCurrShell()->GetOut(), pFrm, false, true, true );
     SwTextFormatter  aLine( pFrm, &aInf );
 
     pFrm->_Format( aLine, aInf );
@@ -2120,7 +2120,7 @@ SwTwips SwTextFrm::CalcFitToContent()
     // #i31490#
     TextFrmLockGuard aLock( this );
 
-    SwTextFormatInfo aInf( this, false, true, true );
+    SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, false, true, true );
     aInf.SetIgnoreFly( true );
     SwTextFormatter  aLine( this, &aInf );
     SwHookOut aHook( aInf );
@@ -2180,7 +2180,7 @@ void SwTextFrm::CalcAdditionalFirstLineOffset()
             TextFrmLockGuard aLock( this );
 
             // simulate text formatting
-            SwTextFormatInfo aInf( this, false, true, true );
+            SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, false, true, true );
             aInf.SetIgnoreFly( true );
             SwTextFormatter aLine( this, &aInf );
             SwHookOut aHook( aInf );
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 07ba9d6..7a69dc2 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -144,7 +144,7 @@ bool SwTextFrm::CalcPrepFootnoteAdjust()
             bReArrange = false;
         if( !pCont || !pFootnote || bReArrange != (pFootnote->FindFootnoteBossFrm() == pBoss) )
         {
-            SwTextFormatInfo aInf( this );
+            SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this );
             SwTextFormatter aLine( this, &aInf );
             aLine.TruncLines();
             SetPara( 0 ); // May be deleted!
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 9ced752..9ae675f 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -28,6 +28,7 @@
 #include <itrform2.hxx>
 #include <guess.hxx>
 #include <splargs.hxx>
+#include <rootfrm.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -78,7 +79,7 @@ bool SwTextFrm::Hyphenate( SwInterHyphInfo &rHyphInf )
         if ( IsVertical() )
             SwapWidthAndHeight();
 
-        SwTextFormatInfo aInf( this, true ); // true for interactive hyph!
+        SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, true ); // true for interactive hyph!
         SwTextFormatter aLine( this, &aInf );
         aLine.CharToLine( rHyphInf.nStart );
 
commit 8155ba78bab5dfe600170d42c0b1ae47da602657
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 17:12:55 2015 +0200

    SwTextFormatInfo::CtorInitTextFormatInfo: use vcl::RenderContext
    
    Change-Id: I0f775bdfaf6a098be25d053f87b1bcf86d533297
    (cherry picked from commit a5fe6ea091ae7e897b11b62b9b749b6194d34585)

diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index cb70ff2..1434a49 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1624,7 +1624,7 @@ void SwTextFrm::FormatOnceMore( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
             // If something went wrong, we need to reformat again
             if( !bGoOn )
             {
-                rInf.CtorInitTextFormatInfo( this );
+                rInf.CtorInitTextFormatInfo( getRootFrm()->GetCurrShell()->GetOut(), this );
                 rLine.CtorInitTextFormatter( this, &rInf );
                 rLine.SetDropLines( 1 );
                 rLine.CalcDropHeight( 1 );
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index bac9704..741bef7 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1351,10 +1351,10 @@ bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen )
     return bAuto;
 }
 
-void SwTextFormatInfo::CtorInitTextFormatInfo( SwTextFrm *pNewFrm, const bool bNewInterHyph,
+void SwTextFormatInfo::CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrm *pNewFrm, const bool bNewInterHyph,
                                 const bool bNewQuick, const bool bTst )
 {
-    CtorInitTextPaintInfo( pNewFrm->getRootFrm()->GetCurrShell()->GetOut(), pNewFrm, SwRect() );
+    CtorInitTextPaintInfo( pRenderContext, pNewFrm, SwRect() );
 
     bQuick = bNewQuick;
     bInterHyph = bNewInterHyph;
@@ -1470,7 +1470,7 @@ void SwTextFormatInfo::Init()
 SwTextFormatInfo::SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL,
                                    const bool bQuickL, const bool bTst)
 {
-    CtorInitTextFormatInfo(pFrame, bInterHyphL, bQuickL, bTst);
+    CtorInitTextFormatInfo(pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame, bInterHyphL, bQuickL, bTst);
 }
 
 /**
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index cbcabef..fc28a0a 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -561,7 +561,7 @@ class SwTextFormatInfo : public SwTextPaintInfo
     bool _CheckFootnotePortion( SwLineLayout* pCurr );
 
 public:
-    void CtorInitTextFormatInfo( SwTextFrm *pFrm, const bool bInterHyph = false,
+    void CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrm *pFrm, const bool bInterHyph = false,
         const bool bQuick = false, const bool bTst = false );
     SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false,
             const bool bQuickL = false, const bool bTst = false);
commit dddbb8dc6e6caefc15134fe48fd769e332d916f4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 17:06:30 2015 +0200

    sw: outline SwTextFormatInfo ctor
    
    Change-Id: I07b3a7768def547a34cbcdd8966157065605d5fb
    (cherry picked from commit d3456256eafa376abaad50dc980ab94032185af6)

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 06bdcc0..bac9704 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1467,6 +1467,12 @@ void SwTextFormatInfo::Init()
     SetPaintOfst(0);
 }
 
+SwTextFormatInfo::SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL,
+                                   const bool bQuickL, const bool bTst)
+{
+    CtorInitTextFormatInfo(pFrame, bInterHyphL, bQuickL, bTst);
+}
+
 /**
  * There are a few differences between a copy constructor
  * and the following constructor for multi-line formatting.
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 0f9ea3e..cbcabef 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -563,9 +563,8 @@ class SwTextFormatInfo : public SwTextPaintInfo
 public:
     void CtorInitTextFormatInfo( SwTextFrm *pFrm, const bool bInterHyph = false,
         const bool bQuick = false, const bool bTst = false );
-    inline SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false,
-            const bool bQuickL = false, const bool bTst = false)
-           { CtorInitTextFormatInfo( pFrame, bInterHyphL, bQuickL, bTst ); }
+    SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false,
+            const bool bQuickL = false, const bool bTst = false);
 
     // For the formatting inside a double line in a line (multi-line portion)
     // we need a modified text-format-info:
commit 3110255ffd54da6f06b425cfcb4a629959a1cdfd
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 16:44:55 2015 +0200

    SwTextPaintInfo::CtorInitTextPaintInfo: use vcl::RenderContext
    
    Change-Id: I1931ec139798d2f2eb956fd0590ab98ce1a65c3c
    (cherry picked from commit 0c33e10b594aa07c4e9adadae59e5c03a4fdc29c)

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 2ff3518..06bdcc0 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -487,9 +487,9 @@ bool SwTextSizeInfo::_HasHint( const SwTextNode* pTextNode, sal_Int32 nPos )
     return pTextNode->GetTextAttrForCharAt(nPos);
 }
 
-void SwTextPaintInfo::CtorInitTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint )
+void SwTextPaintInfo::CtorInitTextPaintInfo( OutputDevice* pRenderContext, SwTextFrm *pFrame, const SwRect &rPaint )
 {
-    CtorInitTextSizeInfo( pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame );
+    CtorInitTextSizeInfo( pRenderContext, pFrame );
     aTextFly.CtorInitTextFly( pFrame ),
     aPaintRect = rPaint;
     nSpaceIdx = 0;
@@ -533,7 +533,7 @@ SwTextPaintInfo::SwTextPaintInfo( const SwTextPaintInfo &rInf )
 
 SwTextPaintInfo::SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint )
 {
-    CtorInitTextPaintInfo( pFrame, rPaint );
+    CtorInitTextPaintInfo( pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame, rPaint );
 }
 
 extern Color aGlobalRetoucheColor;
@@ -1354,7 +1354,7 @@ bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen )
 void SwTextFormatInfo::CtorInitTextFormatInfo( SwTextFrm *pNewFrm, const bool bNewInterHyph,
                                 const bool bNewQuick, const bool bTst )
 {
-    CtorInitTextPaintInfo( pNewFrm, SwRect() );
+    CtorInitTextPaintInfo( pNewFrm->getRootFrm()->GetCurrShell()->GetOut(), pNewFrm, SwRect() );
 
     bQuick = bNewQuick;
     bInterHyph = bNewInterHyph;
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 17ff859..0f9ea3e 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -403,7 +403,7 @@ public:
     SwTextPaintInfo( const SwTextPaintInfo &rInf );
     SwTextPaintInfo( const SwTextPaintInfo &rInf, const OUString* pText );
 
-    void CtorInitTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint );
+    void CtorInitTextPaintInfo( OutputDevice* pRenderContext, SwTextFrm *pFrame, const SwRect &rPaint );
 
     void SetBack( const SvxBrushItem *pItem,
                   const SwRect &rRect ) { pBrushItem = pItem; aItemRect = rRect;}
commit 4283aa9cf0090ec5b21073605d3fe98223c649e0
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 16:33:37 2015 +0200

    sw: outline SwTextPaintInfo ctor
    
    Change-Id: Ie57e1f5abc91286662804e7528afd062d1427fee
    (cherry picked from commit 9829d6ab01e15be7e81f971eac6ba5e402ca5189)

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 3e41ec5..2ff3518 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -531,6 +531,11 @@ SwTextPaintInfo::SwTextPaintInfo( const SwTextPaintInfo &rInf )
       nSpaceIdx( rInf.GetSpaceIdx() )
 { }
 
+SwTextPaintInfo::SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint )
+{
+    CtorInitTextPaintInfo( pFrame, rPaint );
+}
+
 extern Color aGlobalRetoucheColor;
 
 /// Returns if the current background color is dark.
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index e8f88c5..17ff859 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -410,8 +410,7 @@ public:
     const SvxBrushItem *GetBrushItem() const { return pBrushItem; }
     const SwRect       &GetBrushRect() const { return aItemRect;  }
 
-    inline SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint )
-           { CtorInitTextPaintInfo( pFrame, rPaint ); }
+    SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint );
 
     inline SwTwips X() const { return aPos.X(); }
     inline void X( const long nNew ) { aPos.X() = nNew; }
commit 33e33bcce7797ae82e5d79a43df2a04b4938a00b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 16:23:25 2015 +0200

    SwTextSizeInfo::CtorInitTextSizeInfo: use vcl::RenderContext
    
    Change-Id: I6dfceb02b57d886dd8025520e5ed21a2ad46a5b1
    (cherry picked from commit 8af3974013dbae4aa83b13c6fd6c6e8fd04ac072)

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 3dae3d3..3e41ec5 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -251,7 +251,7 @@ SwTextSizeInfo::SwTextSizeInfo( const SwTextSizeInfo &rNew )
 #endif
 }
 
-void SwTextSizeInfo::CtorInitTextSizeInfo( SwTextFrm *pFrame, SwFont *pNewFnt,
+void SwTextSizeInfo::CtorInitTextSizeInfo( OutputDevice* pRenderContext, SwTextFrm *pFrame, SwFont *pNewFnt,
                    const sal_Int32 nNewIdx, const sal_Int32 nNewLen )
 {
     m_pKanaComp = NULL;
@@ -264,9 +264,9 @@ void SwTextSizeInfo::CtorInitTextSizeInfo( SwTextFrm *pFrame, SwFont *pNewFnt,
     // Get the output and reference device
     if ( m_pVsh )
     {
-        m_pOut = m_pVsh->GetOut();
+        m_pOut = pRenderContext;
         m_pRef = &m_pVsh->GetRefDev();
-        m_bOnWin = m_pVsh->GetWin() || OUTDEV_WINDOW == m_pOut->GetOutDevType();
+        m_bOnWin = m_pVsh->GetWin() || OUTDEV_WINDOW == m_pOut->GetOutDevType() || m_pVsh->isOutputToWindow();
     }
     else
     {
@@ -368,7 +368,7 @@ SwTextSizeInfo::SwTextSizeInfo( SwTextFrm *pTextFrm, SwFont *pTextFnt,
                const sal_Int32 nLength )
     : m_bOnWin(false)
 {
-    CtorInitTextSizeInfo( pTextFrm, pTextFnt, nIndex, nLength );
+    CtorInitTextSizeInfo( pTextFrm->getRootFrm()->GetCurrShell()->GetOut(), pTextFrm, pTextFnt, nIndex, nLength );
 }
 
 void SwTextSizeInfo::SelectFont()
@@ -489,7 +489,7 @@ bool SwTextSizeInfo::_HasHint( const SwTextNode* pTextNode, sal_Int32 nPos )
 
 void SwTextPaintInfo::CtorInitTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint )
 {
-    CtorInitTextSizeInfo( pFrame );
+    CtorInitTextSizeInfo( pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame );
     aTextFly.CtorInitTextFly( pFrame ),
     aPaintRect = rPaint;
     nSpaceIdx = 0;
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 1384906..e8f88c5 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -191,7 +191,7 @@ protected:
     sal_uInt8 m_nDirection : 2; // writing direction: 0/90/180/270 degree
 
 protected:
-    void CtorInitTextSizeInfo( SwTextFrm *pFrm, SwFont *pFnt = 0,
+    void CtorInitTextSizeInfo( OutputDevice* pRenderContext, SwTextFrm *pFrm, SwFont *pFnt = 0,
                    const sal_Int32 nIdx = 0,
                    const sal_Int32 nLen = COMPLETE_STRING );
     SwTextSizeInfo();
commit abf0750c181edc20ce9dbd3a362df6cf1f5e10be
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 15:47:15 2015 +0200

    sw: outline SwTextSizeInfo ctors
    
    Change-Id: I8964701bf5b1ecdb11851d7cc8540175e007dd2b
    (cherry picked from commit d7eacc579fb0874e9602b5c0714ac00bd520322a)

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 861f412..3dae3d3 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -188,6 +188,35 @@ inline sal_Int32 GetMinLen( const SwTextSizeInfo &rInf )
     return std::min(nTextLen, nInfLen);
 }
 
+SwTextSizeInfo::SwTextSizeInfo()
+: m_pKanaComp(0)
+, m_pVsh(0)
+, m_pOut(0)
+, m_pRef(0)
+, m_pFnt(0)
+, m_pUnderFnt(0)
+, m_pFrm(0)
+, m_pOpt(0)
+, m_pText(0)
+, m_nIdx(0)
+, m_nLen(0)
+, m_nKanaIdx(0)
+, m_bOnWin    (false)
+, m_bNotEOL   (false)
+, m_bURLNotify(false)
+, m_bStopUnderflow(false)
+, m_bFootnoteInside(false)
+, m_bOtherThanFootnoteInside(false)
+, m_bMulti(false)
+, m_bFirstMulti(false)
+, m_bRuby(false)
+, m_bHanging(false)
+, m_bScriptSpace(false)
+, m_bForbiddenChars(false)
+, m_bSnapToGrid(false)
+, m_nDirection(0)
+{}
+
 SwTextSizeInfo::SwTextSizeInfo( const SwTextSizeInfo &rNew )
     : SwTextInfo( rNew ),
       m_pKanaComp(rNew.GetpKanaComp()),
@@ -334,6 +363,14 @@ SwTextSizeInfo::SwTextSizeInfo( const SwTextSizeInfo &rNew, const OUString* pTex
     SetLen( GetMinLen( *this ) );
 }
 
+SwTextSizeInfo::SwTextSizeInfo( SwTextFrm *pTextFrm, SwFont *pTextFnt,
+               const sal_Int32 nIndex,
+               const sal_Int32 nLength )
+    : m_bOnWin(false)
+{
+    CtorInitTextSizeInfo( pTextFrm, pTextFnt, nIndex, nLength );
+}
+
 void SwTextSizeInfo::SelectFont()
 {
      // The path needs to go via ChgPhysFnt or the FontMetricCache gets confused.
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index a1a30cb..1384906 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -194,34 +194,7 @@ protected:
     void CtorInitTextSizeInfo( SwTextFrm *pFrm, SwFont *pFnt = 0,
                    const sal_Int32 nIdx = 0,
                    const sal_Int32 nLen = COMPLETE_STRING );
-    SwTextSizeInfo()
-        : m_pKanaComp(0)
-        , m_pVsh(0)
-        , m_pOut(0)
-        , m_pRef(0)
-        , m_pFnt(0)
-        , m_pUnderFnt(0)
-        , m_pFrm(0)
-        , m_pOpt(0)
-        , m_pText(0)
-        , m_nIdx(0)
-        , m_nLen(0)
-        , m_nKanaIdx(0)
-        , m_bOnWin    (false)
-        , m_bNotEOL   (false)
-        , m_bURLNotify(false)
-        , m_bStopUnderflow(false)
-        , m_bFootnoteInside(false)
-        , m_bOtherThanFootnoteInside(false)
-        , m_bMulti(false)
-        , m_bFirstMulti(false)
-        , m_bRuby(false)
-        , m_bHanging(false)
-        , m_bScriptSpace(false)
-        , m_bForbiddenChars(false)
-        , m_bSnapToGrid(false)
-        , m_nDirection(0)
-        {}
+    SwTextSizeInfo();
 public:
     SwTextSizeInfo( const SwTextSizeInfo &rInf );
     SwTextSizeInfo( const SwTextSizeInfo &rInf, const OUString* pText,
@@ -230,11 +203,7 @@ public:
 
     SwTextSizeInfo( SwTextFrm *pTextFrm, SwFont *pTextFnt = 0,
                    const sal_Int32 nIndex = 0,
-                   const sal_Int32 nLength = COMPLETE_STRING )
-        : m_bOnWin(false)
-    {
-        CtorInitTextSizeInfo( pTextFrm, pTextFnt, nIndex, nLength );
-    }
+                   const sal_Int32 nLength = COMPLETE_STRING );
 
     // GetMultiAttr returns the text attribute of the multiportion,
     // if rPos is inside any multi-line part.
commit 688227f66e815fac5a99dc6008e1376173bb1abb
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 14:48:09 2015 +0200

    SwLayAction::FormatLayout: use vcl::RenderContext
    
    Change-Id: I3bc993b00940732fd9ca26ccec7d025c8558516a
    (cherry picked from commit b13fbaf697b1cbd1f8b019e3f5500b53e2a39c6c)

diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 53e3c25..1dca776 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -100,7 +100,7 @@ class SwLayAction
     inline bool _PaintContent( const SwContentFrm *, const SwPageFrm *,
                              const SwRect & );
 
-    bool FormatLayout( SwLayoutFrm *, bool bAddRect = true );
+    bool FormatLayout( OutputDevice* pRenderContext, SwLayoutFrm *, bool bAddRect = true );
     bool FormatLayoutTab( SwTabFrm *, bool bAddRect = true );
     bool FormatContent( const SwPageFrm* pPage );
     void _FormatContent( const SwContentFrm* pContent,
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 2845c03..f43ce61 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -572,7 +572,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
                             break;
                         }
 
-                        FormatLayout( pPage );
+                        FormatLayout( pRenderContext, pPage );
                         XCHECKPAGE;
                     }
                     // #i28701# - change condition
@@ -755,7 +755,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
                         break;
                     }
 
-                    FormatLayout( pPg );
+                    FormatLayout( pRenderContext, pPg );
                     XCHECKPAGE;
                 }
 
@@ -1026,7 +1026,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
             }
         }
         else
-            FormatLayout( prPage );
+            FormatLayout( pSh->GetOut(), prPage );
         if ( IsAgain() )
             return false;
     }
@@ -1216,7 +1216,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
 }
 
 // OD 15.11.2002 #105155# - introduce support for vertical layout
-bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
+bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrm *pLay, bool bAddRect )
 {
     OSL_ENSURE( !IsAgain(), "Attention to the invalid page." );
     if ( IsAgain() )
@@ -1236,7 +1236,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
         SwRect aOldRect( aOldFrame );
         if( pLay->IsPageFrm() )
         {
-            aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pLay->getRootFrm()->GetCurrShell()->GetOut());
+            aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pRenderContext);
         }
 
         pLay->Calc();
@@ -1264,7 +1264,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
             if ( pLay->IsPageFrm() )
             {
                 SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay);
-                aPaint = pPageFrm->GetBoundRect(pPageFrm->getRootFrm()->GetCurrShell()->GetOut());
+                aPaint = pPageFrm->GetBoundRect(pRenderContext);
             }
 
             bool bPageInBrowseMode = pLay->IsPageFrm();
@@ -1320,7 +1320,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
                 if(pSh)
                 {
                     SwPageFrm::GetBorderAndShadowBoundRect(aPageRect, pSh,
-                        pSh->GetOut(),
+                        pRenderContext,
                         aPageRect, pPageFrm->IsLeftShadowNeeded(), pPageFrm->IsRightShadowNeeded(),
                         pPageFrm->SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT);
                 }
@@ -1335,7 +1335,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
                         pImp->GetShell()->AddPaintRect( aSpaceToPrevPage );
 
                     if (pSh)
-                        pSh->GetOut()->DrawRect( aSpaceToPrevPage.SVRect() );
+                        pRenderContext->DrawRect( aSpaceToPrevPage.SVRect() );
 
                     // left
                     aSpaceToPrevPage = aPageRect;
@@ -1399,7 +1399,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
                 bTabChanged |= FormatLayoutTab( static_cast<SwTabFrm*>(pLow), bAddRect );
             // Skip the ones already registered for deletion
             else if( !pLow->IsSctFrm() || static_cast<SwSectionFrm*>(pLow)->GetSection() )
-                bChanged |= FormatLayout( static_cast<SwLayoutFrm*>(pLow), bAddRect );
+                bChanged |= FormatLayout( pRenderContext, static_cast<SwLayoutFrm*>(pLow), bAddRect );
         }
         else if ( pImp->GetShell()->IsPaintLocked() )
             // Shortcut to minimize the cycles. With Lock, the
@@ -1413,7 +1413,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
     // OD 11.11.2002 #104414# - add complete frame area as paint area, if frame
     // area has been already added and after formatting its lowers the frame area
     // is enlarged.
-    SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect(pLay->getRootFrm()->GetCurrShell()->GetOut()) : pLay->Frm() );
+    SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect(pRenderContext) : pLay->Frm() );
 
     if ( bAlreadyPainted &&
          ( aBoundRect.Width() > aFrmAtCompletePaint.Width() ||
@@ -1467,7 +1467,7 @@ bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
             if ( pLow->IsTabFrm() )
                 bTabChanged |= FormatLayoutTab( static_cast<SwTabFrm*>(pLow), bAddRect );
             else
-                bChanged |= FormatLayout( static_cast<SwLayoutFrm*>(pLow), bAddRect );
+                bChanged |= FormatLayout( pImp->GetShell()->GetOut(), static_cast<SwLayoutFrm*>(pLow), bAddRect );
         }
         pLow = pLow->GetNext();
     }
@@ -1614,7 +1614,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, bool bAddRect )
         SwLayoutFrm *pLow = static_cast<SwLayoutFrm*>(pTab->Lower());
         while ( pLow )
         {
-            bChanged |= FormatLayout( pLow, bAddRect );
+            bChanged |= FormatLayout( pImp->GetShell()->GetOut(), pLow, bAddRect );
             if ( IsAgain() )
                 return false;
             pLow = static_cast<SwLayoutFrm*>(pLow->GetNext());
commit 209b08a25e997797ab7bfda5b3675e41bec96f2d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 14:13:44 2015 +0200

    SwLayAction::Action: use vcl::RenderContext
    
    Change-Id: I4fb6c42da0c5defa1d5da4cf6f3a13d11388c88d
    (cherry picked from commit 08b3b6ed6c4d8599c9bb75719974c710462f2764)

diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index e85ff36..53e3c25 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -154,7 +154,7 @@ public:
     inline void SetCheckPageNum( sal_uInt16 nNew );
     inline void SetCheckPageNumDirect( sal_uInt16 nNew ) { nCheckPageNum = nNew; }
 
-    void Action();  // here it begins
+    void Action(OutputDevice* pRenderContext); // here it begins
     void Reset();   // back to CTor-defaults
 
     bool IsAgain()      const { return bAgain; }
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 9895e74..2845c03 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -341,7 +341,7 @@ bool SwLayAction::RemoveEmptyBrowserPages()
     return bRet;
 }
 
-void SwLayAction::Action()
+void SwLayAction::Action(OutputDevice* pRenderContext)
 {
     bActionInProgress = true;
 
@@ -366,12 +366,12 @@ void SwLayAction::Action()
     if ( IsCalcLayout() )
         SetCheckPages( false );
 
-    InternalAction(pImp->GetShell()->GetOut());
+    InternalAction(pRenderContext);
     bAgain |= RemoveEmptyBrowserPages();
     while ( IsAgain() )
     {
         bAgain = bNextCycle = false;
-        InternalAction(pImp->GetShell()->GetOut());
+        InternalAction(pRenderContext);
         bAgain |= RemoveEmptyBrowserPages();
     }
     pRoot->DeleteEmptySct();
@@ -2165,7 +2165,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewShellImp *pI ) :
             aAction.SetInputType( VCL_INPUT_ANY );
             aAction.SetIdle( true );
             aAction.SetWaitAllowed( false );
-            aAction.Action();
+            aAction.Action(pImp->GetShell()->GetOut());
             bInterrupt = aAction.IsInterrupt();
         }
 
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 8fe70ac..bcec037 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3236,7 +3236,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
         aAction.SetPaint( false );
         aAction.SetComplete( false );
         aAction.SetReschedule( gProp.pSProgress != nullptr );
-        aAction.Action();
+        aAction.Action(&rRenderContext);
         ResetTurboFlag();
         if ( !pSh->ActionPend() )
             pSh->Imp()->DelRegion();
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 8cf274096..89940c6 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -283,7 +283,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
         if ( mnLockPaint )
             aAction.SetPaint( false );
         aAction.SetInputType( VclInputFlags::KEYBOARD );
-        aAction.Action();
+        aAction.Action(GetWin());
     }
 
     if ( bIsShellForCheckViewLayout )
@@ -948,7 +948,7 @@ void SwViewShell::CalcLayout()
     aAction.SetCalcLayout( true );
     aAction.SetReschedule( true );
     GetDoc()->getIDocumentFieldsAccess().LockExpFields();
-    aAction.Action();
+    aAction.Action(GetOut());
     GetDoc()->getIDocumentFieldsAccess().UnlockExpFields();
 
     //the SetNewFieldLst() on the Doc was cut off and must be fetched again
@@ -964,7 +964,7 @@ void SwViewShell::CalcLayout()
         GetDoc()->getIDocumentFieldsAccess().UpdatePageFields( &aMsgHint );
         GetDoc()->getIDocumentFieldsAccess().UpdateExpFields(NULL, true);
 
-        aAction.Action();
+        aAction.Action(GetOut());
     }
 
     if ( VisArea().HasArea() )
@@ -1596,7 +1596,7 @@ bool SwViewShell::CheckInvalidForPaint( const SwRect &rRect )
         // can't format frames which are locked by the outer action. This may
         // cause and endless loop.
         ++mnStartAction;
-        aAction.Action();
+        aAction.Action(GetWin());
         --mnStartAction;
 
         SwRegionRects *pRegion = Imp()->GetRegion();
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 8ef7cbf..c9dd0d4 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -312,7 +312,7 @@ void SwViewShell::CalcPagesForPrint( sal_uInt16 nMax )
         aAction.SetWaitAllowed( false );
         aAction.SetReschedule( true );
 
-        aAction.Action();
+        aAction.Action(GetOut());
 
         maVisArea = aOldVis; //reset due to the paints
         Imp()->SetFirstVisPageInvalid();
commit 43dbc4d63c05785b07468456beef44f8802e1597
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 12:27:54 2015 +0200

    SwLayAction::InternalAction: use vcl::RenderContext
    
    Change-Id: Icbc5e9a42cc7e7693c6584461505a3233046272c
    (cherry picked from commit 1a2705d16c945cdd85dd75c803039c05af0c853c)

diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 6977627..e85ff36 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -109,7 +109,7 @@ class SwLayAction
 
     bool TurboAction();
     bool _TurboAction( const SwContentFrm * );
-    void InternalAction();
+    void InternalAction(OutputDevice* pRenderContext);
 
     static SwPageFrm *CheckFirstVisPage( SwPageFrm *pPage );
 
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 001189f..9895e74 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -366,12 +366,12 @@ void SwLayAction::Action()
     if ( IsCalcLayout() )
         SetCheckPages( false );
 
-    InternalAction();
+    InternalAction(pImp->GetShell()->GetOut());
     bAgain |= RemoveEmptyBrowserPages();
     while ( IsAgain() )
     {
         bAgain = bNextCycle = false;
-        InternalAction();
+        InternalAction(pImp->GetShell()->GetOut());
         bAgain |= RemoveEmptyBrowserPages();
     }
     pRoot->DeleteEmptySct();
@@ -442,7 +442,7 @@ static void unlockPositionOfObjects( SwPageFrm *pPageFrm )
     }
 }
 
-void SwLayAction::InternalAction()
+void SwLayAction::InternalAction(OutputDevice* pRenderContext)
 {
     OSL_ENSURE( pRoot->Lower()->IsPageFrm(), ":-( No page below the root.");
 
@@ -454,7 +454,7 @@ void SwLayAction::InternalAction()
     // number 1.  If we're doing a fake formatting, the number of the first
     // page is the number of the first visible page.
     SwPageFrm *pPage = IsComplete() ? static_cast<SwPageFrm*>(pRoot->Lower()) :
-                pImp->GetFirstVisPage(pImp->GetShell()->GetOut());
+                pImp->GetFirstVisPage(pRenderContext);
     if ( !pPage )
         pPage = static_cast<SwPageFrm*>(pRoot->Lower());
 
@@ -621,7 +621,7 @@ void SwLayAction::InternalAction()
                     if( !IsComplete() && nPreInvaPage + 2 < nFirstPageNum )
                     {
                         pImp->SetFirstVisPageInvalid();
-                        SwPageFrm *pTmpPage = pImp->GetFirstVisPage(pImp->GetShell()->GetOut());
+                        SwPageFrm *pTmpPage = pImp->GetFirstVisPage(pRenderContext);
                         nFirstPageNum = pTmpPage->GetPhyPageNum();
                         if( nPreInvaPage < nFirstPageNum )
                         {
commit 46a8f3d3652571af0b9772e8bba7ee94f866b626
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 12:15:41 2015 +0200

    SwPageFrm::GetHorizontalShadowRect: use vcl::RenderContext
    
    Change-Id: Ife6c7404079aa1ae10d5c2bdbe77629e0689b167
    (cherry picked from commit c369f8644c45869cb1d80e5e243e445f5cb8b778)

diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 5b4f87d..99097a9 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -96,6 +96,7 @@ class SwPageFrm: public SwFootnoteBossFrm
 
     static void GetHorizontalShadowRect( const SwRect& _rPageRect,
                                      const SwViewShell*    _pViewShell,
+                                     OutputDevice* pRenderContext,
                                      SwRect&       _orBottomShadowRect,
                                      bool bPaintLeftShadow,
                                      bool bPaintRightShadow,
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index a438dc1..8fe70ac 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6028,6 +6028,7 @@ bool SwPageFrm::IsLeftShadowNeeded() const
  */
 /*static*/ void SwPageFrm::GetHorizontalShadowRect( const SwRect& _rPageRect,
                                                 const SwViewShell*    _pViewShell,
+                                                OutputDevice* pRenderContext,
                                                 SwRect&       _orHorizontalShadowRect,
                                                 bool bPaintLeftShadow,
                                                 bool bPaintRightShadow,
@@ -6035,9 +6036,8 @@ bool SwPageFrm::IsLeftShadowNeeded() const
 {
     const SwPostItMgr *pMgr = _pViewShell->GetPostItMgr();
     SwRect aAlignedPageRect( _rPageRect );
-    ::SwAlignRect( aAlignedPageRect, _pViewShell, _pViewShell->GetOut() );
-    SwRect aPagePxRect =
-            _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
+    ::SwAlignRect( aAlignedPageRect, _pViewShell, pRenderContext );
+    SwRect aPagePxRect = pRenderContext->LogicToPixel( aAlignedPageRect.SVRect() );
 
     long lShadowAdjustment = mnShadowPxWidth - 1; // TODO: extract this
 
@@ -6176,7 +6176,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
     SwRect aPaintRect;
     OutputDevice *pOut = _pViewShell->GetOut();
 
-    SwPageFrm::GetHorizontalShadowRect( _rPageRect, _pViewShell, aPaintRect, bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
+    SwPageFrm::GetHorizontalShadowRect( _rPageRect, _pViewShell, pOut, aPaintRect, bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
 
     // Right shadow & corners
     if ( bPaintRightShadow )
@@ -6385,7 +6385,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
 
     // Always ask for full shadow since we want a bounding rect
     // including at least the page frame
-    SwPageFrm::GetHorizontalShadowRect( _rPageRect, _pViewShell, aTmpRect, false, false, bRightSidebar );
+    SwPageFrm::GetHorizontalShadowRect( _rPageRect, _pViewShell, pRenderContext, aTmpRect, false, false, bRightSidebar );
 
     if(bLeftShadow) aPagePxRect.Left( aTmpRect.Left() - mnShadowPxWidth - 1);
     if(bRightShadow) aPagePxRect.Right( aTmpRect.Right() + mnShadowPxWidth + 1);
commit 5f6e5910dd96015a33bde81684a11f9cba61be2e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 12:04:26 2015 +0200

    SwViewShellImp::GetFirstVisPage: use vcl::RenderContext
    
    Change-Id: I7acd380d2e199f042dca61d95596c3bc63c6a206
    (cherry picked from commit cec17a4659389c5fe3a97c144d541c6aedc64d3f)

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index ee223b5..447ad41 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1145,7 +1145,7 @@ void SwCrsrShell::GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum,
     if( !bAtCrsrPos || 0 == (pCFrm = GetCurrFrm( bCalcFrm )) ||
                        0 == (pPg   = pCFrm->FindPageFrm()) )
     {
-        pPg = Imp()->GetFirstVisPage();
+        pPg = Imp()->GetFirstVisPage(GetOut());
         while( pPg && pPg->IsEmptyPage() )
             pPg = static_cast<const SwPageFrm *>(pPg->GetNext());
     }
@@ -1158,7 +1158,7 @@ sal_uInt16 SwCrsrShell::GetNextPrevPageNum( bool bNext )
 {
     SET_CURR_SHELL( this );
     // page number: first visible page or the one at the cursor
-    const SwPageFrm *pPg = Imp()->GetFirstVisPage();
+    const SwPageFrm *pPg = Imp()->GetFirstVisPage(GetOut());
     if( pPg )
     {
         const SwTwips nPageTop = pPg->Frm().Top();
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index fe774a1..db5707c 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -158,7 +158,7 @@ const SdrPageGridFrameList*  SwDPage::GetGridFrameList(
         else
         {
             //The drawing demands all visible pages
-            const SwFrm *pPg = pSh->Imp()->GetFirstVisPage();
+            const SwFrm *pPg = pSh->Imp()->GetFirstVisPage(pSh->GetOut());
             if ( pPg )
                 do
                 {   ::InsertGridFrame( const_cast<SwDPage*>(this)->pGridLst, pPg );
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 78d406b..1a9dfd7 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -186,7 +186,7 @@ bool SwFEShell::GetPageNumber( long nYPos, bool bAtCrsrPos, sal_uInt16& rPhyNum,
     }
     else                                // first visible page
     {
-        pPage = Imp()->GetFirstVisPage();
+        pPage = Imp()->GetFirstVisPage(GetOut());
         if ( pPage && static_cast<const SwPageFrm*>(pPage)->IsEmptyPage() )
             pPage = pPage->GetNext();
     }
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index ecfd426..3146ec3 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -146,8 +146,8 @@ public:
     Color GetRetoucheColor() const;
 
     /// Management of the first visible Page
-    const SwPageFrm *GetFirstVisPage() const;
-          SwPageFrm *GetFirstVisPage();
+    const SwPageFrm *GetFirstVisPage(OutputDevice* pRenderContext) const;
+          SwPageFrm *GetFirstVisPage(OutputDevice* pRenderContext);
     void SetFirstVisPageInvalid() { bFirstPageInvalid = true; }
 
     bool AddPaintRect( const SwRect &rRect );
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index ae068c8..001189f 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -454,7 +454,7 @@ void SwLayAction::InternalAction()
     // number 1.  If we're doing a fake formatting, the number of the first
     // page is the number of the first visible page.
     SwPageFrm *pPage = IsComplete() ? static_cast<SwPageFrm*>(pRoot->Lower()) :
-                pImp->GetFirstVisPage();
+                pImp->GetFirstVisPage(pImp->GetShell()->GetOut());
     if ( !pPage )
         pPage = static_cast<SwPageFrm*>(pRoot->Lower());
 
@@ -621,7 +621,7 @@ void SwLayAction::InternalAction()
                     if( !IsComplete() && nPreInvaPage + 2 < nFirstPageNum )
                     {
                         pImp->SetFirstVisPageInvalid();
-                        SwPageFrm *pTmpPage = pImp->GetFirstVisPage();
+                        SwPageFrm *pTmpPage = pImp->GetFirstVisPage(pImp->GetShell()->GetOut());
                         nFirstPageNum = pTmpPage->GetPhyPageNum();
                         if( nPreInvaPage < nFirstPageNum )
                         {
@@ -2037,7 +2037,7 @@ bool SwLayIdle::DoIdleJob( IdleJobType eJob, bool bVisAreaOnly )
 
     SwPageFrm *pPage;
     if ( bVisAreaOnly )
-        pPage = pImp->GetFirstVisPage();
+        pPage = pImp->GetFirstVisPage(pViewShell->GetOut());
     else
         pPage = static_cast<SwPageFrm*>(pRoot->Lower());
 
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 9e38f1e..a438dc1 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3256,7 +3256,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
     const bool bOldAction = IsCallbackActionEnabled();
     const_cast<SwRootFrm*>(this)->SetCallbackActionEnabled( false );
 
-    const SwPageFrm *pPage = pSh->Imp()->GetFirstVisPage();
+    const SwPageFrm *pPage = pSh->Imp()->GetFirstVisPage(&rRenderContext);
     if ( pPage->GetPrev() )
         pPage = static_cast<const SwPageFrm*>(pPage->GetPrev());
     const bool bBookMode = gProp.pSGlobalShell->GetViewOptions()->IsViewLayoutBookMode();
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index a7a99b6..22fe58a 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -391,7 +391,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara()
     {
         SwViewShell* pViewShell = mpDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
 
-        SwPageFrm* pCurrentPage = pViewShell ? pViewShell->Imp()->GetFirstVisPage() : 0;
+        SwPageFrm* pCurrentPage = pViewShell ? pViewShell->Imp()->GetFirstVisPage(pViewShell->GetOut()) : 0;
         SwPageFrm* pStartPage = pCurrentPage;
         SwPageFrm* pStopPage = 0;
 
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 08e0645..b3957c4 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -270,17 +270,17 @@ Color SwViewShellImp::GetRetoucheColor() const
     return aRet;
 }
 
-SwPageFrm *SwViewShellImp::GetFirstVisPage()
+SwPageFrm *SwViewShellImp::GetFirstVisPage(OutputDevice* pRenderContext)
 {
     if ( bFirstPageInvalid )
-        SetFirstVisPage(pSh->GetOut());
+        SetFirstVisPage(pRenderContext);
     return pFirstVisPage;
 }
 
-const SwPageFrm *SwViewShellImp::GetFirstVisPage() const
+const SwPageFrm *SwViewShellImp::GetFirstVisPage(OutputDevice* pRenderContext) const
 {
     if ( bFirstPageInvalid )
-        const_cast<SwViewShellImp*>(this)->SetFirstVisPage(pSh->GetOut());
+        const_cast<SwViewShellImp*>(this)->SetFirstVisPage(pRenderContext);
     return pFirstVisPage;
 }
 
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 90de53e..8cf274096 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1031,7 +1031,7 @@ void SwViewShell::VisPortChgd( const SwRect &rRect)
 
     //First get the old visible page, so we don't have to look
     //for it afterwards.
-    const SwFrm *pOldPage = Imp()->GetFirstVisPage();
+    const SwFrm *pOldPage = Imp()->GetFirstVisPage(GetWin());
 
     const SwRect aPrevArea( VisArea() );
     const bool bFull = aPrevArea.IsEmpty();
@@ -1478,7 +1478,7 @@ void SwViewShell::PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect
     }
     else
     {
-        const SwFrm *pPage = Imp()->GetFirstVisPage();
+        const SwFrm *pPage = Imp()->GetFirstVisPage(&rRenderContext);
         //Here we have to get the previous page since
         //GetFirstVisPage return the current one but
         //there is a portion of the previous page
@@ -1568,7 +1568,7 @@ bool SwViewShell::CheckInvalidForPaint( const SwRect &rRect )
     if ( !GetWin() )
         return false;
 
-    const SwPageFrm *pPage = Imp()->GetFirstVisPage();
+    const SwPageFrm *pPage = Imp()->GetFirstVisPage(GetOut());
     const SwTwips nBottom = VisArea().Bottom();
     const SwTwips nRight  = VisArea().Right();
     bool bRet = false;
commit d9369b9766fffea0b33b65713685878b2a9e579b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 11:47:46 2015 +0200

    SwViewShellImp::SetFirstVisPage: use vcl::RenderContext
    
    Change-Id: If36b6fdda54dfbe6e4eea14883d659302a1db6be
    (cherry picked from commit 85cd7a6c6883d4d80d583f13d923527ed5e72343)

diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index 205938e..ecfd426 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -89,7 +89,7 @@ class SwViewShellImp
 
     SwPagePreviewLayout* mpPgPreviewLayout;
 
-    void SetFirstVisPage();     // Recalculate the first visible Page
+    void SetFirstVisPage(OutputDevice* pRenderContext); // Recalculate the first visible Page
 
     void StartAction();         // Show handle and hide
     void EndAction();           // Called by SwViewShell::ImplXXXAction
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index c7feb10..08e0645 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -169,7 +169,7 @@ bool SwViewShellImp::IsUpdateExpFields()
     return false;
 }
 
-void SwViewShellImp::SetFirstVisPage()
+void SwViewShellImp::SetFirstVisPage(OutputDevice* pRenderContext)
 {
     if ( pSh->mbDocSizeChgd && pSh->VisArea().Top() > pSh->GetLayout()->Frm().Height() )
     {
@@ -186,18 +186,18 @@ void SwViewShellImp::SetFirstVisPage()
         const bool bBookMode = pSwViewOption->IsViewLayoutBookMode();
 
         SwPageFrm *pPage = static_cast<SwPageFrm*>(pSh->GetLayout()->Lower());
-        SwRect aPageRect = pPage->GetBoundRect(pSh->GetOut());
+        SwRect aPageRect = pPage->GetBoundRect(pRenderContext);
         float fAmount = pSh->VisArea().Height() * 0.43;
         while ( pPage && aPageRect.Bottom() < pSh->VisArea().Top() + fAmount )
         {
             pPage = static_cast<SwPageFrm*>(pPage->GetNext());
             if ( pPage )
             {
-                aPageRect = pPage->GetBoundRect(pSh->GetOut());
+                aPageRect = pPage->GetBoundRect(pRenderContext);
                 if ( bBookMode && pPage->IsEmptyPage() )
                 {
                     const SwPageFrm& rFormatPage = pPage->GetFormatPage();
-                    aPageRect.SSize() = rFormatPage.GetBoundRect(pSh->GetOut()).SSize();
+                    aPageRect.SSize() = rFormatPage.GetBoundRect(pRenderContext).SSize();
                 }
             }
         }
@@ -273,14 +273,14 @@ Color SwViewShellImp::GetRetoucheColor() const
 SwPageFrm *SwViewShellImp::GetFirstVisPage()
 {
     if ( bFirstPageInvalid )
-        SetFirstVisPage();
+        SetFirstVisPage(pSh->GetOut());
     return pFirstVisPage;
 }
 
 const SwPageFrm *SwViewShellImp::GetFirstVisPage() const
 {
     if ( bFirstPageInvalid )
-        const_cast<SwViewShellImp*>(this)->SetFirstVisPage();
+        const_cast<SwViewShellImp*>(this)->SetFirstVisPage(pSh->GetOut());
     return pFirstVisPage;
 }
 
commit c926d60ab00174ad3359c5d44fc1216a4e0c22d6
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 11:44:01 2015 +0200

    sw: outline SwViewShellImp::GetFirstVisPage() methods
    
    Change-Id: Ib506b912752a16c514958896aa16b310f8e09200
    (cherry picked from commit 7b6329479eeb3c416396404c0d371b7aab59dd64)

diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index 2028ead..205938e 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -146,8 +146,8 @@ public:
     Color GetRetoucheColor() const;
 
     /// Management of the first visible Page
-    inline const SwPageFrm *GetFirstVisPage() const;
-    inline       SwPageFrm *GetFirstVisPage();
+    const SwPageFrm *GetFirstVisPage() const;
+          SwPageFrm *GetFirstVisPage();
     void SetFirstVisPageInvalid() { bFirstPageInvalid = true; }
 
     bool AddPaintRect( const SwRect &rRect );
@@ -272,20 +272,6 @@ public:
     void FireAccessibleEvents();
 };
 
-inline SwPageFrm *SwViewShellImp::GetFirstVisPage()
-{
-    if ( bFirstPageInvalid )
-        SetFirstVisPage();
-    return pFirstVisPage;
-}
-
-inline const SwPageFrm *SwViewShellImp::GetFirstVisPage() const
-{
-    if ( bFirstPageInvalid )
-        const_cast<SwViewShellImp*>(this)->SetFirstVisPage();
-    return pFirstVisPage;
-}
-
 inline SwAccessibleMap& SwViewShellImp::GetAccessibleMap()
 {
     if( !pAccMap )
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 24629c7..c7feb10 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -270,6 +270,20 @@ Color SwViewShellImp::GetRetoucheColor() const
     return aRet;
 }
 
+SwPageFrm *SwViewShellImp::GetFirstVisPage()
+{
+    if ( bFirstPageInvalid )
+        SetFirstVisPage();
+    return pFirstVisPage;
+}
+
+const SwPageFrm *SwViewShellImp::GetFirstVisPage() const
+{
+    if ( bFirstPageInvalid )
+        const_cast<SwViewShellImp*>(this)->SetFirstVisPage();
+    return pFirstVisPage;
+}
+
 // create page preview layout
 void SwViewShellImp::InitPagePreviewLayout()
 {
commit cd2e2330914fa22df05b275d2ccd64f4e0442ffa
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 11:31:55 2015 +0200

    SwPageFrm::GetBoundRect: use vcl::RenderContext
    
    Change-Id: Id9e9aa312d8fd4e0d776b41c9cca8073fa57b6fa
    (cherry picked from commit 3b7c803b1b2f5d13f5ca225a9d4aabab348c7786)

diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 58559fd..5b4f87d 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -139,7 +139,7 @@ public:
     inline const SwContentFrm  *FindFirstBodyContent() const;
     inline const SwContentFrm  *FindLastBodyContent() const;
 
-    SwRect GetBoundRect() const;
+    SwRect GetBoundRect(OutputDevice* pOutputDevice) const;
 
     // Specialized GetContentPos() for Field in Frames
     void GetContentPosition( const Point &rPt, SwPosition &rPos ) const;
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index 1de3412..5a70d5b 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -640,7 +640,7 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const
                 // Exclude margins.
                 aPageRect = GetPageFrm()->Prt().SVRect();
             else
-                aPageRect = GetPageFrm( )->GetBoundRect( ).SVRect();
+                aPageRect = GetPageFrm( )->GetBoundRect( GetPageFrm()->getRootFrm()->GetCurrShell()->GetOut() ).SVRect();
             nTargetWidth = aPageRect.GetWidth( ) * (*GetDrawObj( )->GetRelativeWidth());
         }
 
@@ -652,7 +652,7 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const
                 // Exclude margins.
                 aPageRect = GetPageFrm()->Prt().SVRect();
             else
-                aPageRect = GetPageFrm( )->GetBoundRect( ).SVRect();
+                aPageRect = GetPageFrm( )->GetBoundRect( GetPageFrm()->getRootFrm()->GetCurrShell()->GetOut() ).SVRect();
             nTargetHeight = aPageRect.GetHeight( ) * (*GetDrawObj( )->GetRelativeHeight());
         }
 
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index efb23c9..ae068c8 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1236,7 +1236,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
         SwRect aOldRect( aOldFrame );
         if( pLay->IsPageFrm() )
         {
-            aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect();
+            aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pLay->getRootFrm()->GetCurrShell()->GetOut());
         }
 
         pLay->Calc();
@@ -1264,7 +1264,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
             if ( pLay->IsPageFrm() )
             {
                 SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay);
-                aPaint = pPageFrm->GetBoundRect();
+                aPaint = pPageFrm->GetBoundRect(pPageFrm->getRootFrm()->GetCurrShell()->GetOut());
             }
 
             bool bPageInBrowseMode = pLay->IsPageFrm();
@@ -1413,7 +1413,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
     // OD 11.11.2002 #104414# - add complete frame area as paint area, if frame
     // area has been already added and after formatting its lowers the frame area
     // is enlarged.
-    SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect() : pLay->Frm() );
+    SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect(pLay->getRootFrm()->GetCurrShell()->GetOut()) : pLay->Frm() );
 
     if ( bAlreadyPainted &&
          ( aBoundRect.Width() > aFrmAtCompletePaint.Width() ||
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 784627b..9e38f1e 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6393,7 +6393,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
     _orBorderAndShadowBoundRect = pRenderContext->PixelToLogic( aPagePxRect.SVRect() );
 }
 
-SwRect SwPageFrm::GetBoundRect() const
+SwRect SwPageFrm::GetBoundRect(OutputDevice* pOutputDevice) const
 {
     const SwViewShell *pSh = getRootFrm()->GetCurrShell();
     SwRect aPageRect( Frm() );
@@ -6403,7 +6403,7 @@ SwRect SwPageFrm::GetBoundRect() const
         return SwRect( Point(0, 0), Size(0, 0) );
     }
 
-    SwPageFrm::GetBorderAndShadowBoundRect( aPageRect, pSh, pSh->GetOut(), aResult,
+    SwPageFrm::GetBorderAndShadowBoundRect( aPageRect, pSh, pOutputDevice, aResult,
         IsLeftShadowNeeded(), IsRightShadowNeeded(), SidebarPosition() ==  sw::sidebarwindows::SidebarPosition::RIGHT );
     return aResult;
 }
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 6f9068a..24629c7 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -186,18 +186,18 @@ void SwViewShellImp::SetFirstVisPage()
         const bool bBookMode = pSwViewOption->IsViewLayoutBookMode();
 
         SwPageFrm *pPage = static_cast<SwPageFrm*>(pSh->GetLayout()->Lower());
-        SwRect aPageRect = pPage->GetBoundRect();
+        SwRect aPageRect = pPage->GetBoundRect(pSh->GetOut());
         float fAmount = pSh->VisArea().Height() * 0.43;
         while ( pPage && aPageRect.Bottom() < pSh->VisArea().Top() + fAmount )
         {
             pPage = static_cast<SwPageFrm*>(pPage->GetNext());
             if ( pPage )
             {
-                aPageRect = pPage->GetBoundRect();
+                aPageRect = pPage->GetBoundRect(pSh->GetOut());
                 if ( bBookMode && pPage->IsEmptyPage() )
                 {
                     const SwPageFrm& rFormatPage = pPage->GetFormatPage();
-                    aPageRect.SSize() = rFormatPage.GetBoundRect().SSize();
+                    aPageRect.SSize() = rFormatPage.GetBoundRect(pSh->GetOut()).SSize();
                 }
             }
         }
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 5825a62..90de53e 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1078,11 +1078,11 @@ void SwViewShell::VisPortChgd( const SwRect &rRect)
 
             while ( pPage && pPage->Frm().Top() <= nBottom )
             {
-                SwRect aPageRect( pPage->GetBoundRect() );
+                SwRect aPageRect( pPage->GetBoundRect(GetWin()) );
                 if ( bBookMode )
                 {
                     const SwPageFrm& rFormatPage = static_cast<const SwPageFrm*>(pPage)->GetFormatPage();
-                    aPageRect.SSize() = rFormatPage.GetBoundRect().SSize();
+                    aPageRect.SSize() = rFormatPage.GetBoundRect(GetWin()).SSize();
                 }
 
                 // OD 12.02.2003 #i9719#, #105645# - consider new border and shadow width
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index db26491..a9b020f 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -340,7 +340,7 @@ void SwPageBreakWin::UpdatePosition( const Point* pEvtPt )
     while ( pPrevPage && ( ( pPrevPage->Frm().Top( ) == pPageFrm->Frm().Top( ) )
                 || static_cast< const SwPageFrm* >( pPrevPage )->IsEmptyPage( ) ) );
 
-    Rectangle aBoundRect = GetEditWin()->LogicToPixel( pPageFrm->GetBoundRect().SVRect() );
+    Rectangle aBoundRect = GetEditWin()->LogicToPixel( pPageFrm->GetBoundRect(GetEditWin()).SVRect() );
     Rectangle aFrmRect = GetEditWin()->LogicToPixel( pPageFrm->Frm().SVRect() );
 
     long nYLineOffset = ( aBoundRect.Top() + aFrmRect.Top() ) / 2;
commit 56422fa26e3b3116b283628e0782ab4bc592f886
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 11:18:01 2015 +0200

    SwPageFrm::GetBorderAndShadowBoundRect: use vcl::RenderContext
    
    Change-Id: If861aa0a579eb953cd2fc7b790b3514ab1d0ffd0
    (cherry picked from commit d7dd8bb3bdd0fee44d6704cbf34d4a39cd7a3d29)

diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 1023bee..58559fd 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -300,6 +300,7 @@ public:
     */
     static void GetBorderAndShadowBoundRect( const SwRect& _rPageRect,
                                              const SwViewShell*    _pViewShell,
+                                             OutputDevice* pRenderContext,
                                              SwRect& _orBorderAndShadowBoundRect,
                                              const bool bLeftShadow,
                                              const bool bRightShadow,
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 4c61de4..efb23c9 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1320,6 +1320,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
                 if(pSh)
                 {
                     SwPageFrm::GetBorderAndShadowBoundRect(aPageRect, pSh,
+                        pSh->GetOut(),
                         aPageRect, pPageFrm->IsLeftShadowNeeded(), pPageFrm->IsRightShadowNeeded(),
                         pPageFrm->SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT);
                 }
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 4dd76a0..933ef1d 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -259,7 +259,7 @@ void SwPageFrm::DestroyImpl()
                 // including border and shadow area.
                 const bool bRightSidebar = (SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT);
                 SwRect aRetoucheRect;
-                SwPageFrm::GetBorderAndShadowBoundRect( Frm(), pSh, aRetoucheRect, IsLeftShadowNeeded(), IsRightShadowNeeded(), bRightSidebar );
+                SwPageFrm::GetBorderAndShadowBoundRect( Frm(), pSh, pSh->GetOut(), aRetoucheRect, IsLeftShadowNeeded(), IsRightShadowNeeded(), bRightSidebar );
                 pSh->AddPaintRect( aRetoucheRect );
             }
         }
@@ -622,7 +622,7 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
                 // page frame for determine 'old' rectangle - it's used for invalidating.
                 const bool bRightSidebar = (SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT);
                 SwRect aOldRectWithBorderAndShadow;
-                SwPageFrm::GetBorderAndShadowBoundRect( aOldPageFrmRect, pSh, aOldRectWithBorderAndShadow,
+                SwPageFrm::GetBorderAndShadowBoundRect( aOldPageFrmRect, pSh, pSh->GetOut(), aOldRectWithBorderAndShadow,
                     IsLeftShadowNeeded(), IsRightShadowNeeded(), bRightSidebar );
                 pSh->InvalidateWindows( aOldRectWithBorderAndShadow );
             }
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index beec5b1..784627b 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3294,7 +3294,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
         if ( !pPage->IsEmptyPage() )
         {
             SwRect aPaintRect;
-            SwPageFrm::GetBorderAndShadowBoundRect( pPage->Frm(), pSh, aPaintRect,
+            SwPageFrm::GetBorderAndShadowBoundRect( pPage->Frm(), pSh, &rRenderContext, aPaintRect,
                 bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
 
             if ( aRect.IsOver( aPaintRect ) )
@@ -3458,7 +3458,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
             const SwPageFrm& rFormatPage = pPage->GetFormatPage();
             aEmptyPageRect.SSize() = rFormatPage.Frm().SSize();
 
-            SwPageFrm::GetBorderAndShadowBoundRect( aEmptyPageRect, pSh, aPaintRect,
+            SwPageFrm::GetBorderAndShadowBoundRect( aEmptyPageRect, pSh, &rRenderContext, aPaintRect,
                 bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
             aPaintRect._Intersection( aRect );
 
@@ -6368,6 +6368,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
  */
 /*static*/ void SwPageFrm::GetBorderAndShadowBoundRect( const SwRect& _rPageRect,
                                                         const SwViewShell*    _pViewShell,
+                                                        OutputDevice* pRenderContext,
                                                         SwRect& _orBorderAndShadowBoundRect,
                                                         bool bLeftShadow,
                                                         bool bRightShadow,
@@ -6375,9 +6376,8 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
                                                       )
 {
     SwRect aAlignedPageRect( _rPageRect );
-    ::SwAlignRect( aAlignedPageRect, _pViewShell, _pViewShell->GetOut() );
-    SwRect aPagePxRect =
-            _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
+    ::SwAlignRect( aAlignedPageRect, _pViewShell, pRenderContext );
+    SwRect aPagePxRect = pRenderContext->LogicToPixel( aAlignedPageRect.SVRect() );
     aPagePxRect.Bottom( aPagePxRect.Bottom() + mnShadowPxWidth + 1 );
     aPagePxRect.Top( aPagePxRect.Top() - mnShadowPxWidth - 1 );
 
@@ -6390,7 +6390,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
     if(bLeftShadow) aPagePxRect.Left( aTmpRect.Left() - mnShadowPxWidth - 1);
     if(bRightShadow) aPagePxRect.Right( aTmpRect.Right() + mnShadowPxWidth + 1);
 
-    _orBorderAndShadowBoundRect = _pViewShell->GetOut()->PixelToLogic( aPagePxRect.SVRect() );
+    _orBorderAndShadowBoundRect = pRenderContext->PixelToLogic( aPagePxRect.SVRect() );
 }
 
 SwRect SwPageFrm::GetBoundRect() const
@@ -6403,7 +6403,7 @@ SwRect SwPageFrm::GetBoundRect() const
         return SwRect( Point(0, 0), Size(0, 0) );
     }
 
-    SwPageFrm::GetBorderAndShadowBoundRect( aPageRect, pSh, aResult,
+    SwPageFrm::GetBorderAndShadowBoundRect( aPageRect, pSh, pSh->GetOut(), aResult,
         IsLeftShadowNeeded(), IsRightShadowNeeded(), SidebarPosition() ==  sw::sidebarwindows::SidebarPosition::RIGHT );
     return aResult;
 }
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index b8bb276..e24f1c0 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1100,7 +1100,7 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan
                 // paint page border and shadow
                 {
                     SwRect aPageBorderRect;
-                    SwPageFrm::GetBorderAndShadowBoundRect( SwRect( aPageRect ), &mrParentViewShell, aPageBorderRect,
+                    SwPageFrm::GetBorderAndShadowBoundRect( SwRect( aPageRect ), &mrParentViewShell, &rRenderContext, aPageBorderRect,
                         (*aPageIter)->pPage->IsLeftShadowNeeded(), (*aPageIter)->pPage->IsRightShadowNeeded(), true );
                     const vcl::Region aDLRegion(aPageBorderRect.SVRect());
                     mrParentViewShell.DLPrePaint2(aDLRegion);
commit 804e5dc4c02cfafd8a469aa54c60a30d4cd2ad62
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 09:53:02 2015 +0200

    SwAlignRect: use vcl::RenderContext
    
    If the caller has a vcl::RenderContext already, use it. Otherwise just
    use GetOut() on the shell in the caller for now.
    
    (cherry picked from commit 702cb2b28431d4acec302af20169fbb447a2980a)
    
    Conflicts:
    	sw/source/core/crsr/viscrs.cxx
    
    Change-Id: I8070dd3d6622d211885067514d6eb728716830ee

diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index c3d591c..3e92ce5 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -167,7 +167,7 @@ void SwVisCrsr::_SetPosAndShow()
     if( aRect.Height() )
     {
         ::SwCalcPixStatics( m_pCrsrShell->GetOut() );
-        ::SwAlignRect( aRect, (SwViewShell*)m_pCrsrShell );
+        ::SwAlignRect( aRect, static_cast<SwViewShell const *>(m_pCrsrShell), m_pCrsrShell->GetOut() );
     }
     if( !m_pCrsrShell->IsOverwriteCrsr() || m_bIsDragCrsr ||
         m_pCrsrShell->IsSelection() )
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 4cd00c5..f72d7c7 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -848,7 +848,7 @@ void SwNoTextFrm::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfArea
     //     Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
     //     the following code.
     SwRect aAlignedGrfArea = rGrfArea;
-    ::SwAlignRect( aAlignedGrfArea,  pShell );
+    ::SwAlignRect( aAlignedGrfArea,  pShell, pOut );
 
     if( !bIsChart )
     {
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index cc86fdc..23a2226 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -79,7 +79,7 @@ void paintGraphicUsingPrimitivesHelper(
 
 // method to align rectangle.
 // Created declaration here to avoid <extern> declarations
-void SwAlignRect( SwRect &rRect, const SwViewShell *pSh );
+void SwAlignRect( SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext* pRenderContext );
 
 // method to align graphic rectangle
 // Created declaration here to avoid <extern> declarations
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 3aff68a..beec5b1 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1234,7 +1234,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
  * that the border "leaves its original pixel", if it has to
  * No prior adjustments for odd relation between pixel and twip
  */
-void SwAlignRect( SwRect &rRect, const SwViewShell *pSh )
+void SwAlignRect( SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext* pRenderContext )
 {
     if( !rRect.HasArea() )
         return;
@@ -1248,7 +1248,7 @@ void SwAlignRect( SwRect &rRect, const SwViewShell *pSh )
     }
 
     const vcl::RenderContext *pOut = gProp.bSFlyMetafile ?
-                        gProp.pSFlyMetafileOut.get() : pSh->GetOut();
+                        gProp.pSFlyMetafileOut.get() : pRenderContext;
 
     // Hold original rectangle in pixel
     const Rectangle aOrgPxRect = pOut->LogicToPixel( rRect.SVRect() );
@@ -1509,7 +1509,7 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
         }
     }
 
-    ::SwAlignRect( rRect, properties.pSGlobalShell );
+    ::SwAlignRect( rRect, properties.pSGlobalShell, properties.pSGlobalShell->GetOut() );
 }
 
 /**
@@ -1825,7 +1825,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, vcl::RenderContext *pOu
     // Calculate align rectangle from parameter <rGrf> and use aligned
     // rectangle <aAlignedGrfRect> in the following code
     SwRect aAlignedGrfRect = rGrf;
-    ::SwAlignRect( aAlignedGrfRect, &rSh );
+    ::SwAlignRect( aAlignedGrfRect, &rSh, pOut );
 
     // Change type from <bool> to <bool>.
     const bool bNotInside = bClip && !rOut.IsInside( aAlignedGrfRect );
@@ -2076,7 +2076,7 @@ void DrawGraphic(
             GraphicObject* pGraphicObj = const_cast< GraphicObject* >(pBrush->GetGraphicObject());
             // calculate aligned paint rectangle
             SwRect aAlignedPaintRect = rOut;
-            ::SwAlignRect( aAlignedPaintRect, &rSh );
+            ::SwAlignRect( aAlignedPaintRect, &rSh, pOutDev );
             // draw background color for aligned paint rectangle
             lcl_DrawGraphicBackgrd( *pBrush, pOutDev, aAlignedPaintRect, *pGraphicObj, bGrfNum, gProp );
 
@@ -2586,7 +2586,7 @@ void SwTabFrmPainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) const
     SwRect aUpper( pUpper->Prt() );
     aUpper.Pos() += pUpper->Frm().Pos();
     SwRect aUpperAligned( aUpper );
-    ::SwAlignRect( aUpperAligned, gProp.pSGlobalShell );
+    ::SwAlignRect( aUpperAligned, gProp.pSGlobalShell, &rDev );
 
     while ( true )
     {
@@ -3478,7 +3478,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
                 // OD 20.02.2003 #107369# - use aligned page rectangle
                 {
                     SwRect aTmpPageRect( aEmptyPageRect );
-                    ::SwAlignRect( aTmpPageRect, pSh );
+                    ::SwAlignRect( aTmpPageRect, pSh, &rRenderContext );
                     aEmptyPageRect = aTmpPageRect;
                 }
 
@@ -5072,7 +5072,7 @@ void PaintCharacterBorder(
     const bool bJoinWithNext )
 {
     SwRect aAlignedRect(rPaintArea);
-    SwAlignRect(aAlignedRect, gProp.pSGlobalShell);
+    SwAlignRect(aAlignedRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut());
 
     bool bTop = true;
     bool bBottom = true;
@@ -5467,7 +5467,7 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
         //happen, that some parts won't be processed.
         SwRect aRect( Prt() );
         aRect += Frm().Pos();
-        ::SwAlignRect( aRect, gProp.pSGlobalShell );
+        ::SwAlignRect( aRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
         // OD 27.09.2002 #103636# - new local boolean variable in order to
         // suspend border paint under special cases - see below.
         // NOTE: This is a fix for the implementation of feature #99657#.
@@ -6035,7 +6035,7 @@ bool SwPageFrm::IsLeftShadowNeeded() const
 {
     const SwPostItMgr *pMgr = _pViewShell->GetPostItMgr();
     SwRect aAlignedPageRect( _rPageRect );
-    ::SwAlignRect( aAlignedPageRect, _pViewShell );
+    ::SwAlignRect( aAlignedPageRect, _pViewShell, _pViewShell->GetOut() );
     SwRect aPagePxRect =
             _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
 
@@ -6125,7 +6125,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
     static Color aShadowColor( COL_AUTO );
 
     SwRect aAlignedPageRect( _rPageRect );
-    ::SwAlignRect( aAlignedPageRect, _pViewShell );
+    ::SwAlignRect( aAlignedPageRect, _pViewShell, _pViewShell->GetOut() );
     SwRect aPagePxRect = _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
 
     if (aShadowColor != SwViewOption::GetShadowColor())
@@ -6253,7 +6253,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
         return;
 
     SwRect aPageRect( _rPageRect );
-    SwAlignRect( aPageRect, _pViewShell );
+    SwAlignRect( aPageRect, _pViewShell, _pViewShell->GetOut() );
 
     const SwPostItMgr *pMgr = _pViewShell->GetPostItMgr();
     if (pMgr && pMgr->ShowNotes() && pMgr->HasNotes())  // do not show anything in print preview
@@ -6375,7 +6375,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
                                                       )
 {
     SwRect aAlignedPageRect( _rPageRect );
-    ::SwAlignRect( aAlignedPageRect, _pViewShell );
+    ::SwAlignRect( aAlignedPageRect, _pViewShell, _pViewShell->GetOut() );
     SwRect aPagePxRect =
             _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
     aPagePxRect.Bottom( aPagePxRect.Bottom() + mnShadowPxWidth + 1 );
@@ -6565,7 +6565,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
                  (IsTextFrm() && Prt().SSize() == Frm().SSize()) )
             {
                 aRect = Frm();
-                ::SwAlignRect( aRect, gProp.pSGlobalShell );
+                ::SwAlignRect( aRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
             }
             else
             {
@@ -6641,7 +6641,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
                     {
                         if (1 < aRegion.size())
                         {
-                            ::SwAlignRect( aRegion[i], gProp.pSGlobalShell );
+                            ::SwAlignRect( aRegion[i], gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
                             if( !aRegion[i].HasArea() )
                               continue;
                         }
@@ -7043,7 +7043,7 @@ void SwColumnFrm::PaintSubsidiaryLines( const SwPageFrm *,
     if ( pFootnoteCont )
         aArea.AddBottom( pFootnoteCont->Frm().Bottom() - aArea.Bottom() );
 
-    ::SwAlignRect( aArea, gProp.pSGlobalShell );
+    ::SwAlignRect( aArea, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
 
     if ( !gProp.pSGlobalShell->GetViewOptions()->IsViewMetaChars( ) )
         ProcessPrimitives( lcl_CreateColumnAreaDelimiterPrimitives( aArea ) );
@@ -7133,7 +7133,7 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
     if ( !bUseFrmArea )
         aOriginal.Pos() += Frm().Pos();
 
-    ::SwAlignRect( aOriginal, gProp.pSGlobalShell );
+    ::SwAlignRect( aOriginal, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
 
     if ( !aOriginal.IsOver( rRect ) )
         return;
@@ -7235,7 +7235,7 @@ void SwPageFrm::RefreshExtraData( const SwRect &rRect ) const
         || (sal_Int16)SW_MOD()->GetRedlineMarkPos() != text::HoriOrientation::NONE;
 
     SwRect aRect( rRect );
-    ::SwAlignRect( aRect, gProp.pSGlobalShell );
+    ::SwAlignRect( aRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
     if ( aRect.HasArea() )
     {
         SwLayoutFrm::RefreshExtraData( aRect );
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index e07a40b..861f412 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -766,7 +766,7 @@ void SwTextPaintInfo::CalcRect( const SwLinePortion& rPor,
 
     if( aRect.HasArea() && pIntersect )
     {
-        ::SwAlignRect( aRect, GetVsh() );
+        ::SwAlignRect( aRect, GetVsh(), GetOut() );
 
         if ( GetOut()->IsClipRegion() )
         {
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index ed33e4c..ba48288 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -625,7 +625,7 @@ void SwTextFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
                     // #i68520#
                     SwRect aFly( pAnchoredObjTmp->GetObjRect() );
                     // OD 24.01.2003 #106593#
-                    ::SwAlignRect( aFly, pPage->getRootFrm()->GetCurrShell() );
+                    ::SwAlignRect( aFly, pPage->getRootFrm()->GetCurrShell(), pOut );
                     if( aFly.Width() > 0 && aFly.Height() > 0 )
                         aRegion -= aFly;
                 }
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 02c2af9..b8bb276 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1073,7 +1073,7 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan
                 // OD 20.02.2003 #107369# - use aligned page rectangle
                 {
                     SwRect aTmpPageRect( aPageRect );
-                    ::SwAlignRect( aTmpPageRect, &mrParentViewShell);
+                    ::SwAlignRect( aTmpPageRect, &mrParentViewShell, &rRenderContext );
                     aPageRect = aTmpPageRect.SVRect();
                 }
                 pOutputDev->DrawRect( aPageRect );
@@ -1226,7 +1226,7 @@ void SwPagePreviewLayout::_PaintSelectMarkAtPage(
                          _aSelectedPreviewPage->aPageSize );
     // OD 19.02.2003 #107369# - use aligned page rectangle, as it is used for
     // page border and shadow paint - see <SwPageFrm::PaintBorderAndShadow(..)>
-    ::SwAlignRect( aPageRect, &mrParentViewShell);
+    ::SwAlignRect( aPageRect, &mrParentViewShell, pOutputDev );
     Rectangle aPxPageRect = pOutputDev->LogicToPixel( aPageRect.SVRect() );
 
     // draw two rectangle
@@ -1271,8 +1271,8 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
         // OD 20.02.2003 #107369# - invalidate only areas of selection mark.
         SwRect aPageRect( pOldSelectedPreviewPage->aPreviewWinPos,
                               pOldSelectedPreviewPage->aPageSize );
-        ::SwAlignRect( aPageRect, &mrParentViewShell);
         OutputDevice* pOutputDev = mrParentViewShell.GetOut();
+        ::SwAlignRect( aPageRect, &mrParentViewShell, pOutputDev );
         Rectangle aPxPageRect = pOutputDev->LogicToPixel( aPageRect.SVRect() );
         // invalidate top mark line
         Rectangle aInvalPxRect( aPxPageRect.Left(), aPxPageRect.Top(),
commit cfa21cc3664ce3b6588c9d2090851c4bdf28ca0b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 09:52:35 2015 +0200

    SwTabFrm::Paint: use vcl::RenderContext
    
    Change-Id: Iccadf6cd95a0ed9f9ba365d117d819f065193e60
    (cherry picked from commit 5cfc0e3899b51fd2751141d7f1f523803f46c8d1)

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index b83a997..3aff68a 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4385,7 +4385,7 @@ void SwTabFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, Sw
             }
 
             SwTabFrmPainter aHelper(*this);
-            aHelper.PaintLines(*gProp.pSGlobalShell->GetOut(), rRect);
+            aHelper.PaintLines(rRenderContext, rRect);
         }
 
         SwLayoutFrm::Paint( rRenderContext, rRect );
@@ -4398,7 +4398,7 @@ void SwTabFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, Sw
         aTabRect.Pos() += Frm().Pos();
         SwRect aTabOutRect( rRect );
         aTabOutRect.Intersection( aTabRect );
-        SwViewOption::DrawRect( gProp.pSGlobalShell->GetOut(), aTabOutRect, COL_LIGHTGRAY );
+        SwViewOption::DrawRect( &rRenderContext, aTabOutRect, COL_LIGHTGRAY );
     }
     const_cast<SwTabFrm*>(this)->ResetComplete();
 }
commit 5f33669d6f85ec525b6cdb69240429b051e25154
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jun 25 09:47:21 2015 +0200

    SwFlyFrm::Paint: use vcl::RenderContext
    
    Change-Id: Id6bd21deda59a6eecfff39907d967b78b881a1e6
    (cherry picked from commit 74768909b7aad4ac0f23e3210ea97f9dcd1fc93d)

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 809a24d..b83a997 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4134,9 +4134,8 @@ void SwFlyFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, Sw
     SwRect aRect( rRect );
     aRect._Intersection( Frm() );
 
-    OutputDevice* pOut = gProp.pSGlobalShell->GetOut();
-    pOut->Push( PushFlags::CLIPREGION );
-    pOut->SetClipRegion();
+    rRenderContext.Push( PushFlags::CLIPREGION );
+    rRenderContext.SetClipRegion();
     const SwPageFrm* pPage = FindPageFrm();
 
     const SwNoTextFrm *pNoText = Lower() && Lower()->IsNoTextFrm()
@@ -4239,8 +4238,8 @@ void SwFlyFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, Sw
             //one.
 
             // OD 2004-04-23 #116347#
-            pOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
-            pOut->SetLineColor();
+            rRenderContext.Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
+            rRenderContext.SetLineColor();
 
             pPage = FindPageFrm();
 
@@ -4263,20 +4262,20 @@ void SwFlyFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, Sw
                 }
                 if ( bContour )
                 {
-                    pOut->Push();
+                    rRenderContext.Push();
                     // #i80822#
                     // apply clip region under the same conditions, which are
                     // used in <SwNoTextFrm::Paint(..)> to set the clip region
                     // for painting the graphic/OLE. Thus, the clip region is
                     // also applied for the PDF export.
                     SwViewShell *pSh = getRootFrm()->GetCurrShell();
-                    if ( !pOut->GetConnectMetaFile() || !pSh || !pSh->GetWin() )
+                    if ( !rRenderContext.GetConnectMetaFile() || !pSh || !pSh->GetWin() )
                     {
-                        pOut->SetClipRegion(vcl::Region(aPoly));
+                        rRenderContext.SetClipRegion(vcl::Region(aPoly));
                     }
                     for ( size_t i = 0; i < aRegion.size(); ++i )
                         PaintBackground( aRegion[i], pPage, rAttrs, false, true );
-                    pOut->Pop();
+                    rRenderContext.Pop();
                 }
                 else
                     for ( size_t i = 0; i < aRegion.size(); ++i )
@@ -4290,7 +4289,7 @@ void SwFlyFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, Sw
                 PaintBorder( aTmp, pPage, rAttrs );
             }
 
-            pOut->Pop();
+            rRenderContext.Pop();
         }
     }
 
@@ -4330,8 +4329,8 @@ void SwFlyFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, Sw
         // Add subsidiary lines of fly frame and its lowers
         RefreshLaySubsidiary( pPage, aRect );
         // paint subsidiary lines of fly frame and its lowers
-        gProp.pSSpecSubsLines->PaintSubsidiary( pOut, NULL, gProp );
-        gProp.pSSubsLines->PaintSubsidiary( pOut, gProp.pSLines, gProp );
+        gProp.pSSpecSubsLines->PaintSubsidiary( &rRenderContext, NULL, gProp );
+        gProp.pSSubsLines->PaintSubsidiary( &rRenderContext, gProp.pSLines, gProp );
         if ( !bSubsLineRectsCreated )
             // unlock subsidiary lines
             gProp.pSSubsLines->LockLines( false );
@@ -4355,12 +4354,12 @@ void SwFlyFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, Sw
 
     // OD 19.12.2002 #106318# - first paint lines added by fly frame paint
     // and then unlock other lines.
-    gProp.pSLines->PaintLines( pOut, gProp );
+    gProp.pSLines->PaintLines( &rRenderContext, gProp );
     gProp.pSLines->LockLines( false );
     // have to paint frame borders added in heaven layer here...
     ProcessPrimitives(gProp.pBLines->GetBorderLines_Clear());
 
-    pOut->Pop();
+    rRenderContext.Pop();
 
     if ( gProp.pSProgress && pNoText )
         gProp.pSProgress->Reschedule();


More information about the Libreoffice-commits mailing list