LibreOffice Module sw (master)  1
DocumentStylePoolManager.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
20 #include <SwStyleNameMapper.hxx>
21 #include <doc.hxx>
23 #include <IDocumentState.hxx>
24 #include <IDocumentUndoRedo.hxx>
25 #include <fmtanchr.hxx>
26 #include <fmtfsize.hxx>
27 #include <paratr.hxx>
28 #include <poolfmt.hxx>
29 #include <fmtornt.hxx>
30 #include <charfmt.hxx>
31 #include <fmtsrnd.hxx>
32 #include <docary.hxx>
33 #include <GetMetricVal.hxx>
34 #include <pagedesc.hxx>
35 #include <frmfmt.hxx>
36 #include <fmtline.hxx>
37 #include <numrule.hxx>
38 #include <hints.hxx>
39 #include <editeng/paperinf.hxx>
40 #include <editeng/wghtitem.hxx>
41 #include <editeng/fontitem.hxx>
42 #include <editeng/fhgtitem.hxx>
43 #include <editeng/tstpitem.hxx>
44 #include <editeng/lrspitem.hxx>
45 #include <editeng/ulspitem.hxx>
46 #include <editeng/lspcitem.hxx>
47 #include <editeng/adjustitem.hxx>
48 #include <editeng/postitem.hxx>
49 #include <editeng/keepitem.hxx>
50 #include <editeng/opaqitem.hxx>
51 #include <editeng/boxitem.hxx>
52 #include <editeng/cmapitem.hxx>
53 #include <editeng/udlnitem.hxx>
54 #include <editeng/colritem.hxx>
55 #include <editeng/protitem.hxx>
57 #include <editeng/langitem.hxx>
61 #include <svx/strings.hrc>
62 #include <svx/dialmgr.hxx>
63 #include <sal/log.hxx>
64 #include <osl/diagnose.h>
65 #include <strings.hrc>
66 #include <frmatr.hxx>
67 #include <frameformats.hxx>
68 #include <com/sun/star/text/VertOrientation.hpp>
69 #include <com/sun/star/text/RelOrientation.hpp>
70 #include <com/sun/star/text/HoriOrientation.hpp>
71 
72 using namespace ::editeng;
73 using namespace ::com::sun::star;
74 
75 bool IsConditionalByPoolId(sal_uInt16 nId)
76 {
77  // TODO: why is this style conditional?
78  // If it is changed to no longer be conditional, then a style "Text Body"
79  // will be imported without its conditions from ODF.
80  return RES_POOLCOLL_TEXT == nId;
81 }
82 
83 namespace
84 {
85  static const sal_uInt16 PT_3 = 3 * 20; // 3 pt
86  static const sal_uInt16 PT_6 = 6 * 20; // 6 pt
87  static const sal_uInt16 PT_7 = 7 * 20; // 7 pt
88  static const sal_uInt16 PT_10 = 10 * 20; // 10 pt
89  static const sal_uInt16 PT_12 = 12 * 20; // 12 pt
90  static const sal_uInt16 PT_14 = 14 * 20; // 14 pt
91  static const sal_uInt16 PT_16 = 16 * 20; // 16 pt
92  static const sal_uInt16 PT_18 = 18 * 20; // 18 pt
93  static const sal_uInt16 PT_24 = 24 * 20; // 24 pt
94  static const sal_uInt16 PT_28 = 28 * 20; // 28 pt
95 
96  #define HTML_PARSPACE GetMetricVal( CM_05 )
97 
98  static const sal_uInt16 aHeadlineSizes[ 2 * MAXLEVEL ] = {
99  // we do everything percentual now:
100  130, 115, 101, 95, 85,
101  85, 80, 80, 75, 75, // normal
102  PT_24, PT_18, PT_14, PT_12, PT_10,
103  PT_7, PT_7, PT_7, PT_7, PT_7 // HTML mode
104  };
105 
106  long lcl_GetRightMargin( SwDoc& rDoc )
107  {
108  // Make sure that the printer settings are taken over to the standard
109  // page style
110  const SwFrameFormat& rPgDscFormat = rDoc.GetPageDesc( 0 ).GetMaster();
111  const SvxLRSpaceItem& rLR = rPgDscFormat.GetLRSpace();
112  const long nLeft = rLR.GetLeft();
113  const long nRight = rLR.GetRight();
114  const long nWidth = rPgDscFormat.GetFrameSize().GetWidth();
115  return nWidth - nLeft - nRight;
116  }
117 
118  void lcl_SetDfltFont( DefaultFontType nFntType, SfxItemSet& rSet )
119  {
120  static struct {
121  sal_uInt16 nResLngId;
122  sal_uInt16 nResFntId;
123  } aArr[ 3 ] = {
127  };
128  for(const auto & n : aArr)
129  {
130  LanguageType nLng = static_cast<const SvxLanguageItem&>(rSet.GetPool()->GetDefaultItem(
131  n.nResLngId )).GetLanguage();
132  vcl::Font aFnt( OutputDevice::GetDefaultFont( nFntType,
133  nLng, GetDefaultFontFlags::OnlyOne ) );
134 
135  rSet.Put( SvxFontItem( aFnt.GetFamilyType(), aFnt.GetFamilyName(),
136  OUString(), aFnt.GetPitch(),
137  aFnt.GetCharSet(), n.nResFntId ));
138  }
139  }
140 
141  void lcl_SetDfltFont( DefaultFontType nLatinFntType, DefaultFontType nCJKFntType,
142  DefaultFontType nCTLFntType, SfxItemSet& rSet )
143  {
144  static struct {
145  sal_uInt16 nResLngId;
146  sal_uInt16 nResFntId;
147  DefaultFontType nFntType;
148  } aArr[ 3 ] = {
152  };
153  aArr[0].nFntType = nLatinFntType;
154  aArr[1].nFntType = nCJKFntType;
155  aArr[2].nFntType = nCTLFntType;
156 
157  for(const auto & n : aArr)
158  {
159  LanguageType nLng = static_cast<const SvxLanguageItem&>(rSet.GetPool()->GetDefaultItem(
160  n.nResLngId )).GetLanguage();
161  vcl::Font aFnt( OutputDevice::GetDefaultFont( n.nFntType,
162  nLng, GetDefaultFontFlags::OnlyOne ) );
163 
164  rSet.Put( SvxFontItem( aFnt.GetFamilyType(), aFnt.GetFamilyName(),
165  OUString(), aFnt.GetPitch(),
166  aFnt.GetCharSet(), n.nResFntId ));
167  }
168  }
169 
170  void lcl_SetHeadline( SwDoc* pDoc, SwTextFormatColl* pColl,
171  SfxItemSet& rSet,
172  sal_uInt16 nOutLvlBits, sal_uInt8 nLevel, bool bItalic )
173  {
174  SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) );
175  SvxFontHeightItem aHItem(240, 100, RES_CHRATR_FONTSIZE);
176  const bool bHTMLMode = pDoc->GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE);
177  if( bHTMLMode )
178  aHItem.SetHeight( aHeadlineSizes[ MAXLEVEL + nLevel ] );
179  else
180  aHItem.SetHeight( PT_14, aHeadlineSizes[ nLevel ] );
181  SetAllScriptItem( rSet, aHItem );
182 
183  if( bItalic && !bHTMLMode )
184  SetAllScriptItem( rSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE ) );
185 
186  if( bHTMLMode )
187  {
188  lcl_SetDfltFont( DefaultFontType::LATIN_TEXT, DefaultFontType::CJK_TEXT,
189  DefaultFontType::CTL_TEXT, rSet );
190  }
191 
192  if( !pColl )
193  return;
194 
195  if( !( nOutLvlBits & ( 1 << nLevel )) )
196  {
197  pColl->AssignToListLevelOfOutlineStyle(nLevel);
198  if( !bHTMLMode )
199  {
200  SwNumRule * pOutlineRule = pDoc->GetOutlineNumRule();
201  const SwNumFormat& rNFormat = pOutlineRule->Get( nLevel );
202 
203  if ( rNFormat.GetPositionAndSpaceMode() ==
205  ( rNFormat.GetAbsLSpace() || rNFormat.GetFirstLineOffset() ) )
206  {
207  SvxLRSpaceItem aLR( pColl->GetFormatAttr( RES_LR_SPACE ) );
209  //TODO: overflow
210  aLR.SetTextLeft( rNFormat.GetAbsLSpace() );
211  pColl->SetFormatAttr( aLR );
212  }
213 
214  // All paragraph styles, which are assigned to a level of the
215  // outline style has to have the outline style set as its list style.
216  SwNumRuleItem aItem(pOutlineRule->GetName());
217  pColl->SetFormatAttr(aItem);
218  }
219  }
221  }
222 
223  void lcl_SetRegister( SwDoc* pDoc, SfxItemSet& rSet, sal_uInt16 nFact,
224  bool bHeader, bool bTab )
225  {
227  sal_uInt16 nLeft = nFact ? GetMetricVal( CM_05 ) * nFact : 0;
228  aLR.SetTextLeft( nLeft );
229 
230  rSet.Put( aLR );
231  if( bHeader )
232  {
233  SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) );
235  }
236  if( bTab )
237  {
238  long nRightMargin = lcl_GetRightMargin( *pDoc );
239  SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
240  aTStops.Insert( SvxTabStop( nRightMargin - nLeft,
241  SvxTabAdjust::Right,
242  cDfltDecimalChar, '.' ));
243  rSet.Put( aTStops );
244  }
245  }
246 
247  void lcl_SetNumBul( SwDoc* pDoc, SwTextFormatColl* pColl,
248  SfxItemSet& rSet,
249  sal_uInt16 nNxt, SwTwips nEZ, SwTwips nLeft,
250  SwTwips nUpper, SwTwips nLower )
251  {
252 
255  aLR.SetTextFirstLineOffset( sal_uInt16(nEZ) );
256  aLR.SetTextLeft( sal_uInt16(nLeft) );
257  aUL.SetUpper( sal_uInt16(nUpper) );
258  aUL.SetLower( sal_uInt16(nLower) );
259  rSet.Put( aLR );
260  rSet.Put( aUL );
261 
262  if( pColl )
264  }
265 
266  void lcl_PutStdPageSizeIntoItemSet( SwDoc* pDoc, SfxItemSet& rSet )
267  {
269  SwFormatFrameSize aFrameSz( pStdPgDsc->GetMaster().GetFrameSize() );
270  if( pStdPgDsc->GetLandscape() )
271  {
272  SwTwips nTmp = aFrameSz.GetHeight();
273  aFrameSz.SetHeight( aFrameSz.GetWidth() );
274  aFrameSz.SetWidth( nTmp );
275  }
276  rSet.Put( aFrameSz );
277  }
278 }
279 
280 static const char* STR_POOLCOLL_TEXT_ARY[] =
281 {
282  // Category Text
283  STR_POOLCOLL_STANDARD,
284  STR_POOLCOLL_TEXT,
285  STR_POOLCOLL_TEXT_IDENT,
286  STR_POOLCOLL_TEXT_NEGIDENT,
287  STR_POOLCOLL_TEXT_MOVE,
288  STR_POOLCOLL_GREETING,
289  STR_POOLCOLL_SIGNATURE,
290  STR_POOLCOLL_CONFRONTATION,
291  STR_POOLCOLL_MARGINAL,
292  // Subcategory Headlines
293  STR_POOLCOLL_HEADLINE_BASE,
294  STR_POOLCOLL_HEADLINE1,
295  STR_POOLCOLL_HEADLINE2,
296  STR_POOLCOLL_HEADLINE3,
297  STR_POOLCOLL_HEADLINE4,
298  STR_POOLCOLL_HEADLINE5,
299  STR_POOLCOLL_HEADLINE6,
300  STR_POOLCOLL_HEADLINE7,
301  STR_POOLCOLL_HEADLINE8,
302  STR_POOLCOLL_HEADLINE9,
303  STR_POOLCOLL_HEADLINE10
304 };
305 
306 static const char* STR_POOLCOLL_LISTS_ARY[]
307 {
308  // Category Lists
310  // Subcategory Numbering
331 
332  // Subcategory Enumeration
353 };
354 
355 // Special Areas
356 static const char* STR_POOLCOLL_EXTRA_ARY[]
357 {
358  // Subcategory Header
359  STR_POOLCOLL_HEADERFOOTER,
360  STR_POOLCOLL_HEADER,
361  STR_POOLCOLL_HEADERL,
362  STR_POOLCOLL_HEADERR,
363  // Subcategroy Footer
364  STR_POOLCOLL_FOOTER,
365  STR_POOLCOLL_FOOTERL,
366  STR_POOLCOLL_FOOTERR,
367  // Subcategroy Table
368  STR_POOLCOLL_TABLE,
369  STR_POOLCOLL_TABLE_HDLN,
370  // Subcategroy Labels
371  STR_POOLCOLL_LABEL,
372  STR_POOLCOLL_LABEL_ABB,
373  STR_POOLCOLL_LABEL_TABLE,
374  STR_POOLCOLL_LABEL_FRAME,
375  STR_POOLCOLL_LABEL_FIGURE,
376  // Miscellaneous
377  STR_POOLCOLL_FRAME,
378  STR_POOLCOLL_FOOTNOTE,
379  STR_POOLCOLL_JAKETADRESS,
380  STR_POOLCOLL_SENDADRESS,
381  STR_POOLCOLL_ENDNOTE,
382  STR_POOLCOLL_LABEL_DRAWING
383 };
384 
385 static const char* STR_POOLCOLL_REGISTER_ARY[] =
386 {
387  // Category Directories
388  STR_POOLCOLL_REGISTER_BASE,
389  // Subcategory Index-Directories
390  STR_POOLCOLL_TOX_IDXH,
391  STR_POOLCOLL_TOX_IDX1,
392  STR_POOLCOLL_TOX_IDX2,
393  STR_POOLCOLL_TOX_IDX3,
394  STR_POOLCOLL_TOX_IDXBREAK,
395  // Subcategory Tables of Contents
396  STR_POOLCOLL_TOX_CNTNTH,
397  STR_POOLCOLL_TOX_CNTNT1,
398  STR_POOLCOLL_TOX_CNTNT2,
399  STR_POOLCOLL_TOX_CNTNT3,
400  STR_POOLCOLL_TOX_CNTNT4,
401  STR_POOLCOLL_TOX_CNTNT5,
402  // Subcategory User-Directories:
403  STR_POOLCOLL_TOX_USERH,
404  STR_POOLCOLL_TOX_USER1,
405  STR_POOLCOLL_TOX_USER2,
406  STR_POOLCOLL_TOX_USER3,
407  STR_POOLCOLL_TOX_USER4,
408  STR_POOLCOLL_TOX_USER5,
409  // Subcategory Table of Contents more Levels 5 - 10
410  STR_POOLCOLL_TOX_CNTNT6,
411  STR_POOLCOLL_TOX_CNTNT7,
412  STR_POOLCOLL_TOX_CNTNT8,
413  STR_POOLCOLL_TOX_CNTNT9,
414  STR_POOLCOLL_TOX_CNTNT10,
415  // Illustrations Index
416  STR_POOLCOLL_TOX_ILLUSH,
417  STR_POOLCOLL_TOX_ILLUS1,
418  // Object Index
419  STR_POOLCOLL_TOX_OBJECTH,
420  STR_POOLCOLL_TOX_OBJECT1,
421  // Tables Index
422  STR_POOLCOLL_TOX_TABLESH,
423  STR_POOLCOLL_TOX_TABLES1,
424  // Index of Authorities
425  STR_POOLCOLL_TOX_AUTHORITIESH,
426  STR_POOLCOLL_TOX_AUTHORITIES1,
427  // Subcategory User-Directories more Levels 5 - 10
428  STR_POOLCOLL_TOX_USER6,
429  STR_POOLCOLL_TOX_USER7,
430  STR_POOLCOLL_TOX_USER8,
431  STR_POOLCOLL_TOX_USER9,
432  STR_POOLCOLL_TOX_USER10
433 };
434 
435 static const char* STR_POOLCOLL_DOC_ARY[] =
436 {
437  // Category Chapter/Document
438  STR_POOLCOLL_DOC_TITLE,
439  STR_POOLCOLL_DOC_SUBTITLE,
440  STR_POOLCOLL_DOC_APPENDIX
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_BULLET_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.SetTextFirstLineOffset( -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.SetTextFirstLineOffset( - 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_NUMBER_BULLET_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  if (nId == RES_POOLCOLL_TABLE)
804  {
805  aSet.Put( SvxWidowsItem( 0, RES_PARATR_WIDOWS ) );
806  aSet.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
807  }
808  }
809  break;
810 
811  case RES_POOLCOLL_HEADLINE1: // Heading 1
812  {
813  SvxULSpaceItem aUL( PT_12, PT_6, RES_UL_SPACE );
814  aSet.Put( aUL );
815  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 0, false );
816  }
817  break;
818  case RES_POOLCOLL_HEADLINE2: // Heading 2
819  {
820  SvxULSpaceItem aUL( PT_10, PT_6, RES_UL_SPACE );
821  aSet.Put( aUL );
822  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 1, false );
823  }
824  break;
825  case RES_POOLCOLL_HEADLINE3: // Heading 3
826  {
827  SvxULSpaceItem aUL( PT_7, PT_6, RES_UL_SPACE );
828  aSet.Put( aUL );
829  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 2, false );
830  }
831  break;
832  case RES_POOLCOLL_HEADLINE4: // Heading 4
833  {
834  SvxULSpaceItem aUL( PT_6, PT_6, RES_UL_SPACE );
835  aSet.Put( aUL );
836  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 3, true );
837  }
838  break;
839  case RES_POOLCOLL_HEADLINE5: // Heading 5
840  {
841  SvxULSpaceItem aUL( PT_6, PT_3, RES_UL_SPACE );
842  aSet.Put( aUL );
843  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 4, false );
844  }
845  break;
846  case RES_POOLCOLL_HEADLINE6: // Heading 6
847  {
848  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
849  aSet.Put( aUL );
850  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 5, true );
851  }
852  break;
853  case RES_POOLCOLL_HEADLINE7: // Heading 7
854  {
855  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
856  aSet.Put( aUL );
857  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 6, false );
858  }
859  break;
860  case RES_POOLCOLL_HEADLINE8: // Heading 8
861  {
862  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
863  aSet.Put( aUL );
864  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 7, true );
865  }
866  break;
867  case RES_POOLCOLL_HEADLINE9: // Heading 9
868  {
869  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
870  aSet.Put( aUL );
871  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 8, false );
872  }
873  break;
874  case RES_POOLCOLL_HEADLINE10: // Heading 10
875  {
876  SvxULSpaceItem aUL( PT_3, PT_3, RES_UL_SPACE );
877  aSet.Put( aUL );
878  lcl_SetHeadline( &m_rDoc, pNewColl, aSet, nOutLvlBits, 9, false );
879  }
880  break;
881 
882  // Special sections:
883  // Header
885  case RES_POOLCOLL_HEADER:
888  // Footer
889  case RES_POOLCOLL_FOOTER:
892  {
893  SwFormatLineNumber aLN;
894  aLN.SetCountLines( false );
895  aSet.Put( aLN );
896 
897  long nRightMargin = lcl_GetRightMargin( m_rDoc );
898 
899  SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
900  aTStops.Insert( SvxTabStop( nRightMargin / 2, SvxTabAdjust::Center ) );
901  aTStops.Insert( SvxTabStop( nRightMargin, SvxTabAdjust::Right ) );
902 
903  aSet.Put( aTStops );
904 
905  if ( (nId==RES_POOLCOLL_HEADERR) || (nId==RES_POOLCOLL_FOOTERR) ) {
906  SvxAdjustItem aAdjust(SvxAdjust::Right, RES_PARATR_ADJUST );
907  aSet.Put(aAdjust);
908  }
909  }
910  break;
911 
913  {
915  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) );
916  SwFormatLineNumber aLN;
917  aLN.SetCountLines( false );
918  aSet.Put( aLN );
919  }
920  break;
921 
922  case RES_POOLCOLL_FOOTNOTE: // paragraph style Footnote
923  case RES_POOLCOLL_ENDNOTE: // paragraph style Endnote
924  {
926  aLR.SetTextFirstLineOffset( -static_cast<short>( GetMetricVal( CM_05 ) + GetMetricVal( CM_01 ) ) );
929  aSet.Put( aLR );
930  SwFormatLineNumber aLN;
931  aLN.SetCountLines( false );
932  aSet.Put( aLN );
933  }
934  break;
935 
936  case RES_POOLCOLL_LABEL: // basic caption
937  {
939  aUL.SetUpper( PT_6 );
940  aUL.SetLower( PT_6 );
941  aSet.Put( aUL );
944  SwFormatLineNumber aLN;
945  aLN.SetCountLines( false );
946  aSet.Put( aLN );
947  }
948  break;
949 
950  case RES_POOLCOLL_FRAME: // Frame content
951  case RES_POOLCOLL_LABEL_ABB: // caption image
952  case RES_POOLCOLL_LABEL_TABLE: // caption table
953  case RES_POOLCOLL_LABEL_FRAME: // caption frame
954  case RES_POOLCOLL_LABEL_DRAWING: // caption drawing
956  break;
957 
958  case RES_POOLCOLL_JAKETADRESS: // envelope address
959  {
961  aUL.SetLower( PT_3 );
962  aSet.Put( aUL );
963  SwFormatLineNumber aLN;
964  aLN.SetCountLines( false );
965  aSet.Put( aLN );
966  }
967  break;
968 
969  case RES_POOLCOLL_SENDADRESS: // Sender address
970  {
973  else
974  {
975  SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetLower( PT_3 );
976  aSet.Put( aUL );
977  }
978  SwFormatLineNumber aLN;
979  aLN.SetCountLines( false );
980  aSet.Put( aLN );
981  }
982  break;
983 
984  // User defined indexes:
985  case RES_POOLCOLL_TOX_USERH: // Header
986  lcl_SetRegister( &m_rDoc, aSet, 0, true, false );
987  {
988  SwFormatLineNumber aLN;
989  aLN.SetCountLines( false );
990  aSet.Put( aLN );
991  }
992  break;
993  case RES_POOLCOLL_TOX_USER1: // 1st level
994  lcl_SetRegister( &m_rDoc, aSet, 0, false, true );
995  break;
996  case RES_POOLCOLL_TOX_USER2: // 2nd level
997  lcl_SetRegister( &m_rDoc, aSet, 1, false, true );
998  break;
999  case RES_POOLCOLL_TOX_USER3: // 3rd level
1000  lcl_SetRegister( &m_rDoc, aSet, 2, false, true );
1001  break;
1002  case RES_POOLCOLL_TOX_USER4: // 4th level
1003  lcl_SetRegister( &m_rDoc, aSet, 3, false, true );
1004  break;
1005  case RES_POOLCOLL_TOX_USER5: // 5th level
1006  lcl_SetRegister( &m_rDoc, aSet, 4, false, true );
1007  break;
1008  case RES_POOLCOLL_TOX_USER6: // 6th level
1009  lcl_SetRegister( &m_rDoc, aSet, 5, false, true );
1010  break;
1011  case RES_POOLCOLL_TOX_USER7: // 7th level
1012  lcl_SetRegister( &m_rDoc, aSet, 6, false, true );
1013  break;
1014  case RES_POOLCOLL_TOX_USER8: // 8th level
1015  lcl_SetRegister( &m_rDoc, aSet, 7, false, true );
1016  break;
1017  case RES_POOLCOLL_TOX_USER9: // 9th level
1018  lcl_SetRegister( &m_rDoc, aSet, 8, false, true );
1019  break;
1020  case RES_POOLCOLL_TOX_USER10: // 10th level
1021  lcl_SetRegister( &m_rDoc, aSet, 9, false, true );
1022  break;
1023 
1024  // Index
1025  case RES_POOLCOLL_TOX_IDXH: // Header
1026  lcl_SetRegister( &m_rDoc, aSet, 0, true, false );
1027  {
1028  SwFormatLineNumber aLN;
1029  aLN.SetCountLines( false );
1030  aSet.Put( aLN );
1031  }
1032  break;
1033  case RES_POOLCOLL_TOX_IDX1: // 1st level
1034  lcl_SetRegister( &m_rDoc, aSet, 0, false, false );
1035  break;
1036  case RES_POOLCOLL_TOX_IDX2: // 2nd level
1037  lcl_SetRegister( &m_rDoc, aSet, 1, false, false );
1038  break;
1039  case RES_POOLCOLL_TOX_IDX3: // 3rd level
1040  lcl_SetRegister( &m_rDoc, aSet, 2, false, false );
1041  break;
1042  case RES_POOLCOLL_TOX_IDXBREAK: // Separator
1043  lcl_SetRegister( &m_rDoc, aSet, 0, false, false );
1044  break;
1045 
1046  // Table of Content
1047  case RES_POOLCOLL_TOX_CNTNTH: // Header
1048  lcl_SetRegister( &m_rDoc, aSet, 0, true, false );
1049  {
1050  SwFormatLineNumber aLN;
1051  aLN.SetCountLines( false );
1052  aSet.Put( aLN );
1053  }
1054  break;
1055  case RES_POOLCOLL_TOX_CNTNT1: // 1st level
1056  lcl_SetRegister( &m_rDoc, aSet, 0, false, true );
1057  break;
1058  case RES_POOLCOLL_TOX_CNTNT2: // 2nd level
1059  lcl_SetRegister( &m_rDoc, aSet, 1, false, true );
1060  break;
1061  case RES_POOLCOLL_TOX_CNTNT3: // 3rd level
1062  lcl_SetRegister( &m_rDoc, aSet, 2, false, true );
1063  break;
1064  case RES_POOLCOLL_TOX_CNTNT4: // 4th level
1065  lcl_SetRegister( &m_rDoc, aSet, 3, false, true );
1066  break;
1067  case RES_POOLCOLL_TOX_CNTNT5: // 5th level
1068  lcl_SetRegister( &m_rDoc, aSet, 4, false, true );
1069  break;
1070  case RES_POOLCOLL_TOX_CNTNT6: // 6th level
1071  lcl_SetRegister( &m_rDoc, aSet, 5, false, true );
1072  break;
1073  case RES_POOLCOLL_TOX_CNTNT7: // 7th level
1074  lcl_SetRegister( &m_rDoc, aSet, 6, false, true );
1075  break;
1076  case RES_POOLCOLL_TOX_CNTNT8: // 8th level
1077  lcl_SetRegister( &m_rDoc, aSet, 7, false, true );
1078  break;
1079  case RES_POOLCOLL_TOX_CNTNT9: // 9th level
1080  lcl_SetRegister( &m_rDoc, aSet, 8, false, true );
1081  break;
1082  case RES_POOLCOLL_TOX_CNTNT10: // 10th level
1083  lcl_SetRegister( &m_rDoc, aSet, 9, false, true );
1084  break;
1085 
1090  lcl_SetRegister( &m_rDoc, aSet, 0, true, false );
1091  {
1092  SwFormatLineNumber aLN;
1093  aLN.SetCountLines( false );
1094  aSet.Put( aLN );
1095  }
1096  break;
1101  lcl_SetRegister( &m_rDoc, aSet, 0, false, true );
1102  break;
1103 
1105  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
1107  PT_12, PT_6 );
1108  break;
1110  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
1112  0, PT_6 );
1113  break;
1115  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
1117  0, PT_12 );
1118  break;
1120  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM1,
1121  0, SwNumRule::GetNumIndent( 0 ), 0, PT_6 );
1122  break;
1124  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
1126  PT_12, PT_6 );
1127  break;
1129  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
1131  0, PT_6 );
1132  break;
1134  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
1136  0, PT_12 );
1137  break;
1139  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM2,
1140  0, SwNumRule::GetNumIndent( 1 ), 0, PT_6 );
1141  break;
1143  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
1145  PT_12, PT_6 );
1146  break;
1148  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
1150  0, PT_6 );
1151  break;
1153  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
1155  0, PT_12 );
1156  break;
1158  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM3,
1159  0, SwNumRule::GetNumIndent( 2 ), 0, PT_6 );
1160  break;
1162  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
1164  PT_12, PT_6 );
1165  break;
1167  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
1169  0, PT_6 );
1170  break;
1172  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
1174  0, PT_12 );
1175  break;
1177  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM4,
1178  0, SwNumRule::GetNumIndent( 3 ), 0, PT_6 );
1179  break;
1181  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
1183  PT_12, PT_6 );
1184  break;
1186  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
1188  0, PT_6 );
1189  break;
1191  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
1193  0, PT_12 );
1194  break;
1196  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM5,
1197  0, SwNumRule::GetNumIndent( 4 ), 0, PT_6 );
1198  break;
1199 
1201  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL1,
1203  PT_12, PT_6 );
1204  break;
1206  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL1,
1208  0, PT_6 );
1209  break;
1211  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL1,
1213  0, PT_12 );
1214  break;
1216  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM1,
1217  0, SwNumRule::GetBullIndent( 0 ), 0, PT_6 );
1218  break;
1220  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL2,
1222  PT_12, PT_6 );
1223  break;
1225  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL2,
1227  0, PT_6 );
1228  break;
1230  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL2,
1232  0, PT_12 );
1233  break;
1235  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM2,
1236  0, SwNumRule::GetBullIndent( 1 ), 0, PT_6 );
1237  break;
1239  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL3,
1241  PT_12, PT_6 );
1242  break;
1244  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL3,
1246  0, PT_6 );
1247  break;
1249  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL3,
1251  0, PT_12 );
1252  break;
1254  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM3,
1255  0, SwNumRule::GetBullIndent( 2 ), 0, PT_6 );
1256  break;
1258  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL4,
1260  PT_12, PT_6 );
1261  break;
1263  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL4,
1265  0, PT_6 );
1266  break;
1268  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL4,
1270  0, PT_12 );
1271  break;
1273  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM4,
1274  0, SwNumRule::GetBullIndent( 3 ), 0, PT_6 );
1275  break;
1277  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL5,
1279  PT_12, PT_6 );
1280  break;
1282  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL5,
1284  0, PT_6 );
1285  break;
1287  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_LEVEL5,
1289  0, PT_12 );
1290  break;
1292  lcl_SetNumBul( &m_rDoc, pNewColl, aSet, RES_POOLCOLL_BULLET_NONUM5,
1293  0, SwNumRule::GetBullIndent( 4 ), 0, PT_6 );
1294  break;
1295 
1296  case RES_POOLCOLL_DOC_TITLE: // Document Title
1297  {
1299  SetAllScriptItem( aSet, SvxFontHeightItem( PT_28, 100, RES_CHRATR_FONTSIZE ) );
1300 
1301  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) );
1302 
1304  }
1305  break;
1306 
1307  case RES_POOLCOLL_DOC_SUBTITLE: // Document subtitle
1308  {
1309  SvxULSpaceItem aUL( PT_3, PT_6, RES_UL_SPACE );
1310  aSet.Put( aUL );
1312 
1313  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ));
1314 
1316  }
1317  break;
1318 
1319  case RES_POOLCOLL_DOC_APPENDIX: // Document Appendix tdf#114090
1320  {
1322  SetAllScriptItem( aSet, SvxFontHeightItem( PT_16, 100, RES_CHRATR_FONTSIZE ) );
1323 
1324  aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) );
1325 
1327  }
1328  break;
1329 
1331  {
1333  aLR.SetLeft( GetMetricVal( CM_1 ));
1334  aLR.SetRight( GetMetricVal( CM_1 ));
1335  aSet.Put( aLR );
1336  std::unique_ptr<SvxULSpaceItem> aUL(pNewColl->GetULSpace().Clone());
1337  aUL->SetLower( HTML_PARSPACE );
1338  aSet.Put(std::move(aUL));
1339  }
1340  break;
1341 
1342  case RES_POOLCOLL_HTML_PRE:
1343  {
1344  ::lcl_SetDfltFont( DefaultFontType::FIXED, aSet );
1345 
1346  // WORKAROUND: Set PRE to 10pt
1348 
1349  // The lower paragraph distance is set explicitly (makes
1350  // assigning hard attributes easier)
1351  std::unique_ptr<SvxULSpaceItem> aULSpaceItem(pNewColl->GetULSpace().Clone());
1352  aULSpaceItem->SetLower( 0 );
1353  aSet.Put(std::move(aULSpaceItem));
1354  }
1355  break;
1356 
1357  case RES_POOLCOLL_HTML_HR:
1358  {
1359  SvxBoxItem aBox( RES_BOX );
1360  Color aColor( COL_GRAY );
1361  SvxBorderLine aNew(&aColor, 3, SvxBorderLineStyle::DOUBLE);
1362  aBox.SetLine( &aNew, SvxBoxItemLine::BOTTOM );
1363 
1364  aSet.Put( aBox );
1365  aSet.Put( SwParaConnectBorderItem( false ) );
1367 
1368  std::unique_ptr<SvxULSpaceItem> aUL;
1369  {
1371  aUL.reset(pNewColl->GetULSpace().Clone());
1372  }
1373  aUL->SetLower( HTML_PARSPACE );
1374  aSet.Put(std::move(aUL));
1375  SwFormatLineNumber aLN;
1376  aLN.SetCountLines( false );
1377  aSet.Put( aLN );
1378  }
1379  break;
1380 
1381  case RES_POOLCOLL_HTML_DD:
1382  {
1383  std::unique_ptr<SvxLRSpaceItem> aLR(pNewColl->GetLRSpace().Clone());
1384  // We indent by 1 cm. The IDs are always 2 away from each other!
1385  aLR->SetLeft( GetMetricVal( CM_1 ));
1386  aSet.Put(std::move(aLR));
1387  }
1388  break;
1389  case RES_POOLCOLL_HTML_DT:
1390  {
1391  std::unique_ptr<SvxLRSpaceItem> aLR;
1392  {
1394  aLR.reset(pNewColl->GetLRSpace().Clone());
1395  }
1396  // We indent by 0 cm. The IDs are always 2 away from each other!
1397  aLR->SetLeft( 0 );
1398  aSet.Put( std::move(aLR) );
1399  }
1400  break;
1401  }
1402  }
1403 
1404  if( aSet.Count() )
1405  pNewColl->SetFormatAttr( aSet );
1406  return pNewColl;
1407 }
1408 
1412 {
1413  SwFormat *pNewFormat = nullptr;
1414  SwFormat *pDeriveFormat = nullptr;
1415 
1416  SwFormatsBase* pArray[ 2 ];
1417  sal_uInt16 nArrCnt = 1;
1418  const char* pRCId = nullptr;
1419  sal_uInt16 const * pWhichRange = nullptr;
1420 
1421  switch( nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
1422  {
1423  case POOLGRP_CHARFMT:
1424  {
1425  pArray[0] = m_rDoc.GetCharFormats();
1426  pDeriveFormat = m_rDoc.GetDfltCharFormat();
1427  pWhichRange = aCharFormatSetRange;
1428 
1429  if (nId >= RES_POOLCHR_HTML_BEGIN && nId < RES_POOLCHR_HTML_END)
1430  pRCId = STR_POOLCHR_HTML_ARY[nId - RES_POOLCHR_HTML_BEGIN];
1431  else if (nId >= RES_POOLCHR_NORMAL_BEGIN && nId < RES_POOLCHR_NORMAL_END)
1432  pRCId = STR_POOLCHR_ARY[nId - RES_POOLCHR_BEGIN];
1433  else
1434  {
1435  // Fault: unknown Format, but a CharFormat -> return the first one
1436  OSL_ENSURE( false, "invalid Id" );
1437  pRCId = STR_POOLCHR_ARY[0];
1438  }
1439  }
1440  break;
1441  case POOLGRP_FRAMEFMT:
1442  {
1443  pArray[0] = m_rDoc.GetFrameFormats();
1444  pArray[1] = m_rDoc.GetSpzFrameFormats();
1445  pDeriveFormat = m_rDoc.GetDfltFrameFormat();
1446  nArrCnt = 2;
1447  pWhichRange = aFrameFormatSetRange;
1448 
1449  // Fault: unknown Format, but a FrameFormat
1450  // -> return the first one
1451  if( RES_POOLFRM_BEGIN > nId || nId >= RES_POOLFRM_END )
1452  {
1453  OSL_ENSURE( false, "invalid Id" );
1454  nId = RES_POOLFRM_BEGIN;
1455  }
1456 
1457  pRCId = STR_POOLFRM_ARY[nId - RES_POOLFRM_BEGIN];
1458  }
1459  break;
1460 
1461  default:
1462  // Fault, unknown Format
1463  OSL_ENSURE( nId, "invalid Id" );
1464  return nullptr;
1465  }
1466  OSL_ENSURE(pRCId, "invalid Id");
1467 
1468  while( nArrCnt-- )
1469  for( size_t n = 0; n < (*pArray[nArrCnt]).GetFormatCount(); ++n )
1470  if( nId == ( pNewFormat = (*pArray[ nArrCnt ] ).GetFormat( n ) )->
1471  GetPoolFormatId() )
1472  {
1473  return pNewFormat;
1474  }
1475 
1476  OUString aNm(SwResId(pRCId));
1477  SwAttrSet aSet( m_rDoc.GetAttrPool(), pWhichRange );
1478 
1479  {
1480  bool bIsModified = m_rDoc.getIDocumentState().IsModified();
1481 
1482  {
1483  ::sw::UndoGuard const undoGuard(m_rDoc.GetIDocumentUndoRedo());
1484  switch (nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
1485  {
1486  case POOLGRP_CHARFMT:
1487  pNewFormat = m_rDoc.MakeCharFormat_(aNm, pDeriveFormat, false, true);
1488  break;
1489  case POOLGRP_FRAMEFMT:
1490  pNewFormat = m_rDoc.MakeFrameFormat_(aNm, pDeriveFormat, false, true);
1491  break;
1492  default:
1493  break;
1494  }
1495  }
1496 
1497  if( !bIsModified )
1499  pNewFormat->SetPoolFormatId( nId );
1500  pNewFormat->SetAuto(false); // no AutoFormat
1501  }
1502 
1503  switch( nId )
1504  {
1505  case RES_POOLCHR_FOOTNOTE: // Footnote
1506  case RES_POOLCHR_PAGENO: // Page/Field
1507  case RES_POOLCHR_LABEL: // Label
1508  case RES_POOLCHR_DROPCAPS: // Dropcaps
1509  case RES_POOLCHR_NUM_LEVEL: // Numbering level
1510  case RES_POOLCHR_TOXJUMP: // Table of contents jump
1511  case RES_POOLCHR_ENDNOTE: // Endnote
1512  case RES_POOLCHR_LINENUM: // Line numbering
1513  break;
1514 
1515  case RES_POOLCHR_ENDNOTE_ANCHOR: // Endnote anchor
1516  case RES_POOLCHR_FOOTNOTE_ANCHOR: // Footnote anchor
1517  {
1519  }
1520  break;
1521 
1522  case RES_POOLCHR_BULLET_LEVEL: // Bullet character
1523  {
1524  const vcl::Font& rBulletFont = numfunc::GetDefBulletFont();
1525  SetAllScriptItem( aSet, SvxFontItem( rBulletFont.GetFamilyType(),
1526  rBulletFont.GetFamilyName(), rBulletFont.GetStyleName(),
1527  rBulletFont.GetPitch(), rBulletFont.GetCharSet(), RES_CHRATR_FONT ));
1528  }
1529  break;
1530 
1532  {
1533  aSet.Put( SvxColorItem( COL_BLUE, RES_CHRATR_COLOR ) );
1535  // i40133: patch submitted by rail: set language to 'none' to prevent spell checking:
1539  }
1540  break;
1542  {
1543  aSet.Put( SvxColorItem( COL_RED, RES_CHRATR_COLOR ) );
1548  }
1549  break;
1550  case RES_POOLCHR_JUMPEDIT:
1551  {
1552  aSet.Put( SvxColorItem( COL_CYAN, RES_CHRATR_COLOR ) );
1554  aSet.Put( SvxCaseMapItem( SvxCaseMap::SmallCaps, RES_CHRATR_CASEMAP ) );
1555  }
1556  break;
1557 
1558  case RES_POOLCHR_RUBYTEXT:
1559  {
1560  long nH = GetDfltAttr( RES_CHRATR_CJK_FONTSIZE )->GetHeight() / 2;
1563  aSet.Put(SvxEmphasisMarkItem( FontEmphasisMark::NONE, RES_CHRATR_EMPHASIS_MARK) );
1564  }
1565  break;
1566 
1570  {
1572  }
1573  break;
1574 
1577  {
1579  }
1580  break;
1581 
1582  case RES_POOLCHR_HTML_CODE:
1586  {
1587  ::lcl_SetDfltFont( DefaultFontType::FIXED, aSet );
1588  }
1589  break;
1590  case RES_POOLCHR_VERT_NUM:
1591  aSet.Put( SvxCharRotateItem( 900, false, RES_CHRATR_ROTATE ) );
1592  break;
1593 
1594  case RES_POOLFRM_FRAME:
1595  {
1597  {
1598  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ));
1599  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::LINE_CENTER, text::RelOrientation::PRINT_AREA ) );
1600  aSet.Put( SwFormatSurround( css::text::WrapTextMode_NONE ) );
1601  }
1602  else
1603  {
1604  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA ));
1605  aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL ) );
1606  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::PRINT_AREA ) );
1607  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::PRINT_AREA ) );
1608  Color aCol( COL_BLACK );
1609  SvxBorderLine aLine( &aCol, DEF_LINE_WIDTH_0 );
1610  SvxBoxItem aBox( RES_BOX );
1611  aBox.SetLine( &aLine, SvxBoxItemLine::TOP );
1612  aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM );
1613  aBox.SetLine( &aLine, SvxBoxItemLine::LEFT );
1614  aBox.SetLine( &aLine, SvxBoxItemLine::RIGHT );
1615  aBox.SetAllDistances( 85 );
1616  aSet.Put( aBox );
1617  aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1618  aSet.Put( SvxULSpaceItem( 114, 114, RES_UL_SPACE ) );
1619  }
1620 
1621  // for styles of FlyFrames do not set the FillStyle to make it a derived attribute
1622  aSet.ClearItem(XATTR_FILLSTYLE);
1623  }
1624  break;
1625  case RES_POOLFRM_GRAPHIC:
1626  case RES_POOLFRM_OLE:
1627  {
1628  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA ));
1629  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ));
1630  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
1631  aSet.Put( SwFormatSurround( css::text::WrapTextMode_DYNAMIC ));
1632  }
1633  break;
1634  case RES_POOLFRM_FORMEL:
1635  {
1636  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) );
1637  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::CHAR_CENTER, text::RelOrientation::FRAME ) );
1638  aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1639  }
1640  break;
1641  case RES_POOLFRM_MARGINAL:
1642  {
1643  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA ));
1644  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME ));
1645  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
1646  aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL ));
1647  // Set the default width to 3.5 cm, use the minimum value for the height
1649  GetMetricVal( CM_1 ) * 3 + GetMetricVal( CM_05 ),
1650  MM50 ));
1651  }
1652  break;
1653  case RES_POOLFRM_WATERSIGN:
1654  {
1655  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PAGE ));
1656  aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ));
1657  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME ));
1658  aSet.Put( SvxOpaqueItem( RES_OPAQUE, false ));
1659  aSet.Put( SwFormatSurround( css::text::WrapTextMode_THROUGH ));
1660  }
1661  break;
1662  case RES_POOLFRM_LABEL:
1663  {
1664  aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) );
1665  aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
1666  aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
1667 
1668  SvxProtectItem aProtect( RES_PROTECT );
1669  aProtect.SetSizeProtect( true );
1670  aProtect.SetPosProtect( true );
1671  aSet.Put( aProtect );
1672 
1673  pNewFormat->SetAutoUpdateFormat();
1674  }
1675  break;
1676  }
1677  if( aSet.Count() )
1678  {
1679  pNewFormat->SetFormatAttr( aSet );
1680  }
1681  return pNewFormat;
1682 }
1683 
1685 {
1686  return static_cast<SwFrameFormat*>(GetFormatFromPool( nId ));
1687 }
1688 
1690 {
1691  return static_cast<SwCharFormat*>(GetFormatFromPool( nId ));
1692 }
1693 
1694 SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
1695 {
1696  OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
1697  "Wrong AutoFormat Id" );
1698 
1699  for( size_t n = 0; n < m_rDoc.GetPageDescCnt(); ++n )
1700  {
1701  if ( nId == m_rDoc.GetPageDesc(n).GetPoolFormatId() )
1702  {
1703  return &m_rDoc.GetPageDesc(n);
1704  }
1705  }
1706 
1707  if( RES_POOLPAGE_BEGIN > nId || nId >= RES_POOLPAGE_END )
1708  {
1709  // unknown page pool ID
1710  OSL_ENSURE( false, "<SwDoc::GetPageDescFromPool(..)> - unknown page pool ID" );
1711  nId = RES_POOLPAGE_BEGIN;
1712  }
1713 
1714  SwPageDesc* pNewPgDsc = nullptr;
1715  {
1716  static_assert(SAL_N_ELEMENTS(STR_POOLPAGE_ARY) == RES_POOLPAGE_END - RES_POOLPAGE_BEGIN, "### unexpected size!");
1717  const OUString aNm(SwResId(STR_POOLPAGE_ARY[nId - RES_POOLPAGE_BEGIN]));
1718  const bool bIsModified = m_rDoc.getIDocumentState().IsModified();
1719 
1720  {
1721  ::sw::UndoGuard const undoGuard(m_rDoc.GetIDocumentUndoRedo());
1722  pNewPgDsc = m_rDoc.MakePageDesc(aNm, nullptr, bRegardLanguage);
1723  }
1724 
1725  pNewPgDsc->SetPoolFormatId( nId );
1726  if ( !bIsModified )
1727  {
1729  }
1730  }
1731 
1733  {
1734  aLR.SetLeft( GetMetricVal( CM_1 ) * 2 );
1735  aLR.SetRight( aLR.GetLeft() );
1736  }
1738  {
1739  aUL.SetUpper( static_cast<sal_uInt16>(aLR.GetLeft()) );
1740  aUL.SetLower( static_cast<sal_uInt16>(aLR.GetLeft()) );
1741  }
1742 
1744  bool bSetLeft = true;
1745 
1746  switch( nId )
1747  {
1748  case RES_POOLPAGE_STANDARD: // "Default"
1749  {
1750  aSet.Put( aLR );
1751  aSet.Put( aUL );
1753  }
1754  break;
1755 
1756  case RES_POOLPAGE_FIRST: // "First Page"
1757  case RES_POOLPAGE_REGISTER: // "Index"
1758  {
1759  lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
1760  aSet.Put( aLR );
1761  aSet.Put( aUL );
1762  pNewPgDsc->SetUseOn( UseOnPage::All );
1763  if( RES_POOLPAGE_FIRST == nId )
1765  }
1766  break;
1767 
1768  case RES_POOLPAGE_LEFT: // "Left Page"
1769  {
1770  lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
1771  aSet.Put( aLR );
1772  aSet.Put( aUL );
1773  bSetLeft = false;
1774  pNewPgDsc->SetUseOn( UseOnPage::Left );
1775  // this relies on GetPageDescFromPool() not going into infinite recursion
1776  // (by this point RES_POOLPAGE_LEFT will not reach this place again)
1778  }
1779  break;
1780  case RES_POOLPAGE_RIGHT: // "Right Page"
1781  {
1782  lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
1783  aSet.Put( aLR );
1784  aSet.Put( aUL );
1785  bSetLeft = false;
1786  pNewPgDsc->SetUseOn( UseOnPage::Right );
1788  }
1789  break;
1790 
1791  case RES_POOLPAGE_JAKET: // "Envelope"
1792  {
1794  LandscapeSwap( aPSize );
1795  aSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, aPSize.Width(), aPSize.Height() ));
1796  aLR.SetLeft( 0 ); aLR.SetRight( 0 );
1797  aUL.SetUpper( 0 ); aUL.SetLower( 0 );
1798  aSet.Put( aLR );
1799  aSet.Put( aUL );
1800 
1801  pNewPgDsc->SetUseOn( UseOnPage::All );
1802  pNewPgDsc->SetLandscape( true );
1803  }
1804  break;
1805 
1806  case RES_POOLPAGE_HTML: // "HTML"
1807  {
1808  lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
1809  aLR.SetRight( GetMetricVal( CM_1 ));
1810  aUL.SetUpper( static_cast<sal_uInt16>(aLR.GetRight()) );
1811  aUL.SetLower( static_cast<sal_uInt16>(aLR.GetRight()) );
1812  aSet.Put( aLR );
1813  aSet.Put( aUL );
1814 
1815  pNewPgDsc->SetUseOn( UseOnPage::All );
1816  }
1817  break;
1818 
1819  case RES_POOLPAGE_FOOTNOTE: // "Footnote"
1820  case RES_POOLPAGE_ENDNOTE: // "Endnote"
1821  {
1822  lcl_PutStdPageSizeIntoItemSet( &m_rDoc, aSet );
1823  aSet.Put( aLR );
1824  aSet.Put( aUL );
1825  pNewPgDsc->SetUseOn( UseOnPage::All );
1826  SwPageFootnoteInfo aInf( pNewPgDsc->GetFootnoteInfo() );
1827  aInf.SetLineWidth( 0 );
1828  aInf.SetTopDist( 0 );
1829  aInf.SetBottomDist( 0 );
1830  pNewPgDsc->SetFootnoteInfo( aInf );
1831  }
1832  break;
1833 
1834  case RES_POOLPAGE_LANDSCAPE: // "Landscape"
1835  {
1837  SwFormatFrameSize aFrameSz( pStdPgDsc->GetMaster().GetFrameSize() );
1838  if ( !pStdPgDsc->GetLandscape() )
1839  {
1840  const SwTwips nTmp = aFrameSz.GetHeight();
1841  aFrameSz.SetHeight( aFrameSz.GetWidth() );
1842  aFrameSz.SetWidth( nTmp );
1843  }
1844  aSet.Put( aFrameSz );
1845  aSet.Put( aLR );
1846  aSet.Put( aUL );
1847  pNewPgDsc->SetUseOn( UseOnPage::All );
1848  pNewPgDsc->SetLandscape( true );
1849  }
1850  break;
1851 
1852  }
1853 
1854  if( aSet.Count() )
1855  {
1856  if( bSetLeft )
1857  {
1858  pNewPgDsc->GetLeft().SetFormatAttr( aSet );
1859  pNewPgDsc->GetFirstLeft().SetFormatAttr( aSet );
1860  }
1861  pNewPgDsc->GetMaster().SetFormatAttr( aSet );
1862  pNewPgDsc->GetFirstMaster().SetFormatAttr( aSet );
1863  }
1864  return pNewPgDsc;
1865 }
1866 
1868 {
1869  OSL_ENSURE( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END,
1870  "Wrong AutoFormat Id" );
1871 
1872  SwNumRule* pNewRule;
1873 
1874  for (size_t n = 0; n < m_rDoc.GetNumRuleTable().size(); ++n )
1875  {
1876  if (nId == ( pNewRule = m_rDoc.GetNumRuleTable()[ n ] )->GetPoolFormatId())
1877  {
1878  return pNewRule;
1879  }
1880  }
1881 
1882  // error: unknown Pool style
1883  if( RES_POOLNUMRULE_BEGIN > nId || nId >= RES_POOLNUMRULE_END )
1884  {
1885  OSL_ENSURE( false, "invalid Id" );
1886  nId = RES_POOLNUMRULE_BEGIN;
1887  }
1888 
1889  static_assert(SAL_N_ELEMENTS(STR_POOLNUMRULE_NUM_ARY) == RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN, "### unexpected size!");
1890  OUString aNm(SwResId(STR_POOLNUMRULE_NUM_ARY[nId - RES_POOLNUMRULE_BEGIN]));
1891 
1892  SwCharFormat *pNumCFormat = nullptr, *pBullCFormat = nullptr;
1893 
1894  const SvxNumberFormat::SvxNumPositionAndSpaceMode eNumberFormatPositionAndSpaceMode
1896  {
1897  bool bIsModified = m_rDoc.getIDocumentState().IsModified();
1898 
1899  sal_uInt16 n = m_rDoc.MakeNumRule( aNm, nullptr, false, eNumberFormatPositionAndSpaceMode );
1900 
1901  pNewRule = m_rDoc.GetNumRuleTable()[ n ];
1902  pNewRule->SetPoolFormatId( nId );
1903  pNewRule->SetAutoRule( false );
1904 
1905  if( RES_POOLNUMRULE_NUM1 <= nId && nId <= RES_POOLNUMRULE_NUM5 )
1907 
1908  if( ( RES_POOLNUMRULE_BUL1 <= nId && nId <= RES_POOLNUMRULE_BUL5 ) ||
1909  RES_POOLNUMRULE_NUM5 == nId )
1910  pBullCFormat = GetCharFormatFromPool( RES_POOLCHR_NUM_LEVEL );
1911 
1912  if( !bIsModified )
1914  }
1915 
1916  switch( nId )
1917  {
1918  case RES_POOLNUMRULE_NUM1:
1919  {
1920  SwNumFormat aFormat;
1921  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
1923  aFormat.SetCharFormat( pNumCFormat );
1924  aFormat.SetStart( 1 );
1925  aFormat.SetIncludeUpperLevels( 1 );
1926  aFormat.SetSuffix( "." );
1927 
1928  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
1929  {
1930 // cm: 0.7 cm intervals, with 1 cm = 567
1931  397, 794, 1191, 1588, 1985, 2381, 2778, 3175, 3572, 3969
1932  };
1933  const sal_uInt16* pArr = aAbsSpace;
1934 
1935  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1936  {
1937  aFormat.SetFirstLineOffset( - (*pArr) );
1938  }
1939  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1940  {
1942  aFormat.SetFirstLineIndent( - (*pArr) );
1943  }
1944 
1945  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
1946  {
1947  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1948  {
1949  aFormat.SetAbsLSpace( *pArr + 357 ); // 357 is indent of 0.63 cm
1950  }
1951  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1952  {
1953  aFormat.SetListtabPos( *pArr );
1954  aFormat.SetIndentAt( *pArr + 357 );
1955  }
1956 
1957  pNewRule->Set( n, aFormat );
1958  }
1959  }
1960  break;
1961 
1962  case RES_POOLNUMRULE_NUM2:
1963  {
1964  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
1965  {
1966  397, 397, 397, 397, // 0.70 cm intervals
1967  397, 397, 397, 397,
1968  397, 397
1969  };
1970 
1971  const sal_uInt16* pArr = aAbsSpace;
1972  SwNumFormat aFormat;
1973 
1974  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
1976  aFormat.SetCharFormat( pNumCFormat );
1977  aFormat.SetStart( 1 );
1978  aFormat.SetIncludeUpperLevels( 1 );
1979  aFormat.SetSuffix( "." );
1980 
1981  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1982  {
1984  }
1985 
1986  sal_uInt16 nSpace = 357; // indent of 0.63 cm
1987  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
1988  {
1989  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
1990  {
1991  nSpace += pArr[ n ];
1992  aFormat.SetAbsLSpace( nSpace );
1993  aFormat.SetFirstLineOffset( - pArr[ n ] );
1994  }
1995  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
1996  {
1997  nSpace += pArr[ n ];
1998  aFormat.SetListtabPos( nSpace );
1999  aFormat.SetIndentAt( nSpace );
2000  aFormat.SetFirstLineIndent( - pArr[ n ] );
2001  }
2002 
2003  pNewRule->Set( n, aFormat );
2004  }
2005  }
2006  break;
2007  case RES_POOLNUMRULE_NUM3:
2008  {
2009  SwNumFormat aFormat;
2010 
2011  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2013  aFormat.SetCharFormat( pNumCFormat );
2014  aFormat.SetStart( 1 );
2015  aFormat.SetIncludeUpperLevels( 1 );
2016  aFormat.SetSuffix( "." );
2017 
2018  long const nOffs = 397; // 0.70 cm
2019 
2020  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2021  {
2022  aFormat.SetFirstLineOffset( - nOffs );
2023  }
2024  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2025  {
2027  aFormat.SetFirstLineIndent( - nOffs );
2028  }
2029 
2030  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
2031  {
2032  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2033  {
2034  aFormat.SetAbsLSpace( (n+1) * nOffs + 357 ); // 357 is indent of 0.63 cm
2035  }
2036  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2037  {
2038  long nPos = (n+1) * nOffs;
2039  aFormat.SetListtabPos(nPos + 357);
2040  aFormat.SetIndentAt(nPos + 357);
2041  }
2042 
2043  pNewRule->Set( n, aFormat );
2044  }
2045  }
2046  break;
2047  case RES_POOLNUMRULE_NUM4:
2048  {
2049  SwNumFormat aFormat;
2050 
2051  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2053  aFormat.SetCharFormat( pNumCFormat );
2054  aFormat.SetStart( 1 );
2055  aFormat.SetIncludeUpperLevels( 1 );
2056  aFormat.SetSuffix( "." );
2057  aFormat.SetNumAdjust( SvxAdjust::Right );
2058 
2059  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2060  {
2061 // cm: 1.33 cm intervals
2062  754, 1508, 1191, 2262, 3016, 3771, 4525, 5279, 6033, 6787
2063  };
2064  const sal_uInt16* pArr = aAbsSpace;
2065 
2066  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2067  {
2068  aFormat.SetFirstLineOffset( 580 - (*pArr) ); // 1 cm space
2069  }
2070  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2071  {
2073  aFormat.SetFirstLineIndent( 580 - (*pArr) );
2074  }
2075 
2076  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2077  {
2078 
2079  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2080  {
2081  aFormat.SetAbsLSpace( *pArr );
2082  }
2083  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2084  {
2085  aFormat.SetListtabPos( *pArr );
2086  aFormat.SetIndentAt( *pArr );
2087  }
2088 
2089  pNewRule->Set( n, aFormat );
2090  }
2091  }
2092  break;
2093  case RES_POOLNUMRULE_NUM5:
2094  {
2095  // [ First, LSpace ]
2096  static const sal_uInt16 aAbsSpace0to2[] =
2097  {
2098  174, 754, // 0.33, 1.33,
2099  567, 1151, // 1.03, 2.03,
2100  397, 1548 // 2.03, 2.73
2101  };
2102 
2103  const sal_uInt16* pArr0to2 = aAbsSpace0to2;
2104  SwNumFormat aFormat;
2105 
2106  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2108  aFormat.SetStart( 1 );
2109  aFormat.SetIncludeUpperLevels( 1 );
2110  aFormat.SetSuffix( "." );
2111  aFormat.SetNumAdjust( SvxAdjust::Right );
2112 
2113  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2114  {
2116  }
2117 
2118  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2119  {
2120  aFormat.SetFirstLineOffset( -pArr0to2[0] ); // == 0.33 cm
2121  aFormat.SetAbsLSpace( pArr0to2[1] ); // == 1.33 cm
2122  }
2123  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2124  {
2125  aFormat.SetFirstLineIndent( -pArr0to2[0] );
2126  aFormat.SetListtabPos( pArr0to2[1] );
2127  aFormat.SetIndentAt( pArr0to2[1] );
2128  }
2129 
2130  aFormat.SetCharFormat( pNumCFormat );
2131  pNewRule->Set( 0, aFormat );
2132 
2133  aFormat.SetIncludeUpperLevels( 1 );
2134  aFormat.SetStart( 1 );
2135 
2136  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2137  {
2138  aFormat.SetFirstLineOffset( -pArr0to2[2] ); // == 1.03 cm
2139  aFormat.SetAbsLSpace( pArr0to2[3] ); // == 2.03 cm
2140  }
2141  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2142  {
2143  aFormat.SetFirstLineIndent( -pArr0to2[2] );
2144  aFormat.SetListtabPos( pArr0to2[3] );
2145  aFormat.SetIndentAt( pArr0to2[3] );
2146  }
2147 
2148  pNewRule->Set( 1, aFormat );
2149 
2151  aFormat.SetSuffix(OUString(u')'));
2152  aFormat.SetIncludeUpperLevels( 1 );
2153  aFormat.SetStart( 3 );
2154 
2155  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2156  {
2157  aFormat.SetFirstLineOffset( - pArr0to2[4] ); // == 2.03 cm
2158  aFormat.SetAbsLSpace( pArr0to2[5] ); // == 2.73 cm
2159  }
2160  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2161  {
2162  aFormat.SetFirstLineIndent( -pArr0to2[4] );
2163  aFormat.SetListtabPos( pArr0to2[5] );
2164  aFormat.SetIndentAt( pArr0to2[5] );
2165  }
2166 
2167  pNewRule->Set( 2, aFormat );
2168 
2170  aFormat.SetCharFormat( pBullCFormat );
2172  aFormat.SetBulletChar( cBulletChar );
2173  sal_Int16 nOffs = GetMetricVal( CM_01 ) * 4,
2174  nOffs2 = GetMetricVal( CM_1 ) * 2;
2175 
2176  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2177  {
2178  aFormat.SetFirstLineOffset( - nOffs );
2179  }
2180  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2181  {
2182  aFormat.SetFirstLineIndent( - nOffs );
2183  }
2184 
2185  aFormat.SetSuffix( OUString() );
2186  for (sal_uInt16 n = 3; n < MAXLEVEL; ++n)
2187  {
2188  aFormat.SetStart( n+1 );
2189 
2190  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2191  {
2192  aFormat.SetAbsLSpace( nOffs2 + ((n-3) * nOffs) );
2193  }
2194  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2195  {
2196  long nPos = nOffs2 + ((n-3) * static_cast<long>(nOffs));
2197  aFormat.SetListtabPos(nPos);
2198  aFormat.SetIndentAt(nPos);
2199  }
2200 
2201  pNewRule->Set( n, aFormat );
2202  }
2203  }
2204  break;
2205 
2206  case RES_POOLNUMRULE_BUL1:
2207  {
2208  SwNumFormat aFormat;
2209 
2210  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2212  aFormat.SetCharFormat( pBullCFormat );
2213  aFormat.SetStart( 1 );
2214  aFormat.SetIncludeUpperLevels( 1 );
2216  aFormat.SetBulletChar( cBulletChar );
2217 
2218  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2219  {
2220 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
2221  227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
2222  };
2223  const sal_uInt16* pArr = aAbsSpace;
2224 
2225  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2226  {
2227  aFormat.SetFirstLineOffset( - (*pArr) );
2228  }
2229  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2230  {
2232  aFormat.SetFirstLineIndent( - (*pArr) );
2233  }
2234 
2235  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2236  {
2237  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2238  {
2239  aFormat.SetAbsLSpace( *pArr );
2240  }
2241  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2242  {
2243  aFormat.SetListtabPos( *pArr );
2244  aFormat.SetIndentAt( *pArr );
2245  }
2246 
2247  pNewRule->Set( n, aFormat );
2248  }
2249  }
2250  break;
2251  case RES_POOLNUMRULE_BUL2:
2252  {
2253  SwNumFormat aFormat;
2254 
2255  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2257  aFormat.SetCharFormat( pBullCFormat );
2258  aFormat.SetStart( 1 );
2259  aFormat.SetIncludeUpperLevels( 1 );
2261  aFormat.SetBulletChar( 0x2013 );
2262 
2263  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2264  {
2265 // cm: 0,3 0,6 0,9 1,2 1,5 1,8 2,1 2,4 2,7 3,0
2266  170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701
2267  };
2268  const sal_uInt16* pArr = aAbsSpace;
2269 
2270  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2271  {
2272  aFormat.SetFirstLineOffset( - (*pArr) );
2273  }
2274  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2275  {
2277  aFormat.SetFirstLineIndent( - (*pArr) );
2278  }
2279 
2280  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2281  {
2282  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2283  {
2284  aFormat.SetAbsLSpace( *pArr );
2285  }
2286  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2287  {
2288  aFormat.SetListtabPos( *pArr );
2289  aFormat.SetIndentAt( *pArr );
2290  }
2291 
2292  pNewRule->Set( n, aFormat );
2293  }
2294  }
2295  break;
2296  case RES_POOLNUMRULE_BUL3:
2297  {
2298  SwNumFormat aFormat;
2299 
2300  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2301 
2303  aFormat.SetCharFormat( pBullCFormat );
2304  aFormat.SetStart( 1 );
2305  aFormat.SetIncludeUpperLevels( 1 );
2307 
2308  sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4;
2309 
2310  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2311  {
2312  aFormat.SetFirstLineOffset( - nOffs );
2313  }
2314  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2315  {
2317  aFormat.SetFirstLineIndent( - nOffs );
2318  }
2319 
2320  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
2321  {
2322  aFormat.SetBulletChar( (n & 1) ? 0x25a1 : 0x2611 );
2323 
2324  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2325  {
2326  aFormat.SetAbsLSpace( ((n & 1) +1) * nOffs );
2327  }
2328  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2329  {
2330  long nPos = ((n & 1) +1) * static_cast<long>(nOffs);
2331  aFormat.SetListtabPos(nPos);
2332  aFormat.SetIndentAt(nPos);
2333  }
2334 
2335  pNewRule->Set( n, aFormat );
2336  }
2337  }
2338  break;
2339  case RES_POOLNUMRULE_BUL4:
2340  {
2341  SwNumFormat aFormat;
2342 
2343  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2345  aFormat.SetCharFormat( pBullCFormat );
2346  aFormat.SetStart( 1 );
2347  aFormat.SetIncludeUpperLevels( 1 );
2349 
2350  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2351  {
2352 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
2353  227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
2354  };
2355 
2356  const sal_uInt16* pArr = aAbsSpace;
2357 
2358  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2359  {
2360  aFormat.SetFirstLineOffset( - (*pArr) );
2361  }
2362  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2363  {
2365  aFormat.SetFirstLineIndent( - (*pArr) );
2366  }
2367 
2368  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2369  {
2370  switch( n )
2371  {
2372  case 0: aFormat.SetBulletChar( 0x27a2 ); break;
2373  case 1: aFormat.SetBulletChar( 0xE006 ); break;
2374  default: aFormat.SetBulletChar( 0xE004 ); break;
2375  }
2376 
2377  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2378  {
2379  aFormat.SetAbsLSpace( *pArr );
2380  }
2381  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2382  {
2383  aFormat.SetListtabPos( *pArr );
2384  aFormat.SetIndentAt( *pArr );
2385  }
2386 
2387  pNewRule->Set( n, aFormat );
2388  }
2389  }
2390  break;
2391  case RES_POOLNUMRULE_BUL5:
2392  {
2393  SwNumFormat aFormat;
2394 
2395  aFormat.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
2397  aFormat.SetCharFormat( pBullCFormat );
2398  aFormat.SetStart( 1 );
2399  aFormat.SetIncludeUpperLevels( 1 );
2400  aFormat.SetBulletChar( 0x2717 );
2402 
2403  static const sal_uInt16 aAbsSpace[ MAXLEVEL ] =
2404  {
2405 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
2406  227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
2407  };
2408  const sal_uInt16* pArr = aAbsSpace;
2409 
2410  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2411  {
2412  aFormat.SetFirstLineOffset( - (*pArr) );
2413  }
2414  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2415  {
2417  aFormat.SetFirstLineIndent( - (*pArr) );
2418  }
2419 
2420  for (sal_uInt16 n = 0; n < MAXLEVEL; ++n, ++pArr)
2421  {
2422  if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
2423  {
2424  aFormat.SetAbsLSpace( *pArr );
2425  }
2426  else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2427  {
2428  aFormat.SetListtabPos( *pArr );
2429  aFormat.SetIndentAt( *pArr );
2430  }
2431 
2432  pNewRule->Set( n, aFormat );
2433  }
2434  }
2435  break;
2436  }
2437 
2438  return pNewRule;
2439 }
2440 
2443 {
2444  OSL_ENSURE(
2445  (RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
2449  (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) ||
2451  "Wrong AutoFormat Id" );
2452 
2453  SwTextFormatColl* pNewColl = nullptr;
2454  bool bFnd = false;
2455  for( SwTextFormatColls::size_type n = 0; !bFnd && n < m_rDoc.GetTextFormatColls()->size(); ++n )
2456  {
2457  pNewColl = (*m_rDoc.GetTextFormatColls())[ n ];
2458  if( nId == pNewColl->GetPoolFormatId() )
2459  bFnd = true;
2460  }
2461 
2462  if( !bFnd || !pNewColl->HasWriterListeners() )
2463  return false;
2464 
2465  SwAutoFormatGetDocNode aGetHt( &m_rDoc.GetNodes() );
2466  return !pNewColl->GetInfo( aGetHt );
2467 }
2468 
2471 {
2472  const SwFormat *pNewFormat = nullptr;
2473  const SwFormatsBase* pArray[ 2 ];
2474  sal_uInt16 nArrCnt = 1;
2475  bool bFnd = true;
2476 
2477  if (RES_POOLCHR_BEGIN <= nId && nId < RES_POOLCHR_END)
2478  {
2479  pArray[0] = m_rDoc.GetCharFormats();
2480  }
2481  else if (RES_POOLFRM_BEGIN <= nId && nId < RES_POOLFRM_END)
2482  {
2483  pArray[0] = m_rDoc.GetFrameFormats();
2484  pArray[1] = m_rDoc.GetSpzFrameFormats();
2485  nArrCnt = 2;
2486  }
2487  else
2488  {
2489  SAL_WARN("sw.core", "Invalid Pool Id: " << nId << " should be within "
2490  "[" << int(RES_POOLCHR_BEGIN) << "," << int(RES_POOLCHR_END) << ") or "
2491  "[" << int(RES_POOLFRM_BEGIN) << "," << int(RES_POOLFRM_END) << ")");
2492  bFnd = false;
2493  }
2494 
2495  if( bFnd )
2496  {
2497  bFnd = false;
2498  while( nArrCnt-- && !bFnd )
2499  for( size_t n = 0; !bFnd && n < (*pArray[nArrCnt]).GetFormatCount(); ++n )
2500  if( nId == ( pNewFormat = (*pArray[ nArrCnt ] ).GetFormat( n ) )->
2501  GetPoolFormatId() )
2502  bFnd = true;
2503  }
2504 
2505  // Not found or no dependencies?
2506  if( bFnd && pNewFormat->HasWriterListeners() )
2507  {
2508  // Check if we have dependent ContentNodes in the Nodes array
2509  // (also indirect ones for derived Formats)
2510  SwAutoFormatGetDocNode aGetHt( &m_rDoc.GetNodes() );
2511  bFnd = !pNewFormat->GetInfo( aGetHt );
2512  }
2513  else
2514  bFnd = false;
2515 
2516  return bFnd;
2517 }
2518 
2521 {
2522  OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
2523  "Wrong AutoFormat Id" );
2524  SwPageDesc *pNewPgDsc = nullptr;
2525  bool bFnd = false;
2526  for( size_t n = 0; !bFnd && n < m_rDoc.GetPageDescCnt(); ++n )
2527  {
2528  pNewPgDsc = &m_rDoc.GetPageDesc(n);
2529  if( nId == pNewPgDsc->GetPoolFormatId() )
2530  bFnd = true;
2531  }
2532 
2533  // Not found or no dependencies?
2534  if( !bFnd || !pNewPgDsc->HasWriterListeners() ) // ??????
2535  return false;
2536 
2537  // Check if we have dependent ContentNodes in the Nodes array
2538  // (also indirect ones for derived Formats)
2539  SwAutoFormatGetDocNode aGetHt( &m_rDoc.GetNodes() );
2540  return !pNewPgDsc->GetInfo( aGetHt );
2541 }
2542 
2544 {
2545 }
2546 
2547 }
2548 
2549 static std::vector<OUString>
2550 lcl_NewUINameArray(const char** pIds, const size_t nLen, const size_t nSvxIds = 0)
2551 {
2552  assert(nSvxIds <= nLen);
2553  const size_t nWriterIds = nLen - nSvxIds;
2554  std::vector<OUString> aNameArray;
2555  aNameArray.reserve(nLen);
2556  for (size_t i = 0; i < nWriterIds; ++i)
2557  aNameArray.push_back(SwResId(pIds[i]));
2558  for (size_t i = nWriterIds; i < nLen; ++i)
2559  aNameArray.push_back(SvxResId(pIds[i]));
2560  return aNameArray;
2561 }
2562 
2563 const std::vector<OUString>& SwStyleNameMapper::GetTextUINameArray()
2564 {
2565  static const std::vector<OUString> s_aTextUINameArray(
2566  lcl_NewUINameArray(STR_POOLCOLL_TEXT_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_TEXT_ARY)));
2567  return s_aTextUINameArray;
2568 }
2569 
2570 const std::vector<OUString>& SwStyleNameMapper::GetListsUINameArray()
2571 {
2572  static const std::vector<OUString> s_aListsUINameArray(
2573  lcl_NewUINameArray(STR_POOLCOLL_LISTS_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_LISTS_ARY)));
2574  return s_aListsUINameArray;
2575 }
2576 
2577 const std::vector<OUString>& SwStyleNameMapper::GetExtraUINameArray()
2578 {
2579  static const std::vector<OUString> s_aExtraUINameArray(
2581  return s_aExtraUINameArray;
2582 }
2583 
2584 const std::vector<OUString>& SwStyleNameMapper::GetRegisterUINameArray()
2585 {
2586  static const std::vector<OUString> s_aRegisterUINameArray(
2587  lcl_NewUINameArray(STR_POOLCOLL_REGISTER_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_REGISTER_ARY)));
2588  return s_aRegisterUINameArray;
2589 }
2590 
2591 const std::vector<OUString>& SwStyleNameMapper::GetDocUINameArray()
2592 {
2593  static const std::vector<OUString> s_aDocUINameArray(
2594  lcl_NewUINameArray(STR_POOLCOLL_DOC_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_DOC_ARY)));
2595  return s_aDocUINameArray;
2596 }
2597 
2598 const std::vector<OUString>& SwStyleNameMapper::GetHTMLUINameArray()
2599 {
2600  static const std::vector<OUString> s_aHTMLUINameArray(
2601  lcl_NewUINameArray(STR_POOLCOLL_HTML_ARY, SAL_N_ELEMENTS(STR_POOLCOLL_HTML_ARY)));
2602  return s_aHTMLUINameArray;
2603 }
2604 
2605 const std::vector<OUString>& SwStyleNameMapper::GetFrameFormatUINameArray()
2606 {
2607  static const std::vector<OUString> s_aFrameFormatUINameArray(
2608  lcl_NewUINameArray(STR_POOLFRM_ARY, SAL_N_ELEMENTS(STR_POOLFRM_ARY)));
2609  return s_aFrameFormatUINameArray;
2610 }
2611 
2612 const std::vector<OUString>& SwStyleNameMapper::GetChrFormatUINameArray()
2613 {
2614  static const std::vector<OUString> s_aChrFormatUINameArray(
2615  lcl_NewUINameArray(STR_POOLCHR_ARY, SAL_N_ELEMENTS(STR_POOLCHR_ARY)));
2616  return s_aChrFormatUINameArray;
2617 }
2618 
2620 {
2621  static const std::vector<OUString> s_aHTMLChrFormatUINameArray(
2622  lcl_NewUINameArray(STR_POOLCHR_HTML_ARY, SAL_N_ELEMENTS(STR_POOLCHR_HTML_ARY)));
2623  return s_aHTMLChrFormatUINameArray;
2624 }
2625 
2626 const std::vector<OUString>& SwStyleNameMapper::GetPageDescUINameArray()
2627 {
2628  static const std::vector<OUString> s_aPageDescUINameArray(
2629  lcl_NewUINameArray(STR_POOLPAGE_ARY, SAL_N_ELEMENTS(STR_POOLPAGE_ARY)));
2630  return s_aPageDescUINameArray;
2631 }
2632 
2633 const std::vector<OUString>& SwStyleNameMapper::GetNumRuleUINameArray()
2634 {
2635  static const std::vector<OUString> s_aNumRuleUINameArray(
2636  lcl_NewUINameArray(STR_POOLNUMRULE_NUM_ARY, SAL_N_ELEMENTS(STR_POOLNUMRULE_NUM_ARY)));
2637  return s_aNumRuleUINameArray;
2638 }
2639 
2640 const std::vector<OUString>& SwStyleNameMapper::GetTableStyleUINameArray()
2641 {
2642  static const std::vector<OUString> s_aTableStyleUINameArray(
2643  // 1 Writer resource string (XXX if this ever changes rather use offset math)
2644  lcl_NewUINameArray(STR_TABSTYLE_ARY, SAL_N_ELEMENTS(STR_TABSTYLE_ARY),
2645  static_cast<size_t>(SAL_N_ELEMENTS(STR_TABSTYLE_ARY) - 1)));
2646  return s_aTableStyleUINameArray;
2647 }
2648 
2649 /* 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
#define RES_CHRATR_WEIGHT
Definition: hintids.hxx:177
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
bool Insert(const SvxTabStop &rTab)
void SetLabelFollowedBy(const LabelFollowedBy eLabelFollowedBy)
void SetUseOn(UseOnPage eNew)
Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified.
Definition: pagedesc.hxx:320
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:587
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL5S
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL3S
Group HTML-styles.
Definition: poolfmt.hxx:430
static sal_uInt16 GetBullIndent(sal_uInt8 nLvl)
Definition: number.cxx:165
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
Subgroup numberings.
Definition: poolfmt.hxx:281
static const std::vector< OUString > & GetListsUINameArray()
static const char * STR_POOLCOLL_EXTRA_ARY[]
#define RES_CHRATR_CJK_LANGUAGE
Definition: hintids.hxx:186
Footnote at end of document.
Definition: poolfmt.hxx:178
const OUString & GetFamilyName() const
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL1S
SwFrameFormat & GetLeft()
Definition: pagedesc.hxx:218
#define LANGUAGE_ARABIC_SAUDI_ARABIA
#define LINE_SPACE_DEFAULT_HEIGHT
#define RES_CHRATR_FONTSIZE
Definition: hintids.hxx:170
static const std::vector< OUString > & GetTableStyleUINameArray()
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL1S
#define RES_CHRATR_LANGUAGE
Definition: hintids.hxx:172
Group chapter / document.
Definition: poolfmt.hxx:421
#define LANGUAGE_ENGLISH_US
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL3E
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL3
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL3E
void SetAutoRule(bool bFlag)
Definition: numrule.hxx: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
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM5
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
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:438
Main entry in indices.
Definition: poolfmt.hxx:127
const short lNumberFirstLineOffset
Definition: swtypes.hxx:114
NumRule Bullets 3.
Definition: poolfmt.hxx:196
Subgroup user indices.
Definition: poolfmt.hxx:382
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL4S
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:399
SVX_NUM_CHARS_UPPER_LETTER
SwFrameFormat & GetFirstMaster()
Definition: pagedesc.hxx:219
#define LANGUAGE_KOREAN
Doc. subtitle.
Definition: poolfmt.hxx:424
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true) override
Return "Auto-Collection with ID.
Special ranges.
Definition: poolfmt.hxx:327
sal_Int64 n
Objects all levels.
Definition: poolfmt.hxx:401
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL5E
Start 2nd level.
Definition: poolfmt.hxx:307
Definition: doc.hxx:186
Vertical numbering symbols.
Definition: poolfmt.hxx:131
const sal_Unicode cBulletChar
Character for lists.
Definition: numrule.hxx:47
Content 1st level.
Definition: poolfmt.hxx:375
sal_uInt16 GetPoolParent(sal_uInt16 nId)
Query defined parent of a POOL-ID Returns 0 if standard USHRT_MAX if no parent the parent in all othe...
Definition: poolfmt.cxx:143
#define RES_CHRATR_FONT
Definition: hintids.hxx:169
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.
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:143
#define RES_CHRATR_CJK_FONT
Definition: hintids.hxx:184
#define RES_CHRATR_CJK_FONTSIZE
Definition: hintids.hxx:185
void SetIncludeUpperLevels(sal_uInt8 nSet)
SwFormat * MakeFrameFormat_(const OUString &, SwFormat *, bool, bool)
Definition: docfmt.cxx:833
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:329
Tables all levels.
Definition: poolfmt.hxx:405
bool HasWriterListeners() const
Definition: calbck.hxx:208
#define RES_PROTECT
Definition: hintids.hxx:300
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:741
static const std::vector< OUString > & GetPageDescUINameArray()
sal_uInt16 const aTextFormatCollSetRange[]
Definition: init.cxx:150
Value in Var-direction gives minimum (can be exceeded but not be less).
void SetFollow(const SwPageDesc *pNew)
Definition: pagedesc.hxx:293
FontFamily GetFamilyType()
Landscape page style.
Definition: poolfmt.hxx:180
Content 5th level.
Definition: poolfmt.hxx:379
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM4
static const char * STR_POOLCHR_ARY[]
WEIGHT_BOLD
static const std::vector< OUString > & GetDocUINameArray()
const SwPageFootnoteInfo & GetFootnoteInfo() const
Definition: pagedesc.hxx:196
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:109
const SwCharFormat * GetDfltCharFormat() const
Definition: doc.hxx:750
void SetLeft(const long nL, const sal_uInt16 nProp=100)
void SetPropLineSpace(const sal_uInt16 nProp)
provides some methods for generic operations on lists that contain SwFormat* subclasses.
Definition: docary.hxx:43
void SetFootnoteInfo(const SwPageFootnoteInfo &rNew)
Definition: pagedesc.hxx:198
LINESTYLE_NONE
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL5E
OUString SvxResId(const char *pId)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUMBER_BULLET_BASE
void SetPoolFormatId(sal_uInt16 nId)
Definition: format.hxx:144
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
Definition: pagedesc.hxx:254
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:425
const SwTextFormatColl * GetDfltTextFormatColl() const
Definition: doc.hxx:775
Subgroup header.
Definition: poolfmt.hxx:330
void SetLandscape(bool bNew)
Definition: pagedesc.hxx:191
constexpr::Color COL_CYAN(0x00, 0x80, 0x80)
void SetNextTextFormatColl(SwTextFormatColl &rNext)
Inline implementations.
Definition: fmtcol.hxx:228
#define RES_PARATR_TABSTOP
Definition: hintids.hxx:260
SwFormat * MakeCharFormat_(const OUString &, SwFormat *, bool, bool)
Definition: docfmt.cxx:866
void SetAllScriptItem(SfxItemSet &rSet, const SfxPoolItem &rItem)
Definition: poolfmt.cxx:39
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
Definition: docfmt.cxx:652
SVX_NUM_ARABIC
No numbering.
Definition: poolfmt.hxx:292
Content 6th level.
Definition: poolfmt.hxx:389
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL1E
SVX_NUM_ROMAN_UPPER
#define RES_UL_SPACE
Definition: hintids.hxx:292
#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:163
#define DFLT_ESC_PROP
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM1
Authorities all levels.
Definition: poolfmt.hxx:409
const sal_uInt16 POOLGRP_NOCOLLID
POOLCOLL-IDs: +-—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ !User! Range ! 0 ! Offset ! +-—+—+...
Definition: poolfmt.hxx:59
Other stuff.
Definition: poolfmt.hxx:352
void SetPoolFormatId(sal_uInt16 nId)
Definition: numrule.hxx: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.
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM2
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
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:165
NumRule Bullets 2.
Definition: poolfmt.hxx:195
virtual SvxULSpaceItem * Clone(SfxItemPool *pPool=nullptr) const override
void SetRight(const long nR, const sal_uInt16 nProp=100)
void SetListtabPos(const long nListtabPos)
Start 3rd level.
Definition: poolfmt.hxx:311
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL2S
Style of a layout element.
Definition: frmfmt.hxx:57
SVX_NUM_CHARS_LOWER_LETTER
Footnote anchor.
Definition: poolfmt.hxx:128
FontPitch GetPitch()
HTML-styles.
Definition: poolfmt.hxx:135
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)
void SetTextFirstLineOffsetValue(const short nValue)
#define RES_CHRATR_CTL_FONT
Definition: hintids.hxx:189
Internet visited.
Definition: poolfmt.hxx:122
int i
void SetBulletFont(const vcl::Font *pFont)
sal_Int32 GetAbsLSpace() const
No numbering.
Definition: poolfmt.hxx:288
End 5th level.
Definition: poolfmt.hxx:299
No numbering.
Definition: poolfmt.hxx:296
Marginalia.
Definition: poolfmt.hxx:159
First page.
Definition: poolfmt.hxx:172
std::vector< SwTextFormatColl * >::size_type size_type
Definition: docary.hxx:63
Subgroup headings.
Definition: poolfmt.hxx:261
Subgroup footer.
Definition: poolfmt.hxx:336
NumRule Numbering IVX.
Definition: poolfmt.hxx:192
virtual bool IsModified() const =0
Changes of document?
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
Definition: number.cxx:1280
End 2nd level.
Definition: poolfmt.hxx:287
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:880
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL1
void SetAuto(bool bNew)
Definition: format.hxx:159
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL1
bool GetLandscape() const
Definition: pagedesc.hxx:190
Text body.
Definition: poolfmt.hxx:251
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
Definition: docdesc.cxx:639
NumRule Numbering ABC.
Definition: poolfmt.hxx:190
FlyAnchors.
Definition: fmtanchr.hxx:34
Jump from index.
Definition: poolfmt.hxx:124
End 4th level.
Definition: poolfmt.hxx:295
bool IsConditionalByPoolId(sal_uInt16 nId)
const SvxPageUsage aArr[]
const short lBulletFirstLineOffset
Definition: swtypes.hxx:112
#define RES_PARATR_ORPHANS
Definition: hintids.hxx:258
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
#define RES_PARATR_SCRIPTSPACE
Definition: hintids.hxx:265
size_t GetPageDescCnt() const
Definition: doc.hxx:879
Internet normal.
Definition: poolfmt.hxx:121
LINESTYLE_SINGLE
float u
size_t size() const
Definition: docary.hxx:84
Header Left&Right.
Definition: poolfmt.hxx:331
void SetBulletChar(sal_Unicode cSet)
Header Right.
Definition: poolfmt.hxx:333
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:393
#define LANGUAGE_DONTKNOW
#define RES_CHRATR_UNDERLINE
Definition: hintids.hxx:176
Endnote anchor.
Definition: poolfmt.hxx:129
Label drawing objects.
Definition: poolfmt.hxx:358
Subgroup bullets.
Definition: poolfmt.hxx:303
#define RES_CHRATR_ESCAPEMENT
Definition: hintids.hxx:168
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
static sal_uInt16 GetNumIndent(sal_uInt8 nLvl)
Definition: number.cxx:159
void SetPoolFormatId(sal_uInt16 const nId)
Definition: pagedesc.hxx:255
#define XATTR_FILLSTYLE
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL2
PDFDocument & m_rDoc
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL2E
SfxItemPool * GetPool() const
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL1E
Left page.
Definition: poolfmt.hxx:173
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL2E
#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
Frame cannot be moved in Var-direction.
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:98
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM2
#define RES_LR_SPACE
Definition: hintids.hxx:291
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:744
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:594
user index 6..10.
Definition: poolfmt.hxx:412
Endnote page.
Definition: poolfmt.hxx:179
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL2S
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL4E
Size & LandscapeSwap(Size &rSize)
sal_uInt16 const aFrameFormatSetRange[]
Definition: init.cxx:234
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
static const std::vector< OUString > & GetNumRuleUINameArray()
illustrations index.
Definition: poolfmt.hxx:396
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:77
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL3
virtual SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId) override
Return required automatic format.
#define RES_CHRATR_EMPHASIS_MARK
Definition: hintids.hxx:195
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
#define RES_CHRATR_ROTATE
Definition: hintids.hxx:194
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static const std::vector< OUString > & GetHTMLChrFormatUINameArray()
Content 9th level.
Definition: poolfmt.hxx:392
const SvxULSpaceItem & GetULSpace(bool=true) const
Definition: frmatr.hxx:76
void SetSizeProtect(bool bNew)
Footnote information.
Definition: pagedesc.hxx:48
static const std::vector< OUString > & GetChrFormatUINameArray()
void Set(sal_uInt16 i, const SwNumFormat *)
Definition: number.cxx:585
Doc. appendix.
Definition: poolfmt.hxx:425
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:271
Start 5th level.
Definition: poolfmt.hxx:319
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL5
static const std::vector< OUString > & GetExtraUINameArray()
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:737
void SetPosProtect(bool bNew)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL4
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
Definition: number.cxx:1402
#define MM50
Definition: swtypes.hxx:59
#define CM_05
static const char * STR_POOLNUMRULE_NUM_ARY[]
NumRule Numbering 123.
Definition: poolfmt.hxx:189
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:777
ITALIC_NORMAL
#define RES_CHRATR_CTL_LANGUAGE
Definition: hintids.hxx:191
unsigned char sal_uInt8
#define RES_CHRATR_POSTURE
Definition: hintids.hxx:173
virtual bool GetInfo(SfxPoolItem &) const override
Query information from Client.
Definition: pagedesc.cxx:180
LINESTYLE_DOTTED
void SetFirstLineOffset(sal_Int32 nSet)
Right page.
Definition: poolfmt.hxx:174
SwFrameFormat & GetFirstLeft()
Definition: pagedesc.hxx:220
const SwNumRuleTable & GetNumRuleTable() const
Definition: doc.hxx:1065
Marginalia.
Definition: poolfmt.hxx:258
static std::vector< OUString > lcl_NewUINameArray(const char **pIds, const size_t nLen, const size_t nSvxIds=0)
#define RES_OPAQUE
Definition: hintids.hxx:299
Content 4th level.
Definition: poolfmt.hxx:378
static const char * STR_POOLCOLL_DOC_ARY[]
LanguageType GetAppLanguage()
Definition: init.cxx:729
SwNodes & GetNodes()
Definition: doc.hxx:405
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
Start 2nd level.
Definition: poolfmt.hxx:285
virtual SvxLRSpaceItem * Clone(SfxItemPool *pPool=nullptr) const override
static const std::vector< OUString > & GetRegisterUINameArray()
sal_uInt16 const aCharFormatSetRange[]
Definition: init.cxx:245
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_NONUM5
#define RES_KEEP
Definition: hintids.hxx:310
Content 10th level.
Definition: poolfmt.hxx:393
::sw::DocumentSettingManager & GetDocumentSettingManager()
Definition: doc.cxx:185
Content 8th level.
Definition: poolfmt.hxx:391
NumRule Bullets 4.
Definition: poolfmt.hxx:197
#define RES_PARATR_ADJUST
Definition: hintids.hxx:256
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:2449
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
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_LEVEL4S
tables index.
Definition: poolfmt.hxx:404
void SetSuffix(const OUString &rSet)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM4
sal_Int32 GetFirstLineOffset() const
Start 4th level.
Definition: poolfmt.hxx:315
virtual bool IsPoolTextCollUsed(sal_uInt16 nId) const override
Check if this AutoCollection is already/still in use in this Document.
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
DefaultFontType
long GetRight() const
void SetStart(sal_uInt16 nSet)
SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
Return the AutoCollection by its Id.
Definition: poolfmt.cxx:77
static const char * STR_POOLFRM_ARY[]
void SetLineWidth(sal_uLong const nSet)
Definition: pagedesc.hxx:71
No numbering.
Definition: poolfmt.hxx:300
#define RES_PARATR_WIDOWS
Definition: hintids.hxx:259
#define RES_BOX
Definition: hintids.hxx:306
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)
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM1
Content 7th level.
Definition: poolfmt.hxx:390
void SetAbsLSpace(sal_Int32 nSet)
constexpr::Color COL_BLUE(0x00, 0x00, 0x80)
No numbering.
Definition: poolfmt.hxx:284
Subgroup index tables.
Definition: poolfmt.hxx:367
Text body hanging indent.
Definition: poolfmt.hxx:253
Subgroup table of contents.
Definition: poolfmt.hxx:374
#define DEF_LINE_WIDTH_0
sal_uInt16 const aPgFrameFormatSetRange[]
Definition: init.cxx:260
End 3rd level.
Definition: poolfmt.hxx:291
void SetNumberingType(SvxNumType nSet)
long const nRightMargin
const SwFrameFormats * GetFrameFormats() const
Definition: doc.hxx:735
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_BULLET_NONUM3
Subgroup table.
Definition: poolfmt.hxx:341
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL3S
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)
Standard page.
Definition: poolfmt.hxx:171
const sal_uInt16 POOLGRP_CHARFMT
Other groups:
Definition: poolfmt.hxx:76
static const char *STR_POOLCOLL_LISTS_ARY[] STR_POOLCOLL_NUM_LEVEL5
static const std::vector< OUString > & GetTextUINameArray()
NumRule Bullets 5.
Definition: poolfmt.hxx:198
Footer Right.
Definition: poolfmt.hxx:338
#define HTML_PARSPACE
static const char * STR_TABSTYLE_ARY[]
rtl_TextEncoding GetCharSet() const
sal_uInt16 nPos
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1317
#define RES_PARATR_LINESPACING
Definition: hintids.hxx:255
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1023
virtual bool IsPoolFormatUsed(sal_uInt16 nId) const override
Check if this AutoCollection is already/still in use.
virtual void ResetModified()=0
Placeholder.
Definition: poolfmt.hxx: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