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