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();
226  long nWidth = m_nSelectionWidth;
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<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"), pController->getDialog()))
402  , m_xLineTypeDLB(new SvtLineListBox(m_xBuilder->weld_menu_button("linestylelb")))
403  , m_xEd1(new SwPercentField(m_xBuilder->weld_metric_spin_button("width1mf", FieldUnit::CM)))
404  , m_xEd2(new SwPercentField(m_xBuilder->weld_metric_spin_button("width2mf", FieldUnit::CM)))
405  , m_xEd3(new SwPercentField(m_xBuilder->weld_metric_spin_button("width3mf", FieldUnit::CM)))
406  , m_xDistEd1(new SwPercentField(m_xBuilder->weld_metric_spin_button("spacing1mf", FieldUnit::CM)))
407  , m_xDistEd2(new SwPercentField(m_xBuilder->weld_metric_spin_button("spacing2mf", FieldUnit::CM)))
408  , m_xDefaultVS(new weld::CustomWeld(*m_xBuilder, "valueset", m_aDefaultVS))
409  , m_xPgeExampleWN(new weld::CustomWeld(*m_xBuilder, "pageexample", m_aPgeExampleWN))
410  , m_xFrameExampleWN(new weld::CustomWeld(*m_xBuilder, "frameexample", m_aFrameExampleWN))
411  , m_xApplyToFT(m_xBuilder->weld_label("applytoft"))
412  , m_xApplyToLB(m_xBuilder->weld_combo_box("applytolb"))
413 {
419 
420  m_xTextDirectionLB->append(SvxFrameDirection::Horizontal_LR_TB, SvxResId(RID_SVXSTR_FRAMEDIR_LTR));
421  m_xTextDirectionLB->append(SvxFrameDirection::Horizontal_RL_TB, SvxResId(RID_SVXSTR_FRAMEDIR_RTL));
422  m_xTextDirectionLB->append(SvxFrameDirection::Environment, SvxResId(RID_SVXSTR_FRAMEDIR_SUPER));
423 
425 
427 
428  for (int i = 0; i < 5; ++i)
429  //Set accessible name one by one
430  {
431  OUString aItemText;
432  switch( i )
433  {
434  case 0:
435  aItemText = SwResId( STR_COLUMN_VALUESET_ITEM0 ) ;
436  break;
437  case 1:
438  aItemText = SwResId( STR_COLUMN_VALUESET_ITEM1 ) ;
439  break;
440  case 2:
441  aItemText = SwResId( STR_COLUMN_VALUESET_ITEM2 ) ;
442  break;
443  case 3:
444  aItemText = SwResId( STR_COLUMN_VALUESET_ITEM3 );
445  break;
446  default:
447  aItemText = SwResId( STR_COLUMN_VALUESET_ITEM4 );
448  break;
449  }
450  m_aDefaultVS.InsertItem( i + 1, aItemText, i );
451  }
452 
453  m_aDefaultVS.SetSelectHdl(LINK(this, SwColumnPage, SetDefaultsHdl));
454 
456  m_xCLNrEdt->connect_value_changed(aCLNrLk);
457  Link<weld::MetricSpinButton&,void> aLk = LINK(this, SwColumnPage, GapModify);
458  m_xDistEd1->connect_value_changed(aLk);
459  m_xDistEd2->connect_value_changed(aLk);
460 
461  aLk = LINK(this, SwColumnPage, EdModify);
462 
463  m_xEd1->connect_value_changed(aLk);
464  m_xEd2->connect_value_changed(aLk);
465  m_xEd3->connect_value_changed(aLk);
466 
467  m_xBtnBack->connect_clicked(LINK(this, SwColumnPage, Up));
468  m_xBtnNext->connect_clicked(LINK(this, SwColumnPage, Down));
469  m_xAutoWidthBox->connect_toggled(LINK(this, SwColumnPage, AutoWidthHdl));
470 
471  Link<weld::MetricSpinButton&,void> aLk2 = LINK( this, SwColumnPage, UpdateColMgr );
472  m_xLineTypeDLB->SetSelectHdl(LINK(this, SwColumnPage, UpdateColMgrLineBox));
473  m_xLineWidthEdit->connect_value_changed(aLk2);
474  m_xLineColorDLB->SetSelectHdl(LINK( this, SwColumnPage, UpdateColMgrColorBox));
475  m_xLineHeightEdit->connect_value_changed(aLk2);
476  m_xLinePosDLB->connect_changed(LINK(this, SwColumnPage, UpdateColMgrListBox));
477 
478  // Separator line
479  m_xLineTypeDLB->SetSourceUnit( FieldUnit::TWIP );
480 
481  // Fill the line styles listbox
482  m_xLineTypeDLB->InsertEntry(
483  ::editeng::SvxBorderLine::getWidthImpl(SvxBorderLineStyle::SOLID),
484  SvxBorderLineStyle::SOLID );
485  m_xLineTypeDLB->InsertEntry(
486  ::editeng::SvxBorderLine::getWidthImpl(SvxBorderLineStyle::DOTTED),
487  SvxBorderLineStyle::DOTTED );
488  m_xLineTypeDLB->InsertEntry(
489  ::editeng::SvxBorderLine::getWidthImpl(SvxBorderLineStyle::DASHED),
490  SvxBorderLineStyle::DASHED );
491 
492  sal_Int64 nLineWidth = m_xLineWidthEdit->get_value(FieldUnit::POINT);
493  nLineWidth = static_cast<long>(vcl::ConvertDoubleValue(
494  nLineWidth,
495  m_xLineWidthEdit->get_digits(),
496  FieldUnit::POINT, MapUnit::MapTwip ));
497  m_xLineTypeDLB->SetWidth(nLineWidth);
498  m_xLineColorDLB->SelectEntry(COL_BLACK);
499 }
500 
502 {
503  m_xFrameExampleWN.reset();
504  m_xPgeExampleWN.reset();
505  m_xDefaultVS.reset();
506  m_xDistEd2.reset();
507  m_xDistEd1.reset();
508  m_xEd3.reset();
509  m_xEd2.reset();
510  m_xEd1.reset();
511  m_xLineTypeDLB.reset();
512  m_xLineColorDLB.reset();
513  m_xTextDirectionLB.reset();
514 }
515 
516 void SwColumnPage::SetPageWidth(long nPageWidth)
517 {
518  long nNewMaxWidth = static_cast< long >(m_xEd1->NormalizePercent(nPageWidth));
519 
520  m_xDistEd1->set_max(nNewMaxWidth, FieldUnit::TWIP);
521  m_xDistEd2->set_max(nNewMaxWidth, FieldUnit::TWIP);
522  m_xEd1->set_max(nNewMaxWidth, FieldUnit::TWIP);
523  m_xEd2->set_max(nNewMaxWidth, FieldUnit::TWIP);
524  m_xEd3->set_max(nNewMaxWidth, FieldUnit::TWIP);
525 }
526 
528 {
529  weld::MetricSpinButton *pField = rWrap.get();
530  assert(pField);
531  m_aPercentFieldsMap[pField] = &rWrap;
532 }
533 
535 {
536  const sal_uInt16 nHtmlMode =
537  ::GetHtmlMode(static_cast<const SwDocShell*>(SfxObjectShell::Current()));
538  if(nHtmlMode & HTMLMODE_ON)
539  {
540  m_bHtmlMode = true;
541  m_xAutoWidthBox->set_sensitive(false);
542  }
544  m_xEd1->SetMetric(aMetric);
545  m_xEd2->SetMetric(aMetric);
546  m_xEd3->SetMetric(aMetric);
547  m_xDistEd1->SetMetric(aMetric);
548  m_xDistEd2->SetMetric(aMetric);
549  //default spacing between cols = 0.5cm
550  m_xDistEd1->set_value(50, FieldUnit::CM);
551  m_xDistEd2->set_value(50, FieldUnit::CM);
552 
553  m_xColMgr.reset(new SwColMgr(*rSet));
554  m_nCols = m_xColMgr->GetCount() ;
555  m_xCLNrEdt->set_max(std::max(static_cast<sal_uInt16>(m_xCLNrEdt->get_max()), m_nCols));
556 
557  if(m_bFrame)
558  {
559  if(m_bFormat) // there is no size here
560  m_xColMgr->SetActualWidth(FRAME_FORMAT_WIDTH);
561  else
562  {
563  const SwFormatFrameSize& rSize = rSet->Get(RES_FRM_SIZE);
564  const SvxBoxItem& rBox = rSet->Get(RES_BOX);
565  m_xColMgr->SetActualWidth(static_cast<sal_uInt16>(rSize.GetSize().Width()) - rBox.GetSmallestDistance());
566  }
567  }
568  if (m_xBalanceColsCB->get_visible())
569  {
570  const SfxPoolItem* pItem;
571  if( SfxItemState::SET == rSet->GetItemState( RES_COLUMNBALANCE, false, &pItem ))
572  m_xBalanceColsCB->set_active(!static_cast<const SwFormatNoBalancedColumns*>(pItem)->GetValue());
573  else
574  m_xBalanceColsCB->set_active(true);
575  }
576 
577  //text direction
578  if( SfxItemState::DEFAULT <= rSet->GetItemState( RES_FRAMEDIR ) )
579  {
580  const SvxFrameDirectionItem& rItem = rSet->Get(RES_FRAMEDIR);
581  SvxFrameDirection nVal = rItem.GetValue();
582  m_xTextDirectionLB->set_active_id(nVal);
583  m_xTextDirectionLB->save_value();
584  }
585 
586  Init();
587  ActivatePage( *rSet );
588 }
589 
590 // create TabPage
591 std::unique_ptr<SfxTabPage> SwColumnPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet)
592 {
593  return std::make_unique<SwColumnPage>(pPage, pController, *rSet);
594 }
595 
596 // stuff attributes into the Set when OK
598 {
599  // set in ItemSet;
600  // the current settings are already present
601 
602  const SfxPoolItem* pOldItem;
603  const SwFormatCol& rCol = m_xColMgr->GetColumns();
604  if(nullptr == (pOldItem = GetOldItem( *rSet, RES_COL )) ||
605  rCol != *pOldItem )
606  rSet->Put(rCol);
607 
608  if (m_xBalanceColsCB->get_visible())
609  {
610  rSet->Put(SwFormatNoBalancedColumns(!m_xBalanceColsCB->get_active()));
611  }
612  if (m_xTextDirectionLB->get_visible())
613  {
614  if (m_xTextDirectionLB->get_value_changed_from_saved())
615  {
616  rSet->Put(SvxFrameDirectionItem(m_xTextDirectionLB->get_active_id(), RES_FRAMEDIR) );
617  }
618  }
619  return true;
620 }
621 
622 // update ColumnManager
623 IMPL_LINK_NOARG( SwColumnPage, UpdateColMgrListBox, weld::ComboBox&, void )
624 {
625  UpdateColMgr(*m_xLineWidthEdit);
626 }
627 
628 IMPL_LINK_NOARG( SwColumnPage, UpdateColMgrLineBox, SvtLineListBox&, void )
629 {
630  UpdateColMgr(*m_xLineWidthEdit);
631 }
632 
633 IMPL_LINK_NOARG( SwColumnPage, UpdateColMgrColorBox, ColorListBox&, void )
634 {
635  UpdateColMgr(*m_xLineWidthEdit);
636 }
637 
639 {
640  if (!m_xColMgr)
641  return;
642  long nGutterWidth = m_xColMgr->GetGutterWidth();
643  if (m_nCols > 1)
644  {
645  // Determine whether the most narrow column is too narrow
646  // for the adjusted column gap
647  long nMin = m_nColWidth[0];
648 
649  for( sal_uInt16 i = 1; i < m_nCols; ++i )
650  nMin = std::min(nMin, m_nColWidth[i]);
651 
652  bool bAutoWidth = m_xAutoWidthBox->get_active();
653  if(!bAutoWidth)
654  {
655  m_xColMgr->SetAutoWidth(false);
656  // when the user didn't allocate the whole width,
657  // add the missing amount to the last column.
658  long nSum = 0;
659  for(sal_uInt16 i = 0; i < m_nCols; ++i)
660  nSum += m_nColWidth[i];
661  nGutterWidth = 0;
662  for(sal_uInt16 i = 0; i < m_nCols - 1; ++i)
663  nGutterWidth += m_nColDist[i];
664  nSum += nGutterWidth;
665 
666  long nMaxW = m_xColMgr->GetActualSize();
667 
668  if( nSum < nMaxW )
669  m_nColWidth[m_nCols - 1] += nMaxW - nSum;
670 
671  m_xColMgr->SetColWidth( 0, static_cast< sal_uInt16 >(m_nColWidth[0] + m_nColDist[0]/2) );
672  for( sal_uInt16 i = 1; i < m_nCols-1; ++i )
673  {
674  long nActDist = (m_nColDist[i] + m_nColDist[i - 1]) / 2;
675  m_xColMgr->SetColWidth( i, static_cast< sal_uInt16 >(m_nColWidth[i] + nActDist ));
676  }
677  m_xColMgr->SetColWidth( m_nCols-1, static_cast< sal_uInt16 >(m_nColWidth[m_nCols-1] + m_nColDist[m_nCols -2]/2) );
678 
679  }
680 
681  bool bEnable = isLineNotNone();
682  m_xLineHeightEdit->set_sensitive(bEnable);
683  m_xLineHeightLbl->set_sensitive(bEnable);
684  m_xLineWidthLbl->set_sensitive(bEnable);
685  m_xLineWidthEdit->set_sensitive(bEnable);
686  m_xLineColorDLB->set_sensitive(bEnable);
687  m_xLineColorLbl->set_sensitive(bEnable);
688 
689  sal_Int64 nLineWidth = m_xLineWidthEdit->get_value(FieldUnit::PERCENT);
690  nLineWidth = static_cast<long>(vcl::ConvertDoubleValue(
691  nLineWidth,
692  m_xLineWidthEdit->get_digits(),
693  m_xLineWidthEdit->get_unit(), MapUnit::MapTwip ));
694  if( !bEnable )
695  m_xColMgr->SetNoLine();
696  else
697  {
698  m_xColMgr->SetLineWidthAndColor(
699  m_xLineTypeDLB->GetSelectEntryStyle(),
700  nLineWidth,
701  m_xLineColorDLB->GetSelectEntryColor() );
702  m_xColMgr->SetAdjust(SwColLineAdj(m_xLinePosDLB->get_active() + 1));
703  m_xColMgr->SetLineHeightPercent(static_cast<short>(m_xLineHeightEdit->get_value(FieldUnit::PERCENT)));
704  bEnable = m_xColMgr->GetLineHeightPercent() != 100;
705  }
706  m_xLinePosLbl->set_sensitive(bEnable);
707  m_xLinePosDLB->set_sensitive(bEnable);
708 
709  //fdo#66815 if the values are going to be the same, don't update
710  //them to avoid the listbox selection resetting
711  if (nLineWidth != m_xLineTypeDLB->GetWidth())
712  m_xLineTypeDLB->SetWidth(nLineWidth);
713  Color aColor(m_xLineColorDLB->GetSelectEntryColor());
714  if (aColor != m_xLineTypeDLB->GetColor())
715  m_xLineTypeDLB->SetColor(aColor);
716  }
717  else
718  {
719  m_xColMgr->NoCols();
720  m_nCols = 0;
721  }
722 
723  //set maximum values
724  m_xCLNrEdt->set_max(std::max(1L,
725  std::min(long(nMaxCols), long( m_xColMgr->GetActualSize() / (nGutterWidth + MINLAY)) )));
726 
727  //prompt example window
728  if(!m_bLockUpdate)
729  {
730  if(m_bFrame)
731  {
732  m_aFrameExampleWN.SetColumns(m_xColMgr->GetColumns());
733  m_aFrameExampleWN.Invalidate();
734  }
735  else
736  m_aPgeExampleWN.Invalidate();
737  }
738 }
739 
741 {
742  m_xCLNrEdt->set_value(m_nCols);
743 
744  bool bAutoWidth = m_xColMgr->IsAutoWidth() || m_bHtmlMode;
745  m_xAutoWidthBox->set_active(bAutoWidth);
746 
747  sal_Int32 nColumnWidthSum = 0;
748  // set the widths
749  for(sal_uInt16 i = 0; i < m_nCols; ++i)
750  {
751  m_nColWidth[i] = m_xColMgr->GetColWidth(i);
752  nColumnWidthSum += m_nColWidth[i];
753  if(i < m_nCols - 1)
754  m_nColDist[i] = m_xColMgr->GetGutterWidth(i);
755  }
756 
757  if( 1 < m_nCols )
758  {
759  // #97495# make sure that the automatic column width's are always equal
760  if(bAutoWidth)
761  {
762  nColumnWidthSum /= m_nCols;
763  for(sal_uInt16 i = 0; i < m_nCols; ++i)
764  m_nColWidth[i] = nColumnWidthSum;
765  }
766  SwColLineAdj eAdj = m_xColMgr->GetAdjust();
767  if( COLADJ_NONE == eAdj ) // the dialog doesn't know a NONE!
768  {
769  eAdj = COLADJ_TOP;
770  //without Adjust no line type
771  m_xLineTypeDLB->SelectEntry(SvxBorderLineStyle::NONE);
772  m_xLineHeightEdit->set_value(100, FieldUnit::PERCENT);
773  }
774  else
775  {
776  // Need to multiply by 100 because of the 2 decimals
777  m_xLineWidthEdit->set_value( m_xColMgr->GetLineWidth() * 100, FieldUnit::TWIP);
778  m_xLineColorDLB->SelectEntry( m_xColMgr->GetLineColor() );
779  m_xLineTypeDLB->SelectEntry( m_xColMgr->GetLineStyle() );
780  m_xLineTypeDLB->SetWidth( m_xColMgr->GetLineWidth( ) );
781  m_xLineHeightEdit->set_value(m_xColMgr->GetLineHeightPercent(), FieldUnit::PERCENT);
782 
783  }
784  m_xLinePosDLB->set_active( static_cast< sal_Int32 >(eAdj - 1) );
785  }
786  else
787  {
788  m_xLinePosDLB->set_active(0);
789  m_xLineTypeDLB->SelectEntry(SvxBorderLineStyle::NONE);
790  m_xLineHeightEdit->set_value(100, FieldUnit::PERCENT);
791  }
792 
793  UpdateCols();
794  Update(nullptr);
795 
796  // set maximum number of columns
797  // values below 1 are not allowed
798  m_xCLNrEdt->set_max(std::max(1L,
799  std::min(long(nMaxCols), long( m_xColMgr->GetActualSize() / g_nMinWidth) )));
800 }
801 
803 {
804  // nothing is turned off
805  return m_xLineTypeDLB->GetSelectEntryStyle() != SvxBorderLineStyle::NONE;
806 }
807 
808 /*
809  * The number of columns has changed -- here the controls for editing of the
810  * columns are en- or disabled according to the column number. In case there are
811  * more than nVisCols (=3) all Edit are being enabled and the buttons for
812  * scrolling too. Otherwise Edits are being enabled according to the column
813  * numbers; one column can not be edited.
814  */
816 {
817  bool bEnableBtns= false;
818  bool bEnable12 = false;
819  bool bEnable3 = false;
820  const bool bEdit = !m_xAutoWidthBox->get_active();
821  if ( m_nCols > nVisCols )
822  {
823  bEnableBtns = !m_bHtmlMode;
824  bEnable12 = bEnable3 = bEdit;
825  }
826  else if( bEdit )
827  {
828  // here are purposely hardly any breaks
829  switch(m_nCols)
830  {
831  case 3: bEnable3 = true;
832  [[fallthrough]];
833  case 2: bEnable12= true; break;
834  default: /* do nothing */;
835  }
836  }
837  m_xEd1->set_sensitive(bEnable12);
838  bool bEnable = m_nCols > 1;
839  m_xDistEd1->set_sensitive(bEnable);
840  m_xAutoWidthBox->set_sensitive(bEnable && !m_bHtmlMode);
841  m_xEd2->set_sensitive(bEnable12);
842  m_xDistEd2->set_sensitive(bEnable3);
843  m_xEd3->set_sensitive(bEnable3);
844  m_xLbl1->set_sensitive(bEnable12);
845  m_xLbl2->set_sensitive(bEnable12);
846  m_xLbl3->set_sensitive(bEnable3);
847  m_xBtnBack->set_sensitive(bEnableBtns);
848  m_xBtnNext->set_sensitive(bEnableBtns);
849 
850  m_xLineTypeDLB->set_sensitive( bEnable );
851  m_xLineTypeLbl->set_sensitive( bEnable );
852 
853  if (bEnable)
854  {
855  bEnable = isLineNotNone();
856  }
857 
858  //all these depend on > 1 column and line style != none
859  m_xLineHeightEdit->set_sensitive(bEnable);
860  m_xLineHeightLbl->set_sensitive(bEnable);
861  m_xLineWidthLbl->set_sensitive(bEnable);
862  m_xLineWidthEdit->set_sensitive(bEnable);
863  m_xLineColorDLB->set_sensitive(bEnable);
864  m_xLineColorLbl->set_sensitive(bEnable);
865 
866  if (bEnable)
867  bEnable = m_xColMgr->GetLineHeightPercent() != 100;
868 
869  //and these additionally depend on line height != 100%
870  m_xLinePosDLB->set_sensitive(bEnable);
871  m_xLinePosLbl->set_sensitive(bEnable);
872 }
873 
874 void SwColumnPage::SetLabels( sal_uInt16 nVis )
875 {
876  //insert ~ before the last character, e.g. 1 -> ~1, 10 -> 1~0
877  const OUString sLbl( '~' );
878 
879  const OUString sLbl1(OUString::number( nVis + 1 ));
880  m_xLbl1->set_label(sLbl1.replaceAt(sLbl1.getLength()-1, 0, sLbl));
881 
882  const OUString sLbl2(OUString::number( nVis + 2 ));
883  m_xLbl2->set_label(sLbl2.replaceAt(sLbl2.getLength()-1, 0, sLbl));
884 
885  const OUString sLbl3(OUString::number( nVis + 3 ));
886  m_xLbl3->set_label(sLbl3.replaceAt(sLbl3.getLength()-1, 0, sLbl));
887 
888  const OUString sColumnWidth = SwResId( STR_ACCESS_COLUMN_WIDTH ) ;
889  m_xEd1->set_accessible_name(sColumnWidth.replaceFirst("%1", sLbl1));
890  m_xEd2->set_accessible_name(sColumnWidth.replaceFirst("%1", sLbl2));
891  m_xEd3->set_accessible_name(sColumnWidth.replaceFirst("%1", sLbl3));
892 
893  const OUString sDist = SwResId( STR_ACCESS_PAGESETUP_SPACING ) ;
894  m_xDistEd1->set_accessible_name(
895  sDist.replaceFirst("%1", sLbl1).replaceFirst("%2", sLbl2));
896 
897  m_xDistEd2->set_accessible_name(
898  sDist.replaceFirst("%1", sLbl2).replaceFirst("%2", sLbl3));
899 }
900 
901 /*
902  * Handler that is called at alteration of the column number. An alteration of
903  * the column number overwrites potential user's width settings; all columns
904  * are equally wide.
905  */
906 IMPL_LINK(SwColumnPage, ColModify, weld::SpinButton&, rEdit, void)
907 {
908  ColModify(&rEdit);
909 }
910 
912 {
913  m_nCols = static_cast<sal_uInt16>(m_xCLNrEdt->get_value());
914  //#107890# the handler is also called from LoseFocus()
915  //then no change has been made and thus no action should be taken
916  // #i17816# changing the displayed types within the ValueSet
917  //from two columns to two columns with different settings doesn't invalidate the
918  // example windows in ::ColModify()
919  if (pNF && m_xColMgr->GetCount() == m_nCols)
920  return;
921 
922  if (pNF)
924  long nDist = static_cast< long >(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
925  m_xColMgr->SetCount(m_nCols, static_cast<sal_uInt16>(nDist));
926  for(sal_uInt16 i = 0; i < m_nCols; i++)
927  m_nColDist[i] = nDist;
928  m_nFirstVis = 0;
930  UpdateCols();
931  ResetColWidth();
932  Update(nullptr);
933 }
934 
935 /*
936  * Modify handler for an alteration of the column width or the column gap.
937  * These changes take effect time-displaced. With an alteration of the column
938  * width the automatic calculation of the column width is overruled; only an
939  * alteration of the column number leads back to that default.
940  */
941 IMPL_LINK(SwColumnPage, GapModify, weld::MetricSpinButton&, rMetricField, void)
942 {
943  if (m_nCols < 2)
944  return;
945  SwPercentField *pField = m_aPercentFieldsMap[&rMetricField];
946  assert(pField);
947  long nActValue = static_cast< long >(pField->DenormalizePercent(pField->get_value(FieldUnit::TWIP)));
948  if (m_xAutoWidthBox->get_active())
949  {
950  const long nMaxGap = static_cast< long >
951  ((m_xColMgr->GetActualSize() - m_nCols * MINLAY)/(m_nCols - 1));
952  if(nActValue > nMaxGap)
953  {
954  nActValue = nMaxGap;
955  m_xDistEd1->set_value(m_xDistEd1->NormalizePercent(nMaxGap), FieldUnit::TWIP);
956  }
957  m_xColMgr->SetGutterWidth(static_cast<sal_uInt16>(nActValue));
958  for(sal_uInt16 i = 0; i < m_nCols; i++)
959  m_nColDist[i] = nActValue;
960 
961  ResetColWidth();
962  UpdateCols();
963  }
964  else
965  {
966  const sal_uInt16 nVis = m_nFirstVis + ((pField == m_xDistEd2.get()) ? 1 : 0);
967  long nDiff = nActValue - m_nColDist[nVis];
968  if(nDiff)
969  {
970  long nLeft = m_nColWidth[nVis];
971  long nRight = m_nColWidth[nVis + 1];
972  if(nLeft + nRight + 2 * MINLAY < nDiff)
973  nDiff = nLeft + nRight - 2 * MINLAY;
974  if(nDiff < nRight - MINLAY)
975  {
976  nRight -= nDiff;
977  }
978  else
979  {
980  long nTemp = nDiff - nRight + MINLAY;
981  nRight = MINLAY;
982  if(nLeft > nTemp - MINLAY)
983  {
984  nLeft -= nTemp;
985  nTemp = 0;
986  }
987  else
988  {
989  nTemp -= nLeft + MINLAY;
990  nLeft = MINLAY;
991  }
992  nDiff = nTemp;
993  }
994  m_nColWidth[nVis] = nLeft;
995  m_nColWidth[nVis + 1] = nRight;
996  m_nColDist[nVis] += nDiff;
997 
998  m_xColMgr->SetColWidth( nVis, sal_uInt16(nLeft) );
999  m_xColMgr->SetColWidth( nVis + 1, sal_uInt16(nRight) );
1000  m_xColMgr->SetGutterWidth( sal_uInt16(m_nColDist[nVis]), nVis );
1001  }
1002 
1003  }
1004  Update(&rMetricField);
1005 }
1006 
1008 {
1009  SwPercentField *pField = m_aPercentFieldsMap[&rEdit];
1010  assert(pField);
1011  m_pModifiedField = pField;
1012  Timeout();
1013 }
1014 
1015 // Handler behind the Checkbox for automatic width. When the box is checked
1016 // no explicit values for the column width can be entered.
1017 IMPL_LINK(SwColumnPage, AutoWidthHdl, weld::ToggleButton&, rBox, void)
1018 {
1019  long nDist = static_cast< long >(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
1020  m_xColMgr->SetCount(m_nCols, static_cast<sal_uInt16>(nDist));
1021  for(sal_uInt16 i = 0; i < m_nCols; i++)
1022  m_nColDist[i] = nDist;
1023  if (rBox.get_active())
1024  {
1025  m_xColMgr->SetGutterWidth(sal_uInt16(nDist));
1026  ResetColWidth();
1027  }
1028  m_xColMgr->SetAutoWidth(rBox.get_active(), sal_uInt16(nDist));
1029  UpdateCols();
1030  Update(nullptr);
1031 }
1032 
1033 // scroll up the contents of the edits
1035 {
1036  if( m_nFirstVis )
1037  {
1038  --m_nFirstVis;
1039  SetLabels( m_nFirstVis );
1040  Update(nullptr);
1041  }
1042 }
1043 
1044 // scroll down the contents of the edits.
1046 {
1047  if( m_nFirstVis + nVisCols < m_nCols )
1048  {
1049  ++m_nFirstVis;
1050  SetLabels( m_nFirstVis );
1051  Update(nullptr);
1052  }
1053 }
1054 
1055 // relict from ancient times - now directly without time handler; triggered by
1056 // an alteration of the column width or the column gap.
1058 {
1059  SwPercentField *pField = m_pModifiedField;
1060  if (m_pModifiedField)
1061  {
1062  // find the changed column
1063  sal_uInt16 nChanged = m_nFirstVis;
1064  if (m_pModifiedField == m_xEd2.get())
1065  ++nChanged;
1066  else if (m_pModifiedField == m_xEd3.get())
1067  nChanged += 2;
1068 
1069  long nNewWidth = static_cast< long >
1071  long nDiff = nNewWidth - m_nColWidth[nChanged];
1072 
1073  // when it's the last column
1074  if(nChanged == m_nCols - 1)
1075  {
1076  m_nColWidth[0] -= nDiff;
1077  if(m_nColWidth[0] < static_cast<long>(g_nMinWidth))
1078  {
1079  nNewWidth -= g_nMinWidth - m_nColWidth[0];
1080  m_nColWidth[0] = g_nMinWidth;
1081  }
1082 
1083  }
1084  else if(nDiff)
1085  {
1086  m_nColWidth[nChanged + 1] -= nDiff;
1087  if(m_nColWidth[nChanged + 1] < static_cast<long>(g_nMinWidth))
1088  {
1089  nNewWidth -= g_nMinWidth - m_nColWidth[nChanged + 1];
1090  m_nColWidth[nChanged + 1] = g_nMinWidth;
1091  }
1092  }
1093  m_nColWidth[nChanged] = nNewWidth;
1094  m_pModifiedField = nullptr;
1095  }
1096 
1097  Update(pField ? pField->get() : nullptr);
1098 }
1099 
1100 // Update the view
1101 void SwColumnPage::Update(const weld::MetricSpinButton* pInteractiveField)
1102 {
1103  m_xBalanceColsCB->set_sensitive(m_nCols > 1);
1104  if(m_nCols >= 2)
1105  {
1106  sal_Int64 nCurrentValue, nNewValue;
1107 
1108  nCurrentValue = m_xEd1->NormalizePercent(m_xEd1->DenormalizePercent(m_xEd1->get_value(FieldUnit::TWIP)));
1109  nNewValue = m_xEd1->NormalizePercent(m_nColWidth[m_nFirstVis]);
1110 
1111  //fdo#87612 if we're interacting with this widget and the value will be the same
1112  //then leave it alone (i.e. don't change equivalent values of e.g. .8 -> 0.8)
1113  if (nNewValue != nCurrentValue || pInteractiveField != m_xEd1->get())
1114  m_xEd1->set_value(nNewValue, FieldUnit::TWIP);
1115 
1116  nCurrentValue = m_xDistEd1->NormalizePercent(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
1117  nNewValue = m_xDistEd1->NormalizePercent(m_nColDist[m_nFirstVis]);
1118  if (nNewValue != nCurrentValue || pInteractiveField != m_xDistEd1->get())
1119  m_xDistEd1->set_value(nNewValue, FieldUnit::TWIP);
1120 
1121  nCurrentValue = m_xEd2->NormalizePercent(m_xEd2->DenormalizePercent(m_xEd2->get_value(FieldUnit::TWIP)));
1122  nNewValue = m_xEd2->NormalizePercent(m_nColWidth[m_nFirstVis+1]);
1123  if (nNewValue != nCurrentValue || pInteractiveField != m_xEd2->get())
1124  m_xEd2->set_value(nNewValue, FieldUnit::TWIP);
1125 
1126  if(m_nCols >= 3)
1127  {
1128  nCurrentValue = m_xDistEd2->NormalizePercent(m_xDistEd2->DenormalizePercent(m_xDistEd2->get_value(FieldUnit::TWIP)));
1129  nNewValue = m_xDistEd2->NormalizePercent(m_nColDist[m_nFirstVis+1]);
1130  if (nNewValue != nCurrentValue || pInteractiveField != m_xDistEd2->get())
1131  m_xDistEd2->set_value(nNewValue, FieldUnit::TWIP);
1132 
1133  nCurrentValue = m_xEd3->NormalizePercent(m_xEd3->DenormalizePercent(m_xEd3->get_value(FieldUnit::TWIP)));
1134  nNewValue = m_xEd3->NormalizePercent(m_nColWidth[m_nFirstVis+2]);
1135  if (nNewValue != nCurrentValue || pInteractiveField != m_xEd3->get())
1136  m_xEd3->set_value(nNewValue, FieldUnit::TWIP);
1137  }
1138  else
1139  {
1140  m_xEd3->set_text(OUString());
1141  m_xDistEd2->set_text(OUString());
1142  }
1143  }
1144  else
1145  {
1146  m_xEd1->set_text(OUString());
1147  m_xEd2->set_text(OUString());
1148  m_xEd3->set_text(OUString());
1149  m_xDistEd1->set_text(OUString());
1150  m_xDistEd2->set_text(OUString());
1151  }
1152  UpdateColMgr(*m_xLineWidthEdit);
1153 }
1154 
1155 // Update Bsp
1157 {
1158  bool bVertical = false;
1159  if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_FRAMEDIR))
1160  {
1161  const SvxFrameDirectionItem& rDirItem =
1162  rSet.Get(RES_FRAMEDIR);
1163  bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB||
1164  rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB;
1165  }
1166 
1167  if (!m_bFrame)
1168  {
1169  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PAGE_SIZE ))
1170  {
1171  const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
1172 
1173  sal_uInt16 nActWidth;
1174 
1175  if (!bVertical)
1176  {
1177  const SvxLRSpaceItem& rLRSpace = rSet.Get(RES_LR_SPACE);
1178  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
1179  nActWidth = rSize.GetSize().Width()
1180  - rLRSpace.GetLeft() - rLRSpace.GetRight() - rBox.GetSmallestDistance();
1181  }
1182  else
1183  {
1184  const SvxULSpaceItem& rULSpace = rSet.Get( RES_UL_SPACE );
1185  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
1186  nActWidth = rSize.GetSize().Height()
1187  - rULSpace.GetUpper() - rULSpace.GetLower() - rBox.GetSmallestDistance();
1188 
1189  }
1190 
1191  if( m_xColMgr->GetActualSize() != nActWidth)
1192  {
1193  m_xColMgr->SetActualWidth(nActWidth);
1194  ColModify( nullptr );
1195  UpdateColMgr( *m_xLineWidthEdit );
1196  }
1197  }
1198  m_xFrameExampleWN->hide();
1200  m_xPgeExampleWN->show();
1201 
1202  }
1203  else
1204  {
1205  m_xPgeExampleWN->hide();
1206  m_xFrameExampleWN->show();
1207 
1208  // Size
1209  const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE);
1210  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
1211 
1212  sal_uInt16 nTotalWish;
1213  if (m_bFormat)
1214  nTotalWish = FRAME_FORMAT_WIDTH;
1215  else
1216  {
1217  long const nDistance = rBox.GetSmallestDistance();
1218  nTotalWish = (!bVertical ? rSize.GetWidth() : rSize.GetHeight()) - 2 * nDistance;
1219  }
1220 
1221  // set maximum values of column width
1222  SetPageWidth(nTotalWish);
1223 
1224  if(m_xColMgr->GetActualSize() != nTotalWish)
1225  {
1226  m_xColMgr->SetActualWidth(nTotalWish);
1227  Init();
1228  }
1229  bool bPercent;
1230  // only relative data in frame format
1231  if ( m_bFormat || (rSize.GetWidthPercent() && rSize.GetWidthPercent() != SwFormatFrameSize::SYNCED) )
1232  {
1233  // set value for 100%
1234  m_xEd1->SetRefValue(nTotalWish);
1235  m_xEd2->SetRefValue(nTotalWish);
1236  m_xEd3->SetRefValue(nTotalWish);
1237  m_xDistEd1->SetRefValue(nTotalWish);
1238  m_xDistEd2->SetRefValue(nTotalWish);
1239 
1240  // switch to %-view
1241  bPercent = true;
1242  }
1243  else
1244  bPercent = false;
1245 
1246  m_xEd1->ShowPercent(bPercent);
1247  m_xEd2->ShowPercent(bPercent);
1248  m_xEd3->ShowPercent(bPercent);
1249  m_xDistEd1->ShowPercent(bPercent);
1250  m_xDistEd2->ShowPercent(bPercent);
1251  m_xDistEd1->SetMetricFieldMin(0);
1252  m_xDistEd2->SetMetricFieldMin(0);
1253  }
1254  Update(nullptr);
1255 }
1256 
1258 {
1259  if(_pSet)
1260  FillItemSet(_pSet);
1261 
1262  return DeactivateRC::LeavePage;
1263 }
1264 
1265 IMPL_LINK(SwColumnPage, SetDefaultsHdl, ValueSet *, pVS, void)
1266 {
1267  const sal_uInt16 nItem = pVS->GetSelectedItemId();
1268  if( nItem < 4 )
1269  {
1270  m_xCLNrEdt->set_value(nItem);
1271  m_xAutoWidthBox->set_active(true);
1272  m_xDistEd1->set_value(50, FieldUnit::CM);
1273  ColModify(nullptr);
1274  }
1275  else
1276  {
1277  m_bLockUpdate = true;
1278  m_xCLNrEdt->set_value(2);
1279  m_xAutoWidthBox->set_active(false);
1280  m_xDistEd1->set_value(50, FieldUnit::CM);
1281  ColModify(nullptr);
1282  // now set the width ratio to 2 : 1 or 1 : 2 respectively
1283  const long nSmall = static_cast< long >(m_xColMgr->GetActualSize() / 3);
1284  if(nItem == 4)
1285  {
1286  m_xEd2->set_value(m_xEd2->NormalizePercent(nSmall), FieldUnit::TWIP);
1287  m_pModifiedField = m_xEd2.get();
1288  }
1289  else
1290  {
1291  m_xEd1->set_value(m_xEd1->NormalizePercent(nSmall), FieldUnit::TWIP);
1292  m_pModifiedField = m_xEd1.get();
1293  }
1294  m_bLockUpdate = false;
1295  Timeout();
1296 
1297  }
1298 }
1299 
1301 {
1302  m_bFrame = bMod;
1303 }
1304 
1306 {
1307  if(!SW_MOD()->GetCTLOptions().IsCTLFontEnabled())
1308  return;
1309 
1310  m_xTextDirectionFT->set_visible(bSet);
1311  m_xTextDirectionLB->set_visible(bSet);
1312 }
1313 
1315 {
1316  vcl::RenderContext* pDev = rUDEvt.GetRenderContext();
1317  const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
1318 
1319  tools::Rectangle aRect = rUDEvt.GetRect();
1320  const sal_uInt16 nItemId = rUDEvt.GetItemId();
1321  long nRectWidth = aRect.GetWidth();
1322  long nRectHeight = aRect.GetHeight();
1323 
1324  Point aBLPos = aRect.TopLeft();
1325  Color aFillColor(pDev->GetFillColor());
1326  Color aLineColor(pDev->GetLineColor());
1327  pDev->SetFillColor(rStyleSettings.GetFieldColor());
1329 
1330  long nStep = std::abs(std::abs(nRectHeight * 95 /100) / 11);
1331  long nTop = (nRectHeight - 11 * nStep ) / 2;
1332  sal_uInt16 nCols = 0;
1333  long nStarts[3];
1334  long nEnds[3];
1335  nStarts[0] = nRectWidth * 10 / 100;
1336  switch( nItemId )
1337  {
1338  case 1:
1339  nEnds[0] = nRectWidth * 9 / 10;
1340  nCols = 1;
1341  break;
1342  case 2: nCols = 2;
1343  nEnds[0] = nRectWidth * 45 / 100;
1344  nStarts[1] = nEnds[0] + nStep;
1345  nEnds[1] = nRectWidth * 9 / 10;
1346  break;
1347  case 3: nCols = 3;
1348  nEnds[0] = nRectWidth * 30 / 100;
1349  nStarts[1] = nEnds[0] + nStep;
1350  nEnds[1] = nRectWidth * 63 / 100;
1351  nStarts[2] = nEnds[1] + nStep;
1352  nEnds[2] = nRectWidth * 9 / 10;
1353  break;
1354  case 4: nCols = 2;
1355  nEnds[0] = nRectWidth * 63 / 100;
1356  nStarts[1] = nEnds[0] + nStep;
1357  nEnds[1] = nRectWidth * 9 / 10;
1358  break;
1359  case 5: nCols = 2;
1360  nEnds[0] = nRectWidth * 30 / 100;
1361  nStarts[1] = nEnds[0] + nStep;
1362  nEnds[1] = nRectWidth * 9 / 10;
1363  break;
1364  }
1365  for(sal_uInt16 j = 0; j < nCols; j++ )
1366  {
1367  Point aStart(aBLPos.X() + nStarts[j], 0);
1368  Point aEnd(aBLPos.X() + nEnds[j], 0);
1369  for( sal_uInt16 i = 0; i < 12; i ++)
1370  {
1371  aStart.setY( aBLPos.Y() + nTop + i * nStep);
1372  aEnd.setY( aStart.Y() );
1373  pDev->DrawLine(aStart, aEnd);
1374  }
1375  }
1376  pDev->SetFillColor(aFillColor);
1377  pDev->SetLineColor(aLineColor);
1378 }
1379 
1381 {
1382  SetFormat();
1383  Invalidate();
1385 }
1386 
1387 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long GetLeft() const
Point TopLeft() const
long Width() const
std::unique_ptr< SwPercentField > m_xEd2
Definition: column.hxx:127
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
std::unique_ptr< weld::Container > m_xContentArea
Definition: column.hxx:55
std::unique_ptr< weld::MetricSpinButton > m_xLineWidthEdit
Definition: column.hxx:116
long GetWidth() const
FieldUnit
constexpr sal_uInt16 g_nMinWidth(MINLAY)
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:168
long GetHeight() const
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
const SwPageDesc * GetSelectedPageDescs() const
if inside all selection only one PageDesc,
Definition: fedesc.cxx:184
virtual void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface)=0
sal_uInt16 GetLower() const
const char aData[]
Definition: ww8scan.hxx:47
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
long Height() const
std::unique_ptr< weld::CheckButton > m_xAutoWidthBox
Definition: column.hxx:113
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
#define LISTBOX_FRAME
Definition: column.cxx:65
long GetWidth() const
bool m_bFormat
Definition: column.hxx:97
virtual OUString get_text(int pos) const =0
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: column.cxx:597
void SetSelectHdl(const Link< ValueSet *, void > &rLink)
virtual void Reset(const SfxItemSet *rSet) override
Definition: column.cxx:534
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
#define MINLAY
Definition: swtypes.hxx:66
#define FN_INSERT_REGION
Definition: cmdid.h:278
If text in multi-column sections should be evenly distributed.
Definition: fmtclbl.hxx:28
std::unique_ptr< SwPercentField > m_xEd3
Definition: column.hxx:128
#define FRAME_FORMAT_WIDTH
Definition: column.cxx:69
#define LISTBOX_SECTIONS
Definition: column.cxx:63
void SetFrameMode(bool bMod)
Definition: column.cxx:1300
const weld::MetricSpinButton * get() const
Definition: prcntfld.hxx:47
void UpdateCols()
Definition: column.cxx:815
SvxFrameDirection
SwSectionFormat * GetFormat()
Definition: section.hxx:336
void SetPageWidth(long nPageWidth)
Definition: column.cxx:516
static SfxObjectShell * Current()
std::unique_ptr< weld::CustomWeld > m_xFrameExampleWN
Definition: column.hxx:134
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
std::unique_ptr< weld::Label > m_xLineTypeLbl
Definition: column.hxx:114
virtual int get_count() const =0
virtual void StyleUpdated() override
const OUString & GetName() const
Definition: pagedesc.hxx:187
const SvxBoxItem & GetBox(bool=true) const
Definition: frmatr.hxx:84
std::unique_ptr< weld::Label > m_xLbl1
Definition: column.hxx:109
const SwSection * GetCurrSection() const
Definition: edsect.cxx:70
std::unique_ptr< SvtLineListBox > m_xLineTypeDLB
Definition: column.hxx:125
void SwapPam()
Definition: crsrsh.cxx:974
static sal_uInt8 nPagePos
Definition: basesh.cxx:112
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
SwWrtShell & m_rWrtShell
Definition: column.hxx:39
void SetInSection(bool bSet)
Definition: column.cxx:1305
virtual void StyleUpdated() override
Definition: column.cxx:1380
virtual void show()=0
std::unique_ptr< SwPercentField > m_xEd1
Definition: column.hxx:126
std::unique_ptr< ColorListBox > m_xLineColorDLB
Definition: column.hxx:124
OUString SvxResId(const char *pId)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
std::unique_ptr< weld::Label > m_xTextDirectionFT
Definition: column.hxx:122
#define LISTBOX_SECTION
Definition: column.cxx:62
std::map< weld::MetricSpinButton *, SwPercentField * > m_aPercentFieldsMap
Definition: column.hxx:95
long m_nColWidth[nMaxCols]
Definition: column.hxx:91
std::unique_ptr< SwPercentField > m_xDistEd1
Definition: column.hxx:129
void SetExchangeSupport()
static bool IsMarkInSameSection(SwWrtShell &rWrtSh, const SwSection *pSect)
Definition: column.cxx:74
void Update(const weld::MetricSpinButton *pInteractiveField)
Definition: column.cxx:1101
std::unique_ptr< weld::ComboBox > m_xLinePosDLB
Definition: column.hxx:121
std::unique_ptr< weld::Label > m_xLinePosLbl
Definition: column.hxx:120
void UpdateExample(const SfxItemSet &rSet, SwColMgr *pMgr)
Definition: colex.hxx:78
std::unique_ptr< weld::Button > m_xOkButton
Definition: column.hxx:56
long GetSectionWidth(SwFormat const &rFormat) const
Width of current range for column-dialog.
Definition: feshview.cxx:2914
void DrawLine(const Point &rStartPt, const Point &rEndPt)
sal_uInt16 GetActualSize() const
Definition: colmgr.hxx:66
IMPL_LINK_NOARG(SwColumnDlg, OkHdl, weld::Button &, void)
Definition: column.cxx:258
ColumnValueSet m_aDefaultVS
Definition: column.hxx:102
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:168
sal_uInt16 m_nCols
Definition: column.hxx:90
void SetLineColor()
long m_nSelectionWidth
Definition: column.hxx:47
std::unique_ptr< weld::MetricSpinButton > m_xLineHeightEdit
Definition: column.hxx:119
Style of a layout element.
Definition: frmfmt.hxx:57
void Timeout()
Definition: column.cxx:1057
bool HasSelection() const
Definition: wrtsh.hxx:141
#define SW_MOD()
Definition: swmodule.hxx:255
vcl::RenderContext * GetRenderContext() const
long m_nColDist[nMaxCols]
Definition: column.hxx:92
bool IsInsRegionAvailable() const
Definition: edsect.cxx:57
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
std::unique_ptr< SfxItemSet > m_pSectionSet
Definition: column.hxx:42
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:686
int i
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: column.cxx:1156
void connect_changed(const Link< ComboBox &, void > &rLink)
sal_uInt16 GetFullSelectedSectionCount() const
Search inside the cursor selection for full selected sections.
Definition: edsect.cxx:246
std::unique_ptr< weld::Label > m_xLineColorLbl
Definition: column.hxx:117
std::unique_ptr< svx::FrameDirectionListBox > m_xTextDirectionLB
Definition: column.hxx:123
void ColModify(const weld::SpinButton *)
Definition: column.cxx:911
int get_value(FieldUnit eOutUnit=FieldUnit::NONE)
Definition: prcntfld.cxx:129
HTMLMODE_ON
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:337
std::unique_ptr< weld::CheckButton > m_xBalanceColsCB
Definition: column.hxx:107
void SetFillColor()
const Color & GetFieldColor() const
const Color & GetLineColor() const
std::unique_ptr< weld::SpinButton > m_xCLNrEdt
Definition: column.hxx:106
IMPL_LINK(SwColumnDlg, ObjectListBoxHdl, weld::ComboBox &, rBox, void)
Definition: column.cxx:211
SwColExample m_aPgeExampleWN
Definition: column.hxx:103
void InsertItem(sal_uInt16 nItemId, const Image &rImage)
long m_nPageWidth
Definition: column.hxx:48
virtual void set_active(int pos)=0
std::unique_ptr< weld::Button > m_xBtnNext
Definition: column.hxx:112
bool m_bPageChanged
Definition: column.hxx:50
OUString SwResId(const char *pId)
Definition: swmodule.cxx:165
bool m_bHtmlMode
Definition: column.hxx:99
SwPercentField * m_pModifiedField
Definition: column.hxx:93
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
virtual void UserDraw(const UserDrawEvent &rUDEvt) override
Definition: column.cxx:1314
std::unique_ptr< SfxItemSet > m_pSelectionSet
Definition: column.hxx:43
sal_Int32 nLineWidth
std::unique_ptr< SfxItemSet > m_pPageSet
Definition: column.hxx:41
void SetLabels(sal_uInt16 nVis)
Definition: column.cxx:874
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:690
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
static BorderWidthImpl getWidthImpl(SvxBorderLineStyle nStyle)
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
std::unique_ptr< SwColMgr > m_xColMgr
Definition: column.hxx:87
void SetFormat()
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: column.cxx:1257
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:51
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const int nMaxCols
Definition: column.hxx:32
void SetNoSelection()
bool m_bFrame
Definition: column.hxx:98
void Width(long nNew)
Definition: swrect.hxx:187
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:115
void SetColCount(sal_uInt16 nNewCols=1)
static Color & GetFontColor()
Definition: viewopt.cxx:425
const sal_uInt16 nVisCols
Definition: column.cxx:72
RET_OK
bool isLineNotNone() const
Definition: column.cxx:802
int DenormalizePercent(int nValue)
Definition: prcntfld.cxx:164
Reference< XExecutableDialog > m_xDialog
#define LISTBOX_SELECTION
Definition: column.cxx:61
void connectPercentField(SwPercentField &rWrap)
Definition: column.cxx:527
const OUString PERCENT("Percent")
#define LISTBOX_PAGE
Definition: column.cxx:64
virtual ~SwColumnPage() override
Definition: column.cxx:501
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
void Init()
Definition: column.cxx:740
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:89
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
std::unique_ptr< weld::CustomWeld > m_xDefaultVS
Definition: column.hxx:131
std::unique_ptr< SwColumnPage > m_xTabPage
Definition: column.hxx:40
long GetRight() const
std::unique_ptr< SwPercentField > m_xDistEd2
Definition: column.hxx:130
DeactivateRC
OUString sId
bool m_bSelSectionChanged
Definition: column.hxx:52
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:591
virtual void remove(int pos)=0
SwColLineAdj
Definition: fmtclds.hxx:59
std::unique_ptr< weld::Label > m_xLbl3
Definition: column.hxx:111
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
std::unique_ptr< weld::Label > m_xLbl2
Definition: column.hxx:110
Frame is variable in Var-direction.
sal_uInt16 GetGutterWidth(sal_uInt16 nPos=USHRT_MAX) const
Definition: colmgr.cxx:77
long m_nOldSelection
Definition: column.hxx:46
sal_uInt16 GetSmallestDistance() const
long GetHeight() const
SfxItemSet * m_pFrameSet
Definition: column.hxx:44
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
void ResetColWidth()
Definition: column.cxx:360
std::unique_ptr< weld::Label > m_xLineHeightLbl
Definition: column.hxx:118
std::unique_ptr< weld::CustomWeld > m_xPgeExampleWN
Definition: column.hxx:133
const Size & GetSize() const
const Color & GetFillColor() const
SfxItemSet * EvalCurrentSelection(void)
Definition: column.cxx:316
bool m_bFrameChanged
Definition: column.hxx:53
sal_uInt16 GetUpper() const
std::unique_ptr< weld::Button > m_xBtnBack
Definition: column.hxx:108
const SvxLRSpaceItem & GetLRSpace(bool=true) const
Definition: frmatr.hxx:74