LibreOffice Module cui (master)  1
numpages.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 
20 #include <com/sun/star/text/HoriOrientation.hpp>
21 #include <com/sun/star/text/VertOrientation.hpp>
22 
23 #include <numpages.hxx>
24 #include <dialmgr.hxx>
25 #include <tools/mapunit.hxx>
27 #include <i18nlangtag/mslangid.hxx>
28 #include <editeng/numitem.hxx>
29 #include <svl/eitem.hxx>
30 #include <vcl/svapp.hxx>
31 #include <svx/colorbox.hxx>
32 #include <svx/strarray.hxx>
33 #include <svx/gallery.hxx>
34 #include <editeng/brushitem.hxx>
35 #include <svl/intitem.hxx>
36 #include <sfx2/objsh.hxx>
37 #include <vcl/graph.hxx>
38 #include <vcl/settings.hxx>
39 #include <cui/cuicharmap.hxx>
40 #include <editeng/flstitem.hxx>
41 #include <svx/numvset.hxx>
42 #include <sfx2/htmlmode.hxx>
43 #include <unotools/pathoptions.hxx>
44 #include <svtools/ctrltool.hxx>
45 #include <svtools/unitconv.hxx>
46 #include <com/sun/star/style/NumberingType.hpp>
47 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
48 #include <com/sun/star/container/XIndexAccess.hpp>
49 #include <com/sun/star/text/XDefaultNumberingProvider.hpp>
50 #include <com/sun/star/text/XNumberingFormatter.hpp>
51 #include <com/sun/star/beans/PropertyValue.hpp>
53 #include <svx/svxids.hrc>
54 
55 #include <algorithm>
56 #include <memory>
57 #include <vector>
58 #include <sfx2/opengrf.hxx>
59 
60 #include <strings.hrc>
61 #include <svl/stritem.hxx>
62 #include <svl/slstitm.hxx>
63 #include <sfx2/filedlghelper.hxx>
65 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
66 #include <sal/log.hxx>
67 #include <vcl/cvtgrf.hxx>
68 #include <vcl/graphicfilter.hxx>
70 #include <tools/urlobj.hxx>
71 #include <o3tl/temporary.hxx>
72 #include <osl/diagnose.h>
73 
74 using namespace css;
75 using namespace css::uno;
76 using namespace css::beans;
77 using namespace css::lang;
78 using namespace css::text;
79 using namespace css::container;
80 using namespace css::style;
81 
82 #define SHOW_NUMBERING 0
83 #define SHOW_BULLET 1
84 #define SHOW_BITMAP 2
85 
86 #define MAX_BMP_WIDTH 16
87 #define MAX_BMP_HEIGHT 16
88 #define SEARCHPATH_DELIMITER u';'
89 #define SEARCHFILENAME_DELIMITER u'/'
90 
91 static bool bLastRelative = false;
92 
93 static SvxNumSettings_Impl* lcl_CreateNumSettingsPtr(const Sequence<PropertyValue>& rLevelProps)
94 {
95  const PropertyValue* pValues = rLevelProps.getConstArray();
97  for(sal_Int32 j = 0; j < rLevelProps.getLength(); j++)
98  {
99  if ( pValues[j].Name == "NumberingType" )
100  {
101  sal_Int16 nTmp;
102  if (pValues[j].Value >>= nTmp)
103  pNew->nNumberType = static_cast<SvxNumType>(nTmp);
104  }
105  else if ( pValues[j].Name == "Prefix" )
106  pValues[j].Value >>= pNew->sPrefix;
107  else if ( pValues[j].Name == "Suffix" )
108  pValues[j].Value >>= pNew->sSuffix;
109  else if ( pValues[j].Name == "ParentNumbering" )
110  pValues[j].Value >>= pNew->nParentNumbering;
111  else if ( pValues[j].Name == "BulletChar" )
112  pValues[j].Value >>= pNew->sBulletChar;
113  else if ( pValues[j].Name == "BulletFontName" )
114  pValues[j].Value >>= pNew->sBulletFont;
115  }
116  return pNew;
117 }
118 
119 // the selection of bullets from the OpenSymbol
121 {
122  0x2022,
123  0x25cf,
124  0xe00c,
125  0xe00a,
126  0x2794,
127  0x27a2,
128  0x2717,
129  0x2714
130 };
131 
132 // Is one of the masked formats set?
133 static bool lcl_IsNumFmtSet(SvxNumRule const * pNum, sal_uInt16 nLevelMask)
134 {
135  bool bRet = false;
136  sal_uInt16 nMask = 1;
137  for( sal_uInt16 i = 0; i < SVX_MAX_NUM && !bRet; i++ )
138  {
139  if(nLevelMask & nMask)
140  bRet |= nullptr != pNum->Get( i );
141  nMask <<= 1 ;
142  }
143  return bRet;
144 }
145 
147 {
148  static vcl::Font aDefBulletFont = [&]()
149  {
150  vcl::Font tmp("OpenSymbol", "", Size(0, 14));
151  tmp.SetCharSet( RTL_TEXTENCODING_SYMBOL );
152  tmp.SetFamily( FAMILY_DONTKNOW );
153  tmp.SetPitch( PITCH_DONTKNOW );
154  tmp.SetWeight( WEIGHT_DONTKNOW );
155  tmp.SetTransparent( true );
156  return tmp;
157  }();
158  return aDefBulletFont;
159 }
160 
162  : SfxTabPage(pPage, pController, "cui/ui/picknumberingpage.ui", "PickNumberingPage", &rSet)
163  , nActNumLvl(SAL_MAX_UINT16)
164  , bModified(false)
165  , bPreset(false)
166  , nNumItemId(SID_ATTR_NUMBERING_RULE)
167  , m_xExamplesVS(new SvxNumValueSet(m_xBuilder->weld_scrolled_window("valuesetwin", true)))
168  , m_xExamplesVSWin(new weld::CustomWeld(*m_xBuilder, "valueset", *m_xExamplesVS))
169 {
171  m_xExamplesVS->init(NumberingPageType::SINGLENUM);
172  m_xExamplesVS->SetSelectHdl(LINK(this, SvxSingleNumPickTabPage, NumSelectHdl_Impl));
173  m_xExamplesVS->SetDoubleClickHdl(LINK(this, SvxSingleNumPickTabPage, DoubleClickHdl_Impl));
174 
175  Reference<XDefaultNumberingProvider> xDefNum = SvxNumOptionsTabPageHelper::GetNumberingProvider();
176  if(!xDefNum.is())
177  return;
178 
179  Sequence< Sequence< PropertyValue > > aNumberings;
181  try
182  {
183  aNumberings =
184  xDefNum->getDefaultContinuousNumberingLevels( rLocale );
185 
186 
187  sal_Int32 nLength = std::min<sal_Int32>(aNumberings.getLength(), NUM_VALUSET_COUNT);
188 
189  const Sequence<PropertyValue>* pValuesArr = aNumberings.getConstArray();
190  for(sal_Int32 i = 0; i < nLength; i++)
191  {
192  SvxNumSettings_Impl* pNew = lcl_CreateNumSettingsPtr(pValuesArr[i]);
193  aNumSettingsArr.push_back(std::unique_ptr<SvxNumSettings_Impl>(pNew));
194  }
195  }
196  catch(const Exception&)
197  {
198  }
199  Reference<XNumberingFormatter> xFormat(xDefNum, UNO_QUERY);
200  m_xExamplesVS->SetNumberingSettings(aNumberings, xFormat, rLocale);
201 }
202 
204 {
205  m_xExamplesVSWin.reset();
206  m_xExamplesVS.reset();
207 }
208 
209 std::unique_ptr<SfxTabPage> SvxSingleNumPickTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
210  const SfxItemSet* rAttrSet)
211 {
212  return std::make_unique<SvxSingleNumPickTabPage>(pPage, pController, *rAttrSet);
213 }
214 
216 {
217  if( (bPreset || bModified) && pSaveNum)
218  {
219  *pSaveNum = *pActNum;
221  rSet->Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset));
222  }
223 
224  return bModified;
225 }
226 
228 {
229  const SfxPoolItem* pItem;
230  bPreset = false;
231  bool bIsPreset = false;
232  const SfxItemSet* pExampleSet = GetDialogExampleSet();
233  if(pExampleSet)
234  {
235  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
236  bIsPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
237  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
238  nActNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
239  }
240  if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
241  {
242  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
243  }
244  if(pActNum && *pSaveNum != *pActNum)
245  {
246  *pActNum = *pSaveNum;
247  m_xExamplesVS->SetNoSelection();
248  }
249 
250  if(pActNum && (!lcl_IsNumFmtSet(pActNum.get(), nActNumLvl) || bIsPreset))
251  {
252  m_xExamplesVS->SelectItem(1);
253  NumSelectHdl_Impl(m_xExamplesVS.get());
254  bPreset = true;
255  }
256  bPreset |= bIsPreset;
257 
258  bModified = false;
259 }
260 
262 {
263  if(_pSet)
264  FillItemSet(_pSet);
265  return DeactivateRC::LeavePage;
266 }
267 
269 {
270  const SfxPoolItem* pItem;
271 
272  // in Draw the item exists as WhichId, in Writer only as SlotId
273  SfxItemState eState = rSet->GetItemState(SID_ATTR_NUMBERING_RULE, false, &pItem);
274  if(eState != SfxItemState::SET)
275  {
276  nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
277  eState = rSet->GetItemState(nNumItemId, false, &pItem);
278 
279  if( eState != SfxItemState::SET )
280  {
281  pItem = &static_cast< const SvxNumBulletItem& >( rSet->Get( nNumItemId ) );
282  eState = SfxItemState::SET;
283  }
284  }
285  DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
286  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
287 
288  if(!pActNum)
289  pActNum.reset( new SvxNumRule(*pSaveNum) );
290  else if(*pSaveNum != *pActNum)
291  *pActNum = *pSaveNum;
292 }
293 
295 {
296  if(!pActNum)
297  return;
298 
299  bPreset = false;
300  bModified = true;
301  sal_uInt16 nIdx = m_xExamplesVS->GetSelectedItemId() - 1;
302  DBG_ASSERT(aNumSettingsArr.size() > nIdx, "wrong index");
303  if(aNumSettingsArr.size() <= nIdx)
304  return;
305  SvxNumSettings_Impl* _pSet = aNumSettingsArr[nIdx].get();
306  SvxNumType eNewType = _pSet->nNumberType;
307  const sal_Unicode cLocalPrefix = !_pSet->sPrefix.isEmpty() ? _pSet->sPrefix[0] : 0;
308  const sal_Unicode cLocalSuffix = !_pSet->sSuffix.isEmpty() ? _pSet->sSuffix[0] : 0;
309 
310  sal_uInt16 nMask = 1;
311  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
312  {
313  if(nActNumLvl & nMask)
314  {
315  SvxNumberFormat aFmt(pActNum->GetLevel(i));
316  aFmt.SetNumberingType(eNewType);
317  if(cLocalPrefix == ' ')
318  aFmt.SetPrefix( "" );
319  else
320  aFmt.SetPrefix(_pSet->sPrefix);
321  if(cLocalSuffix == ' ')
322  aFmt.SetSuffix( "" );
323  else
324  aFmt.SetSuffix(_pSet->sSuffix);
325  aFmt.SetCharFormatName("");
326  aFmt.SetBulletRelSize(100);
327  pActNum->SetLevel(i, aFmt);
328  }
329  nMask <<= 1;
330  }
331 }
332 
333 IMPL_LINK_NOARG(SvxSingleNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
334 {
335  NumSelectHdl_Impl(m_xExamplesVS.get());
336  weld::Button& rOk = GetDialogController()->GetOKButton();
337  rOk.clicked();
338 }
339 
341  : SfxTabPage(pPage, pController, "cui/ui/pickbulletpage.ui", "PickBulletPage", &rSet)
342  , nActNumLvl(SAL_MAX_UINT16)
343  , bModified(false)
344  , bPreset(false)
345  , nNumItemId(SID_ATTR_NUMBERING_RULE)
346  , m_xExamplesVS(new SvxNumValueSet(m_xBuilder->weld_scrolled_window("valuesetwin", true)))
347  , m_xExamplesVSWin(new weld::CustomWeld(*m_xBuilder, "valueset", *m_xExamplesVS))
348 {
350  m_xExamplesVS->init(NumberingPageType::BULLET);
351  m_xExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl));
352  m_xExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl));
353 }
354 
356 {
357  m_xExamplesVSWin.reset();
358  m_xExamplesVS.reset();
359 }
360 
361 std::unique_ptr<SfxTabPage> SvxBulletPickTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
362  const SfxItemSet* rAttrSet)
363 {
364  return std::make_unique<SvxBulletPickTabPage>(pPage, pController, *rAttrSet);
365 }
366 
368 {
369  if( (bPreset || bModified) && pActNum)
370  {
371  *pSaveNum = *pActNum;
373  rSet->Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset));
374  }
375  return bModified;
376 }
377 
379 {
380  const SfxPoolItem* pItem;
381  bPreset = false;
382  bool bIsPreset = false;
383  const SfxItemSet* pExampleSet = GetDialogExampleSet();
384  if(pExampleSet)
385  {
386  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
387  bIsPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
388  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
389  nActNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
390  }
391  if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
392  {
393  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
394  }
395  if(pActNum && *pSaveNum != *pActNum)
396  {
397  *pActNum = *pSaveNum;
398  m_xExamplesVS->SetNoSelection();
399  }
400 
401  if(pActNum && (!lcl_IsNumFmtSet(pActNum.get(), nActNumLvl) || bIsPreset))
402  {
403  m_xExamplesVS->SelectItem(1);
404  NumSelectHdl_Impl(m_xExamplesVS.get());
405  bPreset = true;
406  }
407  bPreset |= bIsPreset;
408  bModified = false;
409 }
410 
412 {
413  if(_pSet)
414  FillItemSet(_pSet);
415  return DeactivateRC::LeavePage;
416 }
417 
419 {
420  const SfxPoolItem* pItem;
421  // in Draw the item exists as WhichId, in Writer only as SlotId
422  SfxItemState eState = rSet->GetItemState(SID_ATTR_NUMBERING_RULE, false, &pItem);
423  if(eState != SfxItemState::SET)
424  {
425  nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
426  eState = rSet->GetItemState(nNumItemId, false, &pItem);
427 
428  if( eState != SfxItemState::SET )
429  {
430  pItem = &static_cast< const SvxNumBulletItem& >( rSet->Get( nNumItemId ) );
431  eState = SfxItemState::SET;
432  }
433 
434  }
435  DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
436  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
437 
438  if(!pActNum)
439  pActNum.reset( new SvxNumRule(*pSaveNum) );
440  else if(*pSaveNum != *pActNum)
441  *pActNum = *pSaveNum;
442 }
443 
444 IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
445 {
446  if(!pActNum)
447  return;
448 
449  bPreset = false;
450  bModified = true;
451  sal_Unicode cChar = aBulletTypes[m_xExamplesVS->GetSelectedItemId() - 1];
452  const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
453 
454  sal_uInt16 nMask = 1;
455  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
456  {
457  if(nActNumLvl & nMask)
458  {
459  SvxNumberFormat aFmt(pActNum->GetLevel(i));
461  // #i93908# clear suffix for bullet lists
462  aFmt.SetPrefix( OUString() );
463  aFmt.SetSuffix( OUString() );
464  aFmt.SetBulletFont(&rActBulletFont);
465  aFmt.SetBulletChar(cChar );
466  aFmt.SetCharFormatName(sBulletCharFormatName);
467  aFmt.SetBulletRelSize(45);
468  pActNum->SetLevel(i, aFmt);
469  }
470  nMask <<= 1;
471  }
472 }
473 
474 IMPL_LINK_NOARG(SvxBulletPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
475 {
476  NumSelectHdl_Impl(m_xExamplesVS.get());
477  weld::Button& rOk = GetDialogController()->GetOKButton();
478  rOk.clicked();
479 }
480 
482 {
483  const SfxStringItem* pBulletCharFmt = aSet.GetItem<SfxStringItem>(SID_BULLET_CHAR_FMT, false);
484 
485  if (pBulletCharFmt)
486  sBulletCharFormatName = pBulletCharFmt->GetValue();
487 }
488 
490  : SfxTabPage(pPage, pController, "cui/ui/pickoutlinepage.ui", "PickOutlinePage", &rSet)
491  , nActNumLvl(SAL_MAX_UINT16)
492  , nNumItemId(SID_ATTR_NUMBERING_RULE)
493  , bModified(false)
494  , bPreset(false)
495  , m_xExamplesVS(new SvxNumValueSet(m_xBuilder->weld_scrolled_window("valuesetwin", true)))
496  , m_xExamplesVSWin(new weld::CustomWeld(*m_xBuilder, "valueset", *m_xExamplesVS))
497 {
499 
500  m_xExamplesVS->init(NumberingPageType::OUTLINE);
501  m_xExamplesVS->SetSelectHdl(LINK(this, SvxNumPickTabPage, NumSelectHdl_Impl));
502  m_xExamplesVS->SetDoubleClickHdl(LINK(this, SvxNumPickTabPage, DoubleClickHdl_Impl));
503 
504  Reference<XDefaultNumberingProvider> xDefNum = SvxNumOptionsTabPageHelper::GetNumberingProvider();
505  if(!xDefNum.is())
506  return;
507 
508  Sequence<Reference<XIndexAccess> > aOutlineAccess;
510  try
511  {
512  aOutlineAccess = xDefNum->getDefaultOutlineNumberings( rLocale );
513 
514  for(sal_Int32 nItem = 0;
515  nItem < aOutlineAccess.getLength() && nItem < NUM_VALUSET_COUNT;
516  nItem++ )
517  {
518  SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[ nItem ];
519 
520  Reference<XIndexAccess> xLevel = aOutlineAccess.getConstArray()[nItem];
521  for(sal_Int32 nLevel = 0; nLevel < xLevel->getCount() && nLevel < 5; nLevel++)
522  {
523  Any aValueAny = xLevel->getByIndex(nLevel);
524  Sequence<PropertyValue> aLevelProps;
525  aValueAny >>= aLevelProps;
526  SvxNumSettings_Impl* pNew = lcl_CreateNumSettingsPtr(aLevelProps);
527  rItemArr.push_back( std::unique_ptr<SvxNumSettings_Impl>(pNew) );
528  }
529  }
530  }
531  catch(const Exception&)
532  {
533  }
534  Reference<XNumberingFormatter> xFormat(xDefNum, UNO_QUERY);
535  m_xExamplesVS->SetOutlineNumberingSettings(aOutlineAccess, xFormat, rLocale);
536 }
537 
539 {
540  m_xExamplesVSWin.reset();
541  m_xExamplesVS.reset();
542 }
543 
544 std::unique_ptr<SfxTabPage> SvxNumPickTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
545  const SfxItemSet* rAttrSet)
546 {
547  return std::make_unique<SvxNumPickTabPage>(pPage, pController, *rAttrSet);
548 }
549 
551 {
552  if( (bPreset || bModified) && pActNum)
553  {
554  *pSaveNum = *pActNum;
556  rSet->Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset));
557  }
558  return bModified;
559 }
560 
562 {
563  const SfxPoolItem* pItem;
564  bPreset = false;
565  bool bIsPreset = false;
566  const SfxItemSet* pExampleSet = GetDialogExampleSet();
567  if(pExampleSet)
568  {
569  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
570  bIsPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
571  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
572  nActNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
573  }
574  if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
575  {
576  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
577  }
578  if(pActNum && *pSaveNum != *pActNum)
579  {
580  *pActNum = *pSaveNum;
581  m_xExamplesVS->SetNoSelection();
582  }
583 
584  if(pActNum && (!lcl_IsNumFmtSet(pActNum.get(), nActNumLvl) || bIsPreset))
585  {
586  m_xExamplesVS->SelectItem(1);
587  NumSelectHdl_Impl(m_xExamplesVS.get());
588  bPreset = true;
589  }
590  bPreset |= bIsPreset;
591  bModified = false;
592 }
593 
595 {
596  if(_pSet)
597  FillItemSet(_pSet);
598  return DeactivateRC::LeavePage;
599 }
600 
602 {
603  const SfxPoolItem* pItem;
604  // in Draw the item exists as WhichId, in Writer only as SlotId
605  SfxItemState eState = rSet->GetItemState(SID_ATTR_NUMBERING_RULE, false, &pItem);
606  if(eState != SfxItemState::SET)
607  {
608  nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
609  eState = rSet->GetItemState(nNumItemId, false, &pItem);
610 
611  if( eState != SfxItemState::SET )
612  {
613  pItem = &static_cast< const SvxNumBulletItem& >( rSet->Get( nNumItemId ) );
614  eState = SfxItemState::SET;
615  }
616 
617  }
618  DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
619  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
620 
621  if(!pActNum)
622  pActNum.reset( new SvxNumRule(*pSaveNum) );
623  else if(*pSaveNum != *pActNum)
624  *pActNum = *pSaveNum;
625 
626 }
627 
628 // all levels are changed here
629 IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
630 {
631  if(!pActNum)
632  return;
633 
634  bPreset = false;
635  bModified = true;
636 
637  const FontList* pList = nullptr;
638 
639  SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[m_xExamplesVS->GetSelectedItemId() - 1];
640 
641  const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
642  SvxNumSettings_Impl* pLevelSettings = nullptr;
643  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
644  {
645  if(rItemArr.size() > i)
646  pLevelSettings = rItemArr[i].get();
647  if(!pLevelSettings)
648  break;
649  SvxNumberFormat aFmt(pActNum->GetLevel(i));
650  aFmt.SetNumberingType( pLevelSettings->nNumberType );
651  sal_uInt16 nUpperLevelOrChar = static_cast<sal_uInt16>(pLevelSettings->nParentNumbering);
652  if(aFmt.GetNumberingType() == SVX_NUM_CHAR_SPECIAL)
653  {
654  // #i93908# clear suffix for bullet lists
655  aFmt.SetPrefix(OUString());
656  aFmt.SetSuffix(OUString());
657  if( !pLevelSettings->sBulletFont.isEmpty() &&
658  pLevelSettings->sBulletFont != rActBulletFont.GetFamilyName())
659  {
660  //search for the font
661  if(!pList)
662  {
663  SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
664  const SvxFontListItem* pFontListItem =
665  static_cast<const SvxFontListItem*>( pCurDocShell
666  ->GetItem( SID_ATTR_CHAR_FONTLIST ));
667  pList = pFontListItem ? pFontListItem->GetFontList() : nullptr;
668  }
669  if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) )
670  {
671  FontMetric aFontMetric = pList->Get(
672  pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE);
673  vcl::Font aFont(aFontMetric);
674  aFmt.SetBulletFont(&aFont);
675  }
676  else
677  {
678  //if it cannot be found then create a new one
679  vcl::Font aCreateFont( pLevelSettings->sBulletFont,
680  OUString(), Size( 0, 14 ) );
681  aCreateFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW );
682  aCreateFont.SetFamily( FAMILY_DONTKNOW );
683  aCreateFont.SetPitch( PITCH_DONTKNOW );
684  aCreateFont.SetWeight( WEIGHT_DONTKNOW );
685  aCreateFont.SetTransparent( true );
686  aFmt.SetBulletFont( &aCreateFont );
687  }
688  }
689  else
690  aFmt.SetBulletFont( &rActBulletFont );
691 
692  aFmt.SetBulletChar( !pLevelSettings->sBulletChar.isEmpty()
693  ? pLevelSettings->sBulletChar.iterateCodePoints(
694  &o3tl::temporary(sal_Int32(0)))
695  : 0 );
696  aFmt.SetCharFormatName( sBulletCharFormatName );
697  aFmt.SetBulletRelSize(45);
698  }
699  else
700  {
701  aFmt.SetIncludeUpperLevels(sal::static_int_cast< sal_uInt8 >(0 != nUpperLevelOrChar ? pActNum->GetLevelCount() : 0));
702  aFmt.SetCharFormatName(sNumCharFmtName);
703  aFmt.SetBulletRelSize(100);
704  // #i93908#
705  aFmt.SetPrefix(pLevelSettings->sPrefix);
706  aFmt.SetSuffix(pLevelSettings->sSuffix);
707  }
708  pActNum->SetLevel(i, aFmt);
709  }
710 }
711 
712 IMPL_LINK_NOARG(SvxNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
713 {
714  NumSelectHdl_Impl(m_xExamplesVS.get());
715  weld::Button& rOk = GetDialogController()->GetOKButton();
716  rOk.clicked();
717 }
718 
720 {
721  const SfxStringItem* pNumCharFmt = aSet.GetItem<SfxStringItem>(SID_NUM_CHAR_FMT, false);
722  const SfxStringItem* pBulletCharFmt = aSet.GetItem<SfxStringItem>(SID_BULLET_CHAR_FMT, false);
723 
724 
725  if (pNumCharFmt &&pBulletCharFmt)
726  SetCharFormatNames( pNumCharFmt->GetValue(),pBulletCharFmt->GetValue());
727 }
728 
730  : SfxTabPage(pPage, pController, "cui/ui/pickgraphicpage.ui", "PickGraphicPage", &rSet)
731  , nActNumLvl(SAL_MAX_UINT16)
732  , nNumItemId(SID_ATTR_NUMBERING_RULE)
733  , bModified(false)
734  , bPreset(false)
735  , m_xErrorText(m_xBuilder->weld_label("errorft"))
736  , m_xBtBrowseFile(m_xBuilder->weld_button("browseBtn"))
737  , m_xExamplesVS(new SvxBmpNumValueSet(m_xBuilder->weld_scrolled_window("valuesetwin", true)))
738  , m_xExamplesVSWin(new weld::CustomWeld(*m_xBuilder, "valueset", *m_xExamplesVS))
739 {
741 
742  m_xExamplesVS->init();
743  m_xExamplesVS->SetSelectHdl(LINK(this, SvxBitmapPickTabPage, NumSelectHdl_Impl));
744  m_xExamplesVS->SetDoubleClickHdl(LINK(this, SvxBitmapPickTabPage, DoubleClickHdl_Impl));
745  m_xBtBrowseFile->connect_clicked(LINK(this, SvxBitmapPickTabPage, ClickAddBrowseHdl_Impl));
746 
747  eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
748 
749  // determine graphic name
751 
752  size_t i = 0;
753  for (auto & grfName : aGrfNames)
754  {
755  m_xExamplesVS->InsertItem( i + 1, i);
756 
757  INetURLObject aObj(grfName);
758  if(aObj.GetProtocol() == INetProtocol::File)
759  grfName = aObj.PathToFileName();
760 
761  m_xExamplesVS->SetItemText( i + 1, grfName );
762  ++i;
763  }
764 
765  if(aGrfNames.empty())
766  {
767  m_xErrorText->show();
768  }
769  else
770  {
771  m_xExamplesVS->Show();
772  m_xExamplesVS->SetFormat();
773  m_xExamplesVS->Invalidate();
774  }
775 }
776 
778 {
779  m_xExamplesVSWin.reset();
780  m_xExamplesVS.reset();
781 }
782 
783 std::unique_ptr<SfxTabPage> SvxBitmapPickTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
784  const SfxItemSet* rAttrSet)
785 {
786  return std::make_unique<SvxBitmapPickTabPage>(pPage, pController, *rAttrSet);
787 }
788 
790 {
791  const SfxPoolItem* pItem;
792  bPreset = false;
793  bool bIsPreset = false;
794  const SfxItemSet* pExampleSet = GetDialogExampleSet();
795  if(pExampleSet)
796  {
797  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
798  bIsPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
799  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
800  nActNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
801  }
802  if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
803  {
804  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
805  }
806  if(pActNum && *pSaveNum != *pActNum)
807  {
808  *pActNum = *pSaveNum;
809  m_xExamplesVS->SetNoSelection();
810  }
811 
812  if(!aGrfNames.empty() &&
813  (pActNum && (!lcl_IsNumFmtSet(pActNum.get(), nActNumLvl) || bIsPreset)))
814  {
815  m_xExamplesVS->SelectItem(1);
816  NumSelectHdl_Impl(m_xExamplesVS.get());
817  bPreset = true;
818  }
819  bPreset |= bIsPreset;
820  bModified = false;
821 }
822 
824 {
825  if(_pSet)
826  FillItemSet(_pSet);
827  return DeactivateRC::LeavePage;
828 }
829 
831 {
832  if ( aGrfNames.empty() )
833  {
834  return false;
835  }
836  if( (bPreset || bModified) && pActNum)
837  {
838  *pSaveNum = *pActNum;
840  rSet->Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset));
841  }
842 
843  return bModified;
844 }
845 
847 {
848  const SfxPoolItem* pItem;
849  // in Draw the item exists as WhichId, in Writer only as SlotId
850  SfxItemState eState = rSet->GetItemState(SID_ATTR_NUMBERING_RULE, false, &pItem);
851  if(eState != SfxItemState::SET)
852  {
853  nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
854  eState = rSet->GetItemState(nNumItemId, false, &pItem);
855 
856  if( eState != SfxItemState::SET )
857  {
858  pItem = &static_cast< const SvxNumBulletItem& >( rSet->Get( nNumItemId ) );
859  eState = SfxItemState::SET;
860  }
861 
862  }
863  DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
864  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
865 
866  if(!pActNum)
867  pActNum.reset( new SvxNumRule(*pSaveNum) );
868  else if(*pSaveNum != *pActNum)
869  *pActNum = *pSaveNum;
870 }
871 
872 IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
873 {
874  if(!pActNum)
875  return;
876 
877  bPreset = false;
878  bModified = true;
879  sal_uInt16 nIdx = m_xExamplesVS->GetSelectedItemId() - 1;
880 
881  sal_uInt16 nMask = 1;
882  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
883  {
884  if(nActNumLvl & nMask)
885  {
886  SvxNumberFormat aFmt(pActNum->GetLevel(i));
888  aFmt.SetPrefix( "" );
889  aFmt.SetSuffix( "" );
890  aFmt.SetCharFormatName( "" );
891 
892  Graphic aGraphic;
894  {
895  Size aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
896  sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
897  aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(eCoreUnit));
898  SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH );
899  aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient );
900  }
901  else if(aGrfNames.size() > nIdx)
902  aFmt.SetGraphic( aGrfNames[nIdx] );
903  pActNum->SetLevel(i, aFmt);
904  }
905  nMask <<= 1;
906  }
907 }
908 
909 IMPL_LINK_NOARG(SvxBitmapPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
910 {
911  NumSelectHdl_Impl(m_xExamplesVS.get());
912  weld::Button& rOk = GetDialogController()->GetOKButton();
913  rOk.clicked();
914 }
915 
916 IMPL_LINK_NOARG(SvxBitmapPickTabPage, ClickAddBrowseHdl_Impl, weld::Button&, void)
917 {
918  sfx2::FileDialogHelper aFileDialog(0, FileDialogFlags::NONE, GetFrameWeld());
919  aFileDialog.SetTitle(CuiResId(RID_SVXSTR_ADD_IMAGE));
920  if ( aFileDialog.Execute() != ERRCODE_NONE )
921  return;
922 
923  OUString aPath = SvtPathOptions().GetGalleryPath();
924  OUString aPathToken = aPath.getToken( 1 , SEARCHPATH_DELIMITER );
925 
926  OUString aUserImageURL = aFileDialog.GetPath();
927 
928  OUString aFileName;
929  const sal_Int32 nPos {aUserImageURL.lastIndexOf(SEARCHFILENAME_DELIMITER)+1};
930  if (nPos<=0)
931  aFileName = aUserImageURL;
932  else if (nPos<aUserImageURL.getLength())
933  aFileName = aUserImageURL.copy(nPos);
934 
935  OUString aUserGalleryURL = aPathToken + "/" + aFileName;
936  INetURLObject aURL( aUserImageURL );
937  DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
938 
939  GraphicDescriptor aDescriptor(aURL);
940  if (!aDescriptor.Detect())
941  return;
942 
943  uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
944  uno::Reference<ucb::XSimpleFileAccess3> xSimpleFileAccess(
945  ucb::SimpleFileAccess::create( ::comphelper::getComponentContext(xFactory) ) );
946  if ( !xSimpleFileAccess->exists( aUserImageURL ))
947  return;
948 
949  xSimpleFileAccess->copy( aUserImageURL, aUserGalleryURL );
950  INetURLObject gURL( aUserGalleryURL );
951  std::unique_ptr<SvStream> pIn(::utl::UcbStreamHelper::CreateStream(
952  gURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ ));
953  if ( !pIn )
954  return;
955 
956  Graphic aGraphic;
957  GraphicConverter::Import( *pIn, aGraphic );
958 
959  BitmapEx aBitmap = aGraphic.GetBitmapEx();
960  tools::Long nPixelX = aBitmap.GetSizePixel().Width();
961  tools::Long nPixelY = aBitmap.GetSizePixel().Height();
962  double ratio = nPixelY/static_cast<double>(nPixelX);
963  if(nPixelX > 30)
964  {
965  nPixelX = 30;
966  nPixelY = static_cast<tools::Long>(nPixelX*ratio);
967  }
968  if(nPixelY > 30)
969  {
970  nPixelY = 30;
971  nPixelX = static_cast<tools::Long>(nPixelY/ratio);
972  }
973 
974  aBitmap.Scale( Size( nPixelX, nPixelY ), BmpScaleFlag::Fast );
975  Graphic aScaledGraphic( aBitmap );
977 
978  Sequence< PropertyValue > aFilterData( 2 );
979  aFilterData[ 0 ].Name = "Compression";
980  aFilterData[ 0 ].Value <<= sal_Int32(-1) ;
981  aFilterData[ 1 ].Name = "Quality";
982  aFilterData[ 1 ].Value <<= sal_Int32(1);
983 
984  sal_uInt16 nFilterFormat = rFilter.GetExportFormatNumberForShortName( gURL.GetFileExtension() );
985  rFilter.ExportGraphic( aScaledGraphic, gURL , nFilterFormat, &aFilterData );
987 
988  aGrfNames.push_back(aUserGalleryURL);
989  size_t i = 0;
990  for (auto & grfName : aGrfNames)
991  {
992  m_xExamplesVS->InsertItem( i + 1, i);
993  INetURLObject aObj(grfName);
994  if(aObj.GetProtocol() == INetProtocol::File)
995  grfName = aObj.PathToFileName();
996  m_xExamplesVS->SetItemText( i + 1, grfName );
997  ++i;
998  }
999 
1000  if(aGrfNames.empty())
1001  {
1002  m_xErrorText->show();
1003  }
1004  else
1005  {
1006  m_xExamplesVS->Show();
1007  m_xExamplesVS->SetFormat();
1008  }
1009 }
1010 
1011 // tabpage numbering options
1013  const SfxItemSet& rSet)
1014  : SfxTabPage(pPage, pController, "cui/ui/numberingoptionspage.ui", "NumberingOptionsPage", &rSet)
1015  , m_pLevelHdlEvent(nullptr)
1016  , bLastWidthModified(false)
1017  , bModified(false)
1018  , bPreset(false)
1019  , bAutomaticCharStyles(true)
1020  , bHTMLMode(false)
1021  , nBullet(0xff)
1022  , nActNumLvl(1)
1023  , nNumItemId(SID_ATTR_NUMBERING_RULE)
1024  , m_xGrid(m_xBuilder->weld_widget("grid2"))
1025  , m_xLevelLB(m_xBuilder->weld_tree_view("levellb"))
1026  , m_xFmtLB(m_xBuilder->weld_combo_box("numfmtlb"))
1027  , m_xSeparatorFT(m_xBuilder->weld_label("separator"))
1028  , m_xPrefixFT(m_xBuilder->weld_label("prefixft"))
1029  , m_xPrefixED(m_xBuilder->weld_entry("prefix"))
1030  , m_xSuffixFT(m_xBuilder->weld_label("suffixft"))
1031  , m_xSuffixED(m_xBuilder->weld_entry("suffix"))
1032  , m_xCharFmtFT(m_xBuilder->weld_label("charstyleft"))
1033  , m_xCharFmtLB(m_xBuilder->weld_combo_box("charstyle"))
1034  , m_xBulColorFT(m_xBuilder->weld_label("colorft"))
1035  , m_xBulColLB(new ColorListBox(m_xBuilder->weld_menu_button("color"), pController->getDialog()))
1036  , m_xBulRelSizeFT(m_xBuilder->weld_label("relsizeft"))
1037  , m_xBulRelSizeMF(m_xBuilder->weld_metric_spin_button("relsize", FieldUnit::PERCENT))
1038  , m_xAllLevelFT(m_xBuilder->weld_label("sublevelsft"))
1039  , m_xAllLevelNF(m_xBuilder->weld_spin_button("sublevels"))
1040  , m_xStartFT(m_xBuilder->weld_label("startatft"))
1041  , m_xStartED(m_xBuilder->weld_spin_button("startat"))
1042  , m_xBulletFT(m_xBuilder->weld_label("bulletft"))
1043  , m_xBulletPB(m_xBuilder->weld_button("bullet"))
1044  , m_xBitmapFT(m_xBuilder->weld_label("bitmapft"))
1045  , m_xBitmapMB(m_xBuilder->weld_menu_button("bitmap"))
1046  , m_xWidthFT(m_xBuilder->weld_label("widthft"))
1047  , m_xWidthMF(m_xBuilder->weld_metric_spin_button("widthmf", FieldUnit::CM))
1048  , m_xHeightFT(m_xBuilder->weld_label("heightft"))
1049  , m_xHeightMF(m_xBuilder->weld_metric_spin_button("heightmf", FieldUnit::CM))
1050  , m_xRatioCB(m_xBuilder->weld_check_button("keepratio"))
1051  , m_xOrientFT(m_xBuilder->weld_label("orientft"))
1052  , m_xOrientLB(m_xBuilder->weld_combo_box("orientlb"))
1053  , m_xAllLevelsFrame(m_xBuilder->weld_widget("levelsframe"))
1054  , m_xSameLevelCB(m_xBuilder->weld_check_button("allsame"))
1055  , m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWIN))
1056 {
1057  m_xBulColLB->SetSlotId(SID_ATTR_CHAR_COLOR);
1058  m_xBulRelSizeMF->set_min(SVX_NUM_REL_SIZE_MIN, FieldUnit::PERCENT);
1059  m_xBulRelSizeMF->set_increments(5, 50, FieldUnit::PERCENT);
1062 
1063  m_xBulletPB->connect_clicked(LINK(this, SvxNumOptionsTabPage, BulletHdl_Impl));
1064  m_xFmtLB->connect_changed(LINK(this, SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl));
1065  m_xBitmapMB->connect_selected(LINK(this, SvxNumOptionsTabPage, GraphicHdl_Impl));
1066  m_xBitmapMB->connect_toggled(LINK(this, SvxNumOptionsTabPage, PopupActivateHdl_Impl));
1067  m_xLevelLB->set_selection_mode(SelectionMode::Multiple);
1068  m_xLevelLB->connect_changed(LINK(this, SvxNumOptionsTabPage, LevelHdl_Impl));
1069  m_xCharFmtLB->connect_changed(LINK(this, SvxNumOptionsTabPage, CharFmtHdl_Impl));
1070  m_xWidthMF->connect_value_changed(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl));
1071  m_xHeightMF->connect_value_changed(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl));
1072  m_xRatioCB->connect_toggled(LINK(this, SvxNumOptionsTabPage, RatioHdl_Impl));
1073  m_xStartED->connect_value_changed(LINK(this, SvxNumOptionsTabPage, SpinModifyHdl_Impl));
1074  m_xPrefixED->connect_changed(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
1075  m_xSuffixED->connect_changed(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl));
1076  m_xAllLevelNF->connect_value_changed(LINK(this,SvxNumOptionsTabPage, AllLevelHdl_Impl));
1077  m_xOrientLB->connect_changed(LINK(this, SvxNumOptionsTabPage, OrientHdl_Impl));
1078  m_xSameLevelCB->connect_toggled(LINK(this, SvxNumOptionsTabPage, SameLevelHdl_Impl));
1079  m_xBulRelSizeMF->connect_value_changed(LINK(this,SvxNumOptionsTabPage, BulRelSizeHdl_Impl));
1080  m_xBulColLB->SetSelectHdl(LINK(this, SvxNumOptionsTabPage, BulColorHdl_Impl));
1081  aInvalidateTimer.SetInvokeHandler(LINK(this, SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl));
1083 
1084  eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
1085 
1086  // Fill ListBox with predefined / translated numbering types.
1087  sal_uInt32 nCount = SvxNumberingTypeTable::Count();
1088  for (sal_uInt32 i = 0; i < nCount; ++i)
1089  {
1091  }
1092 
1093  // Get advanced numbering types from the component.
1094  // Watch out for the ugly
1095  // 136 == 0x88 == SVX_NUM_BITMAP|0x80 == SVX_NUM_BITMAP|LINK_TOKEN
1096  // to not remove that.
1098 
1099  m_xFmtLB->set_active(0);
1100 
1101  m_xCharFmtLB->set_size_request(m_xCharFmtLB->get_approximate_digit_width() * 10, -1);
1102  Size aSize(m_xGrid->get_preferred_size());
1103  m_xGrid->set_size_request(aSize.Width(), -1);
1104 }
1105 
1107 {
1108  m_xPreviewWIN.reset();
1109  m_xBulColLB.reset();
1110  pActNum.reset();
1111  pSaveNum.reset();
1112  if (m_pLevelHdlEvent)
1113  {
1115  m_pLevelHdlEvent = nullptr;
1116  }
1117 }
1118 
1120 {
1121  if(eMetric == FieldUnit::MM)
1122  {
1123  m_xWidthMF->set_digits(1);
1124  m_xHeightMF->set_digits(1);
1125  }
1126  m_xWidthMF->set_unit(eMetric);
1127  m_xHeightMF->set_unit(eMetric);
1128 }
1129 
1130 std::unique_ptr<SfxTabPage> SvxNumOptionsTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
1131  const SfxItemSet* rAttrSet)
1132 {
1133  return std::make_unique<SvxNumOptionsTabPage>(pPage, pController, *rAttrSet);
1134 };
1135 
1137 {
1138  const SfxPoolItem* pItem;
1139  const SfxItemSet* pExampleSet = GetDialogExampleSet();
1140  sal_uInt16 nTmpNumLvl = 1;
1141  if(pExampleSet)
1142  {
1143  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
1144  bPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
1145  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
1146  nTmpNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
1147  }
1148  if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
1149  {
1150  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
1151  }
1152 
1153  bModified = (!pActNum->Get( 0 ) || bPreset);
1154  if(*pActNum == *pSaveNum && nActNumLvl == nTmpNumLvl)
1155  return;
1156 
1157  nActNumLvl = nTmpNumLvl;
1158  sal_uInt16 nMask = 1;
1159  m_xLevelLB->unselect_all();
1160  if (nActNumLvl == SAL_MAX_UINT16)
1161  m_xLevelLB->select(pActNum->GetLevelCount());
1162  if(nActNumLvl != SAL_MAX_UINT16)
1163  {
1164  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
1165  {
1166  if(nActNumLvl & nMask)
1167  m_xLevelLB->select(i);
1168  nMask <<= 1 ;
1169  }
1170  }
1171  *pActNum = *pSaveNum;
1172 
1173  InitControls();
1174 }
1175 
1177 {
1178  if(_pSet)
1179  FillItemSet(_pSet);
1180  return DeactivateRC::LeavePage;
1181 }
1182 
1184 {
1185  rSet->Put(SfxUInt16Item(SID_PARAM_CUR_NUM_LEVEL, nActNumLvl));
1186  if(bModified && pActNum)
1187  {
1188  *pSaveNum = *pActNum;
1190  rSet->Put(SfxBoolItem(SID_PARAM_NUM_PRESET, false));
1191  }
1192  return bModified;
1193 };
1194 
1196 {
1197  const SfxPoolItem* pItem;
1198  // in Draw the item exists as WhichId, in Writer only as SlotId
1199  SfxItemState eState = rSet->GetItemState(SID_ATTR_NUMBERING_RULE, false, &pItem);
1200  if(eState != SfxItemState::SET)
1201  {
1202  nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
1203  eState = rSet->GetItemState(nNumItemId, false, &pItem);
1204 
1205  if( eState != SfxItemState::SET )
1206  {
1207  pItem = &static_cast< const SvxNumBulletItem& >( rSet->Get( nNumItemId ) );
1208  eState = SfxItemState::SET;
1209  }
1210 
1211  }
1212  DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
1213  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
1214 
1215  // insert levels
1216  if (!m_xLevelLB->n_children())
1217  {
1218  for(sal_uInt16 i = 1; i <= pSaveNum->GetLevelCount(); i++)
1219  m_xLevelLB->append_text(OUString::number(i));
1220  if(pSaveNum->GetLevelCount() > 1)
1221  {
1222  OUString sEntry = "1 - " + OUString::number( pSaveNum->GetLevelCount() );
1223  m_xLevelLB->append_text(sEntry);
1224  m_xLevelLB->select_text(sEntry);
1225  }
1226  else
1227  m_xLevelLB->select(0);
1228  }
1229  else
1230  m_xLevelLB->select(m_xLevelLB->n_children() - 1);
1231 
1232  sal_uInt16 nMask = 1;
1233  m_xLevelLB->unselect_all();
1234  if (nActNumLvl == SAL_MAX_UINT16)
1235  {
1236  m_xLevelLB->select( pSaveNum->GetLevelCount() );
1237  }
1238  else
1239  {
1240  for(sal_uInt16 i = 0; i < pSaveNum->GetLevelCount(); i++)
1241  {
1242  if(nActNumLvl & nMask)
1243  m_xLevelLB->select( i );
1244  nMask <<= 1 ;
1245  }
1246  }
1247 
1248  if(!pActNum)
1249  pActNum.reset( new SvxNumRule(*pSaveNum) );
1250  else if(*pSaveNum != *pActNum)
1251  *pActNum = *pSaveNum;
1253  m_xSameLevelCB->set_active(pActNum->IsContinuousNumbering());
1254 
1255  SfxObjectShell* pShell;
1256  if ( SfxItemState::SET == rSet->GetItemState( SID_HTML_MODE, false, &pItem )
1257  || ( nullptr != ( pShell = SfxObjectShell::Current()) &&
1258  nullptr != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) )
1259  {
1260  sal_uInt16 nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
1261  bHTMLMode = 0 != (nHtmlMode&HTMLMODE_ON);
1262  }
1263 
1264  bool bCharFmt = pActNum->IsFeatureSupported(SvxNumRuleFlags::CHAR_STYLE);
1265  m_xCharFmtFT->set_visible(bCharFmt);
1266  m_xCharFmtLB->set_visible(bCharFmt);
1267 
1268  bool bContinuous = pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS);
1269 
1270  bool bAllLevel = bContinuous && !bHTMLMode;
1271  m_xAllLevelFT->set_visible(bAllLevel);
1272  m_xAllLevelNF->set_visible(bAllLevel);
1273 
1274  m_xAllLevelsFrame->set_visible(bContinuous);
1275 
1276  // again misusage: in Draw there is numeration only until the bitmap
1277  // without SVX_NUM_NUMBER_NONE
1278  //remove types that are unsupported by Draw/Impress
1279  if(!bContinuous)
1280  {
1281  sal_Int32 nFmtCount = m_xFmtLB->get_count();
1282  for(sal_Int32 i = nFmtCount; i; i--)
1283  {
1284  sal_uInt16 nEntryData = m_xFmtLB->get_id(i - 1).toUInt32();
1285  if(/*SVX_NUM_NUMBER_NONE == nEntryData ||*/
1286  (SVX_NUM_BITMAP|LINK_TOKEN) == nEntryData)
1287  m_xFmtLB->remove(i - 1);
1288  }
1289  }
1290  //one must be enabled
1291  if(!pActNum->IsFeatureSupported(SvxNumRuleFlags::ENABLE_LINKED_BMP))
1292  {
1293  auto nPos = m_xFmtLB->find_id(OUString::number(SVX_NUM_BITMAP|LINK_TOKEN));
1294  if (nPos != -1)
1295  m_xFmtLB->remove(nPos);
1296  }
1297  else if(!pActNum->IsFeatureSupported(SvxNumRuleFlags::ENABLE_EMBEDDED_BMP))
1298  {
1299  auto nPos = m_xFmtLB->find_id(OUString::number(SVX_NUM_BITMAP));
1300  if (nPos != -1)
1301  m_xFmtLB->remove(nPos);
1302  }
1303 
1304  // MegaHack: because of a not-fixable 'design mistake/error' in Impress
1305  // delete all kinds of numeric enumerations
1306  if(pActNum->IsFeatureSupported(SvxNumRuleFlags::NO_NUMBERS))
1307  {
1308  sal_Int32 nFmtCount = m_xFmtLB->get_count();
1309  for(sal_Int32 i = nFmtCount; i; i--)
1310  {
1311  sal_uInt16 nEntryData = m_xFmtLB->get_id(i - 1).toUInt32();
1312  if( /*nEntryData >= SVX_NUM_CHARS_UPPER_LETTER &&*/ nEntryData <= SVX_NUM_NUMBER_NONE)
1313  m_xFmtLB->remove(i - 1);
1314  }
1315  }
1316 
1317  InitControls();
1318  bModified = false;
1319 }
1320 
1322 {
1323  bool bShowBullet = true;
1324  bool bShowBitmap = true;
1325  bool bSameType = true;
1326  bool bSameStart = true;
1327  bool bSamePrefix = true;
1328  bool bSameSuffix = true;
1329  bool bAllLevel = true;
1330  bool bSameCharFmt = true;
1331  bool bSameVOrient = true;
1332  bool bSameSize = true;
1333  bool bSameBulColor = true;
1334  bool bSameBulRelSize= true;
1335 
1336  const SvxNumberFormat* aNumFmtArr[SVX_MAX_NUM];
1337  OUString sFirstCharFmt;
1338  sal_Int16 eFirstOrient = text::VertOrientation::NONE;
1339  Size aFirstSize(0,0);
1340  sal_uInt16 nMask = 1;
1341  sal_uInt16 nLvl = SAL_MAX_UINT16;
1342  sal_uInt16 nHighestLevel = 0;
1343 
1344  bool bBullColor = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_COLOR);
1345  bool bBullRelSize = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_REL_SIZE);
1346  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
1347  {
1348  if(nActNumLvl & nMask)
1349  {
1350  aNumFmtArr[i] = &pActNum->GetLevel(i);
1351  bShowBullet &= aNumFmtArr[i]->GetNumberingType() == SVX_NUM_CHAR_SPECIAL;
1352  bShowBitmap &= (aNumFmtArr[i]->GetNumberingType()&(~LINK_TOKEN)) == SVX_NUM_BITMAP;
1353  if(SAL_MAX_UINT16 == nLvl)
1354  {
1355  nLvl = i;
1356  sFirstCharFmt = aNumFmtArr[i]->GetCharFormatName();
1357  eFirstOrient = aNumFmtArr[i]->GetVertOrient();
1358  if(bShowBitmap)
1359  aFirstSize = aNumFmtArr[i]->GetGraphicSize();
1360  }
1361  if( i > nLvl)
1362  {
1363  bSameType &= aNumFmtArr[i]->GetNumberingType() == aNumFmtArr[nLvl]->GetNumberingType();
1364  bSameStart = aNumFmtArr[i]->GetStart() == aNumFmtArr[nLvl]->GetStart();
1365 
1366  bSamePrefix = aNumFmtArr[i]->GetPrefix() == aNumFmtArr[nLvl]->GetPrefix();
1367  bSameSuffix = aNumFmtArr[i]->GetSuffix() == aNumFmtArr[nLvl]->GetSuffix();
1368  bAllLevel &= aNumFmtArr[i]->GetIncludeUpperLevels() == aNumFmtArr[nLvl]->GetIncludeUpperLevels();
1369  bSameCharFmt &= sFirstCharFmt == aNumFmtArr[i]->GetCharFormatName();
1370  bSameVOrient &= eFirstOrient == aNumFmtArr[i]->GetVertOrient();
1371  if(bShowBitmap && bSameSize)
1372  bSameSize &= aNumFmtArr[i]->GetGraphicSize() == aFirstSize;
1373  bSameBulColor &= aNumFmtArr[i]->GetBulletColor() == aNumFmtArr[nLvl]->GetBulletColor();
1374  bSameBulRelSize &= aNumFmtArr[i]->GetBulletRelSize() == aNumFmtArr[nLvl]->GetBulletRelSize();
1375  }
1376  nHighestLevel = i;
1377  }
1378  else
1379  aNumFmtArr[i] = nullptr;
1380 
1381  nMask <<= 1 ;
1382  }
1383  SwitchNumberType(bShowBullet ? 1 : bShowBitmap ? 2 : 0);
1384 
1385  sal_uInt16 nNumberingType;
1386  if (nLvl != SAL_MAX_UINT16)
1387  nNumberingType = aNumFmtArr[nLvl]->GetNumberingType();
1388  else
1389  {
1390  nNumberingType = SVX_NUM_NUMBER_NONE;
1391  bAllLevel = false;
1392  bSameBulRelSize = false;
1393  bSameBulColor = false;
1394  bSameStart = false;
1395  bSamePrefix = false;
1396  bSameSuffix = false;
1397  }
1398 
1399  CheckForStartValue_Impl(nNumberingType);
1400 
1401  if(bShowBitmap)
1402  {
1403  if(!bSameVOrient || eFirstOrient == text::VertOrientation::NONE)
1404  m_xOrientLB->set_active(-1);
1405  else
1406  m_xOrientLB->set_active(
1407  sal::static_int_cast< sal_Int32 >(eFirstOrient - 1));
1408  // no text::VertOrientation::NONE
1409 
1410  if(bSameSize)
1411  {
1412  SetMetricValue(*m_xHeightMF, aFirstSize.Height(), eCoreUnit);
1413  SetMetricValue(*m_xWidthMF, aFirstSize.Width(), eCoreUnit);
1414  }
1415  else
1416  {
1417  m_xHeightMF->set_text("");
1418  m_xWidthMF->set_text("");
1419  }
1420  }
1421 
1422  if(bSameType)
1423  {
1424  sal_uInt16 nLBData = nNumberingType;
1425  m_xFmtLB->set_active_id(OUString::number(nLBData));
1426  }
1427  else
1428  m_xFmtLB->set_active(-1);
1429 
1430  m_xAllLevelNF->set_sensitive(nHighestLevel > 0 && !m_xSameLevelCB->get_active());
1431  m_xAllLevelNF->set_max(nHighestLevel + 1);
1432  if(bAllLevel)
1433  {
1434  m_xAllLevelNF->set_value(aNumFmtArr[nLvl]->GetIncludeUpperLevels());
1435  }
1436  else
1437  {
1438  m_xAllLevelNF->set_text("");
1439  }
1440 
1441  if(bBullRelSize)
1442  {
1443  if(bSameBulRelSize)
1444  m_xBulRelSizeMF->set_value(aNumFmtArr[nLvl]->GetBulletRelSize(), FieldUnit::PERCENT);
1445  else
1446  m_xBulRelSizeMF->set_text("");
1447  }
1448  if(bBullColor)
1449  {
1450  if(bSameBulColor)
1451  m_xBulColLB->SelectEntry(aNumFmtArr[nLvl]->GetBulletColor());
1452  else
1453  m_xBulColLB->SetNoSelection();
1454  }
1455  switch(nBullet)
1456  {
1457  case SHOW_NUMBERING:
1458  if(bSameStart)
1459  {
1460  m_xStartED->set_value(aNumFmtArr[nLvl]->GetStart());
1461  }
1462  else
1463  m_xStartED->set_text("");
1464  break;
1465  case SHOW_BULLET:
1466  break;
1467  case SHOW_BITMAP:
1468  break;
1469  }
1470 
1471  if(bSamePrefix)
1472  m_xPrefixED->set_text(aNumFmtArr[nLvl]->GetPrefix());
1473  else
1474  m_xPrefixED->set_text("");
1475  if(bSameSuffix)
1476  m_xSuffixED->set_text(aNumFmtArr[nLvl]->GetSuffix());
1477  else
1478  m_xSuffixED->set_text("");
1479 
1480  if(bSameCharFmt)
1481  {
1482  if (!sFirstCharFmt.isEmpty())
1483  m_xCharFmtLB->set_active_text(sFirstCharFmt);
1484  else
1485  m_xCharFmtLB->set_active(0);
1486  }
1487  else
1488  m_xCharFmtLB->set_active(-1);
1489 
1492 }
1493 
1494 // 0 - Number; 1 - Bullet; 2 - Bitmap
1496 {
1497  if(nBullet == nType)
1498  return;
1499  nBullet = nType;
1500  bool bBullet = (nType == SHOW_BULLET);
1501  bool bBitmap = (nType == SHOW_BITMAP);
1502  bool bEnableBitmap = (nType == SHOW_BITMAP);
1503  bool bNumeric = !(bBitmap||bBullet);
1504  m_xSeparatorFT->set_visible(bNumeric);
1505  m_xPrefixFT->set_visible(bNumeric);
1506  m_xPrefixED->set_visible(bNumeric);
1507  m_xSuffixFT->set_visible(bNumeric);
1508  m_xSuffixED->set_visible(bNumeric);
1509 
1510  bool bCharFmt = pActNum->IsFeatureSupported(SvxNumRuleFlags::CHAR_STYLE);
1511  m_xCharFmtFT->set_visible(!bBitmap && bCharFmt);
1512  m_xCharFmtLB->set_visible(!bBitmap && bCharFmt);
1513 
1514  // this is rather misusage, as there is no own flag
1515  // for complete numeration
1516  bool bAllLevelFeature = pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS);
1517  bool bAllLevel = bNumeric && bAllLevelFeature && !bHTMLMode;
1518  m_xAllLevelFT->set_visible(bAllLevel);
1519  m_xAllLevelNF->set_visible(bAllLevel);
1520 
1521  m_xStartFT->set_visible(!(bBullet||bBitmap));
1522  m_xStartED->set_visible(!(bBullet||bBitmap));
1523 
1524  m_xBulletFT->set_visible(bBullet);
1525  m_xBulletPB->set_visible(bBullet);
1526  bool bBullColor = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_COLOR);
1527  m_xBulColorFT->set_visible(!bBitmap && bBullColor);
1528  m_xBulColLB->set_visible(!bBitmap && bBullColor);
1529  bool bBullResSize = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_REL_SIZE);
1530  m_xBulRelSizeFT->set_visible(!bBitmap && bBullResSize);
1531  m_xBulRelSizeMF->set_visible(!bBitmap && bBullResSize);
1532 
1533  m_xBitmapFT->set_visible(bBitmap);
1534  m_xBitmapMB->set_visible(bBitmap);
1535 
1536  m_xWidthFT->set_visible(bBitmap);
1537  m_xWidthMF->set_visible(bBitmap);
1538  m_xHeightFT->set_visible(bBitmap);
1539  m_xHeightMF->set_visible(bBitmap);
1540  m_xRatioCB->set_visible(bBitmap);
1541 
1542  m_xOrientFT->set_visible(bBitmap && bAllLevelFeature);
1543  m_xOrientLB->set_visible(bBitmap && bAllLevelFeature);
1544 
1545  m_xWidthFT->set_sensitive(bEnableBitmap);
1546  m_xWidthMF->set_sensitive(bEnableBitmap);
1547  m_xHeightFT->set_sensitive(bEnableBitmap);
1548  m_xHeightMF->set_sensitive(bEnableBitmap);
1549  m_xRatioCB->set_sensitive(bEnableBitmap);
1550  m_xOrientFT->set_sensitive(bEnableBitmap);
1551  m_xOrientLB->set_sensitive(bEnableBitmap);
1552 }
1553 
1555 {
1556  if (m_pLevelHdlEvent)
1557  return;
1558  // tdf#127112 (borrowing tdf#127120 solution) multiselection may be implemented by deselect follow by select so
1559  // fire off the handler to happen on next event loop and only process the
1560  // final state
1561  m_pLevelHdlEvent = Application::PostUserEvent(LINK(this, SvxNumOptionsTabPage, LevelHdl));
1562 }
1563 
1564 IMPL_LINK_NOARG(SvxNumOptionsTabPage, LevelHdl, void*, void)
1565 {
1566  m_pLevelHdlEvent = nullptr;
1567 
1568  sal_uInt16 nSaveNumLvl = nActNumLvl;
1569  nActNumLvl = 0;
1570  std::vector<int> aSelectedRows = m_xLevelLB->get_selected_rows();
1571  if (std::find(aSelectedRows.begin(), aSelectedRows.end(), pActNum->GetLevelCount()) != aSelectedRows.end() &&
1572  (aSelectedRows.size() == 1 || nSaveNumLvl != 0xffff))
1573  {
1574  nActNumLvl = 0xFFFF;
1575  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ )
1576  m_xLevelLB->unselect(i);
1577  }
1578  else if (!aSelectedRows.empty())
1579  {
1580  sal_uInt16 nMask = 1;
1581  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ )
1582  {
1583  if (std::find(aSelectedRows.begin(), aSelectedRows.end(), i) != aSelectedRows.end())
1584  nActNumLvl |= nMask;
1585  nMask <<= 1;
1586  }
1587  m_xLevelLB->unselect(pActNum->GetLevelCount());
1588  }
1589  else
1590  {
1591  nActNumLvl = nSaveNumLvl;
1592  sal_uInt16 nMask = 1;
1593  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ )
1594  {
1595  if(nActNumLvl & nMask)
1596  {
1597  m_xLevelLB->select(i);
1598  break;
1599  }
1600  nMask <<=1;
1601  }
1602  }
1603  InitControls();
1604 }
1605 
1606 IMPL_LINK_NOARG(SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl, Timer *, void)
1607 {
1608  m_aPreviewWIN.Invalidate();
1609 }
1610 
1611 IMPL_LINK(SvxNumOptionsTabPage, AllLevelHdl_Impl, weld::SpinButton&, rBox, void)
1612 {
1613  sal_uInt16 nMask = 1;
1614  for(sal_uInt16 e = 0; e < pActNum->GetLevelCount(); e++)
1615  {
1616  if(nActNumLvl & nMask)
1617  {
1618  SvxNumberFormat aNumFmt(pActNum->GetLevel(e));
1619  aNumFmt.SetIncludeUpperLevels(static_cast<sal_uInt8>(std::min(rBox.get_value(), int(e + 1))) );
1620  pActNum->SetLevel(e, aNumFmt);
1621  }
1622  nMask <<= 1;
1623  }
1624  SetModified();
1625 }
1626 
1627 IMPL_LINK(SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, weld::ComboBox&, rBox, void)
1628 {
1629  OUString sSelectStyle;
1630  bool bShowOrient = false;
1631  bool bBmp = false;
1632  sal_uInt16 nMask = 1;
1633  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
1634  {
1635  if(nActNumLvl & nMask)
1636  {
1637  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
1638  // PAGEDESC does not exist
1639  SvxNumType nNumType = static_cast<SvxNumType>(rBox.get_active_id().toUInt32());
1640  aNumFmt.SetNumberingType(nNumType);
1641  sal_uInt16 nNumberingType = aNumFmt.GetNumberingType();
1642  if(SVX_NUM_BITMAP == (nNumberingType&(~LINK_TOKEN)))
1643  {
1644  bBmp |= nullptr != aNumFmt.GetBrush();
1645  aNumFmt.SetIncludeUpperLevels( 0 );
1646  aNumFmt.SetSuffix( "" );
1647  aNumFmt.SetPrefix( "" );
1648  if(!bBmp)
1649  aNumFmt.SetGraphic("");
1650  pActNum->SetLevel(i, aNumFmt);
1651  SwitchNumberType(SHOW_BITMAP);
1652  bShowOrient = true;
1653  }
1654  else if( SVX_NUM_CHAR_SPECIAL == nNumberingType )
1655  {
1656  aNumFmt.SetIncludeUpperLevels( 0 );
1657  aNumFmt.SetSuffix( "" );
1658  aNumFmt.SetPrefix( "" );
1659  if( !aNumFmt.GetBulletFont() )
1660  aNumFmt.SetBulletFont(&aActBulletFont);
1661  if( !aNumFmt.GetBulletChar() )
1662  aNumFmt.SetBulletChar( SVX_DEF_BULLET );
1663  pActNum->SetLevel(i, aNumFmt);
1664  SwitchNumberType(SHOW_BULLET);
1665  // allocation of the drawing pattern is automatic
1666  if(bAutomaticCharStyles)
1667  {
1668  sSelectStyle = m_sBulletCharFormatName;
1669  }
1670  }
1671  else
1672  {
1673  aNumFmt.SetPrefix( m_xPrefixED->get_text() );
1674  aNumFmt.SetSuffix( m_xSuffixED->get_text() );
1675  SwitchNumberType(SHOW_NUMBERING);
1676  pActNum->SetLevel(i, aNumFmt);
1677  CheckForStartValue_Impl(nNumberingType);
1678 
1679  // allocation of the drawing pattern is automatic
1680  if(bAutomaticCharStyles)
1681  {
1682  sSelectStyle = m_sNumCharFmtName;
1683  }
1684  }
1685  }
1686  nMask <<= 1;
1687  }
1688  bool bAllLevelFeature = pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS);
1689  if(bShowOrient && bAllLevelFeature)
1690  {
1691  m_xOrientFT->show();
1692  m_xOrientLB->show();
1693  }
1694  else
1695  {
1696  m_xOrientFT->hide();
1697  m_xOrientLB->hide();
1698  }
1699  SetModified();
1700  if(!sSelectStyle.isEmpty())
1701  {
1702  m_xCharFmtLB->set_active_text(sSelectStyle);
1703  CharFmtHdl_Impl(*m_xCharFmtLB);
1704  bAutomaticCharStyles = true;
1705  }
1706 }
1707 
1708 void SvxNumOptionsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType)
1709 {
1710  bool bIsNull = m_xStartED->get_value() == 0;
1711  bool bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC ||
1712  SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType ||
1713  SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType;
1714  m_xStartED->set_min(bNoZeroAllowed ? 1 : 0);
1715  if (bIsNull && bNoZeroAllowed)
1717 }
1718 
1719 IMPL_LINK(SvxNumOptionsTabPage, OrientHdl_Impl, weld::ComboBox&, rBox, void)
1720 {
1721  sal_Int32 nPos = rBox.get_active();
1722  nPos ++; // no VERT_NONE
1723 
1724  sal_uInt16 nMask = 1;
1725  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
1726  {
1727  if(nActNumLvl & nMask)
1728  {
1729  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
1730  if(SVX_NUM_BITMAP == (aNumFmt.GetNumberingType()&(~LINK_TOKEN)))
1731  {
1732  const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
1733  const Size& rSize = aNumFmt.GetGraphicSize();
1734  sal_Int16 eOrient = static_cast<sal_Int16>(nPos);
1735  aNumFmt.SetGraphicBrush( pBrushItem, &rSize, &eOrient );
1736  pActNum->SetLevel(i, aNumFmt);
1737  }
1738  }
1739  nMask <<= 1;
1740  }
1741  SetModified(false);
1742 }
1743 
1744 IMPL_LINK(SvxNumOptionsTabPage, SameLevelHdl_Impl, weld::ToggleButton&, rBox, void)
1745 {
1746  bool bSet = rBox.get_active();
1747  pActNum->SetContinuousNumbering(bSet);
1748  bool bRepaint = false;
1749  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
1750  {
1751  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
1752  if(aNumFmt.GetNumberingType() != SVX_NUM_NUMBER_NONE)
1753  {
1754  bRepaint = true;
1755  break;
1756  }
1757  }
1758  SetModified(bRepaint);
1759  InitControls();
1760 }
1761 
1762 IMPL_LINK(SvxNumOptionsTabPage, BulColorHdl_Impl, ColorListBox&, rColorBox, void)
1763 {
1764  Color nSetColor = rColorBox.GetSelectEntryColor();
1765 
1766  sal_uInt16 nMask = 1;
1767  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
1768  {
1769  if(nActNumLvl & nMask)
1770  {
1771  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
1772  aNumFmt.SetBulletColor(nSetColor);
1773  pActNum->SetLevel(i, aNumFmt);
1774  }
1775  nMask <<= 1;
1776  }
1777  SetModified();
1778 }
1779 
1780 IMPL_LINK(SvxNumOptionsTabPage, BulRelSizeHdl_Impl, weld::MetricSpinButton&, rField, void)
1781 {
1782  sal_uInt16 nRelSize = rField.get_value(FieldUnit::PERCENT);
1783 
1784  sal_uInt16 nMask = 1;
1785  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
1786  {
1787  if(nActNumLvl & nMask)
1788  {
1789  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
1790  aNumFmt.SetBulletRelSize(nRelSize);
1791  pActNum->SetLevel(i, aNumFmt);
1792  }
1793  nMask <<= 1;
1794  }
1795  SetModified();
1796 }
1797 
1798 IMPL_LINK(SvxNumOptionsTabPage, GraphicHdl_Impl, const OString&, rIdent, void)
1799 {
1800  OUString aGrfName;
1801  Size aSize;
1802  bool bSucc(false);
1803  SvxOpenGraphicDialog aGrfDlg(CuiResId(RID_SVXSTR_EDIT_GRAPHIC), GetFrameWeld());
1804 
1805  OString sNumber;
1806  if (rIdent.startsWith("gallery", &sNumber))
1807  {
1808  auto idx = sNumber.toUInt32();
1809  if (idx < aGrfNames.size())
1810  {
1811  aGrfName = aGrfNames[idx];
1812  Graphic aGraphic;
1814  {
1815  aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
1816  bSucc = true;
1817  }
1818  }
1819  }
1820  else if (rIdent == "fromfile")
1821  {
1822  aGrfDlg.EnableLink( false );
1823  aGrfDlg.AsLink( false );
1824  if ( !aGrfDlg.Execute() )
1825  {
1826  // memorize selected filter
1827  aGrfName = aGrfDlg.GetPath();
1828 
1829  Graphic aGraphic;
1830  if( !aGrfDlg.GetGraphic(aGraphic) )
1831  {
1832  aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
1833  bSucc = true;
1834  }
1835  }
1836  }
1837  if(!bSucc)
1838  return;
1839 
1840  aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(eCoreUnit));
1841 
1842  sal_uInt16 nMask = 1;
1843  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
1844  {
1845  if(nActNumLvl & nMask)
1846  {
1847  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
1848  aNumFmt.SetCharFormatName(m_sNumCharFmtName);
1849  aNumFmt.SetGraphic(aGrfName);
1850 
1851  // set size for a later comparison
1852  const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
1853  // initiate asynchronous loading
1854  sal_Int16 eOrient = aNumFmt.GetVertOrient();
1855  aNumFmt.SetGraphicBrush( pBrushItem, &aSize, &eOrient );
1856  aInitSize[i] = aNumFmt.GetGraphicSize();
1857 
1858  pActNum->SetLevel(i, aNumFmt);
1859  }
1860  nMask <<= 1;
1861  }
1862  m_xRatioCB->set_sensitive(true);
1863  m_xWidthFT->set_sensitive(true);
1864  m_xHeightFT->set_sensitive(true);
1865  m_xWidthMF->set_sensitive(true);
1866  m_xHeightMF->set_sensitive(true);
1867  SetMetricValue(*m_xWidthMF, aSize.Width(), eCoreUnit);
1868  SetMetricValue(*m_xHeightMF, aSize.Height(), eCoreUnit);
1869  m_xOrientFT->set_sensitive(true);
1870  m_xOrientLB->set_sensitive(true);
1871  SetModified();
1872  //needed due to asynchronous loading of graphics in the SvxBrushItem
1873  aInvalidateTimer.Start();
1874 }
1875 
1877 {
1878  if (m_xGalleryMenu)
1879  return;
1880 
1881  m_xGalleryMenu = m_xBuilder->weld_menu("gallerysubmenu");
1882  weld::WaitObject aWait(GetFrameWeld());
1883 
1885  return;
1886 
1888 
1889  Graphic aGraphic;
1890  OUString sGrfName;
1892  size_t i = 0;
1893  for (const auto & grfName : aGrfNames)
1894  {
1895  sGrfName = grfName;
1896  OUString sItemId = "gallery" + OUString::number(i);
1897  INetURLObject aObj(sGrfName);
1898  if(aObj.GetProtocol() == INetProtocol::File)
1899  sGrfName = aObj.PathToFileName();
1901  {
1902  BitmapEx aBitmap(aGraphic.GetBitmapEx());
1903  Size aSize(aBitmap.GetSizePixel());
1904  if(aSize.Width() > MAX_BMP_WIDTH ||
1905  aSize.Height() > MAX_BMP_HEIGHT)
1906  {
1907  bool bWidth = aSize.Width() > aSize.Height();
1908  double nScale = bWidth ?
1909  double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width()):
1910  double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
1911  aBitmap.Scale(nScale, nScale);
1912  }
1913  pVD->SetOutputSizePixel(aBitmap.GetSizePixel(), false);
1914  pVD->DrawBitmapEx(Point(), aBitmap);
1915  m_xGalleryMenu->append(sItemId, sGrfName, *pVD);
1916  }
1917  else
1918  {
1919  m_xGalleryMenu->append(sItemId, sGrfName);
1920  }
1921  ++i;
1922  }
1924 }
1925 
1927 {
1928  SvxCharacterMap aMap(GetFrameWeld(), nullptr, nullptr);
1929 
1930  sal_uInt16 nMask = 1;
1931  const vcl::Font* pFmtFont = nullptr;
1932  bool bSameBullet = true;
1933  sal_UCS4 cBullet = 0;
1934  bool bFirst = true;
1935  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
1936  {
1937  if(nActNumLvl & nMask)
1938  {
1939  const SvxNumberFormat& rCurFmt = pActNum->GetLevel(i);
1940  if(bFirst)
1941  {
1942  cBullet = rCurFmt.GetBulletChar();
1943  }
1944  else if(rCurFmt.GetBulletChar() != cBullet )
1945  {
1946  bSameBullet = false;
1947  break;
1948  }
1949  if(!pFmtFont)
1950  pFmtFont = rCurFmt.GetBulletFont();
1951  bFirst = false;
1952  }
1953  nMask <<= 1;
1954 
1955  }
1956 
1957  if (pFmtFont)
1958  aMap.SetCharFont(*pFmtFont);
1959  else
1960  aMap.SetCharFont(aActBulletFont);
1961  if (bSameBullet)
1962  aMap.SetChar(cBullet);
1963  if (aMap.run() != RET_OK)
1964  return;
1965 
1966  // change Font Numrules
1967  aActBulletFont = aMap.GetCharFont();
1968 
1969  sal_uInt16 _nMask = 1;
1970  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
1971  {
1972  if(nActNumLvl & _nMask)
1973  {
1974  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
1975  aNumFmt.SetBulletFont(&aActBulletFont);
1976  aNumFmt.SetBulletChar(aMap.GetChar());
1977  pActNum->SetLevel(i, aNumFmt);
1978  }
1979  _nMask <<= 1;
1980  }
1981 
1982  SetModified();
1983 }
1984 
1986 {
1987  bool bWidth = &rField == m_xWidthMF.get();
1988  bLastWidthModified = bWidth;
1989  bool bRatio = m_xRatioCB->get_active();
1990  tools::Long nWidthVal = static_cast<tools::Long>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::MM_100TH)));
1991  tools::Long nHeightVal = static_cast<tools::Long>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::MM_100TH)));
1992  nWidthVal = OutputDevice::LogicToLogic( nWidthVal ,
1993  MapUnit::Map100thMM, eCoreUnit );
1994  nHeightVal = OutputDevice::LogicToLogic( nHeightVal,
1995  MapUnit::Map100thMM, eCoreUnit);
1996  double fSizeRatio;
1997 
1998  bool bRepaint = false;
1999  sal_uInt16 nMask = 1;
2000  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
2001  {
2002  if(nActNumLvl & nMask)
2003  {
2004  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
2005  if(SVX_NUM_BITMAP == (aNumFmt.GetNumberingType()&(~LINK_TOKEN)))
2006  {
2007  Size aSize(aNumFmt.GetGraphicSize() );
2008  Size aSaveSize(aSize);
2009 
2010  if (aInitSize[i].Height())
2011  fSizeRatio = static_cast<double>(aInitSize[i].Width()) / static_cast<double>(aInitSize[i].Height());
2012  else
2013  fSizeRatio = double(1);
2014 
2015  if(bWidth)
2016  {
2017  tools::Long nDelta = nWidthVal - aInitSize[i].Width();
2018  aSize.setWidth( nWidthVal );
2019  if (bRatio)
2020  {
2021  aSize.setHeight( aInitSize[i].Height() + static_cast<tools::Long>(static_cast<double>(nDelta) / fSizeRatio) );
2022  m_xHeightMF->set_value(m_xHeightMF->normalize(
2023  OutputDevice::LogicToLogic( aSize.Height(), eCoreUnit, MapUnit::Map100thMM )),
2024  FieldUnit::MM_100TH);
2025  }
2026  }
2027  else
2028  {
2029  tools::Long nDelta = nHeightVal - aInitSize[i].Height();
2030  aSize.setHeight( nHeightVal );
2031  if (bRatio)
2032  {
2033  aSize.setWidth( aInitSize[i].Width() + static_cast<tools::Long>(static_cast<double>(nDelta) * fSizeRatio) );
2034  m_xWidthMF->set_value(m_xWidthMF->normalize(
2035  OutputDevice::LogicToLogic( aSize.Width(), eCoreUnit, MapUnit::Map100thMM )),
2036  FieldUnit::MM_100TH);
2037  }
2038  }
2039  const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
2040  sal_Int16 eOrient = aNumFmt.GetVertOrient();
2041  if(aSize != aSaveSize)
2042  bRepaint = true;
2043  aNumFmt.SetGraphicBrush( pBrushItem, &aSize, &eOrient );
2044  pActNum->SetLevel(i, aNumFmt);
2045  }
2046  }
2047  nMask <<= 1;
2048  }
2049  SetModified(bRepaint);
2050 }
2051 
2053 {
2054  if (rBox.get_active())
2055  {
2056  if (bLastWidthModified)
2057  SizeHdl_Impl(*m_xWidthMF);
2058  else
2059  SizeHdl_Impl(*m_xHeightMF);
2060  }
2061 }
2062 
2064 {
2065  bAutomaticCharStyles = false;
2066  sal_Int32 nEntryPos = m_xCharFmtLB->get_active();
2067  OUString sEntry = m_xCharFmtLB->get_active_text();
2068  sal_uInt16 nMask = 1;
2069  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
2070  {
2071  if(nActNumLvl & nMask)
2072  {
2073  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
2074  if( 0 == nEntryPos )
2075  aNumFmt.SetCharFormatName("");
2076  else
2077  {
2078  if(SVX_NUM_BITMAP != (aNumFmt.GetNumberingType()&(~LINK_TOKEN)))
2079  aNumFmt.SetCharFormatName(sEntry);
2080  }
2081  pActNum->SetLevel(i, aNumFmt);
2082  }
2083  nMask <<= 1;
2084  }
2085  SetModified(false);
2086 };
2087 
2088 IMPL_LINK(SvxNumOptionsTabPage, EditModifyHdl_Impl, weld::Entry&, rEdit, void)
2089 {
2090  EditModifyHdl_Impl(&rEdit);
2091 }
2092 
2093 IMPL_LINK(SvxNumOptionsTabPage, SpinModifyHdl_Impl, weld::SpinButton&, rSpinButton, void)
2094 {
2095  EditModifyHdl_Impl(&rSpinButton);
2096 }
2097 
2099 {
2100  bool bPrefix = pEdit == m_xPrefixED.get();
2101  bool bSuffix = pEdit == m_xSuffixED.get();
2102  bool bStart = pEdit == m_xStartED.get();
2103  sal_uInt16 nMask = 1;
2104  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
2105  {
2106  if(nActNumLvl & nMask)
2107  {
2108  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
2109  if(bPrefix)
2110  aNumFmt.SetPrefix(m_xPrefixED->get_text());
2111  else if(bSuffix)
2112  aNumFmt.SetSuffix(m_xSuffixED->get_text());
2113  else if(bStart)
2114  aNumFmt.SetStart(m_xStartED->get_value());
2115  pActNum->SetLevel(i, aNumFmt);
2116  }
2117  nMask <<= 1;
2118  }
2119  SetModified();
2120 }
2121 
2123  tools::Long nYMiddle, tools::Long nDivision)
2124 {
2125  const SvxBrushItem* pBrushItem = rFmt.GetBrush();
2126  tools::Long nRet = 0;
2127  if(pBrushItem)
2128  {
2129  const Graphic* pGrf = pBrushItem->GetGraphic();
2130  if(pGrf)
2131  {
2132  Size aGSize( rFmt.GetGraphicSize() );
2133  aGSize.setWidth( aGSize.Width() / nDivision );
2134  nRet = aGSize.Width();
2135  aGSize.setHeight( aGSize.Height() / nDivision );
2136  pGrf->Draw( pVDev, Point(nXStart,nYMiddle - ( aGSize.Height() / 2) ),
2137  pVDev->PixelToLogic( aGSize ) );
2138  }
2139  }
2140  return nRet;
2141 
2142 }
2143 
2145  const SvxNumberFormat& rFmt, tools::Long nXStart,
2146  tools::Long nYStart, const Size& rSize)
2147 {
2148  vcl::Font aTmpFont(pVDev->GetFont());
2149 
2150  // via Uno it's possible that no font has been set!
2151  vcl::Font aFont(rFmt.GetBulletFont() ? *rFmt.GetBulletFont() : aTmpFont);
2152  Size aTmpSize(rSize);
2153  aTmpSize.setWidth( aTmpSize.Width() * ( rFmt.GetBulletRelSize()) );
2154  aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
2155  aTmpSize.setHeight( aTmpSize.Height() * ( rFmt.GetBulletRelSize()) );
2156  aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
2157  // in case of a height of zero it is drawn in original height
2158  if(!aTmpSize.Height())
2159  aTmpSize.setHeight( 1 );
2160  aFont.SetFontSize(aTmpSize);
2161  aFont.SetTransparent(true);
2162  Color aBulletColor = rFmt.GetBulletColor();
2163  if(aBulletColor == COL_AUTO)
2164  aBulletColor = pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK;
2165  else if(aBulletColor == pVDev->GetFillColor())
2166  aBulletColor.Invert();
2167  aFont.SetColor(aBulletColor);
2168  pVDev->SetFont( aFont );
2169  sal_UCS4 cChar = rFmt.GetBulletChar();
2170  OUString aText(&cChar, 1);
2171  tools::Long nY = nYStart;
2172  nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
2173  pVDev->DrawText( Point(nXStart, nY), aText );
2174  tools::Long nRet = pVDev->GetTextWidth(aText);
2175 
2176  pVDev->SetFont(aTmpFont);
2177  return nRet;
2178 }
2179 
2181  : pActNum(nullptr)
2182  , bPosition(false)
2183  , nActLevel(SAL_MAX_UINT16)
2184 {
2185 }
2186 
2187 // paint preview of numeration
2188 void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& /*rRect*/)
2189 {
2190  Size aSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
2191 
2192  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
2193  const Color aBackColor = rStyleSettings.GetFieldColor();
2194  const Color aTextColor = rStyleSettings.GetFieldTextColor();
2195 
2196  ScopedVclPtrInstance<VirtualDevice> pVDev(rRenderContext);
2197  pVDev->EnableRTL(rRenderContext.IsRTLEnabled());
2198  pVDev->SetMapMode(rRenderContext.GetMapMode());
2199  pVDev->SetOutputSize(aSize);
2200 
2201  Color aLineColor(COL_LIGHTGRAY);
2202  if (aLineColor == aBackColor)
2203  aLineColor.Invert();
2204  pVDev->SetLineColor(aLineColor);
2205  pVDev->SetFillColor(aBackColor);
2206 
2207  if (pActNum)
2208  {
2209  tools::Long nWidthRelation = 30; // chapter dialog
2210 
2211  // height per level
2212  tools::Long nXStep = aSize.Width() / (3 * pActNum->GetLevelCount());
2213  if (pActNum->GetLevelCount() < 10)
2214  nXStep /= 2;
2215  tools::Long nYStart = 4;
2216  // the whole height mustn't be used for a single level
2217  tools::Long nYStep = (aSize.Height() - 6)/ (pActNum->GetLevelCount() > 1 ? pActNum->GetLevelCount() : 5);
2218 
2219  aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, MsLangId::getSystemLanguage(), GetDefaultFontFlags::OnlyOne);
2220  aStdFont.SetColor(aTextColor);
2221  aStdFont.SetFillColor(aBackColor);
2222 
2223  tools::Long nFontHeight = nYStep * 6 / 10;
2224  if (bPosition)
2225  nFontHeight = nYStep * 15 / 10;
2226  aStdFont.SetFontSize(Size( 0, nFontHeight ));
2227 
2228  SvxNodeNum aNum;
2229  sal_uInt16 nPreNum = pActNum->GetLevel(0).GetStart();
2230 
2231  if (bPosition)
2232  {
2233  tools::Long nLineHeight = nFontHeight * 8 / 7;
2234  sal_uInt8 nStart = 0;
2235  while (!(nActLevel & (1<<nStart)))
2236  {
2237  nStart++;
2238  }
2239  if (nStart)
2240  nStart--;
2241  sal_uInt8 nEnd = std::min(sal_uInt8(nStart + 3), sal_uInt8(pActNum->GetLevelCount()));
2242  for (sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel)
2243  {
2244  const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel);
2245  aNum.GetLevelVal()[nLevel] = rFmt.GetStart();
2246 
2247  tools::Long nXStart( 0 );
2248  short nTextOffset( 0 );
2249  tools::Long nNumberXPos( 0 );
2251  {
2252  nXStart = rFmt.GetAbsLSpace() / nWidthRelation;
2253  nTextOffset = rFmt.GetCharTextDistance() / nWidthRelation;
2254  nNumberXPos = nXStart;
2255  tools::Long nFirstLineOffset = (-rFmt.GetFirstLineOffset()) / nWidthRelation;
2256 
2257  if (nFirstLineOffset <= nNumberXPos)
2258  nNumberXPos = nNumberXPos - nFirstLineOffset;
2259  else
2260  nNumberXPos = 0;
2261  // in draw this is valid
2262  if (nTextOffset < 0)
2263  nNumberXPos = nNumberXPos + nTextOffset;
2264  }
2266  {
2267  const tools::Long nTmpNumberXPos((rFmt.GetIndentAt() + rFmt.GetFirstLineIndent() ) / nWidthRelation);
2268  if (nTmpNumberXPos < 0)
2269  {
2270  nNumberXPos = 0;
2271  }
2272  else
2273  {
2274  nNumberXPos = nTmpNumberXPos;
2275  }
2276  }
2277 
2278  tools::Long nBulletWidth = 0;
2279  if (SVX_NUM_BITMAP == (rFmt.GetNumberingType() &(~LINK_TOKEN)))
2280  {
2281  tools::Long nYMiddle = nYStart + ( nFontHeight / 2 );
2282  nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawGraphic(pVDev.get(), rFmt, nNumberXPos, nYMiddle, nWidthRelation) : 0;
2283  }
2284  else if (SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType())
2285  {
2286  nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawBullet(pVDev.get(), rFmt, nNumberXPos, nYStart, aStdFont.GetFontSize()) : 0;
2287  }
2288  else
2289  {
2290  pVDev->SetFont(aStdFont);
2291  aNum.SetLevel(nLevel);
2293  aNum.GetLevelVal()[nLevel] = nPreNum;
2294  OUString aText(pActNum->MakeNumString( aNum ));
2295  vcl::Font aSaveFont = pVDev->GetFont();
2296  vcl::Font aColorFont(aSaveFont);
2297  Color aTmpBulletColor = rFmt.GetBulletColor();
2298  if (aTmpBulletColor == COL_AUTO)
2299  aTmpBulletColor = aBackColor.IsDark() ? COL_WHITE : COL_BLACK;
2300  else if (aTmpBulletColor == aBackColor)
2301  aTmpBulletColor.Invert();
2302  aColorFont.SetColor(aTmpBulletColor);
2303  pVDev->SetFont(aColorFont);
2304  pVDev->DrawText(Point(nNumberXPos, nYStart), aText);
2305  pVDev->SetFont(aSaveFont);
2306  nBulletWidth = pVDev->GetTextWidth(aText);
2307  nPreNum++;
2308  }
2311  {
2312  pVDev->SetFont(aStdFont);
2313  OUString aText(' ');
2314  pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
2315  nBulletWidth = nBulletWidth + pVDev->GetTextWidth(aText);
2316  }
2317 
2318  tools::Long nTextXPos( 0 );
2320  {
2321  nTextXPos = nXStart;
2322  if (nTextOffset < 0)
2323  nTextXPos = nTextXPos + nTextOffset;
2324  if (nNumberXPos + nBulletWidth + nTextOffset > nTextXPos)
2325  nTextXPos = nNumberXPos + nBulletWidth + nTextOffset;
2326  }
2328  {
2329  switch (rFmt.GetLabelFollowedBy())
2330  {
2332  {
2333  nTextXPos = rFmt.GetListtabPos() / nWidthRelation;
2334  if (nTextXPos < nNumberXPos + nBulletWidth)
2335  {
2336  nTextXPos = nNumberXPos + nBulletWidth;
2337  }
2338  }
2339  break;
2343  {
2344  nTextXPos = nNumberXPos + nBulletWidth;
2345  }
2346  break;
2347  }
2348 
2349  nXStart = rFmt.GetIndentAt() / nWidthRelation;
2350  }
2351 
2352  ::tools::Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
2353  pVDev->SetFillColor(aBackColor);
2354  pVDev->DrawRect(aRect1);
2355 
2356  ::tools::Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2 ), Size(aSize.Width() / 2, 2));
2357  pVDev->DrawRect(aRect2);
2358  nYStart += 2 * nLineHeight;
2359  }
2360  }
2361  else
2362  {
2363  //#i5153# painting gray or black rectangles as 'normal' numbering text
2364  tools::Long nWidth = pVDev->GetTextWidth("Preview");
2365  tools::Long nTextHeight = pVDev->GetTextHeight();
2366  tools::Long nRectHeight = nTextHeight * 2 / 3;
2367  tools::Long nTopOffset = nTextHeight - nRectHeight;
2368  Color aBlackColor(COL_BLACK);
2369  if (aBlackColor == aBackColor)
2370  aBlackColor.Invert();
2371 
2372  for (sal_uInt16 nLevel = 0; nLevel < pActNum->GetLevelCount(); ++nLevel, nYStart = nYStart + nYStep)
2373  {
2374  const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel);
2375  aNum.GetLevelVal()[ nLevel ] = rFmt.GetStart();
2376  tools::Long nXStart( 0 );
2377  pVDev->SetFillColor( aBackColor );
2378 
2380  {
2381  nXStart = rFmt.GetAbsLSpace() / nWidthRelation;
2382  }
2384  {
2385  const tools::Long nTmpXStart((rFmt.GetIndentAt() + rFmt.GetFirstLineIndent() ) / nWidthRelation);
2386  if (nTmpXStart < 0)
2387  {
2388  nXStart = 0;
2389  }
2390  else
2391  {
2392  nXStart = nTmpXStart;
2393  }
2394  }
2395  nXStart /= 2;
2396  nXStart += 2;
2397  tools::Long nTextOffset = 2 * nXStep;
2398  if (SVX_NUM_BITMAP == (rFmt.GetNumberingType()&(~LINK_TOKEN)))
2399  {
2400  if (rFmt.IsShowSymbol())
2401  {
2402  tools::Long nYMiddle = nYStart + ( nFontHeight / 2 );
2403  nTextOffset = lcl_DrawGraphic(pVDev.get(), rFmt, nXStart, nYMiddle, nWidthRelation);
2404  nTextOffset = nTextOffset + nXStep;
2405  }
2406  }
2407  else if (SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType())
2408  {
2409  if (rFmt.IsShowSymbol())
2410  {
2411  nTextOffset = lcl_DrawBullet(pVDev.get(), rFmt, nXStart, nYStart, aStdFont.GetFontSize());
2412  nTextOffset = nTextOffset + nXStep;
2413  }
2414  }
2415  else
2416  {
2417  vcl::Font aFont(aStdFont);
2418  Size aTmpSize(aStdFont.GetFontSize());
2419  if(pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_REL_SIZE))
2420  {
2421  aTmpSize.setWidth( aTmpSize.Width() * ( rFmt.GetBulletRelSize()) );
2422  aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
2423  aTmpSize.setHeight( aTmpSize.Height() * ( rFmt.GetBulletRelSize()) );
2424  aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
2425  }
2426  if(!aTmpSize.Height())
2427  aTmpSize.setHeight( 1 );
2428  aFont.SetFontSize(aTmpSize);
2429  Color aTmpBulletColor = rFmt.GetBulletColor();
2430  if (aTmpBulletColor == COL_AUTO)
2431  aTmpBulletColor = aBackColor.IsDark() ? COL_WHITE : COL_BLACK;
2432  else if (aTmpBulletColor == aBackColor)
2433  aTmpBulletColor.Invert();
2434  aFont.SetColor(aTmpBulletColor);
2435  pVDev->SetFont(aFont);
2436  aNum.SetLevel( nLevel );
2438  aNum.GetLevelVal()[nLevel] = nPreNum;
2439  OUString aText(pActNum->MakeNumString(aNum));
2440  tools::Long nY = nYStart;
2441  nY -= (pVDev->GetTextHeight() - nTextHeight - pVDev->GetFontMetric().GetDescent());
2442  pVDev->DrawText(Point(nXStart, nY), aText);
2443  nTextOffset = pVDev->GetTextWidth(aText);
2444  nTextOffset = nTextOffset + nXStep;
2445  nPreNum++;
2446  pVDev->SetFont(aStdFont);
2447  }
2448  //#i5153# the selected rectangle(s) should be black
2449  if (0 != (nActLevel & (1<<nLevel)))
2450  {
2451  pVDev->SetFillColor( aBlackColor );
2452  pVDev->SetLineColor( aBlackColor );
2453  }
2454  else
2455  {
2456  //#i5153# unselected levels are gray
2457  pVDev->SetFillColor( aLineColor );
2458  pVDev->SetLineColor( aLineColor );
2459  }
2460  ::tools::Rectangle aRect1(Point(nXStart + nTextOffset, nYStart + nTopOffset), Size(nWidth, nRectHeight));
2461  pVDev->DrawRect(aRect1);
2462  }
2463  }
2464  }
2465  rRenderContext.DrawOutDev(Point(), aSize, Point(), aSize, *pVDev);
2466 }
2467 
2468 
2469 //See uiconfig/swriter/ui/outlinepositionpage.ui for effectively a duplicate
2470 //dialog to this one, except with a different preview window impl.
2471 //TODO, determine if SwNumPositionTabPage and SvxNumPositionTabPage can be
2472 //merged
2474  : SfxTabPage(pPage, pController, "cui/ui/numberingpositionpage.ui", "NumberingPositionPage", &rSet)
2475  , m_pLevelHdlEvent(nullptr)
2476  , nActNumLvl(1)
2477  , nNumItemId(SID_ATTR_NUMBERING_RULE)
2478  , bModified(false)
2479  , bPreset(false)
2480  , bInInintControl(false)
2481  , bLabelAlignmentPosAndSpaceModeActive(false)
2482  , m_xLevelLB(m_xBuilder->weld_tree_view("levellb"))
2483  , m_xDistBorderFT(m_xBuilder->weld_label("indent"))
2484  , m_xDistBorderMF(m_xBuilder->weld_metric_spin_button("indentmf", FieldUnit::CM))
2485  , m_xRelativeCB(m_xBuilder->weld_check_button("relative"))
2486  , m_xIndentFT(m_xBuilder->weld_label("numberingwidth"))
2487  , m_xIndentMF(m_xBuilder->weld_metric_spin_button("numberingwidthmf", FieldUnit::CM))
2488  , m_xDistNumFT(m_xBuilder->weld_label("numdist"))
2489  , m_xDistNumMF(m_xBuilder->weld_metric_spin_button("numdistmf", FieldUnit::CM))
2490  , m_xAlignFT(m_xBuilder->weld_label("numalign"))
2491  , m_xAlignLB(m_xBuilder->weld_combo_box("numalignlb"))
2492  , m_xLabelFollowedByFT(m_xBuilder->weld_label("numfollowedby"))
2493  , m_xLabelFollowedByLB(m_xBuilder->weld_combo_box("numfollowedbylb"))
2494  , m_xListtabFT(m_xBuilder->weld_label("at"))
2495  , m_xListtabMF(m_xBuilder->weld_metric_spin_button("atmf", FieldUnit::CM))
2496  , m_xAlign2FT(m_xBuilder->weld_label("num2align"))
2497  , m_xAlign2LB(m_xBuilder->weld_combo_box("num2alignlb"))
2498  , m_xAlignedAtFT(m_xBuilder->weld_label("alignedat"))
2499  , m_xAlignedAtMF(m_xBuilder->weld_metric_spin_button("alignedatmf", FieldUnit::CM))
2500  , m_xIndentAtFT(m_xBuilder->weld_label("indentat"))
2501  , m_xIndentAtMF(m_xBuilder->weld_metric_spin_button("indentatmf", FieldUnit::CM))
2502  , m_xStandardPB(m_xBuilder->weld_button("standard"))
2503  , m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWIN))
2504 {
2506 
2507  m_xAlignedAtMF->set_range(0, SAL_MAX_INT32, FieldUnit::NONE);
2508  m_xListtabMF->set_range(0, SAL_MAX_INT32, FieldUnit::NONE);
2509  m_xIndentAtMF->set_range(0, SAL_MAX_INT32, FieldUnit::NONE);
2510 
2511  m_xRelativeCB->set_active(true);
2512  m_xAlignLB->connect_changed(LINK(this, SvxNumPositionTabPage, EditModifyHdl_Impl));
2513  m_xAlign2LB->connect_changed(LINK(this, SvxNumPositionTabPage, EditModifyHdl_Impl));
2514  for ( sal_Int32 i = 0; i < m_xAlignLB->get_count(); ++i )
2515  {
2516  m_xAlign2LB->append_text(m_xAlignLB->get_text(i));
2517  }
2518 
2519  Link<weld::MetricSpinButton&,void> aLk3 = LINK(this, SvxNumPositionTabPage, DistanceHdl_Impl);
2520  m_xDistBorderMF->connect_value_changed(aLk3);
2521  m_xDistNumMF->connect_value_changed(aLk3);
2522  m_xIndentMF->connect_value_changed(aLk3);
2523 
2524  m_xLabelFollowedByLB->connect_changed(LINK(this, SvxNumPositionTabPage, LabelFollowedByHdl_Impl));
2525 
2526  m_xListtabMF->connect_value_changed(LINK(this, SvxNumPositionTabPage, ListtabPosHdl_Impl));
2527  m_xAlignedAtMF->connect_value_changed(LINK(this, SvxNumPositionTabPage, AlignAtHdl_Impl));
2528  m_xIndentAtMF->connect_value_changed(LINK(this, SvxNumPositionTabPage, IndentAtHdl_Impl));
2529 
2530  m_xLevelLB->set_selection_mode(SelectionMode::Multiple);
2531  m_xLevelLB->connect_changed(LINK(this, SvxNumPositionTabPage, LevelHdl_Impl));
2532  m_xRelativeCB->connect_toggled(LINK(this, SvxNumPositionTabPage, RelativeHdl_Impl));
2533  m_xStandardPB->connect_clicked(LINK(this, SvxNumPositionTabPage, StandardHdl_Impl));
2534 
2535  m_xRelativeCB->set_active(bLastRelative);
2537  eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
2538 }
2539 
2541 {
2542  if (m_pLevelHdlEvent)
2543  {
2545  m_pLevelHdlEvent = nullptr;
2546  }
2547  m_xPreviewWIN.reset();
2548 }
2549 
2550 /*-------------------------------------------------------*/
2551 
2553 {
2554  bInInintControl = true;
2555  const bool bRelative = !bLabelAlignmentPosAndSpaceModeActive &&
2556  m_xRelativeCB->get_sensitive() && m_xRelativeCB->get_active();
2557  const bool bSingleSelection = m_xLevelLB->count_selected_rows() == 1 &&
2559 
2561  ( bSingleSelection || bRelative ) );
2563  ( bSingleSelection || bRelative ) );
2564 
2565  bool bSetDistEmpty = false;
2566  bool bSameDistBorderNum = !bLabelAlignmentPosAndSpaceModeActive;
2567  bool bSameDist = !bLabelAlignmentPosAndSpaceModeActive;
2568  bool bSameIndent = !bLabelAlignmentPosAndSpaceModeActive;
2569  bool bSameAdjust = true;
2570 
2571  bool bSameLabelFollowedBy = bLabelAlignmentPosAndSpaceModeActive;
2572  bool bSameListtab = bLabelAlignmentPosAndSpaceModeActive;
2573  bool bSameAlignAt = bLabelAlignmentPosAndSpaceModeActive;
2574  bool bSameIndentAt = bLabelAlignmentPosAndSpaceModeActive;
2575 
2576  const SvxNumberFormat* aNumFmtArr[SVX_MAX_NUM];
2577  sal_uInt16 nMask = 1;
2578  sal_uInt16 nLvl = SAL_MAX_UINT16;
2579  tools::Long nFirstBorderTextRelative = -1;
2580  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
2581  {
2582  aNumFmtArr[i] = &pActNum->GetLevel(i);
2583  if(nActNumLvl & nMask)
2584  {
2585  if(SAL_MAX_UINT16 == nLvl)
2586  nLvl = i;
2587 
2588  if( i > nLvl)
2589  {
2590  bSameAdjust &= aNumFmtArr[i]->GetNumAdjust() == aNumFmtArr[nLvl]->GetNumAdjust();
2592  {
2593  if(bRelative)
2594  {
2595  if(nFirstBorderTextRelative == -1)
2596  nFirstBorderTextRelative =
2597  (aNumFmtArr[i]->GetAbsLSpace() + aNumFmtArr[i]->GetFirstLineOffset() -
2598  aNumFmtArr[i - 1]->GetAbsLSpace() + aNumFmtArr[i - 1]->GetFirstLineOffset());
2599  else
2600  bSameDistBorderNum &= nFirstBorderTextRelative ==
2601  (aNumFmtArr[i]->GetAbsLSpace() + aNumFmtArr[i]->GetFirstLineOffset() -
2602  aNumFmtArr[i - 1]->GetAbsLSpace() + aNumFmtArr[i - 1]->GetFirstLineOffset());
2603  }
2604  else
2605  bSameDistBorderNum &=
2606  aNumFmtArr[i]->GetAbsLSpace() - aNumFmtArr[i]->GetFirstLineOffset() ==
2607  aNumFmtArr[i - 1]->GetAbsLSpace() - aNumFmtArr[i - 1]->GetFirstLineOffset();
2608 
2609  bSameDist &= aNumFmtArr[i]->GetCharTextDistance() == aNumFmtArr[nLvl]->GetCharTextDistance();
2610  bSameIndent &= aNumFmtArr[i]->GetFirstLineOffset() == aNumFmtArr[nLvl]->GetFirstLineOffset();
2611  }
2612  else
2613  {
2614  bSameLabelFollowedBy &=
2615  aNumFmtArr[i]->GetLabelFollowedBy() == aNumFmtArr[nLvl]->GetLabelFollowedBy();
2616  bSameListtab &=
2617  aNumFmtArr[i]->GetListtabPos() == aNumFmtArr[nLvl]->GetListtabPos();
2618  bSameAlignAt &=
2619  ( ( aNumFmtArr[i]->GetIndentAt() + aNumFmtArr[i]->GetFirstLineIndent() )
2620  == ( aNumFmtArr[nLvl]->GetIndentAt() + aNumFmtArr[nLvl]->GetFirstLineIndent() ) );
2621  bSameIndentAt &=
2622  aNumFmtArr[i]->GetIndentAt() == aNumFmtArr[nLvl]->GetIndentAt();
2623  }
2624  }
2625  }
2626  nMask <<= 1;
2627 
2628  }
2629  if (SVX_MAX_NUM <= nLvl)
2630  {
2631  OSL_ENSURE(false, "cannot happen.");
2632  return;
2633  }
2634 
2635  if(bSameDistBorderNum)
2636  {
2637  tools::Long nDistBorderNum;
2638  if(bRelative)
2639  {
2640  nDistBorderNum = static_cast<tools::Long>(aNumFmtArr[nLvl]->GetAbsLSpace())+ aNumFmtArr[nLvl]->GetFirstLineOffset();
2641  if(nLvl)
2642  nDistBorderNum -= static_cast<tools::Long>(aNumFmtArr[nLvl - 1]->GetAbsLSpace())+ aNumFmtArr[nLvl - 1]->GetFirstLineOffset();
2643  }
2644  else
2645  {
2646  nDistBorderNum = static_cast<tools::Long>(aNumFmtArr[nLvl]->GetAbsLSpace())+ aNumFmtArr[nLvl]->GetFirstLineOffset();
2647  }
2648  SetMetricValue(*m_xDistBorderMF, nDistBorderNum, eCoreUnit);
2649  }
2650  else
2651  bSetDistEmpty = true;
2652 
2653  if(bSameDist)
2654  SetMetricValue(*m_xDistNumMF, aNumFmtArr[nLvl]->GetCharTextDistance(), eCoreUnit);
2655  else
2656  m_xDistNumMF->set_text("");
2657  if(bSameIndent)
2658  SetMetricValue(*m_xIndentMF, - aNumFmtArr[nLvl]->GetFirstLineOffset(), eCoreUnit);
2659  else
2660  m_xIndentMF->set_text("");
2661 
2662  if(bSameAdjust)
2663  {
2664  sal_Int32 nPos = 1; // centered
2665  if(aNumFmtArr[nLvl]->GetNumAdjust() == SvxAdjust::Left)
2666  nPos = 0;
2667  else if(aNumFmtArr[nLvl]->GetNumAdjust() == SvxAdjust::Right)
2668  nPos = 2;
2669  m_xAlignLB->set_active(nPos);
2670  m_xAlign2LB->set_active(nPos);
2671  }
2672  else
2673  {
2674  m_xAlignLB->set_active(-1);
2675  m_xAlign2LB->set_active(-1);
2676  }
2677 
2678  if ( bSameLabelFollowedBy )
2679  {
2680  sal_Int32 nPos = 0; // LISTTAB
2681  if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::SPACE )
2682  {
2683  nPos = 1;
2684  }
2685  else if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::NOTHING )
2686  {
2687  nPos = 2;
2688  }
2689  else if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::NEWLINE )
2690  {
2691  nPos = 3;
2692  }
2693  m_xLabelFollowedByLB->set_active(nPos);
2694  }
2695  else
2696  {
2697  m_xLabelFollowedByLB->set_active(-1);
2698  }
2699 
2700  if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
2701  {
2702  m_xListtabFT->set_sensitive(true);
2703  m_xListtabMF->set_sensitive(true);
2704  if ( bSameListtab )
2705  {
2706  SetMetricValue(*m_xListtabMF, aNumFmtArr[nLvl]->GetListtabPos(), eCoreUnit);
2707  }
2708  else
2709  {
2710  m_xListtabMF->set_text("");
2711  }
2712  }
2713  else
2714  {
2715  m_xListtabFT->set_sensitive(false);
2716  m_xListtabMF->set_sensitive(false);
2717  m_xListtabMF->set_text("");
2718  }
2719 
2720  if ( bSameAlignAt )
2721  {
2723  aNumFmtArr[nLvl]->GetIndentAt() + aNumFmtArr[nLvl]->GetFirstLineIndent(),
2724  eCoreUnit);
2725  }
2726  else
2727  {
2728  m_xAlignedAtMF->set_text("");
2729  }
2730 
2731  if ( bSameIndentAt )
2732  {
2733  SetMetricValue(*m_xIndentAtMF, aNumFmtArr[nLvl]->GetIndentAt(), eCoreUnit);
2734  }
2735  else
2736  {
2737  m_xIndentAtMF->set_text("");
2738  }
2739 
2740  if ( bSetDistEmpty )
2741  m_xDistBorderMF->set_text("");
2742 
2743  bInInintControl = false;
2744 }
2745 
2747 {
2748  const SfxPoolItem* pItem;
2749  sal_uInt16 nTmpNumLvl = 1;
2750  const SfxItemSet* pExampleSet = GetDialogExampleSet();
2751  if(pExampleSet)
2752  {
2753  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
2754  bPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
2755  if(SfxItemState::SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pItem))
2756  nTmpNumLvl = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
2757  }
2758  if(SfxItemState::SET == rSet.GetItemState(nNumItemId, false, &pItem))
2759  {
2760  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
2761  }
2762  bModified = (!pActNum->Get( 0 ) || bPreset);
2763  if(*pSaveNum != *pActNum ||
2764  nActNumLvl != nTmpNumLvl )
2765  {
2766  *pActNum = *pSaveNum;
2767  nActNumLvl = nTmpNumLvl;
2768  sal_uInt16 nMask = 1;
2769  m_xLevelLB->unselect_all();
2770  if (nActNumLvl == SAL_MAX_UINT16)
2771  m_xLevelLB->select(pActNum->GetLevelCount());
2772  if (nActNumLvl != SAL_MAX_UINT16)
2773  for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
2774  {
2775  if (nActNumLvl & nMask)
2776  m_xLevelLB->select(i);
2777  nMask <<= 1 ;
2778  }
2779  m_xRelativeCB->set_sensitive(nActNumLvl != 1);
2780 
2783 
2784  InitControls();
2785  }
2788 }
2789 
2791 {
2792  if(_pSet)
2793  {
2794  if (m_xDistBorderMF->get_sensitive())
2795  DistanceHdl_Impl(*m_xDistBorderMF);
2796  DistanceHdl_Impl(*m_xIndentMF);
2797  FillItemSet(_pSet);
2798  }
2799  return DeactivateRC::LeavePage;
2800 }
2801 
2803 {
2804  rSet->Put(SfxUInt16Item(SID_PARAM_CUR_NUM_LEVEL, nActNumLvl));
2805 
2806  if(bModified && pActNum)
2807  {
2808  *pSaveNum = *pActNum;
2810  rSet->Put(SfxBoolItem(SID_PARAM_NUM_PRESET, false));
2811  }
2812  return bModified;
2813 }
2814 
2816 {
2817  const SfxPoolItem* pItem;
2818  // in Draw the item exists as WhichId, in Writer only as SlotId
2819  SfxItemState eState = rSet->GetItemState(SID_ATTR_NUMBERING_RULE, false, &pItem);
2820  if(eState != SfxItemState::SET)
2821  {
2822  nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
2823  eState = rSet->GetItemState(nNumItemId, false, &pItem);
2824 
2825  if( eState != SfxItemState::SET )
2826  {
2827  pItem = &static_cast< const SvxNumBulletItem& >( rSet->Get( nNumItemId ) );
2828  eState = SfxItemState::SET;
2829  }
2830 
2831  }
2832  DBG_ASSERT(eState == SfxItemState::SET, "no item found!");
2833  pSaveNum.reset( new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule()) );
2834 
2835  // insert levels
2836  if (!m_xLevelLB->count_selected_rows())
2837  {
2838  for(sal_uInt16 i = 1; i <= pSaveNum->GetLevelCount(); i++)
2839  m_xLevelLB->append_text(OUString::number(i));
2840  if(pSaveNum->GetLevelCount() > 1)
2841  {
2842  OUString sEntry = "1 - " + OUString::number( pSaveNum->GetLevelCount() );
2843  m_xLevelLB->append_text(sEntry);
2844  m_xLevelLB->select_text(sEntry);
2845  }
2846  else
2847  m_xLevelLB->select(0);
2848  }
2849  else
2850  m_xLevelLB->select(m_xLevelLB->count_selected_rows() - 1);
2851  sal_uInt16 nMask = 1;
2852  m_xLevelLB->unselect_all();
2853  if (nActNumLvl == SAL_MAX_UINT16)
2854  {
2855  m_xLevelLB->select(pSaveNum->GetLevelCount());
2856  }
2857  else
2858  {
2859  for(sal_uInt16 i = 0; i < pSaveNum->GetLevelCount(); i++)
2860  {
2861  if(nActNumLvl & nMask)
2862  m_xLevelLB->select(i);
2863  nMask <<= 1;
2864  }
2865  }
2866 
2867  if(!pActNum)
2868  pActNum.reset( new SvxNumRule(*pSaveNum) );
2869  else if(*pSaveNum != *pActNum)
2870  *pActNum = *pSaveNum;
2872 
2875 
2876  InitControls();
2877  bModified = false;
2878 }
2879 
2881 {
2882  if ( pActNum == nullptr )
2883  {
2884  SAL_WARN( "cui.tabpages",
2885  "<SvxNumPositionTabPage::InitPosAndSpaceMode()> - misusage of method -> <pAktNum> has to be already set!" );
2886  return;
2887  }
2888 
2891  sal_uInt16 nMask = 1;
2892  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i )
2893  {
2894  if(nActNumLvl & nMask)
2895  {
2896  SvxNumberFormat aNumFmt( pActNum->GetLevel(i) );
2897  ePosAndSpaceMode = aNumFmt.GetPositionAndSpaceMode();
2898  if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
2899  {
2900  break;
2901  }
2902  }
2903  nMask <<= 1;
2904  }
2905 
2907  ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT;
2908 }
2909 
2911 {
2918  pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS) );
2920  pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS));
2923 
2934 }
2935 
2936 std::unique_ptr<SfxTabPage> SvxNumPositionTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
2937  const SfxItemSet* rAttrSet)
2938 {
2939  return std::make_unique<SvxNumPositionTabPage>(pPage, pController, *rAttrSet);
2940 }
2941 
2943 {
2944  if (eMetric == FieldUnit::MM)
2945  {
2946  m_xDistBorderMF->set_digits(1);
2947  m_xDistNumMF->set_digits(1);
2948  m_xIndentMF->set_digits(1);
2949  m_xListtabMF->set_digits(1);
2950  m_xAlignedAtMF->set_digits(1);
2951  m_xIndentAtMF->set_digits(1);
2952  }
2953  m_xDistBorderMF->set_unit(eMetric);
2954  m_xDistNumMF->set_unit(eMetric);
2955  m_xIndentMF->set_unit(eMetric);
2956  m_xListtabMF->set_unit(eMetric);
2957  m_xAlignedAtMF->set_unit(eMetric);
2958  m_xIndentAtMF->set_unit(eMetric);
2959 }
2960 
2962 {
2963  sal_uInt16 nMask = 1;
2964  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
2965  {
2966  if(nActNumLvl & nMask)
2967  {
2968  SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
2969 
2970  const sal_Int32 nPos = m_xAlignLB->get_visible()
2971  ? m_xAlignLB->get_active()
2972  : m_xAlign2LB->get_active();
2973  SvxAdjust eAdjust = SvxAdjust::Center;
2974  if(nPos == 0)
2975  eAdjust = SvxAdjust::Left;
2976  else if(nPos == 2)
2977  eAdjust = SvxAdjust::Right;
2978  aNumFmt.SetNumAdjust( eAdjust );
2979  pActNum->SetLevel(i, aNumFmt);
2980  }
2981  nMask <<= 1;
2982  }
2983  SetModified();
2984 }
2985 
2987 {
2988  if (m_pLevelHdlEvent)
2989  return;
2990  // tdf#127120 multiselection may be implemented by deselect follow by select so
2991  // fire off the handler to happen on next event loop and only process the
2992  // final state
2993  m_pLevelHdlEvent = Application::PostUserEvent(LINK(this, SvxNumPositionTabPage, LevelHdl));
2994 }
2995 
2997 {
2998  m_pLevelHdlEvent = nullptr;
2999 
3000  sal_uInt16 nSaveNumLvl = nActNumLvl;
3001  nActNumLvl = 0;
3002  std::vector<int> aSelectedRows = m_xLevelLB->get_selected_rows();
3003  if (std::find(aSelectedRows.begin(), aSelectedRows.end(), pActNum->GetLevelCount()) != aSelectedRows.end() &&
3004  (aSelectedRows.size() == 1 || nSaveNumLvl != 0xffff))
3005  {
3006  nActNumLvl = 0xFFFF;
3007  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ )
3008  m_xLevelLB->unselect(i);
3009  }
3010  else if (!aSelectedRows.empty())
3011  {
3012  sal_uInt16 nMask = 1;
3013  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ )
3014  {
3015  if (std::find(aSelectedRows.begin(), aSelectedRows.end(), i) != aSelectedRows.end())
3016  nActNumLvl |= nMask;
3017  nMask <<= 1;
3018  }
3019  m_xLevelLB->unselect(pActNum->GetLevelCount());
3020  }
3021  else
3022  {
3023  nActNumLvl = nSaveNumLvl;
3024  sal_uInt16 nMask = 1;
3025  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ )
3026  {
3027  if(nActNumLvl & nMask)
3028  {
3029  m_xLevelLB->select(i);
3030  break;
3031  }
3032  nMask <<=1;
3033  }
3034  }
3035  m_xRelativeCB->set_sensitive(nActNumLvl != 1);
3036  SetModified();
3037  InitPosAndSpaceMode();
3038  ShowControlsDependingOnPosAndSpaceMode();
3039  InitControls();
3040 }
3041 
3043 {
3044  if(bInInintControl)
3045  return;
3046  tools::Long nValue = GetCoreValue(rFld, eCoreUnit);
3047  sal_uInt16 nMask = 1;
3048  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
3049  {
3050  if(nActNumLvl & nMask)
3051  {
3052  SvxNumberFormat aNumFmt( pActNum->GetLevel( i ) );
3053  if (&rFld == m_xDistBorderMF.get())
3054  {
3055 
3056  if (m_xRelativeCB->get_active())
3057  {
3058  if(0 == i)
3059  {
3060  auto const nTmp = aNumFmt.GetFirstLineOffset();
3061  aNumFmt.SetAbsLSpace( nValue - nTmp);
3062  }
3063  else
3064  {
3065  tools::Long nTmp = pActNum->GetLevel( i - 1 ).GetAbsLSpace() +
3066  pActNum->GetLevel( i - 1 ).GetFirstLineOffset() -
3067  pActNum->GetLevel( i ).GetFirstLineOffset();
3068 
3069  aNumFmt.SetAbsLSpace( nValue + nTmp);
3070  }
3071  }
3072  else
3073  {
3074  aNumFmt.SetAbsLSpace( nValue - aNumFmt.GetFirstLineOffset());
3075  }
3076  }
3077  else if (&rFld == m_xDistNumMF.get())
3078  {
3079  aNumFmt.SetCharTextDistance( static_cast<short>(nValue) );
3080  }
3081  else if (&rFld == m_xIndentMF.get())
3082  {
3083  // together with the FirstLineOffset the AbsLSpace must be changed, too
3084  tools::Long nDiff = nValue + aNumFmt.GetFirstLineOffset();
3085  auto const nAbsLSpace = aNumFmt.GetAbsLSpace();
3086  aNumFmt.SetAbsLSpace(nAbsLSpace + nDiff);
3087  aNumFmt.SetFirstLineOffset( -nValue );
3088  }
3089 
3090  pActNum->SetLevel( i, aNumFmt );
3091  }
3092  nMask <<= 1;
3093  }
3094 
3095  SetModified();
3096  if (!m_xDistBorderMF->get_sensitive())
3097  {
3098  m_xDistBorderMF->set_text("");
3099  }
3100 }
3101 
3102 IMPL_LINK(SvxNumPositionTabPage, RelativeHdl_Impl, weld::ToggleButton&, rBox, void)
3103 {
3104  bool bOn = rBox.get_active();
3105  bool bSingleSelection = m_xLevelLB->count_selected_rows() == 1 && SAL_MAX_UINT16 != nActNumLvl;
3106  bool bSetValue = false;
3107  tools::Long nValue = 0;
3108  if(bOn || bSingleSelection)
3109  {
3110  sal_uInt16 nMask = 1;
3111  bool bFirst = true;
3112  bSetValue = true;
3113  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
3114  {
3115  if(nActNumLvl & nMask)
3116  {
3117  const SvxNumberFormat &rNumFmt = pActNum->GetLevel(i);
3118  if(bFirst)
3119  {
3120  nValue = rNumFmt.GetAbsLSpace() + rNumFmt.GetFirstLineOffset();
3121  if(bOn && i)
3122  nValue -= (pActNum->GetLevel(i - 1).GetAbsLSpace() + pActNum->GetLevel(i - 1).GetFirstLineOffset());
3123  }
3124  else
3125  bSetValue = nValue ==
3126  (rNumFmt.GetAbsLSpace() + rNumFmt.GetFirstLineOffset()) -
3127  (pActNum->GetLevel(i - 1).GetAbsLSpace() + pActNum->GetLevel(i - 1).GetFirstLineOffset());
3128  bFirst = false;
3129  }
3130  nMask <<= 1;
3131  }
3132 
3133  }
3134  if(bSetValue)
3135  SetMetricValue(*m_xDistBorderMF, nValue, eCoreUnit);
3136  else
3137  m_xDistBorderMF->set_text("");
3138  m_xDistBorderMF->set_sensitive(bOn || bSingleSelection);
3139  m_xDistBorderFT->set_sensitive(bOn || bSingleSelection);
3140  bLastRelative = bOn;
3141 }
3142 
3143 IMPL_LINK_NOARG(SvxNumPositionTabPage, LabelFollowedByHdl_Impl, weld::ComboBox&, void)
3144 {
3145  // determine value to be set at the chosen list levels
3147  {
3148  const auto nPos = m_xLabelFollowedByLB->get_active();
3149  if ( nPos == 1 )
3150  {
3151  eLabelFollowedBy = SvxNumberFormat::SPACE;
3152  }
3153  else if ( nPos == 2 )
3154  {
3155  eLabelFollowedBy = SvxNumberFormat::NOTHING;
3156  }
3157  else if ( nPos == 3 )
3158  {
3159  eLabelFollowedBy = SvxNumberFormat::NEWLINE;
3160  }
3161  }
3162 
3163  // set value at the chosen list levels
3164  bool bSameListtabPos = true;
3165  sal_uInt16 nFirstLvl = SAL_MAX_UINT16;
3166  sal_uInt16 nMask = 1;
3167  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i )
3168  {
3169  if ( nActNumLvl & nMask )
3170  {
3171  SvxNumberFormat aNumFmt( pActNum->GetLevel(i) );
3172  aNumFmt.SetLabelFollowedBy( eLabelFollowedBy );
3173  pActNum->SetLevel( i, aNumFmt );
3174 
3175  if ( nFirstLvl == SAL_MAX_UINT16 )
3176  {
3177  nFirstLvl = i;
3178  }
3179  else
3180  {
3181  bSameListtabPos &= aNumFmt.GetListtabPos() ==
3182  pActNum->GetLevel( nFirstLvl ).GetListtabPos();
3183  }
3184  }
3185  nMask <<= 1;
3186  }
3187 
3188  // enable/disable metric field for list tab stop position depending on
3189  // selected item following the list label.
3190  m_xListtabFT->set_sensitive( eLabelFollowedBy == SvxNumberFormat::LISTTAB );
3191  m_xListtabMF->set_sensitive( eLabelFollowedBy == SvxNumberFormat::LISTTAB );
3192  if ( bSameListtabPos && eLabelFollowedBy == SvxNumberFormat::LISTTAB )
3193  {
3194  SetMetricValue(*m_xListtabMF, pActNum->GetLevel( nFirstLvl ).GetListtabPos(), eCoreUnit);
3195  }
3196  else
3197  {
3198  m_xListtabMF->set_text(OUString());
3199  }
3200 
3201  SetModified();
3202 }
3203 
3204 IMPL_LINK(SvxNumPositionTabPage, ListtabPosHdl_Impl, weld::MetricSpinButton&, rFld, void)
3205 {
3206  // determine value to be set at the chosen list levels
3207  const tools::Long nValue = GetCoreValue(rFld, eCoreUnit);
3208 
3209  // set value at the chosen list levels
3210  sal_uInt16 nMask = 1;
3211  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i )
3212  {
3213  if ( nActNumLvl & nMask )
3214  {
3215  SvxNumberFormat aNumFmt( pActNum->GetLevel(i) );
3216  aNumFmt.SetListtabPos( nValue );
3217  pActNum->SetLevel( i, aNumFmt );
3218  }
3219  nMask <<= 1;
3220  }
3221 
3222  SetModified();
3223 }
3224 
3226 {
3227  // determine value to be set at the chosen list levels
3228  const tools::Long nValue = GetCoreValue(rFld, eCoreUnit);
3229 
3230  // set value at the chosen list levels
3231  sal_uInt16 nMask = 1;
3232  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i )
3233  {
3234  if ( nActNumLvl & nMask )
3235  {
3236  SvxNumberFormat aNumFmt( pActNum->GetLevel(i) );
3237  const tools::Long nFirstLineIndent = nValue - aNumFmt.GetIndentAt();
3238  aNumFmt.SetFirstLineIndent( nFirstLineIndent );
3239  pActNum->SetLevel( i, aNumFmt );
3240  }
3241  nMask <<= 1;
3242  }
3243 
3244  SetModified();
3245 }
3246 
3248 {
3249  // determine value to be set at the chosen list levels
3250  const tools::Long nValue = GetCoreValue(rFld, eCoreUnit);
3251 
3252  // set value at the chosen list levels
3253  sal_uInt16 nMask = 1;
3254  for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i )
3255  {
3256  if ( nActNumLvl & nMask )
3257  {
3258  SvxNumberFormat aNumFmt( pActNum->GetLevel(i) );
3259  const tools::Long nAlignedAt = aNumFmt.GetIndentAt() +
3260  aNumFmt.GetFirstLineIndent();
3261  aNumFmt.SetIndentAt( nValue );
3262  const tools::Long nNewFirstLineIndent = nAlignedAt - nValue;
3263  aNumFmt.SetFirstLineIndent( nNewFirstLineIndent );
3264  pActNum->SetLevel( i, aNumFmt );
3265  }
3266  nMask <<= 1;
3267  }
3268 
3269  SetModified();
3270 }
3271 
3273 {
3274  sal_uInt16 nMask = 1;
3275  SvxNumRule aTmpNumRule( pActNum->GetFeatureFlags(),
3276  pActNum->GetLevelCount(),
3277  pActNum->IsContinuousNumbering(),
3278  SvxNumRuleType::NUMBERING,
3279  pActNum->GetLevel( 0 ).GetPositionAndSpaceMode() );
3280  for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
3281  {
3282  if(nActNumLvl & nMask)
3283  {
3284  SvxNumberFormat aNumFmt( pActNum->GetLevel( i ) );
3285  const SvxNumberFormat& aTempFmt(aTmpNumRule.GetLevel( i ));
3286  aNumFmt.SetPositionAndSpaceMode( aTempFmt.GetPositionAndSpaceMode() );
3287  if ( aTempFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
3288  {
3289  aNumFmt.SetAbsLSpace( aTempFmt.GetAbsLSpace() );
3290  aNumFmt.SetCharTextDistance( aTempFmt.GetCharTextDistance() );
3291  aNumFmt.SetFirstLineOffset( aTempFmt.GetFirstLineOffset() );
3292  }
3293  else if ( aTempFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
3294  {
3295  aNumFmt.SetNumAdjust( aTempFmt.GetNumAdjust() );
3296  aNumFmt.SetLabelFollowedBy( aTempFmt.GetLabelFollowedBy() );
3297  aNumFmt.SetListtabPos( aTempFmt.GetListtabPos() );
3298  aNumFmt.SetFirstLineIndent( aTempFmt.GetFirstLineIndent() );
3299  aNumFmt.SetIndentAt( aTempFmt.GetIndentAt() );
3300  }
3301 
3302  pActNum->SetLevel( i, aNumFmt );
3303  }
3304  nMask <<= 1;
3305  }
3306 
3307  InitControls();
3308  SetModified();
3309 }
3310 
3312 {
3313  bModified = true;
3316 }
3317 
3319 {
3320  bModified = true;
3321  if (bRepaint)
3322  {
3325  }
3326 }
3327 
3329 {
3330  const SfxStringListItem* pListItem = aSet.GetItem<SfxStringListItem>(SID_CHAR_FMT_LIST_BOX, false);
3331  const SfxStringItem* pNumCharFmt = aSet.GetItem<SfxStringItem>(SID_NUM_CHAR_FMT, false);
3332  const SfxStringItem* pBulletCharFmt = aSet.GetItem<SfxStringItem>(SID_BULLET_CHAR_FMT, false);
3333  const SfxUInt16Item* pMetricItem = aSet.GetItem<SfxUInt16Item>(SID_METRIC_ITEM, false);
3334 
3335  if (pNumCharFmt &&pBulletCharFmt)
3336  SetCharFmts( pNumCharFmt->GetValue(),pBulletCharFmt->GetValue());
3337 
3338  if (pListItem)
3339  {
3340  const std::vector<OUString> &aList = pListItem->GetList();
3341  sal_uInt32 nCount = aList.size();
3342  for(sal_uInt32 i = 0; i < nCount; i++)
3343  m_xCharFmtLB->append_text(aList[i]);
3344  }
3345  if (pMetricItem)
3346  SetMetric(static_cast<FieldUnit>(pMetricItem->GetValue()));
3347 }
3348 
3350 {
3351  const SfxUInt16Item* pMetricItem = aSet.GetItem<SfxUInt16Item>(SID_METRIC_ITEM, false);
3352 
3353  if (pMetricItem)
3354  SetMetric(static_cast<FieldUnit>(pMetricItem->GetValue()));
3355 }
3356 
3357 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetFamily(FontFamily)
std::unique_ptr< weld::Label > m_xErrorText
Definition: numpages.hxx:172
std::unique_ptr< weld::Label > m_xDistNumFT
Definition: numpages.hxx:332
SvxNumType GetNumberingType() const
#define SHOW_NUMBERING
Definition: numpages.cxx:82
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
tools::Long GetFirstLineIndent() const
void SetFillColor(const Color &)
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
SVX_NUM_CHARS_UPPER_LETTER_N
URL aURL
FieldUnit
void SetLabelFollowedBy(const LabelFollowedBy eLabelFollowedBy)
sal_uInt16 nActNumLvl
Definition: numpages.hxx:92
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: numpages.cxx:789
std::unique_ptr< weld::Label > m_xBulColorFT
Definition: numpages.hxx:233
void SetFontSize(const Size &)
ErrCode GetGraphic(Graphic &) const
std::unique_ptr< weld::MenuButton > m_xBitmapMB
Definition: numpages.hxx:244
void SetCharFmts(const OUString &rNumName, const OUString &rBulletName)
Definition: numpages.hxx:296
#define SVX_NUM_REL_SIZE_MIN
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: numpages.cxx:2790
const OUString & GetFamilyName() const
sal_UCS4 GetBulletChar() const
std::unique_ptr< SvxNumValueSet > m_xExamplesVS
Definition: numpages.hxx:136
const Color & GetBulletColor() const
std::unique_ptr< weld::CustomWeld > m_xExamplesVSWin
Definition: numpages.hxx:175
std::unique_ptr< weld::CustomWeld > m_xExamplesVSWin
Definition: numpages.hxx:70
sal_uInt32 sal_UCS4
void setWidth(tools::Long nWidth)
SvxBulletPickTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: numpages.cxx:340
std::unique_ptr< weld::Label > m_xAllLevelFT
Definition: numpages.hxx:237
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: numpages.cxx:227
std::string GetValue
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: numpages.cxx:411
sal_uInt16 GetBulletRelSize() const
#define NUM_VALUSET_COUNT
Definition: numpages.hxx:119
void SetPositionAndSpaceMode(SvxNumPositionAndSpaceMode ePositionAndSpaceMode)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: numpages.cxx:2936
ImplSVEvent * m_pLevelHdlEvent
Definition: numpages.hxx:313
std::unique_ptr< weld::Label > m_xAlign2FT
Definition: numpages.hxx:342
SvxNumSettingsArr_Impl aNumSettingsArrays[NUM_VALUSET_COUNT]
Definition: numpages.hxx:127
std::unique_ptr< SvxNumValueSet > m_xExamplesVS
Definition: numpages.hxx:69
const SvxBrushItem * GetBrush() const
bool Scale(const Size &rNewSize, BmpScaleFlag nScaleFlag=BmpScaleFlag::Default)
OUString GetPath() const
const sal_uInt16 * GetLevelVal() const
std::unique_ptr< weld::Label > m_xDistBorderFT
Definition: numpages.hxx:327
void SetNumRule(const SvxNumRule *pNum)
SVX_NUM_NUMBER_NONE
std::unique_ptr< SvxNumRule > pActNum
Definition: numpages.hxx:201
long Long
FAMILY_DONTKNOW
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
void SetPrefix(const OUString &rSet)
std::unique_ptr< weld::Widget > m_xAllLevelsFrame
Definition: numpages.hxx:252
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
void SetChar(sal_UCS4)
Definition: cuicharmap.cxx:205
constexpr OUStringLiteral PERCENT(u"Percent")
const SvxNumberFormat * Get(sal_uInt16 nLevel) const
std::unique_ptr< SvxNumRule > pActNum
Definition: numpages.hxx:61
sal_uInt16 GetValue() const
void SetWeight(FontWeight)
std::unique_ptr< weld::CheckButton > m_xRelativeCB
Definition: numpages.hxx:329
std::unique_ptr< weld::ComboBox > m_xLabelFollowedByLB
Definition: numpages.hxx:339
std::unique_ptr< weld::MetricSpinButton > m_xHeightMF
Definition: numpages.hxx:248
sal_uInt8 GetIncludeUpperLevels() const
vcl::Font aActBulletFont
Definition: numpages.hxx:215
std::unique_ptr< weld::Label > m_xBitmapFT
Definition: numpages.hxx:243
IMPL_LINK_NOARG(SvxSingleNumPickTabPage, NumSelectHdl_Impl, ValueSet *, void)
Definition: numpages.cxx:294
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
const MapMode & GetMapMode() const
virtual ~SvxSingleNumPickTabPage() override
Definition: numpages.cxx:203
tools::Long GetListtabPos() const
OUString sBulletCharFormatName
Definition: numpages.hxx:97
std::unique_ptr< weld::CustomWeld > m_xPreviewWIN
Definition: numpages.hxx:255
std::unique_ptr< weld::CustomWeld > m_xPreviewWIN
Definition: numpages.hxx:349
const vcl::Font & GetCharFont() const
Definition: cuicharmap.hxx:157
void SetCharSet(rtl_TextEncoding)
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: numpages.cxx:378
static SfxObjectShell * Current()
OUString Name
const sal_Unicode aBulletTypes[]
Definition: numpages.cxx:120
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: numpages.cxx:1130
void SetIncludeUpperLevels(sal_uInt8 nSet)
sal_Int32 nFirstLineOffset
OUString GetPath() const
std::unique_ptr< SvxNumRule > pActNum
Definition: numpages.hxx:310
std::unique_ptr< SvxNumRule > pSaveNum
Definition: numpages.hxx:311
static int GetValue(sal_uInt32 i)
virtual ~SvxNumPickTabPage() override
Definition: numpages.cxx:538
#define MAX_BMP_WIDTH
Definition: numpages.cxx:86
static Size GetGraphicSizeMM100(const Graphic *pGraphic)
bool IsAvailable(const OUString &rName) const
std::unique_ptr< weld::Label > m_xStartFT
Definition: numpages.hxx:239
sal_uInt16 nActNumLvl
Definition: numpages.hxx:218
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
Size const & GetOutputSizePixel() const
virtual void Reset(const SfxItemSet *rSet) override
Definition: numpages.cxx:1195
SvxNumType
static OUString GetString(sal_uInt32 i)
OUString PathToFileName() const
IMPL_LINK(SvxNumOptionsTabPage, AllLevelHdl_Impl, weld::SpinButton &, rBox, void)
Definition: numpages.cxx:1611
std::unique_ptr< weld::CustomWeld > m_xExamplesVSWin
Definition: numpages.hxx:100
Value
std::unique_ptr< weld::Button > m_xBulletPB
Definition: numpages.hxx:242
HashMap_OWString_Interface aMap
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
constexpr::Color COL_AUTO(0xFF, 0xFF, 0xFF, 0xFF)
std::unique_ptr< SvxNumRule > pSaveNum
Definition: numpages.hxx:62
sal_uInt16 sal_Unicode
std::unique_ptr< weld::ComboBox > m_xAlign2LB
Definition: numpages.hxx:343
std::unique_ptr< weld::ComboBox > m_xAlignLB
Definition: numpages.hxx:335
std::unique_ptr< weld::MetricSpinButton > m_xListtabMF
Definition: numpages.hxx:341
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
std::unique_ptr< SvxBmpNumValueSet > m_xExamplesVS
Definition: numpages.hxx:174
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: numpages.cxx:1183
#define SAL_MAX_UINT16
const vcl::Font & GetFont() const
SvxNumberingPreview m_aPreviewWIN
Definition: numpages.hxx:323
std::unique_ptr< weld::Label > m_xBulRelSizeFT
Definition: numpages.hxx:235
std::unique_ptr< weld::Label > m_xHeightFT
Definition: numpages.hxx:247
std::unique_ptr< weld::Label > m_xBulletFT
Definition: numpages.hxx:241
std::unique_ptr< weld::TreeView > m_xLevelLB
Definition: numpages.hxx:224
void SetExchangeSupport()
int nCount
void SetBulletRelSize(sal_uInt16 nSet)
virtual void Reset(const SfxItemSet *rSet) override
Definition: numpages.cxx:846
void SetCharFormatName(const OUString &rSet)
SVX_NUM_ARABIC
std::unique_ptr< weld::Label > m_xSuffixFT
Definition: numpages.hxx:229
FontMetric Get(const OUString &rName, const OUString &rStyleName) const
short GetCharTextDistance() const
sal_uInt16 nNumItemId
Definition: numpages.hxx:132
std::unique_ptr< SvxNumRule > pSaveNum
Definition: numpages.hxx:130
static tools::Long lcl_DrawGraphic(VirtualDevice *pVDev, const SvxNumberFormat &rFmt, tools::Long nXStart, tools::Long nYMiddle, tools::Long nDivision)
Definition: numpages.cxx:2122
std::unique_ptr< weld::Button > m_xBtBrowseFile
Definition: numpages.hxx:173
std::unique_ptr< weld::MetricSpinButton > m_xDistBorderMF
Definition: numpages.hxx:328
virtual void Reset(const SfxItemSet *rSet) override
Definition: numpages.cxx:2815
void CheckForStartValue_Impl(sal_uInt16 nNumberingType)
Definition: numpages.cxx:1708
const Graphic * GetGraphic(OUString const &referer=OUString()) const
sal_Int16 nNumType
sal_uInt16 nNumItemId
Definition: numpages.hxx:167
const OUString & GetPrefix() const
sal_uInt16 GetExportFormatNumberForShortName(std::u16string_view rShortName)
std::unique_ptr< weld::CustomWeld > m_xExamplesVSWin
Definition: numpages.hxx:137
const OUString & GetSuffix() const
OUString sBulletChar
Definition: numpages.hxx:47
std::unique_ptr< SvxNumValueSet > m_xExamplesVS
Definition: numpages.hxx:99
void SetPitch(FontPitch ePitch)
const LanguageTag & GetLanguageTag() const
std::unique_ptr< SvxNumRule > pActNum
Definition: numpages.hxx:164
std::unique_ptr< weld::Button > m_xStandardPB
Definition: numpages.hxx:348
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: numpages.cxx:3328
SVX_NUM_BITMAP
void Invert()
SVX_NUM_CHAR_SPECIAL
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
WEIGHT_DONTKNOW
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
static LanguageType getSystemLanguage()
void SetLevel(sal_uInt16 nSet)
void SetModified(bool bRepaint=true)
Definition: numpages.cxx:3318
bool IsFeatureSupported(SvxNumRuleFlags nFeature) const
#define SEARCHPATH_DELIMITER
Definition: numpages.cxx:88
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: numpages.cxx:209
bool IsRTLEnabled() const
#define SAL_MAX_INT32
static tools::Long lcl_DrawBullet(VirtualDevice *pVDev, const SvxNumberFormat &rFmt, tools::Long nXStart, tools::Long nYStart, const Size &rSize)
Definition: numpages.cxx:2144
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: numpages.cxx:594
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
SvxAdjust
int i
ImplSVEvent * m_pLevelHdlEvent
Definition: numpages.hxx:206
virtual void Paint(vcl::RenderContext &rRenderContext, const ::tools::Rectangle &rRect) override
Definition: numpages.cxx:2188
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: numpages.cxx:2746
LabelFollowedBy GetLabelFollowedBy() const
void SetBulletFont(const vcl::Font *pFont)
sal_Int32 GetAbsLSpace() const
void SetMetric(FieldUnit eSet)
Definition: numpages.cxx:2942
std::unique_ptr< weld::Label > m_xCharFmtFT
Definition: numpages.hxx:231
bool IsDark() const
#define SEARCHFILENAME_DELIMITER
Definition: numpages.cxx:89
#define SHOW_BULLET
Definition: numpages.cxx:83
SvxSingleNumPickTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: numpages.cxx:161
std::unique_ptr< SvxNumRule > pSaveNum
Definition: numpages.hxx:91
static bool BeginLocking(std::u16string_view rThemeName)
const OUString & GetValue() const
int GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
HTMLMODE_ON
static SvxNumSettings_Impl * lcl_CreateNumSettingsPtr(const Sequence< PropertyValue > &rLevelProps)
Definition: numpages.cxx:93
std::unique_ptr< weld::ComboBox > m_xOrientLB
Definition: numpages.hxx:251
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: numpages.cxx:215
std::unique_ptr< weld::SpinButton > m_xStartED
Definition: numpages.hxx:240
const vcl::Font * GetBulletFont() const
std::unique_ptr< SvxNumRule > pSaveNum
Definition: numpages.hxx:202
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: numpages.cxx:3349
tools::Long Width() const
SvxNumberingPreview m_aPreviewWIN
Definition: numpages.hxx:222
OUString MakeNumString(const SvxNodeNum &) const
WEIGHT_NORMAL
const SvxNumberFormat & GetLevel(sal_uInt16 nLevel) const
sal_uInt16 GetLevelCount() const
static sal_uInt32 Count()
static const vcl::Font & lcl_GetDefaultBulletFont()
Definition: numpages.cxx:146
#define SHOW_BITMAP
Definition: numpages.cxx:84
SvxBitmapPickTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: numpages.cxx:729
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: numpages.cxx:550
virtual void Reset(const SfxItemSet *rSet) override
Definition: numpages.cxx:601
std::unique_ptr< weld::MetricSpinButton > m_xIndentAtMF
Definition: numpages.hxx:347
const Size & GetFontSize() const
PITCH_DONTKNOW
std::unique_ptr< weld::Widget > m_xGrid
Definition: numpages.hxx:223
static Reference< XDefaultNumberingProvider > GetNumberingProvider()
std::unique_ptr< SvxNumRule > pActNum
Definition: numpages.hxx:129
std::unique_ptr< weld::Label > m_xIndentFT
Definition: numpages.hxx:330
SvxAdjust GetNumAdjust() const
void SetCharFormatNames(const OUString &rCharName, const OUString &rBulName)
Definition: numpages.hxx:154
std::unique_ptr< weld::Label > m_xPrefixFT
Definition: numpages.hxx:227
std::unique_ptr< weld::MetricSpinButton > m_xIndentMF
Definition: numpages.hxx:331
const AllSettings & GetSettings() const
sal_uInt16 nActNumLvl
Definition: numpages.hxx:166
void SwitchNumberType(sal_uInt8 nType)
To switch between the numbering type 0 - Number; 1 - Bullet; 2 - Bitmap;.
Definition: numpages.cxx:1495
sal_uInt16 GetStart() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
std::unique_ptr< weld::Entry > m_xSuffixED
Definition: numpages.hxx:230
ITALIC_NONE
void ShowControlsDependingOnPosAndSpaceMode()
Definition: numpages.cxx:2910
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
SvxNumSettingsArr_Impl aNumSettingsArr
Definition: numpages.hxx:60
GPOS_AREA
void SetMetricValue(weld::MetricSpinButton &rField, int nCoreValue, MapUnit eUnit)
void SetTimeout(sal_uInt64 nTimeoutMs)
bool bLabelAlignmentPosAndSpaceModeActive
Definition: numpages.hxx:321
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: numpages.cxx:719
sal_uInt16 nNumItemId
Definition: numpages.hxx:95
static ErrCode Import(SvStream &rIStm, Graphic &rGraphic, ConvertDataFormat nFormat=ConvertDataFormat::Unknown)
SfxItemPool * GetPool() const
std::unique_ptr< weld::Label > m_xListtabFT
Definition: numpages.hxx:340
static bool EndLocking(std::u16string_view rThemeName)
SVX_NUM_CHARS_LOWER_LETTER_N
ErrCode ExportGraphic(const Graphic &rGraphic, const INetURLObject &rPath, sal_uInt16 nFormat, const css::uno::Sequence< css::beans::PropertyValue > *pFilterData=nullptr)
const SfxItemSet * GetDialogExampleSet() const
std::vector< OUString > & GetList()
OUString CuiResId(const char *pKey)
Definition: cuiresmgr.cxx:23
void EditModifyHdl_Impl(const weld::Entry *)
Definition: numpages.cxx:2098
virtual ~SvxNumPositionTabPage() override
Definition: numpages.cxx:2540
void SetTitle(const OUString &rNewTitle)
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: numpages.cxx:367
void SetColor(const Color &)
constexpr T & temporary(T &&x)
const sal_uInt16 idx[]
static bool bLastRelative
Definition: numpages.cxx:91
virtual short run() override
Definition: cuicharmap.cxx:184
SvxNumPickTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: numpages.cxx:489
Point PixelToLogic(const Point &rDevicePt) const
std::unique_ptr< weld::Label > m_xLabelFollowedByFT
Definition: numpages.hxx:338
virtual void Reset(const SfxItemSet *rSet) override
Definition: numpages.cxx:418
std::unique_ptr< weld::Label > m_xIndentAtFT
Definition: numpages.hxx:346
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
std::unique_ptr< weld::Label > m_xWidthFT
Definition: numpages.hxx:245
std::unique_ptr< SvxNumRule > pActNum
Definition: numpages.hxx:90
const PropertyValue * pValues
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
bool IsContinuousNumbering() const
std::unique_ptr< weld::Label > m_xOrientFT
Definition: numpages.hxx:250
TabPage for complete numeration.
Definition: numpages.hxx:122
std::unique_ptr< weld::Entry > m_xPrefixED
Definition: numpages.hxx:228
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: numpages.cxx:544
std::unique_ptr< weld::MetricSpinButton > m_xBulRelSizeMF
Definition: numpages.hxx:236
const Size & GetGraphicSize() const
SfxItemState
weld::Entry & rEdit
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: numpages.cxx:561
std::vector< std::unique_ptr< SvxNumSettings_Impl > > SvxNumSettingsArr_Impl
Definition: numpages.hxx:55
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
std::unique_ptr< weld::ComboBox > m_xCharFmtLB
Definition: numpages.hxx:232
static bool InsertURL(std::u16string_view rThemeName, const OUString &rURL)
#define ERRCODE_NONE
virtual ~SvxBitmapPickTabPage() override
Definition: numpages.cxx:777
#define LINK_TOKEN
unsigned char sal_uInt8
sal_uInt16 nNumItemId
Definition: numpages.hxx:315
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: numpages.cxx:2802
void SetFont(const vcl::Font &rNewFont)
SvxNumPositionTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: numpages.cxx:2473
void clicked()
void SetTransparent(bool bTransparent)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
static bool lcl_IsNumFmtSet(SvxNumRule const *pNum, sal_uInt16 nLevelMask)
Definition: numpages.cxx:133
virtual OUString GetCharFormatName() const
sal_uInt16 nActNumLvl
Definition: numpages.hxx:131
SvxNumType nNumberType
Definition: numpages.hxx:43
INetProtocol GetProtocol() const
RET_OK
std::unique_ptr< weld::CheckButton > m_xSameLevelCB
Definition: numpages.hxx:254
OUString GetFileExtension() const
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
const OUString & GetGalleryPath() const
std::vector< OUString > aGrfNames
Definition: numpages.hxx:162
tools::Long Height() const
void SetMetric(FieldUnit eSet)
Definition: numpages.cxx:1119
#define SVX_MAX_NUM
std::unique_ptr< weld::MetricSpinButton > m_xDistNumMF
Definition: numpages.hxx:333
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
SvxNumOptionsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: numpages.cxx:1012
void SetInvokeHandler(const Link< Timer *, void > &rLink)
void SetCharFont(const vcl::Font &rFont)
Definition: cuicharmap.cxx:573
void SetLevel(sal_uInt8 nVal)
std::unique_ptr< weld::ComboBox > m_xFmtLB
Definition: numpages.hxx:225
virtual ~SvxBulletPickTabPage() override
Definition: numpages.cxx:355
sal_Int32 GetFirstLineOffset() const
bool IsShowSymbol() const
#define SVX_DEF_BULLET
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: numpages.cxx:361
std::unique_ptr< weld::SpinButton > m_xAllLevelNF
Definition: numpages.hxx:238
#define MAX_BMP_HEIGHT
Definition: numpages.cxx:87
DeactivateRC
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: numpages.cxx:261
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: numpages.cxx:830
virtual ~SvxNumOptionsTabPage() override
Definition: numpages.cxx:1106
static GraphicFilter & GetGraphicFilter()
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: numpages.cxx:481
reference_type * get() const
sal_UCS4 GetChar() const
Definition: cuicharmap.cxx:211
#define SAL_WARN(area, stream)
std::unique_ptr< weld::TreeView > m_xLevelLB
Definition: numpages.hxx:324
Reference< XSingleServiceFactory > xFactory
The main purpose of this dialog is to enable the use of characters that are not easily accessible fro...
Definition: cuicharmap.hxx:72
std::unique_ptr< SvxNumRule > pSaveNum
Definition: numpages.hxx:165
OUString sBulletFont
Definition: numpages.hxx:48
sal_uInt16 nActNumLvl
Definition: numpages.hxx:314
sal_Int32 nLength
std::unique_ptr< weld::Label > m_xAlignFT
Definition: numpages.hxx:334
std::unique_ptr< weld::Label > m_xAlignedAtFT
Definition: numpages.hxx:344
const FontList * GetFontList() const
static void GetI18nNumbering(weld::ComboBox &rFmtLB, sal_uInt16 nDoNotRemove)
std::unique_ptr< ColorListBox > m_xBulColLB
Definition: numpages.hxx:234
void SetNumberingType(SvxNumType nSet)
std::unique_ptr< weld::CheckButton > m_xRatioCB
Definition: numpages.hxx:249
const Size & GetSizePixel() const
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: numpages.cxx:1136
std::unique_ptr< weld::MetricSpinButton > m_xAlignedAtMF
Definition: numpages.hxx:345
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
std::unique_ptr< weld::Label > m_xSeparatorFT
Definition: numpages.hxx:226
std::unique_ptr< weld::MetricSpinButton > m_xWidthMF
Definition: numpages.hxx:246
tools::Long GetIndentAt() const
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
void SetBulletColor(Color nSet)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: numpages.cxx:1176
sal_uInt16 nNumItemId
Definition: numpages.hxx:219
sal_Int16 GetVertOrient() const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: numpages.cxx:783
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: numpages.cxx:823
static bool FillObjList(std::u16string_view rThemeName, std::vector< OUString > &rObjList)
SAL_DLLPRIVATE void DrawOutDev(const Point &, const Size &, const Point &, const Size &, const Printer &)=delete
const SvxNumRule * pActNum
sal_uInt16 nPos
const Color & GetFillColor() const
void SetListtabPos(const tools::Long nListtabPos)
static bool GetGraphicObj(std::u16string_view rThemeName, sal_uInt32 nPos, Graphic *pGraphic)
sal_Int16 nValue
virtual void Reset(const SfxItemSet *rSet) override
Definition: numpages.cxx:268