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