diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-23 18:49:16 +0900 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-05-29 20:16:51 +0200 |
commit | 66b8dfdc4d1f689d98652cdb52902a2582e801ee (patch) | |
tree | e39808b16009a3db1750eb7d64f56f7e8ff0d566 | |
parent | b99aed3422288390ba7ad4bc6f42a6f69e1dedd9 (diff) |
pass RenderContext into writer painting
Change-Id: Ib2d986d05dc7db1b65ed29ea295807d6f20cea4a
Signed-off-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r-- | sw/inc/crsrsh.hxx | 2 | ||||
-rw-r--r-- | sw/inc/viewsh.hxx | 6 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/view/pagepreviewlayout.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 21 | ||||
-rw-r--r-- | sw/source/core/view/vprint.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin2.cxx | 4 |
7 files changed, 23 insertions, 22 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 2fdcac8ba2c5..073a8dfb1d8d 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -408,7 +408,7 @@ public: /* * virtual paint method to make selection visible again after Paint */ - void Paint( const Rectangle & rRect ) SAL_OVERRIDE; + void Paint(vcl::RenderContext& rRenderContext, const Rectangle & rRect) SAL_OVERRIDE; // Areas inline void SetMark(); diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index b63eaeffd284..4d34d5a9b3a3 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -174,10 +174,10 @@ class SW_DLLPUBLIC SwViewShell : public sw::Ring<SwViewShell> SAL_DLLPRIVATE void Reformat(); // Invalidates complete Layout (ApplyViewOption). - SAL_DLLPRIVATE void PaintDesktop( const SwRect & ); // Collect values for painting of desktop + SAL_DLLPRIVATE void PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect&); // Collect values for painting of desktop // and calling. // PaintDesktop split. This pars is also used by PreviewPage. - SAL_DLLPRIVATE void _PaintDesktop( const SwRegionRects &rRegion ); + SAL_DLLPRIVATE void _PaintDesktop(vcl::RenderContext& rRenderContext, const SwRegionRects &rRegion); SAL_DLLPRIVATE bool CheckInvalidForPaint( const SwRect & ); // Direct Paint or rather // trigger an action. @@ -246,7 +246,7 @@ public: void DLPostPaint2(bool bPaintFormLayer); const MapMode& getPrePostMapMode() const { return maPrePostMapMode; } - virtual void Paint(const Rectangle &rRect); + virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect); /** Paint tile. diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 9a027c17f734..a8158663ab2f 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1237,7 +1237,7 @@ bool SwCrsrShell::GoPrevCrsr() return true; } -void SwCrsrShell::Paint( const Rectangle &rRect) +void SwCrsrShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect) { comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll(/*bFootnotes =*/ false)); SET_CURR_SHELL( this ); @@ -1254,7 +1254,7 @@ void SwCrsrShell::Paint( const Rectangle &rRect) } // re-paint area - SwViewShell::Paint( rRect ); + SwViewShell::Paint(rRenderContext, rRect); if( m_bHasFocus && !m_bBasicHideCrsr ) { diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index bb154c64c7e9..02c2af9a5f66 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -1015,7 +1015,7 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan } mbInPaint = true; - OutputDevice* pOutputDev = &rRenderContext; //mrParentViewShell.GetOut(); + OutputDevice* pOutputDev = &rRenderContext; // prepare paint if ( maPreviewPages.size() > 0 ) @@ -1040,7 +1040,7 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan } } // paint preview background rectangles - mrParentViewShell._PaintDesktop( aPreviewBackgrdRegion ); + mrParentViewShell._PaintDesktop(rRenderContext, aPreviewBackgrdRegion); } // prepare data for paint of pages @@ -1095,7 +1095,7 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan mrParentViewShell.maVisArea = aPageRect; aPxPaintRect.Intersection( aPxOutRect ); Rectangle aPaintRect = pOutputDev->PixelToLogic( aPxPaintRect ); - mrParentViewShell.Paint( aPaintRect ); + mrParentViewShell.Paint(rRenderContext, aPaintRect); // --> OD 2007-08-15 #i80691# // paint page border and shadow { diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index c6f374b14ae6..ffcc9897ea3f 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -378,7 +378,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd ) mpOut = pVout.get(); if ( bPaintsFromSystem ) - PaintDesktop( aRect ); + PaintDesktop(*mpOut, aRect); pCurrentLayout->Paint( aRect ); pOld->DrawOutDev( aRect.Pos(), aRect.SSize(), aRect.Pos(), aRect.SSize(), *pVout ); @@ -399,7 +399,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd ) DLPrePaint2(vcl::Region(aRect.SVRect())); if ( bPaintsFromSystem ) - PaintDesktop( aRect ); + PaintDesktop(*GetOut(), aRect); if (!isTiledRendering()) pCurrentLayout->Paint( aRect ); else @@ -485,7 +485,7 @@ void SwViewShell::ImplUnlockPaint( bool bVirDev ) OutputDevice *pOld = mpOut; mpOut = pVout.get(); - Paint( VisArea().SVRect() ); + Paint(*mpOut, VisArea().SVRect()); mpOut = pOld; mpOut->DrawOutDev( VisArea().Pos(), aSize, VisArea().Pos(), aSize, *pVout ); @@ -1273,7 +1273,7 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect mpWin = pOldWin; // SW paint stuff - PaintDesktop( aRect ); + PaintDesktop(*GetOut(), aRect); SwViewShell::mbLstAct = true; GetLayout()->Paint( aRect ); SwViewShell::mbLstAct = false; @@ -1414,7 +1414,7 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect return false; } -void SwViewShell::PaintDesktop( const SwRect &rRect ) +void SwViewShell::PaintDesktop(vcl::RenderContext& rRenderContext, const SwRect &rRect) { if ( !GetWin() && !GetOut()->GetConnectMetaFile() ) return; //for the printer we don't do anything here. @@ -1498,11 +1498,11 @@ void SwViewShell::PaintDesktop( const SwRect &rRect ) } } if ( !aRegion.empty() ) - _PaintDesktop( aRegion ); + _PaintDesktop(rRenderContext, aRegion); } // PaintDesktop is split in two, this part is also used by PreviewPage -void SwViewShell::_PaintDesktop( const SwRegionRects &rRegion ) +void SwViewShell::_PaintDesktop(vcl::RenderContext& /*rRenderContext*/, const SwRegionRects &rRegion) { // OD 2004-04-23 #116347# GetOut()->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR ); @@ -1654,8 +1654,9 @@ bool SwViewShell::CheckInvalidForPaint( const SwRect &rRect ) return bRet; } -void SwViewShell::Paint(const Rectangle &rRect) +void SwViewShell::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect) { + mpOut = &rRenderContext; if ( mnLockPaint ) { if ( Imp()->bSmoothUpdate ) @@ -1726,7 +1727,7 @@ void SwViewShell::Paint(const Rectangle &rRect) DLPrePaint2(aRepaintRegion); // <-- - PaintDesktop( aRect ); + PaintDesktop(rRenderContext, aRect); //When useful, process or destroy the old InvalidRect. if ( aRect.IsInside( maInvalidRect ) ) @@ -1836,7 +1837,7 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex CheckInvalidForPaint(aOutRect); // draw - works in logic coordinates - Paint(aOutRect); + Paint(rDevice, aOutRect); // Remove this device in DrawLayer if (Imp()->GetDrawView()) diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 5ea6e10cd807..b674f9299127 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -141,7 +141,7 @@ void SwPaintQueue::Repaint() } } else - pSh->Paint( pPt->aRect.SVRect() ); + pSh->Paint(*pSh->GetOut(), pPt->aRect.SVRect()); pPt = pPt->pNext; } while ( pPt ); diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 47ef3ef52195..fc38db6172b4 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -441,7 +441,7 @@ void SwEditWin::PrePaint(vcl::RenderContext& /*rRenderContext*/) } } -void SwEditWin::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect) +void SwEditWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) { SwWrtShell* pWrtShell = GetView().GetWrtShellPtr(); if(!pWrtShell) @@ -467,7 +467,7 @@ void SwEditWin::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle& GetView().GetVisArea().GetHeight() <= 0 ) Invalidate( rRect ); else - pWrtShell->Paint( rRect ); + pWrtShell->Paint(rRenderContext, rRect); if( bPaintShadowCrsr ) m_pShadCrsr->Paint(); |