LibreOffice Module sw (master) 1
outline.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 <hintids.hxx>
21#include <vcl/settings.hxx>
22#include <vcl/virdev.hxx>
23#include <sfx2/tabdlg.hxx>
24#include <editeng/brushitem.hxx>
26#include <SwStyleNameMapper.hxx>
27#include <num.hxx>
28#include <view.hxx>
29#include <docsh.hxx>
30#include <uitool.hxx>
31#include <wrtsh.hxx>
32#include <swmodule.hxx>
33#include <fmtcol.hxx>
34#include <outline.hxx>
35#include <uinums.hxx>
36#include <poolfmt.hxx>
37#include <shellres.hxx>
38#include <svl/style.hxx>
39#include <charfmt.hxx>
40#include <docstyle.hxx>
41#include <viewopt.hxx>
42#include <outline.hrc>
43#include <strings.hrc>
44#include <paratr.hxx>
45#include <svtools/colorcfg.hxx>
46
48
49using namespace ::com::sun::star;
50
51namespace {
52
53class SwNumNamesDlg : public weld::GenericDialogController
54{
55 std::unique_ptr<weld::Entry> m_xFormEdit;
56 std::unique_ptr<weld::TreeView> m_xFormBox;
57 std::unique_ptr<weld::Button> m_xOKBtn;
58
59 DECL_LINK( ModifyHdl, weld::Entry&, void );
60 DECL_LINK( SelectHdl, weld::TreeView&, void );
61 DECL_LINK( DoubleClickHdl, weld::TreeView&, bool );
62
63public:
64 explicit SwNumNamesDlg(weld::Window *pParent);
65 void SetUserNames(const OUString *pList[]);
66 OUString GetName() const { return m_xFormEdit->get_text(); }
67 int GetCurEntryPos() const { return m_xFormBox->get_selected_index(); }
68};
69
70}
71
72// remember selected entry
73IMPL_LINK( SwNumNamesDlg, SelectHdl, weld::TreeView&, rBox, void )
74{
75 m_xFormEdit->set_text(rBox.get_selected_text());
76 m_xFormEdit->select_region(0, -1);
77}
78
83void SwNumNamesDlg::SetUserNames(const OUString *pList[])
84{
85 sal_uInt16 nSelect = 0;
86 for (sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
87 {
88 if(pList[i])
89 {
90 m_xFormBox->remove(i);
91 m_xFormBox->insert_text(i, *pList[i]);
92 if (i == nSelect)
93 nSelect++;
94 }
95 }
96 m_xFormBox->select(std::min(nSelect, o3tl::narrowing<sal_uInt16>(m_xFormBox->n_children() - 1)));
97 SelectHdl(*m_xFormBox);
98}
99
100// unlock OK-Button when text is in Edit
101IMPL_LINK( SwNumNamesDlg, ModifyHdl, weld::Entry&, rBox, void )
102{
103 m_xOKBtn->set_sensitive(!rBox.get_text().isEmpty());
104}
105
106// DoubleClickHdl
107IMPL_LINK_NOARG(SwNumNamesDlg, DoubleClickHdl, weld::TreeView&, bool)
108{
109 m_xDialog->response(RET_OK);
110 return true;
111}
112
113SwNumNamesDlg::SwNumNamesDlg(weld::Window *pParent)
114 : GenericDialogController(pParent,
115 "modules/swriter/ui/numberingnamedialog.ui",
116 "NumberingNameDialog")
117 , m_xFormEdit(m_xBuilder->weld_entry("entry"))
118 , m_xFormBox(m_xBuilder->weld_tree_view("form"))
119 , m_xOKBtn(m_xBuilder->weld_button("ok"))
120{
121 for (size_t i = 0; i < SAL_N_ELEMENTS(OUTLINE_STYLE); ++i)
122 m_xFormBox->append_text(SwResId(OUTLINE_STYLE[i]));
123
124 m_xFormEdit->connect_changed(LINK(this, SwNumNamesDlg, ModifyHdl));
125 m_xFormBox->connect_changed(LINK(this, SwNumNamesDlg, SelectHdl));
126 m_xFormBox->connect_row_activated(LINK(this, SwNumNamesDlg, DoubleClickHdl));
127 m_xFormBox->set_size_request(-1, m_xFormBox->get_height_rows(9));
128}
129
130static sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel)
131{
132 sal_uInt16 nTmp = nActLevel;
133 sal_uInt16 nTmpLevel = 0;
134 while( 0 != (nTmp >>= 1) )
135 nTmpLevel++;
136 return nTmpLevel;
137}
138
139sal_uInt16 SwOutlineTabDialog::nNumLevel = 1;
140
142 SwWrtShell &rSh)
143 : SfxTabDialogController(pParent, "modules/swriter/ui/outlinenumbering.ui", "OutlineNumberingDialog", pSwItemSet)
144 , rWrtSh(rSh)
145 , pChapterNumRules(SW_MOD()->GetChapterNumRules())
146 , bModified(rWrtSh.IsModified())
147 , m_xMenuButton(m_xBuilder->weld_menu_button("format"))
148{
149 m_xMenuButton->connect_toggled(LINK(this, SwOutlineTabDialog, FormHdl));
150 m_xMenuButton->connect_selected(LINK(this, SwOutlineTabDialog, MenuSelectHdl));
151
152 xNumRule.reset(new SwNumRule(*rSh.GetOutlineNumRule()));
154
155 AddTabPage("position", &SwNumPositionTabPage::Create, nullptr);
156 AddTabPage("numbering", &SwOutlineSettingsTabPage::Create, nullptr);
157
158 OUString sHeadline;
159 sal_uInt16 i;
160
161 for( i = 0; i < MAXLEVEL; ++i )
162 {
163 // if the style wasn't created yet, it's still at this position
164 if( !rWrtSh.GetParaStyle( sHeadline =
165 SwStyleNameMapper::GetUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
166 sHeadline )) )
167 aCollNames[i] = sHeadline;
168 }
169
170 // query the text templates' outlining levels
171 const sal_uInt16 nCount = rWrtSh.GetTextFormatCollCount();
172 for(i = 0; i < nCount; ++i )
173 {
175 if(!rTextColl.IsDefault())
176 {
178 {
179 int nOutLevel = rTextColl.GetAssignedOutlineStyleLevel();
180 aCollNames[ nOutLevel ] = rTextColl.GetName();
181 }
182 }
183 }
184}
185
187{
188}
189
190void SwOutlineTabDialog::PageCreated(const OString& rPageId, SfxTabPage& rPage)
191{
192 if (rPageId == "position")
193 {
194 static_cast<SwNumPositionTabPage&>(rPage).SetWrtShell(&rWrtSh);
195 static_cast<SwNumPositionTabPage&>(rPage).SetOutlineTabDialog(this);
196 }
197 else if (rPageId == "numbering")
198 {
199 static_cast<SwOutlineSettingsTabPage&>(rPage).SetWrtShell(&rWrtSh);
200 }
201}
202
204{
205 if (!bModified)
206 rWrtSh.ResetModified();
207 m_xDialog->response(RET_CANCEL);
208}
209
211{
212 if (!m_xMenuButton->get_active())
213 return;
214
215 // fill PopupMenu
216 for(sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
217 {
218 const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
219 if (!pRules)
220 continue;
221 m_xMenuButton->set_item_label("form" + OString::number(i + 1), pRules->GetName());
222 }
223}
224
225IMPL_LINK(SwOutlineTabDialog, MenuSelectHdl, const OString&, rIdent, void)
226{
227 sal_uInt8 nLevelNo = 0;
228
229 if (rIdent == "form1")
230 nLevelNo = 1;
231 else if (rIdent == "form2")
232 nLevelNo = 2;
233 else if (rIdent == "form3")
234 nLevelNo = 3;
235 else if (rIdent == "form4")
236 nLevelNo = 4;
237 else if (rIdent == "form5")
238 nLevelNo = 5;
239 else if (rIdent == "form6")
240 nLevelNo = 6;
241 else if (rIdent == "form7")
242 nLevelNo = 7;
243 else if (rIdent == "form8")
244 nLevelNo = 8;
245 else if (rIdent == "form9")
246 nLevelNo = 9;
247 else if (rIdent == "saveas")
248 {
249 SwNumNamesDlg aDlg(m_xDialog.get());
250 const OUString *aStrArr[SwChapterNumRules::nMaxRules];
251 for(sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
252 {
253 const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
254 if(pRules)
255 aStrArr[i] = &pRules->GetName();
256 else
257 aStrArr[i] = nullptr;
258 }
259 aDlg.SetUserNames(aStrArr);
260 if (aDlg.run() == RET_OK)
261 {
262 const OUString aName(aDlg.GetName());
263 pChapterNumRules->ApplyNumRules( SwNumRulesWithName(
264 *xNumRule, aName ), aDlg.GetCurEntryPos() );
265 m_xMenuButton->set_item_label("form" + OString::number(aDlg.GetCurEntryPos() + 1), aName);
266 }
267 return;
268 }
269
270 if( nLevelNo-- )
271 {
272 const SwNumRulesWithName *pRules = pChapterNumRules->GetRules( nLevelNo );
273 if( pRules )
274 {
275 pRules->ResetNumRule(rWrtSh, *xNumRule);
276 xNumRule->SetRuleType( OUTLINE_RULE );
277 SfxTabPage* pOutlinePage = GetTabPage("numbering");
278 assert(pOutlinePage);
279 static_cast<SwOutlineSettingsTabPage*>(pOutlinePage)->SetNumRule(xNumRule.get());
280 }
281 else
282 *xNumRule = *rWrtSh.GetOutlineNumRule();
283 }
284
285 SfxTabPage* pPage = GetCurTabPage();
286 pPage->Reset(GetOutputItemSet());
287}
288
289sal_uInt16 SwOutlineTabDialog::GetLevel(std::u16string_view rFormatName) const
290{
291 for(sal_uInt16 i = 0; i < MAXLEVEL; ++i)
292 {
293 if(aCollNames[i] == rFormatName)
294 return i;
295 }
296 return MAXLEVEL;
297}
298
300{
302 // set levels for all created templates; has to be done in order to
303 // delete possibly cancelled assignments again.
304
305 // encapsulate changes into an action to avoid effects on the current cursor
306 // position during the changes.
308
309 const SwNumRule * pOutlineRule = rWrtSh.GetOutlineNumRule();
310
311 sal_uInt16 i, nCount = rWrtSh.GetTextFormatCollCount();
312 for( i = 0; i < nCount; ++i )
313 {
315 if( !rTextColl.IsDefault() )
316 {
317 const SfxPoolItem & rItem =
318 rTextColl.GetFormatAttr(RES_PARATR_NUMRULE, false);
319
320 if (static_cast<sal_uInt8>(GetLevel(rTextColl.GetName())) == MAXLEVEL)
321 {
323 {
325 }
326 if (static_cast<const SwNumRuleItem &>(rItem).GetValue() ==
327 pOutlineRule->GetName())
328 {
330 }
331 }
332 else
333 {
334 rTextColl.AssignToListLevelOfOutlineStyle(GetLevel(rTextColl.GetName()));
335
336 if (static_cast<const SwNumRuleItem &>(rItem).GetValue() !=
337 pOutlineRule->GetName())
338 {
339 SwNumRuleItem aItem(pOutlineRule->GetName());
340 rTextColl.SetFormatAttr(aItem);
341 }
342 }
343 }
344 }
345
346 for(i = 0; i < MAXLEVEL; ++i )
347 {
348 OUString sHeadline;
349 ::SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
350 sHeadline );
352 if( !pColl && aCollNames[i] != sHeadline)
353 {
355 static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i) );
358
359 if( !aCollNames[i].isEmpty() )
360 {
361 pTextColl = rWrtSh.GetParaStyle(
363 if(pTextColl)
364 {
366 SwNumRuleItem aItem(pOutlineRule->GetName());
367 pTextColl->SetFormatAttr(aItem);
368 }
369 }
370 }
371 }
372
374
375 // #i30443#
377
378 return RET_OK;
379}
380
382 const SfxItemSet& rSet)
383 : SfxTabPage(pPage, pController, "modules/swriter/ui/outlinenumberingpage.ui", "OutlineNumberingPage", &rSet)
384 , aNoFormatName(SwResId(SW_STR_NONE))
385 , pSh(nullptr)
386 , pNumRule(nullptr)
387 , pCollNames(nullptr)
388 , nActLevel(1)
389 , m_xLevelLB(m_xBuilder->weld_tree_view("level"))
390 , m_xCollBox(m_xBuilder->weld_combo_box("style"))
391 , m_xNumberBox(new SwNumberingTypeListBox(m_xBuilder->weld_combo_box("numbering")))
392 , m_xCharFormatLB(m_xBuilder->weld_combo_box("charstyle"))
393 , m_xAllLevelFT(m_xBuilder->weld_label("sublevelsft"))
394 , m_xAllLevelNF(m_xBuilder->weld_spin_button("sublevelsnf"))
395 , m_xPrefixED(m_xBuilder->weld_entry("prefix"))
396 , m_xSuffixED(m_xBuilder->weld_entry("suffix"))
397 , m_xStartEdit(m_xBuilder->weld_spin_button("startat"))
398 , m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWIN))
399{
401
403 m_xCollBox->make_sorted();
404 m_xCollBox->append_text(aNoFormatName);
405 m_xLevelLB->connect_changed(LINK(this, SwOutlineSettingsTabPage, LevelHdl));
406 m_xAllLevelNF->connect_value_changed(LINK(this, SwOutlineSettingsTabPage, ToggleComplete));
407 m_xCollBox->connect_changed(LINK(this, SwOutlineSettingsTabPage, CollSelect));
408 m_xNumberBox->connect_changed(LINK(this, SwOutlineSettingsTabPage, NumberSelect));
409 m_xPrefixED->connect_changed(LINK(this, SwOutlineSettingsTabPage, DelimModify));
410 m_xSuffixED->connect_changed(LINK(this, SwOutlineSettingsTabPage, DelimModify));
411 m_xStartEdit->connect_value_changed(LINK(this, SwOutlineSettingsTabPage, StartModified));
412 m_xCharFormatLB->connect_changed(LINK(this, SwOutlineSettingsTabPage, CharFormatHdl));
413}
414
416{
417 // if a template was already selected for this level, select it in the ListBox
418 m_xCollBox->set_sensitive(USHRT_MAX != nActLevel);
419 if(USHRT_MAX == nActLevel)
420 {
421 bool bSamePrefix = true;
422 bool bSameSuffix = true;
423 bool bSameType = true;
424 bool bSameComplete = true;
425 bool bSameStart = true;
426 bool bSameCharFormat = true;
427
428 const SwNumFormat* aNumFormatArr[MAXLEVEL];
429 const SwCharFormat* pFirstFormat = nullptr;
430
431 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
432 {
433
434 aNumFormatArr[ i ] = &pNumRule->Get(i);
435 if(i == 0)
436 pFirstFormat = aNumFormatArr[i]->GetCharFormat();
437 else
438 {
439 bSameType &= aNumFormatArr[i]->GetNumberingType() == aNumFormatArr[0]->GetNumberingType();
440 bSameStart &= aNumFormatArr[i]->GetStart() == aNumFormatArr[0]->GetStart();
441 bSamePrefix &= aNumFormatArr[i]->GetPrefix() == aNumFormatArr[0]->GetPrefix();
442 bSameSuffix &= aNumFormatArr[i]->GetSuffix() == aNumFormatArr[0]->GetSuffix();
443 bSameComplete &= aNumFormatArr[i]->GetIncludeUpperLevels() == aNumFormatArr[0]->GetIncludeUpperLevels();
444 const SwCharFormat* pFormat = aNumFormatArr[i]->GetCharFormat();
445 bSameCharFormat &= (!pFirstFormat && !pFormat)
446 || (pFirstFormat && pFormat && pFormat->GetName() == pFirstFormat->GetName());
447 }
448 }
449 CheckForStartValue_Impl(aNumFormatArr[0]->GetNumberingType());
450 if (bSameType)
451 m_xNumberBox->SelectNumberingType( aNumFormatArr[0]->GetNumberingType() );
452 else
453 m_xNumberBox->SetNoSelection();
454 if(bSameStart)
455 m_xStartEdit->set_value(aNumFormatArr[0]->GetStart());
456 else
457 m_xStartEdit->set_text(OUString());
458 if(bSamePrefix)
459 m_xPrefixED->set_text(aNumFormatArr[0]->GetPrefix());
460 else
461 m_xPrefixED->set_text(OUString());
462 if(bSameSuffix)
463 m_xSuffixED->set_text(aNumFormatArr[0]->GetSuffix());
464 else
465 m_xSuffixED->set_text(OUString());
466
467 if (bSameCharFormat)
468 {
469 if (pFirstFormat)
470 m_xCharFormatLB->set_active_text(pFirstFormat->GetName());
471 else
472 m_xCharFormatLB->set_active_text(SwViewShell::GetShellRes()->aStrNone);
473 }
474 else
475 m_xCharFormatLB->set_active(-1);
476
477 m_xAllLevelFT->set_sensitive(true);
478 m_xAllLevelNF->set_sensitive(true);
479 m_xAllLevelNF->set_max(MAXLEVEL);
480 if (bSameComplete)
481 {
482 m_xAllLevelNF->set_value(aNumFormatArr[0]->GetIncludeUpperLevels());
483 }
484 else
485 {
486 m_xAllLevelNF->set_text(OUString());
487 }
488 }
489 else
490 {
491 sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
492 OUString aColl(pCollNames[nTmpLevel]);
493 if(!aColl.isEmpty())
494 m_xCollBox->set_active_text(aColl);
495 else
496 m_xCollBox->set_active_text(aNoFormatName);
497 const SwNumFormat &rFormat = pNumRule->Get(nTmpLevel);
498
499 m_xNumberBox->SelectNumberingType( rFormat.GetNumberingType() );
500 m_xPrefixED->set_text(rFormat.GetPrefix());
501 m_xSuffixED->set_text(rFormat.GetSuffix());
502 const SwCharFormat* pFormat = rFormat.GetCharFormat();
503 if(pFormat)
504 m_xCharFormatLB->set_active_text(pFormat->GetName());
505 else
506 m_xCharFormatLB->set_active_text(SwViewShell::GetShellRes()->aStrNone);
507
508 if (nTmpLevel || rFormat.HasListFormat())
509 {
510 m_xAllLevelFT->set_sensitive(true);
511 m_xAllLevelNF->set_sensitive(true);
512 m_xAllLevelNF->set_max(nTmpLevel + 1);
513 m_xAllLevelNF->set_min(rFormat.HasListFormat() ? 0 : 1);
514 m_xAllLevelNF->set_value(rFormat.GetIncludeUpperLevels());
515 }
516 else
517 {
518 m_xAllLevelNF->set_text(OUString());
519 m_xAllLevelNF->set_sensitive(false);
520 m_xAllLevelFT->set_sensitive(false);
521 }
523 m_xStartEdit->set_value( rFormat.GetStart() );
524 }
525 SetModified();
526}
527
529{
530 nActLevel = 0;
531 auto aRows = rBox.get_selected_rows();
532 if (std::find(aRows.begin(), aRows.end(), MAXLEVEL) != aRows.end())
533 {
534 nActLevel = 0xFFFF;
535 }
536 else
537 {
538 sal_uInt16 nMask = 1;
539 for( sal_uInt16 i = 0; i < MAXLEVEL; i++ )
540 {
541 if (std::find(aRows.begin(), aRows.end(), i) != aRows.end())
542 nActLevel |= nMask;
543 nMask <<= 1;
544 }
545 }
546 Update();
547}
548
550{
551 sal_uInt16 nMask = 1;
552 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
553 {
554 if(nActLevel & nMask)
555 {
556 SwNumFormat aNumFormat(pNumRule->Get(i));
557 aNumFormat.SetIncludeUpperLevels( std::min( static_cast<sal_uInt8>(rEdit.get_value()),
558 static_cast<sal_uInt8>(i + 1)) );
559 // Set the same prefix/suffix to generate list format with changed IncludedUpperLevels
560 aNumFormat.SetListFormat(aNumFormat.GetPrefix(), aNumFormat.GetSuffix(), i);
561 pNumRule->Set(i, aNumFormat);
562 }
563 nMask <<= 1;
564 }
565 SetModified();
566}
567
569{
570 sal_uInt8 i;
571
572 const OUString aCollName(rBox.get_active_text());
573 //0xFFFF not allowed here (disable)
574 sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
575 OUString sOldName( pCollNames[nTmpLevel] );
576
577 for( i = 0; i < MAXLEVEL; ++i)
578 pCollNames[i] = aSaveCollNames[i];
579
580 if(aCollName == aNoFormatName)
581 pCollNames[nTmpLevel].clear();
582 else
583 {
584 pCollNames[nTmpLevel] = aCollName;
585 // template already in use?
586 for( i = 0; i < MAXLEVEL; ++i)
587 if(i != nTmpLevel && pCollNames[i] == aCollName )
588 pCollNames[i].clear();
589 }
590
591 // search the oldname and put it into the current entries
592 if( !sOldName.isEmpty() )
593 for( i = 0; i < MAXLEVEL; ++i)
594 if( aSaveCollNames[ i ] == sOldName && i != nTmpLevel &&
595 pCollNames[ i ].isEmpty() )
596 {
597 sal_uInt8 n;
598 for( n = 0; n < MAXLEVEL; ++n )
599 if( pCollNames[ n ] == sOldName )
600 break;
601
602 if( MAXLEVEL == n )
603 // it was an outline level name and the current entries is zero.
604 pCollNames[ i ] = sOldName;
605 }
606
607 SetModified();
608 CollSave();
609}
610
612{
613 for (sal_uInt8 i = 0; i < MAXLEVEL; ++i)
615}
616
618{
619 sal_uInt16 nMask = 1;
620 SvxNumType nNumberType = m_xNumberBox->GetSelectedNumberingType();
621 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
622 {
623 if(nActLevel & nMask)
624 {
625 SwNumFormat aNumFormat(pNumRule->Get(i));
626 aNumFormat.SetNumberingType(nNumberType);
627 pNumRule->Set(i, aNumFormat);
628 CheckForStartValue_Impl(nNumberType);
629 }
630 nMask <<= 1;
631 }
632 SetModified();
633}
634
636{
637 sal_uInt16 nMask = 1;
638 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
639 {
640 if(nActLevel & nMask)
641 {
642 SwNumFormat aNumFormat(pNumRule->Get(i));
643 aNumFormat.SetListFormat( m_xPrefixED->get_text(), m_xSuffixED->get_text(), i );
644 pNumRule->Set(i, aNumFormat);
645 }
646 nMask <<= 1;
647 }
648 SetModified();
649}
650
652{
653 sal_uInt16 nMask = 1;
654 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
655 {
656 if(nActLevel & nMask)
657 {
658 SwNumFormat aNumFormat(pNumRule->Get(i));
659 aNumFormat.SetStart(o3tl::narrowing<sal_uInt16>(rEdit.get_value()));
660 pNumRule->Set(i, aNumFormat);
661 }
662 nMask <<= 1;
663 }
664 SetModified();
665}
666
668{
669 OUString sEntry = m_xCharFormatLB->get_active_text();
670 sal_uInt16 nMask = 1;
671 bool bFormatNone = sEntry == SwViewShell::GetShellRes()->aStrNone;
672 SwCharFormat* pFormat = nullptr;
673 if(!bFormatNone)
674 {
675 sal_uInt16 nChCount = pSh->GetCharFormatCount();
676 for(sal_uInt16 i = 0; i < nChCount; i++)
677 {
678 SwCharFormat& rChFormat = pSh->GetCharFormat(i);
679 if(rChFormat.GetName() == sEntry)
680 {
681 pFormat = &rChFormat;
682 break;
683 }
684 }
685 if(!pFormat)
686 {
687 SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
688 SfxStyleSheetBase* pBase;
689 pBase = pPool->Find(sEntry, SfxStyleFamily::Char);
690 if(!pBase)
691 pBase = &pPool->Make(sEntry, SfxStyleFamily::Page);
692 pFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
693
694 }
695 }
696
697 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
698 {
699 if(nActLevel & nMask)
700 {
701 SwNumFormat aNumFormat(pNumRule->Get(i));
702 if(bFormatNone)
703 aNumFormat.SetCharFormat(nullptr);
704 else
705 aNumFormat.SetCharFormat(pFormat);
706 pNumRule->Set(i, aNumFormat);
707 }
708 nMask <<= 1;
709 }
710}
711
713{
714}
715
717{
718 pSh = pShell;
719 // query this document's NumRules
721 pCollNames = static_cast<SwOutlineTabDialog*>(GetDialogController())->GetCollNames();
722
723 CollSave();
724
727 // set start value - nActLevel must be 1 here
728 sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
729 const SwNumFormat& rNumFormat = pNumRule->Get( nTmpLevel );
730 m_xStartEdit->set_value( rNumFormat.GetStart() );
731
732 // create pool formats for headlines
733 for (sal_uInt16 i = 0; i < MAXLEVEL; ++i)
734 {
736 static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), OUString()));
737 m_xLevelLB->append_text( OUString::number(i + 1) );
738 }
739 OUString sStr = "1 - " + OUString::number(MAXLEVEL);
740 m_xLevelLB->append_text(sStr);
741
742 // query the texttemplates' outlining levels
743 const sal_uInt16 nCount = pSh->GetTextFormatCollCount();
744 for (sal_uInt16 i = 0; i < nCount; ++i)
745 {
747 if(!rTextColl.IsDefault())
748 {
749 sStr = rTextColl.GetName();
750 if (m_xCollBox->find_text(sStr) == -1)
751 m_xCollBox->append_text(sStr);
752 }
753 }
754
755 m_xNumberBox->SelectNumberingType(rNumFormat.GetNumberingType());
757 int nTmp = 0;
758 if(nOutlinePos != SwOutlineNodes::npos)
759 {
760 nTmp = o3tl::narrowing<sal_uInt16>(pSh->getIDocumentOutlineNodesAccess()->getOutlineLevel(nOutlinePos));
761 }
762 m_xLevelLB->select(nTmp-1);
763
764 // collect char styles
765 m_xCharFormatLB->clear();
766 m_xCharFormatLB->append_text(SwViewShell::GetShellRes()->aStrNone);
767
768 // char styles
770 pSh->GetView().GetDocShell());
771 Update();
772}
773
775{
777 if(nActLevel != USHRT_MAX)
779 else
780 m_xLevelLB->select(MAXLEVEL);
781 LevelHdl(*m_xLevelLB);
782}
783
785{
787 return DeactivateRC::LeavePage;
788}
789
791{
792 return true;
793}
794
796{
798}
799
800std::unique_ptr<SfxTabPage> SwOutlineSettingsTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
801 const SfxItemSet* rAttrSet)
802{
803 return std::make_unique<SwOutlineSettingsTabPage>(pPage, pController, *rAttrSet);
804}
805
807{
808 bool bIsNull = m_xStartEdit->get_value() == 0;
809 bool bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC ||
810 SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType ||
811 SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType;
812 m_xStartEdit->set_min(bNoZeroAllowed ? 1 : 0);
813 if (bIsNull && bNoZeroAllowed)
814 StartModified(*m_xStartEdit);
815}
816
817static tools::Long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, tools::Long nXStart, tools::Long nYStart, const Size& rSize)
818{
819 vcl::Font aTmpFont(pVDev->GetFont());
820
821 // via Uno it's possible that no font has been set!
822 vcl::Font aFont(rFormat.GetBulletFont() ? *rFormat.GetBulletFont() : aTmpFont);
823 Size aTmpSize(rSize);
824 aTmpSize.setWidth( aTmpSize.Width() * ( rFormat.GetBulletRelSize()) );
825 aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
826 aTmpSize.setHeight( aTmpSize.Height() * ( rFormat.GetBulletRelSize()) );
827 aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
828 // in case of a height of zero it is drawn in original height
829 if(!aTmpSize.Height())
830 aTmpSize.setHeight( 1 );
831 aFont.SetFontSize(aTmpSize);
832 aFont.SetTransparent(true);
833 Color aBulletColor = rFormat.GetBulletColor();
834 if(aBulletColor == COL_AUTO)
835 aBulletColor = pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK;
836 else if(aBulletColor == pVDev->GetFillColor())
837 aBulletColor.Invert();
838 aFont.SetColor(aBulletColor);
839 pVDev->SetFont( aFont );
840 sal_UCS4 cBullet = rFormat.GetBulletChar();
841 OUString aText(&cBullet, 1);
842 tools::Long nY = nYStart;
843 nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
844 pVDev->DrawText( Point(nXStart, nY), aText );
845 tools::Long nRet = pVDev->GetTextWidth(aText);
846
847 pVDev->SetFont(aTmpFont);
848 return nRet;
849}
850
851static tools::Long lcl_DrawGraphic(vcl::RenderContext& rVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
852{
853 const SvxBrushItem* pBrushItem = rFormat.GetBrush();
854 tools::Long nRet = 0;
855 if (pBrushItem)
856 {
857 const Graphic* pGraphic = pBrushItem->GetGraphic();
858 if (pGraphic)
859 {
860 Size aGSize( rFormat.GetGraphicSize());
861 aGSize.setWidth( aGSize.Width() / nDivision );
862 nRet = aGSize.Width();
863 aGSize.setHeight( aGSize.Height() / nDivision );
864 pGraphic->Draw(rVDev, Point(nXStart, nYStart), rVDev.PixelToLogic(aGSize));
865 }
866 }
867 return nRet;
868}
869
871{
872 const Size aSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
873
874 ScopedVclPtrInstance<VirtualDevice> pVDev(rRenderContext);
875 pVDev->SetMapMode(rRenderContext.GetMapMode());
876 pVDev->SetOutputSize(aSize);
877
878 // #101524# OJ
879 pVDev->SetFillColor(SwViewOption::GetDocColor());
880 pVDev->SetLineColor(SwViewOption::GetDocBoundariesColor());
881 pVDev->DrawRect(tools::Rectangle(Point(0,0), aSize));
882
883 if (pActNum)
884 {
885 tools::Long nWidthRelation = 30; // chapter dialog
886 if(nPageWidth)
887 {
888 nWidthRelation = nPageWidth / aSize.Width();
889 if(bPosition)
890 nWidthRelation = nWidthRelation * 2 / 3;
891 else
892 nWidthRelation = nWidthRelation / 4;
893 }
894
895 // height per level
896 const tools::Long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1));
897 const tools::Long nYStep = (aSize.Height() - 6)/ MAXLEVEL;
898 tools::Long nYStart = 4;
899 aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, GetAppLanguage(),
900 GetDefaultFontFlags::OnlyOne, &rRenderContext);
901
902 if (svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR, false).nColor == COL_AUTO)
904 else
906
907 const tools::Long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10;
908 aStdFont.SetFontSize(Size( 0, nFontHeight ));
909
910 tools::Long nPreNum = pActNum->Get(0).GetStart();
911
912 if (bPosition)
913 {
914 const tools::Long nLineHeight = nFontHeight * 8 / 7;
915 sal_uInt8 nStart = 0;
916 while (!(nActLevel & (1 << nStart)))
917 {
918 nStart++;
919 }
920 if(nStart) // so that possible predecessors and successors are showed
921 nStart--;
922
924 sal_uInt8 nEnd = std::min(sal_uInt8(nStart + 3), MAXLEVEL);
925 for (sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel)
926 {
927 const SwNumFormat &rFormat = pActNum->Get(nLevel);
928 aNumVector.push_back(rFormat.GetStart());
929
930 tools::Long nXStart( 0 );
931 tools::Long nTextOffset( 0 );
932 tools::Long nNumberXPos( 0 );
934 {
935 nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
936 nTextOffset = rFormat.GetCharTextDistance() / nWidthRelation;
937 nNumberXPos = nXStart;
938 const tools::Long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation;
939
940 if(nFirstLineOffset <= nNumberXPos)
941 nNumberXPos -= nFirstLineOffset;
942 else
943 nNumberXPos = 0;
944 }
946 {
947 const tools::Long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation);
948 nNumberXPos = (nTmpNumberXPos < 0) ? 0 : nTmpNumberXPos;
949 }
950
951 tools::Long nBulletWidth = 0;
952 if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
953 {
954 nBulletWidth = lcl_DrawGraphic(*pVDev, rFormat, nNumberXPos,
955 nYStart, nWidthRelation);
956 }
957 else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
958 {
959 nBulletWidth = lcl_DrawBullet(pVDev.get(), rFormat, nNumberXPos,
960 nYStart, aStdFont.GetFontSize());
961 }
962 else
963 {
964 pVDev->SetFont(aStdFont);
966 aNumVector[nLevel] = nPreNum;
967 OUString aText(pActNum->MakeNumString( aNumVector ));
968 pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
969 nBulletWidth = pVDev->GetTextWidth(aText);
970 nPreNum++;
971 }
974 {
975 pVDev->SetFont(aStdFont);
976 OUString aText(' ');
977 pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
978 nBulletWidth += pVDev->GetTextWidth(aText);
979 }
980
981 tools::Long nTextXPos(0);
983 {
984 nTextXPos = nXStart;
985 if (nTextOffset < 0)
986 nTextXPos = nTextXPos + nTextOffset;
987 if (nNumberXPos + nBulletWidth + nTextOffset > nTextXPos)
988 nTextXPos = nNumberXPos + nBulletWidth + nTextOffset;
989 }
991 {
992 switch (rFormat.GetLabelFollowedBy())
993 {
995 {
996 nTextXPos = rFormat.GetListtabPos() / nWidthRelation;
997 if (nTextXPos < nNumberXPos + nBulletWidth)
998 {
999 nTextXPos = nNumberXPos + nBulletWidth;
1000 }
1001 }
1002 break;
1006 {
1007 nTextXPos = nNumberXPos + nBulletWidth;
1008 }
1009 break;
1010 }
1011
1012 nXStart = rFormat.GetIndentAt() / nWidthRelation;
1013 }
1014
1015 tools::Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1016 pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor()); // COL_BLACK );
1017 pVDev->DrawRect(aRect1);
1018
1019 tools::Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1020 pVDev->DrawRect(aRect2);
1021 nYStart += 2 * nLineHeight;
1022 }
1023 }
1024 else
1025 {
1026 SwNumberTree::tNumberVector aNumVector;
1027 const tools::Long nLineHeight = nFontHeight * 3 / 2;
1028 for (sal_uInt8 nLevel = 0; nLevel < MAXLEVEL; ++nLevel, nYStart = nYStart + nYStep)
1029 {
1030 const SwNumFormat &rFormat = pActNum->Get(nLevel);
1031 aNumVector.push_back(rFormat.GetStart());
1032 tools::Long nXStart(0);
1034 {
1035 nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
1036 }
1038 {
1039 const tools::Long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation);
1040 nXStart = (nTmpXStart < 0) ? 0 : nTmpXStart;
1041 }
1042 nXStart /= 2;
1043 nXStart += 2;
1044 tools::Long nTextOffset;
1045 if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
1046 {
1047 lcl_DrawGraphic(*pVDev, rFormat, nXStart, nYStart, nWidthRelation);
1048 nTextOffset = nLineHeight + nXStep;
1049 }
1050 else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
1051 {
1052 nTextOffset = lcl_DrawBullet(pVDev.get(), rFormat, nXStart, nYStart, aStdFont.GetFontSize());
1053 nTextOffset += nXStep;
1054 }
1055 else
1056 {
1057 pVDev->SetFont(aStdFont);
1058 if (pActNum->IsContinusNum())
1059 aNumVector[nLevel] = nPreNum;
1060 OUString aText(pActNum->MakeNumString( aNumVector ));
1061 pVDev->DrawText( Point(nXStart, nYStart), aText );
1062 nTextOffset = pVDev->GetTextWidth(aText) + nXStep;
1063 nPreNum++;
1064 }
1065 pVDev->SetFont(aStdFont);
1066 pVDev->DrawText(
1067 Point(nXStart + nTextOffset, nYStart),
1068 (pOutlineNames == nullptr
1070 : pOutlineNames[nLevel]));
1071 }
1072 }
1073 }
1074 rRenderContext.DrawOutDev(Point(0,0), aSize, Point(0,0), aSize, *pVDev);
1075}
1076
1077/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XExecutableDialog > m_xDialog
const StyleSettings & GetStyleSettings() const
bool IsDark() const
void Invert()
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
virtual int getOutlineLevel(const tSortedOutlineNodeList::size_type nIdx) const =0
tools::Long nPageWidth
Definition: numprevw.hxx:32
void SetOutlineNames(const OUString *pNames)
Definition: numprevw.hxx:58
vcl::Font aStdFont
Definition: numprevw.hxx:31
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: outline.cxx:870
sal_uInt16 nActLevel
Definition: numprevw.hxx:35
const SwNumRule * pActNum
Definition: numprevw.hxx:30
const OUString * pOutlineNames
Definition: numprevw.hxx:33
void SetNumRule(const SwNumRule *pNum)
Definition: numprevw.hxx:50
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) 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
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)
const AllSettings & GetSettings() const
const Color & GetFillColor() const
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All) const
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
virtual short Ok()
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
weld::Button & GetCancelButton() const
virtual void Reset(const SfxItemSet *)
SfxOkDialogController * GetDialogController() const
void SetExchangeSupport()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetWindowColor() const
const Graphic * GetGraphic(OUString const &referer=OUString()) const
void SetStart(sal_uInt16 nSet)
tools::Long GetIndentAt() const
sal_uInt8 GetIncludeUpperLevels() const
const SvxBrushItem * GetBrush() const
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
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)
tools::Long GetListtabPos() const
void SetIncludeUpperLevels(sal_uInt8 nSet)
bool HasListFormat() const
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
const OUString & GetPrefix() const
const OUString & GetSuffix() const
short GetCharTextDistance() const
void SetNumberingType(SvxNumType nSet)
SvxNumType GetNumberingType() const
Represents the style of a text portion.
Definition: charfmt.hxx:27
void StartAction()
Definition: crsrsh.cxx:227
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:244
SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel=UCHAR_MAX, SwPaM *pPaM=nullptr)
search "outline position" before previous outline node at given level
Definition: crstrvl.cxx:1225
void SetOutlineNumRule(const SwNumRule &)
Definition: ednumber.cxx:112
SwTextFormatColl & GetTextFormatColl(sal_uInt16 nTextFormatColl) const
Definition: edfcol.cxx:697
sal_uInt16 GetTextFormatCollCount() const
Definition: edfcol.cxx:692
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: edfmt.cxx:152
const SwNumRule * GetOutlineNumRule() const
Definition: ednumber.cxx:119
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
Definition: edfmt.cxx:121
bool IsDefault() const
Definition: format.hxx:129
const OUString & GetName() const
Definition: format.hxx:131
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:367
SwCharFormat * GetCharFormat() const
Definition: numrule.hxx:74
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:280
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: num.cxx:482
bool IsContinusNum() const
Definition: numrule.hxx:235
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:86
const OUString & GetName() const
Definition: numrule.hxx:224
OUString MakeNumString(const SwNodeNum &, bool bInclStrings=true) const
Definition: number.cxx:642
void ResetNumRule(SwWrtShell &rSh, SwNumRule &) const
Definition: uinums.cxx:146
const OUString & GetName() const
Definition: uinums.hxx:74
static constexpr auto npos
Definition: ndarr.hxx:80
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: outline.cxx:774
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: outline.cxx:784
std::unique_ptr< weld::ComboBox > m_xCollBox
Definition: outline.hxx:77
std::unique_ptr< SwNumberingTypeListBox > m_xNumberBox
Definition: outline.hxx:78
NumberingPreview m_aPreviewWIN
Definition: outline.hxx:74
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: outline.cxx:790
virtual ~SwOutlineSettingsTabPage() override
Definition: outline.cxx:712
std::unique_ptr< weld::TreeView > m_xLevelLB
Definition: outline.hxx:76
std::unique_ptr< weld::Label > m_xAllLevelFT
Definition: outline.hxx:80
void SetWrtShell(SwWrtShell *pShell)
Definition: outline.cxx:716
std::unique_ptr< weld::SpinButton > m_xAllLevelNF
Definition: outline.hxx:81
virtual void Reset(const SfxItemSet *rSet) override
Definition: outline.cxx:795
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: outline.cxx:800
std::unique_ptr< weld::Entry > m_xSuffixED
Definition: outline.hxx:83
std::unique_ptr< weld::Entry > m_xPrefixED
Definition: outline.hxx:82
SwOutlineSettingsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: outline.cxx:381
SwNumRule * pNumRule
Definition: outline.hxx:71
std::unique_ptr< weld::SpinButton > m_xStartEdit
Definition: outline.hxx:84
std::unique_ptr< weld::ComboBox > m_xCharFormatLB
Definition: outline.hxx:79
void CheckForStartValue_Impl(sal_uInt16 nNumberingType)
Definition: outline.cxx:806
OUString aSaveCollNames[MAXLEVEL]
Definition: outline.hxx:69
virtual short Ok() override
Definition: outline.cxx:299
static sal_uInt16 nNumLevel
Definition: outline.hxx:35
std::unique_ptr< weld::MenuButton > m_xMenuButton
Definition: outline.hxx:45
SwOutlineTabDialog(weld::Window *pParent, const SfxItemSet *pSwItemSet, SwWrtShell &)
Definition: outline.cxx:141
virtual void PageCreated(const OString &rPageId, SfxTabPage &rPage) override
Definition: outline.cxx:190
OUString aCollNames[MAXLEVEL]
Definition: outline.hxx:37
static void SetActNumLevel(sal_uInt16 nSet)
Definition: outline.hxx:63
virtual ~SwOutlineTabDialog() override
Definition: outline.cxx:186
SwWrtShell & rWrtSh
Definition: outline.hxx:39
sal_uInt16 GetLevel(std::u16string_view rFormatName) const
Definition: outline.cxx:289
static sal_uInt16 GetActNumLevel()
Definition: outline.hxx:62
std::unique_ptr< SwNumRule > xNumRule
Definition: outline.hxx:40
static const OUString & GetUIName(const OUString &rName, SwGetPoolIdFromName)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: fmtcol.cxx:371
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:120
void DeleteAssignmentToListLevelOfOutlineStyle()
Definition: fmtcol.cxx:638
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the <SwNumRuleItem> and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:334
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:611
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:604
static Color & GetDocBoundariesColor()
Definition: viewopt.cxx:396
static Color & GetDocColor()
Definition: viewopt.cxx:391
static Color & GetFontColor()
Definition: viewopt.cxx:456
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2662
const IDocumentOutlineNodes * getIDocumentOutlineNodesAccess() const
Definition: viewsh.cxx:2804
SwDocShell * GetDocShell()
Definition: view.cxx:1133
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
@ GETSTYLE_CREATESOME
Definition: wrtsh.hxx:361
SwTextFormatColl * GetParaStyle(const OUString &rCollName, GetStyle eCreate=GETSTYLE_NOCREATE)
Definition: wrtsh1.cxx:1793
const SwView & GetView() const
Definition: wrtsh.hxx:437
reference_type * get() const
static OUString getProductName()
void SetFontSize(const Size &)
void SetTransparent(bool bTransparent)
void SetColor(const Color &)
const Size & GetFontSize() const
void connect_clicked(const Link< Button &, void > &rLink)
Size const & GetOutputSizePixel() const
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
int nCount
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
virtual OUString GetName() const override
virtual const SfxItemSet * GetOutputItemSet() const override
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
LanguageType GetAppLanguage()
Definition: init.cxx:725
OUString aName
sal_Int64 n
sal_Int32 nFirstLineOffset
#define SAL_N_ELEMENTS(arr)
std::vector< tSwNumTreeNumber > tNumberVector
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
Definition: fmtcol.cxx:76
int i
long Long
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
@ OUTLINE_RULE
Definition: numrule.hxx:92
std::string GetValue
IMPL_LINK_NOARG(SwNumNamesDlg, DoubleClickHdl, weld::TreeView &, bool)
Definition: outline.cxx:107
static sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel)
Definition: outline.cxx:130
static tools::Long lcl_DrawBullet(vcl::RenderContext *pVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, const Size &rSize)
Definition: outline.cxx:817
static tools::Long lcl_DrawGraphic(vcl::RenderContext &rVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
Definition: outline.cxx:851
IMPL_LINK(SwNumNamesDlg, SelectHdl, weld::TreeView &, rBox, void)
Definition: outline.cxx:73
@ RES_POOLCOLL_HEADLINE1
Heading 1.
Definition: poolfmt.hxx:262
static SfxItemSet & rSet
OUString aStrNone
Definition: shellres.hxx:46
SvxNumType
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_ARABIC
SVX_NUM_CHARS_UPPER_LETTER_N
SVX_NUM_BITMAP
SVX_NUM_CHAR_SPECIAL
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
#define SW_MOD()
Definition: swmodule.hxx:256
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
DeactivateRC
unsigned char sal_uInt8
SW_DLLPUBLIC void FillCharStyleListBox(weld::ComboBox &rToFill, SwDocShell *pDocSh, bool bSorted=false, bool bWithDefault=false)
Definition: uitool.cxx:780
RET_OK
RET_CANCEL
sal_uInt32 sal_UCS4