xref: /trunk/main/editeng/source/editeng/editattr.cxx (revision 190118d0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_editeng.hxx"
26 
27 //#include <eeng_pch.hxx>
28 #include <vcl/wrkwin.hxx>
29 #include <vcl/dialog.hxx>
30 #include <vcl/msgbox.hxx>
31 #include <vcl/svapp.hxx>
32 
33 #include <editeng/svxfont.hxx>
34 #include <editeng/flditem.hxx>
35 #include <editeng/fontitem.hxx>
36 #include <editeng/postitem.hxx>
37 #include <editeng/wghtitem.hxx>
38 #include <editeng/udlnitem.hxx>
39 #include <editeng/cntritem.hxx>
40 #include <editeng/shdditem.hxx>
41 #include <editeng/escpitem.hxx>
42 #include <editeng/colritem.hxx>
43 #include <editeng/wrlmitem.hxx>
44 #include <editeng/fhgtitem.hxx>
45 #include <editeng/crsditem.hxx>
46 #include <editeng/cscoitem.hxx>
47 #include <editeng/kernitem.hxx>
48 #include <editeng/akrnitem.hxx>
49 #include <editeng/langitem.hxx>
50 #include <editeng/emphitem.hxx>
51 #include <editeng/charscaleitem.hxx>
52 #include <editeng/charreliefitem.hxx>
53 
54 #include "editattr.hxx"
55 
DBG_NAME(EE_EditAttrib)56 DBG_NAME( EE_EditAttrib )
57 
58 // -------------------------------------------------------------------------
59 // class EditAttrib
60 // -------------------------------------------------------------------------
61 EditAttrib::EditAttrib( const SfxPoolItem& rAttr )
62 {
63 	DBG_CTOR( EE_EditAttrib, 0 );
64 	pItem = &rAttr;
65 }
66 
~EditAttrib()67 EditAttrib::~EditAttrib()
68 {
69 	DBG_DTOR( EE_EditAttrib, 0 );
70 }
71 
72 // -------------------------------------------------------------------------
73 // class EditCharAttrib
74 // -------------------------------------------------------------------------
EditCharAttrib(const SfxPoolItem & rAttr,sal_uInt16 nS,sal_uInt16 nE)75 EditCharAttrib::EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE )
76 					: EditAttrib( rAttr )
77 {
78 	nStart		= nS;
79 	nEnd		= nE;
80 	bFeature	= sal_False;
81 	bEdge		= sal_False;
82 
83     DBG_ASSERT( ( rAttr.Which() >= EE_ITEMS_START ) && ( rAttr.Which() <= EE_ITEMS_END ), "EditCharAttrib CTOR: Invalid id!" );
84     DBG_ASSERT( ( rAttr.Which() < EE_FEATURE_START ) || ( rAttr.Which() > EE_FEATURE_END ) || ( nE == (nS+1) ), "EditCharAttrib CTOR: Invalid feature!" );
85 }
86 
SetFont(SvxFont &,OutputDevice *)87 void EditCharAttrib::SetFont( SvxFont&, OutputDevice* )
88 {
89 }
90 
91 
92 // -------------------------------------------------------------------------
93 // class EditCharAttribFont
94 // -------------------------------------------------------------------------
EditCharAttribFont(const SvxFontItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)95 EditCharAttribFont::EditCharAttribFont( const SvxFontItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
96 	: EditCharAttrib( rAttr, _nStart, _nEnd )
97 {
98 	DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTINFO || rAttr.Which() == EE_CHAR_FONTINFO_CJK || rAttr.Which() == EE_CHAR_FONTINFO_CTL, "Kein Fontattribut!" );
99 }
100 
SetFont(SvxFont & rFont,OutputDevice *)101 void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* )
102 {
103 	const SvxFontItem& rAttr = (const SvxFontItem&)(*GetItem());
104 
105 	rFont.SetName( rAttr.GetFamilyName() );
106 	rFont.SetFamily( rAttr.GetFamily() );
107 	rFont.SetPitch( rAttr.GetPitch() );
108 	rFont.SetCharSet( rAttr.GetCharSet() );
109 }
110 
111 // -------------------------------------------------------------------------
112 // class EditCharAttribItalic
113 // -------------------------------------------------------------------------
EditCharAttribItalic(const SvxPostureItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)114 EditCharAttribItalic::EditCharAttribItalic( const SvxPostureItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
115 	: EditCharAttrib( rAttr, _nStart, _nEnd )
116 {
117 	DBG_ASSERT( rAttr.Which() == EE_CHAR_ITALIC || rAttr.Which() == EE_CHAR_ITALIC_CJK || rAttr.Which() == EE_CHAR_ITALIC_CTL, "Kein Italicattribut!" );
118 }
119 
SetFont(SvxFont & rFont,OutputDevice *)120 void EditCharAttribItalic::SetFont( SvxFont& rFont, OutputDevice* )
121 {
122 	rFont.SetItalic( ((const SvxPostureItem*)GetItem())->GetPosture() );
123 }
124 
125 // -------------------------------------------------------------------------
126 // class EditCharAttribWeight
127 // -------------------------------------------------------------------------
EditCharAttribWeight(const SvxWeightItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)128 EditCharAttribWeight::EditCharAttribWeight( const SvxWeightItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
129 	: EditCharAttrib( rAttr, _nStart, _nEnd )
130 {
131 	DBG_ASSERT( rAttr.Which() == EE_CHAR_WEIGHT || rAttr.Which() == EE_CHAR_WEIGHT_CJK || rAttr.Which() == EE_CHAR_WEIGHT_CTL, "Kein Weightttribut!" );
132 }
133 
SetFont(SvxFont & rFont,OutputDevice *)134 void EditCharAttribWeight::SetFont( SvxFont& rFont, OutputDevice* )
135 {
136 	rFont.SetWeight( (FontWeight)((const SvxWeightItem*)GetItem())->GetValue() );
137 }
138 
139 // -------------------------------------------------------------------------
140 // class EditCharAttribUnderline
141 // -------------------------------------------------------------------------
EditCharAttribUnderline(const SvxUnderlineItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)142 EditCharAttribUnderline::EditCharAttribUnderline( const SvxUnderlineItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
143 	: EditCharAttrib( rAttr, _nStart, _nEnd )
144 {
145 	DBG_ASSERT( rAttr.Which() == EE_CHAR_UNDERLINE, "Kein Underlineattribut!" );
146 }
147 
SetFont(SvxFont & rFont,OutputDevice * pOutDev)148 void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev )
149 {
150 	rFont.SetUnderline( (FontUnderline)((const SvxUnderlineItem*)GetItem())->GetValue() );
151 	if ( pOutDev )
152 		pOutDev->SetTextLineColor( ((const SvxUnderlineItem*)GetItem())->GetColor() );
153 }
154 
155 // -------------------------------------------------------------------------
156 // class EditCharAttribOverline
157 // -------------------------------------------------------------------------
EditCharAttribOverline(const SvxOverlineItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)158 EditCharAttribOverline::EditCharAttribOverline( const SvxOverlineItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
159 	: EditCharAttrib( rAttr, _nStart, _nEnd )
160 {
161 	DBG_ASSERT( rAttr.Which() == EE_CHAR_OVERLINE, "Kein Overlineattribut!" );
162 }
163 
SetFont(SvxFont & rFont,OutputDevice * pOutDev)164 void EditCharAttribOverline::SetFont( SvxFont& rFont, OutputDevice* pOutDev )
165 {
166 	rFont.SetOverline( (FontUnderline)((const SvxOverlineItem*)GetItem())->GetValue() );
167 	if ( pOutDev )
168 		pOutDev->SetOverlineColor( ((const SvxOverlineItem*)GetItem())->GetColor() );
169 }
170 
171 // -------------------------------------------------------------------------
172 // class EditCharAttribFontHeight
173 // -------------------------------------------------------------------------
EditCharAttribFontHeight(const SvxFontHeightItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)174 EditCharAttribFontHeight::EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
175 	: EditCharAttrib( rAttr, _nStart, _nEnd )
176 {
177 	DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTHEIGHT || rAttr.Which() == EE_CHAR_FONTHEIGHT_CJK || rAttr.Which() == EE_CHAR_FONTHEIGHT_CTL, "Kein Heightattribut!" );
178 }
179 
SetFont(SvxFont & rFont,OutputDevice *)180 void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* )
181 {
182 	// Prop wird ignoriert
183 	rFont.SetSize( Size( rFont.GetSize().Width(), ((const SvxFontHeightItem*)GetItem())->GetHeight() ) );
184 }
185 
186 // -------------------------------------------------------------------------
187 // class EditCharAttribFontWidth
188 // -------------------------------------------------------------------------
EditCharAttribFontWidth(const SvxCharScaleWidthItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)189 EditCharAttribFontWidth::EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
190 	: EditCharAttrib( rAttr, _nStart, _nEnd )
191 {
192 	DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTWIDTH, "Kein Widthattribut!" );
193 }
194 
SetFont(SvxFont &,OutputDevice *)195 void EditCharAttribFontWidth::SetFont( SvxFont& /*rFont*/, OutputDevice* )
196 {
197 	// must be calculated outside, because f(device)...
198 }
199 
200 // -------------------------------------------------------------------------
201 // class EditCharAttribStrikeout
202 // -------------------------------------------------------------------------
EditCharAttribStrikeout(const SvxCrossedOutItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)203 EditCharAttribStrikeout::EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
204 	: EditCharAttrib( rAttr, _nStart, _nEnd )
205 {
206 	DBG_ASSERT( rAttr.Which() == EE_CHAR_STRIKEOUT, "Kein Sizeattribut!" );
207 }
208 
SetFont(SvxFont & rFont,OutputDevice *)209 void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* )
210 {
211 	rFont.SetStrikeout( (FontStrikeout)((const SvxCrossedOutItem*)GetItem())->GetValue() );
212 }
213 
214 // -------------------------------------------------------------------------
215 // class EditCharAttribColor
216 // -------------------------------------------------------------------------
EditCharAttribColor(const SvxColorItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)217 EditCharAttribColor::EditCharAttribColor( const SvxColorItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
218 	: EditCharAttrib( rAttr, _nStart, _nEnd )
219 {
220 	DBG_ASSERT( rAttr.Which() == EE_CHAR_COLOR, "Kein Colorattribut!" );
221 }
222 
SetFont(SvxFont & rFont,OutputDevice *)223 void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* )
224 {
225 	rFont.SetColor( ((const SvxColorItem*)GetItem())->GetValue() );
226 }
227 
228 // -------------------------------------------------------------------------
229 // class EditCharAttribLanguage
230 // -------------------------------------------------------------------------
EditCharAttribLanguage(const SvxLanguageItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)231 EditCharAttribLanguage::EditCharAttribLanguage( const SvxLanguageItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
232 	: EditCharAttrib( rAttr, _nStart, _nEnd )
233 {
234 	DBG_ASSERT( ( rAttr.Which() == EE_CHAR_LANGUAGE ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CJK ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CTL ), "Kein Languageattribut!" );
235 }
236 
SetFont(SvxFont & rFont,OutputDevice *)237 void EditCharAttribLanguage::SetFont( SvxFont& rFont, OutputDevice* )
238 {
239 	rFont.SetLanguage( ((const SvxLanguageItem*)GetItem())->GetLanguage() );
240 }
241 
242 // -------------------------------------------------------------------------
243 // class EditCharAttribShadow
244 // -------------------------------------------------------------------------
EditCharAttribShadow(const SvxShadowedItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)245 EditCharAttribShadow::EditCharAttribShadow( const SvxShadowedItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
246 	: EditCharAttrib( rAttr, _nStart, _nEnd )
247 {
248 	DBG_ASSERT( rAttr.Which() == EE_CHAR_SHADOW, "Kein Shadowattribut!" );
249 }
250 
SetFont(SvxFont & rFont,OutputDevice *)251 void EditCharAttribShadow::SetFont( SvxFont& rFont, OutputDevice* )
252 {
253 	rFont.SetShadow( (sal_Bool)((const SvxShadowedItem*)GetItem())->GetValue() );
254 }
255 
256 // -------------------------------------------------------------------------
257 // class EditCharAttribEscapement
258 // -------------------------------------------------------------------------
EditCharAttribEscapement(const SvxEscapementItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)259 EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
260 	: EditCharAttrib( rAttr, _nStart, _nEnd )
261 {
262 	DBG_ASSERT( rAttr.Which() == EE_CHAR_ESCAPEMENT, "Kein Escapementattribut!" );
263 }
264 
SetFont(SvxFont & rFont,OutputDevice *)265 void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* )
266 {
267 	sal_uInt16 nProp = ((const SvxEscapementItem*)GetItem())->GetProp();
268 	rFont.SetPropr( (sal_uInt8)nProp );
269 
270 	short nEsc = ((const SvxEscapementItem*)GetItem())->GetEsc();
271 	if ( nEsc == DFLT_ESC_AUTO_SUPER )
272 		nEsc = 100 - nProp;
273 	else if ( nEsc == DFLT_ESC_AUTO_SUB )
274 		nEsc = sal::static_int_cast< short >( -( 100 - nProp ) );
275 	rFont.SetEscapement( nEsc );
276 }
277 
278 // -------------------------------------------------------------------------
279 // class EditCharAttribOutline
280 // -------------------------------------------------------------------------
EditCharAttribOutline(const SvxContourItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)281 EditCharAttribOutline::EditCharAttribOutline( const SvxContourItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
282 	: EditCharAttrib( rAttr, _nStart, _nEnd )
283 {
284 	DBG_ASSERT( rAttr.Which() == EE_CHAR_OUTLINE, "Kein Outlineattribut!" );
285 }
286 
SetFont(SvxFont & rFont,OutputDevice *)287 void EditCharAttribOutline::SetFont( SvxFont& rFont, OutputDevice* )
288 {
289 	rFont.SetOutline( (sal_Bool)((const SvxContourItem*)GetItem())->GetValue() );
290 }
291 
292 // -------------------------------------------------------------------------
293 // class EditCharAttribTab
294 // -------------------------------------------------------------------------
EditCharAttribTab(const SfxVoidItem & rAttr,sal_uInt16 nPos)295 EditCharAttribTab::EditCharAttribTab( const SfxVoidItem& rAttr, sal_uInt16 nPos )
296 	: EditCharAttrib( rAttr, nPos, nPos+1 )
297 {
298 	SetFeature( sal_True );
299 }
300 
SetFont(SvxFont &,OutputDevice *)301 void EditCharAttribTab::SetFont( SvxFont&, OutputDevice* )
302 {
303 }
304 
305 // -------------------------------------------------------------------------
306 // class EditCharAttribLineBreak
307 // -------------------------------------------------------------------------
EditCharAttribLineBreak(const SfxVoidItem & rAttr,sal_uInt16 nPos)308 EditCharAttribLineBreak::EditCharAttribLineBreak( const SfxVoidItem& rAttr, sal_uInt16 nPos )
309 	: EditCharAttrib( rAttr, nPos, nPos+1 )
310 {
311 	SetFeature( sal_True );
312 }
313 
SetFont(SvxFont &,OutputDevice *)314 void EditCharAttribLineBreak::SetFont( SvxFont&, OutputDevice* )
315 {
316 }
317 
318 // -------------------------------------------------------------------------
319 // class EditCharAttribField
320 // -------------------------------------------------------------------------
EditCharAttribField(const SvxFieldItem & rAttr,sal_uInt16 nPos)321 EditCharAttribField::EditCharAttribField( const SvxFieldItem& rAttr, sal_uInt16 nPos )
322 	: EditCharAttrib( rAttr, nPos, nPos+1 )
323 {
324 	SetFeature( sal_True );	// !!!
325 	pTxtColor = 0;
326 	pFldColor = 0;
327 }
328 
SetFont(SvxFont & rFont,OutputDevice *)329 void EditCharAttribField::SetFont( SvxFont& rFont, OutputDevice* )
330 {
331 	if ( pFldColor )
332 	{
333 		rFont.SetFillColor( *pFldColor );
334 		rFont.SetTransparent( sal_False );
335 	}
336 	if ( pTxtColor )
337 		rFont.SetColor( *pTxtColor );
338 }
339 
EditCharAttribField(const EditCharAttribField & rAttr)340 EditCharAttribField::EditCharAttribField( const EditCharAttribField& rAttr )
341 	: EditCharAttrib( *rAttr.GetItem(), rAttr.GetStart(), rAttr.GetEnd() ),
342 		aFieldValue( rAttr.aFieldValue )
343 {
344 	// Diesen CCTOR nur fuer temporaeres Object verwenden,
345 	// Item wird nicht gepoolt.
346 	pTxtColor = rAttr.pTxtColor ? new Color( *rAttr.pTxtColor ) : 0;
347 	pFldColor = rAttr.pFldColor ? new Color( *rAttr.pFldColor ) : 0;
348 }
349 
~EditCharAttribField()350 EditCharAttribField::~EditCharAttribField()
351 {
352 	Reset();
353 }
354 
operator ==(const EditCharAttribField & rAttr) const355 sal_Bool EditCharAttribField::operator == ( const EditCharAttribField& rAttr ) const
356 {
357 	if ( aFieldValue != rAttr.aFieldValue )
358 		return sal_False;
359 
360 	if ( ( pTxtColor && !rAttr.pTxtColor ) || ( !pTxtColor && rAttr.pTxtColor ) )
361 		return sal_False;
362 	if ( ( pTxtColor && rAttr.pTxtColor ) && ( *pTxtColor != *rAttr.pTxtColor ) )
363 		return sal_False;
364 
365 	if ( ( pFldColor && !rAttr.pFldColor ) || ( !pFldColor && rAttr.pFldColor ) )
366 		return sal_False;
367 	if ( ( pFldColor && rAttr.pFldColor ) && ( *pFldColor != *rAttr.pFldColor ) )
368 		return sal_False;
369 
370 	return sal_True;
371 }
372 
373 // -------------------------------------------------------------------------
374 // class EditCharAttribPairKerning
375 // -------------------------------------------------------------------------
EditCharAttribPairKerning(const SvxAutoKernItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)376 EditCharAttribPairKerning::EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
377 : EditCharAttrib( rAttr, _nStart, _nEnd )
378 {
379 	DBG_ASSERT( rAttr.Which() == EE_CHAR_PAIRKERNING, "Kein PairKerning!" );
380 }
381 
SetFont(SvxFont & rFont,OutputDevice *)382 void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* )
383 {
384 	rFont.SetKerning( ((const SvxAutoKernItem*)GetItem())->GetValue() );
385 }
386 
387 // -------------------------------------------------------------------------
388 // class EditCharAttribKerning
389 // -------------------------------------------------------------------------
EditCharAttribKerning(const SvxKerningItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)390 EditCharAttribKerning::EditCharAttribKerning( const SvxKerningItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
391 : EditCharAttrib( rAttr, _nStart, _nEnd )
392 {
393 	DBG_ASSERT( rAttr.Which() == EE_CHAR_KERNING, "Kein Kerning!" );
394 }
395 
SetFont(SvxFont & rFont,OutputDevice *)396 void EditCharAttribKerning::SetFont( SvxFont& rFont, OutputDevice* )
397 {
398 	rFont.SetFixKerning( ((const SvxKerningItem*)GetItem())->GetValue() );
399 }
400 
401 // -------------------------------------------------------------------------
402 // class EditCharAttribWordLineMode
403 // -------------------------------------------------------------------------
EditCharAttribWordLineMode(const SvxWordLineModeItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)404 EditCharAttribWordLineMode::EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
405 : EditCharAttrib( rAttr, _nStart, _nEnd )
406 {
407 	DBG_ASSERT( rAttr.Which() == EE_CHAR_WLM, "Kein Kerning!" );
408 }
409 
SetFont(SvxFont & rFont,OutputDevice *)410 void EditCharAttribWordLineMode::SetFont( SvxFont& rFont, OutputDevice* )
411 {
412 	rFont.SetWordLineMode( ((const SvxWordLineModeItem*)GetItem())->GetValue() );
413 }
414 
415 // -------------------------------------------------------------------------
416 // class EditCharAttribEmphasisMark
417 // -------------------------------------------------------------------------
EditCharAttribEmphasisMark(const SvxEmphasisMarkItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)418 EditCharAttribEmphasisMark::EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
419 	: EditCharAttrib( rAttr, _nStart, _nEnd )
420 {
421 	DBG_ASSERT( rAttr.Which() == EE_CHAR_EMPHASISMARK, "Kein Emphasisattribut!" );
422 }
423 
SetFont(SvxFont & rFont,OutputDevice *)424 void EditCharAttribEmphasisMark::SetFont( SvxFont& rFont, OutputDevice* )
425 {
426 	rFont.SetEmphasisMark( ((const SvxEmphasisMarkItem*)GetItem())->GetEmphasisMark() );
427 }
428 
429 // -------------------------------------------------------------------------
430 // class EditCharAttribRelief
431 // -------------------------------------------------------------------------
EditCharAttribRelief(const SvxCharReliefItem & rAttr,sal_uInt16 _nStart,sal_uInt16 _nEnd)432 EditCharAttribRelief::EditCharAttribRelief( const SvxCharReliefItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd )
433 	: EditCharAttrib( rAttr, _nStart, _nEnd )
434 {
435 	DBG_ASSERT( rAttr.Which() == EE_CHAR_RELIEF, "Not a relief attribute!" );
436 }
437 
SetFont(SvxFont & rFont,OutputDevice *)438 void EditCharAttribRelief::SetFont( SvxFont& rFont, OutputDevice* )
439 {
440 	rFont.SetRelief( (FontRelief)((const SvxCharReliefItem*)GetItem())->GetValue() );
441 }
442