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