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