Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <vcl/txtattr.hxx>
31 : : #include <vcl/font.hxx>
32 : :
33 : :
34 : :
35 : :
36 : 0 : TextAttrib::~TextAttrib()
37 : : {
38 [ # # ]: 0 : }
39 : :
40 : 0 : int TextAttrib::operator==( const TextAttrib& rAttr ) const
41 : : {
42 : 0 : return mnWhich == rAttr.mnWhich;
43 : : }
44 : :
45 : :
46 : 0 : TextAttribFontColor::TextAttribFontColor( const Color& rColor )
47 : 0 : : TextAttrib( TEXTATTR_FONTCOLOR ), maColor( rColor )
48 : : {
49 : 0 : }
50 : :
51 : 0 : TextAttribFontColor::TextAttribFontColor( const TextAttribFontColor& rAttr )
52 : 0 : : TextAttrib( rAttr ), maColor( rAttr.maColor )
53 : : {
54 : 0 : }
55 : :
56 : 0 : TextAttribFontColor::~TextAttribFontColor()
57 : : {
58 [ # # ]: 0 : }
59 : :
60 : 0 : void TextAttribFontColor::SetFont( Font& rFont ) const
61 : : {
62 : 0 : rFont.SetColor( maColor );
63 : 0 : }
64 : :
65 : 0 : TextAttrib* TextAttribFontColor::Clone() const
66 : : {
67 [ # # ]: 0 : return new TextAttribFontColor( *this );
68 : : }
69 : :
70 : 0 : int TextAttribFontColor::operator==( const TextAttrib& rAttr ) const
71 : : {
72 : 0 : return ( ( TextAttrib::operator==(rAttr ) ) &&
73 [ # # ][ # # ]: 0 : ( maColor == ((const TextAttribFontColor&)rAttr).maColor ) );
74 : : }
75 : :
76 : 0 : TextAttribFontWeight::TextAttribFontWeight( FontWeight eWeight )
77 : 0 : : TextAttrib( TEXTATTR_FONTWEIGHT ), meWeight( eWeight )
78 : : {
79 : 0 : }
80 : :
81 : 0 : TextAttribFontWeight::TextAttribFontWeight( const TextAttribFontWeight& rAttr )
82 : 0 : : TextAttrib( rAttr ), meWeight( rAttr.meWeight )
83 : : {
84 : 0 : }
85 : :
86 : 0 : TextAttribFontWeight::~TextAttribFontWeight()
87 : : {
88 [ # # ]: 0 : }
89 : :
90 : 0 : void TextAttribFontWeight::SetFont( Font& rFont ) const
91 : : {
92 : 0 : rFont.SetWeight( meWeight );
93 : 0 : }
94 : :
95 : 0 : TextAttrib* TextAttribFontWeight::Clone() const
96 : : {
97 [ # # ]: 0 : return new TextAttribFontWeight( *this );
98 : : }
99 : :
100 : 0 : int TextAttribFontWeight::operator==( const TextAttrib& rAttr ) const
101 : : {
102 : 0 : return ( ( TextAttrib::operator==(rAttr ) ) &&
103 [ # # ][ # # ]: 0 : ( meWeight == ((const TextAttribFontWeight&)rAttr).meWeight ) );
104 : : }
105 : :
106 : :
107 : 0 : TextAttribHyperLink::TextAttribHyperLink( const TextAttribHyperLink& rAttr )
108 [ # # ][ # # ]: 0 : : TextAttrib( rAttr ), maURL( rAttr.maURL ), maDescription( rAttr.maDescription )
109 : : {
110 : 0 : maColor = rAttr.maColor;
111 : 0 : }
112 : :
113 [ # # ][ # # ]: 0 : TextAttribHyperLink::~TextAttribHyperLink()
114 : : {
115 [ # # ]: 0 : }
116 : :
117 : 0 : void TextAttribHyperLink::SetFont( Font& rFont ) const
118 : : {
119 : 0 : rFont.SetColor( maColor );
120 : 0 : rFont.SetUnderline( UNDERLINE_SINGLE );
121 : 0 : }
122 : :
123 : 0 : TextAttrib* TextAttribHyperLink::Clone() const
124 : : {
125 [ # # ]: 0 : return new TextAttribHyperLink( *this );
126 : : }
127 : :
128 : 0 : int TextAttribHyperLink::operator==( const TextAttrib& rAttr ) const
129 : : {
130 : 0 : return ( ( TextAttrib::operator==(rAttr ) ) &&
131 : 0 : ( maURL == ((const TextAttribHyperLink&)rAttr).maURL ) &&
132 : 0 : ( maDescription == ((const TextAttribHyperLink&)rAttr).maDescription ) &&
133 [ # # ][ # # : 0 : ( maColor == ((const TextAttribHyperLink&)rAttr).maColor ) );
# # # # ]
134 : : }
135 : :
136 : 0 : TextAttribProtect::TextAttribProtect() :
137 : 0 : TextAttrib( TEXTATTR_PROTECTED )
138 : : {
139 : 0 : }
140 : :
141 : 0 : TextAttribProtect::TextAttribProtect( const TextAttribProtect&) :
142 : 0 : TextAttrib( TEXTATTR_PROTECTED )
143 : : {
144 : 0 : }
145 : :
146 : 0 : TextAttribProtect::~TextAttribProtect()
147 : : {
148 [ # # ]: 0 : }
149 : :
150 : 0 : void TextAttribProtect::SetFont( Font& ) const
151 : : {
152 : 0 : }
153 : :
154 : 0 : TextAttrib* TextAttribProtect::Clone() const
155 : : {
156 [ # # ]: 0 : return new TextAttribProtect();
157 : : }
158 : :
159 : 0 : int TextAttribProtect::operator==( const TextAttrib& rAttr ) const
160 : : {
161 : 0 : return ( TextAttrib::operator==(rAttr ) );
162 : : }
163 : :
164 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|