/src/libreoffice/editeng/source/editeng/editattr.cxx
Line | Count | Source |
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/outdev.hxx> |
21 | | |
22 | | #include <libxml/xmlwriter.h> |
23 | | #include <editeng/eeitem.hxx> |
24 | | #include <editeng/svxfont.hxx> |
25 | | #include <editeng/fontitem.hxx> |
26 | | #include <editeng/postitem.hxx> |
27 | | #include <editeng/wghtitem.hxx> |
28 | | #include <editeng/udlnitem.hxx> |
29 | | #include <editeng/contouritem.hxx> |
30 | | #include <editeng/shdditem.hxx> |
31 | | #include <editeng/escapementitem.hxx> |
32 | | #include <editeng/colritem.hxx> |
33 | | #include <editeng/wrlmitem.hxx> |
34 | | #include <editeng/fhgtitem.hxx> |
35 | | #include <editeng/crossedoutitem.hxx> |
36 | | #include <editeng/kernitem.hxx> |
37 | | #include <editeng/autokernitem.hxx> |
38 | | #include <editeng/langitem.hxx> |
39 | | #include <editeng/emphasismarkitem.hxx> |
40 | | #include <editeng/charreliefitem.hxx> |
41 | | #include <editeng/cmapitem.hxx> |
42 | | #include <editeng/fontvariationsitem.hxx> |
43 | | #include <editeng/opticalsizingitem.hxx> |
44 | | |
45 | | #include <editattr.hxx> |
46 | | |
47 | | |
48 | | EditCharAttrib::EditCharAttrib(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 nS, sal_Int32 nE ) |
49 | 21.2M | : maItemHolder(rPool, &rItem) |
50 | 21.2M | , nStart(nS) |
51 | 21.2M | , nEnd(nE) |
52 | 21.2M | , bFeature(false) |
53 | 21.2M | , bEdge(false) |
54 | 21.2M | , bExpandable(true) |
55 | 21.2M | { |
56 | 21.2M | assert((rItem.Which() >= EE_ITEMS_START) && (rItem.Which() <= EE_ITEMS_END)); |
57 | 21.2M | assert((rItem.Which() < EE_FEATURE_START) || (rItem.Which() > EE_FEATURE_END) || (nE == (nS+1))); |
58 | 21.2M | } |
59 | | |
60 | | EditCharAttrib::~EditCharAttrib() |
61 | 21.2M | { |
62 | 21.2M | } |
63 | | |
64 | | void EditCharAttrib::SetFont( SvxFont&, OutputDevice* ) |
65 | 2.43k | { |
66 | 2.43k | } |
67 | | |
68 | | void EditCharAttrib::dumpAsXml(xmlTextWriterPtr pWriter) const |
69 | 0 | { |
70 | 0 | (void)xmlTextWriterStartElement(pWriter, BAD_CAST("EditCharAttrib")); |
71 | 0 | (void)xmlTextWriterWriteFormatAttribute( |
72 | 0 | pWriter, BAD_CAST("nStart"), "%" SAL_PRIdINT32, nStart); |
73 | 0 | (void)xmlTextWriterWriteFormatAttribute( |
74 | 0 | pWriter, BAD_CAST("nEnd"), "%" SAL_PRIdINT32, nEnd); |
75 | 0 | GetItem()->dumpAsXml(pWriter); |
76 | 0 | (void)xmlTextWriterEndElement(pWriter); |
77 | 0 | } |
78 | | |
79 | | |
80 | | |
81 | | EditCharAttribFont::EditCharAttribFont(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
82 | 1.82M | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
83 | 1.82M | { |
84 | 1.82M | assert(rItem.Which() == EE_CHAR_FONTINFO || rItem.Which() == EE_CHAR_FONTINFO_CJK || rItem.Which() == EE_CHAR_FONTINFO_CTL); |
85 | 1.82M | } |
86 | | |
87 | | void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* ) |
88 | 2.66M | { |
89 | 2.66M | const SvxFontItem& rAttr = static_cast<const SvxFontItem&>(*GetItem()); |
90 | | |
91 | 2.66M | rFont.SetFamilyName( rAttr.GetFamilyName() ); |
92 | 2.66M | rFont.SetFamily( rAttr.GetFamily() ); |
93 | 2.66M | rFont.SetPitch( rAttr.GetPitch() ); |
94 | 2.66M | rFont.SetCharSet( rAttr.GetCharSet() ); |
95 | 2.66M | } |
96 | | |
97 | | |
98 | | |
99 | | EditCharAttribItalic::EditCharAttribItalic(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
100 | 1.53M | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
101 | 1.53M | { |
102 | 1.53M | assert(rItem.Which() == EE_CHAR_ITALIC || rItem.Which() == EE_CHAR_ITALIC_CJK || rItem.Which() == EE_CHAR_ITALIC_CTL); |
103 | 1.53M | } |
104 | | |
105 | | void EditCharAttribItalic::SetFont( SvxFont& rFont, OutputDevice* ) |
106 | 4.72M | { |
107 | 4.72M | rFont.SetItalic( static_cast<const SvxPostureItem*>(GetItem())->GetPosture() ); |
108 | 4.72M | } |
109 | | |
110 | | |
111 | | |
112 | | EditCharAttribWeight::EditCharAttribWeight(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
113 | 1.91M | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
114 | 1.91M | { |
115 | 1.91M | assert(rItem.Which() == EE_CHAR_WEIGHT || rItem.Which() == EE_CHAR_WEIGHT_CJK || rItem.Which() == EE_CHAR_WEIGHT_CTL); |
116 | 1.91M | } |
117 | | |
118 | | void EditCharAttribWeight::SetFont( SvxFont& rFont, OutputDevice* ) |
119 | 4.86M | { |
120 | 4.86M | rFont.SetWeight( static_cast<const SvxWeightItem*>(GetItem())->GetValue() ); |
121 | 4.86M | } |
122 | | |
123 | | |
124 | | |
125 | | EditCharAttribUnderline::EditCharAttribUnderline(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
126 | 483k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
127 | 483k | { |
128 | 483k | assert(rItem.Which() == EE_CHAR_UNDERLINE); |
129 | 483k | } |
130 | | |
131 | | void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) |
132 | 4.77M | { |
133 | 4.77M | rFont.SetUnderline( static_cast<const SvxUnderlineItem*>(GetItem())->GetValue() ); |
134 | | |
135 | 4.77M | if ( pOutDev ) |
136 | 816 | pOutDev->SetTextLineColor( static_cast<const SvxUnderlineItem*>(GetItem())->GetColor() ); |
137 | | |
138 | 4.77M | } |
139 | | |
140 | | |
141 | | |
142 | | EditCharAttribOverline::EditCharAttribOverline(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
143 | 11.9k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
144 | 11.9k | { |
145 | 11.9k | assert(rItem.Which() == EE_CHAR_OVERLINE); |
146 | 11.9k | } |
147 | | |
148 | | void EditCharAttribOverline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) |
149 | 906 | { |
150 | 906 | rFont.SetOverline( static_cast<const SvxOverlineItem*>(GetItem())->GetValue() ); |
151 | 906 | if ( pOutDev ) |
152 | 0 | pOutDev->SetOverlineColor( static_cast<const SvxOverlineItem*>(GetItem())->GetColor() ); |
153 | 906 | } |
154 | | |
155 | | |
156 | | |
157 | | EditCharAttribFontHeight::EditCharAttribFontHeight(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
158 | 2.53M | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
159 | 2.53M | { |
160 | 2.53M | assert(rItem.Which() == EE_CHAR_FONTHEIGHT || rItem.Which() == EE_CHAR_FONTHEIGHT_CJK || rItem.Which() == EE_CHAR_FONTHEIGHT_CTL); |
161 | 2.53M | } |
162 | | |
163 | | void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* ) |
164 | 5.59M | { |
165 | | // Property is ignored |
166 | 5.59M | rFont.SetFontSize( Size( rFont.GetFontSize().Width(), static_cast<const SvxFontHeightItem*>(GetItem())->GetHeight() ) ); |
167 | 5.59M | } |
168 | | |
169 | | |
170 | | |
171 | | EditCharAttribFontWidth::EditCharAttribFontWidth(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
172 | 6.58k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
173 | 6.58k | { |
174 | 6.58k | assert(rItem.Which() == EE_CHAR_FONTWIDTH); |
175 | 6.58k | } |
176 | | |
177 | | void EditCharAttribFontWidth::SetFont( SvxFont& /*rFont*/, OutputDevice* ) |
178 | 454 | { |
179 | | // must be calculated outside, because f(device)... |
180 | 454 | } |
181 | | |
182 | | |
183 | | |
184 | | EditCharAttribStrikeout::EditCharAttribStrikeout(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
185 | 458k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
186 | 458k | { |
187 | 458k | assert(rItem.Which() == EE_CHAR_STRIKEOUT); |
188 | 458k | } |
189 | | |
190 | | void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* ) |
191 | 4.72M | { |
192 | 4.72M | rFont.SetStrikeout( static_cast<const SvxCrossedOutItem*>(GetItem())->GetValue() ); |
193 | 4.72M | } |
194 | | |
195 | | |
196 | | |
197 | | EditCharAttribCaseMap::EditCharAttribCaseMap(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
198 | 196k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
199 | 196k | { |
200 | 196k | assert(rItem.Which() == EE_CHAR_CASEMAP); |
201 | 196k | } |
202 | | |
203 | | void EditCharAttribCaseMap::SetFont( SvxFont& rFont, OutputDevice* ) |
204 | 4.22M | { |
205 | 4.22M | rFont.SetCaseMap( static_cast<const SvxCaseMapItem*>(GetItem())->GetCaseMap() ); |
206 | 4.22M | } |
207 | | |
208 | | |
209 | | |
210 | | EditCharAttribColor::EditCharAttribColor(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
211 | 931k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
212 | 931k | { |
213 | 931k | assert(rItem.Which() == EE_CHAR_COLOR); |
214 | 931k | } |
215 | | |
216 | | void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* ) |
217 | 5.76M | { |
218 | 5.76M | Color aColor = static_cast<const SvxColorItem*>(GetItem())->GetValue(); |
219 | 5.76M | rFont.SetColor( aColor); |
220 | 5.76M | } |
221 | | |
222 | | |
223 | | EditCharAttribBackgroundColor::EditCharAttribBackgroundColor(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
224 | 170k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
225 | 170k | { |
226 | 170k | assert(rItem.Which() == EE_CHAR_BKGCOLOR); |
227 | 170k | } |
228 | | |
229 | | void EditCharAttribBackgroundColor::SetFont( SvxFont& rFont, OutputDevice* ) |
230 | 4.22M | { |
231 | 4.22M | Color aColor = static_cast<const SvxColorItem*>(GetItem())->GetValue(); |
232 | 4.22M | rFont.SetTransparent(aColor.IsTransparent()); |
233 | 4.22M | rFont.SetFillColor(aColor); |
234 | 4.22M | } |
235 | | |
236 | | EditCharAttribLanguage::EditCharAttribLanguage(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
237 | 793k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
238 | 793k | { |
239 | 793k | assert((rItem.Which() == EE_CHAR_LANGUAGE) || (rItem.Which() == EE_CHAR_LANGUAGE_CJK) || (rItem.Which() == EE_CHAR_LANGUAGE_CTL)); |
240 | 793k | } |
241 | | |
242 | | void EditCharAttribLanguage::SetFont( SvxFont& rFont, OutputDevice* ) |
243 | 4.30M | { |
244 | 4.30M | rFont.SetLanguage( static_cast<const SvxLanguageItem*>(GetItem())->GetLanguage() ); |
245 | 4.30M | } |
246 | | |
247 | | EditCharAttribRuby::EditCharAttribRuby(SfxItemPool& rPool, const SfxPoolItem& rItem, |
248 | | sal_Int32 nStartIn, sal_Int32 nEndIn) |
249 | 1.78k | : EditCharAttrib(rPool, rItem, nStartIn, nEndIn) |
250 | 1.78k | { |
251 | 1.78k | assert(rItem.Which() == EE_CHAR_RUBY); |
252 | 1.78k | SetExpandable(false); |
253 | 1.78k | } |
254 | | |
255 | 17.7k | void EditCharAttribRuby::SetFont(SvxFont&, OutputDevice*) {} |
256 | | |
257 | | EditCharAttribScriptHint::EditCharAttribScriptHint(SfxItemPool& rPool, const SfxPoolItem& rItem, |
258 | | sal_Int32 nStartIn, sal_Int32 nEndIn) |
259 | 2.51k | : EditCharAttrib(rPool, rItem, nStartIn, nEndIn) |
260 | 2.51k | { |
261 | 2.51k | assert(rItem.Which() == EE_CHAR_SCRIPT_HINT); |
262 | 2.51k | } |
263 | | |
264 | 0 | void EditCharAttribScriptHint::SetFont(SvxFont&, OutputDevice*) {} |
265 | | |
266 | | EditCharAttribShadow::EditCharAttribShadow(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
267 | 262k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
268 | 262k | { |
269 | 262k | assert(rItem.Which() == EE_CHAR_SHADOW); |
270 | 262k | } |
271 | | |
272 | | void EditCharAttribShadow::SetFont( SvxFont& rFont, OutputDevice* ) |
273 | 448k | { |
274 | 448k | rFont.SetShadow( static_cast<const SvxShadowedItem*>(GetItem())->GetValue() ); |
275 | 448k | } |
276 | | |
277 | | |
278 | | |
279 | | EditCharAttribEscapement::EditCharAttribEscapement(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
280 | 670k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
281 | 670k | { |
282 | 670k | assert(rItem.Which() == EE_CHAR_ESCAPEMENT); |
283 | 670k | } |
284 | | |
285 | | void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) |
286 | 4.92M | { |
287 | 4.92M | sal_uInt16 const nProp = static_cast<const SvxEscapementItem*>(GetItem())->GetProportionalHeight(); |
288 | 4.92M | rFont.SetPropr( static_cast<sal_uInt8>(nProp) ); |
289 | | |
290 | 4.92M | short nEsc = static_cast<const SvxEscapementItem*>(GetItem())->GetEsc(); |
291 | 4.92M | rFont.SetNonAutoEscapement( nEsc, pOutDev ); |
292 | 4.92M | } |
293 | | |
294 | | |
295 | | |
296 | | EditCharAttribOutline::EditCharAttribOutline(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
297 | 379k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
298 | 379k | { |
299 | 379k | assert(rItem.Which() == EE_CHAR_OUTLINE); |
300 | 379k | } |
301 | | |
302 | | void EditCharAttribOutline::SetFont( SvxFont& rFont, OutputDevice* ) |
303 | 4.34M | { |
304 | 4.34M | rFont.SetOutline( static_cast<const SvxContourItem*>(GetItem())->GetValue() ); |
305 | 4.34M | } |
306 | | |
307 | | |
308 | | |
309 | | EditCharAttribTab::EditCharAttribTab(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 nPos) |
310 | 0 | : EditCharAttrib(rPool, rItem, nPos, nPos+1) |
311 | 0 | { |
312 | 0 | SetFeature( true ); |
313 | 0 | } |
314 | | |
315 | | void EditCharAttribTab::SetFont( SvxFont&, OutputDevice* ) |
316 | 0 | { |
317 | 0 | } |
318 | | |
319 | | |
320 | | |
321 | | EditCharAttribLineBreak::EditCharAttribLineBreak(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 nPos) |
322 | 19.8k | : EditCharAttrib(rPool, rItem, nPos, nPos+1) |
323 | 19.8k | { |
324 | 19.8k | SetFeature( true ); |
325 | 19.8k | } |
326 | | |
327 | | void EditCharAttribLineBreak::SetFont( SvxFont&, OutputDevice* ) |
328 | 2.81k | { |
329 | 2.81k | } |
330 | | |
331 | | |
332 | | |
333 | | EditCharAttribField::EditCharAttribField(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 nPos) |
334 | 2.01M | : EditCharAttrib(rPool, rItem, nPos, nPos+1) |
335 | 2.01M | { |
336 | 2.01M | SetFeature( true ); // !!! |
337 | 2.01M | } |
338 | | |
339 | | void EditCharAttribField::SetFont( SvxFont& rFont, OutputDevice* ) |
340 | 356k | { |
341 | 356k | if ( mxFldColor ) |
342 | 4.76k | { |
343 | 4.76k | rFont.SetFillColor( *mxFldColor ); |
344 | 4.76k | rFont.SetTransparent( false ); |
345 | 4.76k | } |
346 | 356k | if ( mxTxtColor ) |
347 | 3.62k | rFont.SetColor( *mxTxtColor ); |
348 | 356k | if ( mxFldLineStyle ) |
349 | 2.96k | rFont.SetUnderline( *mxFldLineStyle ); |
350 | 356k | } |
351 | | |
352 | | |
353 | | void EditCharAttribField::SetFieldValue(const OUString& rVal) |
354 | 6.66M | { |
355 | 6.66M | aFieldValue = rVal; |
356 | 6.66M | } |
357 | | |
358 | | void EditCharAttribField::Reset() |
359 | 15.3M | { |
360 | 15.3M | aFieldValue.clear(); |
361 | 15.3M | mxTxtColor.reset(); |
362 | 15.3M | mxFldColor.reset(); |
363 | 15.3M | mxFldLineStyle.reset(); |
364 | 15.3M | } |
365 | | |
366 | | EditCharAttribField::EditCharAttribField(const EditCharAttribField& rAttr) |
367 | 6.66M | : EditCharAttrib(rAttr.GetHolder().getPool(), *rAttr.GetHolder().getItem(), rAttr.GetStart(), rAttr.GetEnd()) |
368 | 6.66M | , aFieldValue( rAttr.aFieldValue ) |
369 | 6.66M | { |
370 | | // Use this constructor only for temporary Objects, Item is not pooled. |
371 | 6.66M | mxTxtColor = rAttr.mxTxtColor; |
372 | 6.66M | mxFldColor = rAttr.mxFldColor; |
373 | 6.66M | mxFldLineStyle = rAttr.mxFldLineStyle; |
374 | 6.66M | } |
375 | | |
376 | | EditCharAttribField::~EditCharAttribField() |
377 | 8.67M | { |
378 | 8.67M | Reset(); |
379 | 8.67M | } |
380 | | |
381 | | bool EditCharAttribField::operator == ( const EditCharAttribField& rAttr ) const |
382 | 6.66M | { |
383 | 6.66M | if ( aFieldValue != rAttr.aFieldValue ) |
384 | 1.99M | return false; |
385 | | |
386 | 4.66M | if ( ( mxTxtColor && !rAttr.mxTxtColor ) || ( !mxTxtColor && rAttr.mxTxtColor ) ) |
387 | 82 | return false; |
388 | 4.66M | if ( ( mxTxtColor && rAttr.mxTxtColor ) && ( *mxTxtColor != *rAttr.mxTxtColor ) ) |
389 | 0 | return false; |
390 | | |
391 | 4.66M | if ( ( mxFldColor && !rAttr.mxFldColor ) || ( !mxFldColor && rAttr.mxFldColor ) ) |
392 | 0 | return false; |
393 | 4.66M | if ( ( mxFldColor && rAttr.mxFldColor ) && ( *mxFldColor != *rAttr.mxFldColor ) ) |
394 | 0 | return false; |
395 | | |
396 | 4.66M | if ( ( mxFldLineStyle && !rAttr.mxFldLineStyle ) || ( !mxFldLineStyle && rAttr.mxFldLineStyle ) ) |
397 | 0 | return false; |
398 | 4.66M | if ( ( mxFldLineStyle && rAttr.mxFldLineStyle ) && ( *mxFldLineStyle != *rAttr.mxFldLineStyle ) ) |
399 | 0 | return false; |
400 | | |
401 | 4.66M | return true; |
402 | 4.66M | } |
403 | | |
404 | | |
405 | | |
406 | | EditCharAttribPairKerning::EditCharAttribPairKerning(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
407 | 31.8k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
408 | 31.8k | { |
409 | 31.8k | assert(rItem.Which() == EE_CHAR_PAIRKERNING); |
410 | 31.8k | } |
411 | | |
412 | | void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* ) |
413 | 906 | { |
414 | 906 | rFont.SetKerning( static_cast<const SvxAutoKernItem*>(GetItem())->GetValue() ? FontKerning::FontSpecific : FontKerning::NONE ); |
415 | 906 | } |
416 | | |
417 | | |
418 | | |
419 | | EditCharAttribKerning::EditCharAttribKerning(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
420 | 229k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
421 | 229k | { |
422 | 229k | assert(rItem.Which() == EE_CHAR_KERNING); |
423 | 229k | } |
424 | | |
425 | | void EditCharAttribKerning::SetFont( SvxFont& rFont, OutputDevice* ) |
426 | 4.22M | { |
427 | 4.22M | rFont.SetFixKerning( static_cast<const SvxKerningItem*>(GetItem())->GetValue() ); |
428 | 4.22M | } |
429 | | |
430 | | |
431 | | |
432 | | EditCharAttribWordLineMode::EditCharAttribWordLineMode(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
433 | 3.19k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
434 | 3.19k | { |
435 | 3.19k | assert(rItem.Which() == EE_CHAR_WLM); |
436 | 3.19k | } |
437 | | |
438 | | void EditCharAttribWordLineMode::SetFont( SvxFont& rFont, OutputDevice* ) |
439 | 0 | { |
440 | 0 | rFont.SetWordLineMode( static_cast<const SvxWordLineModeItem*>(GetItem())->GetValue() ); |
441 | 0 | } |
442 | | |
443 | | |
444 | | |
445 | | EditCharAttribEmphasisMark::EditCharAttribEmphasisMark(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
446 | 3.81k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
447 | 3.81k | { |
448 | 3.81k | assert(rItem.Which() == EE_CHAR_EMPHASISMARK); |
449 | 3.81k | } |
450 | | |
451 | | void EditCharAttribEmphasisMark::SetFont( SvxFont& rFont, OutputDevice* ) |
452 | 1.36k | { |
453 | 1.36k | rFont.SetEmphasisMark( static_cast<const SvxEmphasisMarkItem*>(GetItem())->GetEmphasisMark() ); |
454 | 1.36k | } |
455 | | |
456 | | |
457 | | |
458 | | EditCharAttribRelief::EditCharAttribRelief(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
459 | 66.4k | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
460 | 66.4k | { |
461 | 66.4k | assert(rItem.Which() == EE_CHAR_RELIEF); |
462 | 66.4k | } |
463 | | |
464 | | void EditCharAttribRelief::SetFont( SvxFont& rFont, OutputDevice* ) |
465 | 360k | { |
466 | 360k | rFont.SetRelief( static_cast<const SvxCharReliefItem*>(GetItem())->GetValue() ); |
467 | 360k | } |
468 | | |
469 | | |
470 | | |
471 | | EditCharAttribOpticalSizing::EditCharAttribOpticalSizing(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
472 | 0 | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
473 | 0 | { |
474 | 0 | assert(rItem.Which() == EE_CHAR_OPTICALSIZING); |
475 | 0 | } |
476 | | |
477 | | void EditCharAttribOpticalSizing::SetFont( SvxFont& rFont, OutputDevice* ) |
478 | 0 | { |
479 | 0 | rFont.SetOpticalSizing( static_cast<const SvxOpticalSizingItem*>(GetItem())->GetValue() ); |
480 | 0 | } |
481 | | |
482 | | |
483 | | EditCharAttribFontVariations::EditCharAttribFontVariations(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
484 | 0 | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
485 | 0 | { |
486 | 0 | assert(rItem.Which() == EE_CHAR_FONTVARIATIONS); |
487 | 0 | } |
488 | | |
489 | | void EditCharAttribFontVariations::SetFont( SvxFont& rFont, OutputDevice* ) |
490 | 0 | { |
491 | 0 | rFont.SetVariations( static_cast<const SvxFontVariationsItem*>(GetItem())->GetVariations() ); |
492 | 0 | } |
493 | | |
494 | | EditCharAttribGrabBag::EditCharAttribGrabBag(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) |
495 | 7 | : EditCharAttrib(rPool, rItem, _nStart, _nEnd) |
496 | 7 | { |
497 | | assert(rItem.Which() == EE_CHAR_GRABBAG); |
498 | 7 | } |
499 | | |
500 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |