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