LibreOffice Module sw (master)  1
atrstck.cxx
Go to the documentation of this file.
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 "atrhndl.hxx"
21 #include <svl/itemiter.hxx>
22 #include <vcl/outdev.hxx>
23 #include <editeng/cmapitem.hxx>
24 #include <editeng/colritem.hxx>
25 #include <editeng/contouritem.hxx>
28 #include <editeng/fontitem.hxx>
29 #include <editeng/fhgtitem.hxx>
30 #include <editeng/kernitem.hxx>
32 #include <editeng/langitem.hxx>
33 #include <editeng/postitem.hxx>
34 #include <editeng/shdditem.hxx>
35 #include <editeng/udlnitem.hxx>
36 #include <editeng/wghtitem.hxx>
37 #include <editeng/wrlmitem.hxx>
38 #include <editeng/autokernitem.hxx>
42 #include <editeng/twolinesitem.hxx>
44 #include <editeng/boxitem.hxx>
45 #include <editeng/shaditem.hxx>
46 #include <viewopt.hxx>
47 #include <charfmt.hxx>
48 #include <fchrfmt.hxx>
49 #include <fmtautofmt.hxx>
50 #include <editeng/brushitem.hxx>
51 #include <fmtinfmt.hxx>
52 #include <txtinet.hxx>
54 #include <viewsh.hxx>
55 
69 {
70  0, // // 0
71  1, // RES_CHRATR_CASEMAP = RES_CHRATR_BEGIN // 1
72  0, // RES_CHRATR_CHARSETCOLOR, // 2
73  2, // RES_CHRATR_COLOR, // 3
74  3, // RES_CHRATR_CONTOUR, // 4
75  4, // RES_CHRATR_CROSSEDOUT, // 5
76  5, // RES_CHRATR_ESCAPEMENT, // 6
77  6, // RES_CHRATR_FONT, // 7
78  7, // RES_CHRATR_FONTSIZE, // 8
79  8, // RES_CHRATR_KERNING, // 9
80  9, // RES_CHRATR_LANGUAGE, // 10
81  10, // RES_CHRATR_POSTURE, // 11
82  0, // RES_CHRATR_UNUSED1, // 12
83  11, // RES_CHRATR_SHADOWED, // 13
84  12, // RES_CHRATR_UNDERLINE, // 14
85  13, // RES_CHRATR_WEIGHT, // 15
86  14, // RES_CHRATR_WORDLINEMODE, // 16
87  15, // RES_CHRATR_AUTOKERN, // 17
88  16, // RES_CHRATR_BLINK, // 18
89  17, // RES_CHRATR_NOHYPHEN, // 19
90  0, // RES_CHRATR_UNUSED2, // 20
91  18, // RES_CHRATR_BACKGROUND, // 21
92  19, // RES_CHRATR_CJK_FONT, // 22
93  20, // RES_CHRATR_CJK_FONTSIZE, // 23
94  21, // RES_CHRATR_CJK_LANGUAGE, // 24
95  22, // RES_CHRATR_CJK_POSTURE, // 25
96  23, // RES_CHRATR_CJK_WEIGHT, // 26
97  24, // RES_CHRATR_CTL_FONT, // 27
98  25, // RES_CHRATR_CTL_FONTSIZE, // 28
99  26, // RES_CHRATR_CTL_LANGUAGE, // 29
100  27, // RES_CHRATR_CTL_POSTURE, // 30
101  28, // RES_CHRATR_CTL_WEIGHT, // 31
102  29, // RES_CHRATR_ROTATE, // 32
103  30, // RES_CHRATR_EMPHASIS_MARK, // 33
104  31, // RES_CHRATR_TWO_LINES, // 34
105  32, // RES_CHRATR_SCALEW, // 35
106  33, // RES_CHRATR_RELIEF, // 36
107  34, // RES_CHRATR_HIDDEN, // 37
108  35, // RES_CHRATR_OVERLINE, // 38
109  0, // RES_CHRATR_RSID, // 39
110  36, // RES_CHRATR_BOX, // 40
111  37, // RES_CHRATR_SHADOW, // 41
112  38, // RES_CHRATR_HIGHLIGHT, // 42
113  0, // RES_CHRATR_GRABBAG, // 43
114  0, // RES_CHRATR_BIDIRTL, // 44
115  0, // RES_CHRATR_IDCTHINT, // 45
116  39, // RES_TXTATR_REFMARK, // 46
117  40, // RES_TXTATR_TOXMARK, // 47
118  41, // RES_TXTATR_META, // 48
119  41, // RES_TXTATR_METAFIELD, // 49
120  0, // RES_TXTATR_AUTOFMT, // 50
121  0, // RES_TXTATR_INETFMT // 51
122  0, // RES_TXTATR_CHARFMT, // 52
123  42, // RES_TXTATR_CJK_RUBY, // 53
124  0, // RES_TXTATR_UNKNOWN_CONTAINER, // 54
125  43, // RES_TXTATR_INPUTFIELD // 55
126 };
127 
128 namespace CharFormat
129 {
130 
132 const SfxItemSet* GetItemSet( const SfxPoolItem& rAttr )
133 {
134  const SfxItemSet* pSet = nullptr;
135 
136  if ( RES_TXTATR_AUTOFMT == rAttr.Which() )
137  {
138  pSet = rAttr.StaticWhichCast(RES_TXTATR_AUTOFMT).GetStyleHandle().get();
139  }
140  else
141  {
142  // Get the attributes from the template
143  const SwCharFormat* pFormat = RES_TXTATR_INETFMT == rAttr.Which() ?
144  rAttr.StaticWhichCast(RES_TXTATR_INETFMT).GetTextINetFormat()->GetCharFormat() :
145  static_cast<const SwFormatCharFormat&>(rAttr).GetCharFormat();
146  if( pFormat )
147  {
148  pSet = &pFormat->GetAttrSet();
149  }
150  }
151 
152  return pSet;
153 }
154 
156 const SfxPoolItem* GetItem( const SwTextAttr& rAttr, sal_uInt16 nWhich )
157 {
158  if ( RES_TXTATR_INETFMT == rAttr.Which() ||
159  RES_TXTATR_CHARFMT == rAttr.Which() ||
160  RES_TXTATR_AUTOFMT == rAttr.Which() )
161  {
162  const SfxItemSet* pSet = CharFormat::GetItemSet( rAttr.GetAttr() );
163  if ( !pSet ) return nullptr;
164 
165  bool bInParent = RES_TXTATR_AUTOFMT != rAttr.Which();
166  const SfxPoolItem* pItem;
167  bool bRet = SfxItemState::SET == pSet->GetItemState( nWhich, bInParent, &pItem );
168 
169  return bRet ? pItem : nullptr;
170  }
171 
172  return ( nWhich == rAttr.Which() ) ? &rAttr.GetAttr() : nullptr;
173 }
174 
176 bool IsItemIncluded( const sal_uInt16 nWhich, const SwTextAttr *pAttr )
177 {
178  bool bRet = false;
179 
180  const SfxItemSet* pItemSet = CharFormat::GetItemSet( pAttr->GetAttr() );
181  if ( pItemSet )
182  bRet = SfxItemState::SET == pItemSet->GetItemState( nWhich );
183 
184  return bRet;
185 }
186 }
187 
195 static bool lcl_ChgHyperLinkColor( const SwTextAttr& rAttr,
196  const SfxPoolItem& rItem,
197  const SwViewShell* pShell,
198  Color* pColor )
199 {
200  if ( !pShell ||
201  RES_TXTATR_INETFMT != rAttr.Which() ||
202  RES_CHRATR_COLOR != rItem.Which() )
203  return false;
204 
205  // #i15455#
206  // 1. case:
207  // We do not want to show visited links:
208  // (printing, pdf export, page preview)
209 
210  SwTextINetFormat & rINetAttr(const_cast<SwTextINetFormat&>(
211  static_txtattr_cast<SwTextINetFormat const&>(rAttr)));
212  if ( pShell->GetOut()->GetOutDevType() == OUTDEV_PRINTER ||
213  pShell->GetViewOptions()->IsPDFExport() ||
214  pShell->GetViewOptions()->IsPagePreview() )
215  {
216  if (rINetAttr.IsVisited())
217  {
218  if ( pColor )
219  {
220  // take color from character format 'unvisited link'
221  rINetAttr.SetVisited(false);
222  const SwCharFormat* pTmpFormat = rINetAttr.GetCharFormat();
223  const SfxPoolItem* pItem;
224  if (SfxItemState::SET == pTmpFormat->GetItemState(RES_CHRATR_COLOR, true, &pItem))
225  *pColor = pItem->StaticWhichCast(RES_CHRATR_COLOR).GetValue();
226  rINetAttr.SetVisited(true);
227  }
228  return true;
229  }
230 
231  return false;
232  }
233 
234  // 2. case:
235  // We do not want to apply the color set in the hyperlink
236  // attribute, instead we take the colors from the view options:
237 
238  if ( pShell->GetWin() &&
239  (
240  (rINetAttr.IsVisited() && SwViewOption::IsVisitedLinks()) ||
241  (!rINetAttr.IsVisited() && SwViewOption::IsLinks())
242  )
243  )
244  {
245  if ( pColor )
246  {
247  if (rINetAttr.IsVisited())
248  {
249  // take color from view option 'visited link color'
251  }
252  else
253  {
254  // take color from view option 'unvisited link color'
255  *pColor = SwViewOption::GetLinksColor();
256  }
257  }
258  return true;
259  }
260 
261  return false;
262 }
263 
265  : m_pIDocumentSettingAccess(nullptr)
266  , m_pShell(nullptr)
267  , m_bVertLayout(false)
268  , m_bVertLayoutLRBT(false)
269 {
270  memset( m_pDefaultArray, 0, NUM_DEFAULT_VALUES * sizeof(SfxPoolItem*) );
271 }
272 
274 {
275 }
276 
277 void SwAttrHandler::Init( const SwAttrSet& rAttrSet,
278  const IDocumentSettingAccess& rIDocumentSettingAcces )
279 {
280  m_pIDocumentSettingAccess = &rIDocumentSettingAcces;
281  m_pShell = nullptr;
282 
283  for ( sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++ )
284  m_pDefaultArray[ StackPos[ i ] ] = &rAttrSet.Get( i );
285 }
286 
287 void SwAttrHandler::Init( const SfxPoolItem** pPoolItem, const SwAttrSet* pAS,
288  const IDocumentSettingAccess& rIDocumentSettingAcces,
289  const SwViewShell* pSh,
290  SwFont& rFnt, bool bVL, bool bVertLayoutLRBT )
291 {
292  // initialize default array
293  memcpy( m_pDefaultArray, pPoolItem,
294  NUM_DEFAULT_VALUES * sizeof(SfxPoolItem*) );
295 
296  m_pIDocumentSettingAccess = &rIDocumentSettingAcces;
297  m_pShell = pSh;
298 
299  // do we have to apply additional paragraph attributes?
300  m_bVertLayout = bVL;
301  m_bVertLayoutLRBT = bVertLayoutLRBT;
302 
303  if ( pAS && pAS->Count() )
304  {
305  SfxItemIter aIter( *pAS );
306  sal_uInt16 nWhich;
307  const SfxPoolItem* pItem = aIter.GetCurItem();
308  do
309  {
310  nWhich = pItem->Which();
311  if (isCHRATR(nWhich))
312  {
313  m_pDefaultArray[ StackPos[ nWhich ] ] = pItem;
314  FontChg( *pItem, rFnt, true );
315  }
316 
317  pItem = aIter.NextItem();
318  } while (pItem);
319  }
320 
321  // It is possible, that Init is called more than once, e.g., in a
322  // SwTextFrame::FormatOnceMore situation or (since sw_redlinehide)
323  // from SwAttrIter::Seek(); in the latter case SwTextSizeInfo::m_pFnt
324  // is an alias of m_pFnt so it must not be deleted!
325  if (m_pFnt)
326  {
327  *m_pFnt = rFnt;
328  }
329  else
330  {
331  m_pFnt.reset(new SwFont(rFnt));
332  }
333 }
334 
336 {
337  for (auto& i : m_aAttrStack)
338  i.clear();
339 }
340 
341 void SwAttrHandler::PushAndChg( const SwTextAttr& rAttr, SwFont& rFnt )
342 {
343  // these special attributes in fact represent a collection of attributes
344  // they have to be pushed to each stack they belong to
345  if ( RES_TXTATR_INETFMT == rAttr.Which() ||
346  RES_TXTATR_CHARFMT == rAttr.Which() ||
347  RES_TXTATR_AUTOFMT == rAttr.Which() )
348  {
349  const SfxItemSet* pSet = CharFormat::GetItemSet( rAttr.GetAttr() );
350  if ( !pSet ) return;
351 
352  for ( sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
353  {
354  const SfxPoolItem* pItem;
355  bool bRet = SfxItemState::SET == pSet->GetItemState( i, rAttr.Which() != RES_TXTATR_AUTOFMT, &pItem );
356 
357  if ( bRet )
358  {
359  // we push rAttr onto the appropriate stack
360  if ( Push( rAttr, *pItem ) )
361  {
362  // we let pItem change rFnt
363  Color aColor;
364  if (lcl_ChgHyperLinkColor(rAttr, *pItem, m_pShell, &aColor))
365  {
366  SvxColorItem aItemNext( aColor, RES_CHRATR_COLOR );
367  FontChg( aItemNext, rFnt, true );
368  }
369  else
370  FontChg( *pItem, rFnt, true );
371  }
372  }
373  }
374  }
375  // this is the usual case, we have a basic attribute, push it onto the
376  // stack and change the font
377  else
378  {
379  if ( Push( rAttr, rAttr.GetAttr() ) )
380  // we let pItem change rFnt
381  FontChg( rAttr.GetAttr(), rFnt, true );
382  }
383 }
384 
385 const SwTextAttr* SwAttrHandler::GetTop(sal_uInt16 nStack)
386 {
387  return m_aAttrStack[nStack].empty() ? nullptr : m_aAttrStack[nStack].back();
388 }
389 
390 bool SwAttrHandler::Push( const SwTextAttr& rAttr, const SfxPoolItem& rItem )
391 {
392  OSL_ENSURE( rItem.Which() < RES_TXTATR_WITHEND_END,
393  "I do not want this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
394 
395  // robust
396  if ( RES_TXTATR_WITHEND_END <= rItem.Which() )
397  return false;
398 
399  const sal_uInt16 nStack = StackPos[ rItem.Which() ];
400 
401  // attributes originating from redlining have highest priority
402  // second priority are hyperlink attributes, which have a color replacement
403  const SwTextAttr* pTopAttr = GetTop(nStack);
404  if ( !pTopAttr
405  || rAttr.IsPriorityAttr()
406  || ( !pTopAttr->IsPriorityAttr()
407  && !lcl_ChgHyperLinkColor(*pTopAttr, rItem, m_pShell, nullptr)))
408  {
409  m_aAttrStack[nStack].push_back(&rAttr);
410  return true;
411  }
412 
413  const auto it = m_aAttrStack[nStack].end() - 1;
414  m_aAttrStack[nStack].insert(it, &rAttr);
415  return false;
416 }
417 
418 void SwAttrHandler::RemoveFromStack(sal_uInt16 nWhich, const SwTextAttr& rAttr)
419 {
420  auto& rStack = m_aAttrStack[StackPos[nWhich]];
421  const auto it = std::find(rStack.begin(), rStack.end(), &rAttr);
422  if (it != rStack.end())
423  rStack.erase(it);
424 }
425 
426 void SwAttrHandler::PopAndChg( const SwTextAttr& rAttr, SwFont& rFnt )
427 {
428  if ( RES_TXTATR_WITHEND_END <= rAttr.Which() )
429  return; // robust
430 
431  // these special attributes in fact represent a collection of attributes
432  // they have to be removed from each stack they belong to
433  if ( RES_TXTATR_INETFMT == rAttr.Which() ||
434  RES_TXTATR_CHARFMT == rAttr.Which() ||
435  RES_TXTATR_AUTOFMT == rAttr.Which() )
436  {
437  const SfxItemSet* pSet = CharFormat::GetItemSet( rAttr.GetAttr() );
438  if ( !pSet ) return;
439 
440  for ( sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
441  {
442  const SfxPoolItem* pItem;
443  bool bRet = SfxItemState::SET == pSet->GetItemState( i, RES_TXTATR_AUTOFMT != rAttr.Which(), &pItem );
444  if ( bRet )
445  {
446  // we remove rAttr from the appropriate stack
447  RemoveFromStack(i, rAttr);
448  // reset font according to attribute on top of stack
449  // or default value
450  ActivateTop( rFnt, i );
451  }
452  }
453  }
454  // this is the usual case, we have a basic attribute, remove it from the
455  // stack and reset the font
456  else
457  {
458  RemoveFromStack(rAttr.Which(), rAttr);
459  // reset font according to attribute on top of stack
460  // or default value
461  ActivateTop( rFnt, rAttr.Which() );
462  }
463 }
464 
466 void SwAttrHandler::Pop( const SwTextAttr& rAttr )
467 {
468  OSL_ENSURE( rAttr.Which() < RES_TXTATR_WITHEND_END,
469  "I do not have this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
470 
471  if ( rAttr.Which() < RES_TXTATR_WITHEND_END )
472  {
473  RemoveFromStack(rAttr.Which(), rAttr);
474  }
475 }
476 
477 void SwAttrHandler::ActivateTop( SwFont& rFnt, const sal_uInt16 nAttr )
478 {
479  OSL_ENSURE( nAttr < RES_TXTATR_WITHEND_END,
480  "I cannot activate this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
481 
482  const sal_uInt16 nStackPos = StackPos[ nAttr ];
483  const SwTextAttr* pTopAt = GetTop(nStackPos);
484  if ( pTopAt )
485  {
486  const SfxPoolItem* pItemNext(nullptr);
487 
488  // check if top attribute is collection of attributes
489  if ( RES_TXTATR_INETFMT == pTopAt->Which() ||
490  RES_TXTATR_CHARFMT == pTopAt->Which() ||
491  RES_TXTATR_AUTOFMT == pTopAt->Which() )
492  {
493  const SfxItemSet* pSet = CharFormat::GetItemSet( pTopAt->GetAttr() );
494  if (pSet)
495  pSet->GetItemState( nAttr, RES_TXTATR_AUTOFMT != pTopAt->Which(), &pItemNext );
496  }
497 
498  if (pItemNext)
499  {
500  Color aColor;
501  if (lcl_ChgHyperLinkColor(*pTopAt, *pItemNext, m_pShell, &aColor))
502  {
503  SvxColorItem aItemNext( aColor, RES_CHRATR_COLOR );
504  FontChg( aItemNext, rFnt, false );
505  }
506  else
507  FontChg( *pItemNext, rFnt, false );
508  }
509  else
510  FontChg( pTopAt->GetAttr(), rFnt, false );
511  }
512 
513  // default value has to be set, we only have default values for char attribs
514  else if ( nStackPos < NUM_DEFAULT_VALUES )
515  FontChg( *m_pDefaultArray[ nStackPos ], rFnt, false );
516  else if ( RES_TXTATR_REFMARK == nAttr )
517  rFnt.GetRef()--;
518  else if ( RES_TXTATR_TOXMARK == nAttr )
519  rFnt.GetTox()--;
520  else if ( (RES_TXTATR_META == nAttr) || (RES_TXTATR_METAFIELD == nAttr) )
521  {
522  rFnt.GetMeta()--;
523  }
524  else if ( RES_TXTATR_CJK_RUBY == nAttr )
525  {
526  // ruby stack has no more attributes
527  // check, if a rotation attribute has to be applied
528  const sal_uInt16 nTwoLineStack = StackPos[ RES_CHRATR_TWO_LINES ];
529  bool bTwoLineAct = false;
530  const SwTextAttr* pTwoLineAttr = GetTop(nTwoLineStack);
531 
532  if ( pTwoLineAttr )
533  {
534  const auto& rTwoLineItem = CharFormat::GetItem( *pTwoLineAttr, RES_CHRATR_TWO_LINES )->StaticWhichCast(RES_CHRATR_TWO_LINES);
535  bTwoLineAct = rTwoLineItem.GetValue();
536  }
537  else
538  bTwoLineAct = m_pDefaultArray[ nTwoLineStack ]->StaticWhichCast(RES_CHRATR_TWO_LINES).GetValue();
539 
540  if ( bTwoLineAct )
541  return;
542 
543  // eventually, a rotate attribute has to be activated
544  const sal_uInt16 nRotateStack = StackPos[ RES_CHRATR_ROTATE ];
545  const SwTextAttr* pRotateAttr = GetTop(nRotateStack);
546 
547  if ( pRotateAttr )
548  {
549  const auto& rRotateItem = CharFormat::GetItem( *pRotateAttr, RES_CHRATR_ROTATE )->StaticWhichCast(RES_CHRATR_ROTATE);
550  rFnt.SetVertical( rRotateItem.GetValue(), m_bVertLayout );
551  }
552  else
553  rFnt.SetVertical( m_pDefaultArray[ nRotateStack ]->StaticWhichCast(RES_CHRATR_ROTATE).GetValue(), m_bVertLayout );
554  }
555  else if ( RES_TXTATR_INPUTFIELD == nAttr )
556  rFnt.GetInputField()--;
557 }
558 
564 void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, bool bPush )
565 {
566  switch ( rItem.Which() )
567  {
568  case RES_CHRATR_CASEMAP :
569  rFnt.SetCaseMap( rItem.StaticWhichCast(RES_CHRATR_CASEMAP).GetCaseMap() );
570  break;
571  case RES_CHRATR_COLOR :
572  rFnt.SetColor( rItem.StaticWhichCast(RES_CHRATR_COLOR).GetValue() );
573  break;
574  case RES_CHRATR_CONTOUR :
575  rFnt.SetOutline( rItem.StaticWhichCast(RES_CHRATR_CONTOUR).GetValue() );
576  break;
577  case RES_CHRATR_CROSSEDOUT :
578  rFnt.SetStrikeout( rItem.StaticWhichCast(RES_CHRATR_CROSSEDOUT).GetStrikeout() );
579  break;
580  case RES_CHRATR_ESCAPEMENT :
581  rFnt.SetEscapement( rItem.StaticWhichCast(RES_CHRATR_ESCAPEMENT).GetEsc() );
582  rFnt.SetProportion( rItem.StaticWhichCast(RES_CHRATR_ESCAPEMENT).GetProportionalHeight() );
583  break;
584  case RES_CHRATR_FONT :
585  {
586  auto& rFontItem = rItem.StaticWhichCast(RES_CHRATR_FONT);
587  rFnt.SetName( rFontItem.GetFamilyName(), SwFontScript::Latin );
588  rFnt.SetStyleName( rFontItem.GetStyleName(), SwFontScript::Latin );
589  rFnt.SetFamily( rFontItem.GetFamily(), SwFontScript::Latin );
590  rFnt.SetPitch( rFontItem.GetPitch(), SwFontScript::Latin );
591  rFnt.SetCharSet( rFontItem.GetCharSet(), SwFontScript::Latin );
592  break;
593  }
594  case RES_CHRATR_FONTSIZE :
595  rFnt.SetSize(Size(0, rItem.StaticWhichCast(RES_CHRATR_FONTSIZE).GetHeight() ), SwFontScript::Latin );
596  break;
597  case RES_CHRATR_KERNING :
598  rFnt.SetFixKerning( rItem.StaticWhichCast(RES_CHRATR_KERNING).GetValue() );
599  break;
600  case RES_CHRATR_LANGUAGE :
602  break;
603  case RES_CHRATR_POSTURE :
605  break;
606  case RES_CHRATR_SHADOWED :
607  rFnt.SetShadow( rItem.StaticWhichCast(RES_CHRATR_SHADOWED).GetValue() );
608  break;
609  case RES_CHRATR_UNDERLINE :
610  {
611  const sal_uInt16 nStackPos = StackPos[ RES_CHRATR_HIDDEN ];
612  const SwTextAttr* pTopAt = GetTop(nStackPos);
613 
614  const SfxPoolItem* pTmpItem = pTopAt ?
616  m_pDefaultArray[ nStackPos ];
617 
618  if ((m_pShell && !m_pShell->GetWin()) ||
619  (pTmpItem && !pTmpItem->StaticWhichCast(RES_CHRATR_HIDDEN).GetValue()) )
620  {
621  rFnt.SetUnderline( rItem.StaticWhichCast(RES_CHRATR_UNDERLINE).GetLineStyle() );
622  rFnt.SetUnderColor( rItem.StaticWhichCast(RES_CHRATR_UNDERLINE).GetColor() );
623  }
624  break;
625  }
626  case RES_CHRATR_BOX:
627  {
628  const SvxBoxItem& aBoxItem = rItem.StaticWhichCast(RES_CHRATR_BOX);
629  rFnt.SetTopBorder( aBoxItem.GetTop() );
630  rFnt.SetBottomBorder( aBoxItem.GetBottom() );
631  rFnt.SetRightBorder( aBoxItem.GetRight() );
632  rFnt.SetLeftBorder( aBoxItem.GetLeft() );
633  rFnt.SetTopBorderDist( aBoxItem.GetDistance(SvxBoxItemLine::TOP) );
634  rFnt.SetBottomBorderDist( aBoxItem.GetDistance(SvxBoxItemLine::BOTTOM) );
635  rFnt.SetRightBorderDist( aBoxItem.GetDistance(SvxBoxItemLine::RIGHT) );
636  rFnt.SetLeftBorderDist( aBoxItem.GetDistance(SvxBoxItemLine::LEFT) );
637  break;
638  }
639  case RES_CHRATR_SHADOW:
640  {
641  const SvxShadowItem& aShadowItem = rItem.StaticWhichCast(RES_CHRATR_SHADOW);
642  rFnt.SetShadowColor( aShadowItem.GetColor() );
643  rFnt.SetShadowWidth( aShadowItem.GetWidth() );
644  rFnt.SetShadowLocation( aShadowItem.GetLocation() );
645  break;
646  }
647  case RES_CHRATR_OVERLINE :
648  rFnt.SetOverline( rItem.StaticWhichCast(RES_CHRATR_OVERLINE).GetLineStyle() );
649  rFnt.SetOverColor( rItem.StaticWhichCast(RES_CHRATR_OVERLINE).GetColor() );
650  break;
651  case RES_CHRATR_WEIGHT :
653  break;
655  rFnt.SetWordLineMode( rItem.StaticWhichCast(RES_CHRATR_WORDLINEMODE).GetValue() );
656  break;
657  case RES_CHRATR_AUTOKERN :
658  if( rItem.StaticWhichCast(RES_CHRATR_AUTOKERN).GetValue() )
659  {
662  FontKerning::FontSpecific :
663  FontKerning::Asian );
664  }
665  else
666  rFnt.SetAutoKern( FontKerning::NONE );
667  break;
668  case RES_CHRATR_BACKGROUND :
669  rFnt.SetBackColor(rItem.StaticWhichCast(RES_CHRATR_BACKGROUND).GetColor());
670  break;
671  case RES_CHRATR_HIGHLIGHT :
672  rFnt.SetHighlightColor( rItem.StaticWhichCast(RES_CHRATR_HIGHLIGHT).GetColor() );
673  break;
674  case RES_CHRATR_CJK_FONT :
675  {
676  auto& rFontItem = rItem.StaticWhichCast(RES_CHRATR_CJK_FONT);
677  rFnt.SetName( rFontItem.GetFamilyName(), SwFontScript::CJK );
678  rFnt.SetStyleName( rFontItem.GetStyleName(), SwFontScript::CJK );
679  rFnt.SetFamily( rFontItem.GetFamily(), SwFontScript::CJK );
680  rFnt.SetPitch( rFontItem.GetPitch(), SwFontScript::CJK );
681  rFnt.SetCharSet( rFontItem.GetCharSet(), SwFontScript::CJK );
682  break;
683  }
686  break;
689  break;
692  break;
693  case RES_CHRATR_CJK_WEIGHT :
695  break;
696  case RES_CHRATR_CTL_FONT :
697  {
698  auto& rFontItem = rItem.StaticWhichCast(RES_CHRATR_CTL_FONT);
699  rFnt.SetName( rFontItem.GetFamilyName(), SwFontScript::CTL );
700  rFnt.SetStyleName( rFontItem.GetStyleName(), SwFontScript::CTL );
701  rFnt.SetFamily( rFontItem.GetFamily(), SwFontScript::CTL );
702  rFnt.SetPitch( rFontItem.GetPitch(), SwFontScript::CTL );
703  rFnt.SetCharSet( rFontItem.GetCharSet(), SwFontScript::CTL );
704  break;
705  }
708  break;
711  break;
714  break;
715  case RES_CHRATR_CTL_WEIGHT :
717  break;
719  rFnt.SetEmphasisMark( rItem.StaticWhichCast(RES_CHRATR_EMPHASIS_MARK).GetEmphasisMark() );
720  break;
721  case RES_CHRATR_SCALEW :
722  rFnt.SetPropWidth( rItem.StaticWhichCast(RES_CHRATR_SCALEW).GetValue() );
723  break;
724  case RES_CHRATR_RELIEF :
725  rFnt.SetRelief( rItem.StaticWhichCast(RES_CHRATR_RELIEF).GetValue() );
726  break;
727  case RES_CHRATR_HIDDEN :
728  if (m_pShell && m_pShell->GetWin())
729  {
730  if ( rItem.StaticWhichCast(RES_CHRATR_HIDDEN).GetValue() )
732  else
734  }
735  break;
736  case RES_CHRATR_ROTATE :
737  {
738  // rotate attribute is applied, when:
739  // 1. ruby stack is empty and
740  // 2. top of two line stack ( or default attribute )is an
741  // deactivated two line attribute
742  const bool bRuby =
743  0 != m_aAttrStack[ StackPos[ RES_TXTATR_CJK_RUBY ] ].size();
744 
745  if ( bRuby )
746  break;
747 
748  const sal_uInt16 nTwoLineStack = StackPos[ RES_CHRATR_TWO_LINES ];
749  bool bTwoLineAct = false;
750  const SwTextAttr* pTwoLineAttr = GetTop(nTwoLineStack);
751 
752  if ( pTwoLineAttr )
753  {
754  const auto& rTwoLineItem = CharFormat::GetItem( *pTwoLineAttr, RES_CHRATR_TWO_LINES )->StaticWhichCast(RES_CHRATR_TWO_LINES);
755  bTwoLineAct = rTwoLineItem.GetValue();
756  }
757  else
758  bTwoLineAct = m_pDefaultArray[ nTwoLineStack ]->StaticWhichCast(RES_CHRATR_TWO_LINES).GetValue();
759 
760  if ( !bTwoLineAct )
762 
763  break;
764  }
765  case RES_CHRATR_TWO_LINES :
766  {
767  bool bRuby = 0 !=
769 
770  // two line is activated, if
771  // 1. no ruby attribute is set and
772  // 2. attribute is active
773  if ( !bRuby && rItem.StaticWhichCast(RES_CHRATR_TWO_LINES).GetValue() )
774  {
775  rFnt.SetVertical( 0_deg10, m_bVertLayout );
776  break;
777  }
778 
779  // a deactivating two line attribute is on top of stack,
780  // check if rotate attribute has to be enabled
781  if ( bRuby )
782  break;
783 
784  const sal_uInt16 nRotateStack = StackPos[ RES_CHRATR_ROTATE ];
785  const SwTextAttr* pRotateAttr = GetTop(nRotateStack);
786 
787  if ( pRotateAttr )
788  {
789  const auto& rRotateItem = CharFormat::GetItem( *pRotateAttr, RES_CHRATR_ROTATE )->StaticWhichCast(RES_CHRATR_ROTATE);
790  rFnt.SetVertical( rRotateItem.GetValue(), m_bVertLayout );
791  }
792  else
793  rFnt.SetVertical(m_pDefaultArray[ nRotateStack ]->StaticWhichCast(RES_CHRATR_ROTATE).GetValue(), m_bVertLayout);
794  break;
795  }
796  case RES_TXTATR_CJK_RUBY :
797  rFnt.SetVertical( 0_deg10, m_bVertLayout );
798  break;
799  case RES_TXTATR_REFMARK :
800  if ( bPush )
801  rFnt.GetRef()++;
802  else
803  rFnt.GetRef()--;
804  break;
805  case RES_TXTATR_TOXMARK :
806  if ( bPush )
807  rFnt.GetTox()++;
808  else
809  rFnt.GetTox()--;
810  break;
811  case RES_TXTATR_META:
813  if ( bPush )
814  rFnt.GetMeta()++;
815  else
816  rFnt.GetMeta()--;
817  break;
818  case RES_TXTATR_INPUTFIELD :
819  if ( bPush )
820  rFnt.GetInputField()++;
821  else
822  rFnt.GetInputField()--;
823  break;
824  }
825 }
826 
829  sal_uInt16& nAscent, sal_uInt16& nHeight ) const
830 {
831  OSL_ENSURE(m_pFnt, "No font available for GetDefaultAscentAndHeight");
832 
833  if (m_pFnt)
834  {
835  SwFont aFont( *m_pFnt );
836  nHeight = aFont.GetHeight( pShell, rOut );
837  nAscent = aFont.GetAscent( pShell, rOut );
838  }
839 }
840 
841 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetLeftBorderDist(const sal_uInt16 nLeftDist)
Definition: swfont.hxx:848
vcl::RenderContext * GetOut() const
Definition: viewsh.hxx:338
OutDevType GetOutDevType() const
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
SwCharFormat * GetCharFormat()
Definition: txtatr2.cxx:111
bool IsPagePreview() const
Definition: viewopt.hxx:635
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
void Pop(const SwTextAttr &rAttr)
Only used during redlining.
Definition: atrstck.cxx:466
static bool IsVisitedLinks()
Definition: viewopt.hxx:670
bool IsPriorityAttr() const
Definition: txatbase.hxx:101
void SetWordLineMode(const bool bWordLineMode)
Definition: swfont.hxx:668
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:471
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_METAFIELD(49)
void PopAndChg(const SwTextAttr &rAttr, SwFont &rFnt)
Definition: atrstck.cxx:426
std::string GetValue
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_META(48)
void FontChg(const SfxPoolItem &rItem, SwFont &rFnt, bool bPush)
When popping an attribute from the stack, the top more remaining attribute in the stack becomes valid...
Definition: atrstck.cxx:564
const SfxPoolItem * GetItem(const SwTextAttr &rAttr, sal_uInt16 nWhich)
Extracts pool item of type nWhich from rAttr.
Definition: atrstck.cxx:156
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
static Color & GetLinksColor()
Definition: viewopt.cxx:422
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:682
sal_uInt16 GetDistance(SvxBoxItemLine nLine) const
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxAutoKernItem > RES_CHRATR_AUTOKERN(17)
bool IsVisited() const
Definition: txtinet.hxx:54
const SfxPoolItem * m_pDefaultArray[NUM_DEFAULT_VALUES]
Definition: atrhndl.hxx:42
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
sal_uInt16 Which() const
Definition: txatbase.hxx:114
void SetOutline(const bool bOutline)
Definition: swfont.hxx:600
const editeng::SvxBorderLine * GetRight() const
void SetPropWidth(const sal_uInt16 nNew)
Definition: swfont.hxx:690
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
sal_uInt8 & GetRef()
Definition: swfont.hxx:249
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
void SetBottomBorderDist(const sal_uInt16 nBottomDist)
Definition: swfont.hxx:834
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
Definition: swfont.hxx:501
constexpr TypedWhichId< SvxTwoLinesItem > RES_CHRATR_TWO_LINES(34)
#define NUM_DEFAULT_VALUES
Definition: swfntcch.hxx:22
void SetColor(const Color &rColor)
Definition: swfont.hxx:411
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
void SetShadow(const bool bShadow)
Definition: swfont.hxx:615
bool m_bVertLayoutLRBT
Definition: atrhndl.hxx:51
const SfxPoolItem * NextItem()
SvxShadowLocation GetLocation() const
bool m_bVertLayout
Definition: atrhndl.hxx:50
constexpr TypedWhichId< SvxShadowItem > RES_CHRATR_SHADOW(41)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
Definition: txatbase.hxx:41
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:323
static Color & GetVisitedLinksColor()
Definition: viewopt.cxx:427
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
void SetShadowColor(const Color &rColor)
Definition: swfont.hxx:920
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:542
constexpr TypedWhichId< SvxCharReliefItem > RES_CHRATR_RELIEF(36)
void SetShadowLocation(const SvxShadowLocation aLocation)
Definition: swfont.hxx:934
std::unique_ptr< SwFont > m_pFnt
Definition: atrhndl.hxx:48
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
void SetStrikeout(const FontStrikeout eStrikeout)
Definition: swfont.hxx:572
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
void SetLeftBorder(const editeng::SvxBorderLine *pLeftBorder)
Definition: swfont.cxx:110
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
OUTDEV_PRINTER
const Color & GetColor() const
void SetStyleName(const OUString &rStyleName, const SwFontScript nWhich)
Definition: swfont.hxx:474
const editeng::SvxBorderLine * GetTop() const
void SetLanguage(LanguageType eNewLang, const SwFontScript nWhich)
Definition: swfont.hxx:804
void Reset()
Definition: atrstck.cxx:335
void Init(const SwAttrSet &rAttrSet, const IDocumentSettingAccess &rIDocumentSettingAccess)
Definition: atrstck.cxx:277
void SetRightBorder(const editeng::SvxBorderLine *pRightBorder)
Definition: swfont.cxx:97
const editeng::SvxBorderLine * GetLeft() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetVisited(bool bNew)
Definition: txtinet.hxx:55
int i
T & StaticWhichCast(TypedWhichId< T > nId)
void SetUnderColor(const Color &rColor)
Definition: swfont.hxx:214
void SetRightBorderDist(const sal_uInt16 nRightDist)
Definition: swfont.hxx:841
void SetShadowWidth(const sal_uInt16 nWidth)
Definition: swfont.hxx:927
void SetCaseMap(const SvxCaseMap eNew)
Definition: swfont.hxx:654
constexpr sal_uInt16 RES_TXTATR_WITHEND_END(56)
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
Definition: swfont.cxx:417
sal_uInt16 Count() const
constexpr TypedWhichId< SvxShadowedItem > RES_CHRATR_SHADOWED(13)
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:708
const IDocumentSettingAccess * m_pIDocumentSettingAccess
Definition: atrhndl.hxx:43
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
Returns the item set associated with a character/inet/auto style.
Definition: atrstck.cxx:132
void SetEscapement(const short nNewEsc)
Definition: swfont.hxx:781
Provides access to settings of a document.
void RemoveFromStack(sal_uInt16 nWhich, const SwTextAttr &rAttr)
Definition: atrstck.cxx:418
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:388
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
Definition: swfont.hxx:529
void GetDefaultAscentAndHeight(SwViewShell const *pShell, OutputDevice const &rOut, sal_uInt16 &nAscent, sal_uInt16 &nHeight) const
Takes the default font and calculated the ascent and height.
Definition: atrstck.cxx:828
bool IsPDFExport() const
Definition: viewopt.hxx:417
Shell * m_pShell
bool Push(const SwTextAttr &rAttr, const SfxPoolItem &rItem)
Definition: atrstck.cxx:390
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
constexpr TypedWhichId< SvxEmphasisMarkItem > RES_CHRATR_EMPHASIS_MARK(33)
sal_uInt8 & GetMeta()
Definition: swfont.hxx:251
void SetOverColor(const Color &rColor)
Definition: swfont.hxx:216
const SwTextAttr * GetTop(sal_uInt16 nStack)
Definition: atrstck.cxx:385
void SetFixKerning(const short nNewKern)
Definition: swfont.hxx:647
constexpr TypedWhichId< SvxCharScaleWidthItem > RES_CHRATR_SCALEW(35)
constexpr TypedWhichId< SvxCharHiddenItem > RES_CHRATR_HIDDEN(37)
void SetBottomBorder(const editeng::SvxBorderLine *pBottomBorder)
Definition: swfont.cxx:84
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
static bool IsLinks()
Definition: viewopt.hxx:669
const sal_uInt8 StackPos[RES_TXTATR_WITHEND_END-RES_CHRATR_BEGIN+1]
Attribute to Stack Mapping.
Definition: atrstck.cxx:68
const SwViewShell * m_pShell
Definition: atrhndl.hxx:44
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
sal_uInt8 & GetInputField()
Definition: swfont.hxx:253
sal_uInt8 & GetTox()
Definition: swfont.hxx:247
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetBackColor(std::optional< Color > xNewColor)
Definition: swfont.cxx:64
void SetSize(const Size &rSize, const SwFontScript nWhich)
Definition: swfont.hxx:734
unsigned char sal_uInt8
constexpr TypedWhichId< SvxWordLineModeItem > RES_CHRATR_WORDLINEMODE(16)
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:423
vcl::Window * GetWin() const
Definition: viewsh.hxx:337
LINESTYLE_DOTTED
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
void SetTopBorder(const editeng::SvxBorderLine *pTopBorder)
Definition: swfont.cxx:71
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
void SetFamily(const FontFamily eFamily, const SwFontScript nWhich)
Definition: swfont.hxx:448
void SetCharSet(const rtl_TextEncoding eCharSet, const SwFontScript nWhich)
Definition: swfont.hxx:487
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
void ActivateTop(SwFont &rFnt, sal_uInt16 nStackPos)
Definition: atrstck.cxx:477
std::vector< const SwTextAttr * > m_aAttrStack[NUM_ATTRIBUTE_STACKS]
Definition: atrhndl.hxx:41
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
constexpr sal_uInt16 RES_CHRATR_END(46)
void SetName(const OUString &rName, const SwFontScript nWhich)
Definition: swfont.hxx:461
void PushAndChg(const SwTextAttr &rAttr, SwFont &rFnt)
Definition: atrstck.cxx:341
const SfxPoolItem & GetAttr() const
Definition: txatbase.hxx:163
bool IsItemIncluded(const sal_uInt16 nWhich, const SwTextAttr *pAttr)
Checks if item is included in character/inet/auto style.
Definition: atrstck.cxx:176
void SetAutoKern(FontKerning nAutoKern)
Definition: swfont.hxx:630
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
void SetItalic(const FontItalic eItalic, const SwFontScript nWhich)
Definition: swfont.hxx:587
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:120
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:762
void SetHighlightColor(const Color &aNewColor)
Definition: swfont.hxx:941
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
static bool lcl_ChgHyperLinkColor(const SwTextAttr &rAttr, const SfxPoolItem &rItem, const SwViewShell *pShell, Color *pColor)
The color of hyperlinks is taken from the associated character attribute, depending on its 'visited' ...
Definition: atrstck.cxx:195
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxKerningItem > RES_CHRATR_KERNING(9)
void SetOverline(const FontLineStyle eOverline)
Definition: swfont.hxx:557
const editeng::SvxBorderLine * GetBottom() const
tools::Long GetHeight() const
Definition: swfont.hxx:280
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
sal_uInt16 Which() const
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
void SetTopBorderDist(const sal_uInt16 nTopDist)
Definition: swfont.hxx:827
const SfxPoolItem * GetCurItem() const
sal_uInt16 GetWidth() const
constexpr TypedWhichId< SvxContourItem > RES_CHRATR_CONTOUR(4)