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