summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-14 18:28:47 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-15 08:56:25 +0900
commit763858b2ce2d5751bbf533b21847a5fd9b5fec61 (patch)
tree790448bbc4de0de63af3be86a9ea5c45c55da071 /sd
parent2079b1f407ac5c29f54f90966a317226e57e9169 (diff)
refactor SdHtmlAttrPreview to use RenderContext
Change-Id: I2b23764932df4a078094944d89cebb06f6eb569a
Diffstat (limited to 'sd')
-rw-r--r--sd/source/filter/html/htmlattr.cxx40
-rw-r--r--sd/source/filter/html/htmlattr.hxx2
2 files changed, 19 insertions, 23 deletions
diff --git a/sd/source/filter/html/htmlattr.cxx b/sd/source/filter/html/htmlattr.cxx
index dd1f4721ad39..4a7732f88315 100644
--- a/sd/source/filter/html/htmlattr.cxx
+++ b/sd/source/filter/html/htmlattr.cxx
@@ -22,8 +22,8 @@
#include <vcl/decoview.hxx>
#include <vcl/builderfactory.hxx>
-SdHtmlAttrPreview::SdHtmlAttrPreview( vcl::Window* pParent, WinBits nStyle )
-:Control( pParent, nStyle )
+SdHtmlAttrPreview::SdHtmlAttrPreview(vcl::Window* pParent, WinBits nStyle)
+ : Control(pParent, nStyle)
{
}
@@ -42,43 +42,39 @@ SdHtmlAttrPreview::~SdHtmlAttrPreview()
{
}
-void SdHtmlAttrPreview::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect )
+void SdHtmlAttrPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
{
- DecorationView aDecoView( this );
+ DecorationView aDecoView(&rRenderContext);
Rectangle aTextRect;
aTextRect.SetSize(GetOutputSize());
- SetLineColor(m_aBackColor);
- SetFillColor(m_aBackColor);
- DrawRect(rRect);
- SetFillColor();
+ rRenderContext.SetLineColor(m_aBackColor);
+ rRenderContext.SetFillColor(m_aBackColor);
+ rRenderContext.DrawRect(rRect);
+ rRenderContext.SetFillColor();
int nHeight = (aTextRect.Bottom() - aTextRect.Top()) >> 2;
aTextRect.Bottom() = nHeight + aTextRect.Top();
- SetTextColor(m_aTextColor);
- DrawText( aTextRect, SD_RESSTR(STR_HTMLATTR_TEXT),
- TEXT_DRAW_CENTER|TEXT_DRAW_VCENTER );
+ rRenderContext.SetTextColor(m_aTextColor);
+ rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_TEXT), TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER);
aTextRect.Move(0,nHeight);
- SetTextColor(m_aLinkColor);
- DrawText( aTextRect, SD_RESSTR(STR_HTMLATTR_LINK),
- TEXT_DRAW_CENTER|TEXT_DRAW_VCENTER );
+ rRenderContext.SetTextColor(m_aLinkColor);
+ rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_LINK), TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER);
aTextRect.Move(0,nHeight);
- SetTextColor(m_aALinkColor);
- DrawText( aTextRect, SD_RESSTR(STR_HTMLATTR_ALINK),
- TEXT_DRAW_CENTER|TEXT_DRAW_VCENTER );
+ rRenderContext.SetTextColor(m_aALinkColor);
+ rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_ALINK), TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER);
aTextRect.Move(0,nHeight);
- SetTextColor(m_aVLinkColor);
- DrawText( aTextRect, SD_RESSTR(STR_HTMLATTR_VLINK),
- TEXT_DRAW_CENTER|TEXT_DRAW_VCENTER );
+ rRenderContext.SetTextColor(m_aVLinkColor);
+ rRenderContext.DrawText(aTextRect, SD_RESSTR(STR_HTMLATTR_VLINK), TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER);
}
-void SdHtmlAttrPreview::SetColors( Color& aBack, Color& aText, Color& aLink,
- Color& aVLink, Color& aALink )
+void SdHtmlAttrPreview::SetColors(Color& aBack, Color& aText, Color& aLink,
+ Color& aVLink, Color& aALink)
{
m_aBackColor = aBack;
m_aTextColor = aText;
diff --git a/sd/source/filter/html/htmlattr.hxx b/sd/source/filter/html/htmlattr.hxx
index 2e0b706bb7e1..07ecf0674f38 100644
--- a/sd/source/filter/html/htmlattr.hxx
+++ b/sd/source/filter/html/htmlattr.hxx
@@ -34,7 +34,7 @@ public:
SdHtmlAttrPreview( vcl::Window* pParent, WinBits nStyle );
virtual ~SdHtmlAttrPreview();
- virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE;
+ virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
void SetColors( Color& aBack, Color& aText, Color& aLink,
Color& aVLink, Color& aALink );