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