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  // Set the same prefix/suffix to generate list format with changed IncludedUpperLevels
559  aNumFormat.SetListFormat(aNumFormat.GetPrefix(), aNumFormat.GetSuffix(), i);
560  pNumRule->Set(i, aNumFormat);
561  }
562  nMask <<= 1;
563  }
564  SetModified();
565 }
566 
568 {
569  sal_uInt8 i;
570 
571  const OUString aCollName(rBox.get_active_text());
572  //0xFFFF not allowed here (disable)
573  sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
574  OUString sOldName( pCollNames[nTmpLevel] );
575 
576  for( i = 0; i < MAXLEVEL; ++i)
577  pCollNames[i] = aSaveCollNames[i];
578 
579  if(aCollName == aNoFormatName)
580  pCollNames[nTmpLevel].clear();
581  else
582  {
583  pCollNames[nTmpLevel] = aCollName;
584  // template already in use?
585  for( i = 0; i < MAXLEVEL; ++i)
586  if(i != nTmpLevel && pCollNames[i] == aCollName )
587  pCollNames[i].clear();
588  }
589 
590  // search the oldname and put it into the current entries
591  if( !sOldName.isEmpty() )
592  for( i = 0; i < MAXLEVEL; ++i)
593  if( aSaveCollNames[ i ] == sOldName && i != nTmpLevel &&
594  pCollNames[ i ].isEmpty() )
595  {
596  sal_uInt8 n;
597  for( n = 0; n < MAXLEVEL; ++n )
598  if( pCollNames[ n ] == sOldName )
599  break;
600 
601  if( MAXLEVEL == n )
602  // it was an outline level name and the current entries is zero.
603  pCollNames[ i ] = sOldName;
604  }
605 
606  SetModified();
607  CollSave();
608 }
609 
611 {
612  for (sal_uInt8 i = 0; i < MAXLEVEL; ++i)
613  aSaveCollNames[i] = pCollNames[i];
614 }
615 
617 {
618  sal_uInt16 nMask = 1;
619  SvxNumType nNumberType = m_xNumberBox->GetSelectedNumberingType();
620  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
621  {
622  if(nActLevel & nMask)
623  {
624  SwNumFormat aNumFormat(pNumRule->Get(i));
625  aNumFormat.SetNumberingType(nNumberType);
626  pNumRule->Set(i, aNumFormat);
627  CheckForStartValue_Impl(nNumberType);
628  }
629  nMask <<= 1;
630  }
631  SetModified();
632 }
633 
635 {
636  sal_uInt16 nMask = 1;
637  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
638  {
639  if(nActLevel & nMask)
640  {
641  SwNumFormat aNumFormat(pNumRule->Get(i));
642  aNumFormat.SetListFormat( m_xPrefixED->get_text(), m_xSuffixED->get_text(), i );
643  pNumRule->Set(i, aNumFormat);
644  }
645  nMask <<= 1;
646  }
647  SetModified();
648 }
649 
650 IMPL_LINK( SwOutlineSettingsTabPage, StartModified, weld::SpinButton&, rEdit, void )
651 {
652  sal_uInt16 nMask = 1;
653  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
654  {
655  if(nActLevel & nMask)
656  {
657  SwNumFormat aNumFormat(pNumRule->Get(i));
658  aNumFormat.SetStart(o3tl::narrowing<sal_uInt16>(rEdit.get_value()));
659  pNumRule->Set(i, aNumFormat);
660  }
661  nMask <<= 1;
662  }
663  SetModified();
664 }
665 
667 {
668  OUString sEntry = m_xCharFormatLB->get_active_text();
669  sal_uInt16 nMask = 1;
670  bool bFormatNone = sEntry == SwViewShell::GetShellRes()->aStrNone;
671  SwCharFormat* pFormat = nullptr;
672  if(!bFormatNone)
673  {
674  sal_uInt16 nChCount = pSh->GetCharFormatCount();
675  for(sal_uInt16 i = 0; i < nChCount; i++)
676  {
677  SwCharFormat& rChFormat = pSh->GetCharFormat(i);
678  if(rChFormat.GetName() == sEntry)
679  {
680  pFormat = &rChFormat;
681  break;
682  }
683  }
684  if(!pFormat)
685  {
686  SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
687  SfxStyleSheetBase* pBase;
688  pBase = pPool->Find(sEntry, SfxStyleFamily::Char);
689  if(!pBase)
690  pBase = &pPool->Make(sEntry, SfxStyleFamily::Page);
691  pFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
692 
693  }
694  }
695 
696  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
697  {
698  if(nActLevel & nMask)
699  {
700  SwNumFormat aNumFormat(pNumRule->Get(i));
701  if(bFormatNone)
702  aNumFormat.SetCharFormat(nullptr);
703  else
704  aNumFormat.SetCharFormat(pFormat);
705  pNumRule->Set(i, aNumFormat);
706  }
707  nMask <<= 1;
708  }
709 }
710 
712 {
713 }
714 
716 {
717  pSh = pShell;
718  // query this document's NumRules
720  pCollNames = static_cast<SwOutlineTabDialog*>(GetDialogController())->GetCollNames();
721 
722  CollSave();
723 
726  // set start value - nActLevel must be 1 here
727  sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
728  const SwNumFormat& rNumFormat = pNumRule->Get( nTmpLevel );
729  m_xStartEdit->set_value( rNumFormat.GetStart() );
730 
731  // create pool formats for headlines
732  for (sal_uInt16 i = 0; i < MAXLEVEL; ++i)
733  {
735  static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), OUString()));
736  m_xLevelLB->append_text( OUString::number(i + 1) );
737  }
738  OUString sStr = "1 - " + OUString::number(MAXLEVEL);
739  m_xLevelLB->append_text(sStr);
740 
741  // query the texttemplates' outlining levels
742  const sal_uInt16 nCount = pSh->GetTextFormatCollCount();
743  for (sal_uInt16 i = 0; i < nCount; ++i)
744  {
745  SwTextFormatColl &rTextColl = pSh->GetTextFormatColl(i);
746  if(!rTextColl.IsDefault())
747  {
748  sStr = rTextColl.GetName();
749  if (m_xCollBox->find_text(sStr) == -1)
750  m_xCollBox->append_text(sStr);
751  }
752  }
753 
754  m_xNumberBox->SelectNumberingType(rNumFormat.GetNumberingType());
755  SwOutlineNodes::size_type nOutlinePos = pSh->GetOutlinePos(MAXLEVEL);
756  int nTmp = 0;
757  if(nOutlinePos != SwOutlineNodes::npos)
758  {
759  nTmp = o3tl::narrowing<sal_uInt16>(pSh->getIDocumentOutlineNodesAccess()->getOutlineLevel(nOutlinePos));
760  }
761  m_xLevelLB->select(nTmp-1);
762 
763  // collect char styles
764  m_xCharFormatLB->clear();
765  m_xCharFormatLB->append_text(SwViewShell::GetShellRes()->aStrNone);
766 
767  // char styles
769  pSh->GetView().GetDocShell());
770  Update();
771 }
772 
774 {
776  if(nActLevel != USHRT_MAX)
778  else
779  m_xLevelLB->select(MAXLEVEL);
780  LevelHdl(*m_xLevelLB);
781 }
782 
784 {
786  return DeactivateRC::LeavePage;
787 }
788 
790 {
791  return true;
792 }
793 
795 {
796  ActivatePage(*rSet);
797 }
798 
799 std::unique_ptr<SfxTabPage> SwOutlineSettingsTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
800  const SfxItemSet* rAttrSet)
801 {
802  return std::make_unique<SwOutlineSettingsTabPage>(pPage, pController, *rAttrSet);
803 }
804 
806 {
807  bool bIsNull = m_xStartEdit->get_value() == 0;
808  bool bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC ||
809  SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType ||
810  SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType;
811  m_xStartEdit->set_min(bNoZeroAllowed ? 1 : 0);
812  if (bIsNull && bNoZeroAllowed)
813  StartModified(*m_xStartEdit);
814 }
815 
816 static tools::Long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, tools::Long nXStart, tools::Long nYStart, const Size& rSize)
817 {
818  vcl::Font aTmpFont(pVDev->GetFont());
819 
820  // via Uno it's possible that no font has been set!
821  vcl::Font aFont(rFormat.GetBulletFont() ? *rFormat.GetBulletFont() : aTmpFont);
822  Size aTmpSize(rSize);
823  aTmpSize.setWidth( aTmpSize.Width() * ( rFormat.GetBulletRelSize()) );
824  aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
825  aTmpSize.setHeight( aTmpSize.Height() * ( rFormat.GetBulletRelSize()) );
826  aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
827  // in case of a height of zero it is drawn in original height
828  if(!aTmpSize.Height())
829  aTmpSize.setHeight( 1 );
830  aFont.SetFontSize(aTmpSize);
831  aFont.SetTransparent(true);
832  Color aBulletColor = rFormat.GetBulletColor();
833  if(aBulletColor == COL_AUTO)
834  aBulletColor = pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK;
835  else if(aBulletColor == pVDev->GetFillColor())
836  aBulletColor.Invert();
837  aFont.SetColor(aBulletColor);
838  pVDev->SetFont( aFont );
839  sal_UCS4 cBullet = rFormat.GetBulletChar();
840  OUString aText(&cBullet, 1);
841  tools::Long nY = nYStart;
842  nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
843  pVDev->DrawText( Point(nXStart, nY), aText );
844  tools::Long nRet = pVDev->GetTextWidth(aText);
845 
846  pVDev->SetFont(aTmpFont);
847  return nRet;
848 }
849 
850 static tools::Long lcl_DrawGraphic(vcl::RenderContext& rVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
851 {
852  const SvxBrushItem* pBrushItem = rFormat.GetBrush();
853  tools::Long nRet = 0;
854  if (pBrushItem)
855  {
856  const Graphic* pGraphic = pBrushItem->GetGraphic();
857  if (pGraphic)
858  {
859  Size aGSize( rFormat.GetGraphicSize());
860  aGSize.setWidth( aGSize.Width() / nDivision );
861  nRet = aGSize.Width();
862  aGSize.setHeight( aGSize.Height() / nDivision );
863  pGraphic->Draw(rVDev, Point(nXStart, nYStart), rVDev.PixelToLogic(aGSize));
864  }
865  }
866  return nRet;
867 }
868 
870 {
871  const Size aSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
872 
873  ScopedVclPtrInstance<VirtualDevice> pVDev(rRenderContext);
874  pVDev->SetMapMode(rRenderContext.GetMapMode());
875  pVDev->SetOutputSize(aSize);
876 
877  // #101524# OJ
878  pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor());
879  pVDev->SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetButtonTextColor());
880  pVDev->DrawRect(tools::Rectangle(Point(0,0), aSize));
881 
882  if (pActNum)
883  {
884  tools::Long nWidthRelation = 30; // chapter dialog
885  if(nPageWidth)
886  {
887  nWidthRelation = nPageWidth / aSize.Width();
888  if(bPosition)
889  nWidthRelation = nWidthRelation * 2 / 3;
890  else
891  nWidthRelation = nWidthRelation / 4;
892  }
893 
894  // height per level
895  const tools::Long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1));
896  const tools::Long nYStep = (aSize.Height() - 6)/ MAXLEVEL;
897  tools::Long nYStart = 4;
898  aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, GetAppLanguage(),
899  GetDefaultFontFlags::OnlyOne, &rRenderContext);
900  // #101524# OJ
902 
903  const tools::Long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10;
904  aStdFont.SetFontSize(Size( 0, nFontHeight ));
905 
906  tools::Long nPreNum = pActNum->Get(0).GetStart();
907 
908  if (bPosition)
909  {
910  const tools::Long nLineHeight = nFontHeight * 8 / 7;
911  sal_uInt8 nStart = 0;
912  while (!(nActLevel & (1 << nStart)))
913  {
914  nStart++;
915  }
916  if(nStart) // so that possible predecessors and successors are showed
917  nStart--;
918 
919  SwNumberTree::tNumberVector aNumVector;
920  sal_uInt8 nEnd = std::min(sal_uInt8(nStart + 3), MAXLEVEL);
921  for (sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel)
922  {
923  const SwNumFormat &rFormat = pActNum->Get(nLevel);
924  aNumVector.push_back(rFormat.GetStart());
925 
926  tools::Long nXStart( 0 );
927  tools::Long nTextOffset( 0 );
928  tools::Long nNumberXPos( 0 );
930  {
931  nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
932  nTextOffset = rFormat.GetCharTextDistance() / nWidthRelation;
933  nNumberXPos = nXStart;
934  const tools::Long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation;
935 
936  if(nFirstLineOffset <= nNumberXPos)
937  nNumberXPos -= nFirstLineOffset;
938  else
939  nNumberXPos = 0;
940  }
942  {
943  const tools::Long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation);
944  nNumberXPos = (nTmpNumberXPos < 0) ? 0 : nTmpNumberXPos;
945  }
946 
947  tools::Long nBulletWidth = 0;
948  if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
949  {
950  nBulletWidth = lcl_DrawGraphic(*pVDev, rFormat, nNumberXPos,
951  nYStart, nWidthRelation);
952  }
953  else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
954  {
955  nBulletWidth = lcl_DrawBullet(pVDev.get(), rFormat, nNumberXPos,
956  nYStart, aStdFont.GetFontSize());
957  }
958  else
959  {
960  pVDev->SetFont(aStdFont);
961  if(pActNum->IsContinusNum())
962  aNumVector[nLevel] = nPreNum;
963  OUString aText(pActNum->MakeNumString( aNumVector ));
964  pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
965  nBulletWidth = pVDev->GetTextWidth(aText);
966  nPreNum++;
967  }
970  {
971  pVDev->SetFont(aStdFont);
972  OUString aText(' ');
973  pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
974  nBulletWidth += pVDev->GetTextWidth(aText);
975  }
976 
977  tools::Long nTextXPos(0);
979  {
980  nTextXPos = nXStart;
981  if (nTextOffset < 0)
982  nTextXPos = nTextXPos + nTextOffset;
983  if (nNumberXPos + nBulletWidth + nTextOffset > nTextXPos)
984  nTextXPos = nNumberXPos + nBulletWidth + nTextOffset;
985  }
987  {
988  switch (rFormat.GetLabelFollowedBy())
989  {
991  {
992  nTextXPos = rFormat.GetListtabPos() / nWidthRelation;
993  if (nTextXPos < nNumberXPos + nBulletWidth)
994  {
995  nTextXPos = nNumberXPos + nBulletWidth;
996  }
997  }
998  break;
1002  {
1003  nTextXPos = nNumberXPos + nBulletWidth;
1004  }
1005  break;
1006  }
1007 
1008  nXStart = rFormat.GetIndentAt() / nWidthRelation;
1009  }
1010 
1011  tools::Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1012  pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor()); // COL_BLACK );
1013  pVDev->DrawRect(aRect1);
1014 
1015  tools::Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1016  pVDev->DrawRect(aRect2);
1017  nYStart += 2 * nLineHeight;
1018  }
1019  }
1020  else
1021  {
1022  SwNumberTree::tNumberVector aNumVector;
1023  const tools::Long nLineHeight = nFontHeight * 3 / 2;
1024  for (sal_uInt8 nLevel = 0; nLevel < MAXLEVEL; ++nLevel, nYStart = nYStart + nYStep)
1025  {
1026  const SwNumFormat &rFormat = pActNum->Get(nLevel);
1027  aNumVector.push_back(rFormat.GetStart());
1028  tools::Long nXStart(0);
1030  {
1031  nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
1032  }
1034  {
1035  const tools::Long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation);
1036  nXStart = (nTmpXStart < 0) ? 0 : nTmpXStart;
1037  }
1038  nXStart /= 2;
1039  nXStart += 2;
1040  tools::Long nTextOffset;
1041  if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
1042  {
1043  lcl_DrawGraphic(*pVDev, rFormat, nXStart, nYStart, nWidthRelation);
1044  nTextOffset = nLineHeight + nXStep;
1045  }
1046  else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
1047  {
1048  nTextOffset = lcl_DrawBullet(pVDev.get(), rFormat, nXStart, nYStart, aStdFont.GetFontSize());
1049  nTextOffset += nXStep;
1050  }
1051  else
1052  {
1053  pVDev->SetFont(aStdFont);
1054  if (pActNum->IsContinusNum())
1055  aNumVector[nLevel] = nPreNum;
1056  OUString aText(pActNum->MakeNumString( aNumVector ));
1057  pVDev->DrawText( Point(nXStart, nYStart), aText );
1058  nTextOffset = pVDev->GetTextWidth(aText) + nXStep;
1059  nPreNum++;
1060  }
1061  pVDev->SetFont(aStdFont);
1062  pVDev->DrawText(
1063  Point(nXStart + nTextOffset, nYStart),
1064  (pOutlineNames == nullptr
1066  : pOutlineNames[nLevel]));
1067  }
1068  }
1069  }
1070  rRenderContext.DrawOutDev(Point(0,0), aSize, Point(0,0), aSize, *pVDev);
1071 }
1072 
1073 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxNumType GetNumberingType() const
IMPL_LINK_NOARG(SwNumNamesDlg, DoubleClickHdl, weld::TreeView &, bool)
Definition: outline.cxx:106
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
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:794
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
Definition: edfmt.cxx:122
static tools::Long lcl_DrawGraphic(vcl::RenderContext &rVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
Definition: outline.cxx:850
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:799
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:642
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2652
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:789
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
sal_uInt16 GetBulletRelSize() const
sal_uInt16 GetTextFormatCollCount() const
Definition: edfcol.cxx:694
const SvxBrushItem * GetBrush() const
const IDocumentOutlineNodes * getIDocumentOutlineNodesAccess() const
Definition: viewsh.cxx:2794
weld::Button & GetCancelButton() const
long Long
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
void CheckForStartValue_Impl(sal_uInt16 nNumberingType)
Definition: outline.cxx:805
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:699
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:120
const SwView & GetView() const
Definition: wrtsh.hxx:431
virtual const SfxItemSet * GetOutputItemSet() const override
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
virtual OUString GetName() const override
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:80
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:1159
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:1132
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:226
const OUString & GetName() const
Definition: uinums.hxx:74
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:86
virtual ~SwOutlineSettingsTabPage() override
Definition: outline.cxx:711
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:280
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:773
void SetFont(const vcl::Font &rNewFont)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: outline.cxx:783
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
OUString aName
static Color & GetFontColor()
Definition: viewopt.cxx:459
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: edfmt.cxx:153
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:715
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:789
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:869
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:1650
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:816
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