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