LibreOffice Module sw (master)  1
column.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 <column.hxx>
21 
22 #include <hintids.hxx>
23 #include <svx/dialmgr.hxx>
24 #include <svx/strings.hrc>
25 #include <sfx2/htmlmode.hxx>
26 #include <svx/colorbox.hxx>
27 #include <editeng/borderline.hxx>
28 #include <editeng/boxitem.hxx>
29 #include <editeng/lrspitem.hxx>
30 #include <editeng/sizeitem.hxx>
31 #include <editeng/frmdiritem.hxx>
32 #include <editeng/ulspitem.hxx>
33 #include <svl/ctloptions.hxx>
34 #include <svl/itemset.hxx>
35 #include <sfx2/dispatch.hxx>
36 #include <sfx2/viewfrm.hxx>
37 #include <vcl/event.hxx>
38 #include <vcl/fieldvalues.hxx>
39 #include <vcl/settings.hxx>
40 #include <vcl/svapp.hxx>
41 
42 #include <swmodule.hxx>
43 
44 #include <swtypes.hxx>
45 #include <wrtsh.hxx>
46 #include <view.hxx>
47 #include <docsh.hxx>
48 #include <uitool.hxx>
49 #include <cmdid.h>
50 #include <viewopt.hxx>
51 #include <fmtclbl.hxx>
52 #include <fmtfsize.hxx>
53 #include <frmatr.hxx>
54 #include <colmgr.hxx>
55 #include <prcntfld.hxx>
56 #include <strings.hrc>
57 #include <section.hxx>
58 #include <pagedesc.hxx>
59 
60 //to match associated data in ColumnPage.ui
61 #define LISTBOX_SELECTION 0
62 #define LISTBOX_SECTION 1
63 #define LISTBOX_SECTIONS 2
64 #define LISTBOX_PAGE 3
65 #define LISTBOX_FRAME 4
66 
67 using namespace ::com::sun::star;
68 
69 #define FRAME_FORMAT_WIDTH 1000
70 
71 // static data
72 const sal_uInt16 nVisCols = 3;
73 
74 static bool IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect )
75 {
76  rWrtSh.SwapPam();
77  bool bRet = pSect == rWrtSh.GetCurrSection();
78  rWrtSh.SwapPam();
79  return bRet;
80 }
81 
83  : SfxDialogController(pParent, "modules/swriter/ui/columndialog.ui", "ColumnDialog")
84  , m_rWrtShell(rSh)
85  , m_pFrameSet(nullptr)
86  , m_nOldSelection(0)
87  , m_nSelectionWidth(0)
88  , m_bPageChanged(false)
89  , m_bSectionChanged(false)
90  , m_bSelSectionChanged(false)
91  , m_bFrameChanged(false)
92  , m_xContentArea(m_xDialog->weld_content_area())
93  , m_xOkButton(m_xBuilder->weld_button("ok"))
94 {
95  SwRect aRect;
96  m_rWrtShell.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR);
97 
98  m_nSelectionWidth = aRect.Width();
99 
100  SfxItemSet* pColPgSet = nullptr;
101  static sal_uInt16 const aSectIds[] = { RES_COL, RES_COL,
104  0 };
105 
106  const SwSection* pCurrSection = m_rWrtShell.GetCurrSection();
107  const sal_uInt16 nFullSectCnt = m_rWrtShell.GetFullSelectedSectionCount();
108  if( pCurrSection && ( !m_rWrtShell.HasSelection() || 0 != nFullSectCnt ))
109  {
110  m_nSelectionWidth = rSh.GetSectionWidth(*pCurrSection->GetFormat());
111  if ( !m_nSelectionWidth )
113  m_pSectionSet.reset( new SfxItemSet( m_rWrtShell.GetAttrPool(), aSectIds ) );
114  m_pSectionSet->Put( pCurrSection->GetFormat()->GetAttrSet() );
115  pColPgSet = m_pSectionSet.get();
116  }
117 
119  ( !pCurrSection || ( 1 != nFullSectCnt &&
120  IsMarkInSameSection( m_rWrtShell, pCurrSection ) )))
121  {
122  m_pSelectionSet.reset( new SfxItemSet( m_rWrtShell.GetAttrPool(), aSectIds ) );
123  pColPgSet = m_pSelectionSet.get();
124  }
125 
127  {
128  const SwFrameFormat* pFormat = rSh.GetFlyFrameFormat() ;
129  m_pFrameSet = new SfxItemSet(m_rWrtShell.GetAttrPool(), aSectIds );
130  m_pFrameSet->Put(pFormat->GetFrameSize());
131  m_pFrameSet->Put(pFormat->GetCol());
132  pColPgSet = m_pFrameSet;
133  }
134 
135  const SwPageDesc* pPageDesc = m_rWrtShell.GetSelectedPageDescs();
136  if( pPageDesc )
137  {
138  m_pPageSet.reset( new SfxItemSet(
140  svl::Items<
143  RES_COL, RES_COL>{}) );
144 
145  const SwFrameFormat &rFormat = pPageDesc->GetMaster();
146  m_nPageWidth = rFormat.GetFrameSize().GetSize().Width();
147 
148  const SvxLRSpaceItem& rLRSpace = rFormat.GetLRSpace();
149  const SvxBoxItem& rBox = rFormat.GetBox();
150  m_nPageWidth -= rLRSpace.GetLeft() + rLRSpace.GetRight() + rBox.GetSmallestDistance();
151 
152  m_pPageSet->Put(rFormat.GetCol());
153  m_pPageSet->Put(rFormat.GetLRSpace());
154  pColPgSet = m_pPageSet.get();
155  }
156 
157  assert(pColPgSet);
158 
159  // create TabPage
160  m_xTabPage = std::make_unique<SwColumnPage>(m_xContentArea.get(), this, *pColPgSet);
161  m_xTabPage->GetApplyLabel()->show();
162  weld::ComboBox* pApplyToLB = m_xTabPage->GetApplyComboBox();
163  pApplyToLB->show();
164 
165  if (pCurrSection && (!m_rWrtShell.HasSelection() || 0 != nFullSectCnt))
166  {
167  pApplyToLB->remove_id(1 >= nFullSectCnt ? OUString::number(LISTBOX_SECTIONS) : OUString::number(LISTBOX_SECTION));
168  }
169  else
170  {
171  pApplyToLB->remove_id(OUString::number(LISTBOX_SECTION));
172  pApplyToLB->remove_id(OUString::number(LISTBOX_SECTIONS));
173  }
174 
176  ( !pCurrSection || ( 1 != nFullSectCnt &&
177  IsMarkInSameSection( m_rWrtShell, pCurrSection ) ))))
178  pApplyToLB->remove_id(OUString::number(LISTBOX_SELECTION));
179 
181  pApplyToLB->remove_id(OUString::number(LISTBOX_FRAME));
182 
183  const int nPagePos = pApplyToLB->find_id(OUString::number(LISTBOX_PAGE));
184  if (m_pPageSet && pPageDesc)
185  {
186  const OUString sPageStr = pApplyToLB->get_text(nPagePos) + pPageDesc->GetName();
187  pApplyToLB->remove(nPagePos);
188  OUString sId(OUString::number(LISTBOX_PAGE));
189  pApplyToLB->insert(nPagePos, sPageStr, &sId, nullptr, nullptr);
190  }
191  else
192  pApplyToLB->remove( nPagePos );
193 
194  pApplyToLB->set_active(0);
195  ObjectHdl(nullptr);
196 
197  pApplyToLB->connect_changed(LINK(this, SwColumnDlg, ObjectListBoxHdl));
198  m_xOkButton->connect_clicked(LINK(this, SwColumnDlg, OkHdl));
199  //#i80458# if no columns can be set then disable OK
200  if (!pApplyToLB->get_count())
201  m_xOkButton->set_sensitive(false);
202  //#i97810# set focus to the TabPage
203  m_xTabPage->ActivateColumnControl();
204 }
205 
207 {
208  m_xTabPage.reset();
209 }
210 
211 IMPL_LINK(SwColumnDlg, ObjectListBoxHdl, weld::ComboBox&, rBox, void)
212 {
213  ObjectHdl(&rBox);
214 }
215 
217 {
219 
220  if (pBox)
221  {
222  m_xTabPage->FillItemSet(pSet);
223  }
224  weld::ComboBox* pApplyToLB = m_xTabPage->GetApplyComboBox();
225  m_nOldSelection = pApplyToLB->get_active_id().toInt32();
227  switch(m_nOldSelection)
228  {
229  case LISTBOX_SELECTION :
230  pSet = m_pSelectionSet.get();
231  if( m_pSelectionSet )
232  pSet->Put(SwFormatFrameSize(SwFrameSize::Variable, nWidth, nWidth));
233  break;
234  case LISTBOX_SECTION :
235  case LISTBOX_SECTIONS :
236  pSet = m_pSectionSet.get();
237  pSet->Put(SwFormatFrameSize(SwFrameSize::Variable, nWidth, nWidth));
238  break;
239  case LISTBOX_PAGE :
240  nWidth = m_nPageWidth;
241  pSet = m_pPageSet.get();
242  pSet->Put(SwFormatFrameSize(SwFrameSize::Variable, nWidth, nWidth));
243  break;
244  case LISTBOX_FRAME:
245  pSet = m_pFrameSet;
246  break;
247  }
248 
249  bool bIsSection = pSet == m_pSectionSet.get() || pSet == m_pSelectionSet.get();
250  m_xTabPage->ShowBalance(bIsSection);
251  m_xTabPage->SetInSection(bIsSection);
252  m_xTabPage->SetFrameMode(true);
253  m_xTabPage->SetPageWidth(nWidth);
254  if( pSet )
255  m_xTabPage->Reset(pSet);
256 }
257 
259 {
260  // evaluate current selection
261  SfxItemSet* pSet = EvalCurrentSelection();
262  m_xTabPage->FillItemSet(pSet);
263 
264  if(m_pSelectionSet && SfxItemState::SET == m_pSelectionSet->GetItemState(RES_COL))
265  {
266  //insert region with columns
267  const SwFormatCol& rColItem = m_pSelectionSet->Get(RES_COL);
268  //only if there actually are columns!
269  if(rColItem.GetNumCols() > 1)
270  m_rWrtShell.GetView().GetViewFrame()->GetDispatcher()->Execute(
271  FN_INSERT_REGION, SfxCallMode::ASYNCHRON, *m_pSelectionSet );
272  }
273 
274  if(m_pSectionSet && m_pSectionSet->Count() && m_bSectionChanged )
275  {
276  const SwSection* pCurrSection = m_rWrtShell.GetCurrSection();
277  const SwSectionFormat* pFormat = pCurrSection->GetFormat();
278  const size_t nNewPos = m_rWrtShell.GetSectionFormatPos( *pFormat );
279  SwSectionData aData(*pCurrSection);
280  m_rWrtShell.UpdateSection( nNewPos, aData, m_pSectionSet.get() );
281  }
282 
283  if(m_pSectionSet && m_pSectionSet->Count() && m_bSelSectionChanged )
284  {
285  m_rWrtShell.SetSectionAttr( *m_pSectionSet );
286  }
287 
288  if(m_pPageSet && SfxItemState::SET == m_pPageSet->GetItemState(RES_COL) && m_bPageChanged)
289  {
290  // determine current PageDescriptor and fill the Set with it
291  const size_t nCurIdx = m_rWrtShell.GetCurPageDesc();
292  SwPageDesc aPageDesc(m_rWrtShell.GetPageDesc(nCurIdx));
293  SwFrameFormat &rFormat = aPageDesc.GetMaster();
294  rFormat.SetFormatAttr(m_pPageSet->Get(RES_COL));
295  m_rWrtShell.ChgPageDesc(nCurIdx, aPageDesc);
296  }
297  if(m_pFrameSet && SfxItemState::SET == m_pFrameSet->GetItemState(RES_COL) && m_bFrameChanged)
298  {
299  SfxItemSet aTmp(*m_pFrameSet->GetPool(), svl::Items<RES_COL, RES_COL>{});
300  aTmp.Put(*m_pFrameSet);
301  m_rWrtShell.StartAction();
302  m_rWrtShell.Push();
303  m_rWrtShell.SetFlyFrameAttr( aTmp );
304  // undo the frame selection again
305  if(m_rWrtShell.IsFrameSelected())
306  {
307  m_rWrtShell.UnSelectFrame();
308  m_rWrtShell.LeaveSelFrameMode();
309  }
310  m_rWrtShell.Pop();
311  m_rWrtShell.EndAction();
312  }
313  m_xDialog->response(RET_OK);
314 }
315 
317 {
318  SfxItemSet* pSet = nullptr;
319 
320  switch(m_nOldSelection)
321  {
322  case LISTBOX_SELECTION :
323  pSet = m_pSelectionSet.get();
324  break;
325  case LISTBOX_SECTION :
326  pSet = m_pSectionSet.get();
327  m_bSectionChanged = true;
328  break;
329  case LISTBOX_SECTIONS :
330  pSet = m_pSectionSet.get();
331  m_bSelSectionChanged = true;
332  break;
333  case LISTBOX_PAGE :
334  pSet = m_pPageSet.get();
335  m_bPageChanged = true;
336  break;
337  case LISTBOX_FRAME:
338  pSet = m_pFrameSet;
339  m_bFrameChanged = true;
340  break;
341  }
342 
343  return pSet;
344 }
345 
346 static
347 sal_uInt16 GetMaxWidth( SwColMgr const * pColMgr, sal_uInt16 nCols )
348 {
349  sal_uInt16 nMax = pColMgr->GetActualSize();
350  if( --nCols )
351  nMax -= pColMgr->GetGutterWidth() * nCols;
352  return nMax;
353 }
354 
355 const sal_uInt16 SwColumnPage::aPageRg[] = {
356  RES_COL, RES_COL,
357  0
358 };
359 
361 {
362  if( m_nCols )
363  {
364  const sal_uInt16 nWidth = GetMaxWidth( m_xColMgr.get(), m_nCols ) / m_nCols;
365 
366  for(sal_uInt16 i = 0; i < m_nCols; ++i)
367  m_nColWidth[i] = static_cast<tools::Long>(nWidth);
368  }
369 
370 }
371 
372 constexpr sal_uInt16 g_nMinWidth(MINLAY);
373 
374 // Now as TabPage
376  : SfxTabPage(pPage, pController, "modules/swriter/ui/columnpage.ui", "ColumnPage", &rSet)
377  , m_nFirstVis(0)
378  , m_pModifiedField(nullptr)
379  , m_bFormat(false)
380  , m_bFrame(false)
381  , m_bHtmlMode(false)
382  , m_bLockUpdate(false)
383  , m_xCLNrEdt(m_xBuilder->weld_spin_button("colsnf"))
384  , m_xBalanceColsCB(m_xBuilder->weld_check_button("balance"))
385  , m_xBtnBack(m_xBuilder->weld_button("back"))
386  , m_xLbl1(m_xBuilder->weld_label("1"))
387  , m_xLbl2(m_xBuilder->weld_label("2"))
388  , m_xLbl3(m_xBuilder->weld_label("3"))
389  , m_xBtnNext(m_xBuilder->weld_button("next"))
390  , m_xAutoWidthBox(m_xBuilder->weld_check_button("autowidth"))
391  , m_xLineTypeLbl(m_xBuilder->weld_label("linestyleft"))
392  , m_xLineWidthLbl(m_xBuilder->weld_label("linewidthft"))
393  , m_xLineWidthEdit(m_xBuilder->weld_metric_spin_button("linewidthmf", FieldUnit::POINT))
394  , m_xLineColorLbl(m_xBuilder->weld_label("linecolorft"))
395  , m_xLineHeightLbl(m_xBuilder->weld_label("lineheightft"))
396  , m_xLineHeightEdit(m_xBuilder->weld_metric_spin_button("lineheightmf", FieldUnit::PERCENT))
397  , m_xLinePosLbl(m_xBuilder->weld_label("lineposft"))
398  , m_xLinePosDLB(m_xBuilder->weld_combo_box("lineposlb"))
399  , m_xTextDirectionFT(m_xBuilder->weld_label("textdirectionft"))
400  , m_xTextDirectionLB(new svx::FrameDirectionListBox(m_xBuilder->weld_combo_box("textdirectionlb")))
401  , m_xLineColorDLB(new ColorListBox(m_xBuilder->weld_menu_button("colorlb"),
402  [this]{ return GetDialogController()->getDialog(); }))
403  , m_xLineTypeDLB(new SvtLineListBox(m_xBuilder->weld_menu_button("linestylelb")))
404  , m_xEd1(new SwPercentField(m_xBuilder->weld_metric_spin_button("width1mf", FieldUnit::CM)))
405  , m_xEd2(new SwPercentField(m_xBuilder->weld_metric_spin_button("width2mf", FieldUnit::CM)))
406  , m_xEd3(new SwPercentField(m_xBuilder->weld_metric_spin_button("width3mf", FieldUnit::CM)))
407  , m_xDistEd1(new SwPercentField(m_xBuilder->weld_metric_spin_button("spacing1mf", FieldUnit::CM)))
408  , m_xDistEd2(new SwPercentField(m_xBuilder->weld_metric_spin_button("spacing2mf", FieldUnit::CM)))
409  , m_xDefaultVS(new weld::CustomWeld(*m_xBuilder, "valueset", m_aDefaultVS))
410  , m_xPgeExampleWN(new weld::CustomWeld(*m_xBuilder, "pageexample", m_aPgeExampleWN))
411  , m_xFrameExampleWN(new weld::CustomWeld(*m_xBuilder, "frameexample", m_aFrameExampleWN))
412  , m_xApplyToFT(m_xBuilder->weld_label("applytoft"))
413  , m_xApplyToLB(m_xBuilder->weld_combo_box("applytolb"))
414 {
415  connectPercentField(*m_xEd1);
416  connectPercentField(*m_xEd2);
417  connectPercentField(*m_xEd3);
418  connectPercentField(*m_xDistEd1);
419  connectPercentField(*m_xDistEd2);
420 
421  m_xTextDirectionLB->append(SvxFrameDirection::Horizontal_LR_TB, SvxResId(RID_SVXSTR_FRAMEDIR_LTR));
422  m_xTextDirectionLB->append(SvxFrameDirection::Horizontal_RL_TB, SvxResId(RID_SVXSTR_FRAMEDIR_RTL));
423  m_xTextDirectionLB->append(SvxFrameDirection::Environment, SvxResId(RID_SVXSTR_FRAMEDIR_SUPER));
424 
425  SetExchangeSupport();
426 
427  m_aDefaultVS.SetColCount(5);
428 
429  for (int i = 0; i < 5; ++i)
430  //Set accessible name one by one
431  {
432  OUString aItemText;
433  switch( i )
434  {
435  case 0:
436  aItemText = SwResId( STR_COLUMN_VALUESET_ITEM0 ) ;
437  break;
438  case 1:
439  aItemText = SwResId( STR_COLUMN_VALUESET_ITEM1 ) ;
440  break;
441  case 2:
442  aItemText = SwResId( STR_COLUMN_VALUESET_ITEM2 ) ;
443  break;
444  case 3:
445  aItemText = SwResId( STR_COLUMN_VALUESET_ITEM3 );
446  break;
447  default:
448  aItemText = SwResId( STR_COLUMN_VALUESET_ITEM4 );
449  break;
450  }
451  m_aDefaultVS.InsertItem( i + 1, aItemText, i );
452  }
453 
454  m_aDefaultVS.SetSelectHdl(LINK(this, SwColumnPage, SetDefaultsHdl));
455 
456  Link<weld::SpinButton&,void> aCLNrLk = LINK(this, SwColumnPage, ColModify);
457  m_xCLNrEdt->connect_value_changed(aCLNrLk);
458  Link<weld::MetricSpinButton&,void> aLk = LINK(this, SwColumnPage, GapModify);
459  m_xDistEd1->connect_value_changed(aLk);
460  m_xDistEd2->connect_value_changed(aLk);
461 
462  aLk = LINK(this, SwColumnPage, EdModify);
463 
464  m_xEd1->connect_value_changed(aLk);
465  m_xEd2->connect_value_changed(aLk);
466  m_xEd3->connect_value_changed(aLk);
467 
468  m_xBtnBack->connect_clicked(LINK(this, SwColumnPage, Up));
469  m_xBtnNext->connect_clicked(LINK(this, SwColumnPage, Down));
470  m_xAutoWidthBox->connect_toggled(LINK(this, SwColumnPage, AutoWidthHdl));
471 
472  Link<weld::MetricSpinButton&,void> aLk2 = LINK( this, SwColumnPage, UpdateColMgr );
473  m_xLineTypeDLB->SetSelectHdl(LINK(this, SwColumnPage, UpdateColMgrLineBox));
474  m_xLineWidthEdit->connect_value_changed(aLk2);
475  m_xLineColorDLB->SetSelectHdl(LINK( this, SwColumnPage, UpdateColMgrColorBox));
476  m_xLineHeightEdit->connect_value_changed(aLk2);
477  m_xLinePosDLB->connect_changed(LINK(this, SwColumnPage, UpdateColMgrListBox));
478 
479  // Separator line
480  m_xLineTypeDLB->SetSourceUnit( FieldUnit::TWIP );
481 
482  // Fill the line styles listbox
483  m_xLineTypeDLB->InsertEntry(
484  ::editeng::SvxBorderLine::getWidthImpl(SvxBorderLineStyle::SOLID),
485  SvxBorderLineStyle::SOLID );
486  m_xLineTypeDLB->InsertEntry(
487  ::editeng::SvxBorderLine::getWidthImpl(SvxBorderLineStyle::DOTTED),
488  SvxBorderLineStyle::DOTTED );
489  m_xLineTypeDLB->InsertEntry(
490  ::editeng::SvxBorderLine::getWidthImpl(SvxBorderLineStyle::DASHED),
491  SvxBorderLineStyle::DASHED );
492 
493  sal_Int64 nLineWidth = m_xLineWidthEdit->get_value(FieldUnit::POINT);
494  nLineWidth = static_cast<tools::Long>(vcl::ConvertDoubleValue(
495  nLineWidth,
496  m_xLineWidthEdit->get_digits(),
497  FieldUnit::POINT, MapUnit::MapTwip ));
498  m_xLineTypeDLB->SetWidth(nLineWidth);
499  m_xLineColorDLB->SelectEntry(COL_BLACK);
500 }
501 
503 {
504  m_xFrameExampleWN.reset();
505  m_xPgeExampleWN.reset();
506  m_xDefaultVS.reset();
507  m_xDistEd2.reset();
508  m_xDistEd1.reset();
509  m_xEd3.reset();
510  m_xEd2.reset();
511  m_xEd1.reset();
512  m_xLineTypeDLB.reset();
513  m_xLineColorDLB.reset();
514  m_xTextDirectionLB.reset();
515 }
516 
518 {
519  tools::Long nNewMaxWidth = static_cast< tools::Long >(m_xEd1->NormalizePercent(nPageWidth));
520 
521  m_xDistEd1->set_max(nNewMaxWidth, FieldUnit::TWIP);
522  m_xDistEd2->set_max(nNewMaxWidth, FieldUnit::TWIP);
523  m_xEd1->set_max(nNewMaxWidth, FieldUnit::TWIP);
524  m_xEd2->set_max(nNewMaxWidth, FieldUnit::TWIP);
525  m_xEd3->set_max(nNewMaxWidth, FieldUnit::TWIP);
526 }
527 
529 {
530  weld::MetricSpinButton *pField = rWrap.get();
531  assert(pField);
532  m_aPercentFieldsMap[pField] = &rWrap;
533 }
534 
536 {
537  const sal_uInt16 nHtmlMode =
538  ::GetHtmlMode(static_cast<const SwDocShell*>(SfxObjectShell::Current()));
539  if(nHtmlMode & HTMLMODE_ON)
540  {
541  m_bHtmlMode = true;
542  m_xAutoWidthBox->set_sensitive(false);
543  }
545  m_xEd1->SetMetric(aMetric);
546  m_xEd2->SetMetric(aMetric);
547  m_xEd3->SetMetric(aMetric);
548  m_xDistEd1->SetMetric(aMetric);
549  m_xDistEd2->SetMetric(aMetric);
550  //default spacing between cols = 0.5cm
551  m_xDistEd1->set_value(50, FieldUnit::CM);
552  m_xDistEd2->set_value(50, FieldUnit::CM);
553 
554  m_xColMgr.reset(new SwColMgr(*rSet));
555  m_nCols = m_xColMgr->GetCount() ;
556  m_xCLNrEdt->set_max(std::max(static_cast<sal_uInt16>(m_xCLNrEdt->get_max()), m_nCols));
557 
558  if(m_bFrame)
559  {
560  if(m_bFormat) // there is no size here
561  m_xColMgr->SetActualWidth(FRAME_FORMAT_WIDTH);
562  else
563  {
564  const SwFormatFrameSize& rSize = rSet->Get(RES_FRM_SIZE);
565  const SvxBoxItem& rBox = rSet->Get(RES_BOX);
566  m_xColMgr->SetActualWidth(static_cast<sal_uInt16>(rSize.GetSize().Width()) - rBox.GetSmallestDistance());
567  }
568  }
569  if (m_xBalanceColsCB->get_visible())
570  {
571  const SfxPoolItem* pItem;
572  if( SfxItemState::SET == rSet->GetItemState( RES_COLUMNBALANCE, false, &pItem ))
573  m_xBalanceColsCB->set_active(!static_cast<const SwFormatNoBalancedColumns*>(pItem)->GetValue());
574  else
575  m_xBalanceColsCB->set_active(true);
576  }
577 
578  //text direction
579  if( SfxItemState::DEFAULT <= rSet->GetItemState( RES_FRAMEDIR ) )
580  {
581  const SvxFrameDirectionItem& rItem = rSet->Get(RES_FRAMEDIR);
582  SvxFrameDirection nVal = rItem.GetValue();
583  m_xTextDirectionLB->set_active_id(nVal);
584  m_xTextDirectionLB->save_value();
585  }
586 
587  Init();
588  ActivatePage( *rSet );
589 }
590 
591 // create TabPage
592 std::unique_ptr<SfxTabPage> SwColumnPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet)
593 {
594  return std::make_unique<SwColumnPage>(pPage, pController, *rSet);
595 }
596 
597 // stuff attributes into the Set when OK
599 {
600  // set in ItemSet;
601  // the current settings are already present
602 
603  const SfxPoolItem* pOldItem;
604  const SwFormatCol& rCol = m_xColMgr->GetColumns();
605  if(nullptr == (pOldItem = GetOldItem( *rSet, RES_COL )) ||
606  rCol != *pOldItem )
607  rSet->Put(rCol);
608 
609  if (m_xBalanceColsCB->get_visible())
610  {
611  rSet->Put(SwFormatNoBalancedColumns(!m_xBalanceColsCB->get_active()));
612  }
613  if (m_xTextDirectionLB->get_visible())
614  {
615  if (m_xTextDirectionLB->get_value_changed_from_saved())
616  {
617  rSet->Put(SvxFrameDirectionItem(m_xTextDirectionLB->get_active_id(), RES_FRAMEDIR) );
618  }
619  }
620  return true;
621 }
622 
623 // update ColumnManager
624 IMPL_LINK_NOARG( SwColumnPage, UpdateColMgrListBox, weld::ComboBox&, void )
625 {
626  UpdateColMgr(*m_xLineWidthEdit);
627 }
628 
629 IMPL_LINK_NOARG( SwColumnPage, UpdateColMgrLineBox, SvtLineListBox&, void )
630 {
631  UpdateColMgr(*m_xLineWidthEdit);
632 }
633 
634 IMPL_LINK_NOARG( SwColumnPage, UpdateColMgrColorBox, ColorListBox&, void )
635 {
636  UpdateColMgr(*m_xLineWidthEdit);
637 }
638 
640 {
641  if (!m_xColMgr)
642  return;
643  tools::Long nGutterWidth = m_xColMgr->GetGutterWidth();
644  if (m_nCols > 1)
645  {
646  // Determine whether the most narrow column is too narrow
647  // for the adjusted column gap
648  tools::Long nMin = m_nColWidth[0];
649 
650  for( sal_uInt16 i = 1; i < m_nCols; ++i )
651  nMin = std::min(nMin, m_nColWidth[i]);
652 
653  bool bAutoWidth = m_xAutoWidthBox->get_active();
654  if(!bAutoWidth)
655  {
656  m_xColMgr->SetAutoWidth(false);
657  // when the user didn't allocate the whole width,
658  // add the missing amount to the last column.
659  tools::Long nSum = 0;
660  for(sal_uInt16 i = 0; i < m_nCols; ++i)
661  nSum += m_nColWidth[i];
662  nGutterWidth = 0;
663  for(sal_uInt16 i = 0; i < m_nCols - 1; ++i)
664  nGutterWidth += m_nColDist[i];
665  nSum += nGutterWidth;
666 
667  tools::Long nMaxW = m_xColMgr->GetActualSize();
668 
669  if( nSum < nMaxW )
670  m_nColWidth[m_nCols - 1] += nMaxW - nSum;
671 
672  m_xColMgr->SetColWidth( 0, static_cast< sal_uInt16 >(m_nColWidth[0] + m_nColDist[0]/2) );
673  for( sal_uInt16 i = 1; i < m_nCols-1; ++i )
674  {
675  tools::Long nActDist = (m_nColDist[i] + m_nColDist[i - 1]) / 2;
676  m_xColMgr->SetColWidth( i, static_cast< sal_uInt16 >(m_nColWidth[i] + nActDist ));
677  }
678  m_xColMgr->SetColWidth( m_nCols-1, static_cast< sal_uInt16 >(m_nColWidth[m_nCols-1] + m_nColDist[m_nCols -2]/2) );
679 
680  }
681 
682  bool bEnable = isLineNotNone();
683  m_xLineHeightEdit->set_sensitive(bEnable);
684  m_xLineHeightLbl->set_sensitive(bEnable);
685  m_xLineWidthLbl->set_sensitive(bEnable);
686  m_xLineWidthEdit->set_sensitive(bEnable);
687  m_xLineColorDLB->set_sensitive(bEnable);
688  m_xLineColorLbl->set_sensitive(bEnable);
689 
690  sal_Int64 nLineWidth = m_xLineWidthEdit->get_value(FieldUnit::PERCENT);
691  nLineWidth = static_cast<tools::Long>(vcl::ConvertDoubleValue(
692  nLineWidth,
693  m_xLineWidthEdit->get_digits(),
694  m_xLineWidthEdit->get_unit(), MapUnit::MapTwip ));
695  if( !bEnable )
696  m_xColMgr->SetNoLine();
697  else
698  {
699  m_xColMgr->SetLineWidthAndColor(
700  m_xLineTypeDLB->GetSelectEntryStyle(),
701  nLineWidth,
702  m_xLineColorDLB->GetSelectEntryColor() );
703  m_xColMgr->SetAdjust(SwColLineAdj(m_xLinePosDLB->get_active() + 1));
704  m_xColMgr->SetLineHeightPercent(static_cast<short>(m_xLineHeightEdit->get_value(FieldUnit::PERCENT)));
705  bEnable = m_xColMgr->GetLineHeightPercent() != 100;
706  }
707  m_xLinePosLbl->set_sensitive(bEnable);
708  m_xLinePosDLB->set_sensitive(bEnable);
709 
710  //fdo#66815 if the values are going to be the same, don't update
711  //them to avoid the listbox selection resetting
712  if (nLineWidth != m_xLineTypeDLB->GetWidth())
713  m_xLineTypeDLB->SetWidth(nLineWidth);
714  Color aColor(m_xLineColorDLB->GetSelectEntryColor());
715  if (aColor != m_xLineTypeDLB->GetColor())
716  m_xLineTypeDLB->SetColor(aColor);
717  }
718  else
719  {
720  m_xColMgr->NoCols();
721  m_nCols = 0;
722  }
723 
724  //set maximum values
725  m_xCLNrEdt->set_max(std::max(tools::Long(1),
726  std::min(tools::Long(nMaxCols), tools::Long(m_xColMgr->GetActualSize() / (nGutterWidth + MINLAY)) )));
727 
728  //prompt example window
729  if(!m_bLockUpdate)
730  {
731  if(m_bFrame)
732  {
733  m_aFrameExampleWN.SetColumns(m_xColMgr->GetColumns());
734  m_aFrameExampleWN.Invalidate();
735  }
736  else
737  m_aPgeExampleWN.Invalidate();
738  }
739 }
740 
742 {
743  m_xCLNrEdt->set_value(m_nCols);
744 
745  bool bAutoWidth = m_xColMgr->IsAutoWidth() || m_bHtmlMode;
746  m_xAutoWidthBox->set_active(bAutoWidth);
747 
748  sal_Int32 nColumnWidthSum = 0;
749  // set the widths
750  for(sal_uInt16 i = 0; i < m_nCols; ++i)
751  {
752  m_nColWidth[i] = m_xColMgr->GetColWidth(i);
753  nColumnWidthSum += m_nColWidth[i];
754  if(i < m_nCols - 1)
755  m_nColDist[i] = m_xColMgr->GetGutterWidth(i);
756  }
757 
758  if( 1 < m_nCols )
759  {
760  // #97495# make sure that the automatic column width's are always equal
761  if(bAutoWidth)
762  {
763  nColumnWidthSum /= m_nCols;
764  for(sal_uInt16 i = 0; i < m_nCols; ++i)
765  m_nColWidth[i] = nColumnWidthSum;
766  }
767  SwColLineAdj eAdj = m_xColMgr->GetAdjust();
768  if( COLADJ_NONE == eAdj ) // the dialog doesn't know a NONE!
769  {
770  eAdj = COLADJ_TOP;
771  //without Adjust no line type
772  m_xLineTypeDLB->SelectEntry(SvxBorderLineStyle::NONE);
773  m_xLineHeightEdit->set_value(100, FieldUnit::PERCENT);
774  }
775  else
776  {
777  // Need to multiply by 100 because of the 2 decimals
778  m_xLineWidthEdit->set_value( m_xColMgr->GetLineWidth() * 100, FieldUnit::TWIP);
779  m_xLineColorDLB->SelectEntry( m_xColMgr->GetLineColor() );
780  m_xLineTypeDLB->SelectEntry( m_xColMgr->GetLineStyle() );
781  m_xLineTypeDLB->SetWidth( m_xColMgr->GetLineWidth( ) );
782  m_xLineHeightEdit->set_value(m_xColMgr->GetLineHeightPercent(), FieldUnit::PERCENT);
783 
784  }
785  m_xLinePosDLB->set_active( static_cast< sal_Int32 >(eAdj - 1) );
786  }
787  else
788  {
789  m_xLinePosDLB->set_active(0);
790  m_xLineTypeDLB->SelectEntry(SvxBorderLineStyle::NONE);
791  m_xLineHeightEdit->set_value(100, FieldUnit::PERCENT);
792  }
793 
794  UpdateCols();
795  Update(nullptr);
796 
797  // set maximum number of columns
798  // values below 1 are not allowed
799  m_xCLNrEdt->set_max(std::max(tools::Long(1),
800  std::min(tools::Long(nMaxCols), tools::Long(m_xColMgr->GetActualSize() / g_nMinWidth) )));
801 }
802 
804 {
805  // nothing is turned off
806  return m_xLineTypeDLB->GetSelectEntryStyle() != SvxBorderLineStyle::NONE;
807 }
808 
809 /*
810  * The number of columns has changed -- here the controls for editing of the
811  * columns are en- or disabled according to the column number. In case there are
812  * more than nVisCols (=3) all Edit are being enabled and the buttons for
813  * scrolling too. Otherwise Edits are being enabled according to the column
814  * numbers; one column can not be edited.
815  */
817 {
818  bool bEnableBtns= false;
819  bool bEnable12 = false;
820  bool bEnable3 = false;
821  const bool bEdit = !m_xAutoWidthBox->get_active();
822  if ( m_nCols > nVisCols )
823  {
824  bEnableBtns = !m_bHtmlMode;
825  bEnable12 = bEnable3 = bEdit;
826  }
827  else if( bEdit )
828  {
829  // here are purposely hardly any breaks
830  switch(m_nCols)
831  {
832  case 3: bEnable3 = true;
833  [[fallthrough]];
834  case 2: bEnable12= true; break;
835  default: /* do nothing */;
836  }
837  }
838  m_xEd1->set_sensitive(bEnable12);
839  bool bEnable = m_nCols > 1;
840  m_xDistEd1->set_sensitive(bEnable);
841  m_xAutoWidthBox->set_sensitive(bEnable && !m_bHtmlMode);
842  m_xEd2->set_sensitive(bEnable12);
843  m_xDistEd2->set_sensitive(bEnable3);
844  m_xEd3->set_sensitive(bEnable3);
845  m_xLbl1->set_sensitive(bEnable12);
846  m_xLbl2->set_sensitive(bEnable12);
847  m_xLbl3->set_sensitive(bEnable3);
848  m_xBtnBack->set_sensitive(bEnableBtns);
849  m_xBtnNext->set_sensitive(bEnableBtns);
850 
851  m_xLineTypeDLB->set_sensitive( bEnable );
852  m_xLineTypeLbl->set_sensitive( bEnable );
853 
854  if (bEnable)
855  {
856  bEnable = isLineNotNone();
857  }
858 
859  //all these depend on > 1 column and line style != none
860  m_xLineHeightEdit->set_sensitive(bEnable);
861  m_xLineHeightLbl->set_sensitive(bEnable);
862  m_xLineWidthLbl->set_sensitive(bEnable);
863  m_xLineWidthEdit->set_sensitive(bEnable);
864  m_xLineColorDLB->set_sensitive(bEnable);
865  m_xLineColorLbl->set_sensitive(bEnable);
866 
867  if (bEnable)
868  bEnable = m_xColMgr->GetLineHeightPercent() != 100;
869 
870  //and these additionally depend on line height != 100%
871  m_xLinePosDLB->set_sensitive(bEnable);
872  m_xLinePosLbl->set_sensitive(bEnable);
873 }
874 
875 void SwColumnPage::SetLabels( sal_uInt16 nVis )
876 {
877  //insert ~ before the last character, e.g. 1 -> ~1, 10 -> 1~0
878  const OUString sLbl( '~' );
879 
880  const OUString sLbl1(OUString::number( nVis + 1 ));
881  m_xLbl1->set_label(sLbl1.replaceAt(sLbl1.getLength()-1, 0, sLbl));
882 
883  const OUString sLbl2(OUString::number( nVis + 2 ));
884  m_xLbl2->set_label(sLbl2.replaceAt(sLbl2.getLength()-1, 0, sLbl));
885 
886  const OUString sLbl3(OUString::number( nVis + 3 ));
887  m_xLbl3->set_label(sLbl3.replaceAt(sLbl3.getLength()-1, 0, sLbl));
888 
889  const OUString sColumnWidth = SwResId( STR_ACCESS_COLUMN_WIDTH ) ;
890  m_xEd1->set_accessible_name(sColumnWidth.replaceFirst("%1", sLbl1));
891  m_xEd2->set_accessible_name(sColumnWidth.replaceFirst("%1", sLbl2));
892  m_xEd3->set_accessible_name(sColumnWidth.replaceFirst("%1", sLbl3));
893 
894  const OUString sDist = SwResId( STR_ACCESS_PAGESETUP_SPACING ) ;
895  m_xDistEd1->set_accessible_name(
896  sDist.replaceFirst("%1", sLbl1).replaceFirst("%2", sLbl2));
897 
898  m_xDistEd2->set_accessible_name(
899  sDist.replaceFirst("%1", sLbl2).replaceFirst("%2", sLbl3));
900 }
901 
902 /*
903  * Handler that is called at alteration of the column number. An alteration of
904  * the column number overwrites potential user's width settings; all columns
905  * are equally wide.
906  */
908 {
909  ColModify(/*bForceColReset=*/false);
910 }
911 
912 void SwColumnPage::ColModify(bool bForceColReset)
913 {
914  m_nCols = static_cast<sal_uInt16>(m_xCLNrEdt->get_value());
915  //#107890# the handler is also called from LoseFocus()
916  //then no change has been made and thus no action should be taken
917  // #i17816# changing the displayed types within the ValueSet
918  //from two columns to two columns with different settings doesn't invalidate the
919  // example windows in ::ColModify()
920  if (!bForceColReset && m_xColMgr->GetCount() == m_nCols)
921  return;
922 
923  if (!bForceColReset)
925  tools::Long nDist = static_cast< tools::Long >(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
926  m_xColMgr->SetCount(m_nCols, static_cast<sal_uInt16>(nDist));
927  for(sal_uInt16 i = 0; i < m_nCols; i++)
928  m_nColDist[i] = nDist;
929  m_nFirstVis = 0;
931  UpdateCols();
932  ResetColWidth();
933  Update(nullptr);
934 }
935 
936 /*
937  * Modify handler for an alteration of the column width or the column gap.
938  * These changes take effect time-displaced. With an alteration of the column
939  * width the automatic calculation of the column width is overruled; only an
940  * alteration of the column number leads back to that default.
941  */
942 IMPL_LINK(SwColumnPage, GapModify, weld::MetricSpinButton&, rMetricField, void)
943 {
944  if (m_nCols < 2)
945  return;
946  SwPercentField *pField = m_aPercentFieldsMap[&rMetricField];
947  assert(pField);
948  tools::Long nActValue = static_cast< tools::Long >(pField->DenormalizePercent(pField->get_value(FieldUnit::TWIP)));
949  if (m_xAutoWidthBox->get_active())
950  {
951  const tools::Long nMaxGap = static_cast< tools::Long >
952  ((m_xColMgr->GetActualSize() - m_nCols * MINLAY)/(m_nCols - 1));
953  if(nActValue > nMaxGap)
954  {
955  nActValue = nMaxGap;
956  m_xDistEd1->set_value(m_xDistEd1->NormalizePercent(nMaxGap), FieldUnit::TWIP);
957  }
958  m_xColMgr->SetGutterWidth(static_cast<sal_uInt16>(nActValue));
959  for(sal_uInt16 i = 0; i < m_nCols; i++)
960  m_nColDist[i] = nActValue;
961 
962  ResetColWidth();
963  UpdateCols();
964  }
965  else
966  {
967  const sal_uInt16 nVis = m_nFirstVis + ((pField == m_xDistEd2.get()) ? 1 : 0);
968  tools::Long nDiff = nActValue - m_nColDist[nVis];
969  if(nDiff)
970  {
971  tools::Long nLeft = m_nColWidth[nVis];
972  tools::Long nRight = m_nColWidth[nVis + 1];
973  if(nLeft + nRight + 2 * MINLAY < nDiff)
974  nDiff = nLeft + nRight - 2 * MINLAY;
975  if(nDiff < nRight - MINLAY)
976  {
977  nRight -= nDiff;
978  }
979  else
980  {
981  tools::Long nTemp = nDiff - nRight + MINLAY;
982  nRight = MINLAY;
983  if(nLeft > nTemp - MINLAY)
984  {
985  nLeft -= nTemp;
986  nTemp = 0;
987  }
988  else
989  {
990  nTemp -= nLeft + MINLAY;
991  nLeft = MINLAY;
992  }
993  nDiff = nTemp;
994  }
995  m_nColWidth[nVis] = nLeft;
996  m_nColWidth[nVis + 1] = nRight;
997  m_nColDist[nVis] += nDiff;
998 
999  m_xColMgr->SetColWidth( nVis, sal_uInt16(nLeft) );
1000  m_xColMgr->SetColWidth( nVis + 1, sal_uInt16(nRight) );
1001  m_xColMgr->SetGutterWidth( sal_uInt16(m_nColDist[nVis]), nVis );
1002  }
1003 
1004  }
1005  Update(&rMetricField);
1006 }
1007 
1009 {
1010  SwPercentField *pField = m_aPercentFieldsMap[&rEdit];
1011  assert(pField);
1012  m_pModifiedField = pField;
1013  Timeout();
1014 }
1015 
1016 // Handler behind the Checkbox for automatic width. When the box is checked
1017 // no explicit values for the column width can be entered.
1018 IMPL_LINK(SwColumnPage, AutoWidthHdl, weld::ToggleButton&, rBox, void)
1019 {
1020  tools::Long nDist = static_cast< tools::Long >(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
1021  m_xColMgr->SetCount(m_nCols, static_cast<sal_uInt16>(nDist));
1022  for(sal_uInt16 i = 0; i < m_nCols; i++)
1023  m_nColDist[i] = nDist;
1024  if (rBox.get_active())
1025  {
1026  m_xColMgr->SetGutterWidth(sal_uInt16(nDist));
1027  ResetColWidth();
1028  }
1029  m_xColMgr->SetAutoWidth(rBox.get_active(), sal_uInt16(nDist));
1030  UpdateCols();
1031  Update(nullptr);
1032 }
1033 
1034 // scroll up the contents of the edits
1036 {
1037  if( m_nFirstVis )
1038  {
1039  --m_nFirstVis;
1040  SetLabels( m_nFirstVis );
1041  Update(nullptr);
1042  }
1043 }
1044 
1045 // scroll down the contents of the edits.
1047 {
1048  if( m_nFirstVis + nVisCols < m_nCols )
1049  {
1050  ++m_nFirstVis;
1051  SetLabels( m_nFirstVis );
1052  Update(nullptr);
1053  }
1054 }
1055 
1056 // relict from ancient times - now directly without time handler; triggered by
1057 // an alteration of the column width or the column gap.
1059 {
1060  SwPercentField *pField = m_pModifiedField;
1061  if (m_pModifiedField)
1062  {
1063  // find the changed column
1064  sal_uInt16 nChanged = m_nFirstVis;
1065  if (m_pModifiedField == m_xEd2.get())
1066  ++nChanged;
1067  else if (m_pModifiedField == m_xEd3.get())
1068  nChanged += 2;
1069 
1070  tools::Long nNewWidth = static_cast< tools::Long >
1072  tools::Long nDiff = nNewWidth - m_nColWidth[nChanged];
1073 
1074  // when it's the last column
1075  if(nChanged == m_nCols - 1)
1076  {
1077  m_nColWidth[0] -= nDiff;
1078  if(m_nColWidth[0] < static_cast<tools::Long>(g_nMinWidth))
1079  {
1080  nNewWidth -= g_nMinWidth - m_nColWidth[0];
1081  m_nColWidth[0] = g_nMinWidth;
1082  }
1083 
1084  }
1085  else if(nDiff)
1086  {
1087  m_nColWidth[nChanged + 1] -= nDiff;
1088  if(m_nColWidth[nChanged + 1] < static_cast<tools::Long>(g_nMinWidth))
1089  {
1090  nNewWidth -= g_nMinWidth - m_nColWidth[nChanged + 1];
1091  m_nColWidth[nChanged + 1] = g_nMinWidth;
1092  }
1093  }
1094  m_nColWidth[nChanged] = nNewWidth;
1095  m_pModifiedField = nullptr;
1096  }
1097 
1098  Update(pField ? pField->get() : nullptr);
1099 }
1100 
1101 // Update the view
1102 void SwColumnPage::Update(const weld::MetricSpinButton* pInteractiveField)
1103 {
1104  m_xBalanceColsCB->set_sensitive(m_nCols > 1);
1105  if(m_nCols >= 2)
1106  {
1107  sal_Int64 nCurrentValue, nNewValue;
1108 
1109  nCurrentValue = m_xEd1->NormalizePercent(m_xEd1->DenormalizePercent(m_xEd1->get_value(FieldUnit::TWIP)));
1110  nNewValue = m_xEd1->NormalizePercent(m_nColWidth[m_nFirstVis]);
1111 
1112  //fdo#87612 if we're interacting with this widget and the value will be the same
1113  //then leave it alone (i.e. don't change equivalent values of e.g. .8 -> 0.8)
1114  if (nNewValue != nCurrentValue || pInteractiveField != m_xEd1->get())
1115  m_xEd1->set_value(nNewValue, FieldUnit::TWIP);
1116 
1117  nCurrentValue = m_xDistEd1->NormalizePercent(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
1118  nNewValue = m_xDistEd1->NormalizePercent(m_nColDist[m_nFirstVis]);
1119  if (nNewValue != nCurrentValue || pInteractiveField != m_xDistEd1->get())
1120  m_xDistEd1->set_value(nNewValue, FieldUnit::TWIP);
1121 
1122  nCurrentValue = m_xEd2->NormalizePercent(m_xEd2->DenormalizePercent(m_xEd2->get_value(FieldUnit::TWIP)));
1123  nNewValue = m_xEd2->NormalizePercent(m_nColWidth[m_nFirstVis+1]);
1124  if (nNewValue != nCurrentValue || pInteractiveField != m_xEd2->get())
1125  m_xEd2->set_value(nNewValue, FieldUnit::TWIP);
1126 
1127  if(m_nCols >= 3)
1128  {
1129  nCurrentValue = m_xDistEd2->NormalizePercent(m_xDistEd2->DenormalizePercent(m_xDistEd2->get_value(FieldUnit::TWIP)));
1130  nNewValue = m_xDistEd2->NormalizePercent(m_nColDist[m_nFirstVis+1]);
1131  if (nNewValue != nCurrentValue || pInteractiveField != m_xDistEd2->get())
1132  m_xDistEd2->set_value(nNewValue, FieldUnit::TWIP);
1133 
1134  nCurrentValue = m_xEd3->NormalizePercent(m_xEd3->DenormalizePercent(m_xEd3->get_value(FieldUnit::TWIP)));
1135  nNewValue = m_xEd3->NormalizePercent(m_nColWidth[m_nFirstVis+2]);
1136  if (nNewValue != nCurrentValue || pInteractiveField != m_xEd3->get())
1137  m_xEd3->set_value(nNewValue, FieldUnit::TWIP);
1138  }
1139  else
1140  {
1141  m_xEd3->set_text(OUString());
1142  m_xDistEd2->set_text(OUString());
1143  }
1144  }
1145  else
1146  {
1147  m_xEd1->set_text(OUString());
1148  m_xEd2->set_text(OUString());
1149  m_xEd3->set_text(OUString());
1150  m_xDistEd1->set_text(OUString());
1151  m_xDistEd2->set_text(OUString());
1152  }
1153  UpdateColMgr(*m_xLineWidthEdit);
1154 }
1155 
1156 // Update Bsp
1158 {
1159  bool bVertical = false;
1160  if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_FRAMEDIR))
1161  {
1162  const SvxFrameDirectionItem& rDirItem =
1163  rSet.Get(RES_FRAMEDIR);
1164  bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB||
1165  rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB;
1166  }
1167 
1168  if (!m_bFrame)
1169  {
1170  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PAGE_SIZE ))
1171  {
1172  const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
1173 
1174  sal_uInt16 nActWidth;
1175 
1176  if (!bVertical)
1177  {
1178  const SvxLRSpaceItem& rLRSpace = rSet.Get(RES_LR_SPACE);
1179  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
1180  nActWidth = rSize.GetSize().Width()
1181  - rLRSpace.GetLeft() - rLRSpace.GetRight() - rBox.GetSmallestDistance();
1182  }
1183  else
1184  {
1185  const SvxULSpaceItem& rULSpace = rSet.Get( RES_UL_SPACE );
1186  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
1187  nActWidth = rSize.GetSize().Height()
1188  - rULSpace.GetUpper() - rULSpace.GetLower() - rBox.GetSmallestDistance();
1189 
1190  }
1191 
1192  if( m_xColMgr->GetActualSize() != nActWidth)
1193  {
1194  m_xColMgr->SetActualWidth(nActWidth);
1195  ColModify(/*bForceColReset=*/false);
1196  UpdateColMgr( *m_xLineWidthEdit );
1197  }
1198  }
1199  m_xFrameExampleWN->hide();
1201  m_xPgeExampleWN->show();
1202 
1203  }
1204  else
1205  {
1206  m_xPgeExampleWN->hide();
1207  m_xFrameExampleWN->show();
1208 
1209  // Size
1210  const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE);
1211  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
1212 
1213  sal_uInt16 nTotalWish;
1214  if (m_bFormat)
1215  nTotalWish = FRAME_FORMAT_WIDTH;
1216  else
1217  {
1218  tools::Long const nDistance = rBox.GetSmallestDistance();
1219  nTotalWish = (!bVertical ? rSize.GetWidth() : rSize.GetHeight()) - 2 * nDistance;
1220  }
1221 
1222  // set maximum values of column width
1223  SetPageWidth(nTotalWish);
1224 
1225  if(m_xColMgr->GetActualSize() != nTotalWish)
1226  {
1227  m_xColMgr->SetActualWidth(nTotalWish);
1228  Init();
1229  }
1230  bool bPercent;
1231  // only relative data in frame format
1232  if ( m_bFormat || (rSize.GetWidthPercent() && rSize.GetWidthPercent() != SwFormatFrameSize::SYNCED) )
1233  {
1234  // set value for 100%
1235  m_xEd1->SetRefValue(nTotalWish);
1236  m_xEd2->SetRefValue(nTotalWish);
1237  m_xEd3->SetRefValue(nTotalWish);
1238  m_xDistEd1->SetRefValue(nTotalWish);
1239  m_xDistEd2->SetRefValue(nTotalWish);
1240 
1241  // switch to %-view
1242  bPercent = true;
1243  }
1244  else
1245  bPercent = false;
1246 
1247  m_xEd1->ShowPercent(bPercent);
1248  m_xEd2->ShowPercent(bPercent);
1249  m_xEd3->ShowPercent(bPercent);
1250  m_xDistEd1->ShowPercent(bPercent);
1251  m_xDistEd2->ShowPercent(bPercent);
1252  m_xDistEd1->SetMetricFieldMin(0);
1253  m_xDistEd2->SetMetricFieldMin(0);
1254  }
1255  Update(nullptr);
1256 }
1257 
1259 {
1260  if(_pSet)
1261  FillItemSet(_pSet);
1262 
1263  return DeactivateRC::LeavePage;
1264 }
1265 
1266 IMPL_LINK(SwColumnPage, SetDefaultsHdl, ValueSet *, pVS, void)
1267 {
1268  const sal_uInt16 nItem = pVS->GetSelectedItemId();
1269  if( nItem < 4 )
1270  {
1271  m_xCLNrEdt->set_value(nItem);
1272  m_xAutoWidthBox->set_active(true);
1273  m_xDistEd1->set_value(50, FieldUnit::CM);
1274  ColModify(/*bForceColReset=*/true);
1275  }
1276  else
1277  {
1278  m_bLockUpdate = true;
1279  m_xCLNrEdt->set_value(2);
1280  m_xAutoWidthBox->set_active(false);
1281  m_xDistEd1->set_value(50, FieldUnit::CM);
1282  ColModify(/*bForceColReset=*/true);
1283  // now set the width ratio to 2 : 1 or 1 : 2 respectively
1284  const tools::Long nSmall = static_cast< tools::Long >(m_xColMgr->GetActualSize() / 3);
1285  if(nItem == 4)
1286  {
1287  m_xEd2->set_value(m_xEd2->NormalizePercent(nSmall), FieldUnit::TWIP);
1288  m_pModifiedField = m_xEd2.get();
1289  }
1290  else
1291  {
1292  m_xEd1->set_value(m_xEd1->NormalizePercent(nSmall), FieldUnit::TWIP);
1293  m_pModifiedField = m_xEd1.get();
1294  }
1295  m_bLockUpdate = false;
1296  Timeout();
1297 
1298  }
1299 }
1300 
1302 {
1303  m_bFrame = bMod;
1304 }
1305 
1307 {
1308  if(!SW_MOD()->GetCTLOptions().IsCTLFontEnabled())
1309  return;
1310 
1311  m_xTextDirectionFT->set_visible(bSet);
1312  m_xTextDirectionLB->set_visible(bSet);
1313 }
1314 
1316 {
1317  vcl::RenderContext* pDev = rUDEvt.GetRenderContext();
1318  const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
1319 
1320  tools::Rectangle aRect = rUDEvt.GetRect();
1321  const sal_uInt16 nItemId = rUDEvt.GetItemId();
1322  tools::Long nRectWidth = aRect.GetWidth();
1323  tools::Long nRectHeight = aRect.GetHeight();
1324 
1325  Point aBLPos = aRect.TopLeft();
1326  Color aFillColor(pDev->GetFillColor());
1327  Color aLineColor(pDev->GetLineColor());
1328  pDev->SetFillColor(rStyleSettings.GetFieldColor());
1329  pDev->SetLineColor(rStyleSettings.GetFieldTextColor());
1330 
1331  tools::Long nStep = std::abs(std::abs(nRectHeight * 95 /100) / 11);
1332  tools::Long nTop = (nRectHeight - 11 * nStep ) / 2;
1333  sal_uInt16 nCols = 0;
1334  tools::Long nStarts[3];
1335  tools::Long nEnds[3];
1336  nStarts[0] = nRectWidth * 10 / 100;
1337  switch( nItemId )
1338  {
1339  case 1:
1340  nEnds[0] = nRectWidth * 9 / 10;
1341  nCols = 1;
1342  break;
1343  case 2: nCols = 2;
1344  nEnds[0] = nRectWidth * 45 / 100;
1345  nStarts[1] = nEnds[0] + nStep;
1346  nEnds[1] = nRectWidth * 9 / 10;
1347  break;
1348  case 3: nCols = 3;
1349  nEnds[0] = nRectWidth * 30 / 100;
1350  nStarts[1] = nEnds[0] + nStep;
1351  nEnds[1] = nRectWidth * 63 / 100;
1352  nStarts[2] = nEnds[1] + nStep;
1353  nEnds[2] = nRectWidth * 9 / 10;
1354  break;
1355  case 4: nCols = 2;
1356  nEnds[0] = nRectWidth * 63 / 100;
1357  nStarts[1] = nEnds[0] + nStep;
1358  nEnds[1] = nRectWidth * 9 / 10;
1359  break;
1360  case 5: nCols = 2;
1361  nEnds[0] = nRectWidth * 30 / 100;
1362  nStarts[1] = nEnds[0] + nStep;
1363  nEnds[1] = nRectWidth * 9 / 10;
1364  break;
1365  }
1366  for(sal_uInt16 j = 0; j < nCols; j++ )
1367  {
1368  Point aStart(aBLPos.X() + nStarts[j], 0);
1369  Point aEnd(aBLPos.X() + nEnds[j], 0);
1370  for( sal_uInt16 i = 0; i < 12; i ++)
1371  {
1372  aStart.setY( aBLPos.Y() + nTop + i * nStep);
1373  aEnd.setY( aStart.Y() );
1374  pDev->DrawLine(aStart, aEnd);
1375  }
1376  }
1377  pDev->SetFillColor(aFillColor);
1378  pDev->SetLineColor(aLineColor);
1379 }
1380 
1382 {
1383  SetFormat();
1384  Invalidate();
1386 }
1387 
1388 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point TopLeft() const
tools::Long m_nColDist[nMaxCols]
Definition: column.hxx:91
std::unique_ptr< SwPercentField > m_xEd2
Definition: column.hxx:126
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
tools::Long GetWidth() const
std::unique_ptr< weld::Container > m_xContentArea
Definition: column.hxx:54
std::unique_ptr< weld::MetricSpinButton > m_xLineWidthEdit
Definition: column.hxx:115
FieldUnit
tools::Long m_nPageWidth
Definition: column.hxx:47
constexpr sal_uInt16 g_nMinWidth(MINLAY)
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:168
const SwPageDesc * GetSelectedPageDescs() const
if inside all selection only one PageDesc,
Definition: fedesc.cxx:185
virtual void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface)=0
sal_uInt16 GetLower() const
SwColumnDlg(weld::Window *pParent, SwWrtShell &rSh)
Definition: column.cxx:82
void ObjectHdl(const weld::ComboBox *)
Definition: column.cxx:216
constexpr TypedWhichId< SwFormatCol > RES_COL(109)
const tools::Rectangle & GetRect() const
std::unique_ptr< weld::CheckButton > m_xAutoWidthBox
Definition: column.hxx:112
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
#define LISTBOX_FRAME
Definition: column.cxx:65
bool m_bFormat
Definition: column.hxx:96
virtual OUString get_text(int pos) const =0
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: column.cxx:598
tools::Long m_nColWidth[nMaxCols]
Definition: column.hxx:90
long Long
tools::Long GetRight() const
virtual void Reset(const SfxItemSet *rSet) override
Definition: column.cxx:535
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
#define MINLAY
Definition: swtypes.hxx:66
#define FN_INSERT_REGION
Definition: cmdid.h:281
constexpr OUStringLiteral PERCENT(u"Percent")
If text in multi-column sections should be evenly distributed.
Definition: fmtclbl.hxx:28
tools::Long m_nOldSelection
Definition: column.hxx:45
std::unique_ptr< SwPercentField > m_xEd3
Definition: column.hxx:127
#define FRAME_FORMAT_WIDTH
Definition: column.cxx:69
tools::Long GetWidth() const
#define LISTBOX_SECTIONS
Definition: column.cxx:63
void SetFrameMode(bool bMod)
Definition: column.cxx:1301
const weld::MetricSpinButton * get() const
Definition: prcntfld.hxx:47
void UpdateCols()
Definition: column.cxx:816
SvxFrameDirection
SwSectionFormat * GetFormat()
Definition: section.hxx:336
static SfxObjectShell * Current()
std::unique_ptr< weld::CustomWeld > m_xFrameExampleWN
Definition: column.hxx:133
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
virtual OUString get_active_id() const =0
virtual int find_id(const OUString &rId) const =0
const Color & GetFieldTextColor() const
std::unique_ptr< weld::Label > m_xLineTypeLbl
Definition: column.hxx:113
virtual int get_count() const =0
virtual void StyleUpdated() override
const OUString & GetName() const
Definition: pagedesc.hxx:197
const SvxBoxItem & GetBox(bool=true) const
Definition: frmatr.hxx:84
std::unique_ptr< weld::Label > m_xLbl1
Definition: column.hxx:108
const SwSection * GetCurrSection() const
Definition: edsect.cxx:71
std::unique_ptr< SvtLineListBox > m_xLineTypeDLB
Definition: column.hxx:124
void SwapPam()
Definition: crsrsh.cxx:975
static sal_uInt8 nPagePos
Definition: basesh.cxx:114
Used by the UI to modify the document model.
Definition: wrtsh.hxx:91
constexpr tools::Long Width() const
SwWrtShell & m_rWrtShell
Definition: column.hxx:38
void SetInSection(bool bSet)
Definition: column.cxx:1306
virtual void StyleUpdated() override
Definition: column.cxx:1381
virtual void show()=0
std::unique_ptr< SwPercentField > m_xEd1
Definition: column.hxx:125
std::unique_ptr< ColorListBox > m_xLineColorDLB
Definition: column.hxx:123
OUString SvxResId(const char *pId)
tools::Long m_nSelectionWidth
Definition: column.hxx:46
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
std::unique_ptr< weld::Label > m_xTextDirectionFT
Definition: column.hxx:121
#define LISTBOX_SECTION
Definition: column.cxx:62
std::map< weld::MetricSpinButton *, SwPercentField * > m_aPercentFieldsMap
Definition: column.hxx:94
std::unique_ptr< SwPercentField > m_xDistEd1
Definition: column.hxx:128
tools::Long GetSectionWidth(SwFormat const &rFormat) const
Width of current range for column-dialog.
Definition: feshview.cxx:2915
static bool IsMarkInSameSection(SwWrtShell &rWrtSh, const SwSection *pSect)
Definition: column.cxx:74
void Update(const weld::MetricSpinButton *pInteractiveField)
Definition: column.cxx:1102
std::unique_ptr< weld::ComboBox > m_xLinePosDLB
Definition: column.hxx:120
void Width(tools::Long nNew)
Definition: swrect.hxx:187
std::unique_ptr< weld::Label > m_xLinePosLbl
Definition: column.hxx:119
void UpdateExample(const SfxItemSet &rSet, SwColMgr *pMgr)
Definition: colex.hxx:78
std::unique_ptr< weld::Button > m_xOkButton
Definition: column.hxx:55
void DrawLine(const Point &rStartPt, const Point &rEndPt)
sal_uInt16 GetActualSize() const
Definition: colmgr.hxx:66
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:47
IMPL_LINK_NOARG(SwColumnDlg, OkHdl, weld::Button &, void)
Definition: column.cxx:258
ColumnValueSet m_aDefaultVS
Definition: column.hxx:101
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:612
static const sal_uInt16 aPageRg[]
Definition: column.hxx:167
sal_uInt16 m_nCols
Definition: column.hxx:89
void SetLineColor()
std::unique_ptr< weld::MetricSpinButton > m_xLineHeightEdit
Definition: column.hxx:118
Style of a layout element.
Definition: frmfmt.hxx:58
void Timeout()
Definition: column.cxx:1058
bool HasSelection() const
Definition: wrtsh.hxx:142
#define SW_MOD()
Definition: swmodule.hxx:255
vcl::RenderContext * GetRenderContext() const
bool IsInsRegionAvailable() const
Definition: edsect.cxx:58
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
std::unique_ptr< SfxItemSet > m_pSectionSet
Definition: column.hxx:41
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:726
int i
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: column.cxx:1157
void connect_changed(const Link< ComboBox &, void > &rLink)
sal_uInt16 GetFullSelectedSectionCount() const
Search inside the cursor selection for full selected sections.
Definition: edsect.cxx:247
std::unique_ptr< weld::Label > m_xLineColorLbl
Definition: column.hxx:116
std::unique_ptr< svx::FrameDirectionListBox > m_xTextDirectionLB
Definition: column.hxx:122
int get_value(FieldUnit eOutUnit=FieldUnit::NONE)
Definition: prcntfld.cxx:130
void SetPageWidth(tools::Long nPageWidth)
Definition: column.cxx:517
HTMLMODE_ON
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:354
tools::Long GetLeft() const
std::unique_ptr< weld::CheckButton > m_xBalanceColsCB
Definition: column.hxx:106
void SetFillColor()
const Color & GetFieldColor() const
const Color & GetLineColor() const
std::unique_ptr< weld::SpinButton > m_xCLNrEdt
Definition: column.hxx:105
IMPL_LINK(SwColumnDlg, ObjectListBoxHdl, weld::ComboBox &, rBox, void)
Definition: column.cxx:211
SwColExample m_aPgeExampleWN
Definition: column.hxx:102
virtual void set_active(int pos)=0
std::unique_ptr< weld::Button > m_xBtnNext
Definition: column.hxx:111
bool m_bPageChanged
Definition: column.hxx:49
OUString SwResId(const char *pId)
Definition: swmodule.cxx:166
bool m_bHtmlMode
Definition: column.hxx:98
SwPercentField * m_pModifiedField
Definition: column.hxx:92
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
tools::Long GetHeight() const
virtual void UserDraw(const UserDrawEvent &rUDEvt) override
Definition: column.cxx:1315
std::unique_ptr< SfxItemSet > m_pSelectionSet
Definition: column.hxx:42
sal_Int32 nLineWidth
std::unique_ptr< SfxItemSet > m_pPageSet
Definition: column.hxx:40
void SetLabels(sal_uInt16 nVis)
Definition: column.cxx:875
virtual ~SwColumnDlg() override
Definition: column.cxx:206
sal_uInt16 GetItemId() const
void CalcBoundRect(SwRect &_orRect, const RndStdIds _nAnchorId, const sal_Int16 _eHoriRelOrient=css::text::RelOrientation::FRAME, const sal_Int16 _eVertRelOrient=css::text::RelOrientation::FRAME, const SwPosition *_pToCharContentPos=nullptr, const bool _bFollowTextFlow=false, bool _bMirror=false, Point *_opRef=nullptr, Size *_opPercent=nullptr, const SwFormatFrameSize *pFormatFrameSize=nullptr) const
i#17567 - adjustments to allow negative vertical positions for fly frames anchored to paragraph or to...
Definition: fews.cxx:691
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:450
static BorderWidthImpl getWidthImpl(SvxBorderLineStyle nStyle)
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:239
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
std::unique_ptr< SwColMgr > m_xColMgr
Definition: column.hxx:86
void SetFormat()
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: column.cxx:1258
static sal_uInt16 GetMaxWidth(SwColMgr const *pColMgr, sal_uInt16 nCols)
Definition: column.cxx:347
void remove_id(const OUString &rId)
weld::Entry & rEdit
bool m_bSectionChanged
Definition: column.hxx:50
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const int nMaxCols
Definition: column.hxx:31
constexpr tools::Long Height() const
void SetNoSelection()
bool m_bFrame
Definition: column.hxx:97
constexpr TypedWhichId< SwFormatNoBalancedColumns > RES_COLUMNBALANCE(119)
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
std::unique_ptr< weld::Label > m_xLineWidthLbl
Definition: column.hxx:114
const sal_uInt16 nVisCols
Definition: column.cxx:72
RET_OK
bool isLineNotNone() const
Definition: column.cxx:803
int DenormalizePercent(int nValue)
Definition: prcntfld.cxx:165
Reference< XExecutableDialog > m_xDialog
#define LISTBOX_SELECTION
Definition: column.cxx:61
void connectPercentField(SwPercentField &rWrap)
Definition: column.cxx:528
SfxOkDialogController * GetDialogController() const
#define LISTBOX_PAGE
Definition: column.cxx:64
virtual ~SwColumnPage() override
Definition: column.cxx:502
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
void Init()
Definition: column.cxx:741
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
SwColumnPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: column.cxx:375
sal_uInt16 m_nFirstVis
Definition: column.hxx:88
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
std::unique_ptr< weld::CustomWeld > m_xDefaultVS
Definition: column.hxx:130
std::unique_ptr< SwColumnPage > m_xTabPage
Definition: column.hxx:39
std::unique_ptr< SwPercentField > m_xDistEd2
Definition: column.hxx:129
DeactivateRC
tools::Long GetHeight() const
OUString sId
void ColModify(bool bForceColReset)
Definition: column.cxx:912
bool m_bSelSectionChanged
Definition: column.hxx:51
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1248
double ConvertDoubleValue(double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: column.cxx:592
virtual void remove(int pos)=0
SwColLineAdj
Definition: fmtclds.hxx:59
std::unique_ptr< weld::Label > m_xLbl3
Definition: column.hxx:110
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:120
std::unique_ptr< weld::Label > m_xLbl2
Definition: column.hxx:109
Frame is variable in Var-direction.
sal_uInt16 GetGutterWidth(sal_uInt16 nPos=USHRT_MAX) const
Definition: colmgr.cxx:77
sal_uInt16 GetSmallestDistance() const
SfxItemSet * m_pFrameSet
Definition: column.hxx:43
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
void ResetColWidth()
Definition: column.cxx:360
std::unique_ptr< weld::Label > m_xLineHeightLbl
Definition: column.hxx:117
std::unique_ptr< weld::CustomWeld > m_xPgeExampleWN
Definition: column.hxx:132
const Size & GetSize() const
const Color & GetFillColor() const
SfxItemSet * EvalCurrentSelection(void)
Definition: column.cxx:316
bool m_bFrameChanged
Definition: column.hxx:52
sal_uInt16 GetUpper() const
std::unique_ptr< weld::Button > m_xBtnBack
Definition: column.hxx:107
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74