Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #include <vcl/txtattr.hxx>
21 : #include <vcl/font.hxx>
22 :
23 0 : TextAttrib::~TextAttrib()
24 : {
25 0 : }
26 :
27 0 : bool TextAttrib::operator==( const TextAttrib& rAttr ) const
28 : {
29 0 : return mnWhich == rAttr.mnWhich;
30 : }
31 :
32 0 : TextAttribFontColor::TextAttribFontColor( const Color& rColor )
33 0 : : TextAttrib( TEXTATTR_FONTCOLOR ), maColor( rColor )
34 : {
35 0 : }
36 :
37 0 : TextAttribFontColor::TextAttribFontColor( const TextAttribFontColor& rAttr )
38 0 : : TextAttrib( rAttr ), maColor( rAttr.maColor )
39 : {
40 0 : }
41 :
42 0 : TextAttribFontColor::~TextAttribFontColor()
43 : {
44 0 : }
45 :
46 0 : void TextAttribFontColor::SetFont( Font& rFont ) const
47 : {
48 0 : rFont.SetColor( maColor );
49 0 : }
50 :
51 0 : TextAttrib* TextAttribFontColor::Clone() const
52 : {
53 0 : return new TextAttribFontColor( *this );
54 : }
55 :
56 0 : bool TextAttribFontColor::operator==( const TextAttrib& rAttr ) const
57 : {
58 0 : return ( ( TextAttrib::operator==(rAttr ) ) &&
59 0 : ( maColor == ((const TextAttribFontColor&)rAttr).maColor ) );
60 : }
61 :
62 0 : TextAttribFontWeight::TextAttribFontWeight( FontWeight eWeight )
63 0 : : TextAttrib( TEXTATTR_FONTWEIGHT ), meWeight( eWeight )
64 : {
65 0 : }
66 :
67 0 : TextAttribFontWeight::TextAttribFontWeight( const TextAttribFontWeight& rAttr )
68 0 : : TextAttrib( rAttr ), meWeight( rAttr.meWeight )
69 : {
70 0 : }
71 :
72 0 : TextAttribFontWeight::~TextAttribFontWeight()
73 : {
74 0 : }
75 :
76 0 : void TextAttribFontWeight::SetFont( Font& rFont ) const
77 : {
78 0 : rFont.SetWeight( meWeight );
79 0 : }
80 :
81 0 : TextAttrib* TextAttribFontWeight::Clone() const
82 : {
83 0 : return new TextAttribFontWeight( *this );
84 : }
85 :
86 0 : bool TextAttribFontWeight::operator==( const TextAttrib& rAttr ) const
87 : {
88 0 : return ( ( TextAttrib::operator==(rAttr ) ) &&
89 0 : ( meWeight == ((const TextAttribFontWeight&)rAttr).meWeight ) );
90 : }
91 :
92 0 : TextAttribHyperLink::TextAttribHyperLink( const TextAttribHyperLink& rAttr )
93 0 : : TextAttrib( rAttr ), maURL( rAttr.maURL ), maDescription( rAttr.maDescription )
94 : {
95 0 : maColor = rAttr.maColor;
96 0 : }
97 :
98 0 : TextAttribHyperLink::~TextAttribHyperLink()
99 : {
100 0 : }
101 :
102 0 : void TextAttribHyperLink::SetFont( Font& rFont ) const
103 : {
104 0 : rFont.SetColor( maColor );
105 0 : rFont.SetUnderline( UNDERLINE_SINGLE );
106 0 : }
107 :
108 0 : TextAttrib* TextAttribHyperLink::Clone() const
109 : {
110 0 : return new TextAttribHyperLink( *this );
111 : }
112 :
113 0 : bool TextAttribHyperLink::operator==( const TextAttrib& rAttr ) const
114 : {
115 0 : return ( ( TextAttrib::operator==(rAttr ) ) &&
116 0 : ( maURL == ((const TextAttribHyperLink&)rAttr).maURL ) &&
117 0 : ( maDescription == ((const TextAttribHyperLink&)rAttr).maDescription ) &&
118 0 : ( maColor == ((const TextAttribHyperLink&)rAttr).maColor ) );
119 : }
120 :
121 0 : TextAttribProtect::TextAttribProtect() :
122 0 : TextAttrib( TEXTATTR_PROTECTED )
123 : {
124 0 : }
125 :
126 0 : TextAttribProtect::TextAttribProtect( const TextAttribProtect&) :
127 0 : TextAttrib( TEXTATTR_PROTECTED )
128 : {
129 0 : }
130 :
131 0 : TextAttribProtect::~TextAttribProtect()
132 : {
133 0 : }
134 :
135 0 : void TextAttribProtect::SetFont( Font& ) const
136 : {
137 0 : }
138 :
139 0 : TextAttrib* TextAttribProtect::Clone() const
140 : {
141 0 : return new TextAttribProtect();
142 : }
143 :
144 0 : bool TextAttribProtect::operator==( const TextAttrib& rAttr ) const
145 : {
146 0 : return ( TextAttrib::operator==(rAttr ) );
147 : }
148 :
149 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|