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