bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / filter / html / htmlattr.cxx
blob21ca43ac56343662bd99c953da437a70576c55db
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "htmlattr.hxx"
21 #include "htmlex.hxx"
22 #include <vcl/decoview.hxx>
25 // =====================================================================
26 // =====================================================================
27 SdHtmlAttrPreview::SdHtmlAttrPreview( Window* pParent, const ResId& rResId )
28 :Control( pParent, rResId )
32 // =====================================================================
33 // =====================================================================
34 SdHtmlAttrPreview::~SdHtmlAttrPreview()
38 // =====================================================================
39 // =====================================================================
40 void SdHtmlAttrPreview::Paint( const Rectangle& rRect )
42 DecorationView aDecoView( this );
44 Rectangle aTextRect;
45 aTextRect.SetSize(GetOutputSize());
47 SetLineColor(m_aBackColor);
48 SetFillColor(m_aBackColor);
49 DrawRect(rRect);
50 SetFillColor();
52 int nHeight = (aTextRect.Bottom() - aTextRect.Top()) >> 2;
53 aTextRect.Bottom() = nHeight + aTextRect.Top();
55 SetTextColor(m_aTextColor);
56 DrawText( aTextRect, String(SdResId(STR_HTMLATTR_TEXT)),
57 TEXT_DRAW_CENTER|TEXT_DRAW_VCENTER );
59 aTextRect.Move(0,nHeight);
60 SetTextColor(m_aLinkColor);
61 DrawText( aTextRect, String(SdResId(STR_HTMLATTR_LINK)),
62 TEXT_DRAW_CENTER|TEXT_DRAW_VCENTER );
64 aTextRect.Move(0,nHeight);
65 SetTextColor(m_aALinkColor);
66 DrawText( aTextRect, String(SdResId(STR_HTMLATTR_ALINK)),
67 TEXT_DRAW_CENTER|TEXT_DRAW_VCENTER );
69 aTextRect.Move(0,nHeight);
70 SetTextColor(m_aVLinkColor);
71 DrawText( aTextRect, String(SdResId(STR_HTMLATTR_VLINK)),
72 TEXT_DRAW_CENTER|TEXT_DRAW_VCENTER );
75 // =====================================================================
76 // =====================================================================
77 void SdHtmlAttrPreview::SetColors( Color& aBack, Color& aText, Color& aLink,
78 Color& aVLink, Color& aALink )
80 m_aBackColor = aBack;
81 m_aTextColor = aText;
82 m_aLinkColor = aLink;
83 m_aVLinkColor = aVLink;
84 m_aALinkColor = aALink;
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */