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 (auto const& aID : OUTLINE_STYLE)
122 m_xFormBox->append_text(SwResId(aID));
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 constexpr sal_uInt16 MAXLEVEL_MASK = USHRT_MAX >> (sizeof(sal_uInt16) * CHAR_BIT - MAXLEVEL);
133 assert((nActLevel & MAXLEVEL_MASK) == nActLevel);
134 sal_uInt16 nTmp = nActLevel & MAXLEVEL_MASK; // a safety measure
135 sal_uInt16 nTmpLevel = 0;
136 while( 0 != (nTmp >>= 1) )
137 nTmpLevel++;
138 return nTmpLevel;
139}
140
142
144 SwWrtShell &rSh)
145 : SfxTabDialogController(pParent, "modules/swriter/ui/outlinenumbering.ui", "OutlineNumberingDialog", pSwItemSet)
146 , m_rWrtSh(rSh)
147 , m_pChapterNumRules(SW_MOD()->GetChapterNumRules())
148 , m_bModified(m_rWrtSh.IsModified())
149 , m_xMenuButton(m_xBuilder->weld_menu_button("format"))
150{
151 m_xMenuButton->connect_toggled(LINK(this, SwOutlineTabDialog, FormHdl));
152 m_xMenuButton->connect_selected(LINK(this, SwOutlineTabDialog, MenuSelectHdl));
153
154 m_xNumRule.reset(new SwNumRule(*rSh.GetOutlineNumRule()));
156
157 if (auto nOutlinePos = m_rWrtSh.GetOutlinePos(MAXLEVEL); nOutlinePos != SwOutlineNodes::npos)
158 {
160 assert(nTmp < MAXLEVEL);
161 SetActNumLevel(nTmp < 0 ? USHRT_MAX : (1 << nTmp));
162 }
163
164 AddTabPage("position", &SwNumPositionTabPage::Create, nullptr);
165 AddTabPage("numbering", &SwOutlineSettingsTabPage::Create, nullptr);
166
167 OUString sHeadline;
168 sal_uInt16 i;
169
170 for( i = 0; i < MAXLEVEL; ++i )
171 {
172 // if the style wasn't created yet, it's still at this position
173 if( !m_rWrtSh.GetParaStyle( sHeadline =
174 SwStyleNameMapper::GetUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
175 sHeadline )) )
176 m_aCollNames[i] = sHeadline;
177 }
178
179 // query the text templates' outlining levels
180 const sal_uInt16 nCount = m_rWrtSh.GetTextFormatCollCount();
181 for(i = 0; i < nCount; ++i )
182 {
184 if(!rTextColl.IsDefault())
185 {
187 {
188 int nOutLevel = rTextColl.GetAssignedOutlineStyleLevel();
189 m_aCollNames[ nOutLevel ] = rTextColl.GetName();
190 }
191 }
192 }
193}
194
196{
197}
198
199void SwOutlineTabDialog::PageCreated(const OUString& rPageId, SfxTabPage& rPage)
200{
201 if (rPageId == "position")
202 {
203 static_cast<SwNumPositionTabPage&>(rPage).SetWrtShell(&m_rWrtSh);
204 static_cast<SwNumPositionTabPage&>(rPage).SetOutlineTabDialog(this);
205 }
206 else if (rPageId == "numbering")
207 {
208 static_cast<SwOutlineSettingsTabPage&>(rPage).SetWrtShell(&m_rWrtSh);
209 }
210}
211
213{
214 if (!m_bModified)
215 m_rWrtSh.ResetModified();
216 m_xDialog->response(RET_CANCEL);
217}
218
220{
221 if (!m_xMenuButton->get_active())
222 return;
223
224 // fill PopupMenu
225 for(sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
226 {
227 const SwNumRulesWithName *pRules = m_pChapterNumRules->GetRules(i);
228 if (!pRules)
229 continue;
230 m_xMenuButton->set_item_label("form" + OUString::number(i + 1), pRules->GetName());
231 }
232}
233
234IMPL_LINK(SwOutlineTabDialog, MenuSelectHdl, const OUString&, rIdent, void)
235{
236 sal_uInt8 nLevelNo = 0;
237
238 if (rIdent == "form1")
239 nLevelNo = 1;
240 else if (rIdent == "form2")
241 nLevelNo = 2;
242 else if (rIdent == "form3")
243 nLevelNo = 3;
244 else if (rIdent == "form4")
245 nLevelNo = 4;
246 else if (rIdent == "form5")
247 nLevelNo = 5;
248 else if (rIdent == "form6")
249 nLevelNo = 6;
250 else if (rIdent == "form7")
251 nLevelNo = 7;
252 else if (rIdent == "form8")
253 nLevelNo = 8;
254 else if (rIdent == "form9")
255 nLevelNo = 9;
256 else if (rIdent == "saveas")
257 {
258 SwNumNamesDlg aDlg(m_xDialog.get());
259 const OUString *aStrArr[SwChapterNumRules::nMaxRules];
260 for(sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
261 {
262 const SwNumRulesWithName *pRules = m_pChapterNumRules->GetRules(i);
263 if(pRules)
264 aStrArr[i] = &pRules->GetName();
265 else
266 aStrArr[i] = nullptr;
267 }
268 aDlg.SetUserNames(aStrArr);
269 if (aDlg.run() == RET_OK)
270 {
271 const OUString aName(aDlg.GetName());
272 m_pChapterNumRules->ApplyNumRules( SwNumRulesWithName(
273 *m_xNumRule, aName ), aDlg.GetCurEntryPos() );
274 m_xMenuButton->set_item_label("form" + OUString::number(aDlg.GetCurEntryPos() + 1), aName);
275 }
276 return;
277 }
278
279 if( nLevelNo-- )
280 {
281 const SwNumRulesWithName *pRules = m_pChapterNumRules->GetRules( nLevelNo );
282 if( pRules )
283 {
284 pRules->ResetNumRule(m_rWrtSh, *m_xNumRule);
285 m_xNumRule->SetRuleType( OUTLINE_RULE );
286 SfxTabPage* pOutlinePage = GetTabPage(u"numbering");
287 assert(pOutlinePage);
288 static_cast<SwOutlineSettingsTabPage*>(pOutlinePage)->SetNumRule(m_xNumRule.get());
289 }
290 else
291 *m_xNumRule = *m_rWrtSh.GetOutlineNumRule();
292 }
293
294 SfxTabPage* pPage = GetCurTabPage();
295 pPage->Reset(GetOutputItemSet());
296}
297
298sal_uInt16 SwOutlineTabDialog::GetLevel(std::u16string_view rFormatName) const
299{
300 for(sal_uInt16 i = 0; i < MAXLEVEL; ++i)
301 {
302 if(m_aCollNames[i] == rFormatName)
303 return i;
304 }
305 return MAXLEVEL;
306}
307
309{
311 // set levels for all created templates; has to be done in order to
312 // delete possibly cancelled assignments again.
313
314 // encapsulate changes into an action to avoid effects on the current cursor
315 // position during the changes.
317
318 const SwNumRule * pOutlineRule = m_rWrtSh.GetOutlineNumRule();
319
320 sal_uInt16 i, nCount = m_rWrtSh.GetTextFormatCollCount();
321 for( i = 0; i < nCount; ++i )
322 {
324 if( !rTextColl.IsDefault() )
325 {
326 const SfxPoolItem & rItem =
327 rTextColl.GetFormatAttr(RES_PARATR_NUMRULE, false);
328
329 if (static_cast<sal_uInt8>(GetLevel(rTextColl.GetName())) == MAXLEVEL)
330 {
332 {
334 }
335 if (static_cast<const SwNumRuleItem &>(rItem).GetValue() ==
336 pOutlineRule->GetName())
337 {
339 }
340 }
341 else
342 {
343 rTextColl.AssignToListLevelOfOutlineStyle(GetLevel(rTextColl.GetName()));
344
345 if (static_cast<const SwNumRuleItem &>(rItem).GetValue() !=
346 pOutlineRule->GetName())
347 {
348 SwNumRuleItem aItem(pOutlineRule->GetName());
349 rTextColl.SetFormatAttr(aItem);
350 }
351 }
352 }
353 }
354
355 for(i = 0; i < MAXLEVEL; ++i )
356 {
357 OUString sHeadline;
358 ::SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
359 sHeadline );
361 if( !pColl && m_aCollNames[i] != sHeadline)
362 {
364 static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i) );
367
368 if( !m_aCollNames[i].isEmpty() )
369 {
370 pTextColl = m_rWrtSh.GetParaStyle(
372 if(pTextColl)
373 {
375 SwNumRuleItem aItem(pOutlineRule->GetName());
376 pTextColl->SetFormatAttr(aItem);
377 }
378 }
379 }
380 }
381
383
384 // #i30443#
386
387 return RET_OK;
388}
389
391 const SfxItemSet& rSet)
392 : SfxTabPage(pPage, pController, "modules/swriter/ui/outlinenumberingpage.ui", "OutlineNumberingPage", &rSet)
393 , m_aNoFormatName(SwResId(SW_STR_NONE))
394 , m_pSh(nullptr)
395 , m_pNumRule(nullptr)
396 , m_pCollNames(nullptr)
397 , m_nActLevel(1)
398 , m_xLevelLB(m_xBuilder->weld_tree_view("level"))
399 , m_xCollBox(m_xBuilder->weld_combo_box("style"))
400 , m_xNumberBox(new SwNumberingTypeListBox(m_xBuilder->weld_combo_box("numbering")))
401 , m_xCharFormatLB(m_xBuilder->weld_combo_box("charstyle"))
402 , m_xAllLevelFT(m_xBuilder->weld_label("sublevelsft"))
403 , m_xAllLevelNF(m_xBuilder->weld_spin_button("sublevelsnf"))
404 , m_xPrefixED(m_xBuilder->weld_entry("prefix"))
405 , m_xSuffixED(m_xBuilder->weld_entry("suffix"))
406 , m_xStartEdit(m_xBuilder->weld_spin_button("startat"))
407 , m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWIN))
408{
410
412 m_xCollBox->make_sorted();
413 m_xCollBox->append_text(m_aNoFormatName);
414 m_xLevelLB->connect_changed(LINK(this, SwOutlineSettingsTabPage, LevelHdl));
415 m_xAllLevelNF->connect_value_changed(LINK(this, SwOutlineSettingsTabPage, ToggleComplete));
416 m_xCollBox->connect_changed(LINK(this, SwOutlineSettingsTabPage, CollSelect));
417 m_xNumberBox->connect_changed(LINK(this, SwOutlineSettingsTabPage, NumberSelect));
418 m_xPrefixED->connect_changed(LINK(this, SwOutlineSettingsTabPage, DelimModify));
419 m_xSuffixED->connect_changed(LINK(this, SwOutlineSettingsTabPage, DelimModify));
420 m_xStartEdit->connect_value_changed(LINK(this, SwOutlineSettingsTabPage, StartModified));
421 m_xCharFormatLB->make_sorted();
422 m_xCharFormatLB->connect_changed(LINK(this, SwOutlineSettingsTabPage, CharFormatHdl));
423}
424
426{
427 // if a template was already selected for this level, select it in the ListBox
428 m_xCollBox->set_sensitive(USHRT_MAX != m_nActLevel);
429 if(USHRT_MAX == m_nActLevel)
430 {
431 bool bSamePrefix = true;
432 bool bSameSuffix = true;
433 bool bSameType = true;
434 bool bSameComplete = true;
435 bool bSameStart = true;
436 bool bSameCharFormat = true;
437
438 const SwNumFormat* aNumFormatArr[MAXLEVEL];
439 const SwCharFormat* pFirstFormat = nullptr;
440
441 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
442 {
443
444 aNumFormatArr[ i ] = &m_pNumRule->Get(i);
445 if(i == 0)
446 pFirstFormat = aNumFormatArr[i]->GetCharFormat();
447 else
448 {
449 bSameType &= aNumFormatArr[i]->GetNumberingType() == aNumFormatArr[0]->GetNumberingType();
450 bSameStart &= aNumFormatArr[i]->GetStart() == aNumFormatArr[0]->GetStart();
451 bSamePrefix &= aNumFormatArr[i]->GetPrefix() == aNumFormatArr[0]->GetPrefix();
452 bSameSuffix &= aNumFormatArr[i]->GetSuffix() == aNumFormatArr[0]->GetSuffix();
453 bSameComplete &= aNumFormatArr[i]->GetIncludeUpperLevels() == aNumFormatArr[0]->GetIncludeUpperLevels();
454 const SwCharFormat* pFormat = aNumFormatArr[i]->GetCharFormat();
455 bSameCharFormat &= (!pFirstFormat && !pFormat)
456 || (pFirstFormat && pFormat && pFormat->GetName() == pFirstFormat->GetName());
457 }
458 }
459 CheckForStartValue_Impl(aNumFormatArr[0]->GetNumberingType());
460 if (bSameType)
461 m_xNumberBox->SelectNumberingType( aNumFormatArr[0]->GetNumberingType() );
462 else
463 m_xNumberBox->SetNoSelection();
464 if(bSameStart)
465 m_xStartEdit->set_value(aNumFormatArr[0]->GetStart());
466 else
467 m_xStartEdit->set_text(OUString());
468 if(bSamePrefix)
469 m_xPrefixED->set_text(aNumFormatArr[0]->GetPrefix());
470 else
471 m_xPrefixED->set_text(OUString());
472 if(bSameSuffix)
473 m_xSuffixED->set_text(aNumFormatArr[0]->GetSuffix());
474 else
475 m_xSuffixED->set_text(OUString());
476
477 if (bSameCharFormat)
478 {
479 if (pFirstFormat)
480 m_xCharFormatLB->set_active_text(pFirstFormat->GetName());
481 else
482 m_xCharFormatLB->set_active_text(SwViewShell::GetShellRes()->aStrNone);
483 }
484 else
485 m_xCharFormatLB->set_active(-1);
486
487 m_xAllLevelFT->set_sensitive(true);
488 m_xAllLevelNF->set_sensitive(true);
489 m_xAllLevelNF->set_max(MAXLEVEL);
490 if (bSameComplete)
491 {
492 m_xAllLevelNF->set_value(aNumFormatArr[0]->GetIncludeUpperLevels());
493 }
494 else
495 {
496 m_xAllLevelNF->set_text(OUString());
497 }
498 }
499 else
500 {
501 sal_uInt16 nTmpLevel = lcl_BitToLevel(m_nActLevel);
502 OUString aColl(m_pCollNames[nTmpLevel]);
503 if(!aColl.isEmpty())
504 m_xCollBox->set_active_text(aColl);
505 else
506 m_xCollBox->set_active_text(m_aNoFormatName);
507 const SwNumFormat &rFormat = m_pNumRule->Get(nTmpLevel);
508
509 m_xNumberBox->SelectNumberingType( rFormat.GetNumberingType() );
510 m_xPrefixED->set_text(rFormat.GetPrefix());
511 m_xSuffixED->set_text(rFormat.GetSuffix());
512 const SwCharFormat* pFormat = rFormat.GetCharFormat();
513 if(pFormat)
514 m_xCharFormatLB->set_active_text(pFormat->GetName());
515 else
516 m_xCharFormatLB->set_active_text(SwViewShell::GetShellRes()->aStrNone);
517
518 if (nTmpLevel || rFormat.HasListFormat())
519 {
520 m_xAllLevelFT->set_sensitive(true);
521 m_xAllLevelNF->set_sensitive(true);
522 m_xAllLevelNF->set_max(nTmpLevel + 1);
523 m_xAllLevelNF->set_min(rFormat.HasListFormat() ? 0 : 1);
524 m_xAllLevelNF->set_value(rFormat.GetIncludeUpperLevels());
525 }
526 else
527 {
528 m_xAllLevelNF->set_text(OUString());
529 m_xAllLevelNF->set_sensitive(false);
530 m_xAllLevelFT->set_sensitive(false);
531 }
533 m_xStartEdit->set_value( rFormat.GetStart() );
534 }
535 SetModified();
536}
537
539{
540 auto aRows = rBox.get_selected_rows();
541 assert(aRows.empty() || aRows.size() == 1); // Single selection only
542 if (aRows.empty() || aRows[0] == MAXLEVEL)
543 {
544 m_nActLevel = USHRT_MAX;
545 }
546 else
547 {
548 m_nActLevel = 1 << aRows[0];
549 }
550 Update();
551}
552
554{
555 sal_uInt16 nMask = 1;
556 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
557 {
558 if(m_nActLevel & nMask)
559 {
560 SwNumFormat aNumFormat(m_pNumRule->Get(i));
561 aNumFormat.SetIncludeUpperLevels( std::min( static_cast<sal_uInt8>(rEdit.get_value()),
562 static_cast<sal_uInt8>(i + 1)) );
563 // Set the same prefix/suffix to generate list format with changed IncludedUpperLevels
564 aNumFormat.SetListFormat(aNumFormat.GetPrefix(), aNumFormat.GetSuffix(), i);
565 m_pNumRule->Set(i, aNumFormat);
566 }
567 nMask <<= 1;
568 }
569 SetModified();
570}
571
573{
574 sal_uInt8 i;
575
576 const OUString aCollName(rBox.get_active_text());
577 //0xFFFF not allowed here (disable)
578 sal_uInt16 nTmpLevel = lcl_BitToLevel(m_nActLevel);
579 OUString sOldName( m_pCollNames[nTmpLevel] );
580
581 for( i = 0; i < MAXLEVEL; ++i)
582 m_pCollNames[i] = m_aSaveCollNames[i];
583
584 m_pCollNames[nTmpLevel] = aCollName;
585 // template already in use?
586 for( i = 0; i < MAXLEVEL; ++i)
587 if(i != nTmpLevel && m_pCollNames[i] == aCollName )
588 m_pCollNames[i].clear();
589
590 // search the oldname and put it into the current entries
591 if( !sOldName.isEmpty() )
592 for( i = 0; i < MAXLEVEL; ++i)
593 if( m_aSaveCollNames[ i ] == sOldName && i != nTmpLevel &&
594 m_pCollNames[ i ].isEmpty() )
595 {
596 sal_uInt8 n;
597 for( n = 0; n < MAXLEVEL; ++n )
598 if( m_pCollNames[ n ] == sOldName )
599 break;
600
601 if( MAXLEVEL == n )
602 // it was an outline level name and the current entries is zero.
603 m_pCollNames[ i ] = sOldName;
604 }
605
606 SetModified();
607 CollSave();
608}
609
611{
612 for (sal_uInt8 i = 0; i < MAXLEVEL; ++i)
614}
615
617{
618 sal_uInt16 nMask = 1;
619 SvxNumType nNumberType = m_xNumberBox->GetSelectedNumberingType();
620 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
621 {
622 if(m_nActLevel & nMask)
623 {
624 SwNumFormat aNumFormat(m_pNumRule->Get(i));
625 aNumFormat.SetNumberingType(nNumberType);
626 m_pNumRule->Set(i, aNumFormat);
627 CheckForStartValue_Impl(nNumberType);
628 }
629 nMask <<= 1;
630 }
631 SetModified();
632}
633
635{
636 sal_uInt16 nMask = 1;
637 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
638 {
639 if(m_nActLevel & nMask)
640 {
641 SwNumFormat aNumFormat(m_pNumRule->Get(i));
642 aNumFormat.SetListFormat( m_xPrefixED->get_text(), m_xSuffixED->get_text(), i );
643 m_pNumRule->Set(i, aNumFormat);
644 }
645 nMask <<= 1;
646 }
647 SetModified();
648}
649
651{
652 sal_uInt16 nMask = 1;
653 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
654 {
655 if(m_nActLevel & nMask)
656 {
657 SwNumFormat aNumFormat(m_pNumRule->Get(i));
658 aNumFormat.SetStart(o3tl::narrowing<sal_uInt16>(rEdit.get_value()));
659 m_pNumRule->Set(i, aNumFormat);
660 }
661 nMask <<= 1;
662 }
663 SetModified();
664}
665
667{
668 OUString sEntry = m_xCharFormatLB->get_active_text();
669 sal_uInt16 nMask = 1;
670 bool bFormatNone = sEntry == SwViewShell::GetShellRes()->aStrNone;
671 SwCharFormat* pFormat = nullptr;
672 if(!bFormatNone)
673 {
674 sal_uInt16 nChCount = m_pSh->GetCharFormatCount();
675 for(sal_uInt16 i = 0; i < nChCount; i++)
676 {
677 SwCharFormat& rChFormat = m_pSh->GetCharFormat(i);
678 if(rChFormat.GetName() == sEntry)
679 {
680 pFormat = &rChFormat;
681 break;
682 }
683 }
684 if(!pFormat)
685 {
686 SfxStyleSheetBasePool* pPool = m_pSh->GetView().GetDocShell()->GetStyleSheetPool();
687 SfxStyleSheetBase* pBase;
688 pBase = pPool->Find(sEntry, SfxStyleFamily::Char);
689 if(!pBase)
690 pBase = &pPool->Make(sEntry, SfxStyleFamily::Page);
691 pFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
692
693 }
694 }
695
696 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
697 {
698 if(m_nActLevel & nMask)
699 {
700 SwNumFormat aNumFormat(m_pNumRule->Get(i));
701 if(bFormatNone)
702 aNumFormat.SetCharFormat(nullptr);
703 else
704 aNumFormat.SetCharFormat(pFormat);
705 m_pNumRule->Set(i, aNumFormat);
706 }
707 nMask <<= 1;
708 }
709}
710
712{
713}
714
716{
717 m_pSh = pShell;
718 // query this document's NumRules
720 m_pCollNames = static_cast<SwOutlineTabDialog*>(GetDialogController())->GetCollNames();
721
722 CollSave();
723
726 // set start value - nActLevel must be 1 here
727 sal_uInt16 nTmpLevel = lcl_BitToLevel(m_nActLevel);
728 const SwNumFormat& rNumFormat = m_pNumRule->Get( nTmpLevel );
729 m_xStartEdit->set_value( rNumFormat.GetStart() );
730
731 // create pool formats for headlines
732 for (sal_uInt16 i = 0; i < MAXLEVEL; ++i)
733 {
735 static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), OUString()));
736 m_xLevelLB->append_text( OUString::number(i + 1) );
737 }
738 OUString sStr = "1 - " + OUString::number(MAXLEVEL);
739 m_xLevelLB->append_text(sStr);
740
741 // query the texttemplates' outlining levels
742 const sal_uInt16 nCount = m_pSh->GetTextFormatCollCount();
743 for (sal_uInt16 i = 0; i < nCount; ++i)
744 {
746 if(!rTextColl.IsDefault())
747 {
748 sStr = rTextColl.GetName();
749 if (m_xCollBox->find_text(sStr) == -1)
750 m_xCollBox->append_text(sStr);
751 }
752 }
753
754 m_xNumberBox->SelectNumberingType(rNumFormat.GetNumberingType());
755
756 // collect char styles
757 m_xCharFormatLB->clear();
758 m_xCharFormatLB->append_text(SwViewShell::GetShellRes()->aStrNone);
759
760 // char styles
763 Update();
764}
765
767{
769 if(m_nActLevel != USHRT_MAX)
771 else
772 m_xLevelLB->select(MAXLEVEL);
773 LevelHdl(*m_xLevelLB);
774}
775
777{
779 return DeactivateRC::LeavePage;
780}
781
783{
784 return true;
785}
786
788{
790}
791
792std::unique_ptr<SfxTabPage> SwOutlineSettingsTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
793 const SfxItemSet* rAttrSet)
794{
795 return std::make_unique<SwOutlineSettingsTabPage>(pPage, pController, *rAttrSet);
796}
797
799{
800 bool bIsNull = m_xStartEdit->get_value() == 0;
801 bool bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC ||
802 SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType ||
803 SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType;
804 m_xStartEdit->set_min(bNoZeroAllowed ? 1 : 0);
805 if (bIsNull && bNoZeroAllowed)
806 StartModified(*m_xStartEdit);
807}
808
809static tools::Long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, tools::Long nXStart, tools::Long nYStart, const Size& rSize)
810{
811 vcl::Font aTmpFont(pVDev->GetFont());
812
813 // via Uno it's possible that no font has been set!
814 vcl::Font aFont(rFormat.GetBulletFont() ? *rFormat.GetBulletFont() : aTmpFont);
815 Size aTmpSize(rSize);
816 aTmpSize.setWidth( aTmpSize.Width() * ( rFormat.GetBulletRelSize()) );
817 aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
818 aTmpSize.setHeight( aTmpSize.Height() * ( rFormat.GetBulletRelSize()) );
819 aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
820 // in case of a height of zero it is drawn in original height
821 if(!aTmpSize.Height())
822 aTmpSize.setHeight( 1 );
823 aFont.SetFontSize(aTmpSize);
824 aFont.SetTransparent(true);
825 Color aBulletColor = rFormat.GetBulletColor();
826 if(aBulletColor == COL_AUTO)
827 aBulletColor = pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK;
828 else if(aBulletColor == pVDev->GetFillColor())
829 aBulletColor.Invert();
830 aFont.SetColor(aBulletColor);
831 pVDev->SetFont( aFont );
832 sal_UCS4 cBullet = rFormat.GetBulletChar();
833 OUString aText(&cBullet, 1);
834 tools::Long nY = nYStart;
835 nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
836 pVDev->DrawText( Point(nXStart, nY), aText );
837 tools::Long nRet = pVDev->GetTextWidth(aText);
838
839 pVDev->SetFont(aTmpFont);
840 return nRet;
841}
842
843static tools::Long lcl_DrawGraphic(vcl::RenderContext& rVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
844{
845 const SvxBrushItem* pBrushItem = rFormat.GetBrush();
846 tools::Long nRet = 0;
847 if (pBrushItem)
848 {
849 const Graphic* pGraphic = pBrushItem->GetGraphic();
850 if (pGraphic)
851 {
852 Size aGSize( rFormat.GetGraphicSize());
853 aGSize.setWidth( aGSize.Width() / nDivision );
854 nRet = aGSize.Width();
855 aGSize.setHeight( aGSize.Height() / nDivision );
856 pGraphic->Draw(rVDev, Point(nXStart, nYStart), rVDev.PixelToLogic(aGSize));
857 }
858 }
859 return nRet;
860}
861
863{
864 const Size aSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
865
866 ScopedVclPtrInstance<VirtualDevice> pVDev(rRenderContext);
867 pVDev->SetMapMode(rRenderContext.GetMapMode());
868 pVDev->SetOutputSize(aSize);
869
871 const Color& rDocColor = pOpt.GetDocColor();
872 const Color& rDocBoundariesColor = pOpt.GetDocBoundariesColor();
873 const Color& rFontColor = pOpt.GetFontColor();
874 // #101524# OJ
875 pVDev->SetFillColor(rDocColor);
876 pVDev->SetLineColor(rDocBoundariesColor);
877 pVDev->DrawRect(tools::Rectangle(Point(0,0), aSize));
878
879 if (m_pActNum)
880 {
881 tools::Long nWidthRelation = 30; // chapter dialog
882 if(m_nPageWidth)
883 {
884 nWidthRelation = m_nPageWidth / aSize.Width();
885 if(m_bPosition)
886 nWidthRelation = nWidthRelation * 2 / 3;
887 else
888 nWidthRelation = nWidthRelation / 4;
889 }
890
891 // height per level
892 const tools::Long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1));
893 const tools::Long nYStep = (aSize.Height() - 6)/ MAXLEVEL;
894 tools::Long nYStart = 4;
895 m_aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, GetAppLanguage(),
896 GetDefaultFontFlags::OnlyOne, &rRenderContext);
897
898 if (svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR, false).nColor == COL_AUTO)
899 m_aStdFont.SetColor( rDocColor.IsDark() ? COL_WHITE : COL_BLACK );
900 else
901 m_aStdFont.SetColor( rFontColor );
902
903 const tools::Long nFontHeight = nYStep * ( m_bPosition ? 15 : 6 ) / 10;
904 m_aStdFont.SetFontSize(Size( 0, nFontHeight ));
905
906 tools::Long nPreNum = m_pActNum->Get(0).GetStart();
907
908 if (m_bPosition)
909 {
910 const tools::Long nLineHeight = nFontHeight * 8 / 7;
911 sal_uInt8 nStart = 0;
912 while (!(m_nActLevel & (1 << nStart)))
913 {
914 nStart++;
915 }
916 if(nStart) // so that possible predecessors and successors are showed
917 nStart--;
918
920 sal_uInt8 nEnd = std::min(sal_uInt8(nStart + 3), MAXLEVEL);
921 for (sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel)
922 {
923 const SwNumFormat &rFormat = m_pActNum->Get(nLevel);
924 aNumVector.push_back(rFormat.GetStart());
925
926 tools::Long nXStart( 0 );
927 tools::Long nTextOffset( 0 );
928 tools::Long nNumberXPos( 0 );
930 {
931 nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
932 nTextOffset = rFormat.GetCharTextDistance() / nWidthRelation;
933 nNumberXPos = nXStart;
934 const tools::Long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation;
935
936 if(nFirstLineOffset <= nNumberXPos)
937 nNumberXPos -= nFirstLineOffset;
938 else
939 nNumberXPos = 0;
940 }
942 {
943 const tools::Long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation);
944 nNumberXPos = (nTmpNumberXPos < 0) ? 0 : nTmpNumberXPos;
945 }
946
947 tools::Long nBulletWidth = 0;
948 if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
949 {
950 nBulletWidth = lcl_DrawGraphic(*pVDev, rFormat, nNumberXPos,
951 nYStart, nWidthRelation);
952 }
953 else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
954 {
955 nBulletWidth = lcl_DrawBullet(pVDev.get(), rFormat, nNumberXPos,
956 nYStart, m_aStdFont.GetFontSize());
957 }
958 else
959 {
960 pVDev->SetFont(m_aStdFont);
962 aNumVector[nLevel] = nPreNum;
963 OUString aText(m_pActNum->MakeNumString( aNumVector ));
964 pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
965 nBulletWidth = pVDev->GetTextWidth(aText);
966 nPreNum++;
967 }
970 {
971 pVDev->SetFont(m_aStdFont);
972 OUString aText(' ');
973 pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
974 nBulletWidth += pVDev->GetTextWidth(aText);
975 }
976
977 tools::Long nTextXPos(0);
979 {
980 nTextXPos = nXStart;
981 if (nTextOffset < 0)
982 nTextXPos = nTextXPos + nTextOffset;
983 if (nNumberXPos + nBulletWidth + nTextOffset > nTextXPos)
984 nTextXPos = nNumberXPos + nBulletWidth + nTextOffset;
985 }
987 {
988 switch (rFormat.GetLabelFollowedBy())
989 {
991 {
992 nTextXPos = rFormat.GetListtabPos() / nWidthRelation;
993 if (nTextXPos < nNumberXPos + nBulletWidth)
994 {
995 nTextXPos = nNumberXPos + nBulletWidth;
996 }
997 }
998 break;
1002 {
1003 nTextXPos = nNumberXPos + nBulletWidth;
1004 }
1005 break;
1006 }
1007
1008 nXStart = rFormat.GetIndentAt() / nWidthRelation;
1009 }
1010
1011 tools::Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1012 pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor()); // COL_BLACK );
1013 pVDev->DrawRect(aRect1);
1014
1015 tools::Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1016 pVDev->DrawRect(aRect2);
1017 nYStart += 2 * nLineHeight;
1018 }
1019 }
1020 else
1021 {
1022 SwNumberTree::tNumberVector aNumVector;
1023 const tools::Long nLineHeight = nFontHeight * 3 / 2;
1024 for (sal_uInt8 nLevel = 0; nLevel < MAXLEVEL; ++nLevel, nYStart = nYStart + nYStep)
1025 {
1026 const SwNumFormat &rFormat = m_pActNum->Get(nLevel);
1027 aNumVector.push_back(rFormat.GetStart());
1028 tools::Long nXStart(0);
1030 {
1031 nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
1032 }
1034 {
1035 const tools::Long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation);
1036 nXStart = (nTmpXStart < 0) ? 0 : nTmpXStart;
1037 }
1038 nXStart /= 2;
1039 nXStart += 2;
1040 tools::Long nTextOffset;
1041 if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
1042 {
1043 lcl_DrawGraphic(*pVDev, rFormat, nXStart, nYStart, nWidthRelation);
1044 nTextOffset = nLineHeight + nXStep;
1045 }
1046 else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
1047 {
1048 nTextOffset = lcl_DrawBullet(pVDev.get(), rFormat, nXStart, nYStart, m_aStdFont.GetFontSize());
1049 nTextOffset += nXStep;
1050 }
1051 else
1052 {
1053 pVDev->SetFont(m_aStdFont);
1054 if (m_pActNum->IsContinusNum())
1055 aNumVector[nLevel] = nPreNum;
1056 OUString aText(m_pActNum->MakeNumString( aNumVector ));
1057 pVDev->DrawText( Point(nXStart, nYStart), aText );
1058 nTextOffset = pVDev->GetTextWidth(aText) + nXStep;
1059 nPreNum++;
1060 }
1061 pVDev->SetFont(m_aStdFont);
1062 pVDev->DrawText(
1063 Point(nXStart + nTextOffset, nYStart),
1064 (m_pOutlineNames == nullptr
1066 : m_pOutlineNames[nLevel]));
1067 }
1068 }
1069 }
1070 rRenderContext.DrawOutDev(Point(0,0), aSize, Point(0,0), aSize, *pVDev);
1071}
1072
1073/* 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
vcl::Font m_aStdFont
Definition: numprevw.hxx:31
tools::Long m_nPageWidth
Definition: numprevw.hxx:32
void SetOutlineNames(const OUString *pNames)
Definition: numprevw.hxx:58
const SwNumRule * m_pActNum
Definition: numprevw.hxx:30
sal_uInt16 m_nActLevel
Definition: numprevw.hxx:35
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: outline.cxx:862
void SetNumRule(const SwNumRule *pNum)
Definition: numprevw.hxx:50
const OUString * m_pOutlineNames
Definition: numprevw.hxx:33
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 & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual short Ok()
void AddTabPage(const OUString &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:226
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
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:1319
void SetOutlineNumRule(const SwNumRule &)
Definition: ednumber.cxx:110
SwTextFormatColl & GetTextFormatColl(sal_uInt16 nTextFormatColl) const
Definition: edfcol.cxx:699
sal_uInt16 GetTextFormatCollCount() const
Definition: edfcol.cxx:694
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: edfmt.cxx:152
const SwNumRule * GetOutlineNumRule() const
Definition: ednumber.cxx:117
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:366
SwCharFormat * GetCharFormat() const
Definition: numrule.hxx:74
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:281
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:87
const OUString & GetName() const
Definition: numrule.hxx:224
OUString MakeNumString(const SwNodeNum &, bool bInclStrings=true) const
Definition: number.cxx:643
void ResetNumRule(SwWrtShell &rSh, SwNumRule &) const
Definition: uinums.cxx:147
const OUString & GetName() const
Definition: uinums.hxx:74
static constexpr auto npos
Definition: ndarr.hxx:81
SwWrtShell * m_pSh
Definition: outline.hxx:71
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: outline.cxx:766
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: outline.cxx:776
std::unique_ptr< weld::ComboBox > m_xCollBox
Definition: outline.hxx:78
std::unique_ptr< SwNumberingTypeListBox > m_xNumberBox
Definition: outline.hxx:79
NumberingPreview m_aPreviewWIN
Definition: outline.hxx:75
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: outline.cxx:782
virtual ~SwOutlineSettingsTabPage() override
Definition: outline.cxx:711
std::unique_ptr< weld::TreeView > m_xLevelLB
Definition: outline.hxx:77
std::unique_ptr< weld::Label > m_xAllLevelFT
Definition: outline.hxx:81
void SetWrtShell(SwWrtShell *pShell)
Definition: outline.cxx:715
sal_uInt16 m_nActLevel
Definition: outline.hxx:74
std::unique_ptr< weld::SpinButton > m_xAllLevelNF
Definition: outline.hxx:82
virtual void Reset(const SfxItemSet *rSet) override
Definition: outline.cxx:787
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: outline.cxx:792
std::unique_ptr< weld::Entry > m_xSuffixED
Definition: outline.hxx:84
std::unique_ptr< weld::Entry > m_xPrefixED
Definition: outline.hxx:83
SwOutlineSettingsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: outline.cxx:390
OUString m_aSaveCollNames[MAXLEVEL]
Definition: outline.hxx:70
OUString * m_pCollNames
Definition: outline.hxx:73
SwNumRule * m_pNumRule
Definition: outline.hxx:72
std::unique_ptr< weld::SpinButton > m_xStartEdit
Definition: outline.hxx:85
std::unique_ptr< weld::ComboBox > m_xCharFormatLB
Definition: outline.hxx:80
void CheckForStartValue_Impl(sal_uInt16 nNumberingType)
Definition: outline.cxx:798
virtual short Ok() override
Definition: outline.cxx:308
OUString m_aCollNames[MAXLEVEL]
Definition: outline.hxx:36
std::unique_ptr< weld::MenuButton > m_xMenuButton
Definition: outline.hxx:46
std::unique_ptr< SwNumRule > m_xNumRule
Definition: outline.hxx:41
SwOutlineTabDialog(weld::Window *pParent, const SfxItemSet *pSwItemSet, SwWrtShell &)
Definition: outline.cxx:143
static sal_uInt16 s_nNumLevel
Definition: outline.hxx:35
virtual void PageCreated(const OUString &rPageId, SfxTabPage &rPage) override
Definition: outline.cxx:199
static void SetActNumLevel(sal_uInt16 nSet)
Definition: outline.hxx:64
virtual ~SwOutlineTabDialog() override
Definition: outline.cxx:195
SwWrtShell & m_rWrtSh
Definition: outline.hxx:40
sal_uInt16 GetLevel(std::u16string_view rFormatName) const
Definition: outline.cxx:298
static sal_uInt16 GetActNumLevel()
Definition: outline.hxx:63
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:61
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: fmtcol.cxx:432
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:122
void DeleteAssignmentToListLevelOfOutlineStyle()
Definition: fmtcol.cxx:712
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:395
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:685
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:678
const Color & GetDocBoundariesColor() const
Definition: viewopt.cxx:457
const Color & GetFontColor() const
Definition: viewopt.cxx:517
static const SwViewOption & GetCurrentViewOptions()
Definition: viewopt.cxx:605
const Color & GetDocColor() const
Definition: viewopt.cxx:452
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2664
const IDocumentOutlineNodes * getIDocumentOutlineNodesAccess() const
Definition: viewsh.cxx:2844
SwDocShell * GetDocShell()
Definition: view.cxx:1193
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
@ GETSTYLE_CREATESOME
Definition: wrtsh.hxx:362
SwTextFormatColl * GetParaStyle(const OUString &rCollName, GetStyle eCreate=GETSTYLE_NOCREATE)
Definition: wrtsh1.cxx:1823
const SwView & GetView() const
Definition: wrtsh.hxx:443
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
float u
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
LanguageType GetAppLanguage()
Definition: init.cxx:741
OUString aName
sal_Int64 n
sal_Int32 nFirstLineOffset
std::vector< tSwNumTreeNumber > tNumberVector
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
Definition: fmtcol.cxx:74
int i
long Long
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
@ OUTLINE_RULE
Definition: numrule.hxx:92
const char 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:809
static tools::Long lcl_DrawGraphic(vcl::RenderContext &rVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
Definition: outline.cxx:843
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:168
#define SW_MOD()
Definition: swmodule.hxx:254
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:781
RET_OK
RET_CANCEL
sal_uInt32 sal_UCS4