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&, bool );
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  return true;
114 }
115 
117  : GenericDialogController(pParent,
118  "modules/swriter/ui/numberingnamedialog.ui",
119  "NumberingNameDialog")
120  , m_xFormEdit(m_xBuilder->weld_entry("entry"))
121  , m_xFormBox(m_xBuilder->weld_tree_view("form"))
122  , m_xOKBtn(m_xBuilder->weld_button("ok"))
123 {
124  for (size_t i = 0; i < SAL_N_ELEMENTS(OUTLINE_STYLE); ++i)
125  m_xFormBox->append_text(SwResId(OUTLINE_STYLE[i]));
126 
127  m_xFormEdit->connect_changed(LINK(this, SwNumNamesDlg, ModifyHdl));
128  m_xFormBox->connect_changed(LINK(this, SwNumNamesDlg, SelectHdl));
129  m_xFormBox->connect_row_activated(LINK(this, SwNumNamesDlg, DoubleClickHdl));
130  m_xFormBox->set_size_request(-1, m_xFormBox->get_height_rows(9));
131 }
132 
133 static sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel)
134 {
135  sal_uInt16 nTmp = nActLevel;
136  sal_uInt16 nTmpLevel = 0;
137  while( 0 != (nTmp >>= 1) )
138  nTmpLevel++;
139  return nTmpLevel;
140 }
141 
142 sal_uInt16 SwOutlineTabDialog::nNumLevel = 1;
143 
145  SwWrtShell &rSh)
146  : SfxTabDialogController(pParent, "modules/swriter/ui/outlinenumbering.ui", "OutlineNumberingDialog", pSwItemSet)
147  , rWrtSh(rSh)
148  , pChapterNumRules(SW_MOD()->GetChapterNumRules())
149  , bModified(rWrtSh.IsModified())
150  , m_xMenuButton(m_xBuilder->weld_menu_button("format"))
151 {
152  m_xMenuButton->connect_clicked(LINK(this, SwOutlineTabDialog, FormHdl));
153  m_xMenuButton->connect_selected(LINK(this, SwOutlineTabDialog, MenuSelectHdl));
154 
155  xNumRule.reset(new SwNumRule(*rSh.GetOutlineNumRule()));
157 
158  AddTabPage("position", &SwNumPositionTabPage::Create, nullptr);
159  AddTabPage("numbering", &SwOutlineSettingsTabPage::Create, nullptr);
160 
161  OUString sHeadline;
162  sal_uInt16 i;
163 
164  for( i = 0; i < MAXLEVEL; ++i )
165  {
166  // if the style wasn't created yet, it's still at this position
167  if( !rWrtSh.GetParaStyle( sHeadline =
168  SwStyleNameMapper::GetUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
169  sHeadline )) )
170  aCollNames[i] = sHeadline;
171  }
172 
173  // query the text templates' outlining levels
174  const sal_uInt16 nCount = rWrtSh.GetTextFormatCollCount();
175  for(i = 0; i < nCount; ++i )
176  {
177  SwTextFormatColl &rTextColl = rWrtSh.GetTextFormatColl(i);
178  if(!rTextColl.IsDefault())
179  {
181  {
182  int nOutLevel = rTextColl.GetAssignedOutlineStyleLevel();
183  aCollNames[ nOutLevel ] = rTextColl.GetName();
184  }
185  }
186  }
187 }
188 
190 {
191 }
192 
193 void SwOutlineTabDialog::PageCreated(const OString& rPageId, SfxTabPage& rPage)
194 {
195  if (rPageId == "position")
196  {
197  static_cast<SwNumPositionTabPage&>(rPage).SetWrtShell(&rWrtSh);
198  static_cast<SwNumPositionTabPage&>(rPage).SetOutlineTabDialog(this);
199  }
200  else if (rPageId == "numbering")
201  {
202  static_cast<SwOutlineSettingsTabPage&>(rPage).SetWrtShell(&rWrtSh);
203  }
204 }
205 
207 {
208  if (!bModified)
209  rWrtSh.ResetModified();
210  m_xDialog->response(RET_CANCEL);
211 }
212 
214 {
215  // fill PopupMenu
216  for(sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
217  {
218  const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
219  if (!pRules)
220  continue;
221  m_xMenuButton->set_item_label("form" + OString::number(i + 1), pRules->GetName());
222  }
223 
224  OString sHelpId(m_xMenuButton->get_item_help_id("form1"));
225  for (sal_Int32 i = 2; i <= 9; ++i)
226  {
227  m_xMenuButton->set_item_help_id("form" + OString::number(i), sHelpId);
228  }
229 }
230 
231 IMPL_LINK(SwOutlineTabDialog, MenuSelectHdl, const OString&, rIdent, void)
232 {
233  sal_uInt8 nLevelNo = 0;
234 
235  if (rIdent == "form1")
236  nLevelNo = 1;
237  else if (rIdent == "form2")
238  nLevelNo = 2;
239  else if (rIdent == "form3")
240  nLevelNo = 3;
241  else if (rIdent == "form4")
242  nLevelNo = 4;
243  else if (rIdent == "form5")
244  nLevelNo = 5;
245  else if (rIdent == "form6")
246  nLevelNo = 6;
247  else if (rIdent == "form7")
248  nLevelNo = 7;
249  else if (rIdent == "form8")
250  nLevelNo = 8;
251  else if (rIdent == "form9")
252  nLevelNo = 9;
253  else if (rIdent == "saveas")
254  {
255  SwNumNamesDlg aDlg(m_xDialog.get());
256  const OUString *aStrArr[SwChapterNumRules::nMaxRules];
257  for(sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
258  {
259  const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
260  if(pRules)
261  aStrArr[i] = &pRules->GetName();
262  else
263  aStrArr[i] = nullptr;
264  }
265  aDlg.SetUserNames(aStrArr);
266  if (aDlg.run() == RET_OK)
267  {
268  const OUString aName(aDlg.GetName());
269  pChapterNumRules->ApplyNumRules( SwNumRulesWithName(
270  *xNumRule, aName ), aDlg.GetCurEntryPos() );
271  m_xMenuButton->set_item_label("form" + OString::number(aDlg.GetCurEntryPos() + 1), aName);
272  }
273  return;
274  }
275 
276  if( nLevelNo-- )
277  {
278  const SwNumRulesWithName *pRules = pChapterNumRules->GetRules( nLevelNo );
279  if( pRules )
280  {
281  xNumRule = pRules->MakeNumRule(rWrtSh);
282  xNumRule->SetRuleType( OUTLINE_RULE );
283  SfxTabPage* pOutlinePage = GetTabPage("numbering");
284  assert(pOutlinePage);
285  static_cast<SwOutlineSettingsTabPage*>(pOutlinePage)->SetNumRule(xNumRule.get());
286  }
287  else
288  *xNumRule = *rWrtSh.GetOutlineNumRule();
289  }
290 
291  SfxTabPage* pPage = GetCurTabPage();
292  pPage->Reset(GetOutputItemSet());
293 }
294 
295 sal_uInt16 SwOutlineTabDialog::GetLevel(const OUString &rFormatName) const
296 {
297  for(sal_uInt16 i = 0; i < MAXLEVEL; ++i)
298  {
299  if(aCollNames[i] == rFormatName)
300  return i;
301  }
302  return MAXLEVEL;
303 }
304 
306 {
308  // set levels for all created templates; has to be done in order to
309  // delete possibly cancelled assignments again.
310 
311  // encapsulate changes into an action to avoid effects on the current cursor
312  // position during the changes.
314 
315  const SwNumRule * pOutlineRule = rWrtSh.GetOutlineNumRule();
316 
317  sal_uInt16 i, nCount = rWrtSh.GetTextFormatCollCount();
318  for( i = 0; i < nCount; ++i )
319  {
320  SwTextFormatColl &rTextColl = rWrtSh.GetTextFormatColl(i);
321  if( !rTextColl.IsDefault() )
322  {
323  const SfxPoolItem & rItem =
324  rTextColl.GetFormatAttr(RES_PARATR_NUMRULE, false);
325 
326  if (static_cast<sal_uInt8>(GetLevel(rTextColl.GetName())) == MAXLEVEL)
327  {
329  {
331  }
332  if (static_cast<const SwNumRuleItem &>(rItem).GetValue() ==
333  pOutlineRule->GetName())
334  {
336  }
337  }
338  else
339  {
340  rTextColl.AssignToListLevelOfOutlineStyle(GetLevel(rTextColl.GetName()));
341 
342  if (static_cast<const SwNumRuleItem &>(rItem).GetValue() !=
343  pOutlineRule->GetName())
344  {
345  SwNumRuleItem aItem(pOutlineRule->GetName());
346  rTextColl.SetFormatAttr(aItem);
347  }
348  }
349  }
350  }
351 
352  for(i = 0; i < MAXLEVEL; ++i )
353  {
354  OUString sHeadline;
355  ::SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
356  sHeadline );
357  SwTextFormatColl* pColl = rWrtSh.FindTextFormatCollByName( sHeadline );
358  if( !pColl && aCollNames[i] != sHeadline)
359  {
361  static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i) );
364 
365  if( !aCollNames[i].isEmpty() )
366  {
367  pTextColl = rWrtSh.GetParaStyle(
369  if(pTextColl)
370  {
371  pTextColl->AssignToListLevelOfOutlineStyle(i);
372  SwNumRuleItem aItem(pOutlineRule->GetName());
373  pTextColl->SetFormatAttr(aItem);
374  }
375  }
376  }
377  }
378 
380 
381  // #i30443#
382  rWrtSh.EndAction();
383 
384  return RET_OK;
385 }
386 
388  const SfxItemSet& rSet)
389  : SfxTabPage(pPage, pController, "modules/swriter/ui/outlinenumberingpage.ui", "OutlineNumberingPage", &rSet)
390  , aNoFormatName(SwResId(SW_STR_NONE))
391  , pSh(nullptr)
392  , pNumRule(nullptr)
393  , pCollNames(nullptr)
394  , nActLevel(1)
395  , m_xLevelLB(m_xBuilder->weld_tree_view("level"))
396  , m_xCollBox(m_xBuilder->weld_combo_box("style"))
397  , m_xNumberBox(new SwNumberingTypeListBox(m_xBuilder->weld_combo_box("numbering")))
398  , m_xCharFormatLB(m_xBuilder->weld_combo_box("charstyle"))
399  , m_xAllLevelFT(m_xBuilder->weld_label("sublevelsft"))
400  , m_xAllLevelNF(m_xBuilder->weld_spin_button("sublevelsnf"))
401  , m_xPrefixED(m_xBuilder->weld_entry("prefix"))
402  , m_xSuffixED(m_xBuilder->weld_entry("suffix"))
403  , m_xStartEdit(m_xBuilder->weld_spin_button("startat"))
404  , m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWIN))
405 {
407 
409  m_xCollBox->make_sorted();
410  m_xCollBox->append_text(aNoFormatName);
411  m_xLevelLB->connect_changed(LINK(this, SwOutlineSettingsTabPage, LevelHdl));
412  m_xAllLevelNF->connect_value_changed(LINK(this, SwOutlineSettingsTabPage, ToggleComplete));
413  m_xCollBox->connect_changed(LINK(this, SwOutlineSettingsTabPage, CollSelect));
414  m_xNumberBox->connect_changed(LINK(this, SwOutlineSettingsTabPage, NumberSelect));
415  m_xPrefixED->connect_changed(LINK(this, SwOutlineSettingsTabPage, DelimModify));
416  m_xSuffixED->connect_changed(LINK(this, SwOutlineSettingsTabPage, DelimModify));
417  m_xStartEdit->connect_value_changed(LINK(this, SwOutlineSettingsTabPage, StartModified));
418  m_xCharFormatLB->connect_changed(LINK(this, SwOutlineSettingsTabPage, CharFormatHdl));
419 }
420 
422 {
423  // if a template was already selected for this level, select it in the ListBox
424  m_xCollBox->set_sensitive(USHRT_MAX != nActLevel);
425  if(USHRT_MAX == nActLevel)
426  {
427  bool bSamePrefix = true;
428  bool bSameSuffix = true;
429  bool bSameType = true;
430  bool bSameComplete = true;
431  bool bSameStart = true;
432  bool bSameCharFormat = true;
433 
434  const SwNumFormat* aNumFormatArr[MAXLEVEL];
435  const SwCharFormat* pFirstFormat = nullptr;
436 
437  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
438  {
439 
440  aNumFormatArr[ i ] = &pNumRule->Get(i);
441  if(i == 0)
442  pFirstFormat = aNumFormatArr[i]->GetCharFormat();
443  else
444  {
445  bSameType &= aNumFormatArr[i]->GetNumberingType() == aNumFormatArr[0]->GetNumberingType();
446  bSameStart &= aNumFormatArr[i]->GetStart() == aNumFormatArr[0]->GetStart();
447  bSamePrefix &= aNumFormatArr[i]->GetPrefix() == aNumFormatArr[0]->GetPrefix();
448  bSameSuffix &= aNumFormatArr[i]->GetSuffix() == aNumFormatArr[0]->GetSuffix();
449  bSameComplete &= aNumFormatArr[i]->GetIncludeUpperLevels() == aNumFormatArr[0]->GetIncludeUpperLevels();
450  const SwCharFormat* pFormat = aNumFormatArr[i]->GetCharFormat();
451  bSameCharFormat &= (!pFirstFormat && !pFormat)
452  || (pFirstFormat && pFormat && pFormat->GetName() == pFirstFormat->GetName());
453  }
454  }
455  CheckForStartValue_Impl(aNumFormatArr[0]->GetNumberingType());
456  if (bSameType)
457  m_xNumberBox->SelectNumberingType( aNumFormatArr[0]->GetNumberingType() );
458  else
459  m_xNumberBox->SetNoSelection();
460  if(bSameStart)
461  m_xStartEdit->set_value(aNumFormatArr[0]->GetStart());
462  else
463  m_xStartEdit->set_text(OUString());
464  if(bSamePrefix)
465  m_xPrefixED->set_text(aNumFormatArr[0]->GetPrefix());
466  else
467  m_xPrefixED->set_text(OUString());
468  if(bSameSuffix)
469  m_xSuffixED->set_text(aNumFormatArr[0]->GetSuffix());
470  else
471  m_xSuffixED->set_text(OUString());
472 
473  if (bSameCharFormat)
474  {
475  if (pFirstFormat)
476  m_xCharFormatLB->set_active_text(pFirstFormat->GetName());
477  else
478  m_xCharFormatLB->set_active_text(SwViewShell::GetShellRes()->aStrNone);
479  }
480  else
481  m_xCharFormatLB->set_active(-1);
482 
483  m_xAllLevelFT->set_sensitive(true);
484  m_xAllLevelNF->set_sensitive(true);
485  m_xAllLevelNF->set_max(MAXLEVEL);
486  if (bSameComplete)
487  {
488  m_xAllLevelNF->set_value(aNumFormatArr[0]->GetIncludeUpperLevels());
489  }
490  else
491  {
492  m_xAllLevelNF->set_text(OUString());
493  }
494  }
495  else
496  {
497  sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
498  OUString aColl(pCollNames[nTmpLevel]);
499  if(!aColl.isEmpty())
500  m_xCollBox->set_active_text(aColl);
501  else
502  m_xCollBox->set_active_text(aNoFormatName);
503  const SwNumFormat &rFormat = pNumRule->Get(nTmpLevel);
504 
505  m_xNumberBox->SelectNumberingType( rFormat.GetNumberingType() );
506  m_xPrefixED->set_text(rFormat.GetPrefix());
507  m_xSuffixED->set_text(rFormat.GetSuffix());
508  const SwCharFormat* pFormat = rFormat.GetCharFormat();
509  if(pFormat)
510  m_xCharFormatLB->set_active_text(pFormat->GetName());
511  else
512  m_xCharFormatLB->set_active_text(SwViewShell::GetShellRes()->aStrNone);
513 
514  if(nTmpLevel)
515  {
516  m_xAllLevelFT->set_sensitive(true);
517  m_xAllLevelNF->set_sensitive(true);
518  m_xAllLevelNF->set_max(nTmpLevel + 1);
519  m_xAllLevelNF->set_value(rFormat.GetIncludeUpperLevels());
520  }
521  else
522  {
523  m_xAllLevelNF->set_text(OUString());
524  m_xAllLevelNF->set_sensitive(false);
525  m_xAllLevelFT->set_sensitive(false);
526  }
528  m_xStartEdit->set_value( rFormat.GetStart() );
529  }
530  SetModified();
531 }
532 
534 {
535  nActLevel = 0;
536  auto aRows = rBox.get_selected_rows();
537  if (std::find(aRows.begin(), aRows.end(), MAXLEVEL) != aRows.end())
538  {
539  nActLevel = 0xFFFF;
540  }
541  else
542  {
543  sal_uInt16 nMask = 1;
544  for( sal_uInt16 i = 0; i < MAXLEVEL; i++ )
545  {
546  if (std::find(aRows.begin(), aRows.end(), i) != aRows.end())
547  nActLevel |= nMask;
548  nMask <<= 1;
549  }
550  }
551  Update();
552 }
553 
554 IMPL_LINK(SwOutlineSettingsTabPage, ToggleComplete, weld::SpinButton&, rEdit, void)
555 {
556  sal_uInt16 nMask = 1;
557  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
558  {
559  if(nActLevel & nMask)
560  {
561  SwNumFormat aNumFormat(pNumRule->Get(i));
562  aNumFormat.SetIncludeUpperLevels( std::min( static_cast<sal_uInt8>(rEdit.get_value()),
563  static_cast<sal_uInt8>(i + 1)) );
564  pNumRule->Set(i, aNumFormat);
565  }
566  nMask <<= 1;
567  }
568  SetModified();
569 }
570 
572 {
573  sal_uInt8 i;
574 
575  const OUString aCollName(rBox.get_active_text());
576  //0xFFFF not allowed here (disable)
577  sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
578  OUString sOldName( pCollNames[nTmpLevel] );
579 
580  for( i = 0; i < MAXLEVEL; ++i)
581  pCollNames[i] = aSaveCollNames[i];
582 
583  if(aCollName == aNoFormatName)
584  pCollNames[nTmpLevel].clear();
585  else
586  {
587  pCollNames[nTmpLevel] = aCollName;
588  // template already in use?
589  for( i = 0; i < MAXLEVEL; ++i)
590  if(i != nTmpLevel && pCollNames[i] == aCollName )
591  pCollNames[i].clear();
592  }
593 
594  // search the oldname and put it into the current entries
595  if( !sOldName.isEmpty() )
596  for( i = 0; i < MAXLEVEL; ++i)
597  if( aSaveCollNames[ i ] == sOldName && i != nTmpLevel &&
598  pCollNames[ i ].isEmpty() )
599  {
600  sal_uInt8 n;
601  for( n = 0; n < MAXLEVEL; ++n )
602  if( pCollNames[ n ] == sOldName )
603  break;
604 
605  if( MAXLEVEL == n )
606  // it was an outline level name and the current entries is zero.
607  pCollNames[ i ] = sOldName;
608  }
609 
610  SetModified();
611  CollSave();
612 }
613 
615 {
616  for (sal_uInt8 i = 0; i < MAXLEVEL; ++i)
618 }
619 
621 {
622  sal_uInt16 nMask = 1;
623  SvxNumType nNumberType = m_xNumberBox->GetSelectedNumberingType();
624  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
625  {
626  if(nActLevel & nMask)
627  {
628  SwNumFormat aNumFormat(pNumRule->Get(i));
629  aNumFormat.SetNumberingType(nNumberType);
630  pNumRule->Set(i, aNumFormat);
631  CheckForStartValue_Impl(nNumberType);
632  }
633  nMask <<= 1;
634  }
635  SetModified();
636 }
637 
639 {
640  sal_uInt16 nMask = 1;
641  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
642  {
643  if(nActLevel & nMask)
644  {
645  SwNumFormat aNumFormat(pNumRule->Get(i));
646  aNumFormat.SetPrefix( m_xPrefixED->get_text() );
647  aNumFormat.SetSuffix( m_xSuffixED->get_text() );
648  pNumRule->Set(i, aNumFormat);
649  }
650  nMask <<= 1;
651  }
652  SetModified();
653 }
654 
655 IMPL_LINK( SwOutlineSettingsTabPage, StartModified, weld::SpinButton&, rEdit, void )
656 {
657  sal_uInt16 nMask = 1;
658  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
659  {
660  if(nActLevel & nMask)
661  {
662  SwNumFormat aNumFormat(pNumRule->Get(i));
663  aNumFormat.SetStart(static_cast<sal_uInt16>(rEdit.get_value()));
664  pNumRule->Set(i, aNumFormat);
665  }
666  nMask <<= 1;
667  }
668  SetModified();
669 }
670 
672 {
673  OUString sEntry = m_xCharFormatLB->get_active_text();
674  sal_uInt16 nMask = 1;
675  bool bFormatNone = sEntry == SwViewShell::GetShellRes()->aStrNone;
676  SwCharFormat* pFormat = nullptr;
677  if(!bFormatNone)
678  {
679  sal_uInt16 nChCount = pSh->GetCharFormatCount();
680  for(sal_uInt16 i = 0; i < nChCount; i++)
681  {
682  SwCharFormat& rChFormat = pSh->GetCharFormat(i);
683  if(rChFormat.GetName() == sEntry)
684  {
685  pFormat = &rChFormat;
686  break;
687  }
688  }
689  if(!pFormat)
690  {
691  SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
692  SfxStyleSheetBase* pBase;
693  pBase = pPool->Find(sEntry, SfxStyleFamily::Char);
694  if(!pBase)
695  pBase = &pPool->Make(sEntry, SfxStyleFamily::Page);
696  pFormat = static_cast<SwDocStyleSheet*>(pBase)->GetCharFormat();
697 
698  }
699  }
700 
701  for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
702  {
703  if(nActLevel & nMask)
704  {
705  SwNumFormat aNumFormat(pNumRule->Get(i));
706  if(bFormatNone)
707  aNumFormat.SetCharFormat(nullptr);
708  else
709  aNumFormat.SetCharFormat(pFormat);
710  pNumRule->Set(i, aNumFormat);
711  }
712  nMask <<= 1;
713  }
714 }
715 
717 {
718 }
719 
721 {
722  pSh = pShell;
723  // query this document's NumRules
725  pCollNames = static_cast<SwOutlineTabDialog*>(GetDialogController())->GetCollNames();
726 
727  CollSave();
728 
731  // set start value - nActLevel must be 1 here
732  sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
733  const SwNumFormat& rNumFormat = pNumRule->Get( nTmpLevel );
734  m_xStartEdit->set_value( rNumFormat.GetStart() );
735 
736  // create pool formats for headlines
737  for (sal_uInt16 i = 0; i < MAXLEVEL; ++i)
738  {
740  static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), OUString()));
741  m_xLevelLB->append_text( OUString::number(i + 1) );
742  }
743  OUString sStr = "1 - " + 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 
804 std::unique_ptr<SfxTabPage> SwOutlineSettingsTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
805  const SfxItemSet* rAttrSet)
806 {
807  return std::make_unique<SwOutlineSettingsTabPage>(pPage, pController, *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
IMPL_LINK_NOARG(SwNumNamesDlg, DoubleClickHdl, weld::TreeView &, bool)
Definition: outline.cxx:110
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:799
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:804
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:2493
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:2618
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:133
const OUString & GetName() const
Definition: numrule.hxx:221
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:329
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: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
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
SwOutlineSettingsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: outline.cxx:387
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:821
const OUString & GetPrefix() const
SwOutlineTabDialog(weld::Window *pParent, const SfxItemSet *pSwItemSet, SwWrtShell &)
Definition: outline.cxx:144
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:232
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: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:150
LabelFollowedBy GetLabelFollowedBy() const
sal_Int32 GetAbsLSpace() const
sal_uInt16 GetLevel(const OUString &rFormatName) const
Definition: outline.cxx:295
bool IsDark() const
virtual short Ok() override
Definition: outline.cxx:305
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
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
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:193
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:190
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:211
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:716
void SetCharFormat(SwCharFormat *)
Definition: number.cxx:271
const Size & GetGraphicSize() const
weld::Entry & rEdit
const Color & GetButtonTextColor() const
SwNumNamesDlg(weld::Window *pParent)
Definition: outline.cxx:116
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:154
void SetOutlineNumRule(const SwNumRule &)
Definition: ednumber.cxx:111
LanguageType GetAppLanguage()
Definition: init.cxx:729
RET_OK
int GetCurEntryPos() const
Definition: outline.cxx:72
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: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
OString const aName
OUString GetName() const
Definition: outline.cxx:71
void SetWrtShell(SwWrtShell *pShell)
Definition: outline.cxx:720
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:74
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:189
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