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 
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 const TranslateId STR_POOLCOLL_LISTS_ARY[]
310 {
311  // Category Lists
313  // Subcategory Numbering
334 
335  // Subcategory Enumeration
356 };
357 
358 // Special Areas
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 
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 
439 {
440  // Category Chapter/Document
441  STR_POOLCOLL_DOC_TITLE,
442  STR_POOLCOLL_DOC_SUBTITLE,
443  STR_POOLCOLL_DOC_APPENDIX
444 };
445 
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 
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 
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 
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 
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 
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
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  TranslateId pResId;
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: // Table 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  // tdf#143066 : set language to 'none' to prevent spell checking for indices
824  if (nId == RES_POOLCOLL_REGISTER_BASE)
825  {
829  }
830  break;
831  }
832  break;
833 
834  case RES_POOLCOLL_HEADLINE1: // Heading 1
835  {
836  SvxULSpaceItem aUL( PT_12, PT_6, RES_UL_SPACE );
837  aSet.Put( aUL );
838  lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 0, false );
839  }
840  break;
841  case RES_POOLCOLL_HEADLINE2: // Heading 2
842  {
843  SvxULSpaceItem aUL( PT_10, PT_6, RES_UL_SPACE );
844  aSet.Put( aUL );
845  lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 1, false );
846  }
847  break;
848  case RES_POOLCOLL_HEADLINE3: // Heading 3
849  {
850  SvxULSpaceItem aUL( PT_7, PT_6, RES_UL_SPACE );
851  aSet.Put( aUL );
852  lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 2, false );
853  }
854  break;
855  case RES_POOLCOLL_HEADLINE4: // Heading 4
856  {
857  SvxULSpaceItem aUL( PT_6, PT_6, RES_UL_SPACE );
858  aSet.Put( aUL );
859  lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 3, true );
860  }
861  break;
862  case RES_POOLCOLL_HEADLINE5: // Heading 5
863  {
864  SvxULSpaceItem aUL( PT_6, PT_3, RES_UL_SPACE );
865  aSet.Put( aUL );
866  lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 4, false );
867  }
868  break;
869  case RES_POOLCOLL_HEADLINE6: // Heading 6
870  {
871  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
872  aSet.Put( aUL );
873  lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 5, true );
874  }
875  break;
876  case RES_POOLCOLL_HEADLINE7: // Heading 7
877  {
878  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
879  aSet.Put( aUL );
880  lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 6, false );
881  }
882  break;
883  case RES_POOLCOLL_HEADLINE8: // Heading 8
884  {
885  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
886  aSet.Put( aUL );
887  lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 7, true );
888  }
889  break;
890  case RES_POOLCOLL_HEADLINE9: // Heading 9
891  {
892  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
893  aSet.Put( aUL );
894  lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 8, false );
895  }
896  break;
897  case RES_POOLCOLL_HEADLINE10: // Heading 10
898  {
899  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
900  aSet.Put( aUL );
901  lcl_SetHeadline( m_rDoc, pNewColl, aSet, nOutLvlBits, 9, false );
902  }
903  break;
904 
905  // Special sections:
906  // Header
908  case RES_POOLCOLL_HEADER:
911  // Footer
912  case RES_POOLCOLL_FOOTER:
915  {
916  SwFormatLineNumber aLN;
917  aLN.SetCountLines( false );
918  aSet.Put( aLN );
919 
920  tools::Long nRightMargin = lcl_GetRightMargin( m_rDoc );
921 
922  SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
923  aTStops.Insert( SvxTabStop( nRightMargin / 2, SvxTabAdjust::Center ) );
924  aTStops.Insert( SvxTabStop( nRightMargin, SvxTabAdjust::Right ) );
925 
926  aSet.Put( aTStops );
927 
928  if ( (nId==RES_POOLCOLL_HEADERR) || (nId==RES_POOLCOLL_FOOTERR) ) {
929  SvxAdjustItem aAdjust(SvxAdjust::Right, RES_PARATR_ADJUST );
930  aSet.Put(aAdjust);
931  }
932  }
933  break;
934 
936  {
938  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) );
939  SwFormatLineNumber aLN;
940  aLN.SetCountLines( false );
941  aSet.Put( aLN );
942  }
943  break;
944 
945  case RES_POOLCOLL_FOOTNOTE: // paragraph style Footnote
946  case RES_POOLCOLL_ENDNOTE: // paragraph style Endnote
947  {
952  aSet.Put( aLR );
953  SwFormatLineNumber aLN;
954  aLN.SetCountLines( false );
955  aSet.Put( aLN );
956  }
957  break;
958 
959  case RES_POOLCOLL_LABEL: // basic caption
960  {
962  aUL.SetUpper( PT_6 );
963  aUL.SetLower( PT_6 );
964  aSet.Put( aUL );
967  SwFormatLineNumber aLN;
968  aLN.SetCountLines( false );
969  aSet.Put( aLN );
970  }
971  break;
972 
973  case RES_POOLCOLL_FRAME: // Frame content
974  case RES_POOLCOLL_LABEL_ABB: // caption image
975  case RES_POOLCOLL_LABEL_TABLE: // caption table
976  case RES_POOLCOLL_LABEL_FRAME: // caption frame
977  case RES_POOLCOLL_LABEL_DRAWING: // caption drawing
979  break;
980 
981  case RES_POOLCOLL_ENVELOPE_ADDRESS: // envelope address
982  {
984  aUL.SetLower( PT_3 );
985  aSet.Put( aUL );
986  SwFormatLineNumber aLN;
987  aLN.SetCountLines( false );
988  aSet.Put( aLN );
989  }
990  break;
991 
992  case RES_POOLCOLL_SEND_ADDRESS: // Sender address
993  {
996  else
997  {
998  SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetLower( PT_3 );
999  aSet.Put( aUL );
1000  }
1001  SwFormatLineNumber aLN;
1002  aLN.SetCountLines( false );
1003  aSet.Put( aLN );
1004  }
1005  break;
1006  // User defined indexes:
1007  case RES_POOLCOLL_TOX_USERH: // Header
1008  lcl_SetRegister( m_rDoc, aSet, 0, true, false );
1009  {
1010  SwFormatLineNumber aLN;
1011  aLN.SetCountLines( false );
1012  aSet.Put( aLN );
1013  }
1014  break;
1015  case RES_POOLCOLL_TOX_USER1: // 1st level
1016  lcl_SetRegister( m_rDoc, aSet, 0, false, true );
1017  break;
1018  case RES_POOLCOLL_TOX_USER2: // 2nd level
1019  lcl_SetRegister( m_rDoc, aSet, 1, false, true );
1020  break;
1021  case RES_POOLCOLL_TOX_USER3: // 3rd level
1022  lcl_SetRegister( m_rDoc, aSet, 2, false, true );
1023  break;
1024  case RES_POOLCOLL_TOX_USER4: // 4th level
1025  lcl_SetRegister( m_rDoc, aSet, 3, false, true );
1026  break;
1027  case RES_POOLCOLL_TOX_USER5: // 5th level
1028  lcl_SetRegister( m_rDoc, aSet, 4, false, true );
1029  break;
1030  case RES_POOLCOLL_TOX_USER6: // 6th level
1031  lcl_SetRegister( m_rDoc, aSet, 5, false, true );
1032  break;
1033  case RES_POOLCOLL_TOX_USER7: // 7th level
1034  lcl_SetRegister( m_rDoc, aSet, 6, false, true );
1035  break;
1036  case RES_POOLCOLL_TOX_USER8: // 8th level
1037  lcl_SetRegister( m_rDoc, aSet, 7, false, true );
1038  break;
1039  case RES_POOLCOLL_TOX_USER9: // 9th level
1040  lcl_SetRegister( m_rDoc, aSet, 8, false, true );
1041  break;
1042  case RES_POOLCOLL_TOX_USER10: // 10th level
1043  lcl_SetRegister( m_rDoc, aSet, 9, false, true );
1044  break;
1045 
1046  // Index
1047  case RES_POOLCOLL_TOX_IDXH: // Header
1048  lcl_SetRegister( m_rDoc, aSet, 0, true, false );
1049  {
1050  SwFormatLineNumber aLN;
1051  aLN.SetCountLines( false );
1052  aSet.Put( aLN );
1053  }
1054  break;
1055  case RES_POOLCOLL_TOX_IDX1: // 1st level
1056  lcl_SetRegister( m_rDoc, aSet, 0, false, false );
1057  break;
1058  case RES_POOLCOLL_TOX_IDX2: // 2nd level
1059  lcl_SetRegister( m_rDoc, aSet, 1, false, false );
1060  break;
1061  case RES_POOLCOLL_TOX_IDX3: // 3rd level
1062  lcl_SetRegister( m_rDoc, aSet, 2, false, false );
1063  break;
1064  case RES_POOLCOLL_TOX_IDXBREAK: // Separator
1065  lcl_SetRegister( m_rDoc, aSet, 0, false, false );
1066  break;
1067 
1068  // Table of Content
1069  case RES_POOLCOLL_TOX_CNTNTH: // Header
1070  lcl_SetRegister( m_rDoc, aSet, 0, true, false );
1071  {
1072  SwFormatLineNumber aLN;
1073  aLN.SetCountLines( false );
1074  aSet.Put( aLN );
1075  }
1076  break;
1077  case RES_POOLCOLL_TOX_CNTNT1: // 1st level
1078  lcl_SetRegister( m_rDoc, aSet, 0, false, true );
1079  break;
1080  case RES_POOLCOLL_TOX_CNTNT2: // 2nd level
1081  lcl_SetRegister( m_rDoc, aSet, 1, false, true );
1082  break;
1083  case RES_POOLCOLL_TOX_CNTNT3: // 3rd level
1084  lcl_SetRegister( m_rDoc, aSet, 2, false, true );
1085  break;
1086  case RES_POOLCOLL_TOX_CNTNT4: // 4th level
1087  lcl_SetRegister( m_rDoc, aSet, 3, false, true );
1088  break;
1089  case RES_POOLCOLL_TOX_CNTNT5: // 5th level
1090  lcl_SetRegister( m_rDoc, aSet, 4, false, true );
1091  break;
1092  case RES_POOLCOLL_TOX_CNTNT6: // 6th level
1093  lcl_SetRegister( m_rDoc, aSet, 5, false, true );
1094  break;
1095  case RES_POOLCOLL_TOX_CNTNT7: // 7th level
1096  lcl_SetRegister( m_rDoc, aSet, 6, false, true );
1097  break;
1098  case RES_POOLCOLL_TOX_CNTNT8: // 8th level
1099  lcl_SetRegister( m_rDoc, aSet, 7, false, true );
1100  break;
1101  case RES_POOLCOLL_TOX_CNTNT9: // 9th level
1102  lcl_SetRegister( m_rDoc, aSet, 8, false, true );
1103  break;
1104  case RES_POOLCOLL_TOX_CNTNT10: // 10th level
1105  lcl_SetRegister( m_rDoc, aSet, 9, false, true );
1106  break;
1107 
1112  lcl_SetRegister( m_rDoc, aSet, 0, true, false );
1113  {
1114  SwFormatLineNumber aLN;
1115  aLN.SetCountLines( false );
1116  aSet.Put( aLN );
1117  }
1118  break;
1123  lcl_SetRegister( m_rDoc, aSet, 0, false, true );
1124  break;
1125 
1127  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
1129  PT_12, PT_6 );
1130  break;
1132  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
1134  0, PT_6 );
1135  break;
1137  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
1139  0, PT_12 );
1140  break;
1142  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM1,
1143  0, SwNumRule::GetNumIndent( 0 ), 0, PT_6 );
1144  break;
1146  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
1148  PT_12, PT_6 );
1149  break;
1151  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
1153  0, PT_6 );
1154  break;
1156  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
1158  0, PT_12 );
1159  break;
1161  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM2,
1162  0, SwNumRule::GetNumIndent( 1 ), 0, PT_6 );
1163  break;
1165  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
1167  PT_12, PT_6 );
1168  break;
1170  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
1172  0, PT_6 );
1173  break;
1175  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
1177  0, PT_12 );
1178  break;
1180  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM3,
1181  0, SwNumRule::GetNumIndent( 2 ), 0, PT_6 );
1182  break;
1184  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
1186  PT_12, PT_6 );
1187  break;
1189  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
1191  0, PT_6 );
1192  break;
1194  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
1196  0, PT_12 );
1197  break;
1199  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM4,
1200  0, SwNumRule::GetNumIndent( 3 ), 0, PT_6 );
1201  break;
1203  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
1205  PT_12, PT_6 );
1206  break;
1208  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
1210  0, PT_6 );
1211  break;
1213  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
1215  0, PT_12 );
1216  break;
1218  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM5,
1219  0, SwNumRule::GetNumIndent( 4 ), 0, PT_6 );
1220  break;
1221 
1223  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL1,
1225  PT_12, PT_6 );
1226  break;
1228  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL1,
1230  0, PT_6 );
1231  break;
1233  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL1,
1235  0, PT_12 );
1236  break;
1238  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM1,
1239  0, SwNumRule::GetBullIndent( 0 ), 0, PT_6 );
1240  break;
1242  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL2,
1244  PT_12, PT_6 );
1245  break;
1247  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL2,
1249  0, PT_6 );
1250  break;
1252  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL2,
1254  0, PT_12 );
1255  break;
1257  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM2,
1258  0, SwNumRule::GetBullIndent( 1 ), 0, PT_6 );
1259  break;
1261  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL3,
1263  PT_12, PT_6 );
1264  break;
1266  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL3,
1268  0, PT_6 );
1269  break;
1271  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL3,
1273  0, PT_12 );
1274  break;
1276  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM3,
1277  0, SwNumRule::GetBullIndent( 2 ), 0, PT_6 );
1278  break;
1280  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL4,
1282  PT_12, PT_6 );
1283  break;
1285  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL4,
1287  0, PT_6 );
1288  break;
1290  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL4,
1292  0, PT_12 );
1293  break;
1295  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM4,
1296  0, SwNumRule::GetBullIndent( 3 ), 0, PT_6 );
1297  break;
1299  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL5,
1301  PT_12, PT_6 );
1302  break;
1304  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL5,
1306  0, PT_6 );
1307  break;
1309  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL5,
1311  0, PT_12 );
1312  break;
1314  lcl_SetNumBul( m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM5,
1315  0, SwNumRule::GetBullIndent( 4 ), 0, PT_6 );
1316  break;
1317 
1318  case RES_POOLCOLL_DOC_TITLE: // Document Title
1319  {
1321  SetAllScriptItem( aSet, SvxFontHeightItem( PT_28, 100, RES_CHRATR_FONTSIZE ) );
1322 
1323  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) );
1324 
1326  }
1327  break;
1328 
1329  case RES_POOLCOLL_DOC_SUBTITLE: // Document subtitle
1330  {
1331  SvxULSpaceItem aUL( PT_3, PT_6, RES_UL_SPACE );
1332  aSet.Put( aUL );
1334 
1335  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ));
1336 
1338  }
1339  break;
1340 
1341  case RES_POOLCOLL_DOC_APPENDIX: // Document Appendix tdf#114090
1342  {
1344  SetAllScriptItem( aSet, SvxFontHeightItem( PT_16, 100, RES_CHRATR_FONTSIZE ) );
1345 
1346  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) );
1347 
1349  }
1350  break;
1351 
1353  {
1357  aSet.Put( aLR );
1358  std::unique_ptr<SvxULSpaceItem> aUL(pNewColl->GetULSpace().Clone());
1359  aUL->SetLower( HTML_PARSPACE );
1360  aSet.Put(std::move(aUL));
1361  }
1362  break;
1363 
1364  case RES_POOLCOLL_HTML_PRE:
1365  {
1366  ::lcl_SetDfltFont( DefaultFontType::FIXED, aSet );
1367 
1368  // WORKAROUND: Set PRE to 10pt
1370 
1371  // The lower paragraph distance is set explicitly (makes
1372  // assigning hard attributes easier)
1373  std::unique_ptr<SvxULSpaceItem> aULSpaceItem(pNewColl->GetULSpace().Clone());
1374  aULSpaceItem->SetLower( 0 );
1375  aSet.Put(std::move(aULSpaceItem));
1376  }
1377  break;
1378 
1379  case RES_POOLCOLL_HTML_HR:
1380  {
1381  SvxBoxItem aBox( RES_BOX );
1382  Color aColor( COL_GRAY );
1383  SvxBorderLine aNew(&aColor, 3, SvxBorderLineStyle::DOUBLE);
1384  aBox.SetLine( &aNew, SvxBoxItemLine::BOTTOM );
1385 
1386  aSet.Put( aBox );
1387  aSet.Put( SwParaConnectBorderItem( false ) );
1389 
1390  std::unique_ptr<SvxULSpaceItem> aUL;
1391  {
1393  aUL.reset(pNewColl->GetULSpace().Clone());
1394  }
1395  aUL->SetLower( HTML_PARSPACE );
1396  aSet.Put(std::move(aUL));
1397  SwFormatLineNumber aLN;
1398  aLN.SetCountLines( false );
1399  aSet.Put( aLN );
1400  }
1401  break;
1402 
1403  case RES_POOLCOLL_HTML_DD:
1404  {
1405  std::unique_ptr<SvxLRSpaceItem> aLR(pNewColl->GetLRSpace().Clone());
1406  // We indent by 1 cm. The IDs are always 2 away from each other!
1408  aSet.Put(std::move(aLR));
1409  }
1410  break;
1411  case RES_POOLCOLL_HTML_DT:
1412  {
1413  std::unique_ptr<SvxLRSpaceItem> aLR;
1414  {
1416  aLR.reset(pNewColl->GetLRSpace().Clone());
1417  }
1418  // We indent by 0 cm. The IDs are always 2 away from each other!
1419  aLR->SetLeft( 0 );
1420  aSet.Put( std::move(aLR) );
1421  }
1422  break;
1423  }
1424  }
1425 
1426  if( aSet.Count() )
1427  pNewColl->SetFormatAttr( aSet );
1428  return pNewColl;
1429 }
1430 
1434 {
1435  SwFormat *pNewFormat = nullptr;
1436  SwFormat *pDeriveFormat = nullptr;
1437 
1438  SwFormatsBase* pArray[ 2 ];
1439  sal_uInt16 nArrCnt = 1;
1440  TranslateId pRCId;
1441  WhichRangesContainer const* pWhichRange;
1442 
1443  switch( nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
1444  {
1445  case POOLGRP_CHARFMT:
1446  {
1447  pArray[0] = m_rDoc.GetCharFormats();
1448  pDeriveFormat = m_rDoc.GetDfltCharFormat();
1449  pWhichRange = &aCharFormatSetRange;
1450 
1451  if (nId >= RES_POOLCHR_HTML_BEGIN && nId < RES_POOLCHR_HTML_END)
1452  pRCId = STR_POOLCHR_HTML_ARY[nId - RES_POOLCHR_HTML_BEGIN];
1453  else if (nId >= RES_POOLCHR_NORMAL_BEGIN && nId < RES_POOLCHR_NORMAL_END)
1454  pRCId = STR_POOLCHR_ARY[nId - RES_POOLCHR_BEGIN];
1455  else
1456  {
1457  // Fault: unknown Format, but a CharFormat -> return the first one
1458  OSL_ENSURE( false, "invalid Id" );
1459  pRCId = STR_POOLCHR_ARY[0];
1460  }
1461  }
1462  break;
1463  case POOLGRP_FRAMEFMT:
1464  {
1465  pArray[0] = m_rDoc.GetFrameFormats();
1466  pArray[1] = m_rDoc.GetSpzFrameFormats();
1467  pDeriveFormat = m_rDoc.GetDfltFrameFormat();
1468  nArrCnt = 2;
1469  pWhichRange = &aFrameFormatSetRange;
1470 
1471  // Fault: unknown Format, but a FrameFormat
1472  // -> return the first one
1473  if( RES_POOLFRM_BEGIN > nId || nId >= RES_POOLFRM_END )
1474  {
1475  OSL_ENSURE( false, "invalid Id" );
1476  nId = RES_POOLFRM_BEGIN;
1477  }
1478 
1479  pRCId = STR_POOLFRM_ARY[nId - RES_POOLFRM_BEGIN];
1480  }
1481  break;
1482 
1483  default:
1484  // Fault, unknown Format
1485  OSL_ENSURE( nId, "invalid Id" );
1486  return nullptr;
1487  }
1488  OSL_ENSURE(pRCId, "invalid Id");
1489 
1490  while( nArrCnt-- )
1491  for( size_t n = 0; n < (*pArray[nArrCnt]).GetFormatCount(); ++n )
1492  {
1493  pNewFormat = (*pArray[ nArrCnt ] ).GetFormat( n );
1494  if( nId == pNewFormat->GetPoolFormatId() )
1495  {
1496  return pNewFormat;
1497  }
1498  }
1499 
1500  OUString aNm(SwResId(pRCId));
1501  SwAttrSet aSet(m_rDoc.GetAttrPool(), *pWhichRange);
1502 
1503  {
1504  bool bIsModified = m_rDoc.getIDocumentState().IsModified();
1505 
1506  {
1507  ::sw::UndoGuard const undoGuard(m_rDoc.GetIDocumentUndoRedo());
1508  switch (nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
1509  {
1510  case POOLGRP_CHARFMT:
1511  pNewFormat = m_rDoc.MakeCharFormat_(aNm, pDeriveFormat, false, true);
1512  break;
1513  case POOLGRP_FRAMEFMT:
1514  pNewFormat = m_rDoc.MakeFrameFormat_(aNm, pDeriveFormat, false, true);
1515  break;
1516  default:
1517  break;
1518  }
1519  }
1520 
1521  if( !bIsModified )
1523  pNewFormat->SetPoolFormatId( nId );
1524  pNewFormat->SetAuto(false); // no AutoFormat
1525  }
1526 
1527  switch( nId )
1528  {
1529  case RES_POOLCHR_FOOTNOTE: // Footnote
1530  case RES_POOLCHR_PAGENO: // Page/Field
1531  case RES_POOLCHR_LABEL: // Label
1532  case RES_POOLCHR_DROPCAPS: // Dropcaps
1533  case RES_POOLCHR_NUM_LEVEL: // Numbering level
1534  case RES_POOLCHR_TOXJUMP: // Table of contents jump
1535  case RES_POOLCHR_ENDNOTE: // Endnote
1536  case RES_POOLCHR_LINENUM: // Line numbering
1537  break;
1538 
1539  case RES_POOLCHR_ENDNOTE_ANCHOR: // Endnote anchor
1540  case RES_POOLCHR_FOOTNOTE_ANCHOR: // Footnote anchor
1541  {
1543  }
1544  break;
1545 
1546  case RES_POOLCHR_BULLET_LEVEL: // Bullet character
1547  {
1548  const vcl::Font& rBulletFont = numfunc::GetDefBulletFont();
1549  SetAllScriptItem( aSet, SvxFontItem( rBulletFont.GetFamilyType(),
1550  rBulletFont.GetFamilyName(), rBulletFont.GetStyleName(),
1551  rBulletFont.GetPitch(), rBulletFont.GetCharSet(), RES_CHRATR_FONT ));
1552  }
1553  break;
1554 
1556  {
1557  aSet.Put( SvxColorItem( COL_BLUE, RES_CHRATR_COLOR ) );
1559  // i40133: patch submitted by rail: set language to 'none' to prevent spell checking:
1563  }
1564  break;
1566  {
1567  aSet.Put( SvxColorItem( COL_RED, RES_CHRATR_COLOR ) );
1572  }
1573  break;
1574  case RES_POOLCHR_JUMPEDIT:
1575  {
1576  aSet.Put( SvxColorItem( COL_CYAN, RES_CHRATR_COLOR ) );
1578  aSet.Put( SvxCaseMapItem( SvxCaseMap::SmallCaps, RES_CHRATR_CASEMAP ) );
1579  }
1580  break;
1581 
1582  case RES_POOLCHR_RUBYTEXT:
1583  {
1584  tools::Long nH = GetDfltAttr( RES_CHRATR_CJK_FONTSIZE )->GetHeight() / 2;
1587  aSet.Put(SvxEmphasisMarkItem( FontEmphasisMark::NONE, RES_CHRATR_EMPHASIS_MARK) );
1588  }
1589  break;
1590 
1594  {
1596  }
1597  break;
1598 
1601  {
1603  }
1604  break;
1605 
1606  case RES_POOLCHR_HTML_CODE:
1610  {
1611  ::lcl_SetDfltFont( DefaultFontType::FIXED, aSet );
1612  }
1613  break;
1614  case RES_POOLCHR_VERT_NUM:
1615  aSet.Put( SvxCharRotateItem( 900_deg10, false, RES_CHRATR_ROTATE ) );
1616  break;
1617 
1618  case RES_POOLFRM_FRAME:
1619  {
1621  {
1622  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ));
1623  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::LINE_CENTER, text::RelOrientation::PRINT_AREA ) );
1624  aSet.Put( SwFormatSurround( css::text::WrapTextMode_NONE ) );
1625  }
1626  else
1627  {
1628  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA ));
1629  aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL ) );
1630  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::PRINT_AREA ) );
1631  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::PRINT_AREA ) );
1632  Color aCol( COL_BLACK );
1633  SvxBorderLine aLine( &aCol, DEF_LINE_WIDTH_0 );
1634  SvxBoxItem aBox( RES_BOX );
1635  aBox.SetLine( &aLine, SvxBoxItemLine::TOP );
1636  aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
1637  aBox.SetLine( &aLine, SvxBoxItemLine::LEFT );
1638  aBox.SetLine( &aLine, SvxBoxItemLine::RIGHT );
1639  aBox.SetAllDistances( 85 );
1640  aSet.Put( aBox );
1641  aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1642  aSet.Put( SvxULSpaceItem( 114, 114, RES_UL_SPACE ) );
1643  }
1644 
1645  // for styles of FlyFrames do not set the FillStyle to make it a derived attribute
1646  aSet.ClearItem(XATTR_FILLSTYLE);
1647  }
1648  break;
1649  case RES_POOLFRM_GRAPHIC:
1650  case RES_POOLFRM_OLE:
1651  {
1652  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA ));
1653  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ));
1654  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
1655  aSet.Put( SwFormatSurround( css::text::WrapTextMode_DYNAMIC ));
1656  }
1657  break;
1658  case RES_POOLFRM_FORMEL:
1659  {
1660  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) );
1661  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::CHAR_CENTER, text::RelOrientation::FRAME ) );
1662  aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1663  }
1664  break;
1665  case RES_POOLFRM_MARGINAL:
1666  {
1667  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA ));
1668  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME ));
1669  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
1670  aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL ));
1671  // Set the default width to 3.5 cm, use the minimum value for the height
1675  }
1676  break;
1677  case RES_POOLFRM_WATERSIGN:
1678  {
1679  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PAGE ));
1680  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ));
1681  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME ));
1682  aSet.Put( SvxOpaqueItem( RES_OPAQUE, false ));
1683  aSet.Put( SwFormatSurround( css::text::WrapTextMode_THROUGH ));
1684  }
1685  break;
1686  case RES_POOLFRM_LABEL:
1687  {
1688  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) );
1689  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
1690  aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1691 
1692  SvxProtectItem aProtect( RES_PROTECT );
1693  aProtect.SetSizeProtect( true );
1694  aProtect.SetPosProtect( true );
1695  aSet.Put( aProtect );
1696 
1697  pNewFormat->SetAutoUpdateFormat();
1698  }
1699  break;
1700  }
1701  if( aSet.Count() )
1702  {
1703  pNewFormat->SetFormatAttr( aSet );
1704  }
1705  return pNewFormat;
1706 }
1707 
1709 {
1710  return static_cast<SwFrameFormat*>(GetFormatFromPool( nId ));
1711 }
1712 
1714 {
1715  return static_cast<SwCharFormat*>(GetFormatFromPool( nId ));
1716 }
1717 
1718 SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
1719 {
1720  OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
1721  "Wrong AutoFormat Id" );
1722 
1723  for( size_t n = 0; n < m_rDoc.GetPageDescCnt(); ++n )
1724  {
1725  if ( nId == m_rDoc.GetPageDesc(n).GetPoolFormatId() )
1726  {
1727  return &m_rDoc.GetPageDesc(n);
1728  }
1729  }
1730 
1731  if( RES_POOLPAGE_BEGIN > nId || nId >= RES_POOLPAGE_END )
1732  {
1733  // unknown page pool ID
1734  OSL_ENSURE( false, "<SwDoc::GetPageDescFromPool(..)> - unknown page pool ID" );
1735  nId = RES_POOLPAGE_BEGIN;
1736  }
1737 
1738  SwPageDesc* pNewPgDsc = nullptr;
1739  {
1740  static_assert(SAL_N_ELEMENTS(STR_POOLPAGE_ARY) == RES_POOLPAGE_END - RES_POOLPAGE_BEGIN, "### unexpected size!");
1741  const OUString aNm(SwResId(STR_POOLPAGE_ARY[nId - RES_POOLPAGE_BEGIN]));
1742  const bool bIsModified = m_rDoc.getIDocumentState().IsModified();
1743 
1744  {
1745  ::sw::UndoGuard const undoGuard(m_rDoc.GetIDocumentUndoRedo());
1746  pNewPgDsc = m_rDoc.MakePageDesc(aNm, nullptr, bRegardLanguage);
1747  }
1748 
1749  pNewPgDsc->SetPoolFormatId( nId );
1750  if ( !bIsModified )
1751  {
1753  }
1754  }
1755 
1757  {
1759  aLR.SetRight( aLR.GetLeft() );
1760  }
1762  {
1763  aUL.SetUpper( o3tl::narrowing<sal_uInt16>(aLR.GetLeft()) );
1764  aUL.SetLower( o3tl::narrowing<sal_uInt16>(aLR.GetLeft()) );
1765  }
1766 
1768  bool bSetLeft = true;
1769 
1770  switch( nId )
1771  {
1772  case RES_POOLPAGE_STANDARD: // "Default"
1773  {
1774  aSet.Put( aLR );
1775  aSet.Put( aUL );
1777  }
1778  break;
1779 
1780  case RES_POOLPAGE_FIRST: // "First Page"
1781  case RES_POOLPAGE_REGISTER: // "Index"
1782  {
1783  lcl_PutStdPageSizeIntoItemSet( m_rDoc, aSet );
1784  aSet.Put( aLR );
1785  aSet.Put( aUL );
1786  pNewPgDsc->SetUseOn( UseOnPage::All );
1787  if( RES_POOLPAGE_FIRST == nId )
1789  }
1790  break;
1791 
1792  case RES_POOLPAGE_LEFT: // "Left Page"
1793  {
1794  lcl_PutStdPageSizeIntoItemSet( m_rDoc, aSet );
1795  aSet.Put( aLR );
1796  aSet.Put( aUL );
1797  bSetLeft = false;
1798  pNewPgDsc->SetUseOn( UseOnPage::Left );
1799  // this relies on GetPageDescFromPool() not going into infinite recursion
1800  // (by this point RES_POOLPAGE_LEFT will not reach this place again)
1802  }
1803  break;
1804  case RES_POOLPAGE_RIGHT: // "Right Page"
1805  {
1806  lcl_PutStdPageSizeIntoItemSet( m_rDoc, aSet );
1807  aSet.Put( aLR );
1808  aSet.Put( aUL );
1809  bSetLeft = false;
1810  pNewPgDsc->SetUseOn( UseOnPage::Right );
1812  }
1813  break;
1814 
1815  case RES_POOLPAGE_ENVELOPE: // "Envelope"
1816  {
1818  LandscapeSwap( aPSize );
1819  aSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, aPSize.Width(), aPSize.Height() ));
1820  aLR.SetLeft( 0 ); aLR.SetRight( 0 );
1821  aUL.SetUpper( 0 ); aUL.SetLower( 0 );
1822  aSet.Put( aLR );
1823  aSet.Put( aUL );
1824 
1825  pNewPgDsc->SetUseOn( UseOnPage::All );
1826  pNewPgDsc->SetLandscape( true );
1827  }
1828  break;
1829 
1830  case RES_POOLPAGE_HTML: // "HTML"
1831  {
1832  lcl_PutStdPageSizeIntoItemSet( m_rDoc, aSet );
1834  aUL.SetUpper( o3tl::narrowing<sal_uInt16>(aLR.GetRight()) );
1835  aUL.SetLower( o3tl::narrowing<sal_uInt16>(aLR.GetRight()) );
1836  aSet.Put( aLR );
1837  aSet.Put( aUL );
1838 
1839  pNewPgDsc->SetUseOn( UseOnPage::All );
1840  }
1841  break;
1842 
1843  case RES_POOLPAGE_FOOTNOTE: // "Footnote"
1844  case RES_POOLPAGE_ENDNOTE: // "Endnote"
1845  {
1846  lcl_PutStdPageSizeIntoItemSet( m_rDoc, aSet );
1847  aSet.Put( aLR );
1848  aSet.Put( aUL );
1849  pNewPgDsc->SetUseOn( UseOnPage::All );
1850  SwPageFootnoteInfo aInf( pNewPgDsc->GetFootnoteInfo() );
1851  aInf.SetLineWidth( 0 );
1852  aInf.SetTopDist( 0 );
1853  aInf.SetBottomDist( 0 );
1854  pNewPgDsc->SetFootnoteInfo( aInf );
1855  }
1856  break;
1857 
1858  case RES_POOLPAGE_LANDSCAPE: // "Landscape"
1859  {
1861  SwFormatFrameSize aFrameSz( pStdPgDsc->GetMaster().GetFrameSize() );
1862  if ( !pStdPgDsc->GetLandscape() )
1863  {
1864  const SwTwips nTmp = aFrameSz.GetHeight();
1865  aFrameSz.SetHeight( aFrameSz.GetWidth() );
1866  aFrameSz.SetWidth( nTmp );
1867  }
1868  aSet.Put( aFrameSz );
1869  aSet.Put( aLR );
1870  aSet.Put( aUL );
1871  pNewPgDsc->SetUseOn( UseOnPage::All );
1872  pNewPgDsc->SetLandscape( true );
1873  }
1874  break;
1875 
1876  }
1877 
1878  if( aSet.Count() )
1879  {
1880  if( bSetLeft )
1881  {
1882  pNewPgDsc->GetLeft().SetFormatAttr( aSet );
1883  pNewPgDsc->GetFirstLeft().SetFormatAttr( aSet );
1884  }
1885  pNewPgDsc->GetMaster().SetFormatAttr( aSet );
1886  pNewPgDsc->GetFirstMaster().SetFormatAttr( aSet );
1887  }
1888  return pNewPgDsc;
1889 }
1890 
1892 {
1893  OSL_ENSURE( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END,
1894  "Wrong AutoFormat Id" );
1895 
1896  SwNumRule* pNewRule;
1897 
1898  for (size_t n = 0; n < m_rDoc.GetNumRuleTable().size(); ++n )
1899  {
1900  pNewRule = m_rDoc.GetNumRuleTable()[ n ];
1901  if (nId == pNewRule->GetPoolFormatId())
1902  {
1903  return pNewRule;
1904  }
1905  }
1906 
1907  // error: unknown Pool style
1908  if( RES_POOLNUMRULE_BEGIN > nId || nId >= RES_POOLNUMRULE_END )
1909  {
1910  OSL_ENSURE( false, "invalid Id" );
1911  nId = RES_POOLNUMRULE_BEGIN;
1912  }
1913 
1914  static_assert(SAL_N_ELEMENTS(STR_POOLNUMRULE_NUM_ARY) == RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN, "### unexpected size!");
1915  OUString aNm(SwResId(STR_POOLNUMRULE_NUM_ARY[nId - RES_POOLNUMRULE_BEGIN]));
1916 
1917  SwCharFormat *pNumCFormat = nullptr, *pBullCFormat = nullptr;
1918 
1919  const SvxNumberFormat::SvxNumPositionAndSpaceMode eNumberFormatPositionAndSpaceMode
1921  {
1922  bool bIsModified = m_rDoc.getIDocumentState().IsModified();
1923 
1924  sal_uInt16 n = m_rDoc.MakeNumRule( aNm, nullptr, false, eNumberFormatPositionAndSpaceMode );
1925 
1926  pNewRule = m_rDoc.GetNumRuleTable()[ n ];
1927  pNewRule->SetPoolFormatId( nId );
1928  pNewRule->SetAutoRule( false );
1929 
1930  if( RES_POOLNUMRULE_NUM1 <= nId && nId <= RES_POOLNUMRULE_NUM5 )
1932 
1933  if( ( RES_POOLNUMRULE_BUL1 <= nId && nId <= RES_POOLNUMRULE_BUL5 ) ||
1934  RES_POOLNUMRULE_NUM5 == nId )
1935  pBullCFormat = GetCharFormatFromPool( RES_POOLCHR_NUM_LEVEL );
1936 
1937  if( !bIsModified )
1939  }
1940 
1941  switch( nId )
1942  {
1943  case RES_POOLNUMRULE_NUM1:
1944  {
1945  SwNumFormat aFormat;
1946  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
1948  aFormat.SetCharFormat( pNumCFormat );
1949  aFormat.SetStart( 1 );
1950  aFormat.SetIncludeUpperLevels( 1 );
1951  aFormat.SetSuffix( "." );
1952 
1953  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
1954  {
1955 // cm: 0.7 cm intervals, with 1 cm = 567
1956  397, 794, 1191, 1588, 1985, 2381, 2778, 3175, 3572, 3969
1957  };
1958  const sal_uInt16* pArr = aAbsSpace;
1959 
1960  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1961  {
1962  aFormat.SetFirstLineOffset( - (*pArr) );
1963  }
1964  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1965  {
1967  aFormat.SetFirstLineIndent( - (*pArr) );
1968  }
1969 
1970  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
1971  {
1972  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1973  {
1974  aFormat.SetAbsLSpace( *pArr + 357 ); // 357 is indent of 0.63 cm
1975  }
1976  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1977  {
1978  aFormat.SetListtabPos( *pArr );
1979  aFormat.SetIndentAt( *pArr + 357 );
1980  }
1981 
1982  pNewRule->Set( n, aFormat );
1983  }
1984  }
1985  break;
1986 
1987  case RES_POOLNUMRULE_NUM2:
1988  {
1989  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
1990  {
1991  397, 397, 397, 397, // 0.70 cm intervals
1992  397, 397, 397, 397,
1993  397, 397
1994  };
1995 
1996  const sal_uInt16* pArr = aAbsSpace;
1997  SwNumFormat aFormat;
1998 
1999  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2001  aFormat.SetCharFormat( pNumCFormat );
2002  aFormat.SetStart( 1 );
2003  aFormat.SetIncludeUpperLevels( 1 );
2004  aFormat.SetSuffix( "." );
2005 
2006  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2007  {
2009  }
2010 
2011  sal_uInt16 nSpace = 357; // indent of 0.63 cm
2012  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
2013  {
2014  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2015  {
2016  nSpace += pArr[ n ];
2017  aFormat.SetAbsLSpace( nSpace );
2018  aFormat.SetFirstLineOffset( - pArr[ n ] );
2019  }
2020  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2021  {
2022  nSpace += pArr[ n ];
2023  aFormat.SetListtabPos( nSpace );
2024  aFormat.SetIndentAt( nSpace );
2025  aFormat.SetFirstLineIndent( - pArr[ n ] );
2026  }
2027 
2028  pNewRule->Set( n, aFormat );
2029  }
2030  }
2031  break;
2032  case RES_POOLNUMRULE_NUM3:
2033  {
2034  SwNumFormat aFormat;
2035 
2036  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2038  aFormat.SetCharFormat( pNumCFormat );
2039  aFormat.SetStart( 1 );
2040  aFormat.SetIncludeUpperLevels( 1 );
2041  aFormat.SetSuffix( "." );
2042 
2043  tools::Long const nOffs = 397; // 0.70 cm
2044 
2045  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2046  {
2047  aFormat.SetFirstLineOffset( - nOffs );
2048  }
2049  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2050  {
2052  aFormat.SetFirstLineIndent( - nOffs );
2053  }
2054 
2055  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
2056  {
2057  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2058  {
2059  aFormat.SetAbsLSpace( (n+1) * nOffs + 357 ); // 357 is indent of 0.63 cm
2060  }
2061  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2062  {
2063  tools::Long nPos = (n+1) * nOffs;
2064  aFormat.SetListtabPos(nPos + 357);
2065  aFormat.SetIndentAt(nPos + 357);
2066  }
2067 
2068  pNewRule->Set( n, aFormat );
2069  }
2070  }
2071  break;
2072  case RES_POOLNUMRULE_NUM4:
2073  {
2074  SwNumFormat aFormat;
2075 
2076  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2078  aFormat.SetCharFormat( pNumCFormat );
2079  aFormat.SetStart( 1 );
2080  aFormat.SetIncludeUpperLevels( 1 );
2081  aFormat.SetSuffix( "." );
2082  aFormat.SetNumAdjust( SvxAdjust::Right );
2083 
2084  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2085  {
2086 // cm: 1.33 cm intervals
2087  754, 1508, 1191, 2262, 3016, 3771, 4525, 5279, 6033, 6787
2088  };
2089  const sal_uInt16* pArr = aAbsSpace;
2090 
2091  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2092  {
2093  aFormat.SetFirstLineOffset( 580 - (*pArr) ); // 1 cm space
2094  }
2095  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2096  {
2098  aFormat.SetFirstLineIndent( 580 - (*pArr) );
2099  }
2100 
2101  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2102  {
2103 
2104  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2105  {
2106  aFormat.SetAbsLSpace( *pArr );
2107  }
2108  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2109  {
2110  aFormat.SetListtabPos( *pArr );
2111  aFormat.SetIndentAt( *pArr );
2112  }
2113 
2114  pNewRule->Set( n, aFormat );
2115  }
2116  }
2117  break;
2118  case RES_POOLNUMRULE_NUM5:
2119  {
2120  // [ First, LSpace ]
2121  static const sal_uInt16 aAbsSpace0to2[] =
2122  {
2123  174, 754, // 0.33, 1.33,
2124  567, 1151, // 1.03, 2.03,
2125  397, 1548 // 2.03, 2.73
2126  };
2127 
2128  const sal_uInt16* pArr0to2 = aAbsSpace0to2;
2129  SwNumFormat aFormat;
2130 
2131  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2133  aFormat.SetStart( 1 );
2134  aFormat.SetIncludeUpperLevels( 1 );
2135  aFormat.SetSuffix( "." );
2136  aFormat.SetNumAdjust( SvxAdjust::Right );
2137 
2138  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2139  {
2141  }
2142 
2143  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2144  {
2145  aFormat.SetFirstLineOffset( -pArr0to2[0] ); // == 0.33 cm
2146  aFormat.SetAbsLSpace( pArr0to2[1] ); // == 1.33 cm
2147  }
2148  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2149  {
2150  aFormat.SetFirstLineIndent( -pArr0to2[0] );
2151  aFormat.SetListtabPos( pArr0to2[1] );
2152  aFormat.SetIndentAt( pArr0to2[1] );
2153  }
2154 
2155  aFormat.SetCharFormat( pNumCFormat );
2156  pNewRule->Set( 0, aFormat );
2157 
2158  aFormat.SetIncludeUpperLevels( 1 );
2159  aFormat.SetStart( 1 );
2160 
2161  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2162  {
2163  aFormat.SetFirstLineOffset( -pArr0to2[2] ); // == 1.03 cm
2164  aFormat.SetAbsLSpace( pArr0to2[3] ); // == 2.03 cm
2165  }
2166  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2167  {
2168  aFormat.SetFirstLineIndent( -pArr0to2[2] );
2169  aFormat.SetListtabPos( pArr0to2[3] );
2170  aFormat.SetIndentAt( pArr0to2[3] );
2171  }
2172 
2173  pNewRule->Set( 1, aFormat );
2174 
2176  aFormat.SetSuffix(OUString(u')'));
2177  aFormat.SetIncludeUpperLevels( 1 );
2178  aFormat.SetStart( 3 );
2179 
2180  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2181  {
2182  aFormat.SetFirstLineOffset( - pArr0to2[4] ); // == 2.03 cm
2183  aFormat.SetAbsLSpace( pArr0to2[5] ); // == 2.73 cm
2184  }
2185  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2186  {
2187  aFormat.SetFirstLineIndent( -pArr0to2[4] );
2188  aFormat.SetListtabPos( pArr0to2[5] );
2189  aFormat.SetIndentAt( pArr0to2[5] );
2190  }
2191 
2192  pNewRule->Set( 2, aFormat );
2193 
2195  aFormat.SetCharFormat( pBullCFormat );
2197  aFormat.SetBulletChar( cBulletChar );
2198  sal_Int16 nOffs = o3tl::convert(4, o3tl::Length::mm, o3tl::Length::twip),
2200 
2201  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2202  {
2203  aFormat.SetFirstLineOffset( - nOffs );
2204  }
2205  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2206  {
2207  aFormat.SetFirstLineIndent( - nOffs );
2208  }
2209 
2210  aFormat.SetSuffix( OUString() );
2211  for (sal_uInt16 n = 3; n < MAXLEVEL; ++n)
2212  {
2213  aFormat.SetStart( n+1 );
2214 
2215  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2216  {
2217  aFormat.SetAbsLSpace( nOffs2 + ((n-3) * nOffs) );
2218  }
2219  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2220  {
2221  tools::Long nPos = nOffs2 + ((n-3) * static_cast<tools::Long>(nOffs));
2222  aFormat.SetListtabPos(nPos);
2223  aFormat.SetIndentAt(nPos);
2224  }
2225 
2226  pNewRule->Set( n, aFormat );
2227  }
2228  }
2229  break;
2230 
2231  case RES_POOLNUMRULE_BUL1:
2232  {
2233  SwNumFormat aFormat;
2234 
2235  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2237  aFormat.SetCharFormat( pBullCFormat );
2238  aFormat.SetStart( 1 );
2239  aFormat.SetIncludeUpperLevels( 1 );
2241  aFormat.SetBulletChar( cBulletChar );
2242 
2243  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2244  {
2245 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
2246  227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
2247  };
2248  const sal_uInt16* pArr = aAbsSpace;
2249 
2250  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2251  {
2252  aFormat.SetFirstLineOffset( - (*pArr) );
2253  }
2254  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2255  {
2257  aFormat.SetFirstLineIndent( - (*pArr) );
2258  }
2259 
2260  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2261  {
2262  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2263  {
2264  aFormat.SetAbsLSpace( *pArr );
2265  }
2266  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2267  {
2268  aFormat.SetListtabPos( *pArr );
2269  aFormat.SetIndentAt( *pArr );
2270  }
2271 
2272  pNewRule->Set( n, aFormat );
2273  }
2274  }
2275  break;
2276  case RES_POOLNUMRULE_BUL2:
2277  {
2278  SwNumFormat aFormat;
2279 
2280  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2282  aFormat.SetCharFormat( pBullCFormat );
2283  aFormat.SetStart( 1 );
2284  aFormat.SetIncludeUpperLevels( 1 );
2286  aFormat.SetBulletChar( 0x2013 );
2287 
2288  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2289  {
2290 // cm: 0,3 0,6 0,9 1,2 1,5 1,8 2,1 2,4 2,7 3,0
2291  170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701
2292  };
2293  const sal_uInt16* pArr = aAbsSpace;
2294 
2295  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2296  {
2297  aFormat.SetFirstLineOffset( - (*pArr) );
2298  }
2299  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2300  {
2302  aFormat.SetFirstLineIndent( - (*pArr) );
2303  }
2304 
2305  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2306  {
2307  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2308  {
2309  aFormat.SetAbsLSpace( *pArr );
2310  }
2311  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2312  {
2313  aFormat.SetListtabPos( *pArr );
2314  aFormat.SetIndentAt( *pArr );
2315  }
2316 
2317  pNewRule->Set( n, aFormat );
2318  }
2319  }
2320  break;
2321  case RES_POOLNUMRULE_BUL3:
2322  {
2323  SwNumFormat aFormat;
2324 
2325  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2326 
2328  aFormat.SetCharFormat( pBullCFormat );
2329  aFormat.SetStart( 1 );
2330  aFormat.SetIncludeUpperLevels( 1 );
2332 
2333  sal_uInt16 nOffs = o3tl::convert(4, o3tl::Length::mm, o3tl::Length::twip);
2334 
2335  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2336  {
2337  aFormat.SetFirstLineOffset( - nOffs );
2338  }
2339  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2340  {
2342  aFormat.SetFirstLineIndent( - nOffs );
2343  }
2344 
2345  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
2346  {
2347  aFormat.SetBulletChar( (n & 1) ? 0x25a1 : 0x2611 );
2348 
2349  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2350  {
2351  aFormat.SetAbsLSpace( ((n & 1) +1) * nOffs );
2352  }
2353  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2354  {
2355  tools::Long nPos = ((n & 1) +1) * static_cast<tools::Long>(nOffs);
2356  aFormat.SetListtabPos(nPos);
2357  aFormat.SetIndentAt(nPos);
2358  }
2359 
2360  pNewRule->Set( n, aFormat );
2361  }
2362  }
2363  break;
2364  case RES_POOLNUMRULE_BUL4:
2365  {
2366  SwNumFormat aFormat;
2367 
2368  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2370  aFormat.SetCharFormat( pBullCFormat );
2371  aFormat.SetStart( 1 );
2372  aFormat.SetIncludeUpperLevels( 1 );
2374 
2375  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2376  {
2377 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
2378  227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
2379  };
2380 
2381  const sal_uInt16* pArr = aAbsSpace;
2382 
2383  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2384  {
2385  aFormat.SetFirstLineOffset( - (*pArr) );
2386  }
2387  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2388  {
2390  aFormat.SetFirstLineIndent( - (*pArr) );
2391  }
2392 
2393  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2394  {
2395  switch( n )
2396  {
2397  case 0: aFormat.SetBulletChar( 0x27a2 ); break;
2398  case 1: aFormat.SetBulletChar( 0xE006 ); break;
2399  default: aFormat.SetBulletChar( 0xE004 ); break;
2400  }
2401 
2402  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2403  {
2404  aFormat.SetAbsLSpace( *pArr );
2405  }
2406  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2407  {
2408  aFormat.SetListtabPos( *pArr );
2409  aFormat.SetIndentAt( *pArr );
2410  }
2411 
2412  pNewRule->Set( n, aFormat );
2413  }
2414  }
2415  break;
2416  case RES_POOLNUMRULE_BUL5:
2417  {
2418  SwNumFormat aFormat;
2419 
2420  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2422  aFormat.SetCharFormat( pBullCFormat );
2423  aFormat.SetStart( 1 );
2424  aFormat.SetIncludeUpperLevels( 1 );
2425  aFormat.SetBulletChar( 0x2717 );
2427 
2428  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2429  {
2430 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
2431  227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
2432  };
2433  const sal_uInt16* pArr = aAbsSpace;
2434 
2435  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2436  {
2437  aFormat.SetFirstLineOffset( - (*pArr) );
2438  }
2439  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2440  {
2442  aFormat.SetFirstLineIndent( - (*pArr) );
2443  }
2444 
2445  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2446  {
2447  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2448  {
2449  aFormat.SetAbsLSpace( *pArr );
2450  }
2451  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2452  {
2453  aFormat.SetListtabPos( *pArr );
2454  aFormat.SetIndentAt( *pArr );
2455  }
2456 
2457  pNewRule->Set( n, aFormat );
2458  }
2459  }
2460  break;
2461  }
2462 
2463  return pNewRule;
2464 }
2465 
2468 {
2469  OSL_ENSURE(
2470  (RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
2474  (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) ||
2476  "Wrong AutoFormat Id" );
2477 
2478  SwTextFormatColl* pNewColl = nullptr;
2479  bool bFnd = false;
2480  for( SwTextFormatColls::size_type n = 0; !bFnd && n < m_rDoc.GetTextFormatColls()->size(); ++n )
2481  {
2482  pNewColl = (*m_rDoc.GetTextFormatColls())[ n ];
2483  if( nId == pNewColl->GetPoolFormatId() )
2484  bFnd = true;
2485  }
2486 
2487  if( !bFnd || !pNewColl->HasWriterListeners() )
2488  return false;
2489 
2490  SwAutoFormatGetDocNode aGetHt( &m_rDoc.GetNodes() );
2491  return !pNewColl->GetInfo( aGetHt );
2492 }
2493 
2496 {
2497  const SwFormat *pNewFormat = nullptr;
2498  const SwFormatsBase* pArray[ 2 ];
2499  sal_uInt16 nArrCnt = 1;
2500  bool bFnd = true;
2501 
2502  if (RES_POOLCHR_BEGIN <= nId && nId < RES_POOLCHR_END)
2503  {
2504  pArray[0] = m_rDoc.GetCharFormats();
2505  }
2506  else if (RES_POOLFRM_BEGIN <= nId && nId < RES_POOLFRM_END)
2507  {
2508  pArray[0] = m_rDoc.GetFrameFormats();
2509  pArray[1] = m_rDoc.GetSpzFrameFormats();
2510  nArrCnt = 2;
2511  }
2512  else
2513  {
2514  SAL_WARN("sw.core", "Invalid Pool Id: " << nId << " should be within "
2515  "[" << int(RES_POOLCHR_BEGIN) << "," << int(RES_POOLCHR_END) << ") or "
2516  "[" << int(RES_POOLFRM_BEGIN) << "," << int(RES_POOLFRM_END) << ")");
2517  bFnd = false;
2518  }
2519 
2520  if( bFnd )
2521  {
2522  bFnd = false;
2523  while( nArrCnt-- && !bFnd )
2524  for( size_t n = 0; !bFnd && n < (*pArray[nArrCnt]).GetFormatCount(); ++n )
2525  {
2526  pNewFormat = (*pArray[ nArrCnt ] ).GetFormat( n );
2527  if( nId == pNewFormat->GetPoolFormatId() )
2528  bFnd = true;
2529  }
2530  }
2531 
2532  // Not found or no dependencies?
2533  if( bFnd && pNewFormat->HasWriterListeners() )
2534  {
2535  // Check if we have dependent ContentNodes in the Nodes array
2536  // (also indirect ones for derived Formats)
2537  SwAutoFormatGetDocNode aGetHt( &m_rDoc.GetNodes() );
2538  bFnd = !pNewFormat->GetInfo( aGetHt );
2539  }
2540  else
2541  bFnd = false;
2542 
2543  return bFnd;
2544 }
2545 
2548 {
2549  OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
2550  "Wrong AutoFormat Id" );
2551  SwPageDesc *pNewPgDsc = nullptr;
2552  bool bFnd = false;
2553  for( size_t n = 0; !bFnd && n < m_rDoc.GetPageDescCnt(); ++n )
2554  {
2555  pNewPgDsc = &m_rDoc.GetPageDesc(n);
2556  if( nId == pNewPgDsc->GetPoolFormatId() )
2557  bFnd = true;
2558  }
2559 
2560  // Not found or no dependencies?
2561  if( !bFnd || !pNewPgDsc->HasWriterListeners() ) // ??????
2562  return false;
2563 
2564  // Check if we have dependent ContentNodes in the Nodes array
2565  // (also indirect ones for derived Formats)
2566  SwAutoFormatGetDocNode aGetHt( &m_rDoc.GetNodes() );
2567  return !pNewPgDsc->GetInfo( aGetHt );
2568 }
2569 
2571 {
2572 }
2573 
2574 }
2575 
2576 static std::vector<OUString>
2577 lcl_NewUINameArray(const TranslateId* pIds, const size_t nLen, const size_t nSvxIds = 0)
2578 {
2579  assert(nSvxIds <= nLen);
2580  const size_t nWriterIds = nLen - nSvxIds;
2581  std::vector<OUString> aNameArray;
2582  aNameArray.reserve(nLen);
2583  for (size_t i = 0; i < nWriterIds; ++i)
2584  aNameArray.push_back(SwResId(pIds[i]));
2585  for (size_t i = nWriterIds; i < nLen; ++i)
2586  aNameArray.push_back(SvxResId(pIds[i]));
2587  return aNameArray;
2588 }
2589 
2590 const std::vector<OUString>& SwStyleNameMapper::GetTextUINameArray()
2591 {
2592  SvtSysLocale aSysLocale;
2593  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2594  static std::map<LanguageTag, std::vector<OUString>> s_aTextUINameArray;
2595 
2596  auto it = s_aTextUINameArray.find(rCurrentLanguage);
2597  if (it == s_aTextUINameArray.end())
2598  it = s_aTextUINameArray.emplace(rCurrentLanguage,
2599  lcl_NewUINameArray(STR_POOLCOLL_TEXT_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_TEXT_ARY))).first;
2600 
2601  return it->second;
2602 }
2603 
2604 const std::vector<OUString>& SwStyleNameMapper::GetListsUINameArray()
2605 {
2606  SvtSysLocale aSysLocale;
2607  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2608  static std::map<LanguageTag, std::vector<OUString>> s_aListsUINameArray;
2609 
2610  auto it = s_aListsUINameArray.find(rCurrentLanguage);
2611  if (it == s_aListsUINameArray.end())
2612  it = s_aListsUINameArray.emplace(rCurrentLanguage,
2613  lcl_NewUINameArray(STR_POOLCOLL_LISTS_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_LISTS_ARY))).first;
2614 
2615  return it->second;
2616 }
2617 
2618 const std::vector<OUString>& SwStyleNameMapper::GetExtraUINameArray()
2619 {
2620  SvtSysLocale aSysLocale;
2621  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2622  static std::map<LanguageTag, std::vector<OUString>> s_aExtraUINameArray;
2623 
2624  auto it = s_aExtraUINameArray.find(rCurrentLanguage);
2625  if (it == s_aExtraUINameArray.end())
2626  it = s_aExtraUINameArray.emplace(rCurrentLanguage,
2628 
2629  return it->second;
2630 }
2631 
2632 const std::vector<OUString>& SwStyleNameMapper::GetRegisterUINameArray()
2633 {
2634  SvtSysLocale aSysLocale;
2635  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2636  static std::map<LanguageTag, std::vector<OUString>> s_aRegisterUINameArray;
2637 
2638  auto it = s_aRegisterUINameArray.find(rCurrentLanguage);
2639  if (it == s_aRegisterUINameArray.end())
2640  it = s_aRegisterUINameArray.emplace(rCurrentLanguage,
2641  lcl_NewUINameArray(STR_POOLCOLL_REGISTER_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_REGISTER_ARY))).first;
2642 
2643  return it->second;
2644 }
2645 
2646 const std::vector<OUString>& SwStyleNameMapper::GetDocUINameArray()
2647 {
2648  SvtSysLocale aSysLocale;
2649  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2650  static std::map<LanguageTag, std::vector<OUString>> s_aDocUINameArray;
2651 
2652  auto it = s_aDocUINameArray.find(rCurrentLanguage);
2653  if (it == s_aDocUINameArray.end())
2654  it = s_aDocUINameArray.emplace(rCurrentLanguage,
2655  lcl_NewUINameArray(STR_POOLCOLL_DOC_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_DOC_ARY))).first;
2656 
2657  return it->second;
2658 }
2659 
2660 const std::vector<OUString>& SwStyleNameMapper::GetHTMLUINameArray()
2661 {
2662  SvtSysLocale aSysLocale;
2663  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2664  static std::map<LanguageTag, std::vector<OUString>> s_aHTMLUINameArray;
2665 
2666  auto it = s_aHTMLUINameArray.find(rCurrentLanguage);
2667  if (it == s_aHTMLUINameArray.end())
2668  it = s_aHTMLUINameArray.emplace(rCurrentLanguage,
2669  lcl_NewUINameArray(STR_POOLCOLL_HTML_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_HTML_ARY))).first;
2670 
2671  return it->second;
2672 }
2673 
2674 const std::vector<OUString>& SwStyleNameMapper::GetFrameFormatUINameArray()
2675 {
2676  SvtSysLocale aSysLocale;
2677  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2678  static std::map<LanguageTag, std::vector<OUString>> s_aFrameFormatUINameArray;
2679 
2680  auto it = s_aFrameFormatUINameArray.find(rCurrentLanguage);
2681  if (it == s_aFrameFormatUINameArray.end())
2682  it = s_aFrameFormatUINameArray.emplace(rCurrentLanguage,
2683  lcl_NewUINameArray(STR_POOLFRM_ARY, SAL_N_ELEMENTS(STR_POOLFRM_ARY))).first;
2684 
2685  return it->second;
2686 }
2687 
2688 const std::vector<OUString>& SwStyleNameMapper::GetChrFormatUINameArray()
2689 {
2690  SvtSysLocale aSysLocale;
2691  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2692  static std::map<LanguageTag, std::vector<OUString>> s_aChrFormatUINameArray;
2693 
2694  auto it = s_aChrFormatUINameArray.find(rCurrentLanguage);
2695  if (it == s_aChrFormatUINameArray.end())
2696  it = s_aChrFormatUINameArray.emplace(rCurrentLanguage,
2697  lcl_NewUINameArray(STR_POOLCHR_ARY, SAL_N_ELEMENTS(STR_POOLCHR_ARY))).first;
2698 
2699  return it->second;
2700 }
2701 
2703 {
2704  SvtSysLocale aSysLocale;
2705  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2706  static std::map<LanguageTag, std::vector<OUString>> s_aHTMLChrFormatUINameArray;
2707 
2708  auto it = s_aHTMLChrFormatUINameArray.find(rCurrentLanguage);
2709  if (it == s_aHTMLChrFormatUINameArray.end())
2710  it = s_aHTMLChrFormatUINameArray.emplace(rCurrentLanguage,
2711  lcl_NewUINameArray(STR_POOLCHR_HTML_ARY, SAL_N_ELEMENTS(STR_POOLCHR_HTML_ARY))).first;
2712 
2713  return it->second;
2714 }
2715 
2716 const std::vector<OUString>& SwStyleNameMapper::GetPageDescUINameArray()
2717 {
2718  SvtSysLocale aSysLocale;
2719  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2720  static std::map<LanguageTag, std::vector<OUString>> s_aPageDescUINameArray;
2721 
2722  auto it = s_aPageDescUINameArray.find(rCurrentLanguage);
2723  if (it == s_aPageDescUINameArray.end())
2724  it = s_aPageDescUINameArray.emplace(rCurrentLanguage,
2725  lcl_NewUINameArray(STR_POOLPAGE_ARY, SAL_N_ELEMENTS(STR_POOLPAGE_ARY))).first;
2726 
2727  return it->second;
2728 }
2729 
2730 const std::vector<OUString>& SwStyleNameMapper::GetNumRuleUINameArray()
2731 {
2732  SvtSysLocale aSysLocale;
2733  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2734  static std::map<LanguageTag, std::vector<OUString>> s_aNumRuleUINameArray;
2735 
2736  auto it = s_aNumRuleUINameArray.find(rCurrentLanguage);
2737  if (it == s_aNumRuleUINameArray.end())
2738  it = s_aNumRuleUINameArray.emplace(rCurrentLanguage,
2739  lcl_NewUINameArray(STR_POOLNUMRULE_NUM_ARY, SAL_N_ELEMENTS(STR_POOLNUMRULE_NUM_ARY))).first;
2740 
2741  return it->second;
2742 }
2743 
2744 const std::vector<OUString>& SwStyleNameMapper::GetTableStyleUINameArray()
2745 {
2746  SvtSysLocale aSysLocale;
2747  const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
2748  static std::map<LanguageTag, std::vector<OUString>> s_aTableStyleUINameArray;
2749 
2750  auto it = s_aTableStyleUINameArray.find(rCurrentLanguage);
2751  if (it == s_aTableStyleUINameArray.end())
2752  it = s_aTableStyleUINameArray.emplace(rCurrentLanguage,
2753  // 1 Writer resource string (XXX if this ever changes rather use offset math)
2754  lcl_NewUINameArray(STR_TABSTYLE_ARY, SAL_N_ELEMENTS(STR_TABSTYLE_ARY),
2755  static_cast<size_t>(SAL_N_ELEMENTS(STR_TABSTYLE_ARY) - 1))).first;
2756 
2757  return it->second;
2758 }
2759 
2760 /* 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)
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:341
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:599
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
Group HTML-styles.
Definition: poolfmt.hxx:430
static sal_uInt16 GetBullIndent(sal_uInt8 nLvl)
Definition: number.cxx:167
Subgroup numberings.
Definition: poolfmt.hxx:281
WhichRangesContainer const aTextFormatCollSetRange(svl::Items< RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, RES_PARATR_LIST_LEVEL, RES_PARATR_LIST_LEVEL, RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, XATTR_FILL_FIRST, XATTR_FILL_LAST >)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
static const std::vector< OUString > & GetListsUINameArray()
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)
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:239
const TranslateId STR_POOLCOLL_REGISTER_ARY[]
#define LANGUAGE_ARABIC_SAUDI_ARABIA
#define LINE_SPACE_DEFAULT_HEIGHT
constexpr auto toTwips(N number, Length from)
constexpr short lNumberFirstLineOffset
Definition: swtypes.hxx:102
static const std::vector< OUString > & GetTableStyleUINameArray()
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL2E
Group chapter / document.
Definition: poolfmt.hxx:421
#define LANGUAGE_ENGLISH_US
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
void SetAutoRule(bool bFlag)
Definition: numrule.hxx:231
const OUString & GetStyleName() const
Start 3rd level.
Definition: poolfmt.hxx:289
static const std::vector< OUString > & GetFrameFormatUINameArray()
const LanguageTag & GetUILanguageTag() const
const sal_uInt16 COLL_GET_RANGE_BITS
Definition: poolfmt.hxx:71
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId) override
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(110)
void SetPositionAndSpaceMode(SvxNumPositionAndSpaceMode ePositionAndSpaceMode)
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL3
constexpr::Color COL_RED(0x80, 0x00, 0x00)
const TranslateId STR_POOLCOLL_EXTRA_ARY[]
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM1
static const std::vector< OUString > & GetHTMLUINameArray()
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
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)
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:390
const TranslateId STR_POOLFRM_ARY[]
SVX_NUM_CHARS_UPPER_LETTER
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat IDs.
Definition: numrule.hxx:251
SwFrameFormat & GetFirstMaster()
Definition: pagedesc.hxx:240
#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
Start 2nd level.
Definition: poolfmt.hxx:307
Definition: doc.hxx:188
Vertical numbering symbols.
Definition: poolfmt.hxx:130
const sal_Unicode cBulletChar
Character for lists.
Definition: numrule.hxx:48
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:93
Content 1st level.
Definition: poolfmt.hxx:375
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM2
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL1E
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
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL2
void SetIncludeUpperLevels(sal_uInt8 nSet)
SwFormat * MakeFrameFormat_(const OUString &, SwFormat *, bool, bool)
Definition: docfmt.cxx:848
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:203
virtual bool GetInfo(SfxPoolItem &) const override
Definition: calbck.cxx:162
WhichRangesContainer const aFrameFormatSetRange(svl::Items< RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, XATTR_FILL_FIRST, XATTR_FILL_LAST >)
const TranslateId STR_POOLCOLL_DOC_ARY[]
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM4
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:744
static const std::vector< OUString > & GetPageDescUINameArray()
Value in Var-direction gives minimum (can be exceeded but not be less).
void SetFollow(const SwPageDesc *pNew)
Definition: pagedesc.hxx:314
FontFamily GetFamilyType()
void SetIndentAt(const tools::Long nIndentAt)
Landscape page style.
Definition: poolfmt.hxx:179
Content 5th level.
Definition: poolfmt.hxx:379
const TranslateId STR_POOLCOLL_TEXT_ARY[]
WEIGHT_BOLD
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
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:1204
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL3
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL4E
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM3
const SwPageFootnoteInfo & GetFootnoteInfo() const
Definition: pagedesc.hxx:205
const TranslateId STR_POOLNUMRULE_NUM_ARY[]
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:753
void SetPropLineSpace(const sal_uInt16 nProp)
provides some methods for generic operations on lists that contain SwFormat* subclasses.
Definition: docary.hxx:44
void SetFootnoteInfo(const SwPageFootnoteInfo &rNew)
Definition: pagedesc.hxx:207
LINESTYLE_NONE
void SetPoolFormatId(sal_uInt16 nId)
Definition: format.hxx:148
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
Definition: pagedesc.hxx:275
const TranslateId STR_POOLCHR_ARY[]
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
const SwTextFormatColl * GetDfltTextFormatColl() const
Definition: doc.hxx:776
Subgroup header.
Definition: poolfmt.hxx:330
void SetLandscape(bool bNew)
Definition: pagedesc.hxx:200
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:881
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL5E
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:667
OUString SvxResId(TranslateId aId)
SVX_NUM_ARABIC
No numbering.
Definition: poolfmt.hxx:292
Content 6th level.
Definition: poolfmt.hxx:389
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
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL1S
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL2E
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
const TranslateId STR_POOLPAGE_ARY[]
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)
Base class for various Writer styles.
Definition: format.hxx:46
#define SAL_N_ELEMENTS(arr)
Content 3rd level.
Definition: poolfmt.hxx:377
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:69
NumRule Bullets 2.
Definition: poolfmt.hxx:195
virtual SvxULSpaceItem * Clone(SfxItemPool *pPool=nullptr) const override
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL1E
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL2
Start 3rd level.
Definition: poolfmt.hxx:311
Style of a layout element.
Definition: frmfmt.hxx:59
SVX_NUM_CHARS_LOWER_LETTER
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL3S
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL5
Footnote anchor.
Definition: poolfmt.hxx:127
FontPitch GetPitch()
HTML-styles.
Definition: poolfmt.hxx:134
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
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL4S
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:67
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 TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM4
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1333
End 2nd level.
Definition: poolfmt.hxx:287
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:881
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM1
void SetAuto(bool bNew)
Definition: format.hxx:163
bool GetLandscape() const
Definition: pagedesc.hxx:199
WhichRangesContainer const aCharFormatSetRange(svl::Items< RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1 >)
Text body.
Definition: poolfmt.hxx:251
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL5
const TranslateId STR_POOLCOLL_HTML_ARY[]
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
Definition: docdesc.cxx:759
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[]
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:880
Internet normal.
Definition: poolfmt.hxx:120
LINESTYLE_SINGLE
float u
size_t size() const
Definition: docary.hxx:88
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)
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL2S
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL3E
static sal_uInt16 GetNumIndent(sal_uInt8 nLvl)
Definition: number.cxx:161
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL2S
void SetPoolFormatId(sal_uInt16 const nId)
Definition: pagedesc.hxx:276
constexpr TypedWhichId< SvxEmphasisMarkItem > RES_CHRATR_EMPHASIS_MARK(33)
const TranslateId STR_POOLCHR_HTML_ARY[]
tools::Long GetHeight() const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
SfxItemPool * GetPool() const
Left page.
Definition: poolfmt.hxx:172
Start 4th level.
Definition: poolfmt.hxx:293
Illustrations all levels.
Definition: poolfmt.hxx:397
Frame cannot be moved in Var-direction.
tools::Long SwTwips
Definition: swtypes.hxx:52
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:102
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL4E
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL5E
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:747
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL5S
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
Size & LandscapeSwap(Size &rSize)
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
virtual SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId) override
Return required automatic format.
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUMBER_BULLET_BASE
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL4
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
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:603
Doc. appendix.
Definition: poolfmt.hxx:425
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:273
Start 5th level.
Definition: poolfmt.hxx:319
static const std::vector< OUString > & GetExtraUINameArray()
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL1
constexpr TypedWhichId< SvxOrphansItem > RES_PARATR_ORPHANS(66)
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:740
void SetPosProtect(bool bNew)
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
Definition: number.cxx:1499
static std::vector< OUString > lcl_NewUINameArray(const TranslateId *pIds, const size_t nLen, const size_t nSvxIds=0)
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
NumRule Numbering 123.
Definition: poolfmt.hxx:189
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM5
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:778
constexpr tools::Long Height() const
constexpr short lBulletFirstLineOffset
Definition: swtypes.hxx:100
ITALIC_NORMAL
unsigned char sal_uInt8
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL4
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL4S
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM2
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:241
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1066
const TranslateId STR_TABSTYLE_ARY[]
Marginalia.
Definition: poolfmt.hxx:258
OUString aName
Content 4th level.
Definition: poolfmt.hxx:378
LanguageType GetAppLanguage()
Definition: init.cxx:723
SwNodes & GetNodes()
Definition: doc.hxx:409
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL1S
Start 2nd level.
Definition: poolfmt.hxx:285
virtual SvxLRSpaceItem * Clone(SfxItemPool *pPool=nullptr) const override
static const std::vector< OUString > & GetRegisterUINameArray()
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:2448
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)
tables index.
Definition: poolfmt.hxx:404
void SetSuffix(const OUString &rSet)
sal_Int32 GetFirstLineOffset() const
Start 4th level.
Definition: poolfmt.hxx:315
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM3
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL3E
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
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.
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL3S
Line numbering.
Definition: poolfmt.hxx:125
PAPER_ENV_C65
#define SAL_WARN(area, stream)
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
End 3rd level.
Definition: poolfmt.hxx:291
void SetNumberingType(SvxNumType nSet)
const SwFrameFormats * GetFrameFormats() const
Definition: doc.hxx:738
Subgroup table.
Definition: poolfmt.hxx:341
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 TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL1
const sal_uInt16 POOLGRP_CHARFMT
Other groups:
Definition: poolfmt.hxx:75
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
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)
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM5
constexpr TypedWhichId< SvxWidowsItem > RES_PARATR_WIDOWS(67)
rtl_TextEncoding GetCharSet() const
sal_uInt16 nPos
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1319
void SetListtabPos(const tools::Long nListtabPos)
const TranslateId STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL5S
WhichRangesContainer const aPgFrameFormatSetRange(svl::Items< RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1 >)
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1024
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