LibreOffice Module svx (master)  1
nbdtmg.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  */
19 #include <svx/nbdtmg.hxx>
20 #include <svx/svxids.hrc>
21 #include <vcl/svapp.hxx>
22 #include <svl/itemset.hxx>
23 #include <sfx2/request.hxx>
24 #include <svl/stritem.hxx>
25 #include <editeng/unolingu.hxx>
26 #include <svtools/ctrltool.hxx>
27 #include <sfx2/objsh.hxx>
28 #include <editeng/flstitem.hxx>
29 #include <svl/itempool.hxx>
30 #include <vcl/outdev.hxx>
31 #include <svx/gallery.hxx>
32 #include <editeng/brushitem.hxx>
33 #include <svx/dialmgr.hxx>
34 #include <svx/strings.hrc>
35 #include <vcl/graph.hxx>
36 #include <vcl/settings.hxx>
37 
39 #include <tools/debug.hxx>
40 #include <tools/urlobj.hxx>
41 #include <unotools/streamwrap.hxx>
43 #include <unotools/pathoptions.hxx>
44 #include <editeng/eeitem.hxx>
45 
46 #include <com/sun/star/text/HoriOrientation.hpp>
47 #include <com/sun/star/text/VertOrientation.hpp>
48 #include <com/sun/star/text/RelOrientation.hpp>
49 #include <com/sun/star/style/NumberingType.hpp>
50 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
51 #include <com/sun/star/container/XIndexAccess.hpp>
52 #include <com/sun/star/text/DefaultNumberingProvider.hpp>
53 #include <com/sun/star/text/XNumberingFormatter.hpp>
54 #include <com/sun/star/beans/PropertyValue.hpp>
56 #include <com/sun/star/text/XNumberingTypeInfo.hpp>
57 #include <memory>
58 
59 using namespace com::sun::star;
60 using namespace com::sun::star::uno;
61 using namespace com::sun::star::beans;
62 using namespace com::sun::star::lang;
63 using namespace com::sun::star::text;
64 using namespace com::sun::star::container;
65 using namespace com::sun::star::style;
66 
67 namespace svx { namespace sidebar {
68 
69 namespace {
70 
72 {
73  static vcl::Font aDefBulletFont = [&]()
74  {
75  static vcl::Font tmp("OpenSymbol", "", Size(0, 14));
76  tmp.SetCharSet( RTL_TEXTENCODING_SYMBOL );
77  tmp.SetFamily( FAMILY_DONTKNOW );
78  tmp.SetPitch( PITCH_DONTKNOW );
79  tmp.SetWeight( WEIGHT_DONTKNOW );
80  tmp.SetTransparent( true );
81  return tmp;
82  }();
83  return aDefBulletFont;
84 }
85 
86 const sal_Unicode aDefaultBulletTypes[] =
87 {
88  0x2022,
89  0x25cf,
90  0xe00c,
91  0xe00a,
92  0x2794,
93  0x27a2,
94  0x2717,
95  0x2714
96 };
97 
98 NumSettings_Impl* lcl_CreateNumberingSettingsPtr(const Sequence<PropertyValue>& rLevelProps)
99 {
100  NumSettings_Impl* pNew = new NumSettings_Impl;
101  for(const PropertyValue& rValue : rLevelProps)
102  {
103  if(rValue.Name == "NumberingType")
104  {
105  sal_Int16 nTmp;
106  if (rValue.Value >>= nTmp)
107  pNew->nNumberType = static_cast<SvxNumType>(nTmp);
108  }
109  else if(rValue.Name == "Prefix")
110  rValue.Value >>= pNew->sPrefix;
111  else if(rValue.Name == "Suffix")
112  rValue.Value >>= pNew->sSuffix;
113  else if(rValue.Name == "ParentNumbering")
114  rValue.Value >>= pNew->nParentNumbering;
115  else if(rValue.Name == "BulletChar")
116  rValue.Value >>= pNew->sBulletChar;
117  else if(rValue.Name == "BulletFontName")
118  rValue.Value >>= pNew->sBulletFont;
119  }
120  const sal_Unicode cLocalPrefix = pNew->sPrefix.getLength() ? pNew->sPrefix[0] : 0;
121  const sal_Unicode cLocalSuffix = pNew->sSuffix.getLength() ? pNew->sSuffix[0] : 0;
122  if( cLocalPrefix == ' ') pNew->sPrefix.clear();
123  if( cLocalSuffix == ' ') pNew->sSuffix.clear();
124  return pNew;
125 }
126 
127 }
128 
129 sal_uInt16 NBOTypeMgrBase:: IsSingleLevel(sal_uInt16 nCurLevel)
130 {
131  sal_uInt16 nLv = sal_uInt16(0xFFFF);
132  sal_uInt16 nCount = 0;
133  sal_uInt16 nMask = 1;
134  for( sal_uInt16 i = 0; i < SVX_MAX_NUM; i++ )
135  {
136  if(nCurLevel & nMask)
137  {
138  nCount++;
139  nLv=i;
140  }
141  nMask <<= 1 ;
142  }
143 
144  if ( nCount == 1)
145  return nLv;
146  else
147  return sal_uInt16(0xFFFF);
148 }
149 
150 void NBOTypeMgrBase::SetItems(const SfxItemSet* pArg) {
151  pSet = pArg;
152  if ( pSet )
153  {
154  SfxAllItemSet aSet(*pSet);
155 
156  const SfxStringItem* pBulletCharFmt = aSet.GetItem<SfxStringItem>(SID_BULLET_CHAR_FMT, false);
157  if (pBulletCharFmt)
158  aBulletCharFmtName = pBulletCharFmt->GetValue();
159 
160  const SfxStringItem* pNumCharFmt = aSet.GetItem<SfxStringItem>(SID_NUM_CHAR_FMT, false);
161  if (pNumCharFmt)
162  aNumCharFmtName = pNumCharFmt->GetValue();
163 
164  const SfxPoolItem* pItem;
165  SfxItemState eState = pSet->GetItemState(SID_ATTR_NUMBERING_RULE, false, &pItem);
166  if(eState == SfxItemState::SET)
167  {
168  eCoreUnit = pSet->GetPool()->GetMetric(pSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
169  } else {
170  //sd use different sid for numbering rule
171  eState = pSet->GetItemState(EE_PARA_NUMBULLET, false, &pItem);
172  if(eState == SfxItemState::SET)
173  {
174  eCoreUnit = pSet->GetPool()->GetMetric(pSet->GetPool()->GetWhich(EE_PARA_NUMBULLET));
175  }
176  }
177  }
178 }
179 
180 void NBOTypeMgrBase::ImplLoad(const OUString& filename)
181 {
182  bIsLoading = true;
183  MapUnit eOldCoreUnit=eCoreUnit;
184  eCoreUnit = MapUnit::Map100thMM;
185  INetURLObject aFile( SvtPathOptions().GetUserConfigPath() );
186  aFile.Append( filename);
187  std::unique_ptr<SvStream> xIStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ ));
188  if( xIStm ) {
189  sal_uInt32 nVersion = 0;
190  sal_Int32 nNumIndex = 0;
191  xIStm->ReadUInt32( nVersion );
192  if (nVersion==DEFAULT_NUMBERING_CACHE_FORMAT_VERSION) //first version
193  {
194  xIStm->ReadInt32( nNumIndex );
195  while (nNumIndex>=0 && nNumIndex<DEFAULT_NUM_VALUSET_COUNT) {
196  SvxNumRule aNum(*xIStm);
197  //bullet color in font properties is not stored correctly. Need set tranparency bits manually
198  for(sal_uInt16 i = 0; i < aNum.GetLevelCount(); i++)
199  {
200  SvxNumberFormat aFmt(aNum.GetLevel(i));
201  if (aFmt.GetBulletFont()) {
202  vcl::Font aFont(*aFmt.GetBulletFont());
203  Color c=aFont.GetColor();
204  c.SetTransparency(0xFF);
205  aFont.SetColor(c);
206  aFmt.SetBulletFont(&aFont);
207  aNum.SetLevel(i, aFmt);
208  }
209  }
210  RelplaceNumRule(aNum,nNumIndex,0x1/*nLevel*/);
211  xIStm->ReadInt32( nNumIndex );
212  }
213  }
214  }
215  eCoreUnit = eOldCoreUnit;
216  bIsLoading = false;
217 }
218 void NBOTypeMgrBase::ImplStore(const OUString& filename)
219 {
220  if (bIsLoading) return;
221  MapUnit eOldCoreUnit=eCoreUnit;
222  eCoreUnit = MapUnit::Map100thMM;
223  INetURLObject aFile( SvtPathOptions().GetUserConfigPath() );
224  aFile.Append( filename);
225  std::unique_ptr<SvStream> xOStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::WRITE ));
226  if( xOStm ) {
227  sal_uInt32 nVersion;
228  sal_Int32 nNumIndex;
230  xOStm->WriteUInt32( nVersion );
231  for(sal_Int32 nItem = 0; nItem < DEFAULT_NUM_VALUSET_COUNT; nItem++ ) {
232  if (IsCustomized(nItem)) {
233  SvxNumRule aDefNumRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::CONTINUOUS | SvxNumRuleFlags::BULLET_COLOR,
234  10, false,
235  SvxNumRuleType::NUMBERING, SvxNumberFormat::LABEL_ALIGNMENT);
236  xOStm->WriteInt32( nItem );
237  ApplyNumRule(aDefNumRule,nItem,0x1/*nLevel*/,false,true);
238  aDefNumRule.Store(*xOStm);
239  }
240  }
241  nNumIndex = -1;
242  xOStm->WriteInt32( nNumIndex ); //write end flag
243  }
244  eCoreUnit = eOldCoreUnit;
245 }
246 
247 // Character Bullet Type lib
248 BulletsSettings* BulletsTypeMgr::pActualBullets[] ={nullptr,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr,nullptr};
249 sal_Unicode BulletsTypeMgr::aDynamicBulletTypes[]={' ',' ',' ',' ',' ',' ',' ',' '};
250 sal_Unicode BulletsTypeMgr::aDynamicRTLBulletTypes[]={' ',' ',' ',' ',' ',' ',' ',' '};
251 
252 BulletsTypeMgr::BulletsTypeMgr()
253  : NBOTypeMgrBase()
254 {
255  Init();
256 }
257 
258 namespace {
259 
260 class theBulletsTypeMgr : public rtl::Static<BulletsTypeMgr, theBulletsTypeMgr> {};
261 
262 }
263 
265 {
266  return theBulletsTypeMgr::get();
267 }
268 
270 {
271  const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
272 
273  for (sal_uInt16 i=0;i<DEFAULT_BULLET_TYPES;i++)
274  {
276  pActualBullets[i]->cBulletChar = aDefaultBulletTypes[i];
277  pActualBullets[i]->aFont = rActBulletFont;
278  pActualBullets[i]->sDescription = SvxResId( RID_SVXSTR_BULLET_DESCRIPTION_0 + i );
279  }
280 }
281 sal_uInt16 BulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex)
282 {
283  if ( mLevel == sal_uInt16(0xFFFF) || mLevel == 0)
284  return sal_uInt16(0xFFFF);
285  //if ( !lcl_IsNumFmtSet(pNR, mLevel) ) return (sal_uInt16)0xFFFF;
286 
287  sal_uInt16 nActLv = IsSingleLevel(mLevel);
288 
289  if ( nActLv == sal_uInt16(0xFFFF) )
290  return sal_uInt16(0xFFFF);
291 
292  const SvxNumberFormat& aFmt(aNum.GetLevel(nActLv));
293  sal_Unicode cChar = aFmt.GetBulletChar();
294  for(sal_uInt16 i = nFromIndex; i < DEFAULT_BULLET_TYPES; i++)
295  {
296  if ( (cChar == pActualBullets[i]->cBulletChar) ||
297  (cChar == 9830 && 57356 == pActualBullets[i]->cBulletChar) ||
298  (cChar == 9632 && 57354 == pActualBullets[i]->cBulletChar) )
299  {
300  return i+1;
301  }
302  }
303 
304  return sal_uInt16(0xFFFF);
305 }
306 
307 void BulletsTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel)
308 {
309  if ( mLevel == sal_uInt16(0xFFFF) || mLevel == 0)
310  return;
311 
312  if ( GetNBOIndexForNumRule(aNum,mLevel) != sal_uInt16(0xFFFF) )
313  return;
314 
315  sal_uInt16 nActLv = IsSingleLevel(mLevel);
316 
317  if ( nActLv == sal_uInt16(0xFFFF) )
318  return;
319 
320  SvxNumberFormat aFmt(aNum.GetLevel(nActLv));
321  sal_Unicode cChar = aFmt.GetBulletChar();
322  const vcl::Font* pFont = aFmt.GetBulletFont();
323  if ( nIndex >= DEFAULT_BULLET_TYPES )
324  return;
325 
326  pActualBullets[nIndex]->cBulletChar = cChar;
327  if ( pFont )
328  pActualBullets[nIndex]->aFont = *pFont;
329  pActualBullets[nIndex]->bIsCustomized = true;
330 }
331 
332 void BulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool /*isDefault*/, bool isResetSize)
333 {
334  if ( nIndex >= DEFAULT_BULLET_TYPES )
335  return;
336  sal_Unicode cChar = pActualBullets[nIndex]->cBulletChar;
337  const vcl::Font& rActBulletFont = pActualBullets[nIndex]->aFont;
338 
339  sal_uInt16 nMask = 1;
340  OUString sBulletCharFormatName = GetBulletCharFmtName();
341  for(sal_uInt16 i = 0; i < aNum.GetLevelCount(); i++)
342  {
343  if(mLevel & nMask)
344  {
345  SvxNumberFormat aFmt(aNum.GetLevel(i));
347  aFmt.SetBulletFont(&rActBulletFont);
348  aFmt.SetBulletChar(cChar );
349  aFmt.SetCharFormatName(sBulletCharFormatName);
350  aFmt.SetPrefix( "" );
351  aFmt.SetSuffix( "" );
352  if (isResetSize) aFmt.SetBulletRelSize(45);
353  aNum.SetLevel(i, aFmt);
354  }
355  nMask <<= 1;
356  }
357 }
358 
359 OUString BulletsTypeMgr::GetDescription(sal_uInt16 nIndex, bool /*isDefault*/)
360 {
361  OUString sRet;
362 
363  if ( nIndex >= DEFAULT_BULLET_TYPES )
364  return sRet;
365  else
366  sRet = pActualBullets[nIndex]->sDescription;
367 
368  return sRet;
369 }
370 
371 bool BulletsTypeMgr::IsCustomized(sal_uInt16 nIndex)
372 {
373  bool bRet = false;
374 
375  if ( nIndex >= DEFAULT_BULLET_TYPES )
376  bRet = false;
377  else
378  bRet = pActualBullets[nIndex]->bIsCustomized;
379 
380  return bRet;
381 }
382 
383 // Numbering Type lib
385  : NBOTypeMgrBase()
386 {
387  Init();
389  ImplLoad("standard.syb");
390 }
391 
393 {
394 }
395 
396 static const char* RID_SVXSTR_SINGLENUM_DESCRIPTIONS[] =
397 {
398  RID_SVXSTR_SINGLENUM_DESCRIPTION_0,
399  RID_SVXSTR_SINGLENUM_DESCRIPTION_1,
400  RID_SVXSTR_SINGLENUM_DESCRIPTION_2,
401  RID_SVXSTR_SINGLENUM_DESCRIPTION_3,
402  RID_SVXSTR_SINGLENUM_DESCRIPTION_4,
403  RID_SVXSTR_SINGLENUM_DESCRIPTION_5,
404  RID_SVXSTR_SINGLENUM_DESCRIPTION_6,
405  RID_SVXSTR_SINGLENUM_DESCRIPTION_7
406 };
407 
408 namespace {
409 
410 class theNumberingTypeMgr : public rtl::Static<NumberingTypeMgr, theNumberingTypeMgr> {};
411 
412 }
413 
415 {
416  return theNumberingTypeMgr::get();
417 }
418 
420 {
421  Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
422  Reference<XDefaultNumberingProvider> xDefNum = DefaultNumberingProvider::create( xContext );
423 
425  Locale aLocale(Application::GetSettings().GetLanguageTag().getLocale());
426  try
427  {
428  aNumberings = xDefNum->getDefaultContinuousNumberingLevels( aLocale );
429 
430  sal_Int32 nLength = aNumberings.getLength();
431 
432  const Sequence<PropertyValue>* pValuesArr = aNumberings.getConstArray();
433  for(sal_Int32 i = 0; i < nLength; i++)
434  {
435  NumSettings_Impl* pNew = lcl_CreateNumberingSettingsPtr(pValuesArr[i]);
436  NumberSettings_Impl* pNumEntry = new NumberSettings_Impl;
437  pNumEntry->pNumSetting = pNew;
438  if ( i < 8 )
439  pNumEntry->sDescription = SvxResId(RID_SVXSTR_SINGLENUM_DESCRIPTIONS[i]);
440  maNumberSettingsArr.push_back(std::shared_ptr<NumberSettings_Impl>(pNumEntry));
441  }
442  }
443  catch(Exception&)
444  {
445  }
446 }
447 
448 sal_uInt16 NumberingTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex)
449 {
450  if ( mLevel == sal_uInt16(0xFFFF) || mLevel > aNum.GetLevelCount() || mLevel == 0)
451  return sal_uInt16(0xFFFF);
452 
453  sal_uInt16 nActLv = IsSingleLevel(mLevel);
454 
455  if ( nActLv == sal_uInt16(0xFFFF) )
456  return sal_uInt16(0xFFFF);
457 
458  const SvxNumberFormat& aFmt(aNum.GetLevel(nActLv));
459  //sal_Unicode cPrefix = OUString(aFmt.GetPrefix())[0];
460  //sal_Unicode cSuffix = :OUString(aFmt.GetSuffix())[0];
461  const OUString& sPrefix = aFmt.GetPrefix();
462  const OUString& sLclSuffix = aFmt.GetSuffix();
463  sal_Int16 eNumType = aFmt.GetNumberingType();
464 
465  sal_uInt16 nCount = maNumberSettingsArr.size();
466  for(sal_uInt16 i = nFromIndex; i < nCount; ++i)
467  {
468  NumberSettings_Impl* _pSet = maNumberSettingsArr[i].get();
469  sal_Int16 eNType = _pSet->pNumSetting->nNumberType;
470  OUString sLocalPrefix = _pSet->pNumSetting->sPrefix;
471  OUString sLocalSuffix = _pSet->pNumSetting->sSuffix;
472  if (sPrefix == sLocalPrefix &&
473  sLclSuffix == sLocalSuffix &&
474  eNumType == eNType )
475  {
476  return i+1;
477  }
478  }
479 
480 
481  return sal_uInt16(0xFFFF);
482 }
483 
484 void NumberingTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel)
485 {
486  sal_uInt16 nActLv = IsSingleLevel(mLevel);
487 
488  if ( nActLv == sal_uInt16(0xFFFF) )
489  return;
490 
491  const SvxNumberFormat& aFmt(aNum.GetLevel(nActLv));
492  SvxNumType eNumType = aFmt.GetNumberingType();
493 
494  sal_uInt16 nCount = maNumberSettingsArr.size();
495  if ( nIndex >= nCount )
496  return;
497 
498  NumberSettings_Impl* _pSet = maNumberSettingsArr[nIndex].get();
499 
500  _pSet->pNumSetting->sPrefix = aFmt.GetPrefix();
501  _pSet->pNumSetting->sSuffix = aFmt.GetSuffix();
502  _pSet->pNumSetting->nNumberType = eNumType;
503  _pSet->bIsCustomized = true;
504 
505  SvxNumRule aTmpRule1(aNum);
506  SvxNumRule aTmpRule2(aNum);
507  ApplyNumRule(aTmpRule1,nIndex,mLevel,true);
508  ApplyNumRule(aTmpRule2,nIndex,mLevel);
509  if (aTmpRule1==aTmpRule2) _pSet->bIsCustomized=false;
510  if (!_pSet->bIsCustomized) {
511  _pSet->sDescription = GetDescription(nIndex,true);
512  }
513  ImplStore("standard.syb");
514 }
515 
516 void NumberingTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault, bool isResetSize)
517 {
518  if(maNumberSettingsArr.size() <= nIndex)
519  return;
520  NumberSettingsArr_Impl* pCurrentNumberSettingsArr = &maNumberSettingsArr;
521  if (isDefault) pCurrentNumberSettingsArr = &maDefaultNumberSettingsArr;
522  NumberSettings_Impl* _pSet = (*pCurrentNumberSettingsArr)[nIndex].get();
523  SvxNumType eNewType = _pSet->pNumSetting->nNumberType;
524 
525  sal_uInt16 nMask = 1;
526  OUString sNumCharFmtName = GetNumCharFmtName();
527  for(sal_uInt16 i = 0; i < aNum.GetLevelCount(); i++)
528  {
529  if(mLevel & nMask)
530  {
531  SvxNumberFormat aFmt(aNum.GetLevel(i));
532  if (eNewType!=aFmt.GetNumberingType()) isResetSize=true;
533  aFmt.SetNumberingType(eNewType);
534  aFmt.SetPrefix(_pSet->pNumSetting->sPrefix);
535  aFmt.SetSuffix(_pSet->pNumSetting->sSuffix);
536 
537  aFmt.SetCharFormatName(sNumCharFmtName);
538  if (isResetSize) aFmt.SetBulletRelSize(100);
539  aNum.SetLevel(i, aFmt);
540  }
541  nMask <<= 1 ;
542  }
543 }
544 
545 OUString NumberingTypeMgr::GetDescription(sal_uInt16 nIndex, bool isDefault)
546 {
547  OUString sRet;
548  sal_uInt16 nLength = maNumberSettingsArr.size();
549 
550  if ( nIndex >= nLength )
551  return sRet;
552  else
553  sRet = maNumberSettingsArr[nIndex]->sDescription;
554  if (isDefault) sRet = maDefaultNumberSettingsArr[nIndex]->sDescription;
555 
556  return sRet;
557 }
558 
559 bool NumberingTypeMgr::IsCustomized(sal_uInt16 nIndex)
560 {
561  bool bRet = false;
562  sal_uInt16 nLength = maNumberSettingsArr.size();
563 
564  if ( nIndex >= nLength )
565  bRet = false;
566  else
567  bRet = maNumberSettingsArr[nIndex]->bIsCustomized;
568 
569  return bRet;
570 }
571 // Multi-level /Outline Type lib
573  : NBOTypeMgrBase()
574 {
575  Init();
576  for(sal_Int32 nItem = 0; nItem < DEFAULT_NUM_VALUSET_COUNT; nItem++ )
577  {
579  }
580  //Initial the first time to store the default value. Then do it again for customized value
581  Init();
582  ImplLoad("standard.syc");
583 }
584 
585 namespace {
586 
587 class theOutlineTypeMgr : public rtl::Static<OutlineTypeMgr, theOutlineTypeMgr> {};
588 
589 }
590 
592 {
593  return theOutlineTypeMgr::get();
594 }
595 
597 {
598  Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
599  Reference<XDefaultNumberingProvider> xDefNum = DefaultNumberingProvider::create( xContext );
600 
601  Sequence<Reference<XIndexAccess> > aOutlineAccess;
602  Locale aLocale(Application::GetSettings().GetLanguageTag().getLocale());
603  try
604  {
605  aOutlineAccess = xDefNum->getDefaultOutlineNumberings( aLocale );
606 
607  SvxNumRule aDefNumRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::CONTINUOUS | SvxNumRuleFlags::BULLET_COLOR,
608  10, false,
609  SvxNumRuleType::NUMBERING, SvxNumberFormat::LABEL_ALIGNMENT);
610 
611  auto nSize = std::min<sal_Int32>(aOutlineAccess.getLength(), DEFAULT_NUM_VALUSET_COUNT);
612  for(sal_Int32 nItem = 0; nItem < nSize; nItem++ )
613  {
615  OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[ nItem ];
616  pItemArr->sDescription = SvxResId( RID_SVXSTR_OUTLINENUM_DESCRIPTION_0 + nItem );
617  pItemArr->pNumSettingsArr = new NumSettingsArr_Impl;
618  Reference<XIndexAccess> xLevel = aOutlineAccess.getConstArray()[nItem];
619  for(sal_Int32 nLevel = 0; nLevel < xLevel->getCount() && nLevel < 5; nLevel++)
620  {
621  Any aValueAny = xLevel->getByIndex(nLevel);
622  Sequence<PropertyValue> aLevelProps;
623  aValueAny >>= aLevelProps;
624  NumSettings_Impl* pNew = lcl_CreateNumberingSettingsPtr(aLevelProps);
625  const SvxNumberFormat& aNumFmt( aDefNumRule.GetLevel( nLevel) );
626  pNew->eLabelFollowedBy = aNumFmt.GetLabelFollowedBy();
627  pNew->nTabValue = aNumFmt.GetListtabPos();
628  pNew->eNumAlign = aNumFmt.GetNumAdjust();
629  pNew->nNumAlignAt = aNumFmt.GetFirstLineIndent();
630  pNew->nNumIndentAt = aNumFmt.GetIndentAt();
631  pItemArr->pNumSettingsArr->push_back(std::shared_ptr<NumSettings_Impl>(pNew));
632  }
633  }
634  }
635  catch(Exception&)
636  {
637  }
638 }
639 
640 sal_uInt16 OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 /*mLevel*/,sal_uInt16 nFromIndex)
641 {
642  sal_uInt16 const nLength = SAL_N_ELEMENTS(pOutlineSettingsArrs);
643  for(sal_uInt16 iDex = nFromIndex; iDex < nLength; iDex++)
644  {
645  bool bNotMatch = false;
646  OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[iDex];
647  sal_uInt16 nCount = pItemArr->pNumSettingsArr->size();
648  for (sal_uInt16 iLevel=0;iLevel < nCount;iLevel++)
649  {
650  NumSettings_Impl* _pSet = (*pItemArr->pNumSettingsArr)[iLevel].get();
651  sal_Int16 eNType = _pSet->nNumberType;
652 
653  const SvxNumberFormat& aFmt(aNum.GetLevel(iLevel));
654  const OUString& sPrefix = aFmt.GetPrefix();
655  const OUString& sLclSuffix = aFmt.GetSuffix();
656  sal_Int16 eNumType = aFmt.GetNumberingType();
657  if( eNumType == SVX_NUM_CHAR_SPECIAL)
658  {
659  sal_Unicode cChar = aFmt.GetBulletChar();
660  sal_Unicode ccChar = _pSet->sBulletChar[0];
661  if ( !((cChar == ccChar) &&
662  _pSet->eLabelFollowedBy == aFmt.GetLabelFollowedBy() &&
663  _pSet->nTabValue == aFmt.GetListtabPos() &&
664  _pSet->eNumAlign == aFmt.GetNumAdjust() &&
665  _pSet->nNumAlignAt == aFmt.GetFirstLineIndent() &&
666  _pSet->nNumIndentAt == aFmt.GetIndentAt()))
667  {
668  bNotMatch = true;
669  break;
670  }
671  }else if ((eNumType&(~LINK_TOKEN)) == SVX_NUM_BITMAP ) {
672  const SvxBrushItem* pBrsh1 = aFmt.GetBrush();
673  const SvxBrushItem* pBrsh2 = _pSet->pBrushItem;
674  bool bIsMatch = false;
675  if (pBrsh1==pBrsh2) bIsMatch = true;
676  if (pBrsh1 && pBrsh2) {
677  const Graphic* pGrf1 = pBrsh1->GetGraphic();
678  const Graphic* pGrf2 = pBrsh2->GetGraphic();
679  if (pGrf1==pGrf2) bIsMatch = true;
680  if (pGrf1 && pGrf2) {
681  if ( pGrf1->GetBitmapEx() == pGrf2->GetBitmapEx() &&
682  _pSet->aSize == aFmt.GetGraphicSize())
683  bIsMatch = true;
684  }
685  }
686  if (!bIsMatch) {
687  bNotMatch = true;
688  break;
689  }
690  } else
691  {
692  if (!(sPrefix == _pSet->sPrefix &&
693  sLclSuffix == _pSet->sSuffix &&
694  eNumType == eNType &&
695  _pSet->eLabelFollowedBy == aFmt.GetLabelFollowedBy() &&
696  _pSet->nTabValue == aFmt.GetListtabPos() &&
697  _pSet->eNumAlign == aFmt.GetNumAdjust() &&
698  _pSet->nNumAlignAt == aFmt.GetFirstLineIndent() &&
699  _pSet->nNumIndentAt == aFmt.GetIndentAt()))
700  {
701  bNotMatch = true;
702  break;
703  }
704  }
705  }
706  if ( !bNotMatch )
707  return iDex+1;
708  }
709 
710 
711  return sal_uInt16(0xFFFF);
712 }
713 
714 void OutlineTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel)
715 {
716  sal_uInt16 const nLength = SAL_N_ELEMENTS(pOutlineSettingsArrs);
717  if ( nIndex >= nLength )
718  return;
719 
720  OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex];
721  sal_uInt16 nCount = pItemArr->pNumSettingsArr->size();
722  for (sal_uInt16 iLevel=0;iLevel < nCount;iLevel++)
723  {
724  const SvxNumberFormat& aFmt(aNum.GetLevel(iLevel));
725  SvxNumType eNumType = aFmt.GetNumberingType();
726 
727  NumSettings_Impl* _pSet = (*pItemArr->pNumSettingsArr)[iLevel].get();
728 
729  _pSet->eLabelFollowedBy = aFmt.GetLabelFollowedBy();
730  _pSet->nTabValue = aFmt.GetListtabPos();
731  _pSet->eNumAlign = aFmt.GetNumAdjust();
732  _pSet->nNumAlignAt = aFmt.GetFirstLineIndent();
733  _pSet->nNumIndentAt = aFmt.GetIndentAt();
734 
735  if( eNumType == SVX_NUM_CHAR_SPECIAL)
736  {
737  sal_Unicode cChar = aFmt.GetBulletChar();
738  OUString sChar(cChar);
739  _pSet->sBulletChar = sChar;
740  if ( aFmt.GetBulletFont() )
741  _pSet->sBulletFont = aFmt.GetBulletFont()->GetFamilyName();
742  _pSet->nNumberType = eNumType;
743  pItemArr->bIsCustomized = true;
744  }else if ((eNumType&(~LINK_TOKEN)) == SVX_NUM_BITMAP ) {
745  if (_pSet->pBrushItem) {
746  delete _pSet->pBrushItem;
747  _pSet->pBrushItem=nullptr;
748  }
749  if (aFmt.GetBrush())
750  _pSet->pBrushItem = new SvxBrushItem(*aFmt.GetBrush());
751  _pSet->aSize = aFmt.GetGraphicSize();
752  _pSet->nNumberType = eNumType;
753  } else
754  {
755  _pSet->sPrefix = aFmt.GetPrefix();
756  _pSet->sSuffix = aFmt.GetSuffix();
757  _pSet->nNumberType = eNumType;
758  if ( aFmt.GetBulletFont() )
759  _pSet->sBulletFont = aFmt.GetBulletFont()->GetFamilyName();
760  pItemArr->bIsCustomized = true;
761  }
762  }
763  SvxNumRule aTmpRule1(aNum);
764  SvxNumRule aTmpRule2(aNum);
765  ApplyNumRule(aTmpRule1,nIndex,mLevel,true);
766  ApplyNumRule(aTmpRule2,nIndex,mLevel);
767  if (aTmpRule1==aTmpRule2) pItemArr->bIsCustomized=false;
768  if (!pItemArr->bIsCustomized) {
769  pItemArr->sDescription = GetDescription(nIndex,true);
770  }
771  ImplStore("standard.syc");
772 }
773 
774 void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 /*mLevel*/, bool isDefault, bool isResetSize)
775 {
776  DBG_ASSERT(DEFAULT_NUM_VALUSET_COUNT > nIndex, "wrong index");
777  if(DEFAULT_NUM_VALUSET_COUNT <= nIndex)
778  return;
779 
780  const FontList* pList = nullptr;
781 
782  OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex];
783  if (isDefault) pItemArr=pDefaultOutlineSettingsArrs[nIndex];
784 
785  NumSettingsArr_Impl *pNumSettingsArr=pItemArr->pNumSettingsArr;
786 
787  NumSettings_Impl* pLevelSettings = nullptr;
788  for(sal_uInt16 i = 0; i < aNum.GetLevelCount(); i++)
789  {
790  if(pNumSettingsArr->size() > i)
791  pLevelSettings = (*pNumSettingsArr)[i].get();
792 
793  if(!pLevelSettings)
794  break;
795 
796  SvxNumberFormat aFmt(aNum.GetLevel(i));
797  const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
798  if (pLevelSettings->nNumberType !=aFmt.GetNumberingType()) isResetSize=true;
799  aFmt.SetNumberingType( pLevelSettings->nNumberType );
800  sal_uInt16 nUpperLevelOrChar = static_cast<sal_uInt16>(pLevelSettings->nParentNumbering);
801  if(aFmt.GetNumberingType() == SVX_NUM_CHAR_SPECIAL)
802  {
803  if( pLevelSettings->sBulletFont.getLength() &&
804  pLevelSettings->sBulletFont != rActBulletFont.GetFamilyName() )
805  {
806  //search for the font
807  if(!pList)
808  {
809  SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
810  const SvxFontListItem* pFontListItem = static_cast<const SvxFontListItem*>( pCurDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ) );
811  pList = pFontListItem ? pFontListItem->GetFontList() : nullptr;
812  }
813  if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) )
814  {
815  FontMetric aFontMetric = pList->Get(pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE);
816  vcl::Font aFont(aFontMetric);
817  aFmt.SetBulletFont(&aFont);
818  }
819  else
820  {
821  //if it cannot be found then create a new one
822  vcl::Font aCreateFont( pLevelSettings->sBulletFont, OUString(), Size( 0, 14 ) );
823  aCreateFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW );
824  aCreateFont.SetFamily( FAMILY_DONTKNOW );
825  aCreateFont.SetPitch( PITCH_DONTKNOW );
826  aCreateFont.SetWeight( WEIGHT_DONTKNOW );
827  aCreateFont.SetTransparent( true );
828  aFmt.SetBulletFont( &aCreateFont );
829  }
830  }else
831  aFmt.SetBulletFont( &rActBulletFont );
832 
833  sal_Unicode cChar = 0;
834  if( !pLevelSettings->sBulletChar.isEmpty() )
835  cChar = pLevelSettings->sBulletChar[0];
837  {
838  if( 0 == i && cChar == BulletsTypeMgr::aDynamicBulletTypes[5] )
839  cChar = BulletsTypeMgr::aDynamicRTLBulletTypes[5];
840  else if( 1 == i )
841  {
842  const SvxNumberFormat& numberFmt = aNum.GetLevel(0);
843  if( numberFmt.GetBulletChar() == BulletsTypeMgr::aDynamicRTLBulletTypes[5] )
844  cChar = BulletsTypeMgr::aDynamicRTLBulletTypes[4];
845  }
846  }
847 
848  aFmt.SetBulletChar(cChar);
849  aFmt.SetCharFormatName( GetBulletCharFmtName() );
850  if (isResetSize) aFmt.SetBulletRelSize(45);
851  }else if ((aFmt.GetNumberingType()&(~LINK_TOKEN)) == SVX_NUM_BITMAP ) {
852  if (pLevelSettings->pBrushItem) {
853  const Graphic* pGrf = pLevelSettings->pBrushItem->GetGraphic();
854  Size aSize = pLevelSettings->aSize;
855  sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
856  if (!isResetSize && aFmt.GetGraphicSize()!=Size(0,0)) aSize=aFmt.GetGraphicSize();
857  else {
858  if (aSize.Width()==0 && aSize.Height()==0 && pGrf) {
859  aSize = SvxNumberFormat::GetGraphicSizeMM100( pGrf );
860  }
861  }
862  aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(GetMapUnit()));
863  aFmt.SetGraphicBrush( pLevelSettings->pBrushItem, &aSize, &eOrient );
864  }
865  } else
866  {
867  aFmt.SetIncludeUpperLevels(sal::static_int_cast< sal_uInt8 >(0 != nUpperLevelOrChar ? aNum.GetLevelCount() : 0));
868  aFmt.SetCharFormatName(GetNumCharFmtName());
869  if (isResetSize) aFmt.SetBulletRelSize(100);
870  }
871  if(pNumSettingsArr->size() > i) {
872  aFmt.SetLabelFollowedBy(pLevelSettings->eLabelFollowedBy);
873  aFmt.SetListtabPos(pLevelSettings->nTabValue);
874  aFmt.SetNumAdjust(pLevelSettings->eNumAlign);
875  aFmt.SetFirstLineIndent(pLevelSettings->nNumAlignAt);
876  aFmt.SetIndentAt(pLevelSettings->nNumIndentAt);
877  }
878  aFmt.SetPrefix(pLevelSettings->sPrefix);
879  aFmt.SetSuffix(pLevelSettings->sSuffix);
880  aNum.SetLevel(i, aFmt);
881  }
882 }
883 
884 OUString OutlineTypeMgr::GetDescription(sal_uInt16 nIndex, bool isDefault)
885 {
886  OUString sRet;
887 
888  if ( nIndex >= SAL_N_ELEMENTS(pOutlineSettingsArrs) )
889  return sRet;
890  else
891  {
892  OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex];
893  if (isDefault) pItemArr = pDefaultOutlineSettingsArrs[nIndex];
894  if ( pItemArr )
895  {
896  sRet = pItemArr->sDescription;
897  }
898  }
899  return sRet;
900 }
901 
902 bool OutlineTypeMgr::IsCustomized(sal_uInt16 nIndex)
903 {
904  bool bRet = false;
905 
906  if ( nIndex >= SAL_N_ELEMENTS(pOutlineSettingsArrs) )
907  return bRet;
908  else
909  {
910  OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex];
911  if ( pItemArr )
912  {
913  bRet = pItemArr->bIsCustomized;
914  }
915  }
916 
917  return bRet;
918 }
919 
920 
921 }}
922 
923 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetFamily(FontFamily)
virtual void ApplyNumRule(SvxNumRule &aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false, bool isResetSize=false) override
Definition: nbdtmg.cxx:332
SvxNumType GetNumberingType() const
long Width() const
#define DEFAULT_BULLET_TYPES
Definition: nbdtmg.hxx:29
static const char * RID_SVXSTR_SINGLENUM_DESCRIPTIONS[]
Definition: nbdtmg.cxx:396
virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) override
Definition: nbdtmg.cxx:884
void SetTransparency(sal_uInt8 nTransparency)
void ImplStore(const OUString &filename)
Definition: nbdtmg.cxx:218
virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule &aNum, sal_uInt16 mLevel, sal_uInt16 nFromIndex=0) override
Definition: nbdtmg.cxx:640
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
long Height() const
MapUnit GetMapUnit() const
Definition: nbdtmg.hxx:141
#define DEFAULT_NUM_VALUSET_COUNT
Definition: nbdtmg.hxx:30
FAMILY_DONTKNOW
NumberSettingsArr_Impl maNumberSettingsArr
Definition: nbdtmg.hxx:176
static const AllSettings & GetSettings()
const sal_Unicode cBulletChar
std::vector< std::shared_ptr< NumberSettings_Impl > > NumberSettingsArr_Impl
Definition: nbdtmg.hxx:95
void SetWeight(FontWeight)
static sal_uInt16 IsSingleLevel(sal_uInt16 nCurLevel)
Definition: nbdtmg.cxx:129
NumSettings_Impl * pNumSetting
Definition: nbdtmg.hxx:87
void SetCharSet(rtl_TextEncoding)
static SfxObjectShell * Current()
#define DEFAULT_NUMBERING_CACHE_FORMAT_VERSION
Definition: nbdtmg.hxx:31
virtual void Init() override
Definition: nbdtmg.cxx:269
virtual bool IsCustomized(sal_uInt16 nIndex) override
Definition: nbdtmg.cxx:371
static Size GetGraphicSizeMM100(const Graphic *pGraphic)
bool IsAvailable(const OUString &rName) const
virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) override
Definition: nbdtmg.cxx:545
SvxNumType
void Store(SvStream &rStream)
sal_uInt16 sal_Unicode
static OutlineTypeMgr & GetInstance()
Definition: nbdtmg.cxx:591
virtual void Init() override
Definition: nbdtmg.cxx:596
std::vector< std::shared_ptr< NumSettings_Impl > > NumSettingsArr_Impl
Definition: nbdtmg.hxx:69
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
static vcl::Font & lcl_GetDefaultBulletFont()
SvxNumberFormat::LabelFollowedBy eLabelFollowedBy
Definition: nbdtmg.hxx:43
int nCount
FontMetric Get(const OUString &rName, const OUString &rStyleName) const
NumSettingsArr_Impl * pNumSettingsArr
Definition: nbdtmg.hxx:102
const Graphic * GetGraphic(OUString const &referer=OUString()) const
virtual void RelplaceNumRule(SvxNumRule &aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) override
Definition: nbdtmg.cxx:307
virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule &aNum, sal_uInt16 mLevel, sal_uInt16 nFromIndex=0) override
Definition: nbdtmg.cxx:448
void SetPitch(FontPitch ePitch)
const OUString & GetNumCharFmtName() const
Definition: nbdtmg.hxx:140
#define SAL_N_ELEMENTS(arr)
SVX_NUM_BITMAP
SVX_NUM_CHAR_SPECIAL
WEIGHT_DONTKNOW
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
OUString sPrefix
#define DBG_ASSERT(sCon, aError)
virtual ~NumberingTypeMgr() override
Definition: nbdtmg.cxx:392
bool Append(OUString const &rTheSegment, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
int i
const OUString & GetValue() const
WEIGHT_NORMAL
const SvxNumberFormat & GetLevel(sal_uInt16 nLevel) const
sal_uInt16 GetLevelCount() const
void SetBulletChar(sal_Unicode cSet)
static bool GetLayoutRTL()
PITCH_DONTKNOW
virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule &aNum, sal_uInt16 mLevel, sal_uInt16 nFromIndex=0) override
Definition: nbdtmg.cxx:281
SvxBrushItem * pBrushItem
Definition: nbdtmg.hxx:52
virtual void ApplyNumRule(SvxNumRule &aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false, bool isResetSize=false) override
Definition: nbdtmg.cxx:774
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
ITALIC_NONE
virtual bool IsCustomized(sal_uInt16 nIndex) override
Definition: nbdtmg.cxx:902
sal_Int16 nVersion
void ImplLoad(const OUString &filename)
Definition: nbdtmg.cxx:180
static BulletsSettings * pActualBullets[DEFAULT_BULLET_TYPES]
Definition: nbdtmg.hxx:158
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
NumberSettingsArr_Impl maDefaultNumberSettingsArr
Definition: nbdtmg.hxx:177
SfxItemState
OutlineSettings_Impl * pOutlineSettingsArrs[DEFAULT_NUM_VALUSET_COUNT]
Definition: nbdtmg.hxx:195
#define LINK_TOKEN
virtual void RelplaceNumRule(SvxNumRule &aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) override
Definition: nbdtmg.cxx:714
void SetTransparent(bool bTransparent)
#define EE_PARA_NUMBULLET
const OUString & GetBulletCharFmtName() const
Definition: nbdtmg.hxx:139
#define SVX_MAX_NUM
static BulletsTypeMgr & GetInstance()
Definition: nbdtmg.cxx:264
virtual void ApplyNumRule(SvxNumRule &aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false, bool isResetSize=false) override
Definition: nbdtmg.cxx:516
sal_Unicode GetBulletChar() const
MapUnit
OutlineSettings_Impl * pDefaultOutlineSettingsArrs[DEFAULT_NUM_VALUSET_COUNT]
Definition: nbdtmg.hxx:196
virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) override
Definition: nbdtmg.cxx:359
const FontList * GetFontList() const
virtual bool IsCustomized(sal_uInt16 nIndex) override
Definition: nbdtmg.cxx:559
void SetNumberingType(SvxNumType nSet)
sal_Int32 const nLength
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
virtual void RelplaceNumRule(SvxNumRule &aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) override
Definition: nbdtmg.cxx:484
void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat &rFmt, bool bIsValid=true)
static NumberingTypeMgr & GetInstance()
Definition: nbdtmg.cxx:414
virtual void Init() override
Definition: nbdtmg.cxx:419