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