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: ...@@ -125,37 +125,45 @@ public:
class GraphCtrlUserCall : public SdrObjUserCall class GraphCtrlUserCall : public SdrObjUserCall
{ {
GraphCtrl& rWin; GraphCtrl& rWin;
public: public:
GraphCtrlUserCall( GraphCtrl& rGraphWin ) : rWin( rGraphWin ) {}; GraphCtrlUserCall(GraphCtrl& rGraphWin)
virtual ~GraphCtrlUserCall() {}; : 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 class GraphCtrlView : public SdrView
{ {
GraphCtrl& rGraphCtrl; GraphCtrl& rGraphCtrl;
protected: protected:
virtual void MarkListHasChanged() SAL_OVERRIDE virtual void MarkListHasChanged() SAL_OVERRIDE
{ {
SdrView::MarkListHasChanged(); SdrView::MarkListHasChanged();
rGraphCtrl.MarkListHasChanged(); rGraphCtrl.MarkListHasChanged();
} }
public: public:
GraphCtrlView(SdrModel* pModel, GraphCtrl* pWindow)
: SdrView(pModel, pWindow)
, rGraphCtrl(*pWindow)
{}
GraphCtrlView( SdrModel* pModel, GraphCtrl* pWindow) : virtual ~GraphCtrlView()
SdrView ( pModel, pWindow ), {}
rGraphCtrl ( *pWindow ) {};
virtual ~GraphCtrlView() {};
}; };
#endif // INCLUDED_SVX_GRAPHCTL_HXX #endif // INCLUDED_SVX_GRAPHCTL_HXX
......
...@@ -242,19 +242,19 @@ void GraphCtrl::Resize() ...@@ -242,19 +242,19 @@ void GraphCtrl::Resize()
Invalidate(); 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 // #i72889# used splitted repaint to be able to paint an own background
// even to the buffered view // even to the buffered view
const bool bGraphicValid(GRAPHIC_NONE != aGraphic.GetType()); 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.SetBackground(GetBackground());
rTarget.Erase(); rTarget.Erase();
...@@ -271,7 +271,7 @@ void GraphCtrl::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ...@@ -271,7 +271,7 @@ void GraphCtrl::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle&
// #i73381# in non-SdrMode, paint to local directly // #i73381# in non-SdrMode, paint to local directly
if(bGraphicValid) 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