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