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