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