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 , m_rWrtSh(rSh)
145 , m_pChapterNumRules(SW_MOD()->GetChapterNumRules())
146 , m_bModified(m_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 m_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( !m_rWrtSh.GetParaStyle( sHeadline =
165 SwStyleNameMapper::GetUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
166 sHeadline )) )
167 m_aCollNames[i] = sHeadline;
168 }
169
170 // query the text templates' outlining levels
171 const sal_uInt16 nCount = m_rWrtSh.GetTextFormatCollCount();
172 for(i = 0; i < nCount; ++i )
173 {
175 if(!rTextColl.IsDefault())
176 {
178 {
179 int nOutLevel = rTextColl.GetAssignedOutlineStyleLevel();
180 m_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(&m_rWrtSh);
195 static_cast<SwNumPositionTabPage&>(rPage).SetOutlineTabDialog(this);
196 }
197 else if (rPageId == "numbering")
198 {
199 static_cast<SwOutlineSettingsTabPage&>(rPage).SetWrtShell(&m_rWrtSh);
200 }
201}
202
204{
205 if (!m_bModified)
206 m_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 = m_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 = m_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 m_pChapterNumRules->ApplyNumRules( SwNumRulesWithName(
264 *m_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 = m_pChapterNumRules->GetRules( nLevelNo );
273 if( pRules )
274 {
275 pRules->ResetNumRule(m_rWrtSh, *m_xNumRule);
276 m_xNumRule->SetRuleType( OUTLINE_RULE );
277 SfxTabPage* pOutlinePage = GetTabPage("numbering");
278 assert(pOutlinePage);
279 static_cast<SwOutlineSettingsTabPage*>(pOutlinePage)->SetNumRule(m_xNumRule.get());
280 }
281 else
282 *m_xNumRule = *m_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(m_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 = m_rWrtSh.GetOutlineNumRule();
310
311 sal_uInt16 i, nCount = m_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 && m_aCollNames[i] != sHeadline)
353 {
355 static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i) );
358
359 if( !m_aCollNames[i].isEmpty() )
360 {
361 pTextColl = m_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 , m_aNoFormatName(SwResId(SW_STR_NONE))
385 , m_pSh(nullptr)
386 , m_pNumRule(nullptr)
387 , m_pCollNames(nullptr)
388 , m_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(m_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->make_sorted();
413 m_xCharFormatLB->connect_changed(LINK(this, SwOutlineSettingsTabPage, CharFormatHdl));
414}
415
417{
418 // if a template was already selected for this level, select it in the ListBox
419 m_xCollBox->set_sensitive(USHRT_MAX != m_nActLevel);
420 if(USHRT_MAX == m_nActLevel)
421 {
422 bool bSamePrefix = true;
423 bool bSameSuffix = true;
424 bool bSameType = true;
425 bool bSameComplete = true;
426 bool bSameStart = true;
427 bool bSameCharFormat = true;
428
429 const SwNumFormat* aNumFormatArr[MAXLEVEL];
430 const SwCharFormat* pFirstFormat = nullptr;
431
432 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
433 {
434
435 aNumFormatArr[ i ] = &m_pNumRule->Get(i);
436 if(i == 0)
437 pFirstFormat = aNumFormatArr[i]->GetCharFormat();
438 else
439 {
440 bSameType &= aNumFormatArr[i]->GetNumberingType() == aNumFormatArr[0]->GetNumberingType();
441 bSameStart &= aNumFormatArr[i]->GetStart() == aNumFormatArr[0]->GetStart();
442 bSamePrefix &= aNumFormatArr[i]->GetPrefix() == aNumFormatArr[0]->GetPrefix();
443 bSameSuffix &= aNumFormatArr[i]->GetSuffix() == aNumFormatArr[0]->GetSuffix();
444 bSameComplete &= aNumFormatArr[i]->GetIncludeUpperLevels() == aNumFormatArr[0]->GetIncludeUpperLevels();
445 const SwCharFormat* pFormat = aNumFormatArr[i]->GetCharFormat();
446 bSameCharFormat &= (!pFirstFormat && !pFormat)
447 || (pFirstFormat && pFormat && pFormat->GetName() == pFirstFormat->GetName());
448 }
449 }
450 CheckForStartValue_Impl(aNumFormatArr[0]->GetNumberingType());
451 if (bSameType)
452 m_xNumberBox->SelectNumberingType( aNumFormatArr[0]->GetNumberingType() );
453 else
454 m_xNumberBox->SetNoSelection();
455 if(bSameStart)
456 m_xStartEdit->set_value(aNumFormatArr[0]->GetStart());
457 else
458 m_xStartEdit->set_text(OUString());
459 if(bSamePrefix)
460 m_xPrefixED->set_text(aNumFormatArr[0]->GetPrefix());
461 else
462 m_xPrefixED->set_text(OUString());
463 if(bSameSuffix)
464 m_xSuffixED->set_text(aNumFormatArr[0]->GetSuffix());
465 else
466 m_xSuffixED->set_text(OUString());
467
468 if (bSameCharFormat)
469 {
470 if (pFirstFormat)
471 m_xCharFormatLB->set_active_text(pFirstFormat->GetName());
472 else
473 m_xCharFormatLB->set_active_text(SwViewShell::GetShellRes()->aStrNone);
474 }
475 else
476 m_xCharFormatLB->set_active(-1);
477
478 m_xAllLevelFT->set_sensitive(true);
479 m_xAllLevelNF->set_sensitive(true);
480 m_xAllLevelNF->set_max(MAXLEVEL);
481 if (bSameComplete)
482 {
483 m_xAllLevelNF->set_value(aNumFormatArr[0]->GetIncludeUpperLevels());
484 }
485 else
486 {
487 m_xAllLevelNF->set_text(OUString());
488 }
489 }
490 else
491 {
492 sal_uInt16 nTmpLevel = lcl_BitToLevel(m_nActLevel);
493 OUString aColl(m_pCollNames[nTmpLevel]);
494 if(!aColl.isEmpty())
495 m_xCollBox->set_active_text(aColl);
496 else
497 m_xCollBox->set_active_text(m_aNoFormatName);
498 const SwNumFormat &rFormat = m_pNumRule->Get(nTmpLevel);
499
500 m_xNumberBox->SelectNumberingType( rFormat.GetNumberingType() );
501 m_xPrefixED->set_text(rFormat.GetPrefix());
502 m_xSuffixED->set_text(rFormat.GetSuffix());
503 const SwCharFormat* pFormat = rFormat.GetCharFormat();
504 if(pFormat)
505 m_xCharFormatLB->set_active_text(pFormat->GetName());
506 else
507 m_xCharFormatLB->set_active_text(SwViewShell::GetShellRes()->aStrNone);
508
509 if (nTmpLevel || rFormat.HasListFormat())
510 {
511 m_xAllLevelFT->set_sensitive(true);
512 m_xAllLevelNF->set_sensitive(true);
513 m_xAllLevelNF->set_max(nTmpLevel + 1);
514 m_xAllLevelNF->set_min(rFormat.HasListFormat() ? 0 : 1);
515 m_xAllLevelNF->set_value(rFormat.GetIncludeUpperLevels());
516 }
517 else
518 {
519 m_xAllLevelNF->set_text(OUString());
520 m_xAllLevelNF->set_sensitive(false);
521 m_xAllLevelFT->set_sensitive(false);
522 }
524 m_xStartEdit->set_value( rFormat.GetStart() );
525 }
526 SetModified();
527}
528
530{
531 m_nActLevel = 0;
532 auto aRows = rBox.get_selected_rows();
533 if (std::find(aRows.begin(), aRows.end(), MAXLEVEL) != aRows.end())
534 {
535 m_nActLevel = 0xFFFF;
536 }
537 else
538 {
539 sal_uInt16 nMask = 1;
540 for( sal_uInt16 i = 0; i < MAXLEVEL; i++ )
541 {
542 if (std::find(aRows.begin(), aRows.end(), i) != aRows.end())
543 m_nActLevel |= nMask;
544 nMask <<= 1;
545 }
546 }
547 Update();
548}
549
551{
552 sal_uInt16 nMask = 1;
553 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
554 {
555 if(m_nActLevel & nMask)
556 {
557 SwNumFormat aNumFormat(m_pNumRule->Get(i));
558 aNumFormat.SetIncludeUpperLevels( std::min( static_cast<sal_uInt8>(rEdit.get_value()),
559 static_cast<sal_uInt8>(i + 1)) );
560 // Set the same prefix/suffix to generate list format with changed IncludedUpperLevels
561 aNumFormat.SetListFormat(aNumFormat.GetPrefix(), aNumFormat.GetSuffix(), i);
562 m_pNumRule->Set(i, aNumFormat);
563 }
564 nMask <<= 1;
565 }
566 SetModified();
567}
568
570{
571 sal_uInt8 i;
572
573 const OUString aCollName(rBox.get_active_text());
574 //0xFFFF not allowed here (disable)
575 sal_uInt16 nTmpLevel = lcl_BitToLevel(m_nActLevel);
576 OUString sOldName( m_pCollNames[nTmpLevel] );
577
578 for( i = 0; i < MAXLEVEL; ++i)
579 m_pCollNames[i] = m_aSaveCollNames[i];
580
581 if(aCollName == m_aNoFormatName)
582 m_pCollNames[nTmpLevel].clear();
583 else
584 {
585 m_pCollNames[nTmpLevel] = aCollName;
586 // template already in use?
587 for( i = 0; i < MAXLEVEL; ++i)
588 if(i != nTmpLevel && m_pCollNames[i] == aCollName )
589 m_pCollNames[i].clear();
590 }
591
592 // search the oldname and put it into the current entries
593 if( !sOldName.isEmpty() )
594 for( i = 0; i < MAXLEVEL; ++i)
595 if( m_aSaveCollNames[ i ] == sOldName && i != nTmpLevel &&
596 m_pCollNames[ i ].isEmpty() )
597 {
598 sal_uInt8 n;
599 for( n = 0; n < MAXLEVEL; ++n )
600 if( m_pCollNames[ n ] == sOldName )
601 break;
602
603 if( MAXLEVEL == n )
604 // it was an outline level name and the current entries is zero.
605 m_pCollNames[ i ] = sOldName;
606 }
607
608 SetModified();
609 CollSave();
610}
611
613{
614 for (sal_uInt8 i = 0; i < MAXLEVEL; ++i)
616}
617
619{
620 sal_uInt16 nMask = 1;
621 SvxNumType nNumberType = m_xNumberBox->GetSelectedNumberingType();
622 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
623 {
624 if(m_nActLevel & nMask)
625 {
626 SwNumFormat aNumFormat(m_pNumRule->Get(i));
627 aNumFormat.SetNumberingType(nNumberType);
628 m_pNumRule->Set(i, aNumFormat);
629 CheckForStartValue_Impl(nNumberType);
630 }
631 nMask <<= 1;
632 }
633 SetModified();
634}
635
637{
638 sal_uInt16 nMask = 1;
639 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
640 {
641 if(m_nActLevel & nMask)
642 {
643 SwNumFormat aNumFormat(m_pNumRule->Get(i));
644 aNumFormat.SetListFormat( m_xPrefixED->get_text(), m_xSuffixED->get_text(), i );
645 m_pNumRule->Set(i, aNumFormat);
646 }
647 nMask <<= 1;
648 }
649 SetModified();
650}
651
653{
654 sal_uInt16 nMask = 1;
655 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
656 {
657 if(m_nActLevel & nMask)
658 {
659 SwNumFormat aNumFormat(m_pNumRule->Get(i));
660 aNumFormat.SetStart(o3tl::narrowing<sal_uInt16>(rEdit.get_value()));
661 m_pNumRule->Set(i, aNumFormat);
662 }
663 nMask <<= 1;
664 }
665 SetModified();
666}
667
669{
670 OUString sEntry = m_xCharFormatLB->get_active_text();
671 sal_uInt16 nMask = 1;
672 bool bFormatNone = sEntry == SwViewShell::GetShellRes()->aStrNone;
673 SwCharFormat* pFormat = nullptr;
674 if(!bFormatNone)
675 {
676 sal_uInt16 nChCount = m_pSh->GetCharFormatCount();
677 for(sal_uInt16 i = 0; i < nChCount; i++)
678 {
679 SwCharFormat& rChFormat = m_pSh->GetCharFormat(i);
680 if(rChFormat.GetName() == sEntry)
681 {
682 pFormat = &rChFormat;
683 break;
684 }
685 }
686 if(!pFormat)
687 {
688 SfxStyleSheetBasePool* pPool = m_pSh->GetView().GetDocShell()->GetStyleSheetPool();
689 SfxStyleSheetBase* pBase;
690 pBase = pPool->Find(sEntry, SfxStyleFamily::Char);
691 if(!pBase)
692 pBase = &pPool->Make(sEntry, SfxStyleFamily::Page);
693 pFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
694
695 }
696 }
697
698 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
699 {
700 if(m_nActLevel & nMask)
701 {
702 SwNumFormat aNumFormat(m_pNumRule->Get(i));
703 if(bFormatNone)
704 aNumFormat.SetCharFormat(nullptr);
705 else
706 aNumFormat.SetCharFormat(pFormat);
707 m_pNumRule->Set(i, aNumFormat);
708 }
709 nMask <<= 1;
710 }
711}
712
714{
715}
716
718{
719 m_pSh = pShell;
720 // query this document's NumRules
722 m_pCollNames = static_cast<SwOutlineTabDialog*>(GetDialogController())->GetCollNames();
723
724 CollSave();
725
728 // set start value - nActLevel must be 1 here
729 sal_uInt16 nTmpLevel = lcl_BitToLevel(m_nActLevel);
730 const SwNumFormat& rNumFormat = m_pNumRule->Get( nTmpLevel );
731 m_xStartEdit->set_value( rNumFormat.GetStart() );
732
733 // create pool formats for headlines
734 for (sal_uInt16 i = 0; i < MAXLEVEL; ++i)
735 {
737 static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), OUString()));
738 m_xLevelLB->append_text( OUString::number(i + 1) );
739 }
740 OUString sStr = "1 - " + OUString::number(MAXLEVEL);
741 m_xLevelLB->append_text(sStr);
742
743 // query the texttemplates' outlining levels
744 const sal_uInt16 nCount = m_pSh->GetTextFormatCollCount();
745 for (sal_uInt16 i = 0; i < nCount; ++i)
746 {
748 if(!rTextColl.IsDefault())
749 {
750 sStr = rTextColl.GetName();
751 if (m_xCollBox->find_text(sStr) == -1)
752 m_xCollBox->append_text(sStr);
753 }
754 }
755
756 m_xNumberBox->SelectNumberingType(rNumFormat.GetNumberingType());
758 int nTmp = 0;
759 if(nOutlinePos != SwOutlineNodes::npos)
760 {
761 nTmp = o3tl::narrowing<sal_uInt16>(m_pSh->getIDocumentOutlineNodesAccess()->getOutlineLevel(nOutlinePos));
762 }
763 m_xLevelLB->select(nTmp-1);
764
765 // collect char styles
766 m_xCharFormatLB->clear();
767 m_xCharFormatLB->append_text(SwViewShell::GetShellRes()->aStrNone);
768
769 // char styles
772 Update();
773}
774
776{
778 if(m_nActLevel != USHRT_MAX)
780 else
781 m_xLevelLB->select(MAXLEVEL);
782 LevelHdl(*m_xLevelLB);
783}
784
786{
788 return DeactivateRC::LeavePage;
789}
790
792{
793 return true;
794}
795
797{
799}
800
801std::unique_ptr<SfxTabPage> SwOutlineSettingsTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
802 const SfxItemSet* rAttrSet)
803{
804 return std::make_unique<SwOutlineSettingsTabPage>(pPage, pController, *rAttrSet);
805}
806
808{
809 bool bIsNull = m_xStartEdit->get_value() == 0;
810 bool bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC ||
811 SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType ||
812 SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType;
813 m_xStartEdit->set_min(bNoZeroAllowed ? 1 : 0);
814 if (bIsNull && bNoZeroAllowed)
815 StartModified(*m_xStartEdit);
816}
817
818static tools::Long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, tools::Long nXStart, tools::Long nYStart, const Size& rSize)
819{
820 vcl::Font aTmpFont(pVDev->GetFont());
821
822 // via Uno it's possible that no font has been set!
823 vcl::Font aFont(rFormat.GetBulletFont() ? *rFormat.GetBulletFont() : aTmpFont);
824 Size aTmpSize(rSize);
825 aTmpSize.setWidth( aTmpSize.Width() * ( rFormat.GetBulletRelSize()) );
826 aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
827 aTmpSize.setHeight( aTmpSize.Height() * ( rFormat.GetBulletRelSize()) );
828 aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
829 // in case of a height of zero it is drawn in original height
830 if(!aTmpSize.Height())
831 aTmpSize.setHeight( 1 );
832 aFont.SetFontSize(aTmpSize);
833 aFont.SetTransparent(true);
834 Color aBulletColor = rFormat.GetBulletColor();
835 if(aBulletColor == COL_AUTO)
836 aBulletColor = pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK;
837 else if(aBulletColor == pVDev->GetFillColor())
838 aBulletColor.Invert();
839 aFont.SetColor(aBulletColor);
840 pVDev->SetFont( aFont );
841 sal_UCS4 cBullet = rFormat.GetBulletChar();
842 OUString aText(&cBullet, 1);
843 tools::Long nY = nYStart;
844 nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
845 pVDev->DrawText( Point(nXStart, nY), aText );
846 tools::Long nRet = pVDev->GetTextWidth(aText);
847
848 pVDev->SetFont(aTmpFont);
849 return nRet;
850}
851
852static tools::Long lcl_DrawGraphic(vcl::RenderContext& rVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
853{
854 const SvxBrushItem* pBrushItem = rFormat.GetBrush();
855 tools::Long nRet = 0;
856 if (pBrushItem)
857 {
858 const Graphic* pGraphic = pBrushItem->GetGraphic();
859 if (pGraphic)
860 {
861 Size aGSize( rFormat.GetGraphicSize());
862 aGSize.setWidth( aGSize.Width() / nDivision );
863 nRet = aGSize.Width();
864 aGSize.setHeight( aGSize.Height() / nDivision );
865 pGraphic->Draw(rVDev, Point(nXStart, nYStart), rVDev.PixelToLogic(aGSize));
866 }
867 }
868 return nRet;
869}
870
872{
873 const Size aSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
874
875 ScopedVclPtrInstance<VirtualDevice> pVDev(rRenderContext);
876 pVDev->SetMapMode(rRenderContext.GetMapMode());
877 pVDev->SetOutputSize(aSize);
878
879 // #101524# OJ
880 pVDev->SetFillColor(SwViewOption::GetDocColor());
881 pVDev->SetLineColor(SwViewOption::GetDocBoundariesColor());
882 pVDev->DrawRect(tools::Rectangle(Point(0,0), aSize));
883
884 if (m_pActNum)
885 {
886 tools::Long nWidthRelation = 30; // chapter dialog
887 if(m_nPageWidth)
888 {
889 nWidthRelation = m_nPageWidth / aSize.Width();
890 if(m_bPosition)
891 nWidthRelation = nWidthRelation * 2 / 3;
892 else
893 nWidthRelation = nWidthRelation / 4;
894 }
895
896 // height per level
897 const tools::Long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1));
898 const tools::Long nYStep = (aSize.Height() - 6)/ MAXLEVEL;
899 tools::Long nYStart = 4;
900 m_aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, GetAppLanguage(),
901 GetDefaultFontFlags::OnlyOne, &rRenderContext);
902
903 if (svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR, false).nColor == COL_AUTO)
905 else
907
908 const tools::Long nFontHeight = nYStep * ( m_bPosition ? 15 : 6 ) / 10;
909 m_aStdFont.SetFontSize(Size( 0, nFontHeight ));
910
911 tools::Long nPreNum = m_pActNum->Get(0).GetStart();
912
913 if (m_bPosition)
914 {
915 const tools::Long nLineHeight = nFontHeight * 8 / 7;
916 sal_uInt8 nStart = 0;
917 while (!(m_nActLevel & (1 << nStart)))
918 {
919 nStart++;
920 }
921 if(nStart) // so that possible predecessors and successors are showed
922 nStart--;
923
925 sal_uInt8 nEnd = std::min(sal_uInt8(nStart + 3), MAXLEVEL);
926 for (sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel)
927 {
928 const SwNumFormat &rFormat = m_pActNum->Get(nLevel);
929 aNumVector.push_back(rFormat.GetStart());
930
931 tools::Long nXStart( 0 );
932 tools::Long nTextOffset( 0 );
933 tools::Long nNumberXPos( 0 );
935 {
936 nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
937 nTextOffset = rFormat.GetCharTextDistance() / nWidthRelation;
938 nNumberXPos = nXStart;
939 const tools::Long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation;
940
941 if(nFirstLineOffset <= nNumberXPos)
942 nNumberXPos -= nFirstLineOffset;
943 else
944 nNumberXPos = 0;
945 }
947 {
948 const tools::Long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation);
949 nNumberXPos = (nTmpNumberXPos < 0) ? 0 : nTmpNumberXPos;
950 }
951
952 tools::Long nBulletWidth = 0;
953 if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
954 {
955 nBulletWidth = lcl_DrawGraphic(*pVDev, rFormat, nNumberXPos,
956 nYStart, nWidthRelation);
957 }
958 else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
959 {
960 nBulletWidth = lcl_DrawBullet(pVDev.get(), rFormat, nNumberXPos,
961 nYStart, m_aStdFont.GetFontSize());
962 }
963 else
964 {
965 pVDev->SetFont(m_aStdFont);
967 aNumVector[nLevel] = nPreNum;
968 OUString aText(m_pActNum->MakeNumString( aNumVector ));
969 pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
970 nBulletWidth = pVDev->GetTextWidth(aText);
971 nPreNum++;
972 }
975 {
976 pVDev->SetFont(m_aStdFont);
977 OUString aText(' ');
978 pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
979 nBulletWidth += pVDev->GetTextWidth(aText);
980 }
981
982 tools::Long nTextXPos(0);
984 {
985 nTextXPos = nXStart;
986 if (nTextOffset < 0)
987 nTextXPos = nTextXPos + nTextOffset;
988 if (nNumberXPos + nBulletWidth + nTextOffset > nTextXPos)
989 nTextXPos = nNumberXPos + nBulletWidth + nTextOffset;
990 }
992 {
993 switch (rFormat.GetLabelFollowedBy())
994 {
996 {
997 nTextXPos = rFormat.GetListtabPos() / nWidthRelation;
998 if (nTextXPos < nNumberXPos + nBulletWidth)
999 {
1000 nTextXPos = nNumberXPos + nBulletWidth;
1001 }
1002 }
1003 break;
1007 {
1008 nTextXPos = nNumberXPos + nBulletWidth;
1009 }
1010 break;
1011 }
1012
1013 nXStart = rFormat.GetIndentAt() / nWidthRelation;
1014 }
1015
1016 tools::Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1017 pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor()); // COL_BLACK );
1018 pVDev->DrawRect(aRect1);
1019
1020 tools::Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1021 pVDev->DrawRect(aRect2);
1022 nYStart += 2 * nLineHeight;
1023 }
1024 }
1025 else
1026 {
1027 SwNumberTree::tNumberVector aNumVector;
1028 const tools::Long nLineHeight = nFontHeight * 3 / 2;
1029 for (sal_uInt8 nLevel = 0; nLevel < MAXLEVEL; ++nLevel, nYStart = nYStart + nYStep)
1030 {
1031 const SwNumFormat &rFormat = m_pActNum->Get(nLevel);
1032 aNumVector.push_back(rFormat.GetStart());
1033 tools::Long nXStart(0);
1035 {
1036 nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
1037 }
1039 {
1040 const tools::Long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation);
1041 nXStart = (nTmpXStart < 0) ? 0 : nTmpXStart;
1042 }
1043 nXStart /= 2;
1044 nXStart += 2;
1045 tools::Long nTextOffset;
1046 if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
1047 {
1048 lcl_DrawGraphic(*pVDev, rFormat, nXStart, nYStart, nWidthRelation);
1049 nTextOffset = nLineHeight + nXStep;
1050 }
1051 else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
1052 {
1053 nTextOffset = lcl_DrawBullet(pVDev.get(), rFormat, nXStart, nYStart, m_aStdFont.GetFontSize());
1054 nTextOffset += nXStep;
1055 }
1056 else
1057 {
1058 pVDev->SetFont(m_aStdFont);
1059 if (m_pActNum->IsContinusNum())
1060 aNumVector[nLevel] = nPreNum;
1061 OUString aText(m_pActNum->MakeNumString( aNumVector ));
1062 pVDev->DrawText( Point(nXStart, nYStart), aText );
1063 nTextOffset = pVDev->GetTextWidth(aText) + nXStep;
1064 nPreNum++;
1065 }
1066 pVDev->SetFont(m_aStdFont);
1067 pVDev->DrawText(
1068 Point(nXStart + nTextOffset, nYStart),
1069 (m_pOutlineNames == nullptr
1071 : m_pOutlineNames[nLevel]));
1072 }
1073 }
1074 }
1075 rRenderContext.DrawOutDev(Point(0,0), aSize, Point(0,0), aSize, *pVDev);
1076}
1077
1078/* 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:871
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 * 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: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:1185
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:70
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: outline.cxx:775
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: outline.cxx:785
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:791
virtual ~SwOutlineSettingsTabPage() override
Definition: outline.cxx:713
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:717
sal_uInt16 m_nActLevel
Definition: outline.hxx:73
std::unique_ptr< weld::SpinButton > m_xAllLevelNF
Definition: outline.hxx:81
virtual void Reset(const SfxItemSet *rSet) override
Definition: outline.cxx:796
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: outline.cxx:801
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
OUString m_aSaveCollNames[MAXLEVEL]
Definition: outline.hxx:69
OUString * m_pCollNames
Definition: outline.hxx:72
SwNumRule * m_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:807
virtual short Ok() override
Definition: outline.cxx:299
OUString m_aCollNames[MAXLEVEL]
Definition: outline.hxx:37
static sal_uInt16 nNumLevel
Definition: outline.hxx:35
std::unique_ptr< weld::MenuButton > m_xMenuButton
Definition: outline.hxx:45
std::unique_ptr< SwNumRule > m_xNumRule
Definition: outline.hxx:40
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
static void SetActNumLevel(sal_uInt16 nSet)
Definition: outline.hxx:63
virtual ~SwOutlineTabDialog() override
Definition: outline.cxx:186
SwWrtShell & m_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
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:382
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:120
void DeleteAssignmentToListLevelOfOutlineStyle()
Definition: fmtcol.cxx:648
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:345
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:621
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:614
static Color & GetDocBoundariesColor()
Definition: viewopt.cxx:374
static Color & GetDocColor()
Definition: viewopt.cxx:369
static Color & GetFontColor()
Definition: viewopt.cxx:439
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2650
const IDocumentOutlineNodes * getIDocumentOutlineNodesAccess() const
Definition: viewsh.cxx:2830
SwDocShell * GetDocShell()
Definition: view.cxx:1160
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:1806
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
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: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:818
static tools::Long lcl_DrawGraphic(vcl::RenderContext &rVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
Definition: outline.cxx:852
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:165
#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