Kaydet (Commit) 60ef5920 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

pass RenderContext into writer painting

Change-Id: Ib2d986d05dc7db1b65ed29ea295807d6f20cea4a
üst 95ccc26b
......@@ -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();
......
......@@ -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.
......
......@@ -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 )
{
......
......@@ -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
{
......
......@@ -377,7 +377,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 );
......@@ -398,7 +398,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
......@@ -484,7 +484,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 );
......@@ -1263,7 +1263,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;
......@@ -1404,7 +1404,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.
......@@ -1488,11 +1488,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 );
......@@ -1644,8 +1644,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 )
......@@ -1716,7 +1717,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 ) )
......@@ -1826,7 +1827,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())
......
......@@ -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 );
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment