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 
224 IMPL_LINK(SwOutlineTabDialog, MenuSelectHdl, const OString&, rIdent, void)
225 {
226  sal_uInt8 nLevelNo = 0;
227 
228  if (rIdent == "form1")
229  nLevelNo = 1;
230  else if (rIdent == "form2")
231  nLevelNo = 2;
232  else if (rIdent == "form3")
233  nLevelNo = 3;
234  else if (rIdent == "form4")
235  nLevelNo = 4;
236  else if (rIdent == "form5")
237  nLevelNo = 5;
238  else if (rIdent == "form6")
239  nLevelNo = 6;
240  else if (rIdent == "form7")
241  nLevelNo = 7;
242  else if (rIdent == "form8")
243  nLevelNo = 8;
244  else if (rIdent == "form9")
245  nLevelNo = 9;
246  else if (rIdent == "saveas")
247  {
248  SwNumNamesDlg aDlg(m_xDialog.get());
249  const OUString *aStrArr[SwChapterNumRules::nMaxRules];
250  for(sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
251  {
252  const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
253  if(pRules)
254  aStrArr[i] = &pRules->GetName();
255  else
256  aStrArr[i] = nullptr;
257  }
258  aDlg.SetUserNames(aStrArr);
259  if (aDlg.run() == RET_OK)
260  {
261  const OUString aName(aDlg.GetName());
262  pChapterNumRules->ApplyNumRules( SwNumRulesWithName(
263  *xNumRule, aName ), aDlg.GetCurEntryPos() );
264  m_xMenuButton->set_item_label("form" + OString::number(aDlg.GetCurEntryPos() + 1), aName);
265  }
266  return;
267  }
268 
269  if( nLevelNo-- )
270  {
271  const SwNumRulesWithName *pRules = pChapterNumRules->GetRules( nLevelNo );
272  if( pRules )
273  {
274  pRules->ResetNumRule(rWrtSh, *xNumRule);
275  xNumRule->SetRuleType( OUTLINE_RULE );
276  SfxTabPage* pOutlinePage = GetTabPage("numbering");
277  assert(pOutlinePage);
278  static_cast<SwOutlineSettingsTabPage*>(pOutlinePage)->SetNumRule(xNumRule.get());
279  }
280  else
281  *xNumRule = *rWrtSh.GetOutlineNumRule();
282  }
283 
284  SfxTabPage* pPage = GetCurTabPage();
285  pPage->Reset(GetOutputItemSet());
286 }
287 
288 sal_uInt16 SwOutlineTabDialog::GetLevel(std::u16string_view rFormatName) const
289 {
290  for(sal_uInt16 i = 0; i < MAXLEVEL; ++i)
291  {
292  if(aCollNames[i] == rFormatName)
293  return i;
294  }
295  return MAXLEVEL;
296 }
297 
299 {
301  // set levels for all created templates; has to be done in order to
302  // delete possibly cancelled assignments again.
303 
304  // encapsulate changes into an action to avoid effects on the current cursor
305  // position during the changes.
307 
308  const SwNumRule * pOutlineRule = rWrtSh.GetOutlineNumRule();
309 
310  sal_uInt16 i, nCount = rWrtSh.GetTextFormatCollCount();
311  for( i = 0; i < nCount; ++i )
312  {
313  SwTextFormatColl &rTextColl = rWrtSh.GetTextFormatColl(i);
314  if( !rTextColl.IsDefault() )
315  {
316  const SfxPoolItem & rItem =
317  rTextColl.GetFormatAttr(RES_PARATR_NUMRULE, false);
318 
319  if (static_cast<sal_uInt8>(GetLevel(rTextColl.GetName())) == MAXLEVEL)
320  {
322  {
324  }
325  if (static_cast<const SwNumRuleItem &>(rItem).GetValue() ==
326  pOutlineRule->GetName())
327  {
329  }
330  }
331  else
332  {
333  rTextColl.AssignToListLevelOfOutlineStyle(GetLevel(rTextColl.GetName()));
334 
335  if (static_cast<const SwNumRuleItem &>(rItem).GetValue() !=
336  pOutlineRule->GetName())
337  {
338  SwNumRuleItem aItem(pOutlineRule->GetName());
339  rTextColl.SetFormatAttr(aItem);
340  }
341  }
342  }
343  }
344 
345  for(i = 0; i < MAXLEVEL; ++i )
346  {
347  OUString sHeadline;
348  ::SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
349  sHeadline );
350  SwTextFormatColl* pColl = rWrtSh.FindTextFormatCollByName( sHeadline );
351  if( !pColl && aCollNames[i] != sHeadline)
352  {
354  static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i) );
357 
358  if( !aCollNames[i].isEmpty() )
359  {
360  pTextColl = rWrtSh.GetParaStyle(
362  if(pTextColl)
363  {
364  pTextColl->AssignToListLevelOfOutlineStyle(i);
365  SwNumRuleItem aItem(pOutlineRule->GetName());
366  pTextColl->SetFormatAttr(aItem);
367  }
368  }
369  }
370  }
371 
373 
374  // #i30443#
375  rWrtSh.EndAction();
376 
377  return RET_OK;
378 }
379 
381  const SfxItemSet& rSet)
382  : SfxTabPage(pPage, pController, "modules/swriter/ui/outlinenumberingpage.ui", "OutlineNumberingPage", &rSet)
383  , aNoFormatName(SwResId(SW_STR_NONE))
384  , pSh(nullptr)
385  , pNumRule(nullptr)
386  , pCollNames(nullptr)
387  , nActLevel(1)
388  , m_xLevelLB(m_xBuilder->weld_tree_view("level"))
389  , m_xCollBox(m_xBuilder->weld_combo_box("style"))
390  , m_xNumberBox(new SwNumberingTypeListBox(m_xBuilder->weld_combo_box("numbering")))
391  , m_xCharFormatLB(m_xBuilder->weld_combo_box("charstyle"))
392  , m_xAllLevelFT(m_xBuilder->weld_label("sublevelsft"))
393  , m_xAllLevelNF(m_xBuilder->weld_spin_button("sublevelsnf"))
394  , m_xPrefixED(m_xBuilder->weld_entry("prefix"))
395  , m_xSuffixED(m_xBuilder->weld_entry("suffix"))
396  , m_xStartEdit(m_xBuilder->weld_spin_button("startat"))
397  , m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWIN))
398 {
400 
402  m_xCollBox->make_sorted();
403  m_xCollBox->append_text(aNoFormatName);
404  m_xLevelLB->connect_changed(LINK(this, SwOutlineSettingsTabPage, LevelHdl));
405  m_xAllLevelNF->connect_value_changed(LINK(this, SwOutlineSettingsTabPage, ToggleComplete));
406  m_xCollBox->connect_changed(LINK(this, SwOutlineSettingsTabPage, CollSelect));
407  m_xNumberBox->connect_changed(LINK(this, SwOutlineSettingsTabPage, NumberSelect));
408  m_xPrefixED->connect_changed(LINK(this, SwOutlineSettingsTabPage, DelimModify));
409  m_xSuffixED->connect_changed(LINK(this, SwOutlineSettingsTabPage, DelimModify));
410  m_xStartEdit->connect_value_changed(LINK(this, SwOutlineSettingsTabPage, StartModified));
411  m_xCharFormatLB->connect_changed(LINK(this, SwOutlineSettingsTabPage, CharFormatHdl));
412 }
413 
415 {
416  // if a template was already selected for this level, select it in the ListBox
417  m_xCollBox->set_sensitive(USHRT_MAX != nActLevel);
418  if(USHRT_MAX == nActLevel)
419  {
420  bool bSamePrefix = true;
421  bool bSameSuffix = true;
422  bool bSameType = true;
423  bool bSameComplete = true;
424  bool bSameStart = true;
425  bool bSameCharFormat = true;
426 
427  const SwNumFormat* aNumFormatArr[MAXLEVEL];
428  const SwCharFormat* pFirstFormat = nullptr;
429 
430  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
431  {
432 
433  aNumFormatArr[ i ] = &pNumRule->Get(i);
434  if(i == 0)
435  pFirstFormat = aNumFormatArr[i]->GetCharFormat();
436  else
437  {
438  bSameType &= aNumFormatArr[i]->GetNumberingType() == aNumFormatArr[0]->GetNumberingType();
439  bSameStart &= aNumFormatArr[i]->GetStart() == aNumFormatArr[0]->GetStart();
440  bSamePrefix &= aNumFormatArr[i]->GetPrefix() == aNumFormatArr[0]->GetPrefix();
441  bSameSuffix &= aNumFormatArr[i]->GetSuffix() == aNumFormatArr[0]->GetSuffix();
442  bSameComplete &= aNumFormatArr[i]->GetIncludeUpperLevels() == aNumFormatArr[0]->GetIncludeUpperLevels();
443  const SwCharFormat* pFormat = aNumFormatArr[i]->GetCharFormat();
444  bSameCharFormat &= (!pFirstFormat && !pFormat)
445  || (pFirstFormat && pFormat && pFormat->GetName() == pFirstFormat->GetName());
446  }
447  }
448  CheckForStartValue_Impl(aNumFormatArr[0]->GetNumberingType());
449  if (bSameType)
450  m_xNumberBox->SelectNumberingType( aNumFormatArr[0]->GetNumberingType() );
451  else
452  m_xNumberBox->SetNoSelection();
453  if(bSameStart)
454  m_xStartEdit->set_value(aNumFormatArr[0]->GetStart());
455  else
456  m_xStartEdit->set_text(OUString());
457  if(bSamePrefix)
458  m_xPrefixED->set_text(aNumFormatArr[0]->GetPrefix());
459  else
460  m_xPrefixED->set_text(OUString());
461  if(bSameSuffix)
462  m_xSuffixED->set_text(aNumFormatArr[0]->GetSuffix());
463  else
464  m_xSuffixED->set_text(OUString());
465 
466  if (bSameCharFormat)
467  {
468  if (pFirstFormat)
469  m_xCharFormatLB->set_active_text(pFirstFormat->GetName());
470  else
471  m_xCharFormatLB->set_active_text(SwViewShell::GetShellRes()->aStrNone);
472  }
473  else
474  m_xCharFormatLB->set_active(-1);
475 
476  m_xAllLevelFT->set_sensitive(true);
477  m_xAllLevelNF->set_sensitive(true);
478  m_xAllLevelNF->set_max(MAXLEVEL);
479  if (bSameComplete)
480  {
481  m_xAllLevelNF->set_value(aNumFormatArr[0]->GetIncludeUpperLevels());
482  }
483  else
484  {
485  m_xAllLevelNF->set_text(OUString());
486  }
487  }
488  else
489  {
490  sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
491  OUString aColl(pCollNames[nTmpLevel]);
492  if(!aColl.isEmpty())
493  m_xCollBox->set_active_text(aColl);
494  else
495  m_xCollBox->set_active_text(aNoFormatName);
496  const SwNumFormat &rFormat = pNumRule->Get(nTmpLevel);
497 
498  m_xNumberBox->SelectNumberingType( rFormat.GetNumberingType() );
499  m_xPrefixED->set_text(rFormat.GetPrefix());
500  m_xSuffixED->set_text(rFormat.GetSuffix());
501  const SwCharFormat* pFormat = rFormat.GetCharFormat();
502  if(pFormat)
503  m_xCharFormatLB->set_active_text(pFormat->GetName());
504  else
505  m_xCharFormatLB->set_active_text(SwViewShell::GetShellRes()->aStrNone);
506 
507  if (nTmpLevel || rFormat.HasListFormat())
508  {
509  m_xAllLevelFT->set_sensitive(true);
510  m_xAllLevelNF->set_sensitive(true);
511  m_xAllLevelNF->set_max(nTmpLevel + 1);
512  m_xAllLevelNF->set_min(rFormat.HasListFormat() ? 0 : 1);
513  m_xAllLevelNF->set_value(rFormat.GetIncludeUpperLevels());
514  }
515  else
516  {
517  m_xAllLevelNF->set_text(OUString());
518  m_xAllLevelNF->set_sensitive(false);
519  m_xAllLevelFT->set_sensitive(false);
520  }
522  m_xStartEdit->set_value( rFormat.GetStart() );
523  }
524  SetModified();
525 }
526 
528 {
529  nActLevel = 0;
530  auto aRows = rBox.get_selected_rows();
531  if (std::find(aRows.begin(), aRows.end(), MAXLEVEL) != aRows.end())
532  {
533  nActLevel = 0xFFFF;
534  }
535  else
536  {
537  sal_uInt16 nMask = 1;
538  for( sal_uInt16 i = 0; i < MAXLEVEL; i++ )
539  {
540  if (std::find(aRows.begin(), aRows.end(), i) != aRows.end())
541  nActLevel |= nMask;
542  nMask <<= 1;
543  }
544  }
545  Update();
546 }
547 
548 IMPL_LINK(SwOutlineSettingsTabPage, ToggleComplete, weld::SpinButton&, rEdit, void)
549 {
550  sal_uInt16 nMask = 1;
551  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
552  {
553  if(nActLevel & nMask)
554  {
555  SwNumFormat aNumFormat(pNumRule->Get(i));
556  aNumFormat.SetIncludeUpperLevels( std::min( static_cast<sal_uInt8>(rEdit.get_value()),
557  static_cast<sal_uInt8>(i + 1)) );
558  if (aNumFormat.HasListFormat())
559  {
560  aNumFormat.SetListFormat(); // clear custom format
561  m_xAllLevelNF->set_min(1);
562  }
563  pNumRule->Set(i, aNumFormat);
564  }
565  nMask <<= 1;
566  }
567  SetModified();
568 }
569 
571 {
572  sal_uInt8 i;
573 
574  const OUString aCollName(rBox.get_active_text());
575  //0xFFFF not allowed here (disable)
576  sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
577  OUString sOldName( pCollNames[nTmpLevel] );
578 
579  for( i = 0; i < MAXLEVEL; ++i)
580  pCollNames[i] = aSaveCollNames[i];
581 
582  if(aCollName == aNoFormatName)
583  pCollNames[nTmpLevel].clear();
584  else
585  {
586  pCollNames[nTmpLevel] = aCollName;
587  // template already in use?
588  for( i = 0; i < MAXLEVEL; ++i)
589  if(i != nTmpLevel && pCollNames[i] == aCollName )
590  pCollNames[i].clear();
591  }
592 
593  // search the oldname and put it into the current entries
594  if( !sOldName.isEmpty() )
595  for( i = 0; i < MAXLEVEL; ++i)
596  if( aSaveCollNames[ i ] == sOldName && i != nTmpLevel &&
597  pCollNames[ i ].isEmpty() )
598  {
599  sal_uInt8 n;
600  for( n = 0; n < MAXLEVEL; ++n )
601  if( pCollNames[ n ] == sOldName )
602  break;
603 
604  if( MAXLEVEL == n )
605  // it was an outline level name and the current entries is zero.
606  pCollNames[ i ] = sOldName;
607  }
608 
609  SetModified();
610  CollSave();
611 }
612 
614 {
615  for (sal_uInt8 i = 0; i < MAXLEVEL; ++i)
616  aSaveCollNames[i] = pCollNames[i];
617 }
618 
620 {
621  sal_uInt16 nMask = 1;
622  SvxNumType nNumberType = m_xNumberBox->GetSelectedNumberingType();
623  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
624  {
625  if(nActLevel & nMask)
626  {
627  SwNumFormat aNumFormat(pNumRule->Get(i));
628  aNumFormat.SetNumberingType(nNumberType);
629  pNumRule->Set(i, aNumFormat);
630  CheckForStartValue_Impl(nNumberType);
631  }
632  nMask <<= 1;
633  }
634  SetModified();
635 }
636 
638 {
639  sal_uInt16 nMask = 1;
640  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
641  {
642  if(nActLevel & nMask)
643  {
644  SwNumFormat aNumFormat(pNumRule->Get(i));
645  aNumFormat.SetListFormat( m_xPrefixED->get_text(), m_xSuffixED->get_text(), i );
646  pNumRule->Set(i, aNumFormat);
647  }
648  nMask <<= 1;
649  }
650  SetModified();
651 }
652 
653 IMPL_LINK( SwOutlineSettingsTabPage, StartModified, weld::SpinButton&, rEdit, void )
654 {
655  sal_uInt16 nMask = 1;
656  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
657  {
658  if(nActLevel & nMask)
659  {
660  SwNumFormat aNumFormat(pNumRule->Get(i));
661  aNumFormat.SetStart(o3tl::narrowing<sal_uInt16>(rEdit.get_value()));
662  pNumRule->Set(i, aNumFormat);
663  }
664  nMask <<= 1;
665  }
666  SetModified();
667 }
668 
670 {
671  OUString sEntry = m_xCharFormatLB->get_active_text();
672  sal_uInt16 nMask = 1;
673  bool bFormatNone = sEntry == SwViewShell::GetShellRes()->aStrNone;
674  SwCharFormat* pFormat = nullptr;
675  if(!bFormatNone)
676  {
677  sal_uInt16 nChCount = pSh->GetCharFormatCount();
678  for(sal_uInt16 i = 0; i < nChCount; i++)
679  {
680  SwCharFormat& rChFormat = pSh->GetCharFormat(i);
681  if(rChFormat.GetName() == sEntry)
682  {
683  pFormat = &rChFormat;
684  break;
685  }
686  }
687  if(!pFormat)
688  {
689  SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
690  SfxStyleSheetBase* pBase;
691  pBase = pPool->Find(sEntry, SfxStyleFamily::Char);
692  if(!pBase)
693  pBase = &pPool->Make(sEntry, SfxStyleFamily::Page);
694  pFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
695 
696  }
697  }
698 
699  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
700  {
701  if(nActLevel & nMask)
702  {
703  SwNumFormat aNumFormat(pNumRule->Get(i));
704  if(bFormatNone)
705  aNumFormat.SetCharFormat(nullptr);
706  else
707  aNumFormat.SetCharFormat(pFormat);
708  pNumRule->Set(i, aNumFormat);
709  }
710  nMask <<= 1;
711  }
712 }
713 
715 {
716 }
717 
719 {
720  pSh = pShell;
721  // query this document's NumRules
723  pCollNames = static_cast<SwOutlineTabDialog*>(GetDialogController())->GetCollNames();
724 
725  CollSave();
726 
729  // set start value - nActLevel must be 1 here
730  sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
731  const SwNumFormat& rNumFormat = pNumRule->Get( nTmpLevel );
732  m_xStartEdit->set_value( rNumFormat.GetStart() );
733 
734  // create pool formats for headlines
735  for (sal_uInt16 i = 0; i < MAXLEVEL; ++i)
736  {
738  static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), OUString()));
739  m_xLevelLB->append_text( OUString::number(i + 1) );
740  }
741  OUString sStr = "1 - " + OUString::number(MAXLEVEL);
742  m_xLevelLB->append_text(sStr);
743 
744  // query the texttemplates' outlining levels
745  const sal_uInt16 nCount = pSh->GetTextFormatCollCount();
746  for (sal_uInt16 i = 0; i < nCount; ++i)
747  {
748  SwTextFormatColl &rTextColl = pSh->GetTextFormatColl(i);
749  if(!rTextColl.IsDefault())
750  {
751  sStr = rTextColl.GetName();
752  if (m_xCollBox->find_text(sStr) == -1)
753  m_xCollBox->append_text(sStr);
754  }
755  }
756 
757  m_xNumberBox->SelectNumberingType(rNumFormat.GetNumberingType());
758  SwOutlineNodes::size_type nOutlinePos = pSh->GetOutlinePos(MAXLEVEL);
759  int nTmp = 0;
760  if(nOutlinePos != SwOutlineNodes::npos)
761  {
762  nTmp = o3tl::narrowing<sal_uInt16>(pSh->getIDocumentOutlineNodesAccess()->getOutlineLevel(nOutlinePos));
763  }
764  m_xLevelLB->select(nTmp-1);
765 
766  // collect char styles
767  m_xCharFormatLB->clear();
768  m_xCharFormatLB->append_text(SwViewShell::GetShellRes()->aStrNone);
769 
770  // char styles
772  pSh->GetView().GetDocShell());
773  Update();
774 }
775 
777 {
779  if(nActLevel != USHRT_MAX)
781  else
782  m_xLevelLB->select(MAXLEVEL);
783  LevelHdl(*m_xLevelLB);
784 }
785 
787 {
789  return DeactivateRC::LeavePage;
790 }
791 
793 {
794  return true;
795 }
796 
798 {
799  ActivatePage(*rSet);
800 }
801 
802 std::unique_ptr<SfxTabPage> SwOutlineSettingsTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
803  const SfxItemSet* rAttrSet)
804 {
805  return std::make_unique<SwOutlineSettingsTabPage>(pPage, pController, *rAttrSet);
806 }
807 
809 {
810  bool bIsNull = m_xStartEdit->get_value() == 0;
811  bool bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC ||
812  SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType ||
813  SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType;
814  m_xStartEdit->set_min(bNoZeroAllowed ? 1 : 0);
815  if (bIsNull && bNoZeroAllowed)
816  StartModified(*m_xStartEdit);
817 }
818 
819 static tools::Long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, tools::Long nXStart, tools::Long nYStart, const Size& rSize)
820 {
821  vcl::Font aTmpFont(pVDev->GetFont());
822 
823  // via Uno it's possible that no font has been set!
824  vcl::Font aFont(rFormat.GetBulletFont() ? *rFormat.GetBulletFont() : aTmpFont);
825  Size aTmpSize(rSize);
826  aTmpSize.setWidth( aTmpSize.Width() * ( rFormat.GetBulletRelSize()) );
827  aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
828  aTmpSize.setHeight( aTmpSize.Height() * ( rFormat.GetBulletRelSize()) );
829  aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
830  // in case of a height of zero it is drawn in original height
831  if(!aTmpSize.Height())
832  aTmpSize.setHeight( 1 );
833  aFont.SetFontSize(aTmpSize);
834  aFont.SetTransparent(true);
835  Color aBulletColor = rFormat.GetBulletColor();
836  if(aBulletColor == COL_AUTO)
837  aBulletColor = pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK;
838  else if(aBulletColor == pVDev->GetFillColor())
839  aBulletColor.Invert();
840  aFont.SetColor(aBulletColor);
841  pVDev->SetFont( aFont );
842  sal_UCS4 cBullet = rFormat.GetBulletChar();
843  OUString aText(&cBullet, 1);
844  tools::Long nY = nYStart;
845  nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
846  pVDev->DrawText( Point(nXStart, nY), aText );
847  tools::Long nRet = pVDev->GetTextWidth(aText);
848 
849  pVDev->SetFont(aTmpFont);
850  return nRet;
851 }
852 
853 static tools::Long lcl_DrawGraphic(vcl::RenderContext& rVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
854 {
855  const SvxBrushItem* pBrushItem = rFormat.GetBrush();
856  tools::Long nRet = 0;
857  if (pBrushItem)
858  {
859  const Graphic* pGraphic = pBrushItem->GetGraphic();
860  if (pGraphic)
861  {
862  Size aGSize( rFormat.GetGraphicSize());
863  aGSize.setWidth( aGSize.Width() / nDivision );
864  nRet = aGSize.Width();
865  aGSize.setHeight( aGSize.Height() / nDivision );
866  pGraphic->Draw(rVDev, Point(nXStart, nYStart), rVDev.PixelToLogic(aGSize));
867  }
868  }
869  return nRet;
870 }
871 
873 {
874  const Size aSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
875 
876  ScopedVclPtrInstance<VirtualDevice> pVDev(rRenderContext);
877  pVDev->SetMapMode(rRenderContext.GetMapMode());
878  pVDev->SetOutputSize(aSize);
879 
880  // #101524# OJ
881  pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor());
882  pVDev->SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetButtonTextColor());
883  pVDev->DrawRect(tools::Rectangle(Point(0,0), aSize));
884 
885  if (pActNum)
886  {
887  tools::Long nWidthRelation = 30; // chapter dialog
888  if(nPageWidth)
889  {
890  nWidthRelation = nPageWidth / aSize.Width();
891  if(bPosition)
892  nWidthRelation = nWidthRelation * 2 / 3;
893  else
894  nWidthRelation = nWidthRelation / 4;
895  }
896 
897  // height per level
898  const tools::Long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1));
899  const tools::Long nYStep = (aSize.Height() - 6)/ MAXLEVEL;
900  tools::Long nYStart = 4;
901  aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, GetAppLanguage(),
902  GetDefaultFontFlags::OnlyOne, &rRenderContext);
903  // #101524# OJ
905 
906  const tools::Long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10;
907  aStdFont.SetFontSize(Size( 0, nFontHeight ));
908 
909  tools::Long nPreNum = pActNum->Get(0).GetStart();
910 
911  if (bPosition)
912  {
913  const tools::Long nLineHeight = nFontHeight * 8 / 7;
914  sal_uInt8 nStart = 0;
915  while (!(nActLevel & (1 << nStart)))
916  {
917  nStart++;
918  }
919  if(nStart) // so that possible predecessors and successors are showed
920  nStart--;
921 
922  SwNumberTree::tNumberVector aNumVector;
923  sal_uInt8 nEnd = std::min(sal_uInt8(nStart + 3), MAXLEVEL);
924  for (sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel)
925  {
926  const SwNumFormat &rFormat = pActNum->Get(nLevel);
927  aNumVector.push_back(rFormat.GetStart());
928 
929  tools::Long nXStart( 0 );
930  tools::Long nTextOffset( 0 );
931  tools::Long nNumberXPos( 0 );
933  {
934  nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
935  nTextOffset = rFormat.GetCharTextDistance() / nWidthRelation;
936  nNumberXPos = nXStart;
937  const tools::Long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation;
938 
939  if(nFirstLineOffset <= nNumberXPos)
940  nNumberXPos -= nFirstLineOffset;
941  else
942  nNumberXPos = 0;
943  }
945  {
946  const tools::Long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation);
947  nNumberXPos = (nTmpNumberXPos < 0) ? 0 : nTmpNumberXPos;
948  }
949 
950  tools::Long nBulletWidth = 0;
951  if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
952  {
953  nBulletWidth = lcl_DrawGraphic(*pVDev, rFormat, nNumberXPos,
954  nYStart, nWidthRelation);
955  }
956  else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
957  {
958  nBulletWidth = lcl_DrawBullet(pVDev.get(), rFormat, nNumberXPos,
959  nYStart, aStdFont.GetFontSize());
960  }
961  else
962  {
963  pVDev->SetFont(aStdFont);
964  if(pActNum->IsContinusNum())
965  aNumVector[nLevel] = nPreNum;
966  OUString aText(pActNum->MakeNumString( aNumVector ));
967  pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
968  nBulletWidth = pVDev->GetTextWidth(aText);
969  nPreNum++;
970  }
973  {
974  pVDev->SetFont(aStdFont);
975  OUString aText(' ');
976  pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
977  nBulletWidth += pVDev->GetTextWidth(aText);
978  }
979 
980  tools::Long nTextXPos(0);
982  {
983  nTextXPos = nXStart;
984  if (nTextOffset < 0)
985  nTextXPos = nTextXPos + nTextOffset;
986  if (nNumberXPos + nBulletWidth + nTextOffset > nTextXPos)
987  nTextXPos = nNumberXPos + nBulletWidth + nTextOffset;
988  }
990  {
991  switch (rFormat.GetLabelFollowedBy())
992  {
994  {
995  nTextXPos = rFormat.GetListtabPos() / nWidthRelation;
996  if (nTextXPos < nNumberXPos + nBulletWidth)
997  {
998  nTextXPos = nNumberXPos + nBulletWidth;
999  }
1000  }
1001  break;
1005  {
1006  nTextXPos = nNumberXPos + nBulletWidth;
1007  }
1008  break;
1009  }
1010 
1011  nXStart = rFormat.GetIndentAt() / nWidthRelation;
1012  }
1013 
1014  tools::Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1015  pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor()); // COL_BLACK );
1016  pVDev->DrawRect(aRect1);
1017 
1018  tools::Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1019  pVDev->DrawRect(aRect2);
1020  nYStart += 2 * nLineHeight;
1021  }
1022  }
1023  else
1024  {
1025  SwNumberTree::tNumberVector aNumVector;
1026  const tools::Long nLineHeight = nFontHeight * 3 / 2;
1027  for (sal_uInt8 nLevel = 0; nLevel < MAXLEVEL; ++nLevel, nYStart = nYStart + nYStep)
1028  {
1029  const SwNumFormat &rFormat = pActNum->Get(nLevel);
1030  aNumVector.push_back(rFormat.GetStart());
1031  tools::Long nXStart(0);
1033  {
1034  nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
1035  }
1037  {
1038  const tools::Long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation);
1039  nXStart = (nTmpXStart < 0) ? 0 : nTmpXStart;
1040  }
1041  nXStart /= 2;
1042  nXStart += 2;
1043  tools::Long nTextOffset;
1044  if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
1045  {
1046  lcl_DrawGraphic(*pVDev, rFormat, nXStart, nYStart, nWidthRelation);
1047  nTextOffset = nLineHeight + nXStep;
1048  }
1049  else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
1050  {
1051  nTextOffset = lcl_DrawBullet(pVDev.get(), rFormat, nXStart, nYStart, aStdFont.GetFontSize());
1052  nTextOffset += nXStep;
1053  }
1054  else
1055  {
1056  pVDev->SetFont(aStdFont);
1057  if (pActNum->IsContinusNum())
1058  aNumVector[nLevel] = nPreNum;
1059  OUString aText(pActNum->MakeNumString( aNumVector ));
1060  pVDev->DrawText( Point(nXStart, nYStart), aText );
1061  nTextOffset = pVDev->GetTextWidth(aText) + nXStep;
1062  nPreNum++;
1063  }
1064  pVDev->SetFont(aStdFont);
1065  pVDev->DrawText(
1066  Point(nXStart + nTextOffset, nYStart),
1067  (pOutlineNames == nullptr
1069  : pOutlineNames[nLevel]));
1070  }
1071  }
1072  }
1073  rRenderContext.DrawOutDev(Point(0,0), aSize, Point(0,0), aSize, *pVDev);
1074 }
1075 
1076 /* 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
void SetFontSize(const Size &)
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:613
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
virtual void Reset(const SfxItemSet *rSet) override
Definition: outline.cxx:797
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:853
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:802
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:628
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:791
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:808
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
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
sal_Int64 n
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:93
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:343
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
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
virtual short Ok()
SwTextFormatColl & GetTextFormatColl(sal_uInt16 nTextFormatColl) const
Definition: edfcol.cxx:697
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:120
const SwView & GetView() const
Definition: wrtsh.hxx:431
const SwNumRule * pActNum
Definition: numprevw.hxx:30
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
virtual void Reset(const SfxItemSet *)
short GetCharTextDistance() const
SwOutlineSettingsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: outline.cxx:380
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:288
#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
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
static OUString getProductName()
LabelFollowedBy GetLabelFollowedBy() const
sal_Int32 GetAbsLSpace() const
bool IsDark() const
virtual short Ok() override
Definition: outline.cxx:298
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
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:647
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
Represents the style of a text portion.
Definition: charfmt.hxx:26
SVX_NUM_CHARS_LOWER_LETTER_N
SwDocShell * GetDocShell()
Definition: view.cxx:1127
void SetColor(const Color &)
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:620
std::vector< tSwNumTreeNumber > tNumberVector
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void StartAction()
Definition: crsrsh.cxx:227
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:714
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:776
void SetFont(const vcl::Font &rNewFont)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: outline.cxx:786
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
OUString aName
static Color & GetFontColor()
Definition: viewopt.cxx:456
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: edfmt.cxx:154
void SetOutlineNumRule(const SwNumRule &)
Definition: ednumber.cxx:115
LanguageType GetAppLanguage()
Definition: init.cxx:723
RET_OK
void ResetNumRule(SwWrtShell &rSh, SwNumRule &) const
Definition: uinums.cxx:146
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
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:380
void SetStart(sal_uInt16 nSet)
DeactivateRC
void SetWrtShell(SwWrtShell *pShell)
Definition: outline.cxx:718
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:792
void SetNumberingType(SvxNumType nSet)
std::vector< SwNode * >::size_type size_type
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:872
OUString aSaveCollNames[MAXLEVEL]
Definition: outline.hxx:69
std::unique_ptr< weld::ComboBox > m_xCollBox
Definition: outline.hxx:77
void SetListFormat(const OUString &rPrefix, const OUString &rSuffix, int nLevel)
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:244
static tools::Long lcl_DrawBullet(vcl::RenderContext *pVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, const Size &rSize)
Definition: outline.cxx:819
std::unique_ptr< weld::Label > m_xAllLevelFT
Definition: outline.hxx:80
const std::optional< vcl::Font > & GetBulletFont() const
static sal_uInt16 GetActNumLevel()
Definition: outline.hxx:62