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/menu.hxx>
22 #include <vcl/settings.hxx>
23 #include <vcl/virdev.hxx>
24 #include <sfx2/tabdlg.hxx>
25 #include <editeng/brushitem.hxx>
26 #include <unotools/configmgr.hxx>
27 #include <SwStyleNameMapper.hxx>
28 #include <num.hxx>
29 #include <view.hxx>
30 #include <docsh.hxx>
31 #include <uitool.hxx>
32 #include <wrtsh.hxx>
33 #include <swmodule.hxx>
34 #include <fmtcol.hxx>
35 #include <outline.hxx>
36 #include <uinums.hxx>
37 #include <poolfmt.hxx>
38 #include <shellres.hxx>
39 #include <svl/style.hxx>
40 #include <charfmt.hxx>
41 #include <docstyle.hxx>
42 #include <viewopt.hxx>
43 #include <svtools/ctrlbox.hxx>
44 #include <globals.hrc>
45 #include <outline.hrc>
46 #include <strings.hrc>
47 #include <paratr.hxx>
48 
49 #include <unomid.h>
50 
52 #include <app.hrc>
53 
54 #include <com/sun/star/accessibility/AccessibleRole.hpp>
55 
56 using namespace ::com::sun::star;
57 
59 {
60  std::unique_ptr<weld::Entry> m_xFormEdit;
61  std::unique_ptr<weld::TreeView> m_xFormBox;
62  std::unique_ptr<weld::Button> m_xOKBtn;
63 
64  DECL_LINK( ModifyHdl, weld::Entry&, void );
65  DECL_LINK( SelectHdl, weld::TreeView&, void );
66  DECL_LINK( DoubleClickHdl, weld::TreeView&, void );
67 
68 public:
69  explicit SwNumNamesDlg(weld::Window *pParent);
70  void SetUserNames(const OUString *pList[]);
71  OUString GetName() const { return m_xFormEdit->get_text(); }
72  int GetCurEntryPos() const { return m_xFormBox->get_selected_index(); }
73 };
74 
75 // remember selected entry
76 IMPL_LINK( SwNumNamesDlg, SelectHdl, weld::TreeView&, rBox, void )
77 {
78  m_xFormEdit->set_text(rBox.get_selected_text());
79  m_xFormEdit->select_region(0, -1);
80 }
81 
86 void SwNumNamesDlg::SetUserNames(const OUString *pList[])
87 {
88  sal_uInt16 nSelect = 0;
89  for (sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
90  {
91  if(pList[i])
92  {
93  m_xFormBox->remove(i);
94  m_xFormBox->insert_text(i, *pList[i]);
95  if (i == nSelect)
96  nSelect++;
97  }
98  }
99  m_xFormBox->select(nSelect);
100  SelectHdl(*m_xFormBox);
101 }
102 
103 // unlock OK-Button when text is in Edit
104 IMPL_LINK( SwNumNamesDlg, ModifyHdl, weld::Entry&, rBox, void )
105 {
106  m_xOKBtn->set_sensitive(!rBox.get_text().isEmpty());
107 }
108 
109 // DoubleClickHdl
111 {
112  m_xDialog->response(RET_OK);
113 }
114 
116  : GenericDialogController(pParent,
117  "modules/swriter/ui/numberingnamedialog.ui",
118  "NumberingNameDialog")
119  , m_xFormEdit(m_xBuilder->weld_entry("entry"))
120  , m_xFormBox(m_xBuilder->weld_tree_view("form"))
121  , m_xOKBtn(m_xBuilder->weld_button("ok"))
122 {
123  for (size_t i = 0; i < SAL_N_ELEMENTS(OUTLINE_STYLE); ++i)
124  m_xFormBox->append_text(SwResId(OUTLINE_STYLE[i]));
125 
126  m_xFormEdit->connect_changed(LINK(this, SwNumNamesDlg, ModifyHdl));
127  m_xFormBox->connect_changed(LINK(this, SwNumNamesDlg, SelectHdl));
128  m_xFormBox->connect_row_activated(LINK(this, SwNumNamesDlg, DoubleClickHdl));
129  m_xFormBox->set_size_request(-1, m_xFormBox->get_height_rows(9));
130 }
131 
132 static sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel)
133 {
134  sal_uInt16 nTmp = nActLevel;
135  sal_uInt16 nTmpLevel = 0;
136  while( 0 != (nTmp >>= 1) )
137  nTmpLevel++;
138  return nTmpLevel;
139 }
140 
141 sal_uInt16 SwOutlineTabDialog::nNumLevel = 1;
142 
144  SwWrtShell &rSh)
145  : SfxTabDialogController(pParent, "modules/swriter/ui/outlinenumbering.ui", "OutlineNumberingDialog", pSwItemSet)
146  , rWrtSh(rSh)
147  , pChapterNumRules(SW_MOD()->GetChapterNumRules())
148  , bModified(rWrtSh.IsModified())
149  , m_xMenuButton(m_xBuilder->weld_menu_button("format"))
150 {
151  m_xMenuButton->connect_clicked(LINK(this, SwOutlineTabDialog, FormHdl));
152  m_xMenuButton->connect_selected(LINK(this, SwOutlineTabDialog, MenuSelectHdl));
153 
154  xNumRule.reset(new SwNumRule(*rSh.GetOutlineNumRule()));
156 
157  AddTabPage("position", &SwNumPositionTabPage::Create, nullptr);
158  AddTabPage("numbering", &SwOutlineSettingsTabPage::Create, nullptr);
159 
160  OUString sHeadline;
161  sal_uInt16 i;
162 
163  for( i = 0; i < MAXLEVEL; ++i )
164  {
165  // if the style wasn't created yet, it's still at this position
166  if( !rWrtSh.GetParaStyle( sHeadline =
167  SwStyleNameMapper::GetUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
168  sHeadline )) )
169  aCollNames[i] = sHeadline;
170  }
171 
172  // query the text templates' outlining levels
173  const sal_uInt16 nCount = rWrtSh.GetTextFormatCollCount();
174  for(i = 0; i < nCount; ++i )
175  {
176  SwTextFormatColl &rTextColl = rWrtSh.GetTextFormatColl(i);
177  if(!rTextColl.IsDefault())
178  {
180  {
181  int nOutLevel = rTextColl.GetAssignedOutlineStyleLevel();
182  aCollNames[ nOutLevel ] = rTextColl.GetName();
183  }
184  }
185  }
186 }
187 
189 {
190 }
191 
192 void SwOutlineTabDialog::PageCreated(const OString& rPageId, SfxTabPage& rPage)
193 {
194  if (rPageId == "position")
195  {
196  static_cast<SwNumPositionTabPage&>(rPage).SetWrtShell(&rWrtSh);
197  static_cast<SwNumPositionTabPage&>(rPage).SetOutlineTabDialog(this);
198  }
199  else if (rPageId == "numbering")
200  {
201  static_cast<SwOutlineSettingsTabPage&>(rPage).SetWrtShell(&rWrtSh);
202  }
203 }
204 
206 {
207  if (!bModified)
208  rWrtSh.ResetModified();
209  m_xDialog->response(RET_CANCEL);
210 }
211 
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  xNumRule = pRules->MakeNumRule(rWrtSh);
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(const OUString &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, "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)
514  {
515  m_xAllLevelFT->set_sensitive(true);
516  m_xAllLevelNF->set_sensitive(true);
517  m_xAllLevelNF->set_max(nTmpLevel + 1);
518  m_xAllLevelNF->set_value(rFormat.GetIncludeUpperLevels());
519  }
520  else
521  {
522  m_xAllLevelNF->set_text(OUString());
523  m_xAllLevelNF->set_sensitive(false);
524  m_xAllLevelFT->set_sensitive(false);
525  }
527  m_xStartEdit->set_value( rFormat.GetStart() );
528  }
529  SetModified();
530 }
531 
533 {
534  nActLevel = 0;
535  auto aRows = rBox.get_selected_rows();
536  if (std::find(aRows.begin(), aRows.end(), MAXLEVEL) != aRows.end())
537  {
538  nActLevel = 0xFFFF;
539  }
540  else
541  {
542  sal_uInt16 nMask = 1;
543  for( sal_uInt16 i = 0; i < MAXLEVEL; i++ )
544  {
545  if (std::find(aRows.begin(), aRows.end(), i) != aRows.end())
546  nActLevel |= nMask;
547  nMask <<= 1;
548  }
549  }
550  Update();
551 }
552 
553 IMPL_LINK(SwOutlineSettingsTabPage, ToggleComplete, weld::SpinButton&, rEdit, void)
554 {
555  sal_uInt16 nMask = 1;
556  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
557  {
558  if(nActLevel & nMask)
559  {
560  SwNumFormat aNumFormat(pNumRule->Get(i));
561  aNumFormat.SetIncludeUpperLevels( std::min( static_cast<sal_uInt8>(rEdit.get_value()),
562  static_cast<sal_uInt8>(i + 1)) );
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)
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.SetPrefix( m_xPrefixED->get_text() );
646  aNumFormat.SetSuffix( m_xSuffixED->get_text() );
647  pNumRule->Set(i, aNumFormat);
648  }
649  nMask <<= 1;
650  }
651  SetModified();
652 }
653 
654 IMPL_LINK( SwOutlineSettingsTabPage, StartModified, weld::SpinButton&, rEdit, void )
655 {
656  sal_uInt16 nMask = 1;
657  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
658  {
659  if(nActLevel & nMask)
660  {
661  SwNumFormat aNumFormat(pNumRule->Get(i));
662  aNumFormat.SetStart(static_cast<sal_uInt16>(rEdit.get_value()));
663  pNumRule->Set(i, aNumFormat);
664  }
665  nMask <<= 1;
666  }
667  SetModified();
668 }
669 
671 {
672  OUString sEntry = m_xCharFormatLB->get_active_text();
673  sal_uInt16 nMask = 1;
674  bool bFormatNone = sEntry == SwViewShell::GetShellRes()->aStrNone;
675  SwCharFormat* pFormat = nullptr;
676  if(!bFormatNone)
677  {
678  sal_uInt16 nChCount = pSh->GetCharFormatCount();
679  for(sal_uInt16 i = 0; i < nChCount; i++)
680  {
681  SwCharFormat& rChFormat = pSh->GetCharFormat(i);
682  if(rChFormat.GetName() == sEntry)
683  {
684  pFormat = &rChFormat;
685  break;
686  }
687  }
688  if(!pFormat)
689  {
690  SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
691  SfxStyleSheetBase* pBase;
692  pBase = pPool->Find(sEntry, SfxStyleFamily::Char);
693  if(!pBase)
694  pBase = &pPool->Make(sEntry, SfxStyleFamily::Page);
695  pFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
696 
697  }
698  }
699 
700  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
701  {
702  if(nActLevel & nMask)
703  {
704  SwNumFormat aNumFormat(pNumRule->Get(i));
705  if(bFormatNone)
706  aNumFormat.SetCharFormat(nullptr);
707  else
708  aNumFormat.SetCharFormat(pFormat);
709  pNumRule->Set(i, aNumFormat);
710  }
711  nMask <<= 1;
712  }
713 }
714 
716 {
717 }
718 
720 {
721  pSh = pShell;
722  // query this document's NumRules
724  pCollNames = static_cast<SwOutlineTabDialog*>(GetDialogController())->GetCollNames();
725 
726  CollSave();
727 
730  // set start value - nActLevel must be 1 here
731  sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
732  const SwNumFormat& rNumFormat = pNumRule->Get( nTmpLevel );
733  m_xStartEdit->set_value( rNumFormat.GetStart() );
734 
735  // create pool formats for headlines
736  for (sal_uInt16 i = 0; i < MAXLEVEL; ++i)
737  {
739  static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), OUString()));
740  m_xLevelLB->append_text( OUString::number(i + 1) );
741  }
742  OUString sStr("1 - ");
743  sStr += OUString::number(MAXLEVEL);
744  m_xLevelLB->append_text(sStr);
745 
746  // query the texttemplates' outlining levels
747  const sal_uInt16 nCount = pSh->GetTextFormatCollCount();
748  for (sal_uInt16 i = 0; i < nCount; ++i)
749  {
750  SwTextFormatColl &rTextColl = pSh->GetTextFormatColl(i);
751  if(!rTextColl.IsDefault())
752  {
753  sStr = rTextColl.GetName();
754  if (m_xCollBox->find_text(sStr) == -1)
755  m_xCollBox->append_text(sStr);
756  }
757  }
758 
759  m_xNumberBox->SelectNumberingType(rNumFormat.GetNumberingType());
760  SwOutlineNodes::size_type nOutlinePos = pSh->GetOutlinePos(MAXLEVEL);
761  int nTmp = 0;
762  if(nOutlinePos != SwOutlineNodes::npos)
763  {
764  nTmp = static_cast<sal_uInt16>(pSh->getIDocumentOutlineNodesAccess()->getOutlineLevel(nOutlinePos));
765  }
766  m_xLevelLB->select(nTmp-1);
767 
768  // collect char styles
769  m_xCharFormatLB->clear();
770  m_xCharFormatLB->append_text(SwViewShell::GetShellRes()->aStrNone);
771 
772  // char styles
774  pSh->GetView().GetDocShell());
775  Update();
776 }
777 
779 {
781  if(nActLevel != USHRT_MAX)
783  else
784  m_xLevelLB->select(MAXLEVEL);
785  LevelHdl(*m_xLevelLB);
786 }
787 
789 {
791  return DeactivateRC::LeavePage;
792 }
793 
795 {
796  return true;
797 }
798 
800 {
801  ActivatePage(*rSet);
802 }
803 
805  const SfxItemSet* rAttrSet)
806 {
807  return VclPtr<SwOutlineSettingsTabPage>::Create(pParent, *rAttrSet);
808 }
809 
811 {
812  bool bIsNull = m_xStartEdit->get_value() == 0;
813  bool bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC ||
814  SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType ||
815  SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType;
816  m_xStartEdit->set_min(bNoZeroAllowed ? 1 : 0);
817  if (bIsNull && bNoZeroAllowed)
818  StartModified(*m_xStartEdit);
819 }
820 
821 static long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, long nXStart, long nYStart, const Size& rSize)
822 {
823  vcl::Font aTmpFont(pVDev->GetFont());
824 
825  // via Uno it's possible that no font has been set!
826  vcl::Font aFont(rFormat.GetBulletFont() ? *rFormat.GetBulletFont() : aTmpFont);
827  Size aTmpSize(rSize);
828  aTmpSize.setWidth( aTmpSize.Width() * ( rFormat.GetBulletRelSize()) );
829  aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
830  aTmpSize.setHeight( aTmpSize.Height() * ( rFormat.GetBulletRelSize()) );
831  aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
832  // in case of a height of zero it is drawn in original height
833  if(!aTmpSize.Height())
834  aTmpSize.setHeight( 1 );
835  aFont.SetFontSize(aTmpSize);
836  aFont.SetTransparent(true);
837  Color aBulletColor = rFormat.GetBulletColor();
838  if(aBulletColor == COL_AUTO)
839  aBulletColor = pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK;
840  else if(aBulletColor == pVDev->GetFillColor())
841  aBulletColor.Invert();
842  aFont.SetColor(aBulletColor);
843  pVDev->SetFont( aFont );
844  OUString aText(rFormat.GetBulletChar());
845  long nY = nYStart;
846  nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
847  pVDev->DrawText( Point(nXStart, nY), aText );
848  long nRet = pVDev->GetTextWidth(aText);
849 
850  pVDev->SetFont(aTmpFont);
851  return nRet;
852 }
853 
854 static long lcl_DrawGraphic(vcl::RenderContext* pVDev, const SwNumFormat &rFormat, long nXStart, long nYStart, long nDivision)
855 {
856  const SvxBrushItem* pBrushItem = rFormat.GetBrush();
857  long nRet = 0;
858  if (pBrushItem)
859  {
860  const Graphic* pGraphic = pBrushItem->GetGraphic();
861  if (pGraphic)
862  {
863  Size aGSize( rFormat.GetGraphicSize());
864  aGSize.setWidth( aGSize.Width() / nDivision );
865  nRet = aGSize.Width();
866  aGSize.setHeight( aGSize.Height() / nDivision );
867  pGraphic->Draw(pVDev, Point(nXStart, nYStart), pVDev->PixelToLogic(aGSize));
868  }
869  }
870  return nRet;
871 }
872 
874 {
875  const Size aSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
876 
877  ScopedVclPtrInstance<VirtualDevice> pVDev(rRenderContext);
878  pVDev->SetMapMode(rRenderContext.GetMapMode());
879  pVDev->SetOutputSize(aSize);
880 
881  // #101524# OJ
882  pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor());
883  pVDev->SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetButtonTextColor());
884  pVDev->DrawRect(tools::Rectangle(Point(0,0), aSize));
885 
886  if (pActNum)
887  {
888  long nWidthRelation = 30; // chapter dialog
889  if(nPageWidth)
890  {
891  nWidthRelation = nPageWidth / aSize.Width();
892  if(bPosition)
893  nWidthRelation = nWidthRelation * 2 / 3;
894  else
895  nWidthRelation = nWidthRelation / 4;
896  }
897 
898  // height per level
899  const long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1));
900  const long nYStep = (aSize.Height() - 6)/ MAXLEVEL;
901  long nYStart = 4;
902  aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, GetAppLanguage(),
903  GetDefaultFontFlags::OnlyOne, &rRenderContext);
904  // #101524# OJ
906 
907  const long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10;
908  aStdFont.SetFontSize(Size( 0, nFontHeight ));
909 
910  long nPreNum = pActNum->Get(0).GetStart();
911 
912  if (bPosition)
913  {
914  const long nLineHeight = nFontHeight * 8 / 7;
915  sal_uInt8 nStart = 0;
916  while (!(nActLevel & (1 << nStart)))
917  {
918  nStart++;
919  }
920  if(nStart) // so that possible predecessors and successors are showed
921  nStart--;
922 
923  SwNumberTree::tNumberVector aNumVector;
924  sal_uInt8 nEnd = std::min(sal_uInt8(nStart + 3), MAXLEVEL);
925  for (sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel)
926  {
927  const SwNumFormat &rFormat = pActNum->Get(nLevel);
928  aNumVector.push_back(rFormat.GetStart());
929 
930  long nXStart( 0 );
931  long nTextOffset( 0 );
932  long nNumberXPos( 0 );
934  {
935  nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
936  nTextOffset = rFormat.GetCharTextDistance() / nWidthRelation;
937  nNumberXPos = nXStart;
938  const long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation;
939 
940  if(nFirstLineOffset <= nNumberXPos)
941  nNumberXPos -= nFirstLineOffset;
942  else
943  nNumberXPos = 0;
944  }
946  {
947  const long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation);
948  nNumberXPos = (nTmpNumberXPos < 0) ? 0 : nTmpNumberXPos;
949  }
950 
951  long nBulletWidth = 0;
952  if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
953  {
954  nBulletWidth = lcl_DrawGraphic(pVDev.get(), rFormat, nNumberXPos,
955  nYStart, nWidthRelation);
956  }
957  else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
958  {
959  nBulletWidth = lcl_DrawBullet(pVDev.get(), rFormat, nNumberXPos,
960  nYStart, aStdFont.GetFontSize());
961  }
962  else
963  {
964  pVDev->SetFont(aStdFont);
965  if(pActNum->IsContinusNum())
966  aNumVector[nLevel] = nPreNum;
967  OUString aText(pActNum->MakeNumString( aNumVector ));
968  pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
969  nBulletWidth = pVDev->GetTextWidth(aText);
970  nPreNum++;
971  }
974  {
975  pVDev->SetFont(aStdFont);
976  OUString aText(' ');
977  pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
978  nBulletWidth += pVDev->GetTextWidth(aText);
979  }
980 
981  long nTextXPos(0);
983  {
984  nTextXPos = nXStart;
985  if (nTextOffset < 0)
986  nTextXPos = nTextXPos + nTextOffset;
987  if (nNumberXPos + nBulletWidth + nTextOffset > nTextXPos)
988  nTextXPos = nNumberXPos + nBulletWidth + nTextOffset;
989  }
991  {
992  switch (rFormat.GetLabelFollowedBy())
993  {
995  {
996  nTextXPos = rFormat.GetListtabPos() / nWidthRelation;
997  if (nTextXPos < nNumberXPos + nBulletWidth)
998  {
999  nTextXPos = nNumberXPos + nBulletWidth;
1000  }
1001  }
1002  break;
1006  {
1007  nTextXPos = nNumberXPos + nBulletWidth;
1008  }
1009  break;
1010  }
1011 
1012  nXStart = rFormat.GetIndentAt() / nWidthRelation;
1013  }
1014 
1015  tools::Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1016  pVDev->SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor()); // COL_BLACK );
1017  pVDev->DrawRect(aRect1);
1018 
1019  tools::Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2), Size(aSize.Width() / 2, 2));
1020  pVDev->DrawRect(aRect2);
1021  nYStart += 2 * nLineHeight;
1022  }
1023  }
1024  else
1025  {
1026  SwNumberTree::tNumberVector aNumVector;
1027  const long nLineHeight = nFontHeight * 3 / 2;
1028  for (sal_uInt8 nLevel = 0; nLevel < MAXLEVEL; ++nLevel, nYStart = nYStart + nYStep)
1029  {
1030  const SwNumFormat &rFormat = pActNum->Get(nLevel);
1031  aNumVector.push_back(rFormat.GetStart());
1032  long nXStart(0);
1034  {
1035  nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
1036  }
1038  {
1039  const long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation);
1040  nXStart = (nTmpXStart < 0) ? 0 : nTmpXStart;
1041  }
1042  nXStart /= 2;
1043  nXStart += 2;
1044  long nTextOffset;
1045  if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
1046  {
1047  lcl_DrawGraphic(pVDev.get(), rFormat, nXStart, nYStart, nWidthRelation);
1048  nTextOffset = nLineHeight + nXStep;
1049  }
1050  else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
1051  {
1052  nTextOffset = lcl_DrawBullet(pVDev.get(), rFormat, nXStart, nYStart, aStdFont.GetFontSize());
1053  nTextOffset += nXStep;
1054  }
1055  else
1056  {
1057  pVDev->SetFont(aStdFont);
1058  if (pActNum->IsContinusNum())
1059  aNumVector[nLevel] = nPreNum;
1060  OUString aText(pActNum->MakeNumString( aNumVector ));
1061  pVDev->DrawText( Point(nXStart, nYStart), aText );
1062  nTextOffset = pVDev->GetTextWidth(aText) + nXStep;
1063  nPreNum++;
1064  }
1065  pVDev->SetFont(aStdFont);
1066  pVDev->DrawText(
1067  Point(nXStart + nTextOffset, nYStart),
1068  (pOutlineNames == nullptr
1070  : pOutlineNames[nLevel]));
1071  }
1072  }
1073  }
1074  rRenderContext.DrawOutDev(Point(0,0), aSize, Point(0,0), aSize, *pVDev);
1075 }
1076 
1077 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxNumType GetNumberingType() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
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:588
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
virtual void Reset(const SfxItemSet *rSet) override
Definition: outline.cxx:799
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
Definition: edfmt.cxx:125
const Color & GetBulletColor() const
long GetFirstLineIndent() const
bool IsDefault() const
Definition: format.hxx:109
OUString MakeNumString(const SwNodeNum &, bool bInclStrings=true) const
Definition: number.cxx:617
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2489
std::unique_ptr< weld::ComboBox > m_xCharFormatLB
Definition: outline.hxx:79
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: num.cxx:500
std::string GetValue
SW_DLLPUBLIC void FillCharStyleListBox(weld::ComboBox &rToFill, SwDocShell *pDocSh, bool bSorted=false, bool bWithDefault=false)
Definition: uitool.cxx:735
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
long Height() const
sal_uInt16 GetBulletRelSize() const
sal_uInt16 GetTextFormatCollCount() const
Definition: edfcol.cxx:694
const SvxBrushItem * GetBrush() const
const IDocumentOutlineNodes * getIDocumentOutlineNodesAccess() const
Definition: viewsh.cxx:2614
weld::Button & GetCancelButton() const
void CheckForStartValue_Impl(sal_uInt16 nNumberingType)
Definition: outline.cxx:810
const StyleSettings & GetStyleSettings() const
IMPL_LINK(SwNumNamesDlg, SelectHdl, weld::TreeView &, rBox, void)
Definition: outline.cxx:76
void SetOutlineNames(const OUString *pNames)
Definition: numprevw.hxx:58
void SetPrefix(const OUString &rSet)
sal_uInt8 GetIncludeUpperLevels() const
OUString aCollNames[MAXLEVEL]
Definition: outline.hxx:37
const MapMode & GetMapMode() const
std::unique_ptr< weld::Entry > m_xSuffixED
Definition: outline.hxx:83
static sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel)
Definition: outline.cxx:132
const OUString & GetName() const
Definition: numrule.hxx:222
static sal_uInt16 nNumLevel
Definition: outline.hxx:35
std::unique_ptr< weld::Entry > m_xPrefixED
Definition: outline.hxx:82
void SetIncludeUpperLevels(sal_uInt8 nSet)
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:330
std::unique_ptr< weld::Button > m_xOKBtn
Definition: outline.cxx:62
RET_CANCEL
Size const & GetOutputSizePixel() const
std::unique_ptr< SwNumRule > xNumRule
Definition: outline.hxx:40
SvxNumType
OUString const aStrNone
Definition: shellres.hxx:45
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
virtual short Ok()
constexpr::Color COL_AUTO(0xFF, 0xFF, 0xFF, 0xFF)
SwTextFormatColl & GetTextFormatColl(sal_uInt16 nTextFormatColl) const
Definition: edfcol.cxx:699
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:109
const SwView & GetView() const
Definition: wrtsh.hxx:426
const SwNumRule * pActNum
Definition: numprevw.hxx:30
const vcl::Font & GetFont() const
std::unique_ptr< weld::SpinButton > m_xAllLevelNF
Definition: outline.hxx:81
const OUString & GetName() const
Definition: format.hxx:111
void SetExchangeSupport()
SwNumRule * pNumRule
Definition: outline.hxx:71
SVX_NUM_ARABIC
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
virtual void Reset(const SfxItemSet *)
short GetCharTextDistance() const
void SetUserNames(const OUString *pList[])
set user defined names
Definition: outline.cxx:86
const Graphic * GetGraphic(OUString const &referer=OUString()) const
#define RES_PARATR_NUMRULE
Definition: hintids.hxx:170
static long lcl_DrawBullet(vcl::RenderContext *pVDev, const SwNumFormat &rFormat, long nXStart, long nYStart, const Size &rSize)
Definition: outline.cxx:821
const OUString & GetPrefix() const
SwOutlineSettingsTabPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: outline.cxx:386
SwOutlineTabDialog(weld::Window *pParent, const SfxItemSet *pSwItemSet, SwWrtShell &)
Definition: outline.cxx:143
const OUString & GetSuffix() const
std::unique_ptr< weld::SpinButton > m_xStartEdit
Definition: outline.hxx:84
#define SAL_N_ELEMENTS(arr)
SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel=UCHAR_MAX)
search "outline position" before previous outline node at given level
Definition: crstrvl.cxx:1157
bool IsContinusNum() const
Definition: numrule.hxx:233
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
static long lcl_DrawGraphic(vcl::RenderContext *pVDev, const SwNumFormat &rFormat, long nXStart, long nYStart, long nDivision)
Definition: outline.cxx:854
OUString const aNoFormatName
Definition: outline.hxx:68
#define SW_MOD()
Definition: swmodule.hxx:256
static constexpr auto npos
Definition: ndarr.hxx:80
void Draw(OutputDevice *pOutDev, const Point &rDestPt) const
static OUString getProductName()
std::unique_ptr< SwNumRule > MakeNumRule(SwWrtShell &rSh) const
Definition: uinums.cxx:156
LabelFollowedBy GetLabelFollowedBy() const
sal_Int32 GetAbsLSpace() const
sal_uInt16 GetLevel(const OUString &rFormatName) const
Definition: outline.cxx:294
bool IsDark() const
virtual short Ok() override
Definition: outline.cxx:304
std::unique_ptr< weld::TreeView > m_xFormBox
Definition: outline.cxx:61
void EndAction(const bool bIdleEnd=false, const bool DoSetPosX=false)
Definition: crsrsh.cxx:228
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
int i
DECL_LINK(ModifyHdl, weld::Entry &, void)
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:192
const Size & GetFontSize() const
static void SetActNumLevel(sal_uInt16 nSet)
Definition: outline.hxx:63
void DeleteAssignmentToListLevelOfOutlineStyle()
Definition: fmtcol.cxx:622
const AllSettings & GetSettings() const
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
sal_uInt16 GetStart() const
const SwNumRule * GetOutlineNumRule() const
Definition: ednumber.cxx:120
SvxNumPositionAndSpaceMode GetPositionAndSpaceMode() const
SVX_NUM_CHARS_LOWER_LETTER_N
SwDocShell * GetDocShell()
Definition: view.cxx:1127
void SetColor(const Color &)
IMPL_LINK_NOARG(SwNumNamesDlg, DoubleClickHdl, weld::TreeView &, void)
Definition: outline.cxx:110
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:595
std::vector< tSwNumTreeNumber > tNumberVector
Point PixelToLogic(const Point &rDevicePt) const
void StartAction()
Definition: crsrsh.cxx:211
long GetIndentAt() const
const OUString & GetName() const
Definition: uinums.hxx:74
const SwNumFormat & Get(sal_uInt16 i) const
Definition: number.cxx:83
virtual ~SwOutlineSettingsTabPage() override
Definition: outline.cxx:715
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: outline.cxx:804
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:277
const Size & GetGraphicSize() const
weld::Entry & rEdit
const Color & GetButtonTextColor() const
SwNumNamesDlg(weld::Window *pParent)
Definition: outline.cxx:115
unsigned char sal_uInt8
std::unique_ptr< weld::Entry > m_xFormEdit
Definition: outline.cxx:60
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: outline.cxx:778
void SetFont(const vcl::Font &rNewFont)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: outline.cxx:788
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
static Color & GetFontColor()
Definition: viewopt.cxx:428
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: edfmt.cxx:156
void SetOutlineNumRule(const SwNumRule &)
Definition: ednumber.cxx:113
LanguageType GetAppLanguage()
Definition: init.cxx:765
RET_OK
int GetCurEntryPos() const
Definition: outline.cxx:72
static VclPtr< reference_type > Create(Arg &&...arg)
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
static const OUString & GetUIName(const OUString &rName, SwGetPoolIdFromName)
SfxOkDialogController * GetDialogController() const
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:377
const Color & GetWindowColor() const
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
long GetListtabPos() const
sal_Int32 GetFirstLineOffset() const
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: fmtcol.cxx:367
long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
sal_Unicode GetBulletChar() const
void SetStart(sal_uInt16 nSet)
DeactivateRC
OString const aName
OUString GetName() const
Definition: outline.cxx:71
void SetWrtShell(SwWrtShell *pShell)
Definition: outline.cxx:719
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:794
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
void setWidth(long nWidth)
SwNumRule * GetNumRule(SwTextFormatColl &rTextFormatColl)
determines the list style, which directly set at the given paragraph style
Definition: fmtcol.cxx:75
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: outline.cxx:873
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:188
const Color & GetFillColor() const
SwTextFormatColl * GetParaStyle(const OUString &rCollName, GetStyle eCreate=GETSTYLE_NOCREATE)
Definition: wrtsh1.cxx:1497
std::unique_ptr< weld::Label > m_xAllLevelFT
Definition: outline.hxx:80
static sal_uInt16 GetActNumLevel()
Definition: outline.hxx:62