LibreOffice Module sw (master)  1
DocumentStylePoolManager.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  */
20 #include <SwStyleNameMapper.hxx>
21 #include <doc.hxx>
23 #include <IDocumentState.hxx>
24 #include <IDocumentUndoRedo.hxx>
25 #include <fmtanchr.hxx>
26 #include <fmtfsize.hxx>
27 #include <paratr.hxx>
28 #include <poolfmt.hxx>
29 #include <fmtornt.hxx>
30 #include <charfmt.hxx>
31 #include <fmtsrnd.hxx>
32 #include <docary.hxx>
33 #include <GetMetricVal.hxx>
34 #include <pagedesc.hxx>
35 #include <frmfmt.hxx>
36 #include <fmtline.hxx>
37 #include <numrule.hxx>
38 #include <hints.hxx>
39 #include <editeng/paperinf.hxx>
40 #include <editeng/wghtitem.hxx>
41 #include <editeng/fontitem.hxx>
42 #include <editeng/fhgtitem.hxx>
43 #include <editeng/tstpitem.hxx>
44 #include <editeng/lrspitem.hxx>
45 #include <editeng/ulspitem.hxx>
46 #include <editeng/lspcitem.hxx>
47 #include <editeng/adjustitem.hxx>
48 #include <editeng/postitem.hxx>
49 #include <editeng/keepitem.hxx>
50 #include <editeng/opaqitem.hxx>
51 #include <editeng/boxitem.hxx>
52 #include <editeng/cmapitem.hxx>
53 #include <editeng/udlnitem.hxx>
54 #include <editeng/colritem.hxx>
55 #include <editeng/protitem.hxx>
57 #include <editeng/langitem.hxx>
61 #include <svx/strings.hrc>
62 #include <svx/dialmgr.hxx>
63 #include <sal/log.hxx>
64 #include <osl/diagnose.h>
65 #include <strings.hrc>
66 #include <frmatr.hxx>
67 #include <frameformats.hxx>
68 #include <com/sun/star/text/VertOrientation.hpp>
69 #include <com/sun/star/text/RelOrientation.hpp>
70 #include <com/sun/star/text/HoriOrientation.hpp>
71 
72 using namespace ::editeng;
73 using namespace ::com::sun::star;
74 
75 bool IsConditionalByPoolId(sal_uInt16 nId)
76 {
77  // TODO: why is this style conditional?
78  // If it is changed to no longer be conditional, then a style "Text Body"
79  // will be imported without its conditions from ODF.
80  return RES_POOLCOLL_TEXT == nId;
81 }
82 
83 namespace
84 {
85  const sal_uInt16 PT_3 = 3 * 20; // 3 pt
86  const sal_uInt16 PT_6 = 6 * 20; // 6 pt
87  const sal_uInt16 PT_7 = 7 * 20; // 7 pt
88  const sal_uInt16 PT_10 = 10 * 20; // 10 pt
89  const sal_uInt16 PT_12 = 12 * 20; // 12 pt
90  const sal_uInt16 PT_14 = 14 * 20; // 14 pt
91  const sal_uInt16 PT_16 = 16 * 20; // 16 pt
92  const sal_uInt16 PT_18 = 18 * 20; // 18 pt
93  const sal_uInt16 PT_24 = 24 * 20; // 24 pt
94  const sal_uInt16 PT_28 = 28 * 20; // 28 pt
95 
96  #define HTML_PARSPACE GetMetricVal( CM_05 )
97 
98  const sal_uInt16 aHeadlineSizes[ 2 * MAXLEVEL ] = {
99  // we do everything percentual now:
100  130, 115, 101, 95, 85,
101  85, 80, 80, 75, 75, // normal
102  PT_24, PT_18, PT_14, PT_12, PT_10,
103  PT_7, PT_7, PT_7, PT_7, PT_7 // HTML mode
104  };
105 
106  long lcl_GetRightMargin( SwDoc& rDoc )
107  {
108  // Make sure that the printer settings are taken over to the standard
109  // page style
110  const SwFrameFormat& rPgDscFormat = rDoc.GetPageDesc( 0 ).GetMaster();
111  const SvxLRSpaceItem& rLR = rPgDscFormat.GetLRSpace();
112  const long nLeft = rLR.GetLeft();
113  const long nRight = rLR.GetRight();
114  const long nWidth = rPgDscFormat.GetFrameSize().GetWidth();
115  return nWidth - nLeft - nRight;
116  }
117 
118  void lcl_SetDfltFont( DefaultFontType nFntType, SfxItemSet& rSet )
119  {
120  static struct {
121  sal_uInt16 nResLngId;
122  sal_uInt16 nResFntId;
123  } aArr[ 3 ] = {
127  };
128  for(const auto & n : aArr)
129  {
130  LanguageType nLng = static_cast<const SvxLanguageItem&>(rSet.GetPool()->GetDefaultItem(
131  n.nResLngId )).GetLanguage();
132  vcl::Font aFnt( OutputDevice::GetDefaultFont( nFntType,
133  nLng, GetDefaultFontFlags::OnlyOne ) );
134 
135  rSet.Put( SvxFontItem( aFnt.GetFamilyType(), aFnt.GetFamilyName(),
136  OUString(), aFnt.GetPitch(),
137  aFnt.GetCharSet(), n.nResFntId ));
138  }
139  }
140 
141  void lcl_SetDfltFont( DefaultFontType nLatinFntType, DefaultFontType nCJKFntType,
142  DefaultFontType nCTLFntType, SfxItemSet& rSet )
143  {
144  static struct {
145  sal_uInt16 nResLngId;
146  sal_uInt16 nResFntId;
147  DefaultFontType nFntType;
148  } aArr[ 3 ] = {
152  };
153  aArr[0].nFntType = nLatinFntType;
154  aArr[1].nFntType = nCJKFntType;
155  aArr[2].nFntType = nCTLFntType;
156 
157  for(const auto & n : aArr)
158  {
159  LanguageType nLng = static_cast<const SvxLanguageItem&>(rSet.GetPool()->GetDefaultItem(
160  n.nResLngId )).GetLanguage();
161  vcl::Font aFnt( OutputDevice::GetDefaultFont( n.nFntType,
162  nLng, GetDefaultFontFlags::OnlyOne ) );
163 
164  rSet.Put( SvxFontItem( aFnt.GetFamilyType(), aFnt.GetFamilyName(),
165  OUString(), aFnt.GetPitch(),
166  aFnt.GetCharSet(), n.nResFntId ));
167  }
168  }
169 
170  void lcl_SetHeadline( SwDoc* pDoc, SwTextFormatColl* pColl,
171  SfxItemSet& rSet,
172  sal_uInt16 nOutLvlBits, sal_uInt8 nLevel, bool bItalic )
173  {
174  SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) );
175  SvxFontHeightItem aHItem(240, 100, RES_CHRATR_FONTSIZE);
176  const bool bHTMLMode = pDoc->GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE);
177  if( bHTMLMode )
178  aHItem.SetHeight( aHeadlineSizes[ MAXLEVEL + nLevel ] );
179  else
180  aHItem.SetHeight( PT_14, aHeadlineSizes[ nLevel ] );
181  SetAllScriptItem( rSet, aHItem );
182 
183  if( bItalic && !bHTMLMode )
184  SetAllScriptItem( rSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE ) );
185 
186  if( bHTMLMode )
187  {
188  lcl_SetDfltFont( DefaultFontType::LATIN_TEXT, DefaultFontType::CJK_TEXT,
189  DefaultFontType::CTL_TEXT, rSet );
190  }
191 
192  if( !pColl )
193  return;
194 
195  if( !( nOutLvlBits & ( 1 << nLevel )) )
196  {
197  pColl->AssignToListLevelOfOutlineStyle(nLevel);
198  if( !bHTMLMode )
199  {
200  SwNumRule * pOutlineRule = pDoc->GetOutlineNumRule();
201  const SwNumFormat& rNFormat = pOutlineRule->Get( nLevel );
202 
203  if ( rNFormat.GetPositionAndSpaceMode() ==
205  ( rNFormat.GetAbsLSpace() || rNFormat.GetFirstLineOffset() ) )
206  {
207  SvxLRSpaceItem aLR( pColl->GetFormatAttr( RES_LR_SPACE ) );
209  //TODO: overflow
210  aLR.SetTextLeft( rNFormat.GetAbsLSpace() );
211  pColl->SetFormatAttr( aLR );
212  }
213 
214  // All paragraph styles, which are assigned to a level of the
215  // outline style has to have the outline style set as its list style.
216  SwNumRuleItem aItem(pOutlineRule->GetName());
217  pColl->SetFormatAttr(aItem);
218  }
219  }
221  }
222 
223  void lcl_SetRegister( SwDoc* pDoc, SfxItemSet& rSet, sal_uInt16 nFact,
224  bool bHeader, bool bTab )
225  {
227  sal_uInt16 nLeft = nFact ? GetMetricVal( CM_05 ) * nFact : 0;
228  aLR.SetTextLeft( nLeft );
229 
230  rSet.Put( aLR );
231  if( bHeader )
232  {
233  SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) );
235  }
236  if( bTab )
237  {
238  long nRightMargin = lcl_GetRightMargin( *pDoc );
239  SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
240  aTStops.Insert( SvxTabStop( nRightMargin - nLeft,
241  SvxTabAdjust::Right,
242  cDfltDecimalChar, '.' ));
243  rSet.Put( aTStops );
244  }
245  }
246 
247  void lcl_SetNumBul( SwDoc* pDoc, SwTextFormatColl* pColl,
248  SfxItemSet& rSet,
249  sal_uInt16 nNxt, SwTwips nEZ, SwTwips nLeft,
250  SwTwips nUpper, SwTwips nLower )
251  {
252 
255  aLR.SetTextFirstLineOffset( sal_uInt16(nEZ) );
256  aLR.SetTextLeft( sal_uInt16(nLeft) );
257  aUL.SetUpper( sal_uInt16(nUpper) );
258  aUL.SetLower( sal_uInt16(nLower) );
259  rSet.Put( aLR );
260  rSet.Put( aUL );
261 
262  if( pColl )
264  }
265 
266  void lcl_PutStdPageSizeIntoItemSet( SwDoc* pDoc, SfxItemSet& rSet )
267  {
269  SwFormatFrameSize aFrameSz( pStdPgDsc->GetMaster().GetFrameSize() );
270  if( pStdPgDsc->GetLandscape() )
271  {
272  SwTwips nTmp = aFrameSz.GetHeight();
273  aFrameSz.SetHeight( aFrameSz.GetWidth() );
274  aFrameSz.SetWidth( nTmp );
275  }
276  rSet.Put( aFrameSz );
277  }
278 }
279 
280 static const char* STR_POOLCOLL_TEXT_ARY[] =
281 {
282  // Category Text
283  STR_POOLCOLL_STANDARD,
284  STR_POOLCOLL_TEXT,
285  STR_POOLCOLL_TEXT_IDENT,
286  STR_POOLCOLL_TEXT_NEGIDENT,
287  STR_POOLCOLL_TEXT_MOVE,
288  STR_POOLCOLL_GREETING,
289  STR_POOLCOLL_SIGNATURE,
290  STR_POOLCOLL_CONFRONTATION,
291  STR_POOLCOLL_MARGINAL,
292  // Subcategory Headlines
293  STR_POOLCOLL_HEADLINE_BASE,
294  STR_POOLCOLL_HEADLINE1,
295  STR_POOLCOLL_HEADLINE2,
296  STR_POOLCOLL_HEADLINE3,
297  STR_POOLCOLL_HEADLINE4,
298  STR_POOLCOLL_HEADLINE5,
299  STR_POOLCOLL_HEADLINE6,
300  STR_POOLCOLL_HEADLINE7,
301  STR_POOLCOLL_HEADLINE8,
302  STR_POOLCOLL_HEADLINE9,
303  STR_POOLCOLL_HEADLINE10
304 };
305 
306 static const char* STR_POOLCOLL_LISTS_ARY[]
307 {
308  // Category Lists
310  // Subcategory Numbering
331 
332  // Subcategory Enumeration
353 };
354 
355 // Special Areas
356 static const char* STR_POOLCOLL_EXTRA_ARY[]
357 {
358  // Subcategory Header
359  STR_POOLCOLL_HEADERFOOTER,
360  STR_POOLCOLL_HEADER,
361  STR_POOLCOLL_HEADERL,
362  STR_POOLCOLL_HEADERR,
363  // Subcategory Footer
364  STR_POOLCOLL_FOOTER,
365  STR_POOLCOLL_FOOTERL,
366  STR_POOLCOLL_FOOTERR,
367  // Subcategory Table
368  STR_POOLCOLL_TABLE,
369  STR_POOLCOLL_TABLE_HDLN,
370  // Subcategory Labels
371  STR_POOLCOLL_LABEL,
372  STR_POOLCOLL_LABEL_ABB,
373  STR_POOLCOLL_LABEL_TABLE,
374  STR_POOLCOLL_LABEL_FRAME,
375  STR_POOLCOLL_LABEL_FIGURE,
376  // Miscellaneous
377  STR_POOLCOLL_FRAME,
378  STR_POOLCOLL_FOOTNOTE,
379  STR_POOLCOLL_JAKETADRESS,
380  STR_POOLCOLL_SENDADRESS,
381  STR_POOLCOLL_ENDNOTE,
382  STR_POOLCOLL_LABEL_DRAWING
383 };
384 
385 static const char* STR_POOLCOLL_REGISTER_ARY[] =
386 {
387  // Category Directories
388  STR_POOLCOLL_REGISTER_BASE,
389  // Subcategory Index-Directories
390  STR_POOLCOLL_TOX_IDXH,
391  STR_POOLCOLL_TOX_IDX1,
392  STR_POOLCOLL_TOX_IDX2,
393  STR_POOLCOLL_TOX_IDX3,
394  STR_POOLCOLL_TOX_IDXBREAK,
395  // Subcategory Tables of Contents
396  STR_POOLCOLL_TOX_CNTNTH,
397  STR_POOLCOLL_TOX_CNTNT1,
398  STR_POOLCOLL_TOX_CNTNT2,
399  STR_POOLCOLL_TOX_CNTNT3,
400  STR_POOLCOLL_TOX_CNTNT4,
401  STR_POOLCOLL_TOX_CNTNT5,
402  // Subcategory User-Directories:
403  STR_POOLCOLL_TOX_USERH,
404  STR_POOLCOLL_TOX_USER1,
405  STR_POOLCOLL_TOX_USER2,
406  STR_POOLCOLL_TOX_USER3,
407  STR_POOLCOLL_TOX_USER4,
408  STR_POOLCOLL_TOX_USER5,
409  // Subcategory Table of Contents more Levels 5 - 10
410  STR_POOLCOLL_TOX_CNTNT6,
411  STR_POOLCOLL_TOX_CNTNT7,
412  STR_POOLCOLL_TOX_CNTNT8,
413  STR_POOLCOLL_TOX_CNTNT9,
414  STR_POOLCOLL_TOX_CNTNT10,
415  // Illustrations Index
416  STR_POOLCOLL_TOX_ILLUSH,
417  STR_POOLCOLL_TOX_ILLUS1,
418  // Object Index
419  STR_POOLCOLL_TOX_OBJECTH,
420  STR_POOLCOLL_TOX_OBJECT1,
421  // Tables Index
422  STR_POOLCOLL_TOX_TABLESH,
423  STR_POOLCOLL_TOX_TABLES1,
424  // Index of Authorities
425  STR_POOLCOLL_TOX_AUTHORITIESH,
426  STR_POOLCOLL_TOX_AUTHORITIES1,
427  // Subcategory User-Directories more Levels 5 - 10
428  STR_POOLCOLL_TOX_USER6,
429  STR_POOLCOLL_TOX_USER7,
430  STR_POOLCOLL_TOX_USER8,
431  STR_POOLCOLL_TOX_USER9,
432  STR_POOLCOLL_TOX_USER10
433 };
434 
435 static const char* STR_POOLCOLL_DOC_ARY[] =
436 {
437  // Category Chapter/Document
438  STR_POOLCOLL_DOC_TITLE,
439  STR_POOLCOLL_DOC_SUBTITLE,
440  STR_POOLCOLL_DOC_APPENDIX
441 };
442 
443 static const char* STR_POOLCOLL_HTML_ARY[] =
444 {
445  // Category HTML-Templates
446  STR_POOLCOLL_HTML_BLOCKQUOTE,
447  STR_POOLCOLL_HTML_PRE,
448  STR_POOLCOLL_HTML_HR,
449  STR_POOLCOLL_HTML_DD,
450  STR_POOLCOLL_HTML_DT
451 };
452 
453 static const char* STR_POOLCHR_ARY[] =
454 {
455  STR_POOLCHR_FOOTNOTE,
456  STR_POOLCHR_PAGENO,
457  STR_POOLCHR_LABEL,
458  STR_POOLCHR_DROPCAPS,
459  STR_POOLCHR_NUM_LEVEL,
460  STR_POOLCHR_BULLET_LEVEL,
461  STR_POOLCHR_INET_NORMAL,
462  STR_POOLCHR_INET_VISIT,
463  STR_POOLCHR_JUMPEDIT,
464  STR_POOLCHR_TOXJUMP,
465  STR_POOLCHR_ENDNOTE,
466  STR_POOLCHR_LINENUM,
467  STR_POOLCHR_IDX_MAIN_ENTRY,
468  STR_POOLCHR_FOOTNOTE_ANCHOR,
469  STR_POOLCHR_ENDNOTE_ANCHOR,
470  STR_POOLCHR_RUBYTEXT,
471  STR_POOLCHR_VERT_NUM
472 };
473 
474 static const char* STR_POOLCHR_HTML_ARY[] =
475 {
476  STR_POOLCHR_HTML_EMPHASIS,
477  STR_POOLCHR_HTML_CITIATION,
478  STR_POOLCHR_HTML_STRONG,
479  STR_POOLCHR_HTML_CODE,
480  STR_POOLCHR_HTML_SAMPLE,
481  STR_POOLCHR_HTML_KEYBOARD,
482  STR_POOLCHR_HTML_VARIABLE,
483  STR_POOLCHR_HTML_DEFINSTANCE,
484  STR_POOLCHR_HTML_TELETYPE
485 };
486 
487 static const char* STR_POOLFRM_ARY[] =
488 {
489  STR_POOLFRM_FRAME,
490  STR_POOLFRM_GRAPHIC,
491  STR_POOLFRM_OLE,
492  STR_POOLFRM_FORMEL,
493  STR_POOLFRM_MARGINAL,
494  STR_POOLFRM_WATERSIGN,
495  STR_POOLFRM_LABEL
496 };
497 
498 static const char* STR_POOLPAGE_ARY[] =
499 {
500  // Page styles
501  STR_POOLPAGE_STANDARD,
502  STR_POOLPAGE_FIRST,
503  STR_POOLPAGE_LEFT,
504  STR_POOLPAGE_RIGHT,
505  STR_POOLPAGE_JAKET,
506  STR_POOLPAGE_REGISTER,
507  STR_POOLPAGE_HTML,
508  STR_POOLPAGE_FOOTNOTE,
509  STR_POOLPAGE_ENDNOTE,
510  STR_POOLPAGE_LANDSCAPE
511 };
512 
513 static const char* STR_POOLNUMRULE_NUM_ARY[] =
514 {
515  // Numbering styles
516  STR_POOLNUMRULE_NUM1,
517  STR_POOLNUMRULE_NUM2,
518  STR_POOLNUMRULE_NUM3,
519  STR_POOLNUMRULE_NUM4,
520  STR_POOLNUMRULE_NUM5,
521  STR_POOLNUMRULE_BUL1,
522  STR_POOLNUMRULE_BUL2,
523  STR_POOLNUMRULE_BUL3,
524  STR_POOLNUMRULE_BUL4,
525  STR_POOLNUMRULE_BUL5
526 };
527 
528 // XXX MUST match the entries of TableStyleProgNameTable in
529 // sw/source/core/doc/SwStyleNameMapper.cxx and MUST match the order of
530 // RES_POOL_TABLESTYLE_TYPE in sw/inc/poolfmt.hxx
531 static const char* STR_TABSTYLE_ARY[] =
532 {
533  // XXX MUST be in order, Writer first, then Svx old, then Svx new
534  // 1 Writer resource string
535  STR_TABSTYLE_DEFAULT,
536  // 16 old styles Svx resource strings
537  RID_SVXSTR_TBLAFMT_3D,
538  RID_SVXSTR_TBLAFMT_BLACK1,
539  RID_SVXSTR_TBLAFMT_BLACK2,
540  RID_SVXSTR_TBLAFMT_BLUE,
541  RID_SVXSTR_TBLAFMT_BROWN,
542  RID_SVXSTR_TBLAFMT_CURRENCY,
543  RID_SVXSTR_TBLAFMT_CURRENCY_3D,
544  RID_SVXSTR_TBLAFMT_CURRENCY_GRAY,
545  RID_SVXSTR_TBLAFMT_CURRENCY_LAVENDER,
546  RID_SVXSTR_TBLAFMT_CURRENCY_TURQUOISE,
547  RID_SVXSTR_TBLAFMT_GRAY,
548  RID_SVXSTR_TBLAFMT_GREEN,
549  RID_SVXSTR_TBLAFMT_LAVENDER,
550  RID_SVXSTR_TBLAFMT_RED,
551  RID_SVXSTR_TBLAFMT_TURQUOISE,
552  RID_SVXSTR_TBLAFMT_YELLOW,
553  // 10 new styles since LibreOffice 6.0 Svx resource strings
554  RID_SVXSTR_TBLAFMT_LO6_ACADEMIC,
555  RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_BLUE,
556  RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_GREEN,
557  RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_RED,
558  RID_SVXSTR_TBLAFMT_LO6_BOX_LIST_YELLOW,
559  RID_SVXSTR_TBLAFMT_LO6_ELEGANT,
560  RID_SVXSTR_TBLAFMT_LO6_FINANCIAL,
561  RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_COLUMNS,
562  RID_SVXSTR_TBLAFMT_LO6_SIMPLE_GRID_ROWS,
563  RID_SVXSTR_TBLAFMT_LO6_SIMPLE_LIST_SHADED
564 };
565 
566 namespace sw
567 {
568 
570 {
571 }
572 
573 SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
574 {
575  OSL_ENSURE(
580  (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) ||
582  "Wrong AutoFormat Id" );
583 
584  SwTextFormatColl* pNewColl;
585  sal_uInt16 nOutLvlBits = 0;
586  for (size_t n = 0, nSize = m_rDoc.GetTextFormatColls()->size(); n < nSize; ++n)
587  {
588  pNewColl = (*m_rDoc.GetTextFormatColls())[ n ];
589  if( nId == pNewColl->GetPoolFormatId() )
590  {
591  return pNewColl;
592  }
593 
594  if( pNewColl->IsAssignedToListLevelOfOutlineStyle())
595  nOutLvlBits |= ( 1 << pNewColl->GetAssignedOutlineStyleLevel() );
596  }
597 
598  // Didn't find it until here -> create anew
599  const char* pResId = nullptr;
601  {
602  static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_TEXT_ARY) == RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN, "### unexpected size!");
603  pResId = STR_POOLCOLL_TEXT_ARY[nId - RES_POOLCOLL_TEXT_BEGIN];
604  }
605  else if (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END)
606  {
607  static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_LISTS_ARY) == RES_POOLCOLL_LISTS_END - RES_POOLCOLL_LISTS_BEGIN, "### unexpected size!");
608  pResId = STR_POOLCOLL_LISTS_ARY[nId - RES_POOLCOLL_LISTS_BEGIN];
609  }
610  else if (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END)
611  {
612  static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_EXTRA_ARY) == RES_POOLCOLL_EXTRA_END - RES_POOLCOLL_EXTRA_BEGIN, "### unexpected size!");
614  }
616  {
617  static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_REGISTER_ARY) == RES_POOLCOLL_REGISTER_END - RES_POOLCOLL_REGISTER_BEGIN, "### unexpected size!");
618  pResId = STR_POOLCOLL_REGISTER_ARY[nId - RES_POOLCOLL_REGISTER_BEGIN];
619  }
620  else if (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END)
621  {
622  static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_DOC_ARY) == RES_POOLCOLL_DOC_END - RES_POOLCOLL_DOC_BEGIN, "### unexpected size!");
623  pResId = STR_POOLCOLL_DOC_ARY[nId - RES_POOLCOLL_DOC_BEGIN];
624  }
625  else if (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END)
626  {
627  static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_HTML_ARY) == RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN, "### unexpected size!");
628  pResId = STR_POOLCOLL_HTML_ARY[nId - RES_POOLCOLL_HTML_BEGIN];
629  }
630 
631  OSL_ENSURE(pResId, "Invalid Pool ID");
632  if (!pResId)
634 
635  OUString aNm(SwResId(pResId));
636 
637  // A Set for all to-be-set Attributes
639  sal_uInt16 nParent = GetPoolParent( nId );
640 
641  {
642 
643 //FEATURE::CONDCOLL
644  if(::IsConditionalByPoolId( nId ))
645  pNewColl = new SwConditionTextFormatColl( m_rDoc.GetAttrPool(), aNm, !nParent
647  : GetTextCollFromPool( nParent ));
648  else
649 //FEATURE::CONDCOLL
650  pNewColl = new SwTextFormatColl( m_rDoc.GetAttrPool(), aNm, !nParent
652  : GetTextCollFromPool( nParent ));
653  pNewColl->SetPoolFormatId( nId );
654  m_rDoc.GetTextFormatColls()->push_back( pNewColl );
655  }
656 
658  if ( !bNoDefault )
659  {
660  switch( nId )
661  {
662  // General content forms
664  /* koreans do not like SvxScriptItem(TRUE) */
665  if (bRegardLanguage)
666  {
667  LanguageType nAppLanguage = GetAppLanguage();
668  if (GetDefaultFrameDirection(nAppLanguage) ==
669  SvxFrameDirection::Horizontal_RL_TB)
670  {
671  SvxAdjustItem aAdjust(SvxAdjust::Right, RES_PARATR_ADJUST );
672  aSet.Put(aAdjust);
673  }
674  if (nAppLanguage == LANGUAGE_KOREAN)
675  {
676  SvxScriptSpaceItem aScriptSpace(false, RES_PARATR_SCRIPTSPACE);
677  aSet.Put(aScriptSpace);
678  }
679  }
680  break;
681 
682  case RES_POOLCOLL_TEXT: // Text body
683  {
685  SvxULSpaceItem aUL( 0, PT_7, RES_UL_SPACE );
686  aLSpc.SetPropLineSpace( 115 );
688  aSet.Put( aUL );
689  aSet.Put( aLSpc );
690  }
691  break;
692  case RES_POOLCOLL_TEXT_IDENT: // Text body indentation
693  {
696  aSet.Put( aLR );
697  }
698  break;
699  case RES_POOLCOLL_TEXT_NEGIDENT: // Text body neg. indentation
700  {
702  aLR.SetTextFirstLineOffset( -static_cast<short>(GetMetricVal( CM_05 )));
703  aLR.SetTextLeft( GetMetricVal( CM_1 ));
705  aTStops.Insert( SvxTabStop( 0 ));
706 
707  aSet.Put( aLR );
708  aSet.Put( aTStops );
709  }
710  break;
711  case RES_POOLCOLL_TEXT_MOVE: // Text body move
712  {
714  aLR.SetTextLeft( GetMetricVal( CM_05 ));
715  aSet.Put( aLR );
716  }
717  break;
718 
719  case RES_POOLCOLL_CONFRONTATION: // Text body confrontation
720  {
722  aLR.SetTextFirstLineOffset( - short( GetMetricVal( CM_1 ) * 4 +
723  GetMetricVal( CM_05)) );
724  aLR.SetTextLeft( GetMetricVal( CM_1 ) * 5 );
726  aTStops.Insert( SvxTabStop( 0 ));
727 
728  aSet.Put( aLR );
729  aSet.Put( aTStops );
730  }
731  break;
732  case RES_POOLCOLL_MARGINAL: // Text body marginal
733  {
735  aLR.SetTextLeft( GetMetricVal( CM_1 ) * 4 );
736  aSet.Put( aLR );
737  }
738  break;
739 
740  case RES_POOLCOLL_HEADLINE_BASE: // Base headline
741  {
742  static const sal_uInt16 aFontWhich[] =
743  { RES_CHRATR_FONT,
745  RES_CHRATR_CTL_FONT
746  };
747  static const sal_uInt16 aLangTypes[] =
748  {
752  };
753  static const LanguageType aLangs[] =
754  {
758  };
759  static const DefaultFontType nFontTypes[] =
760  {
761  DefaultFontType::LATIN_HEADING,
762  DefaultFontType::CJK_HEADING,
763  DefaultFontType::CTL_HEADING
764  };
765 
766  for( int i = 0; i < 3; ++i )
767  {
768  LanguageType nLng = static_cast<const SvxLanguageItem&>(m_rDoc.GetDefault( aLangTypes[i] )).GetLanguage();
769  if( LANGUAGE_DONTKNOW == nLng )
770  nLng = aLangs[i];
771 
772  vcl::Font aFnt( OutputDevice::GetDefaultFont( nFontTypes[i],
773  nLng, GetDefaultFontFlags::OnlyOne ) );
774 
775  aSet.Put( SvxFontItem( aFnt.GetFamilyType(), aFnt.GetFamilyName(),
776  OUString(), aFnt.GetPitch(),
777  aFnt.GetCharSet(), aFontWhich[i] ));
778  }
779 
780  SvxFontHeightItem aFntSize( PT_14, 100, RES_CHRATR_FONTSIZE );
781  SvxULSpaceItem aUL( PT_12, PT_6, RES_UL_SPACE );
783  aUL.SetLower( HTML_PARSPACE );
784  aSet.Put( SvxFormatKeepItem( true, RES_KEEP ));
785 
787 
788  aSet.Put( aUL );
789  SetAllScriptItem( aSet, aFntSize );
790  }
791  break;
792 
793  case RES_POOLCOLL_NUMBER_BULLET_BASE: // Base Numbering
794  break;
795 
796  case RES_POOLCOLL_GREETING: // Greeting
797  case RES_POOLCOLL_REGISTER_BASE: // Base indexes
798  case RES_POOLCOLL_SIGNATURE: // Signatures
799  case RES_POOLCOLL_TABLE: // Tabele content
800  {
801  SwFormatLineNumber aLN;
802  aLN.SetCountLines( false );
803  aSet.Put( aLN );
804  if (nId == RES_POOLCOLL_TABLE)
805  {
806  aSet.Put( SvxWidowsItem( 0, RES_PARATR_WIDOWS ) );
807  aSet.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
808  }
809  }
810  break;
811 
812  case RES_POOLCOLL_HEADLINE1: // Heading 1
813  {
814  SvxULSpaceItem aUL( PT_12, PT_6, RES_UL_SPACE );
815  aSet.Put( aUL );
816  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 0, false );
817  }
818  break;
819  case RES_POOLCOLL_HEADLINE2: // Heading 2
820  {
821  SvxULSpaceItem aUL( PT_10, PT_6, RES_UL_SPACE );
822  aSet.Put( aUL );
823  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 1, false );
824  }
825  break;
826  case RES_POOLCOLL_HEADLINE3: // Heading 3
827  {
828  SvxULSpaceItem aUL( PT_7, PT_6, RES_UL_SPACE );
829  aSet.Put( aUL );
830  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 2, false );
831  }
832  break;
833  case RES_POOLCOLL_HEADLINE4: // Heading 4
834  {
835  SvxULSpaceItem aUL( PT_6, PT_6, RES_UL_SPACE );
836  aSet.Put( aUL );
837  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 3, true );
838  }
839  break;
840  case RES_POOLCOLL_HEADLINE5: // Heading 5
841  {
842  SvxULSpaceItem aUL( PT_6, PT_3, RES_UL_SPACE );
843  aSet.Put( aUL );
844  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 4, false );
845  }
846  break;
847  case RES_POOLCOLL_HEADLINE6: // Heading 6
848  {
849  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
850  aSet.Put( aUL );
851  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 5, true );
852  }
853  break;
854  case RES_POOLCOLL_HEADLINE7: // Heading 7
855  {
856  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
857  aSet.Put( aUL );
858  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 6, false );
859  }
860  break;
861  case RES_POOLCOLL_HEADLINE8: // Heading 8
862  {
863  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
864  aSet.Put( aUL );
865  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 7, true );
866  }
867  break;
868  case RES_POOLCOLL_HEADLINE9: // Heading 9
869  {
870  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
871  aSet.Put( aUL );
872  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 8, false );
873  }
874  break;
875  case RES_POOLCOLL_HEADLINE10: // Heading 10
876  {
877  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
878  aSet.Put( aUL );
879  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 9, false );
880  }
881  break;
882 
883  // Special sections:
884  // Header
886  case RES_POOLCOLL_HEADER:
889  // Footer
890  case RES_POOLCOLL_FOOTER:
893  {
894  SwFormatLineNumber aLN;
895  aLN.SetCountLines( false );
896  aSet.Put( aLN );
897 
898  long nRightMargin = lcl_GetRightMargin( m_rDoc );
899 
900  SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
901  aTStops.Insert( SvxTabStop( nRightMargin / 2, SvxTabAdjust::Center ) );
902  aTStops.Insert( SvxTabStop( nRightMargin, SvxTabAdjust::Right ) );
903 
904  aSet.Put( aTStops );
905 
906  if ( (nId==RES_POOLCOLL_HEADERR) || (nId==RES_POOLCOLL_FOOTERR) ) {
907  SvxAdjustItem aAdjust(SvxAdjust::Right, RES_PARATR_ADJUST );
908  aSet.Put(aAdjust);
909  }
910  }
911  break;
912 
914  {
916  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) );
917  SwFormatLineNumber aLN;
918  aLN.SetCountLines( false );
919  aSet.Put( aLN );
920  }
921  break;
922 
923  case RES_POOLCOLL_FOOTNOTE: // paragraph style Footnote
924  case RES_POOLCOLL_ENDNOTE: // paragraph style Endnote
925  {
927  aLR.SetTextFirstLineOffset( -static_cast<short>( GetMetricVal( CM_05 ) + GetMetricVal( CM_01 ) ) );
930  aSet.Put( aLR );
931  SwFormatLineNumber aLN;
932  aLN.SetCountLines( false );
933  aSet.Put( aLN );
934  }
935  break;
936 
937  case RES_POOLCOLL_LABEL: // basic caption
938  {
940  aUL.SetUpper( PT_6 );
941  aUL.SetLower( PT_6 );
942  aSet.Put( aUL );
945  SwFormatLineNumber aLN;
946  aLN.SetCountLines( false );
947  aSet.Put( aLN );
948  }
949  break;
950 
951  case RES_POOLCOLL_FRAME: // Frame content
952  case RES_POOLCOLL_LABEL_ABB: // caption image
953  case RES_POOLCOLL_LABEL_TABLE: // caption table
954  case RES_POOLCOLL_LABEL_FRAME: // caption frame
955  case RES_POOLCOLL_LABEL_DRAWING: // caption drawing
957  break;
958 
959  case RES_POOLCOLL_JAKETADRESS: // envelope address
960  {
962  aUL.SetLower( PT_3 );
963  aSet.Put( aUL );
964  SwFormatLineNumber aLN;
965  aLN.SetCountLines( false );
966  aSet.Put( aLN );
967  }
968  break;
969 
970  case RES_POOLCOLL_SENDADRESS: // Sender address
971  {
974  else
975  {
976  SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetLower( PT_3 );
977  aSet.Put( aUL );
978  }
979  SwFormatLineNumber aLN;
980  aLN.SetCountLines( false );
981  aSet.Put( aLN );
982  }
983  break;
984 
985  // User defined indexes:
986  case RES_POOLCOLL_TOX_USERH: // Header
987  lcl_SetRegister( &m_rDoc, aSet, 0, true, false );
988  {
989  SwFormatLineNumber aLN;
990  aLN.SetCountLines( false );
991  aSet.Put( aLN );
992  }
993  break;
994  case RES_POOLCOLL_TOX_USER1: // 1st level
995  lcl_SetRegister( &m_rDoc, aSet, 0, false, true );
996  break;
997  case RES_POOLCOLL_TOX_USER2: // 2nd level
998  lcl_SetRegister( &m_rDoc, aSet, 1, false, true );
999  break;
1000  case RES_POOLCOLL_TOX_USER3: // 3rd level
1001  lcl_SetRegister( &m_rDoc, aSet, 2, false, true );
1002  break;
1003  case RES_POOLCOLL_TOX_USER4: // 4th level
1004  lcl_SetRegister( &m_rDoc, aSet, 3, false, true );
1005  break;
1006  case RES_POOLCOLL_TOX_USER5: // 5th level
1007  lcl_SetRegister( &m_rDoc, aSet, 4, false, true );
1008  break;
1009  case RES_POOLCOLL_TOX_USER6: // 6th level
1010  lcl_SetRegister( &m_rDoc, aSet, 5, false, true );
1011  break;
1012  case RES_POOLCOLL_TOX_USER7: // 7th level
1013  lcl_SetRegister( &m_rDoc, aSet, 6, false, true );
1014  break;
1015  case RES_POOLCOLL_TOX_USER8: // 8th level
1016  lcl_SetRegister( &m_rDoc, aSet, 7, false, true );
1017  break;
1018  case RES_POOLCOLL_TOX_USER9: // 9th level
1019  lcl_SetRegister( &m_rDoc, aSet, 8, false, true );
1020  break;
1021  case RES_POOLCOLL_TOX_USER10: // 10th level
1022  lcl_SetRegister( &m_rDoc, aSet, 9, false, true );
1023  break;
1024 
1025  // Index
1026  case RES_POOLCOLL_TOX_IDXH: // Header
1027  lcl_SetRegister( &m_rDoc, aSet, 0, true, false );
1028  {
1029  SwFormatLineNumber aLN;
1030  aLN.SetCountLines( false );
1031  aSet.Put( aLN );
1032  }
1033  break;
1034  case RES_POOLCOLL_TOX_IDX1: // 1st level
1035  lcl_SetRegister( &m_rDoc, aSet, 0, false, false );
1036  break;
1037  case RES_POOLCOLL_TOX_IDX2: // 2nd level
1038  lcl_SetRegister( &m_rDoc, aSet, 1, false, false );
1039  break;
1040  case RES_POOLCOLL_TOX_IDX3: // 3rd level
1041  lcl_SetRegister( &m_rDoc, aSet, 2, false, false );
1042  break;
1043  case RES_POOLCOLL_TOX_IDXBREAK: // Separator
1044  lcl_SetRegister( &m_rDoc, aSet, 0, false, false );
1045  break;
1046 
1047  // Table of Content
1048  case RES_POOLCOLL_TOX_CNTNTH: // Header
1049  lcl_SetRegister( &m_rDoc, aSet, 0, true, false );
1050  {
1051  SwFormatLineNumber aLN;
1052  aLN.SetCountLines( false );
1053  aSet.Put( aLN );
1054  }
1055  break;
1056  case RES_POOLCOLL_TOX_CNTNT1: // 1st level
1057  lcl_SetRegister( &m_rDoc, aSet, 0, false, true );
1058  break;
1059  case RES_POOLCOLL_TOX_CNTNT2: // 2nd level
1060  lcl_SetRegister( &m_rDoc, aSet, 1, false, true );
1061  break;
1062  case RES_POOLCOLL_TOX_CNTNT3: // 3rd level
1063  lcl_SetRegister( &m_rDoc, aSet, 2, false, true );
1064  break;
1065  case RES_POOLCOLL_TOX_CNTNT4: // 4th level
1066  lcl_SetRegister( &m_rDoc, aSet, 3, false, true );
1067  break;
1068  case RES_POOLCOLL_TOX_CNTNT5: // 5th level
1069  lcl_SetRegister( &m_rDoc, aSet, 4, false, true );
1070  break;
1071  case RES_POOLCOLL_TOX_CNTNT6: // 6th level
1072  lcl_SetRegister( &m_rDoc, aSet, 5, false, true );
1073  break;
1074  case RES_POOLCOLL_TOX_CNTNT7: // 7th level
1075  lcl_SetRegister( &m_rDoc, aSet, 6, false, true );
1076  break;
1077  case RES_POOLCOLL_TOX_CNTNT8: // 8th level
1078  lcl_SetRegister( &m_rDoc, aSet, 7, false, true );
1079  break;
1080  case RES_POOLCOLL_TOX_CNTNT9: // 9th level
1081  lcl_SetRegister( &m_rDoc, aSet, 8, false, true );
1082  break;
1083  case RES_POOLCOLL_TOX_CNTNT10: // 10th level
1084  lcl_SetRegister( &m_rDoc, aSet, 9, false, true );
1085  break;
1086 
1091  lcl_SetRegister( &m_rDoc, aSet, 0, true, false );
1092  {
1093  SwFormatLineNumber aLN;
1094  aLN.SetCountLines( false );
1095  aSet.Put( aLN );
1096  }
1097  break;
1102  lcl_SetRegister( &m_rDoc, aSet, 0, false, true );
1103  break;
1104 
1106  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
1108  PT_12, PT_6 );
1109  break;
1111  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
1113  0, PT_6 );
1114  break;
1116  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
1118  0, PT_12 );
1119  break;
1121  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM1,
1122  0, SwNumRule::GetNumIndent( 0 ), 0, PT_6 );
1123  break;
1125  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
1127  PT_12, PT_6 );
1128  break;
1130  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
1132  0, PT_6 );
1133  break;
1135  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
1137  0, PT_12 );
1138  break;
1140  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM2,
1141  0, SwNumRule::GetNumIndent( 1 ), 0, PT_6 );
1142  break;
1144  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
1146  PT_12, PT_6 );
1147  break;
1149  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
1151  0, PT_6 );
1152  break;
1154  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
1156  0, PT_12 );
1157  break;
1159  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM3,
1160  0, SwNumRule::GetNumIndent( 2 ), 0, PT_6 );
1161  break;
1163  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
1165  PT_12, PT_6 );
1166  break;
1168  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
1170  0, PT_6 );
1171  break;
1173  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
1175  0, PT_12 );
1176  break;
1178  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM4,
1179  0, SwNumRule::GetNumIndent( 3 ), 0, PT_6 );
1180  break;
1182  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
1184  PT_12, PT_6 );
1185  break;
1187  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
1189  0, PT_6 );
1190  break;
1192  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
1194  0, PT_12 );
1195  break;
1197  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM5,
1198  0, SwNumRule::GetNumIndent( 4 ), 0, PT_6 );
1199  break;
1200 
1202  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL1,
1204  PT_12, PT_6 );
1205  break;
1207  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL1,
1209  0, PT_6 );
1210  break;
1212  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL1,
1214  0, PT_12 );
1215  break;
1217  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM1,
1218  0, SwNumRule::GetBullIndent( 0 ), 0, PT_6 );
1219  break;
1221  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL2,
1223  PT_12, PT_6 );
1224  break;
1226  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL2,
1228  0, PT_6 );
1229  break;
1231  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL2,
1233  0, PT_12 );
1234  break;
1236  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM2,
1237  0, SwNumRule::GetBullIndent( 1 ), 0, PT_6 );
1238  break;
1240  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL3,
1242  PT_12, PT_6 );
1243  break;
1245  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL3,
1247  0, PT_6 );
1248  break;
1250  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL3,
1252  0, PT_12 );
1253  break;
1255  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM3,
1256  0, SwNumRule::GetBullIndent( 2 ), 0, PT_6 );
1257  break;
1259  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL4,
1261  PT_12, PT_6 );
1262  break;
1264  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL4,
1266  0, PT_6 );
1267  break;
1269  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL4,
1271  0, PT_12 );
1272  break;
1274  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM4,
1275  0, SwNumRule::GetBullIndent( 3 ), 0, PT_6 );
1276  break;
1278  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL5,
1280  PT_12, PT_6 );
1281  break;
1283  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL5,
1285  0, PT_6 );
1286  break;
1288  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL5,
1290  0, PT_12 );
1291  break;
1293  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM5,
1294  0, SwNumRule::GetBullIndent( 4 ), 0, PT_6 );
1295  break;
1296 
1297  case RES_POOLCOLL_DOC_TITLE: // Document Title
1298  {
1300  SetAllScriptItem( aSet, SvxFontHeightItem( PT_28, 100, RES_CHRATR_FONTSIZE ) );
1301 
1302  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) );
1303 
1305  }
1306  break;
1307 
1308  case RES_POOLCOLL_DOC_SUBTITLE: // Document subtitle
1309  {
1310  SvxULSpaceItem aUL( PT_3, PT_6, RES_UL_SPACE );
1311  aSet.Put( aUL );
1313 
1314  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ));
1315 
1317  }
1318  break;
1319 
1320  case RES_POOLCOLL_DOC_APPENDIX: // Document Appendix tdf#114090
1321  {
1323  SetAllScriptItem( aSet, SvxFontHeightItem( PT_16, 100, RES_CHRATR_FONTSIZE ) );
1324 
1325  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) );
1326 
1328  }
1329  break;
1330 
1332  {
1334  aLR.SetLeft( GetMetricVal( CM_1 ));
1335  aLR.SetRight( GetMetricVal( CM_1 ));
1336  aSet.Put( aLR );
1337  std::unique_ptr<SvxULSpaceItem> aUL(pNewColl->GetULSpace().Clone());
1338  aUL->SetLower( HTML_PARSPACE );
1339  aSet.Put(std::move(aUL));
1340  }
1341  break;
1342 
1343  case RES_POOLCOLL_HTML_PRE:
1344  {
1345  ::lcl_SetDfltFont( DefaultFontType::FIXED, aSet );
1346 
1347  // WORKAROUND: Set PRE to 10pt
1349 
1350  // The lower paragraph distance is set explicitly (makes
1351  // assigning hard attributes easier)
1352  std::unique_ptr<SvxULSpaceItem> aULSpaceItem(pNewColl->GetULSpace().Clone());
1353  aULSpaceItem->SetLower( 0 );
1354  aSet.Put(std::move(aULSpaceItem));
1355  }
1356  break;
1357 
1358  case RES_POOLCOLL_HTML_HR:
1359  {
1360  SvxBoxItem aBox( RES_BOX );
1361  Color aColor( COL_GRAY );
1362  SvxBorderLine aNew(&aColor, 3, SvxBorderLineStyle::DOUBLE);
1363  aBox.SetLine( &aNew, SvxBoxItemLine::BOTTOM );
1364 
1365  aSet.Put( aBox );
1366  aSet.Put( SwParaConnectBorderItem( false ) );
1368 
1369  std::unique_ptr<SvxULSpaceItem> aUL;
1370  {
1372  aUL.reset(pNewColl->GetULSpace().Clone());
1373  }
1374  aUL->SetLower( HTML_PARSPACE );
1375  aSet.Put(std::move(aUL));
1376  SwFormatLineNumber aLN;
1377  aLN.SetCountLines( false );
1378  aSet.Put( aLN );
1379  }
1380  break;
1381 
1382  case RES_POOLCOLL_HTML_DD:
1383  {
1384  std::unique_ptr<SvxLRSpaceItem> aLR(pNewColl->GetLRSpace().Clone());
1385  // We indent by 1 cm. The IDs are always 2 away from each other!
1386  aLR->SetLeft( GetMetricVal( CM_1 ));
1387  aSet.Put(std::move(aLR));
1388  }
1389  break;
1390  case RES_POOLCOLL_HTML_DT:
1391  {
1392  std::unique_ptr<SvxLRSpaceItem> aLR;
1393  {
1395  aLR.reset(pNewColl->GetLRSpace().Clone());
1396  }
1397  // We indent by 0 cm. The IDs are always 2 away from each other!
1398  aLR->SetLeft( 0 );
1399  aSet.Put( std::move(aLR) );
1400  }
1401  break;
1402  }
1403  }
1404 
1405  if( aSet.Count() )
1406  pNewColl->SetFormatAttr( aSet );
1407  return pNewColl;
1408 }
1409 
1413 {
1414  SwFormat *pNewFormat = nullptr;
1415  SwFormat *pDeriveFormat = nullptr;
1416 
1417  SwFormatsBase* pArray[ 2 ];
1418  sal_uInt16 nArrCnt = 1;
1419  const char* pRCId = nullptr;
1420  sal_uInt16 const * pWhichRange = nullptr;
1421 
1422  switch( nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
1423  {
1424  case POOLGRP_CHARFMT:
1425  {
1426  pArray[0] = m_rDoc.GetCharFormats();
1427  pDeriveFormat = m_rDoc.GetDfltCharFormat();
1428  pWhichRange = aCharFormatSetRange;
1429 
1430  if (nId >= RES_POOLCHR_HTML_BEGIN && nId < RES_POOLCHR_HTML_END)
1431  pRCId = STR_POOLCHR_HTML_ARY[nId - RES_POOLCHR_HTML_BEGIN];
1432  else if (nId >= RES_POOLCHR_NORMAL_BEGIN && nId < RES_POOLCHR_NORMAL_END)
1433  pRCId = STR_POOLCHR_ARY[nId - RES_POOLCHR_BEGIN];
1434  else
1435  {
1436  // Fault: unknown Format, but a CharFormat -> return the first one
1437  OSL_ENSURE( false, "invalid Id" );
1438  pRCId = STR_POOLCHR_ARY[0];
1439  }
1440  }
1441  break;
1442  case POOLGRP_FRAMEFMT:
1443  {
1444  pArray[0] = m_rDoc.GetFrameFormats();
1445  pArray[1] = m_rDoc.GetSpzFrameFormats();
1446  pDeriveFormat = m_rDoc.GetDfltFrameFormat();
1447  nArrCnt = 2;
1448  pWhichRange = aFrameFormatSetRange;
1449 
1450  // Fault: unknown Format, but a FrameFormat
1451  // -> return the first one
1452  if( RES_POOLFRM_BEGIN > nId || nId >= RES_POOLFRM_END )
1453  {
1454  OSL_ENSURE( false, "invalid Id" );
1455  nId = RES_POOLFRM_BEGIN;
1456  }
1457 
1458  pRCId = STR_POOLFRM_ARY[nId - RES_POOLFRM_BEGIN];
1459  }
1460  break;
1461 
1462  default:
1463  // Fault, unknown Format
1464  OSL_ENSURE( nId, "invalid Id" );
1465  return nullptr;
1466  }
1467  OSL_ENSURE(pRCId, "invalid Id");
1468 
1469  while( nArrCnt-- )
1470  for( size_t n = 0; n < (*pArray[nArrCnt]).GetFormatCount(); ++n )
1471  {
1472  pNewFormat = (*pArray[ nArrCnt ] ).GetFormat( n );
1473  if( nId == pNewFormat->GetPoolFormatId() )
1474  {
1475  return pNewFormat;
1476  }
1477  }
1478 
1479  OUString aNm(SwResId(pRCId));
1480  SwAttrSet aSet( m_rDoc.GetAttrPool(), pWhichRange );
1481 
1482  {
1483  bool bIsModified = m_rDoc.getIDocumentState().IsModified();
1484 
1485  {
1486  ::sw::UndoGuard const undoGuard(m_rDoc.GetIDocumentUndoRedo());
1487  switch (nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
1488  {
1489  case POOLGRP_CHARFMT:
1490  pNewFormat = m_rDoc.MakeCharFormat_(aNm, pDeriveFormat, false, true);
1491  break;
1492  case POOLGRP_FRAMEFMT:
1493  pNewFormat = m_rDoc.MakeFrameFormat_(aNm, pDeriveFormat, false, true);
1494  break;
1495  default:
1496  break;
1497  }
1498  }
1499 
1500  if( !bIsModified )
1502  pNewFormat->SetPoolFormatId( nId );
1503  pNewFormat->SetAuto(false); // no AutoFormat
1504  }
1505 
1506  switch( nId )
1507  {
1508  case RES_POOLCHR_FOOTNOTE: // Footnote
1509  case RES_POOLCHR_PAGENO: // Page/Field
1510  case RES_POOLCHR_LABEL: // Label
1511  case RES_POOLCHR_DROPCAPS: // Dropcaps
1512  case RES_POOLCHR_NUM_LEVEL: // Numbering level
1513  case RES_POOLCHR_TOXJUMP: // Table of contents jump
1514  case RES_POOLCHR_ENDNOTE: // Endnote
1515  case RES_POOLCHR_LINENUM: // Line numbering
1516  break;
1517 
1518  case RES_POOLCHR_ENDNOTE_ANCHOR: // Endnote anchor
1519  case RES_POOLCHR_FOOTNOTE_ANCHOR: // Footnote anchor
1520  {
1522  }
1523  break;
1524 
1525  case RES_POOLCHR_BULLET_LEVEL: // Bullet character
1526  {
1527  const vcl::Font& rBulletFont = numfunc::GetDefBulletFont();
1528  SetAllScriptItem( aSet, SvxFontItem( rBulletFont.GetFamilyType(),
1529  rBulletFont.GetFamilyName(), rBulletFont.GetStyleName(),
1530  rBulletFont.GetPitch(), rBulletFont.GetCharSet(), RES_CHRATR_FONT ));
1531  }
1532  break;
1533 
1535  {
1536  aSet.Put( SvxColorItem( COL_BLUE, RES_CHRATR_COLOR ) );
1538  // i40133: patch submitted by rail: set language to 'none' to prevent spell checking:
1542  }
1543  break;
1545  {
1546  aSet.Put( SvxColorItem( COL_RED, RES_CHRATR_COLOR ) );
1551  }
1552  break;
1553  case RES_POOLCHR_JUMPEDIT:
1554  {
1555  aSet.Put( SvxColorItem( COL_CYAN, RES_CHRATR_COLOR ) );
1557  aSet.Put( SvxCaseMapItem( SvxCaseMap::SmallCaps, RES_CHRATR_CASEMAP ) );
1558  }
1559  break;
1560 
1561  case RES_POOLCHR_RUBYTEXT:
1562  {
1563  long nH = GetDfltAttr( RES_CHRATR_CJK_FONTSIZE )->GetHeight() / 2;
1566  aSet.Put(SvxEmphasisMarkItem( FontEmphasisMark::NONE, RES_CHRATR_EMPHASIS_MARK) );
1567  }
1568  break;
1569 
1573  {
1575  }
1576  break;
1577 
1580  {
1582  }
1583  break;
1584 
1585  case RES_POOLCHR_HTML_CODE:
1589  {
1590  ::lcl_SetDfltFont( DefaultFontType::FIXED, aSet );
1591  }
1592  break;
1593  case RES_POOLCHR_VERT_NUM:
1594  aSet.Put( SvxCharRotateItem( 900, false, RES_CHRATR_ROTATE ) );
1595  break;
1596 
1597  case RES_POOLFRM_FRAME:
1598  {
1600  {
1601  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ));
1602  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::LINE_CENTER, text::RelOrientation::PRINT_AREA ) );
1603  aSet.Put( SwFormatSurround( css::text::WrapTextMode_NONE ) );
1604  }
1605  else
1606  {
1607  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA ));
1608  aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL ) );
1609  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::PRINT_AREA ) );
1610  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::PRINT_AREA ) );
1611  Color aCol( COL_BLACK );
1612  SvxBorderLine aLine( &aCol, DEF_LINE_WIDTH_0 );
1613  SvxBoxItem aBox( RES_BOX );
1614  aBox.SetLine( &aLine, SvxBoxItemLine::TOP );
1615  aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
1616  aBox.SetLine( &aLine, SvxBoxItemLine::LEFT );
1617  aBox.SetLine( &aLine, SvxBoxItemLine::RIGHT );
1618  aBox.SetAllDistances( 85 );
1619  aSet.Put( aBox );
1620  aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1621  aSet.Put( SvxULSpaceItem( 114, 114, RES_UL_SPACE ) );
1622  }
1623 
1624  // for styles of FlyFrames do not set the FillStyle to make it a derived attribute
1625  aSet.ClearItem(XATTR_FILLSTYLE);
1626  }
1627  break;
1628  case RES_POOLFRM_GRAPHIC:
1629  case RES_POOLFRM_OLE:
1630  {
1631  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA ));
1632  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ));
1633  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
1634  aSet.Put( SwFormatSurround( css::text::WrapTextMode_DYNAMIC ));
1635  }
1636  break;
1637  case RES_POOLFRM_FORMEL:
1638  {
1639  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) );
1640  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::CHAR_CENTER, text::RelOrientation::FRAME ) );
1641  aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1642  }
1643  break;
1644  case RES_POOLFRM_MARGINAL:
1645  {
1646  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA ));
1647  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME ));
1648  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
1649  aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL ));
1650  // Set the default width to 3.5 cm, use the minimum value for the height
1652  GetMetricVal( CM_1 ) * 3 + GetMetricVal( CM_05 ),
1653  MM50 ));
1654  }
1655  break;
1656  case RES_POOLFRM_WATERSIGN:
1657  {
1658  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PAGE ));
1659  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ));
1660  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME ));
1661  aSet.Put( SvxOpaqueItem( RES_OPAQUE, false ));
1662  aSet.Put( SwFormatSurround( css::text::WrapTextMode_THROUGH ));
1663  }
1664  break;
1665  case RES_POOLFRM_LABEL:
1666  {
1667  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) );
1668  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
1669  aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1670 
1671  SvxProtectItem aProtect( RES_PROTECT );
1672  aProtect.SetSizeProtect( true );
1673  aProtect.SetPosProtect( true );
1674  aSet.Put( aProtect );
1675 
1676  pNewFormat->SetAutoUpdateFormat();
1677  }
1678  break;
1679  }
1680  if( aSet.Count() )
1681  {
1682  pNewFormat->SetFormatAttr( aSet );
1683  }
1684  return pNewFormat;
1685 }
1686 
1688 {
1689  return static_cast<SwFrameFormat*>(GetFormatFromPool( nId ));
1690 }
1691 
1693 {
1694  return static_cast<SwCharFormat*>(GetFormatFromPool( nId ));
1695 }
1696 
1697 SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
1698 {
1699  OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
1700  "Wrong AutoFormat Id" );
1701 
1702  for( size_t n = 0; n < m_rDoc.GetPageDescCnt(); ++n )
1703  {
1704  if ( nId == m_rDoc.GetPageDesc(n).GetPoolFormatId() )
1705  {
1706  return &m_rDoc.GetPageDesc(n);
1707  }
1708  }
1709 
1710  if( RES_POOLPAGE_BEGIN > nId || nId >= RES_POOLPAGE_END )
1711  {
1712  // unknown page pool ID
1713  OSL_ENSURE( false, "<SwDoc::GetPageDescFromPool(..)> - unknown page pool ID" );
1714  nId = RES_POOLPAGE_BEGIN;
1715  }
1716 
1717  SwPageDesc* pNewPgDsc = nullptr;
1718  {
1719  static_assert(SAL_N_ELEMENTS(STR_POOLPAGE_ARY) == RES_POOLPAGE_END - RES_POOLPAGE_BEGIN, "### unexpected size!");
1720  const OUString aNm(SwResId(STR_POOLPAGE_ARY[nId - RES_POOLPAGE_BEGIN]));
1721  const bool bIsModified = m_rDoc.getIDocumentState().IsModified();
1722 
1723  {
1724  ::sw::UndoGuard const undoGuard(m_rDoc.GetIDocumentUndoRedo());
1725  pNewPgDsc = m_rDoc.MakePageDesc(aNm, nullptr, bRegardLanguage);
1726  }
1727 
1728  pNewPgDsc->SetPoolFormatId( nId );
1729  if ( !bIsModified )
1730  {
1732  }
1733  }
1734 
1736  {
1737  aLR.SetLeft( GetMetricVal( CM_1 ) * 2 );
1738  aLR.SetRight( aLR.GetLeft() );
1739  }
1741  {
1742  aUL.SetUpper( static_cast<sal_uInt16>(aLR.GetLeft()) );
1743  aUL.SetLower( static_cast<sal_uInt16>(aLR.GetLeft()) );
1744  }
1745 
1747  bool bSetLeft = true;
1748 
1749  switch( nId )
1750  {
1751  case RES_POOLPAGE_STANDARD: // "Default"
1752  {
1753  aSet.Put( aLR );
1754  aSet.Put( aUL );
1756  }
1757  break;
1758 
1759  case RES_POOLPAGE_FIRST: // "First Page"
1760  case RES_POOLPAGE_REGISTER: // "Index"
1761  {
1762  lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
1763  aSet.Put( aLR );
1764  aSet.Put( aUL );
1765  pNewPgDsc->SetUseOn( UseOnPage::All );
1766  if( RES_POOLPAGE_FIRST == nId )
1768  }
1769  break;
1770 
1771  case RES_POOLPAGE_LEFT: // "Left Page"
1772  {
1773  lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
1774  aSet.Put( aLR );
1775  aSet.Put( aUL );
1776  bSetLeft = false;
1777  pNewPgDsc->SetUseOn( UseOnPage::Left );
1778  // this relies on GetPageDescFromPool() not going into infinite recursion
1779  // (by this point RES_POOLPAGE_LEFT will not reach this place again)
1781  }
1782  break;
1783  case RES_POOLPAGE_RIGHT: // "Right Page"
1784  {
1785  lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
1786  aSet.Put( aLR );
1787  aSet.Put( aUL );
1788  bSetLeft = false;
1789  pNewPgDsc->SetUseOn( UseOnPage::Right );
1791  }
1792  break;
1793 
1794  case RES_POOLPAGE_JAKET: // "Envelope"
1795  {
1797  LandscapeSwap( aPSize );
1798  aSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, aPSize.Width(), aPSize.Height() ));
1799  aLR.SetLeft( 0 ); aLR.SetRight( 0 );
1800  aUL.SetUpper( 0 ); aUL.SetLower( 0 );
1801  aSet.Put( aLR );
1802  aSet.Put( aUL );
1803 
1804  pNewPgDsc->SetUseOn( UseOnPage::All );
1805  pNewPgDsc->SetLandscape( true );
1806  }
1807  break;
1808 
1809  case RES_POOLPAGE_HTML: // "HTML"
1810  {
1811  lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
1812  aLR.SetRight( GetMetricVal( CM_1 ));
1813  aUL.SetUpper( static_cast<sal_uInt16>(aLR.GetRight()) );
1814  aUL.SetLower( static_cast<sal_uInt16>(aLR.GetRight()) );
1815  aSet.Put( aLR );
1816  aSet.Put( aUL );
1817 
1818  pNewPgDsc->SetUseOn( UseOnPage::All );
1819  }
1820  break;
1821 
1822  case RES_POOLPAGE_FOOTNOTE: // "Footnote"
1823  case RES_POOLPAGE_ENDNOTE: // "Endnote"
1824  {
1825  lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
1826  aSet.Put( aLR );
1827  aSet.Put( aUL );
1828  pNewPgDsc->SetUseOn( UseOnPage::All );
1829  SwPageFootnoteInfo aInf( pNewPgDsc->GetFootnoteInfo() );
1830  aInf.SetLineWidth( 0 );
1831  aInf.SetTopDist( 0 );
1832  aInf.SetBottomDist( 0 );
1833  pNewPgDsc->SetFootnoteInfo( aInf );
1834  }
1835  break;
1836 
1837  case RES_POOLPAGE_LANDSCAPE: // "Landscape"
1838  {
1840  SwFormatFrameSize aFrameSz( pStdPgDsc->GetMaster().GetFrameSize() );
1841  if ( !pStdPgDsc->GetLandscape() )
1842  {
1843  const SwTwips nTmp = aFrameSz.GetHeight();
1844  aFrameSz.SetHeight( aFrameSz.GetWidth() );
1845  aFrameSz.SetWidth( nTmp );
1846  }
1847  aSet.Put( aFrameSz );
1848  aSet.Put( aLR );
1849  aSet.Put( aUL );
1850  pNewPgDsc->SetUseOn( UseOnPage::All );
1851  pNewPgDsc->SetLandscape( true );
1852  }
1853  break;
1854 
1855  }
1856 
1857  if( aSet.Count() )
1858  {
1859  if( bSetLeft )
1860  {
1861  pNewPgDsc->GetLeft().SetFormatAttr( aSet );
1862  pNewPgDsc->GetFirstLeft().SetFormatAttr( aSet );
1863  }
1864  pNewPgDsc->GetMaster().SetFormatAttr( aSet );
1865  pNewPgDsc->GetFirstMaster().SetFormatAttr( aSet );
1866  }
1867  return pNewPgDsc;
1868 }
1869 
1871 {
1872  OSL_ENSURE( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END,
1873  "Wrong AutoFormat Id" );
1874 
1875  SwNumRule* pNewRule;
1876 
1877  for (size_t n = 0; n < m_rDoc.GetNumRuleTable().size(); ++n )
1878  {
1879  pNewRule = m_rDoc.GetNumRuleTable()[ n ];
1880  if (nId == pNewRule->GetPoolFormatId())
1881  {
1882  return pNewRule;
1883  }
1884  }
1885 
1886  // error: unknown Pool style
1887  if( RES_POOLNUMRULE_BEGIN > nId || nId >= RES_POOLNUMRULE_END )
1888  {
1889  OSL_ENSURE( false, "invalid Id" );
1890  nId = RES_POOLNUMRULE_BEGIN;
1891  }
1892 
1893  static_assert(SAL_N_ELEMENTS(STR_POOLNUMRULE_NUM_ARY) == RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN, "### unexpected size!");
1894  OUString aNm(SwResId(STR_POOLNUMRULE_NUM_ARY[nId - RES_POOLNUMRULE_BEGIN]));
1895 
1896  SwCharFormat *pNumCFormat = nullptr, *pBullCFormat = nullptr;
1897 
1898  const SvxNumberFormat::SvxNumPositionAndSpaceMode eNumberFormatPositionAndSpaceMode
1900  {
1901  bool bIsModified = m_rDoc.getIDocumentState().IsModified();
1902 
1903  sal_uInt16 n = m_rDoc.MakeNumRule( aNm, nullptr, false, eNumberFormatPositionAndSpaceMode );
1904 
1905  pNewRule = m_rDoc.GetNumRuleTable()[ n ];
1906  pNewRule->SetPoolFormatId( nId );
1907  pNewRule->SetAutoRule( false );
1908 
1909  if( RES_POOLNUMRULE_NUM1 <= nId && nId <= RES_POOLNUMRULE_NUM5 )
1911 
1912  if( ( RES_POOLNUMRULE_BUL1 <= nId && nId <= RES_POOLNUMRULE_BUL5 ) ||
1913  RES_POOLNUMRULE_NUM5 == nId )
1914  pBullCFormat = GetCharFormatFromPool( RES_POOLCHR_NUM_LEVEL );
1915 
1916  if( !bIsModified )
1918  }
1919 
1920  switch( nId )
1921  {
1922  case RES_POOLNUMRULE_NUM1:
1923  {
1924  SwNumFormat aFormat;
1925  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
1927  aFormat.SetCharFormat( pNumCFormat );
1928  aFormat.SetStart( 1 );
1929  aFormat.SetIncludeUpperLevels( 1 );
1930  aFormat.SetSuffix( "." );
1931 
1932  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
1933  {
1934 // cm: 0.7 cm intervals, with 1 cm = 567
1935  397, 794, 1191, 1588, 1985, 2381, 2778, 3175, 3572, 3969
1936  };
1937  const sal_uInt16* pArr = aAbsSpace;
1938 
1939  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1940  {
1941  aFormat.SetFirstLineOffset( - (*pArr) );
1942  }
1943  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1944  {
1946  aFormat.SetFirstLineIndent( - (*pArr) );
1947  }
1948 
1949  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
1950  {
1951  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1952  {
1953  aFormat.SetAbsLSpace( *pArr + 357 ); // 357 is indent of 0.63 cm
1954  }
1955  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1956  {
1957  aFormat.SetListtabPos( *pArr );
1958  aFormat.SetIndentAt( *pArr + 357 );
1959  }
1960 
1961  pNewRule->Set( n, aFormat );
1962  }
1963  }
1964  break;
1965 
1966  case RES_POOLNUMRULE_NUM2:
1967  {
1968  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
1969  {
1970  397, 397, 397, 397, // 0.70 cm intervals
1971  397, 397, 397, 397,
1972  397, 397
1973  };
1974 
1975  const sal_uInt16* pArr = aAbsSpace;
1976  SwNumFormat aFormat;
1977 
1978  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
1980  aFormat.SetCharFormat( pNumCFormat );
1981  aFormat.SetStart( 1 );
1982  aFormat.SetIncludeUpperLevels( 1 );
1983  aFormat.SetSuffix( "." );
1984 
1985  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1986  {
1988  }
1989 
1990  sal_uInt16 nSpace = 357; // indent of 0.63 cm
1991  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
1992  {
1993  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1994  {
1995  nSpace += pArr[ n ];
1996  aFormat.SetAbsLSpace( nSpace );
1997  aFormat.SetFirstLineOffset( - pArr[ n ] );
1998  }
1999  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2000  {
2001  nSpace += pArr[ n ];
2002  aFormat.SetListtabPos( nSpace );
2003  aFormat.SetIndentAt( nSpace );
2004  aFormat.SetFirstLineIndent( - pArr[ n ] );
2005  }
2006 
2007  pNewRule->Set( n, aFormat );
2008  }
2009  }
2010  break;
2011  case RES_POOLNUMRULE_NUM3:
2012  {
2013  SwNumFormat aFormat;
2014 
2015  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2017  aFormat.SetCharFormat( pNumCFormat );
2018  aFormat.SetStart( 1 );
2019  aFormat.SetIncludeUpperLevels( 1 );
2020  aFormat.SetSuffix( "." );
2021 
2022  long const nOffs = 397; // 0.70 cm
2023 
2024  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2025  {
2026  aFormat.SetFirstLineOffset( - nOffs );
2027  }
2028  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2029  {
2031  aFormat.SetFirstLineIndent( - nOffs );
2032  }
2033 
2034  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
2035  {
2036  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2037  {
2038  aFormat.SetAbsLSpace( (n+1) * nOffs + 357 ); // 357 is indent of 0.63 cm
2039  }
2040  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2041  {
2042  long nPos = (n+1) * nOffs;
2043  aFormat.SetListtabPos(nPos + 357);
2044  aFormat.SetIndentAt(nPos + 357);
2045  }
2046 
2047  pNewRule->Set( n, aFormat );
2048  }
2049  }
2050  break;
2051  case RES_POOLNUMRULE_NUM4:
2052  {
2053  SwNumFormat aFormat;
2054 
2055  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2057  aFormat.SetCharFormat( pNumCFormat );
2058  aFormat.SetStart( 1 );
2059  aFormat.SetIncludeUpperLevels( 1 );
2060  aFormat.SetSuffix( "." );
2061  aFormat.SetNumAdjust( SvxAdjust::Right );
2062 
2063  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2064  {
2065 // cm: 1.33 cm intervals
2066  754, 1508, 1191, 2262, 3016, 3771, 4525, 5279, 6033, 6787
2067  };
2068  const sal_uInt16* pArr = aAbsSpace;
2069 
2070  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2071  {
2072  aFormat.SetFirstLineOffset( 580 - (*pArr) ); // 1 cm space
2073  }
2074  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2075  {
2077  aFormat.SetFirstLineIndent( 580 - (*pArr) );
2078  }
2079 
2080  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2081  {
2082 
2083  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2084  {
2085  aFormat.SetAbsLSpace( *pArr );
2086  }
2087  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2088  {
2089  aFormat.SetListtabPos( *pArr );
2090  aFormat.SetIndentAt( *pArr );
2091  }
2092 
2093  pNewRule->Set( n, aFormat );
2094  }
2095  }
2096  break;
2097  case RES_POOLNUMRULE_NUM5:
2098  {
2099  // [ First, LSpace ]
2100  static const sal_uInt16 aAbsSpace0to2[] =
2101  {
2102  174, 754, // 0.33, 1.33,
2103  567, 1151, // 1.03, 2.03,
2104  397, 1548 // 2.03, 2.73
2105  };
2106 
2107  const sal_uInt16* pArr0to2 = aAbsSpace0to2;
2108  SwNumFormat aFormat;
2109 
2110  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2112  aFormat.SetStart( 1 );
2113  aFormat.SetIncludeUpperLevels( 1 );
2114  aFormat.SetSuffix( "." );
2115  aFormat.SetNumAdjust( SvxAdjust::Right );
2116 
2117  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2118  {
2120  }
2121 
2122  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2123  {
2124  aFormat.SetFirstLineOffset( -pArr0to2[0] ); // == 0.33 cm
2125  aFormat.SetAbsLSpace( pArr0to2[1] ); // == 1.33 cm
2126  }
2127  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2128  {
2129  aFormat.SetFirstLineIndent( -pArr0to2[0] );
2130  aFormat.SetListtabPos( pArr0to2[1] );
2131  aFormat.SetIndentAt( pArr0to2[1] );
2132  }
2133 
2134  aFormat.SetCharFormat( pNumCFormat );
2135  pNewRule->Set( 0, aFormat );
2136 
2137  aFormat.SetIncludeUpperLevels( 1 );
2138  aFormat.SetStart( 1 );
2139 
2140  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2141  {
2142  aFormat.SetFirstLineOffset( -pArr0to2[2] ); // == 1.03 cm
2143  aFormat.SetAbsLSpace( pArr0to2[3] ); // == 2.03 cm
2144  }
2145  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2146  {
2147  aFormat.SetFirstLineIndent( -pArr0to2[2] );
2148  aFormat.SetListtabPos( pArr0to2[3] );
2149  aFormat.SetIndentAt( pArr0to2[3] );
2150  }
2151 
2152  pNewRule->Set( 1, aFormat );
2153 
2155  aFormat.SetSuffix(OUString(u')'));
2156  aFormat.SetIncludeUpperLevels( 1 );
2157  aFormat.SetStart( 3 );
2158 
2159  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2160  {
2161  aFormat.SetFirstLineOffset( - pArr0to2[4] ); // == 2.03 cm
2162  aFormat.SetAbsLSpace( pArr0to2[5] ); // == 2.73 cm
2163  }
2164  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2165  {
2166  aFormat.SetFirstLineIndent( -pArr0to2[4] );
2167  aFormat.SetListtabPos( pArr0to2[5] );
2168  aFormat.SetIndentAt( pArr0to2[5] );
2169  }
2170 
2171  pNewRule->Set( 2, aFormat );
2172 
2174  aFormat.SetCharFormat( pBullCFormat );
2176  aFormat.SetBulletChar( cBulletChar );
2177  sal_Int16 nOffs = GetMetricVal( CM_01 ) * 4,
2178  nOffs2 = GetMetricVal( CM_1 ) * 2;
2179 
2180  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2181  {
2182  aFormat.SetFirstLineOffset( - nOffs );
2183  }
2184  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2185  {
2186  aFormat.SetFirstLineIndent( - nOffs );
2187  }
2188 
2189  aFormat.SetSuffix( OUString() );
2190  for (sal_uInt16 n = 3; n < MAXLEVEL; ++n)
2191  {
2192  aFormat.SetStart( n+1 );
2193 
2194  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2195  {
2196  aFormat.SetAbsLSpace( nOffs2 + ((n-3) * nOffs) );
2197  }
2198  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2199  {
2200  long nPos = nOffs2 + ((n-3) * static_cast<long>(nOffs));
2201  aFormat.SetListtabPos(nPos);
2202  aFormat.SetIndentAt(nPos);
2203  }
2204 
2205  pNewRule->Set( n, aFormat );
2206  }
2207  }
2208  break;
2209 
2210  case RES_POOLNUMRULE_BUL1:
2211  {
2212  SwNumFormat aFormat;
2213 
2214  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2216  aFormat.SetCharFormat( pBullCFormat );
2217  aFormat.SetStart( 1 );
2218  aFormat.SetIncludeUpperLevels( 1 );
2220  aFormat.SetBulletChar( cBulletChar );
2221 
2222  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2223  {
2224 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
2225  227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
2226  };
2227  const sal_uInt16* pArr = aAbsSpace;
2228 
2229  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2230  {
2231  aFormat.SetFirstLineOffset( - (*pArr) );
2232  }
2233  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2234  {
2236  aFormat.SetFirstLineIndent( - (*pArr) );
2237  }
2238 
2239  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2240  {
2241  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2242  {
2243  aFormat.SetAbsLSpace( *pArr );
2244  }
2245  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2246  {
2247  aFormat.SetListtabPos( *pArr );
2248  aFormat.SetIndentAt( *pArr );
2249  }
2250 
2251  pNewRule->Set( n, aFormat );
2252  }
2253  }
2254  break;
2255  case RES_POOLNUMRULE_BUL2:
2256  {
2257  SwNumFormat aFormat;
2258 
2259  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2261  aFormat.SetCharFormat( pBullCFormat );
2262  aFormat.SetStart( 1 );
2263  aFormat.SetIncludeUpperLevels( 1 );
2265  aFormat.SetBulletChar( 0x2013 );
2266 
2267  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2268  {
2269 // cm: 0,3 0,6 0,9 1,2 1,5 1,8 2,1 2,4 2,7 3,0
2270  170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701
2271  };
2272  const sal_uInt16* pArr = aAbsSpace;
2273 
2274  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2275  {
2276  aFormat.SetFirstLineOffset( - (*pArr) );
2277  }
2278  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2279  {
2281  aFormat.SetFirstLineIndent( - (*pArr) );
2282  }
2283 
2284  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2285  {
2286  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2287  {
2288  aFormat.SetAbsLSpace( *pArr );
2289  }
2290  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2291  {
2292  aFormat.SetListtabPos( *pArr );
2293  aFormat.SetIndentAt( *pArr );
2294  }
2295 
2296  pNewRule->Set( n, aFormat );
2297  }
2298  }
2299  break;
2300  case RES_POOLNUMRULE_BUL3:
2301  {
2302  SwNumFormat aFormat;
2303 
2304  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2305 
2307  aFormat.SetCharFormat( pBullCFormat );
2308  aFormat.SetStart( 1 );
2309  aFormat.SetIncludeUpperLevels( 1 );
2311 
2312  sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4;
2313 
2314  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2315  {
2316  aFormat.SetFirstLineOffset( - nOffs );
2317  }
2318  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2319  {
2321  aFormat.SetFirstLineIndent( - nOffs );
2322  }
2323 
2324  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
2325  {
2326  aFormat.SetBulletChar( (n & 1) ? 0x25a1 : 0x2611 );
2327 
2328  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2329  {
2330  aFormat.SetAbsLSpace( ((n & 1) +1) * nOffs );
2331  }
2332  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2333  {
2334  long nPos = ((n & 1) +1) * static_cast<long>(nOffs);
2335  aFormat.SetListtabPos(nPos);
2336  aFormat.SetIndentAt(nPos);
2337  }
2338 
2339  pNewRule->Set( n, aFormat );
2340  }
2341  }
2342  break;
2343  case RES_POOLNUMRULE_BUL4:
2344  {
2345  SwNumFormat aFormat;
2346 
2347  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2349  aFormat.SetCharFormat( pBullCFormat );
2350  aFormat.SetStart( 1 );
2351  aFormat.SetIncludeUpperLevels( 1 );
2353 
2354  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2355  {
2356 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
2357  227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
2358  };
2359 
2360  const sal_uInt16* pArr = aAbsSpace;
2361 
2362  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2363  {
2364  aFormat.SetFirstLineOffset( - (*pArr) );
2365  }
2366  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2367  {
2369  aFormat.SetFirstLineIndent( - (*pArr) );
2370  }
2371 
2372  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2373  {
2374  switch( n )
2375  {
2376  case 0: aFormat.SetBulletChar( 0x27a2 ); break;
2377  case 1: aFormat.SetBulletChar( 0xE006 ); break;
2378  default: aFormat.SetBulletChar( 0xE004 ); break;
2379  }
2380 
2381  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2382  {
2383  aFormat.SetAbsLSpace( *pArr );
2384  }
2385  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2386  {
2387  aFormat.SetListtabPos( *pArr );
2388  aFormat.SetIndentAt( *pArr );
2389  }
2390 
2391  pNewRule->Set( n, aFormat );
2392  }
2393  }
2394  break;
2395  case RES_POOLNUMRULE_BUL5:
2396  {
2397  SwNumFormat aFormat;
2398 
2399  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2401  aFormat.SetCharFormat( pBullCFormat );
2402  aFormat.SetStart( 1 );
2403  aFormat.SetIncludeUpperLevels( 1 );
2404  aFormat.SetBulletChar( 0x2717 );
2406 
2407  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2408  {
2409 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
2410  227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
2411  };
2412  const sal_uInt16* pArr = aAbsSpace;
2413 
2414  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2415  {
2416  aFormat.SetFirstLineOffset( - (*pArr) );
2417  }
2418  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2419  {
2421  aFormat.SetFirstLineIndent( - (*pArr) );
2422  }
2423 
2424  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2425  {
2426  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2427  {
2428  aFormat.SetAbsLSpace( *pArr );
2429  }
2430  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2431  {
2432  aFormat.SetListtabPos( *pArr );
2433  aFormat.SetIndentAt( *pArr );
2434  }
2435 
2436  pNewRule->Set( n, aFormat );
2437  }
2438  }
2439  break;
2440  }
2441 
2442  return pNewRule;
2443 }
2444 
2447 {
2448  OSL_ENSURE(
2449  (RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
2453  (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) ||
2455  "Wrong AutoFormat Id" );
2456 
2457  SwTextFormatColl* pNewColl = nullptr;
2458  bool bFnd = false;
2459  for( SwTextFormatColls::size_type n = 0; !bFnd && n < m_rDoc.GetTextFormatColls()->size(); ++n )
2460  {
2461  pNewColl = (*m_rDoc.GetTextFormatColls())[ n ];
2462  if( nId == pNewColl->GetPoolFormatId() )
2463  bFnd = true;
2464  }
2465 
2466  if( !bFnd || !pNewColl->HasWriterListeners() )
2467  return false;
2468 
2469  SwAutoFormatGetDocNode aGetHt( &m_rDoc.GetNodes() );
2470  return !pNewColl->GetInfo( aGetHt );
2471 }
2472 
2475 {
2476  const SwFormat *pNewFormat = nullptr;
2477  const SwFormatsBase* pArray[ 2 ];
2478  sal_uInt16 nArrCnt = 1;
2479  bool bFnd = true;
2480 
2481  if (RES_POOLCHR_BEGIN <= nId && nId < RES_POOLCHR_END)
2482  {
2483  pArray[0] = m_rDoc.GetCharFormats();
2484  }
2485  else if (RES_POOLFRM_BEGIN <= nId && nId < RES_POOLFRM_END)
2486  {
2487  pArray[0] = m_rDoc.GetFrameFormats();
2488  pArray[1] = m_rDoc.GetSpzFrameFormats();
2489  nArrCnt = 2;
2490  }
2491  else
2492  {
2493  SAL_WARN("sw.core", "Invalid Pool Id: " << nId << " should be within "
2494  "[" << int(RES_POOLCHR_BEGIN) << "," << int(RES_POOLCHR_END) << ") or "
2495  "[" << int(RES_POOLFRM_BEGIN) << "," << int(RES_POOLFRM_END) << ")");
2496  bFnd = false;
2497  }
2498 
2499  if( bFnd )
2500  {
2501  bFnd = false;
2502  while( nArrCnt-- && !bFnd )
2503  for( size_t n = 0; !bFnd && n < (*pArray[nArrCnt]).GetFormatCount(); ++n )
2504  {
2505  pNewFormat = (*pArray[ nArrCnt ] ).GetFormat( n );
2506  if( nId == pNewFormat->GetPoolFormatId() )
2507  bFnd = true;
2508  }
2509  }
2510 
2511  // Not found or no dependencies?
2512  if( bFnd && pNewFormat->HasWriterListeners() )
2513  {
2514  // Check if we have dependent ContentNodes in the Nodes array
2515  // (also indirect ones for derived Formats)
2516  SwAutoFormatGetDocNode aGetHt( &m_rDoc.GetNodes() );
2517  bFnd = !pNewFormat->GetInfo( aGetHt );
2518  }
2519  else
2520  bFnd = false;
2521 
2522  return bFnd;
2523 }
2524 
2527 {
2528  OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
2529  "Wrong AutoFormat Id" );
2530  SwPageDesc *pNewPgDsc = nullptr;
2531  bool bFnd = false;
2532  for( size_t n = 0; !bFnd && n < m_rDoc.GetPageDescCnt(); ++n )
2533  {
2534  pNewPgDsc = &m_rDoc.GetPageDesc(n);
2535  if( nId == pNewPgDsc->GetPoolFormatId() )
2536  bFnd = true;
2537  }
2538 
2539  // Not found or no dependencies?
2540  if( !bFnd || !pNewPgDsc->HasWriterListeners() ) // ??????
2541  return false;
2542 
2543  // Check if we have dependent ContentNodes in the Nodes array
2544  // (also indirect ones for derived Formats)
2545  SwAutoFormatGetDocNode aGetHt( &m_rDoc.GetNodes() );
2546  return !pNewPgDsc->GetInfo( aGetHt );
2547 }
2548 
2550 {
2551 }
2552 
2553 }
2554 
2555 static std::vector<OUString>
2556 lcl_NewUINameArray(const char** pIds, const size_t nLen, const size_t nSvxIds = 0)
2557 {
2558  assert(nSvxIds <= nLen);
2559  const size_t nWriterIds = nLen - nSvxIds;
2560  std::vector<OUString> aNameArray;
2561  aNameArray.reserve(nLen);
2562  for (size_t i = 0; i < nWriterIds; ++i)
2563  aNameArray.push_back(SwResId(pIds[i]));
2564  for (size_t i = nWriterIds; i < nLen; ++i)
2565  aNameArray.push_back(SvxResId(pIds[i]));
2566  return aNameArray;
2567 }
2568 
2569 const std::vector<OUString>& SwStyleNameMapper::GetTextUINameArray()
2570 {
2571  static const std::vector<OUString> s_aTextUINameArray(
2572  lcl_NewUINameArray(STR_POOLCOLL_TEXT_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_TEXT_ARY)));
2573  return s_aTextUINameArray;
2574 }
2575 
2576 const std::vector<OUString>& SwStyleNameMapper::GetListsUINameArray()
2577 {
2578  static const std::vector<OUString> s_aListsUINameArray(
2579  lcl_NewUINameArray(STR_POOLCOLL_LISTS_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_LISTS_ARY)));
2580  return s_aListsUINameArray;
2581 }
2582 
2583 const std::vector<OUString>& SwStyleNameMapper::GetExtraUINameArray()
2584 {
2585  static const std::vector<OUString> s_aExtraUINameArray(
2587  return s_aExtraUINameArray;
2588 }
2589 
2590 const std::vector<OUString>& SwStyleNameMapper::GetRegisterUINameArray()
2591 {
2592  static const std::vector<OUString> s_aRegisterUINameArray(
2593  lcl_NewUINameArray(STR_POOLCOLL_REGISTER_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_REGISTER_ARY)));
2594  return s_aRegisterUINameArray;
2595 }
2596 
2597 const std::vector<OUString>& SwStyleNameMapper::GetDocUINameArray()
2598 {
2599  static const std::vector<OUString> s_aDocUINameArray(
2600  lcl_NewUINameArray(STR_POOLCOLL_DOC_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_DOC_ARY)));
2601  return s_aDocUINameArray;
2602 }
2603 
2604 const std::vector<OUString>& SwStyleNameMapper::GetHTMLUINameArray()
2605 {
2606  static const std::vector<OUString> s_aHTMLUINameArray(
2607  lcl_NewUINameArray(STR_POOLCOLL_HTML_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_HTML_ARY)));
2608  return s_aHTMLUINameArray;
2609 }
2610 
2611 const std::vector<OUString>& SwStyleNameMapper::GetFrameFormatUINameArray()
2612 {
2613  static const std::vector<OUString> s_aFrameFormatUINameArray(
2614  lcl_NewUINameArray(STR_POOLFRM_ARY, SAL_N_ELEMENTS(STR_POOLFRM_ARY)));
2615  return s_aFrameFormatUINameArray;
2616 }
2617 
2618 const std::vector<OUString>& SwStyleNameMapper::GetChrFormatUINameArray()
2619 {
2620  static const std::vector<OUString> s_aChrFormatUINameArray(
2621  lcl_NewUINameArray(STR_POOLCHR_ARY, SAL_N_ELEMENTS(STR_POOLCHR_ARY)));
2622  return s_aChrFormatUINameArray;
2623 }
2624 
2626 {
2627  static const std::vector<OUString> s_aHTMLChrFormatUINameArray(
2628  lcl_NewUINameArray(STR_POOLCHR_HTML_ARY, SAL_N_ELEMENTS(STR_POOLCHR_HTML_ARY)));
2629  return s_aHTMLChrFormatUINameArray;
2630 }
2631 
2632 const std::vector<OUString>& SwStyleNameMapper::GetPageDescUINameArray()
2633 {
2634  static const std::vector<OUString> s_aPageDescUINameArray(
2635  lcl_NewUINameArray(STR_POOLPAGE_ARY, SAL_N_ELEMENTS(STR_POOLPAGE_ARY)));
2636  return s_aPageDescUINameArray;
2637 }
2638 
2639 const std::vector<OUString>& SwStyleNameMapper::GetNumRuleUINameArray()
2640 {
2641  static const std::vector<OUString> s_aNumRuleUINameArray(
2642  lcl_NewUINameArray(STR_POOLNUMRULE_NUM_ARY, SAL_N_ELEMENTS(STR_POOLNUMRULE_NUM_ARY)));
2643  return s_aNumRuleUINameArray;
2644 }
2645 
2646 const std::vector<OUString>& SwStyleNameMapper::GetTableStyleUINameArray()
2647 {
2648  static const std::vector<OUString> s_aTableStyleUINameArray(
2649  // 1 Writer resource string (XXX if this ever changes rather use offset math)
2650  lcl_NewUINameArray(STR_TABSTYLE_ARY, SAL_N_ELEMENTS(STR_TABSTYLE_ARY),
2651  static_cast<size_t>(SAL_N_ELEMENTS(STR_TABSTYLE_ARY) - 1)));
2652  return s_aTableStyleUINameArray;
2653 }
2654 
2655 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long GetLeft() const
End 1st level.
Definition: poolfmt.hxx:283
long Width() const
NumRule Numbering abc.
Definition: poolfmt.hxx:191
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(100)
static const char * STR_POOLCOLL_HTML_ARY[]
virtual bool IsPoolPageDescUsed(sal_uInt16 nId) const override
Check if this AutoCollection is already/still in use in this Document.
Subgroup labels.
Definition: poolfmt.hxx:345
#define LANGUAGE_NONE
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
bool Insert(const SvxTabStop &rTab)
void SetLabelFollowedBy(const LabelFollowedBy eLabelFollowedBy)
void SetUseOn(UseOnPage eNew)
Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified.
Definition: pagedesc.hxx:320
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:587
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL5S
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL3S
Group HTML-styles.
Definition: poolfmt.hxx:430
static sal_uInt16 GetBullIndent(sal_uInt8 nLvl)
Definition: number.cxx:166
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
Subgroup numberings.
Definition: poolfmt.hxx:281
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
static const std::vector< OUString > & GetListsUINameArray()
static const char * STR_POOLCOLL_EXTRA_ARY[]
Footnote at end of document.
Definition: poolfmt.hxx:178
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
const OUString & GetFamilyName() const
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL1S
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:218
#define LANGUAGE_ARABIC_SAUDI_ARABIA
#define LINE_SPACE_DEFAULT_HEIGHT
static const std::vector< OUString > & GetTableStyleUINameArray()
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL1S
Group chapter / document.
Definition: poolfmt.hxx:421
#define LANGUAGE_ENGLISH_US
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL3E
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL3
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL3E
void SetAutoRule(bool bFlag)
Definition: numrule.hxx:228
static const char * STR_POOLPAGE_ARY[]
const OUString & GetStyleName() const
Start 3rd level.
Definition: poolfmt.hxx:289
static const std::vector< OUString > & GetFrameFormatUINameArray()
#define CM_01
static const char * STR_POOLCHR_HTML_ARY[]
const sal_uInt16 COLL_GET_RANGE_BITS
Definition: poolfmt.hxx:72
long Height() const
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId) override
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL4E
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM5
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(110)
void SetPositionAndSpaceMode(SvxNumPositionAndSpaceMode ePositionAndSpaceMode)
constexpr::Color COL_RED(0x80, 0x00, 0x00)
long GetWidth() const
static const std::vector< OUString > & GetHTMLUINameArray()
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL5S
Header Left.
Definition: poolfmt.hxx:332
Pages/field.
Definition: poolfmt.hxx:115
NumRule Bullets 1.
Definition: poolfmt.hxx:194
End of text styles collection.
Definition: poolfmt.hxx:438
Main entry in indices.
Definition: poolfmt.hxx:127
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
const short lNumberFirstLineOffset
Definition: swtypes.hxx:110
NumRule Bullets 3.
Definition: poolfmt.hxx:196
Subgroup user indices.
Definition: poolfmt.hxx:382
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL4S
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:399
SVX_NUM_CHARS_UPPER_LETTER
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat IDs.
Definition: numrule.hxx:248
SwFrameFormat & GetFirstMaster()
Definition: pagedesc.hxx:219
#define LANGUAGE_KOREAN
Doc. subtitle.
Definition: poolfmt.hxx:424
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true) override
Return "Auto-Collection with ID.
Special ranges.
Definition: poolfmt.hxx:327
sal_Int64 n
Objects all levels.
Definition: poolfmt.hxx:401
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL5E
Start 2nd level.
Definition: poolfmt.hxx:307
Definition: doc.hxx:184
Vertical numbering symbols.
Definition: poolfmt.hxx:131
const sal_Unicode cBulletChar
Character for lists.
Definition: numrule.hxx:47
Content 1st level.
Definition: poolfmt.hxx:375
sal_uInt16 GetPoolParent(sal_uInt16 nId)
Query defined parent of a POOL-ID Returns 0 if standard USHRT_MAX if no parent the parent in all othe...
Definition: poolfmt.cxx:143
constexpr::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
void SetTextLeft(const long nL, const sal_uInt16 nProp=100)
PAPER_ENV_C65
long SwTwips
Definition: swtypes.hxx:49
const OUString & GetName() const
Definition: numrule.hxx:222
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(99)
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:143
void SetIncludeUpperLevels(sal_uInt8 nSet)
SwFormat * MakeFrameFormat_(const OUString &, SwFormat *, bool, bool)
Definition: docfmt.cxx:834
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:329
Tables all levels.
Definition: poolfmt.hxx:405
bool HasWriterListeners() const
Definition: calbck.hxx:208
static const char * STR_POOLCOLL_REGISTER_ARY[]
virtual bool GetInfo(SfxPoolItem &) const override
Definition: calbck.cxx:206
static const char * STR_POOLCOLL_TEXT_ARY[]
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:739
static const std::vector< OUString > & GetPageDescUINameArray()
sal_uInt16 const aTextFormatCollSetRange[]
Definition: init.cxx:150
Value in Var-direction gives minimum (can be exceeded but not be less).
void SetFollow(const SwPageDesc *pNew)
Definition: pagedesc.hxx:293
FontFamily GetFamilyType()
Landscape page style.
Definition: poolfmt.hxx:180
Content 5th level.
Definition: poolfmt.hxx:379
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM4
static const char * STR_POOLCHR_ARY[]
WEIGHT_BOLD
static const std::vector< OUString > & GetDocUINameArray()
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
const SwPageFootnoteInfo & GetFootnoteInfo() const
Definition: pagedesc.hxx:196
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:109
const SwCharFormat * GetDfltCharFormat() const
Definition: doc.hxx:748
void SetLeft(const long nL, const sal_uInt16 nProp=100)
void SetPropLineSpace(const sal_uInt16 nProp)
provides some methods for generic operations on lists that contain SwFormat* subclasses.
Definition: docary.hxx:43
void SetFootnoteInfo(const SwPageFootnoteInfo &rNew)
Definition: pagedesc.hxx:198
LINESTYLE_NONE
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL5E
OUString SvxResId(const char *pId)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUMBER_BULLET_BASE
void SetPoolFormatId(sal_uInt16 nId)
Definition: format.hxx:144
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
Definition: pagedesc.hxx:254
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:425
const SwTextFormatColl * GetDfltTextFormatColl() const
Definition: doc.hxx:773
Subgroup header.
Definition: poolfmt.hxx:330
void SetLandscape(bool bNew)
Definition: pagedesc.hxx:191
constexpr::Color COL_CYAN(0x00, 0x80, 0x80)
void SetNextTextFormatColl(SwTextFormatColl &rNext)
Inline implementations.
Definition: fmtcol.hxx:228
SwFormat * MakeCharFormat_(const OUString &, SwFormat *, bool, bool)
Definition: docfmt.cxx:867
void SetAllScriptItem(SfxItemSet &rSet, const SfxPoolItem &rItem)
Definition: poolfmt.cxx:39
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
Definition: docfmt.cxx:653
SVX_NUM_ARABIC
No numbering.
Definition: poolfmt.hxx:292
Content 6th level.
Definition: poolfmt.hxx:389
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL1E
SVX_NUM_ROMAN_UPPER
#define DFLT_ESC_AUTO_SUPER
NumRule Numbering ivx.
Definition: poolfmt.hxx:193
Numbering symbols.
Definition: poolfmt.hxx:118
SVX_NUM_ROMAN_LOWER
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:153
virtual SwNumRule * GetNumRuleFromPool(sal_uInt16 nId) override
void SetAllDistances(sal_uInt16 nNew)
Content 2nd level.
Definition: poolfmt.hxx:376
Text body indent.
Definition: poolfmt.hxx:254
#define DFLT_ESC_PROP
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM1
Authorities all levels.
Definition: poolfmt.hxx:409
const sal_uInt16 POOLGRP_NOCOLLID
POOLCOLL-IDs: +-—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ !User! Range ! 0 ! Offset ! +-—+—+...
Definition: poolfmt.hxx:59
Other stuff.
Definition: poolfmt.hxx:352
void SetPoolFormatId(sal_uInt16 nId)
Definition: numrule.hxx:249
sal_uInt16 GetPoolFormatId() const
Get and set Pool style IDs.
Definition: format.hxx:143
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM2
void SetFirstLineIndent(const long nFirstLineIndent)
Base class for various Writer styles.
Definition: format.hxx:43
#define SAL_N_ELEMENTS(arr)
Content 3rd level.
Definition: poolfmt.hxx:377
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL2
void SetNumAdjust(SvxAdjust eSet)
SVX_NUM_CHAR_SPECIAL
object index.
Definition: poolfmt.hxx:400
Table of Contents - heading.
Definition: poolfmt.hxx:342
NumRule Bullets 2.
Definition: poolfmt.hxx:195
virtual SvxULSpaceItem * Clone(SfxItemPool *pPool=nullptr) const override
void SetRight(const long nR, const sal_uInt16 nProp=100)
void SetListtabPos(const long nListtabPos)
Start 3rd level.
Definition: poolfmt.hxx:311
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL2S
Style of a layout element.
Definition: frmfmt.hxx:57
SVX_NUM_CHARS_LOWER_LETTER
Footnote anchor.
Definition: poolfmt.hxx:128
FontPitch GetPitch()
HTML-styles.
Definition: poolfmt.hxx:135
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL4
Complimentary close.
Definition: poolfmt.hxx:255
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true) override
Return required automatic page style.
void SetIndentAt(const long nIndentAt)
void SetTextFirstLineOffsetValue(const short nValue)
Internet visited.
Definition: poolfmt.hxx:122
int i
void SetBulletFont(const vcl::Font *pFont)
sal_Int32 GetAbsLSpace() const
No numbering.
Definition: poolfmt.hxx:288
End 5th level.
Definition: poolfmt.hxx:299
No numbering.
Definition: poolfmt.hxx:296
Marginalia.
Definition: poolfmt.hxx:159
First page.
Definition: poolfmt.hxx:172
std::vector< SwTextFormatColl * >::size_type size_type
Definition: docary.hxx:63
Subgroup headings.
Definition: poolfmt.hxx:261
Subgroup footer.
Definition: poolfmt.hxx:336
NumRule Numbering IVX.
Definition: poolfmt.hxx:192
virtual bool IsModified() const =0
Changes of document?
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1319
End 2nd level.
Definition: poolfmt.hxx:287
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:878
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL1
void SetAuto(bool bNew)
Definition: format.hxx:159
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL1
bool GetLandscape() const
Definition: pagedesc.hxx:190
Text body.
Definition: poolfmt.hxx:251
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
Definition: docdesc.cxx:638
NumRule Numbering ABC.
Definition: poolfmt.hxx:190
FlyAnchors.
Definition: fmtanchr.hxx:34
Jump from index.
Definition: poolfmt.hxx:124
End 4th level.
Definition: poolfmt.hxx:295
bool IsConditionalByPoolId(sal_uInt16 nId)
const SvxPageUsage aArr[]
const short lBulletFirstLineOffset
Definition: swtypes.hxx:108
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
size_t GetPageDescCnt() const
Definition: doc.hxx:877
Internet normal.
Definition: poolfmt.hxx:121
LINESTYLE_SINGLE
float u
size_t size() const
Definition: docary.hxx:84
Header Left&Right.
Definition: poolfmt.hxx:331
void SetBulletChar(sal_Unicode cSet)
Header Right.
Definition: poolfmt.hxx:333
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:393
#define LANGUAGE_DONTKNOW
Endnote anchor.
Definition: poolfmt.hxx:129
Label drawing objects.
Definition: poolfmt.hxx:358
Subgroup bullets.
Definition: poolfmt.hxx:303
constexpr TypedWhichId< SvxLineSpacingItem > RES_PARATR_LINESPACING(RES_PARATR_BEGIN)
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
static sal_uInt16 GetNumIndent(sal_uInt8 nLvl)
Definition: number.cxx:160
void SetPoolFormatId(sal_uInt16 const nId)
Definition: pagedesc.hxx:255
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL2
PDFDocument & m_rDoc
constexpr TypedWhichId< SvxEmphasisMarkItem > RES_CHRATR_EMPHASIS_MARK(33)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL2E
SfxItemPool * GetPool() const
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL1E
Left page.
Definition: poolfmt.hxx:173
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL2E
#define CM_1
Start 4th level.
Definition: poolfmt.hxx:293
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM3
Illustrations all levels.
Definition: poolfmt.hxx:397
Frame cannot be moved in Var-direction.
void SetCountLines(bool b)
Definition: fmtline.hxx:61
Text body first line indent.
Definition: poolfmt.hxx:252
const sal_uInt16 POOLGRP_FRAMEFMT
Definition: poolfmt.hxx:77
void push_back(Value const &rVal)
Definition: docary.hxx:98
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM2
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:742
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:594
user index 6..10.
Definition: poolfmt.hxx:412
Endnote page.
Definition: poolfmt.hxx:179
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL2S
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL4E
Size & LandscapeSwap(Size &rSize)
sal_uInt16 const aFrameFormatSetRange[]
Definition: init.cxx:234
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
static const std::vector< OUString > & GetNumRuleUINameArray()
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
illustrations index.
Definition: poolfmt.hxx:396
constexpr TypedWhichId< SvxScriptSpaceItem > RES_PARATR_SCRIPTSPACE(73)
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:78
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL3
virtual SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId) override
Return required automatic format.
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static const std::vector< OUString > & GetHTMLChrFormatUINameArray()
Content 9th level.
Definition: poolfmt.hxx:392
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:76
void SetSizeProtect(bool bNew)
Footnote information.
Definition: pagedesc.hxx:48
static const std::vector< OUString > & GetChrFormatUINameArray()
void Set(sal_uInt16 i, const SwNumFormat *)
Definition: number.cxx:588
Doc. appendix.
Definition: poolfmt.hxx:425
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:272
Start 5th level.
Definition: poolfmt.hxx:319
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL5
static const std::vector< OUString > & GetExtraUINameArray()
constexpr TypedWhichId< SvxOrphansItem > RES_PARATR_ORPHANS(66)
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:735
void SetPosProtect(bool bNew)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL4
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
Definition: number.cxx:1441
#define MM50
Definition: swtypes.hxx:59
#define CM_05
static const char * STR_POOLNUMRULE_NUM_ARY[]
NumRule Numbering 123.
Definition: poolfmt.hxx:189
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:775
ITALIC_NORMAL
unsigned char sal_uInt8
virtual bool GetInfo(SfxPoolItem &) const override
Query information from Client.
Definition: pagedesc.cxx:180
LINESTYLE_DOTTED
void SetFirstLineOffset(sal_Int32 nSet)
Right page.
Definition: poolfmt.hxx:174
SwFrameFormat & GetFirstLeft()
Definition: pagedesc.hxx:220
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1063
Marginalia.
Definition: poolfmt.hxx:258
static std::vector< OUString > lcl_NewUINameArray(const char **pIds, const size_t nLen, const size_t nSvxIds=0)
Content 4th level.
Definition: poolfmt.hxx:378
static const char * STR_POOLCOLL_DOC_ARY[]
LanguageType GetAppLanguage()
Definition: init.cxx:729
SwNodes & GetNodes()
Definition: doc.hxx:403
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
Start 2nd level.
Definition: poolfmt.hxx:285
virtual SvxLRSpaceItem * Clone(SfxItemPool *pPool=nullptr) const override
static const std::vector< OUString > & GetRegisterUINameArray()
sal_uInt16 const aCharFormatSetRange[]
Definition: init.cxx:245
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM5
Content 10th level.
Definition: poolfmt.hxx:393
::sw::DocumentSettingManager & GetDocumentSettingManager()
Definition: doc.cxx:185
Content 8th level.
Definition: poolfmt.hxx:391
NumRule Bullets 4.
Definition: poolfmt.hxx:197
Start 5th level.
Definition: poolfmt.hxx:297
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
Definition: docnum.cxx:2449
Label illustration.
Definition: poolfmt.hxx:346
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:377
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL4S
tables index.
Definition: poolfmt.hxx:404
void SetSuffix(const OUString &rSet)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM4
sal_Int32 GetFirstLineOffset() const
Start 4th level.
Definition: poolfmt.hxx:315
virtual bool IsPoolTextCollUsed(sal_uInt16 nId) const override
Check if this AutoCollection is already/still in use in this Document.
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
DefaultFontType
long GetRight() const
void SetStart(sal_uInt16 nSet)
SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
Return the AutoCollection by its Id.
Definition: poolfmt.cxx:77
static const char * STR_POOLFRM_ARY[]
void SetLineWidth(sal_uLong const nSet)
Definition: pagedesc.hxx:71
No numbering.
Definition: poolfmt.hxx:300
Footer Left.
Definition: poolfmt.hxx:337
virtual SwFormat * GetFormatFromPool(sal_uInt16 nId) override
Return the AutomaticFormat with the supplied Id.
Line numbering.
Definition: poolfmt.hxx:126
#define SAL_WARN(area, stream)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM1
Content 7th level.
Definition: poolfmt.hxx:390
void SetAbsLSpace(sal_Int32 nSet)
constexpr::Color COL_BLUE(0x00, 0x00, 0x80)
No numbering.
Definition: poolfmt.hxx:284
Subgroup index tables.
Definition: poolfmt.hxx:367
Text body hanging indent.
Definition: poolfmt.hxx:253
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
Subgroup table of contents.
Definition: poolfmt.hxx:374
#define DEF_LINE_WIDTH_0
sal_uInt16 const aPgFrameFormatSetRange[]
Definition: init.cxx:260
End 3rd level.
Definition: poolfmt.hxx:291
void SetNumberingType(SvxNumType nSet)
long const nRightMargin
const SwFrameFormats * GetFrameFormats() const
Definition: doc.hxx:733
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM3
Subgroup table.
Definition: poolfmt.hxx:341
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL3S
sal_uInt16 GetMetricVal(int n)
long GetHeight() const
index of authorities.
Definition: poolfmt.hxx:408
Envelope.
Definition: poolfmt.hxx:175
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
Standard page.
Definition: poolfmt.hxx:171
const sal_uInt16 POOLGRP_CHARFMT
Other groups:
Definition: poolfmt.hxx:76
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL5
static const std::vector< OUString > & GetTextUINameArray()
NumRule Bullets 5.
Definition: poolfmt.hxx:198
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
Footer Right.
Definition: poolfmt.hxx:338
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
#define HTML_PARSPACE
static const char * STR_TABSTYLE_ARY[]
constexpr TypedWhichId< SvxWidowsItem > RES_PARATR_WIDOWS(67)
rtl_TextEncoding GetCharSet() const
sal_uInt16 nPos
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1315
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1021
virtual bool IsPoolFormatUsed(sal_uInt16 nId) const override
Check if this AutoCollection is already/still in use.
virtual void ResetModified()=0
Placeholder.
Definition: poolfmt.hxx:123
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74
void SetAutoUpdateFormat(bool bNew=true)
Definition: format.hxx:169