Kaydet (Commit) 0617f87c authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

refactor Ruler to use RenderContext

Change-Id: Ic4c57e161419a9b185b2c5ee8e8b79d3da9e4a7e
üst 71c56174
...@@ -85,14 +85,14 @@ void FillUpWithDefTabs_Impl( long nDefDist, SvxTabStopItem& rTabs ) ...@@ -85,14 +85,14 @@ void FillUpWithDefTabs_Impl( long nDefDist, SvxTabStopItem& rTabs )
// class TabWin_Impl ----------------------------------------------------- // class TabWin_Impl -----------------------------------------------------
void TabWin_Impl::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) void TabWin_Impl::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
{ {
// Paint tabulators // Paint tabulators
Point aPnt; Point aPoint;
Size aSize = GetOutputSizePixel(); Size aSize = rRenderContext.GetOutputSizePixel();
aPnt.X() = aSize.Width() / 2; aPoint.X() = aSize.Width() / 2;
aPnt.Y() = aSize.Height() / 2; aPoint.Y() = aSize.Height() / 2;
Ruler::DrawTab( this, GetSettings().GetStyleSettings().GetFontColor(), aPnt, nTabStyle ); Ruler::DrawTab(rRenderContext, rRenderContext.GetSettings().GetStyleSettings().GetFontColor(), aPoint, nTabStyle);
} }
// class SvxTabulatorTabPage --------------------------------------------- // class SvxTabulatorTabPage ---------------------------------------------
......
...@@ -667,22 +667,27 @@ private: ...@@ -667,22 +667,27 @@ private:
SVT_DLLPRIVATE void ImplVDrawRect( long nX1, long nY1, long nX2, long nY2 ); SVT_DLLPRIVATE void ImplVDrawRect( long nX1, long nY1, long nX2, long nY2 );
SVT_DLLPRIVATE void ImplVDrawText( long nX, long nY, const OUString& rText, long nMin = LONG_MIN, long nMax = LONG_MAX ); SVT_DLLPRIVATE void ImplVDrawText( long nX, long nY, const OUString& rText, long nMin = LONG_MIN, long nMax = LONG_MAX );
SVT_DLLPRIVATE void ImplDrawTicks( long nMin, long nMax, long nStart, long nVirTop, long nVirBottom ); SVT_DLLPRIVATE void ImplDrawTicks(vcl::RenderContext& rRenderContext,
SVT_DLLPRIVATE void ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom ); long nMin, long nMax, long nStart, long nVirTop, long nVirBottom);
SVT_DLLPRIVATE void ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle, bool bIsHit = false ); SVT_DLLPRIVATE void ImplDrawBorders(vcl::RenderContext& rRenderContext,
SVT_DLLPRIVATE void ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom ); long nMin, long nMax, long nVirTop, long nVirBottom);
SVT_DLLPRIVATE void ImplDrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle ); SVT_DLLPRIVATE void ImplDrawIndent(vcl::RenderContext& rRenderContext,
SVT_DLLPRIVATE void ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom ); const Polygon& rPoly, sal_uInt16 nStyle, bool bIsHit = false);
SVT_DLLPRIVATE void ImplDrawIndents(vcl::RenderContext& rRenderContext,
long nMin, long nMax, long nVirTop, long nVirBottom);
SVT_DLLPRIVATE void ImplDrawTab(vcl::RenderContext& rRenderContext, const Point& rPos, sal_uInt16 nStyle);
SVT_DLLPRIVATE void ImplDrawTabs(vcl::RenderContext& rRenderContext,
long nMin, long nMax, long nVirTop, long nVirBottom);
using Window::ImplInit; using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit( WinBits nWinBits ); SVT_DLLPRIVATE void ImplInit( WinBits nWinBits );
SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
SVT_DLLPRIVATE void ImplCalc(); SVT_DLLPRIVATE void ImplCalc();
SVT_DLLPRIVATE void ImplFormat(); SVT_DLLPRIVATE void ImplFormat(vcl::RenderContext& rRenderContext);
SVT_DLLPRIVATE void ImplInitExtraField( bool bUpdate ); SVT_DLLPRIVATE void ImplInitExtraField( bool bUpdate );
SVT_DLLPRIVATE void ImplInvertLines( bool bErase = false ); SVT_DLLPRIVATE void ImplInvertLines(vcl::RenderContext& rRenderContext, bool bErase = false);
SVT_DLLPRIVATE void ImplDraw(); SVT_DLLPRIVATE void ImplDraw(vcl::RenderContext& rRenderContext);
SVT_DLLPRIVATE void ImplDrawExtra( bool bPaint = false ); SVT_DLLPRIVATE void ImplDrawExtra(vcl::RenderContext& rRenderContext, bool bPaint = false);
SVT_DLLPRIVATE void ImplUpdate( bool bMustCalc = false ); SVT_DLLPRIVATE void ImplUpdate( bool bMustCalc = false );
using Window::ImplHitTest; using Window::ImplHitTest;
...@@ -713,7 +718,7 @@ public: ...@@ -713,7 +718,7 @@ public:
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE; virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE; virtual void Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE;
virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE; virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE; virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
...@@ -791,8 +796,8 @@ public: ...@@ -791,8 +796,8 @@ public:
sal_uInt32 GetTabCount() const; sal_uInt32 GetTabCount() const;
const RulerTab* GetTabs() const; const RulerTab* GetTabs() const;
static void DrawTab( OutputDevice* pDevice, const Color &rFillColor, static void DrawTab(vcl::RenderContext& rRenderContext, const Color &rFillColor,
const Point& rPos, sal_uInt16 nStyle ); const Point& rPos, sal_uInt16 nStyle);
void SetStyle( WinBits nStyle ); void SetStyle( WinBits nStyle );
WinBits GetStyle() const { return mnWinStyle; } WinBits GetStyle() const { return mnWinStyle; }
......
...@@ -3475,7 +3475,7 @@ void SvxRuler::Command( const CommandEvent& rCommandEvent ) ...@@ -3475,7 +3475,7 @@ void SvxRuler::Command( const CommandEvent& rCommandEvent )
{ {
sal_uInt16 nStyle = bRTL ? i|RULER_TAB_RTL : i; sal_uInt16 nStyle = bRTL ? i|RULER_TAB_RTL : i;
nStyle |= static_cast<sal_uInt16>(bHorz ? WB_HORZ : WB_VERT); nStyle |= static_cast<sal_uInt16>(bHorz ? WB_HORZ : WB_VERT);
DrawTab(pDev, aFillColor, aPt, nStyle); DrawTab(*pDev, aFillColor, aPt, nStyle);
aMenu.InsertItem(i + 1, aMenu.InsertItem(i + 1,
ResId(RID_SVXSTR_RULER_START + i, DIALOG_MGR()).toString(), ResId(RID_SVXSTR_RULER_START + i, DIALOG_MGR()).toString(),
Image(pDev->GetBitmap(Point(), aSz), Color(COL_WHITE))); Image(pDev->GetBitmap(Point(), aSz), Color(COL_WHITE)));
......
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