Kaydet (Commit) 9130c611 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

refactor GraphCtrl to use RenderContext

Change-Id: Id0a3d24e7c6d6910b62f2950dcb7bd5cb67f59ad
üst eee24f6c
......@@ -125,37 +125,45 @@ public:
class GraphCtrlUserCall : public SdrObjUserCall
{
GraphCtrl& rWin;
GraphCtrl& rWin;
public:
GraphCtrlUserCall( GraphCtrl& rGraphWin ) : rWin( rGraphWin ) {};
virtual ~GraphCtrlUserCall() {};
GraphCtrlUserCall(GraphCtrl& rGraphWin)
: rWin(rGraphWin)
{}
virtual void Changed( const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect ) SAL_OVERRIDE;
virtual ~GraphCtrlUserCall()
{}
virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectangle& rOldBoundRect) SAL_OVERRIDE;
};
SdrObjUserCall* GraphCtrl::GetSdrUserCall() { return pUserCall; }
SdrObjUserCall* GraphCtrl::GetSdrUserCall()
{
return pUserCall;
}
class GraphCtrlView : public SdrView
{
GraphCtrl& rGraphCtrl;
GraphCtrl& rGraphCtrl;
protected:
virtual void MarkListHasChanged() SAL_OVERRIDE
{
SdrView::MarkListHasChanged();
rGraphCtrl.MarkListHasChanged();
}
virtual void MarkListHasChanged() SAL_OVERRIDE
{
SdrView::MarkListHasChanged();
rGraphCtrl.MarkListHasChanged();
}
public:
GraphCtrlView(SdrModel* pModel, GraphCtrl* pWindow)
: SdrView(pModel, pWindow)
, rGraphCtrl(*pWindow)
{}
GraphCtrlView( SdrModel* pModel, GraphCtrl* pWindow) :
SdrView ( pModel, pWindow ),
rGraphCtrl ( *pWindow ) {};
virtual ~GraphCtrlView() {};
virtual ~GraphCtrlView()
{}
};
#endif // INCLUDED_SVX_GRAPHCTL_HXX
......
......@@ -242,19 +242,19 @@ void GraphCtrl::Resize()
Invalidate();
}
void GraphCtrl::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect )
void GraphCtrl::Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect)
{
// #i72889# used splitted repaint to be able to paint an own background
// even to the buffered view
const bool bGraphicValid(GRAPHIC_NONE != aGraphic.GetType());
if(bSdrMode)
if (bSdrMode)
{
SdrPaintWindow* pPaintWindow = pView->BeginCompleteRedraw(this);
SdrPaintWindow* pPaintWindow = pView->BeginCompleteRedraw(&rRenderContext);
if(bGraphicValid)
if (bGraphicValid)
{
OutputDevice& rTarget = pPaintWindow->GetTargetOutputDevice();
vcl::RenderContext& rTarget = pPaintWindow->GetTargetOutputDevice();
rTarget.SetBackground(GetBackground());
rTarget.Erase();
......@@ -271,7 +271,7 @@ void GraphCtrl::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle&
// #i73381# in non-SdrMode, paint to local directly
if(bGraphicValid)
{
aGraphic.Draw(this, Point(), aGraphSize);
aGraphic.Draw(&rRenderContext, Point(), aGraphSize);
}
}
}
......
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