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

Miklos Vajna vmiklos at collabora.co.uk
Thu Jun 25 00:36:41 PDT 2015


 sw/inc/viewsh.hxx                  |    8 +++++++-
 sw/source/core/doc/notxtfrm.cxx    |   21 ++++++++++-----------
 sw/source/core/draw/dflyobj.cxx    |    2 +-
 sw/source/core/inc/cellfrm.hxx     |    2 +-
 sw/source/core/inc/flyfrm.hxx      |    2 +-
 sw/source/core/inc/frame.hxx       |    2 +-
 sw/source/core/inc/layfrm.hxx      |    2 +-
 sw/source/core/inc/notxtfrm.hxx    |    2 +-
 sw/source/core/inc/rootfrm.hxx     |    2 +-
 sw/source/core/inc/tabfrm.hxx      |    2 +-
 sw/source/core/inc/txtfrm.hxx      |    2 +-
 sw/source/core/layout/paintfrm.cxx |   26 ++++++++++++--------------
 sw/source/core/layout/unusedf.cxx  |    2 +-
 sw/source/core/text/frmpaint.cxx   |    6 +++---
 sw/source/core/text/porfly.cxx     |    2 +-
 sw/source/core/view/viewpg.cxx     |    2 +-
 sw/source/core/view/viewsh.cxx     |   30 ++++++++++++++++++++----------
 sw/source/core/view/vnew.cxx       |    2 ++
 sw/source/core/view/vprint.cxx     |   16 ++++++++--------
 sw/source/uibase/app/docsh.cxx     |    2 +-
 sw/source/uibase/docvw/edtwin2.cxx |    4 ++++
 21 files changed, 79 insertions(+), 60 deletions(-)

New commits:
commit 793cf067532865a728b74d213e567c4d1f196a84
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jun 24 13:13:41 2015 +0200

    SwLayoutFrm::Paint: use vcl::RenderContext
    
    Change-Id: Ibc36078313a9ee2482e392de18abfe77f3d0df48
    (cherry picked from commit f640893b8ca6dc8f390dc128ad252693c7d241d9)

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index d0e298a..809a24d 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3587,11 +3587,9 @@ SwShortCut::SwShortCut( const SwFrm& rFrm, const SwRect& rRect )
 
 void SwLayoutFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const) const
 {
-    SwViewShell *pSh = getRootFrm()->GetCurrShell();
-
     // #i16816# tagged pdf support
     Frm_Info aFrmInfo( *this );
-    SwTaggedPDFHelper aTaggedPDFHelper( 0, &aFrmInfo, 0, *pSh->GetOut() );
+    SwTaggedPDFHelper aTaggedPDFHelper( 0, &aFrmInfo, 0, rRenderContext );
 
     const SwFrm *pFrm = Lower();
     if ( !pFrm )
commit 3261bebe2f809866d698092b3292afbbc5e8b543
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jun 24 13:12:08 2015 +0200

    SwTextFrm::Paint: use vcl::RenderContext
    
    Change-Id: Iede5ae0269a2bb2e4f2e6cef4af50d57e200938d
    (cherry picked from commit c4270080798881bdac8392814dfb530e6a974c1e)

diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index f47dfa3..22ddbd7 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -575,7 +575,7 @@ bool SwTextFrm::PaintEmpty( const SwRect &rRect, bool bCheck ) const
     return false;
 }
 
-void SwTextFrm::Paint(vcl::RenderContext& /*rRenderContext*/, SwRect const& rRect, SwPrintData const*const) const
+void SwTextFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const) const
 {
     ResetRepaint();
 
@@ -583,10 +583,10 @@ void SwTextFrm::Paint(vcl::RenderContext& /*rRenderContext*/, SwRect const& rRec
     SwViewShell *pSh = getRootFrm()->GetCurrShell();
 
     Num_Info aNumInfo( *this );
-    SwTaggedPDFHelper aTaggedPDFHelperNumbering( &aNumInfo, 0, 0, *pSh->GetOut() );
+    SwTaggedPDFHelper aTaggedPDFHelperNumbering( &aNumInfo, 0, 0, rRenderContext );
 
     Frm_Info aFrmInfo( *this );
-    SwTaggedPDFHelper aTaggedPDFHelperParagraph( 0, &aFrmInfo, 0, *pSh->GetOut() );
+    SwTaggedPDFHelper aTaggedPDFHelperParagraph( 0, &aFrmInfo, 0, rRenderContext );
 
     if( !IsEmpty() || !PaintEmpty( rRect, true ) )
     {
commit 048ad22dba4ee9c62458a2d9560f9b7f24a43510
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jun 24 11:38:34 2015 +0200

    sw: add SwViewShell::mbOutputToWindow
    
    So that we can know if the output is a virtual device that will end up
    on the screen (due to double buffering) or a "real" virtual device.
    
    Change-Id: I1e8eeddfb19c374363b98786c26836e1f3236e7f
    (cherry picked from commit f2c84d410cf6df3bb3725d2495e3b6b60b2cf17b)

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 4bb296fc..5f7a9ce 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -199,6 +199,9 @@ protected:
 
     bool mbInLibreOfficeKitCallback;
 
+    /// The virtual device we paint to will end up on the screen.
+    bool mbOutputToWindow;
+
 public:
     TYPEINFO();
 
@@ -587,6 +590,9 @@ public:
     /// Are we doing tiled rendering?
     bool isTiledRendering() const;
 
+    void setOutputToWindow(bool bOutputToWindow);
+    bool isOutputToWindow() const;
+
 };
 
 // manages global ShellPointer
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 93dbef5..4cd00c5 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -935,7 +935,7 @@ void SwNoTextFrm::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfArea
                         pVout = 0;
 
                     OSL_ENSURE( OUTDEV_VIRDEV != pOut->GetOutDevType() ||
-                            pShell->GetViewOptions()->IsPDFExport(),
+                            pShell->GetViewOptions()->IsPDFExport() || pShell->isOutputToWindow(),
                             "pOut should not be a virtual device" );
 
                     pGrfNd->StartGraphicAnimation(pOut, aAlignedGrfArea.Pos(),
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 1414473..5825a62 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -139,6 +139,16 @@ bool SwViewShell::isTiledRendering() const
     return getIDocumentDrawModelAccess()->GetDrawModel()->isTiledRendering();
 }
 
+void SwViewShell::setOutputToWindow(bool bOutputToWindow)
+{
+    mbOutputToWindow = bOutputToWindow;
+}
+
+bool SwViewShell::isOutputToWindow() const
+{
+    return mbOutputToWindow;
+}
+
 static void
 lcl_PaintTransparentFormControls(SwViewShell & rShell, SwRect const& rRect)
 {
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 1c436df..301dc8d 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -170,6 +170,7 @@ SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow,
     mnLockPaint( 0 ),
     mbSelectAll(false),
     mbInLibreOfficeKitCallback(false),
+    mbOutputToWindow(false),
     mpPrePostOutDev(0), // #i72754#
     maPrePostMapMode()
 {
@@ -246,6 +247,7 @@ SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window *pWindow,
     mnLockPaint( 0 ),
     mbSelectAll(false),
     mbInLibreOfficeKitCallback(false),
+    mbOutputToWindow(false),
     mpPrePostOutDev(0), // #i72754#
     maPrePostMapMode()
 {
diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx
index fc38db6..dd78039 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -467,7 +467,11 @@ void SwEditWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect
               GetView().GetVisArea().GetHeight() <= 0 )
         Invalidate( rRect );
     else
+    {
+        pWrtShell->setOutputToWindow(true);
         pWrtShell->Paint(rRenderContext, rRect);
+        pWrtShell->setOutputToWindow(false);
+    }
 
     if( bPaintShadowCrsr )
         m_pShadCrsr->Paint();
commit 3e21af098ac7f7754558821f3df27331c6adfbf2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jun 24 10:59:34 2015 +0200

    SwNoTextFrm::Paint: stop using SwViewShell::GetOut()
    
    Change-Id: Id7a975cff09066bd796a7fbdee63393266c1843e
    (cherry picked from commit cc9e9219cb897fa1a84916feb13720020fd20b12)

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index f19a863..93dbef5 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -215,7 +215,7 @@ static void lcl_ClearArea( const SwFrm &rFrm,
     }
 }
 
-void SwNoTextFrm::Paint(vcl::RenderContext& /*rRenderContext*/, SwRect const& rRect, SwPrintData const*const) const
+void SwNoTextFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const) const
 {
     if ( Frm().IsEmpty() )
         return;
@@ -245,8 +245,7 @@ void SwNoTextFrm::Paint(vcl::RenderContext& /*rRenderContext*/, SwRect const& rR
 
     SfxProgress::EnterLock(); // No progress reschedules in paint (SwapIn)
 
-    OutputDevice *pOut = pSh->GetOut();
-    pOut->Push();
+    rRenderContext.Push();
     bool bClip = true;
     tools::PolyPolygon aPoly;
 
@@ -258,12 +257,12 @@ void SwNoTextFrm::Paint(vcl::RenderContext& /*rRenderContext*/, SwRect const& rR
     // #i13147# - add 2nd parameter with value <true> to
     // method call <FindFlyFrm().GetContour(..)> to indicate that it is called
     // for paint in order to avoid load of the intrinsic graphic.
-    if ( ( !pOut->GetConnectMetaFile() ||
+    if ( ( !rRenderContext.GetConnectMetaFile() ||
            !pSh->GetWin() ) &&
          FindFlyFrm()->GetContour( aPoly, true )
        )
     {
-        pOut->SetClipRegion(vcl::Region(aPoly));
+        rRenderContext.SetClipRegion(vcl::Region(aPoly));
         bClip = false;
     }
 
@@ -294,23 +293,23 @@ void SwNoTextFrm::Paint(vcl::RenderContext& /*rRenderContext*/, SwRect const& rR
     {
         // Calculate the four to-be-deleted rectangles
         if( pSh->GetWin() )
-            ::lcl_ClearArea( *this, *pSh->GetOut(), aPaintArea, aNormal );
+            ::lcl_ClearArea( *this, rRenderContext, aPaintArea, aNormal );
 
         // The intersection of the PaintArea and the Bitmap contains the absolutely visible area of the Frame
         aPaintArea._Intersection( aNormal );
 
         if ( bClip )
-            pOut->IntersectClipRegion( aPaintArea.SVRect() );
+            rRenderContext.IntersectClipRegion( aPaintArea.SVRect() );
         /// delete unused 3rd parameter
-        PaintPicture( pOut, aGrfArea );
+        PaintPicture( &rRenderContext, aGrfArea );
     }
     else
         // If it's not visible, simply delete the given Area
-        lcl_ClearArea( *this, *pSh->GetOut(), aPaintArea, SwRect() );
+        lcl_ClearArea( *this, rRenderContext, aPaintArea, SwRect() );
     if( pGrfNd )
         pGrfNd->SetFrameInPaint( false );
 
-    pOut->Pop();
+    rRenderContext.Pop();
     SfxProgress::LeaveLock();
 }
 
commit 0ff2fa0f46b4273e6c5b58d6caa5c611c9320dcf
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jun 24 10:51:37 2015 +0200

    SwFrm::Paint: take a vcl::RenderContext
    
    Change-Id: I530d98a425adb32e2c8e1e4d012130f68f6c90a1
    (cherry picked from commit 2fb93c6436739dfc8bec1348fad4f263cd625b65)

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 8931045..f19a863 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -215,7 +215,7 @@ static void lcl_ClearArea( const SwFrm &rFrm,
     }
 }
 
-void SwNoTextFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
+void SwNoTextFrm::Paint(vcl::RenderContext& /*rRenderContext*/, SwRect const& rRect, SwPrintData const*const) const
 {
     if ( Frm().IsEmpty() )
         return;
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 2df0aa0..6829829 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -483,7 +483,7 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject(
                 RestoreMapMode aRestoreMapModeIfNeeded( pShell );
 
                 // paint the FlyFrame (use standard VCL-Paint)
-                pFlyFrm->Paint( GetFlyFrm()->Frm() );
+                pFlyFrm->Paint( *pShell->GetOut(), GetFlyFrm()->Frm() );
             }
         }
     }
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index 21b73c4..efd3796 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -43,7 +43,7 @@ public:
     SwCellFrm( const SwTableBox &, SwFrm*, bool bInsertContent = true );
 
     virtual bool GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0, bool bTestBackground = false ) const SAL_OVERRIDE;
-    virtual void Paint( SwRect const&,
+    virtual void Paint( vcl::RenderContext& rRenderContext, SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const SAL_OVERRIDE;
     virtual void CheckDirection( bool bVert ) SAL_OVERRIDE;
 
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index df2edc4..59f33db 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -162,7 +162,7 @@ public:
 
     // get client information
     virtual bool GetInfo( SfxPoolItem& ) const SAL_OVERRIDE;
-    virtual void Paint( SwRect const&,
+    virtual void Paint( vcl::RenderContext& rRenderContext, SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const SAL_OVERRIDE;
     virtual Size ChgSize( const Size& aNewSize ) SAL_OVERRIDE;
     virtual bool GetCrsrOfst( SwPosition *, Point&,
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 8d283f5..2072d40 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -764,7 +764,7 @@ public:
                                  SwCrsrMoveState* = 0, bool bTestBackground = false ) const;
     virtual bool    GetCharRect( SwRect &, const SwPosition&,
                                  SwCrsrMoveState* = 0 ) const;
-    virtual void Paint( SwRect const&,
+    virtual void Paint( vcl::RenderContext& rRenderContext, SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const;
 
     // HACK: shortcut between frame and formatting
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index e61fbf7..b3b0ccb 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -104,7 +104,7 @@ public:
 
     SwLayoutFrm( SwFrameFormat*, SwFrm* );
 
-    virtual void Paint( SwRect const&,
+    virtual void Paint( vcl::RenderContext& rRenderContext, SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const SAL_OVERRIDE;
     const SwFrm *Lower() const { return m_pLower; }
           SwFrm *Lower()       { return m_pLower; }
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index 12a91dd..e0a65c4 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -46,7 +46,7 @@ protected:
 public:
     SwNoTextFrm( SwNoTextNode * const, SwFrm* );
 
-    virtual void Paint( SwRect const&,
+    virtual void Paint( vcl::RenderContext& rRenderContext, SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const SAL_OVERRIDE;
     virtual bool GetCharRect( SwRect &, const SwPosition&,
                               SwCrsrMoveState* = 0) const SAL_OVERRIDE;
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 44952ad..d57989b 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -199,7 +199,7 @@ public:
     virtual bool  GetCrsrOfst( SwPosition *, Point&,
                                SwCrsrMoveState* = 0, bool bTestBackground = false ) const SAL_OVERRIDE;
 
-    virtual void Paint( SwRect const&,
+    virtual void Paint( vcl::RenderContext& rRenderContext, SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const SAL_OVERRIDE;
     virtual SwTwips ShrinkFrm( SwTwips, bool bTst = false, bool bInfo = false ) SAL_OVERRIDE;
     virtual SwTwips GrowFrm  ( SwTwips, bool bTst = false, bool bInfo = false ) SAL_OVERRIDE;
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index c78872b..3f0c935 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -126,7 +126,7 @@ public:
     SwTabFrm* FindMaster( bool bFirstMaster = false ) const;
 
     virtual bool GetInfo( SfxPoolItem &rHint ) const SAL_OVERRIDE;
-    virtual void Paint( SwRect const&,
+    virtual void Paint( vcl::RenderContext& rRenderContext, SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const SAL_OVERRIDE;
     virtual void CheckDirection( bool bVert ) SAL_OVERRIDE;
 
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 63ce3b9..6fe9380 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -287,7 +287,7 @@ public:
 
     void   PaintExtraData( const SwRect & rRect ) const; /// Page number etc.
     SwRect Paint();
-    virtual void Paint( SwRect const&,
+    virtual void Paint( vcl::RenderContext& rRenderContext, SwRect const&,
                         SwPrintData const*const pPrintData = NULL ) const SAL_OVERRIDE;
     virtual bool GetInfo( SfxPoolItem & ) const SAL_OVERRIDE;
 
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 6b9ab9c..d0e298a 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3172,7 +3172,7 @@ namespace
  * 3. Paint the document content (text)
  * 4. Paint the draw layer that is above the document
 |*/
-void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
+void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const pPrintData) const
 {
     OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "Lower of root is no page." );
 
@@ -3388,7 +3388,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c
                     gProp.pSSpecSubsLines->PaintSubsidiary( pSh->GetOut(), NULL, gProp );
                 }
 
-                pPage->Paint( aPaintRect );
+                pPage->Paint( rRenderContext, aPaintRect );
 
                 // no paint of page border and shadow, if writer is in place mode.
                 if( pSh->GetWin() && pSh->GetDoc()->GetDocShell() &&
@@ -3585,7 +3585,7 @@ SwShortCut::SwShortCut( const SwFrm& rFrm, const SwRect& rRect )
     }
 }
 
-void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
+void SwLayoutFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const) const
 {
     SwViewShell *pSh = getRootFrm()->GetCurrShell();
 
@@ -3669,7 +3669,7 @@ void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
             pFrm->ResetCompletePaint();
             aPaintRect._Intersection( rRect );
 
-            pFrm->Paint( aPaintRect );
+            pFrm->Paint( rRenderContext, aPaintRect );
 
             if ( Lower() && Lower()->IsColumnFrm() )
             {
@@ -4091,10 +4091,10 @@ bool SwFlyFrm::IsPaint( SdrObject *pObj, const SwViewShell *pSh )
     return bPaint;
 }
 
-void SwCellFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
+void SwCellFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const) const
 {
     if ( GetLayoutRowSpan() >= 1 )
-        SwLayoutFrm::Paint( rRect );
+        SwLayoutFrm::Paint( rRenderContext, rRect );
 }
 
 struct BorderLinesGuard
@@ -4112,7 +4112,7 @@ private:
     BorderLines *const m_pBorderLines;
 };
 
-void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
+void SwFlyFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const) const
 {
     //optimize thumbnail generation and store procedure to improve odt saving performance, #i120030#
     SwViewShell *pShell = getRootFrm()->GetCurrShell();
@@ -4351,7 +4351,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
         }
     }
 
-    SwLayoutFrm::Paint( aRect );
+    SwLayoutFrm::Paint( rRenderContext, aRect );
 
     Validate();
 
@@ -4368,7 +4368,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
         gProp.pSProgress->Reschedule();
 }
 
-void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
+void SwTabFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, SwPrintData const*const) const
 {
     const SwViewOption* pViewOption = gProp.pSGlobalShell->GetViewOptions();
     if (pViewOption->IsTable())
@@ -4391,7 +4391,7 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
             aHelper.PaintLines(*gProp.pSGlobalShell->GetOut(), rRect);
         }
 
-        SwLayoutFrm::Paint( rRect );
+        SwLayoutFrm::Paint( rRenderContext, rRect );
     }
     // OD 10.01.2003 #i6467# - no light grey rectangle for page preview
     else if ( gProp.pSGlobalShell->GetWin() && !gProp.pSGlobalShell->IsPreview() )
@@ -7712,7 +7712,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap )
                           &aSwRedirector );
         gProp.pSLines->PaintLines( pDev, gProp );
         if ( pFly->IsFlyInCntFrm() )
-            pFly->Paint( aOut );
+            pFly->Paint( *pDev, aOut );
         gProp.pSLines->PaintLines( pDev, gProp );
         // OD 30.08.2002 #102450# - add 3rd parameter
         pImp->PaintLayer( pIDDMA->GetHeavenId(), 0, aOut, &aPageBackgrdColor,
diff --git a/sw/source/core/layout/unusedf.cxx b/sw/source/core/layout/unusedf.cxx
index 3561928..a788a58 100644
--- a/sw/source/core/layout/unusedf.cxx
+++ b/sw/source/core/layout/unusedf.cxx
@@ -26,7 +26,7 @@ void SwFrm::Format( const SwBorderAttrs * )
     OSL_FAIL( "Format() of the base class called." );
 }
 
-void SwFrm::Paint(SwRect const&, SwPrintData const*const) const
+void SwFrm::Paint(vcl::RenderContext&, SwRect const&, SwPrintData const*const) const
 {
     OSL_FAIL( "Paint() of the base class called." );
 }
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index a5b65ac..f47dfa3 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -575,7 +575,7 @@ bool SwTextFrm::PaintEmpty( const SwRect &rRect, bool bCheck ) const
     return false;
 }
 
-void SwTextFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
+void SwTextFrm::Paint(vcl::RenderContext& /*rRenderContext*/, SwRect const& rRect, SwPrintData const*const) const
 {
     ResetRepaint();
 
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index ac84ea7..bd1c3d1 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -238,7 +238,7 @@ void SwFlyCntPortion::Paint( const SwTextPaintInfo &rInf ) const
             // GetFlyFrm() may change the layout mode at the output device.
             {
                 SwLayoutModeModifier aLayoutModeModifier( *rInf.GetOut() );
-                GetFlyFrm()->Paint( aRect );
+                GetFlyFrm()->Paint( const_cast<vcl::RenderContext&>(*rInf.GetOut()), aRect );
             }
             ((SwTextPaintInfo&)rInf).GetRefDev()->SetLayoutMode(
                     rInf.GetOut()->GetLayoutMode() );
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index 7382d68..3a3749b 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -212,7 +212,7 @@ void SwViewShell::PrintProspect(
             aPos -= aShell.maVisArea.Pos();
             aMapMode.SetOrigin( aPos );
             pPrinter->SetMapMode( aMapMode );
-            pStPage->GetUpper()->Paint( pStPage->Frm() );
+            pStPage->GetUpper()->Paint( *pOutDev, pStPage->Frm() );
         }
 
         pStPage = pNxtPage;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 4eae3c4..1414473 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -379,7 +379,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
                             mpOut = pVout.get();
                             if ( bPaintsFromSystem )
                                 PaintDesktop(*mpOut, aRect);
-                            pCurrentLayout->Paint( aRect );
+                            pCurrentLayout->Paint( *mpOut, aRect );
                             pOld->DrawOutDev( aRect.Pos(), aRect.SSize(),
                                               aRect.Pos(), aRect.SSize(), *pVout );
                             mpOut = pOld;
@@ -401,7 +401,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
                         if ( bPaintsFromSystem )
                             PaintDesktop(*GetOut(), aRect);
                         if (!isTiledRendering())
-                            pCurrentLayout->Paint( aRect );
+                            pCurrentLayout->Paint( *mpOut, aRect );
                         else
                             pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
 
@@ -1275,7 +1275,7 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect
                 // SW paint stuff
                 PaintDesktop(*GetOut(), aRect);
                 SwViewShell::mbLstAct = true;
-                GetLayout()->Paint( aRect );
+                GetLayout()->Paint( *GetOut(), aRect );
                 SwViewShell::mbLstAct = false;
 
                 // end paint and destroy ObjectContact again
@@ -1712,7 +1712,7 @@ void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRe
                 if ( aRect.IsInside( maInvalidRect ) )
                     ResetInvalidRect();
                 SwViewShell::mbLstAct = true;
-                GetLayout()->Paint( aRect );
+                GetLayout()->Paint( rRenderContext, aRect );
                 SwViewShell::mbLstAct = false;
             }
             else
@@ -1733,7 +1733,7 @@ void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRe
                     if ( aRect.IsInside( maInvalidRect ) )
                         ResetInvalidRect();
                     SwViewShell::mbLstAct = true;
-                    GetLayout()->Paint( aRect );
+                    GetLayout()->Paint( rRenderContext, aRect );
                     SwViewShell::mbLstAct = false;
                     // --> OD 2009-08-12 #i101192#
                     // end Pre/PostPaint encapsulation
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 918de2f..8ef7cbf 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -533,7 +533,7 @@ bool SwViewShell::PrintOrPDFExport(
 
         ::SetSwVisArea( pViewSh2, pStPage->Frm() );
 
-        pStPage->GetUpper()->Paint( pStPage->Frm(), &rPrintData );
+        pStPage->GetUpper()->Paint( *pOutDev, pStPage->Frm(), &rPrintData );
 
         SwPaintQueue::Repaint();
 
@@ -616,7 +616,7 @@ void SwViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintD
 
         rRenderContext.Push( PushFlags::CLIPREGION );
         rRenderContext.IntersectClipRegion( aSwRect.SVRect() );
-        pSh->GetLayout()->Paint( aSwRect );
+        pSh->GetLayout()->Paint( rRenderContext, aSwRect );
 
         rRenderContext.Pop();
         // first the CurrShell object needs to be destroyed!
commit 5624957d322604d9f32b11be635d125cd36de49a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jun 24 09:34:40 2015 +0200

    SwViewShell::PrtOle2: take a vcl::RenderContext
    
    Change-Id: I0d56649cf322b7769f77ccd99be367cd813570ea
    (cherry picked from commit 1d1c0632d2de3180abaa9782404c0aea1f1b30af)

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 4d34d5a..4bb296fc 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -372,7 +372,7 @@ public:
 
     // Printing for OLE 2.0.
     static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions,
-                         OutputDevice* pOleOut, const Rectangle& rRect );
+                         vcl::RenderContext& rRenderContext, const Rectangle& rRect );
 
     // Fill temporary doc with selected text for Print or PDF export.
     SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt );
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index f2997ce..918de2f 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -583,15 +583,15 @@ bool SwViewShell::PrintOrPDFExport(
 }
 
 void SwViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions,
-                         OutputDevice* pOleOut, const Rectangle& rRect )
+                           vcl::RenderContext& rRenderContext, const Rectangle& rRect )
 {
     // For printing a shell is needed. Either the Doc already has one, than we
     // create a new view, or it has none, than we create the first view.
     SwViewShell *pSh;
     if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() )
-        pSh = new SwViewShell( *pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(), 0, pOleOut,VSHELLFLAG_SHARELAYOUT );
+        pSh = new SwViewShell( *pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(), 0, &rRenderContext,VSHELLFLAG_SHARELAYOUT );
     else
-        pSh = new SwViewShell( *pDoc, 0, pOpt, pOleOut);
+        pSh = new SwViewShell( *pDoc, 0, pOpt, &rRenderContext);
 
     {
         SET_CURR_SHELL( pSh );
@@ -614,11 +614,11 @@ void SwViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintD
         // document because the thumbnail creation will not trigger a complete
         // formatting of the document.
 
-        pOleOut->Push( PushFlags::CLIPREGION );
-        pOleOut->IntersectClipRegion( aSwRect.SVRect() );
+        rRenderContext.Push( PushFlags::CLIPREGION );
+        rRenderContext.IntersectClipRegion( aSwRect.SVRect() );
         pSh->GetLayout()->Paint( aSwRect );
 
-        pOleOut->Pop();
+        rRenderContext.Pop();
         // first the CurrShell object needs to be destroyed!
     }
     delete pSh;
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index ff621d3..1d275dd 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -809,7 +809,7 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
     pDev->SetBackground();
     const bool bWeb = this->ISA(SwWebDocShell);
     SwPrintData aOpts;
-    SwViewShell::PrtOle2(m_pDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, pDev, aRect);
+    SwViewShell::PrtOle2(m_pDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, *pDev, aRect);
     pDev->Pop();
 
     if( pOrig )
commit 394b20f6fb757d902ca4dbcd5ad0675dff481d27
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jun 24 09:34:00 2015 +0200

    SwViewShell::Paint: can use render context here directly
    
    Change-Id: I75a532e85ce4caa3fe199669054a9811e3e5144a
    (cherry picked from commit f25ee3ce07b942b5b8ec3d24d05ac4037f1cb9d0)

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index ffcc989..4eae3c4 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1777,11 +1777,11 @@ void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRe
             const vcl::Region aDLRegion(rRect);
             DLPrePaint2(aDLRegion);
 
-            mpOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
-            mpOut->SetFillColor( Imp()->GetRetoucheColor() );
-            mpOut->SetLineColor();
-            mpOut->DrawRect( rRect );
-            mpOut->Pop();
+            rRenderContext.Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
+            rRenderContext.SetFillColor( Imp()->GetRetoucheColor() );
+            rRenderContext.SetLineColor();
+            rRenderContext.DrawRect( rRect );
+            rRenderContext.Pop();
             // #i68597#
             DLPostPaint2(true);
         }


More information about the Libreoffice-commits mailing list