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

Miklos Vajna vmiklos at collabora.co.uk
Wed Jun 24 01:03:38 PDT 2015


 sw/inc/viewsh.hxx              |    2 +-
 sw/source/core/view/viewsh.cxx |   10 +++++-----
 sw/source/core/view/vprint.cxx |   12 ++++++------
 sw/source/uibase/app/docsh.cxx |    2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 1d1c0632d2de3180abaa9782404c0aea1f1b30af
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

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index cb7f1a3..e2ea4b5 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -365,7 +365,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 6867025..3098745c 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 55e3b74..e060a1e 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -831,7 +831,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 f25ee3ce07b942b5b8ec3d24d05ac4037f1cb9d0
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

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index ea4fc5d2..009f6e4 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