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_xTabPage = std::make_unique<SwColumnPage>(m_xContentArea.get(), this, *pColPgSet);
171  m_xTabPage->GetApplyLabel()->show();
172  weld::ComboBox* pApplyToLB = m_xTabPage->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
213  m_xTabPage->ActivateColumnControl();
214 }
215 
217 {
218  m_xTabPage.reset();
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_xTabPage->FillItemSet(pSet);
233  }
234  weld::ComboBox* pApplyToLB = m_xTabPage->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_xTabPage->ShowBalance(bIsSection);
261  m_xTabPage->SetInSection(bIsSection);
262  m_xTabPage->SetFrameMode(true);
263  m_xTabPage->SetPageWidth(nWidth);
264  if( pSet )
265  m_xTabPage->Reset(pSet);
266 }
267 
269 {
270  // evaluate current selection
271  SfxItemSet* pSet = EvalCurrentSelection();
272  m_xTabPage->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(pPage, pController, "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"), pController->getDialog()))
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  m_xFrameExampleWN.reset();
514  m_xPgeExampleWN.reset();
515  m_xDefaultVS.reset();
516  m_xDistEd2.reset();
517  m_xDistEd1.reset();
518  m_xEd3.reset();
519  m_xEd2.reset();
520  m_xEd1.reset();
521  m_xLineTypeDLB.reset();
522  m_xLineColorDLB.reset();
523  m_xTextDirectionLB.reset();
524 }
525 
526 void SwColumnPage::SetPageWidth(long nPageWidth)
527 {
528  long nNewMaxWidth = static_cast< long >(m_xEd1->NormalizePercent(nPageWidth));
529 
530  m_xDistEd1->set_max(nNewMaxWidth, FieldUnit::TWIP);
531  m_xDistEd2->set_max(nNewMaxWidth, FieldUnit::TWIP);
532  m_xEd1->set_max(nNewMaxWidth, FieldUnit::TWIP);
533  m_xEd2->set_max(nNewMaxWidth, FieldUnit::TWIP);
534  m_xEd3->set_max(nNewMaxWidth, FieldUnit::TWIP);
535 }
536 
538 {
539  weld::MetricSpinButton *pField = rWrap.get();
540  assert(pField);
541  m_aPercentFieldsMap[pField] = &rWrap;
542 }
543 
545 {
546  const sal_uInt16 nHtmlMode =
547  ::GetHtmlMode(static_cast<const SwDocShell*>(SfxObjectShell::Current()));
548  if(nHtmlMode & HTMLMODE_ON)
549  {
550  m_bHtmlMode = true;
551  m_xAutoWidthBox->set_sensitive(false);
552  }
554  m_xEd1->SetMetric(aMetric);
555  m_xEd2->SetMetric(aMetric);
556  m_xEd3->SetMetric(aMetric);
557  m_xDistEd1->SetMetric(aMetric);
558  m_xDistEd2->SetMetric(aMetric);
559  //default spacing between cols = 0.5cm
560  m_xDistEd1->set_value(50, FieldUnit::CM);
561  m_xDistEd2->set_value(50, FieldUnit::CM);
562 
563  m_xColMgr.reset(new SwColMgr(*rSet));
564  m_nCols = m_xColMgr->GetCount() ;
565  m_xCLNrEdt->set_max(std::max(static_cast<sal_uInt16>(m_xCLNrEdt->get_max()), m_nCols));
566 
567  if(m_bFrame)
568  {
569  if(m_bFormat) // there is no size here
570  m_xColMgr->SetActualWidth(FRAME_FORMAT_WIDTH);
571  else
572  {
573  const SwFormatFrameSize& rSize = rSet->Get(RES_FRM_SIZE);
574  const SvxBoxItem& rBox = rSet->Get(RES_BOX);
575  m_xColMgr->SetActualWidth(static_cast<sal_uInt16>(rSize.GetSize().Width()) - rBox.GetSmallestDistance());
576  }
577  }
578  if (m_xBalanceColsCB->get_visible())
579  {
580  const SfxPoolItem* pItem;
581  if( SfxItemState::SET == rSet->GetItemState( RES_COLUMNBALANCE, false, &pItem ))
582  m_xBalanceColsCB->set_active(!static_cast<const SwFormatNoBalancedColumns*>(pItem)->GetValue());
583  else
584  m_xBalanceColsCB->set_active(true);
585  }
586 
587  //text direction
588  if( SfxItemState::DEFAULT <= rSet->GetItemState( RES_FRAMEDIR ) )
589  {
590  const SvxFrameDirectionItem& rItem = rSet->Get(RES_FRAMEDIR);
591  SvxFrameDirection nVal = rItem.GetValue();
592  m_xTextDirectionLB->set_active_id(nVal);
593  m_xTextDirectionLB->save_value();
594  }
595 
596  Init();
597  ActivatePage( *rSet );
598 }
599 
600 // create TabPage
601 std::unique_ptr<SfxTabPage> SwColumnPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet)
602 {
603  return std::make_unique<SwColumnPage>(pPage, pController, *rSet);
604 }
605 
606 // stuff attributes into the Set when OK
608 {
609  // set in ItemSet;
610  // the current settings are already present
611 
612  const SfxPoolItem* pOldItem;
613  const SwFormatCol& rCol = m_xColMgr->GetColumns();
614  if(nullptr == (pOldItem = GetOldItem( *rSet, RES_COL )) ||
615  rCol != *pOldItem )
616  rSet->Put(rCol);
617 
618  if (m_xBalanceColsCB->get_visible())
619  {
620  rSet->Put(SwFormatNoBalancedColumns(!m_xBalanceColsCB->get_active()));
621  }
622  if (m_xTextDirectionLB->get_visible())
623  {
624  if (m_xTextDirectionLB->get_value_changed_from_saved())
625  {
626  rSet->Put(SvxFrameDirectionItem(m_xTextDirectionLB->get_active_id(), RES_FRAMEDIR) );
627  }
628  }
629  return true;
630 }
631 
632 // update ColumnManager
633 IMPL_LINK_NOARG( SwColumnPage, UpdateColMgrListBox, weld::ComboBox&, void )
634 {
635  UpdateColMgr(*m_xLineWidthEdit);
636 }
637 
638 IMPL_LINK_NOARG( SwColumnPage, UpdateColMgrLineBox, SvtLineListBox&, void )
639 {
640  UpdateColMgr(*m_xLineWidthEdit);
641 }
642 
643 IMPL_LINK_NOARG( SwColumnPage, UpdateColMgrColorBox, ColorListBox&, void )
644 {
645  UpdateColMgr(*m_xLineWidthEdit);
646 }
647 
649 {
650  if (!m_xColMgr)
651  return;
652  long nGutterWidth = m_xColMgr->GetGutterWidth();
653  if (m_nCols > 1)
654  {
655  // Determine whether the most narrow column is too narrow
656  // for the adjusted column gap
657  long nMin = m_nColWidth[0];
658 
659  for( sal_uInt16 i = 1; i < m_nCols; ++i )
660  nMin = std::min(nMin, m_nColWidth[i]);
661 
662  bool bAutoWidth = m_xAutoWidthBox->get_active();
663  if(!bAutoWidth)
664  {
665  m_xColMgr->SetAutoWidth(false);
666  // when the user didn't allocate the whole width,
667  // add the missing amount to the last column.
668  long nSum = 0;
669  for(sal_uInt16 i = 0; i < m_nCols; ++i)
670  nSum += m_nColWidth[i];
671  nGutterWidth = 0;
672  for(sal_uInt16 i = 0; i < m_nCols - 1; ++i)
673  nGutterWidth += m_nColDist[i];
674  nSum += nGutterWidth;
675 
676  long nMaxW = m_xColMgr->GetActualSize();
677 
678  if( nSum < nMaxW )
679  m_nColWidth[m_nCols - 1] += nMaxW - nSum;
680 
681  m_xColMgr->SetColWidth( 0, static_cast< sal_uInt16 >(m_nColWidth[0] + m_nColDist[0]/2) );
682  for( sal_uInt16 i = 1; i < m_nCols-1; ++i )
683  {
684  long nActDist = (m_nColDist[i] + m_nColDist[i - 1]) / 2;
685  m_xColMgr->SetColWidth( i, static_cast< sal_uInt16 >(m_nColWidth[i] + nActDist ));
686  }
687  m_xColMgr->SetColWidth( m_nCols-1, static_cast< sal_uInt16 >(m_nColWidth[m_nCols-1] + m_nColDist[m_nCols -2]/2) );
688 
689  }
690 
691  bool bEnable = isLineNotNone();
692  m_xLineHeightEdit->set_sensitive(bEnable);
693  m_xLineHeightLbl->set_sensitive(bEnable);
694  m_xLineWidthLbl->set_sensitive(bEnable);
695  m_xLineWidthEdit->set_sensitive(bEnable);
696  m_xLineColorDLB->set_sensitive(bEnable);
697  m_xLineColorLbl->set_sensitive(bEnable);
698 
699  sal_Int64 nLineWidth = m_xLineWidthEdit->get_value(FieldUnit::PERCENT);
700  nLineWidth = static_cast<long>(MetricField::ConvertDoubleValue(
701  nLineWidth,
702  m_xLineWidthEdit->get_digits(),
703  m_xLineWidthEdit->get_unit(), MapUnit::MapTwip ));
704  if( !bEnable )
705  m_xColMgr->SetNoLine();
706  else
707  {
708  m_xColMgr->SetLineWidthAndColor(
709  m_xLineTypeDLB->GetSelectEntryStyle(),
710  nLineWidth,
711  m_xLineColorDLB->GetSelectEntryColor() );
712  m_xColMgr->SetAdjust(SwColLineAdj(m_xLinePosDLB->get_active() + 1));
713  m_xColMgr->SetLineHeightPercent(static_cast<short>(m_xLineHeightEdit->get_value(FieldUnit::PERCENT)));
714  bEnable = m_xColMgr->GetLineHeightPercent() != 100;
715  }
716  m_xLinePosLbl->set_sensitive(bEnable);
717  m_xLinePosDLB->set_sensitive(bEnable);
718 
719  //fdo#66815 if the values are going to be the same, don't update
720  //them to avoid the listbox selection resetting
721  if (nLineWidth != m_xLineTypeDLB->GetWidth())
722  m_xLineTypeDLB->SetWidth(nLineWidth);
723  Color aColor(m_xLineColorDLB->GetSelectEntryColor());
724  if (aColor != m_xLineTypeDLB->GetColor())
725  m_xLineTypeDLB->SetColor(aColor);
726  }
727  else
728  {
729  m_xColMgr->NoCols();
730  m_nCols = 0;
731  }
732 
733  //set maximum values
734  m_xCLNrEdt->set_max(std::max(1L,
735  std::min(long(nMaxCols), long( m_xColMgr->GetActualSize() / (nGutterWidth + MINLAY)) )));
736 
737  //prompt example window
738  if(!m_bLockUpdate)
739  {
740  if(m_bFrame)
741  {
742  m_aFrameExampleWN.SetColumns(m_xColMgr->GetColumns());
743  m_aFrameExampleWN.Invalidate();
744  }
745  else
746  m_aPgeExampleWN.Invalidate();
747  }
748 }
749 
751 {
752  m_xCLNrEdt->set_value(m_nCols);
753 
754  bool bAutoWidth = m_xColMgr->IsAutoWidth() || m_bHtmlMode;
755  m_xAutoWidthBox->set_active(bAutoWidth);
756 
757  sal_Int32 nColumnWidthSum = 0;
758  // set the widths
759  for(sal_uInt16 i = 0; i < m_nCols; ++i)
760  {
761  m_nColWidth[i] = m_xColMgr->GetColWidth(i);
762  nColumnWidthSum += m_nColWidth[i];
763  if(i < m_nCols - 1)
764  m_nColDist[i] = m_xColMgr->GetGutterWidth(i);
765  }
766 
767  if( 1 < m_nCols )
768  {
769  // #97495# make sure that the automatic column width's are always equal
770  if(bAutoWidth)
771  {
772  nColumnWidthSum /= m_nCols;
773  for(sal_uInt16 i = 0; i < m_nCols; ++i)
774  m_nColWidth[i] = nColumnWidthSum;
775  }
776  SwColLineAdj eAdj = m_xColMgr->GetAdjust();
777  if( COLADJ_NONE == eAdj ) // the dialog doesn't know a NONE!
778  {
779  eAdj = COLADJ_TOP;
780  //without Adjust no line type
781  m_xLineTypeDLB->SelectEntry(SvxBorderLineStyle::NONE);
782  m_xLineHeightEdit->set_value(100, FieldUnit::PERCENT);
783  }
784  else
785  {
786  // Need to multiply by 100 because of the 2 decimals
787  m_xLineWidthEdit->set_value( m_xColMgr->GetLineWidth() * 100, FieldUnit::TWIP);
788  m_xLineColorDLB->SelectEntry( m_xColMgr->GetLineColor() );
789  m_xLineTypeDLB->SelectEntry( m_xColMgr->GetLineStyle() );
790  m_xLineTypeDLB->SetWidth( m_xColMgr->GetLineWidth( ) );
791  m_xLineHeightEdit->set_value(m_xColMgr->GetLineHeightPercent(), FieldUnit::PERCENT);
792 
793  }
794  m_xLinePosDLB->set_active( static_cast< sal_Int32 >(eAdj - 1) );
795  }
796  else
797  {
798  m_xLinePosDLB->set_active(0);
799  m_xLineTypeDLB->SelectEntry(SvxBorderLineStyle::NONE);
800  m_xLineHeightEdit->set_value(100, FieldUnit::PERCENT);
801  }
802 
803  UpdateCols();
804  Update(nullptr);
805 
806  // set maximum number of columns
807  // values below 1 are not allowed
808  m_xCLNrEdt->set_max(std::max(1L,
809  std::min(long(nMaxCols), long( m_xColMgr->GetActualSize() / g_nMinWidth) )));
810 }
811 
813 {
814  // nothing is turned off
815  return m_xLineTypeDLB->GetSelectEntryStyle() != SvxBorderLineStyle::NONE;
816 }
817 
818 /*
819  * The number of columns has changed -- here the controls for editing of the
820  * columns are en- or disabled according to the column number. In case there are
821  * more than nVisCols (=3) all Edit are being enabled and the buttons for
822  * scrolling too. Otherwise Edits are being enabled according to the column
823  * numbers; one column can not be edited.
824  */
826 {
827  bool bEnableBtns= false;
828  bool bEnable12 = false;
829  bool bEnable3 = false;
830  const bool bEdit = !m_xAutoWidthBox->get_active();
831  if ( m_nCols > nVisCols )
832  {
833  bEnableBtns = !m_bHtmlMode;
834  bEnable12 = bEnable3 = bEdit;
835  }
836  else if( bEdit )
837  {
838  // here are purposely hardly any breaks
839  switch(m_nCols)
840  {
841  case 3: bEnable3 = true;
842  [[fallthrough]];
843  case 2: bEnable12= true; break;
844  default: /* do nothing */;
845  }
846  }
847  m_xEd1->set_sensitive(bEnable12);
848  bool bEnable = m_nCols > 1;
849  m_xDistEd1->set_sensitive(bEnable);
850  m_xAutoWidthBox->set_sensitive(bEnable && !m_bHtmlMode);
851  m_xEd2->set_sensitive(bEnable12);
852  m_xDistEd2->set_sensitive(bEnable3);
853  m_xEd3->set_sensitive(bEnable3);
854  m_xLbl1->set_sensitive(bEnable12);
855  m_xLbl2->set_sensitive(bEnable12);
856  m_xLbl3->set_sensitive(bEnable3);
857  m_xBtnBack->set_sensitive(bEnableBtns);
858  m_xBtnNext->set_sensitive(bEnableBtns);
859 
860  m_xLineTypeDLB->set_sensitive( bEnable );
861  m_xLineTypeLbl->set_sensitive( bEnable );
862 
863  if (bEnable)
864  {
865  bEnable = isLineNotNone();
866  }
867 
868  //all these depend on > 1 column and line style != none
869  m_xLineHeightEdit->set_sensitive(bEnable);
870  m_xLineHeightLbl->set_sensitive(bEnable);
871  m_xLineWidthLbl->set_sensitive(bEnable);
872  m_xLineWidthEdit->set_sensitive(bEnable);
873  m_xLineColorDLB->set_sensitive(bEnable);
874  m_xLineColorLbl->set_sensitive(bEnable);
875 
876  if (bEnable)
877  bEnable = m_xColMgr->GetLineHeightPercent() != 100;
878 
879  //and these additionally depend on line height != 100%
880  m_xLinePosDLB->set_sensitive(bEnable);
881  m_xLinePosLbl->set_sensitive(bEnable);
882 }
883 
884 void SwColumnPage::SetLabels( sal_uInt16 nVis )
885 {
886  //insert ~ before the last character, e.g. 1 -> ~1, 10 -> 1~0
887  const OUString sLbl( '~' );
888 
889  const OUString sLbl1(OUString::number( nVis + 1 ));
890  m_xLbl1->set_label(sLbl1.replaceAt(sLbl1.getLength()-1, 0, sLbl));
891 
892  const OUString sLbl2(OUString::number( nVis + 2 ));
893  m_xLbl2->set_label(sLbl2.replaceAt(sLbl2.getLength()-1, 0, sLbl));
894 
895  const OUString sLbl3(OUString::number( nVis + 3 ));
896  m_xLbl3->set_label(sLbl3.replaceAt(sLbl3.getLength()-1, 0, sLbl));
897 
898  const OUString sColumnWidth = SwResId( STR_ACCESS_COLUMN_WIDTH ) ;
899  m_xEd1->set_accessible_name(sColumnWidth.replaceFirst("%1", sLbl1));
900  m_xEd2->set_accessible_name(sColumnWidth.replaceFirst("%1", sLbl2));
901  m_xEd3->set_accessible_name(sColumnWidth.replaceFirst("%1", sLbl3));
902 
903  const OUString sDist = SwResId( STR_ACCESS_PAGESETUP_SPACING ) ;
904  m_xDistEd1->set_accessible_name(
905  sDist.replaceFirst("%1", sLbl1).replaceFirst("%2", sLbl2));
906 
907  m_xDistEd2->set_accessible_name(
908  sDist.replaceFirst("%1", sLbl2).replaceFirst("%2", sLbl3));
909 }
910 
911 /*
912  * Handler that is called at alteration of the column number. An alteration of
913  * the column number overwrites potential user's width settings; all columns
914  * are equally wide.
915  */
916 IMPL_LINK(SwColumnPage, ColModify, weld::SpinButton&, rEdit, void)
917 {
918  ColModify(&rEdit);
919 }
920 
922 {
923  m_nCols = static_cast<sal_uInt16>(m_xCLNrEdt->get_value());
924  //#107890# the handler is also called from LoseFocus()
925  //then no change has been made and thus no action should be taken
926  // #i17816# changing the displayed types within the ValueSet
927  //from two columns to two columns with different settings doesn't invalidate the
928  // example windows in ::ColModify()
929  if (!pNF || m_xColMgr->GetCount() != m_nCols)
930  {
931  if (pNF)
933  long nDist = static_cast< long >(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
934  m_xColMgr->SetCount(m_nCols, static_cast<sal_uInt16>(nDist));
935  for(sal_uInt16 i = 0; i < m_nCols; i++)
936  m_nColDist[i] = nDist;
937  m_nFirstVis = 0;
939  UpdateCols();
940  ResetColWidth();
941  Update(nullptr);
942  }
943 }
944 
945 /*
946  * Modify handler for an alteration of the column width or the column gap.
947  * These changes take effect time-displaced. With an alteration of the column
948  * width the automatic calculation of the column width is overruled; only an
949  * alteration of the column number leads back to that default.
950  */
951 IMPL_LINK(SwColumnPage, GapModify, weld::MetricSpinButton&, rMetricField, void)
952 {
953  if (m_nCols < 2)
954  return;
955  SwPercentField *pField = m_aPercentFieldsMap[&rMetricField];
956  assert(pField);
957  long nActValue = static_cast< long >(pField->DenormalizePercent(pField->get_value(FieldUnit::TWIP)));
958  if (m_xAutoWidthBox->get_active())
959  {
960  const long nMaxGap = static_cast< long >
961  ((m_xColMgr->GetActualSize() - m_nCols * MINLAY)/(m_nCols - 1));
962  if(nActValue > nMaxGap)
963  {
964  nActValue = nMaxGap;
965  m_xDistEd1->set_value(m_xDistEd1->NormalizePercent(nMaxGap), FieldUnit::TWIP);
966  }
967  m_xColMgr->SetGutterWidth(static_cast<sal_uInt16>(nActValue));
968  for(sal_uInt16 i = 0; i < m_nCols; i++)
969  m_nColDist[i] = nActValue;
970 
971  ResetColWidth();
972  UpdateCols();
973  }
974  else
975  {
976  const sal_uInt16 nVis = m_nFirstVis + ((pField == m_xDistEd2.get()) ? 1 : 0);
977  long nDiff = nActValue - m_nColDist[nVis];
978  if(nDiff)
979  {
980  long nLeft = m_nColWidth[nVis];
981  long nRight = m_nColWidth[nVis + 1];
982  if(nLeft + nRight + 2 * MINLAY < nDiff)
983  nDiff = nLeft + nRight - 2 * MINLAY;
984  if(nDiff < nRight - MINLAY)
985  {
986  nRight -= nDiff;
987  }
988  else
989  {
990  long nTemp = nDiff - nRight + MINLAY;
991  nRight = MINLAY;
992  if(nLeft > nTemp - MINLAY)
993  {
994  nLeft -= nTemp;
995  nTemp = 0;
996  }
997  else
998  {
999  nTemp -= nLeft + MINLAY;
1000  nLeft = MINLAY;
1001  }
1002  nDiff = nTemp;
1003  }
1004  m_nColWidth[nVis] = nLeft;
1005  m_nColWidth[nVis + 1] = nRight;
1006  m_nColDist[nVis] += nDiff;
1007 
1008  m_xColMgr->SetColWidth( nVis, sal_uInt16(nLeft) );
1009  m_xColMgr->SetColWidth( nVis + 1, sal_uInt16(nRight) );
1010  m_xColMgr->SetGutterWidth( sal_uInt16(m_nColDist[nVis]), nVis );
1011  }
1012 
1013  }
1014  Update(&rMetricField);
1015 }
1016 
1018 {
1019  SwPercentField *pField = m_aPercentFieldsMap[&rEdit];
1020  assert(pField);
1021  m_pModifiedField = pField;
1022  Timeout();
1023 }
1024 
1025 // Handler behind the Checkbox for automatic width. When the box is checked
1026 // no explicit values for the column width can be entered.
1027 IMPL_LINK(SwColumnPage, AutoWidthHdl, weld::ToggleButton&, rBox, void)
1028 {
1029  long nDist = static_cast< long >(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
1030  m_xColMgr->SetCount(m_nCols, static_cast<sal_uInt16>(nDist));
1031  for(sal_uInt16 i = 0; i < m_nCols; i++)
1032  m_nColDist[i] = nDist;
1033  if (rBox.get_active())
1034  {
1035  m_xColMgr->SetGutterWidth(sal_uInt16(nDist));
1036  ResetColWidth();
1037  }
1038  m_xColMgr->SetAutoWidth(rBox.get_active(), sal_uInt16(nDist));
1039  UpdateCols();
1040  Update(nullptr);
1041 }
1042 
1043 // scroll up the contents of the edits
1045 {
1046  if( m_nFirstVis )
1047  {
1048  --m_nFirstVis;
1049  SetLabels( m_nFirstVis );
1050  Update(nullptr);
1051  }
1052 }
1053 
1054 // scroll down the contents of the edits.
1056 {
1057  if( m_nFirstVis + nVisCols < m_nCols )
1058  {
1059  ++m_nFirstVis;
1060  SetLabels( m_nFirstVis );
1061  Update(nullptr);
1062  }
1063 }
1064 
1065 // relict from ancient times - now directly without time handler; triggered by
1066 // an alteration of the column width or the column gap.
1068 {
1069  SwPercentField *pField = m_pModifiedField;
1070  if (m_pModifiedField)
1071  {
1072  // find the changed column
1073  sal_uInt16 nChanged = m_nFirstVis;
1074  if (m_pModifiedField == m_xEd2.get())
1075  ++nChanged;
1076  else if (m_pModifiedField == m_xEd3.get())
1077  nChanged += 2;
1078 
1079  long nNewWidth = static_cast< long >
1081  long nDiff = nNewWidth - m_nColWidth[nChanged];
1082 
1083  // when it's the last column
1084  if(nChanged == m_nCols - 1)
1085  {
1086  m_nColWidth[0] -= nDiff;
1087  if(m_nColWidth[0] < static_cast<long>(g_nMinWidth))
1088  {
1089  nNewWidth -= g_nMinWidth - m_nColWidth[0];
1090  m_nColWidth[0] = g_nMinWidth;
1091  }
1092 
1093  }
1094  else if(nDiff)
1095  {
1096  m_nColWidth[nChanged + 1] -= nDiff;
1097  if(m_nColWidth[nChanged + 1] < static_cast<long>(g_nMinWidth))
1098  {
1099  nNewWidth -= g_nMinWidth - m_nColWidth[nChanged + 1];
1100  m_nColWidth[nChanged + 1] = g_nMinWidth;
1101  }
1102  }
1103  m_nColWidth[nChanged] = nNewWidth;
1104  m_pModifiedField = nullptr;
1105  }
1106 
1107  Update(pField ? pField->get() : nullptr);
1108 }
1109 
1110 // Update the view
1111 void SwColumnPage::Update(const weld::MetricSpinButton* pInteractiveField)
1112 {
1113  m_xBalanceColsCB->set_sensitive(m_nCols > 1);
1114  if(m_nCols >= 2)
1115  {
1116  sal_Int64 nCurrentValue, nNewValue;
1117 
1118  nCurrentValue = m_xEd1->NormalizePercent(m_xEd1->DenormalizePercent(m_xEd1->get_value(FieldUnit::TWIP)));
1119  nNewValue = m_xEd1->NormalizePercent(m_nColWidth[m_nFirstVis]);
1120 
1121  //fdo#87612 if we're interacting with this widget and the value will be the same
1122  //then leave it alone (i.e. don't change equivalent values of e.g. .8 -> 0.8)
1123  if (nNewValue != nCurrentValue || pInteractiveField != m_xEd1->get())
1124  m_xEd1->set_value(nNewValue, FieldUnit::TWIP);
1125 
1126  nCurrentValue = m_xDistEd1->NormalizePercent(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP)));
1127  nNewValue = m_xDistEd1->NormalizePercent(m_nColDist[m_nFirstVis]);
1128  if (nNewValue != nCurrentValue || pInteractiveField != m_xDistEd1->get())
1129  m_xDistEd1->set_value(nNewValue, FieldUnit::TWIP);
1130 
1131  nCurrentValue = m_xEd2->NormalizePercent(m_xEd2->DenormalizePercent(m_xEd2->get_value(FieldUnit::TWIP)));
1132  nNewValue = m_xEd2->NormalizePercent(m_nColWidth[m_nFirstVis+1]);
1133  if (nNewValue != nCurrentValue || pInteractiveField != m_xEd2->get())
1134  m_xEd2->set_value(nNewValue, FieldUnit::TWIP);
1135 
1136  if(m_nCols >= 3)
1137  {
1138  nCurrentValue = m_xDistEd2->NormalizePercent(m_xDistEd2->DenormalizePercent(m_xDistEd2->get_value(FieldUnit::TWIP)));
1139  nNewValue = m_xDistEd2->NormalizePercent(m_nColDist[m_nFirstVis+1]);
1140  if (nNewValue != nCurrentValue || pInteractiveField != m_xDistEd2->get())
1141  m_xDistEd2->set_value(nNewValue, FieldUnit::TWIP);
1142 
1143  nCurrentValue = m_xEd3->NormalizePercent(m_xEd3->DenormalizePercent(m_xEd3->get_value(FieldUnit::TWIP)));
1144  nNewValue = m_xEd3->NormalizePercent(m_nColWidth[m_nFirstVis+2]);
1145  if (nNewValue != nCurrentValue || pInteractiveField != m_xEd3->get())
1146  m_xEd3->set_value(nNewValue, FieldUnit::TWIP);
1147  }
1148  else
1149  {
1150  m_xEd3->set_text(OUString());
1151  m_xDistEd2->set_text(OUString());
1152  }
1153  }
1154  else
1155  {
1156  m_xEd1->set_text(OUString());
1157  m_xEd2->set_text(OUString());
1158  m_xEd3->set_text(OUString());
1159  m_xDistEd1->set_text(OUString());
1160  m_xDistEd2->set_text(OUString());
1161  }
1162  UpdateColMgr(*m_xLineWidthEdit);
1163 }
1164 
1165 // Update Bsp
1167 {
1168  bool bVertical = false;
1169  if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_FRAMEDIR))
1170  {
1171  const SvxFrameDirectionItem& rDirItem =
1172  rSet.Get(RES_FRAMEDIR);
1173  bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB||
1174  rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB;
1175  }
1176 
1177  if (!m_bFrame)
1178  {
1179  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PAGE_SIZE ))
1180  {
1181  const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
1182 
1183  sal_uInt16 nActWidth;
1184 
1185  if (!bVertical)
1186  {
1187  const SvxLRSpaceItem& rLRSpace = rSet.Get(RES_LR_SPACE);
1188  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
1189  nActWidth = rSize.GetSize().Width()
1190  - rLRSpace.GetLeft() - rLRSpace.GetRight() - rBox.GetSmallestDistance();
1191  }
1192  else
1193  {
1194  const SvxULSpaceItem& rULSpace = rSet.Get( RES_UL_SPACE );
1195  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
1196  nActWidth = rSize.GetSize().Height()
1197  - rULSpace.GetUpper() - rULSpace.GetLower() - rBox.GetSmallestDistance();
1198 
1199  }
1200 
1201  if( m_xColMgr->GetActualSize() != nActWidth)
1202  {
1203  m_xColMgr->SetActualWidth(nActWidth);
1204  ColModify( nullptr );
1205  UpdateColMgr( *m_xLineWidthEdit );
1206  }
1207  }
1208  m_xFrameExampleWN->hide();
1210  m_xPgeExampleWN->show();
1211 
1212  }
1213  else
1214  {
1215  m_xPgeExampleWN->hide();
1216  m_xFrameExampleWN->show();
1217 
1218  // Size
1219  const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE);
1220  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
1221 
1222  sal_uInt16 nTotalWish;
1223  if (m_bFormat)
1224  nTotalWish = FRAME_FORMAT_WIDTH;
1225  else
1226  {
1227  long const nDistance = rBox.GetSmallestDistance();
1228  nTotalWish = (!bVertical ? rSize.GetWidth() : rSize.GetHeight()) - 2 * nDistance;
1229  }
1230 
1231  // set maximum values of column width
1232  SetPageWidth(nTotalWish);
1233 
1234  if(m_xColMgr->GetActualSize() != nTotalWish)
1235  {
1236  m_xColMgr->SetActualWidth(nTotalWish);
1237  Init();
1238  }
1239  bool bPercent;
1240  // only relative data in frame format
1241  if ( m_bFormat || (rSize.GetWidthPercent() && rSize.GetWidthPercent() != SwFormatFrameSize::SYNCED) )
1242  {
1243  // set value for 100%
1244  m_xEd1->SetRefValue(nTotalWish);
1245  m_xEd2->SetRefValue(nTotalWish);
1246  m_xEd3->SetRefValue(nTotalWish);
1247  m_xDistEd1->SetRefValue(nTotalWish);
1248  m_xDistEd2->SetRefValue(nTotalWish);
1249 
1250  // switch to %-view
1251  bPercent = true;
1252  }
1253  else
1254  bPercent = false;
1255 
1256  m_xEd1->ShowPercent(bPercent);
1257  m_xEd2->ShowPercent(bPercent);
1258  m_xEd3->ShowPercent(bPercent);
1259  m_xDistEd1->ShowPercent(bPercent);
1260  m_xDistEd2->ShowPercent(bPercent);
1261  m_xDistEd1->SetMetricFieldMin(0);
1262  m_xDistEd2->SetMetricFieldMin(0);
1263  }
1264  Update(nullptr);
1265 }
1266 
1268 {
1269  if(_pSet)
1270  FillItemSet(_pSet);
1271 
1272  return DeactivateRC::LeavePage;
1273 }
1274 
1275 IMPL_LINK(SwColumnPage, SetDefaultsHdl, SvtValueSet *, pVS, void)
1276 {
1277  const sal_uInt16 nItem = pVS->GetSelectedItemId();
1278  if( nItem < 4 )
1279  {
1280  m_xCLNrEdt->set_value(nItem);
1281  m_xAutoWidthBox->set_active(true);
1282  m_xDistEd1->set_value(50, FieldUnit::CM);
1283  ColModify(nullptr);
1284  }
1285  else
1286  {
1287  m_bLockUpdate = true;
1288  m_xCLNrEdt->set_value(2);
1289  m_xAutoWidthBox->set_active(false);
1290  m_xDistEd1->set_value(50, FieldUnit::CM);
1291  ColModify(nullptr);
1292  // now set the width ratio to 2 : 1 or 1 : 2 respectively
1293  const long nSmall = static_cast< long >(m_xColMgr->GetActualSize() / 3);
1294  if(nItem == 4)
1295  {
1296  m_xEd2->set_value(m_xEd2->NormalizePercent(nSmall), FieldUnit::TWIP);
1297  m_pModifiedField = m_xEd2.get();
1298  }
1299  else
1300  {
1301  m_xEd1->set_value(m_xEd1->NormalizePercent(nSmall), FieldUnit::TWIP);
1302  m_pModifiedField = m_xEd1.get();
1303  }
1304  m_bLockUpdate = false;
1305  Timeout();
1306 
1307  }
1308 }
1309 
1311 {
1312  m_bFrame = bMod;
1313 }
1314 
1316 {
1317  if(!SW_MOD()->GetCTLOptions().IsCTLFontEnabled())
1318  return;
1319 
1320  m_xTextDirectionFT->set_visible(bSet);
1321  m_xTextDirectionLB->set_visible(bSet);
1322 }
1323 
1325 {
1326  vcl::RenderContext* pDev = rUDEvt.GetRenderContext();
1327  const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
1328 
1329  tools::Rectangle aRect = rUDEvt.GetRect();
1330  const sal_uInt16 nItemId = rUDEvt.GetItemId();
1331  long nRectWidth = aRect.GetWidth();
1332  long nRectHeight = aRect.GetHeight();
1333 
1334  Point aBLPos = aRect.TopLeft();
1335  Color aFillColor(pDev->GetFillColor());
1336  Color aLineColor(pDev->GetLineColor());
1337  pDev->SetFillColor(rStyleSettings.GetFieldColor());
1339 
1340  long nStep = std::abs(std::abs(nRectHeight * 95 /100) / 11);
1341  long nTop = (nRectHeight - 11 * nStep ) / 2;
1342  sal_uInt16 nCols = 0;
1343  long nStarts[3];
1344  long nEnds[3];
1345  nStarts[0] = nRectWidth * 10 / 100;
1346  switch( nItemId )
1347  {
1348  case 1:
1349  nEnds[0] = nRectWidth * 9 / 10;
1350  nCols = 1;
1351  break;
1352  case 2: nCols = 2;
1353  nEnds[0] = nRectWidth * 45 / 100;
1354  nStarts[1] = nEnds[0] + nStep;
1355  nEnds[1] = nRectWidth * 9 / 10;
1356  break;
1357  case 3: nCols = 3;
1358  nEnds[0] = nRectWidth * 30 / 100;
1359  nStarts[1] = nEnds[0] + nStep;
1360  nEnds[1] = nRectWidth * 63 / 100;
1361  nStarts[2] = nEnds[1] + nStep;
1362  nEnds[2] = nRectWidth * 9 / 10;
1363  break;
1364  case 4: nCols = 2;
1365  nEnds[0] = nRectWidth * 63 / 100;
1366  nStarts[1] = nEnds[0] + nStep;
1367  nEnds[1] = nRectWidth * 9 / 10;
1368  break;
1369  case 5: nCols = 2;
1370  nEnds[0] = nRectWidth * 30 / 100;
1371  nStarts[1] = nEnds[0] + nStep;
1372  nEnds[1] = nRectWidth * 9 / 10;
1373  break;
1374  }
1375  for(sal_uInt16 j = 0; j < nCols; j++ )
1376  {
1377  Point aStart(aBLPos.X() + nStarts[j], 0);
1378  Point aEnd(aBLPos.X() + nEnds[j], 0);
1379  for( sal_uInt16 i = 0; i < 12; i ++)
1380  {
1381  aStart.setY( aBLPos.Y() + nTop + i * nStep);
1382  aEnd.setY( aStart.Y() );
1383  pDev->DrawLine(aStart, aEnd);
1384  }
1385  }
1386  pDev->SetFillColor(aFillColor);
1387  pDev->SetLineColor(aLineColor);
1388 }
1389 
1391 {
1392  SetFormat();
1393  Invalidate();
1395 }
1396 
1397 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long GetLeft() const
Point TopLeft() const
long Width() const
std::unique_ptr< SwPercentField > m_xEd2
Definition: column.hxx:127
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:196
#define RES_COL
Definition: hintids.hxx:216
constexpr sal_uInt16 g_nMinWidth(MINLAY)
const SwFormatCol & GetCol(bool=true) const
Definition: fmtclds.hxx:168
long GetHeight() const
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
const SwPageDesc * GetSelectedPageDescs() const
if inside all selection only one PageDesc,
Definition: fedesc.cxx: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: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: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:607
#define RES_FRAMEDIR
Definition: hintids.hxx:227
virtual void Reset(const SfxItemSet *rSet) override
Definition: column.cxx:544
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:1310
const weld::MetricSpinButton * get() const
Definition: prcntfld.hxx:47
void UpdateCols()
Definition: column.cxx:825
SvxFrameDirection
SwSectionFormat * GetFormat()
Definition: section.hxx:336
void SetPageWidth(long nPageWidth)
Definition: column.cxx:526
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:187
const SvxBoxItem & GetBox(bool=true) const
Definition: frmatr.hxx:84
std::unique_ptr< weld::Label > m_xLbl1
Definition: column.hxx:109
const SwSection * GetCurrSection() const
Definition: edsect.cxx: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:90
SwWrtShell & m_rWrtShell
Definition: column.hxx:39
#define RES_COLUMNBALANCE
Definition: hintids.hxx:226
void SetInSection(bool bSet)
Definition: column.cxx:1315
virtual void StyleUpdated() override
Definition: column.cxx:1390
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:1111
std::unique_ptr< weld::ComboBox > m_xLinePosDLB
Definition: column.hxx:121
#define RES_UL_SPACE
Definition: hintids.hxx:199
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)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
sal_uInt16 GetActualSize() const
Definition: colmgr.hxx:66
IMPL_LINK_NOARG(SwColumnDlg, OkHdl, weld::Button &, void)
Definition: column.cxx:268
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:168
sal_uInt16 m_nCols
Definition: column.hxx:90
void SetLineColor()
long m_nSelectionWidth
Definition: column.hxx:47
std::unique_ptr< weld::MetricSpinButton > m_xLineHeightEdit
Definition: column.hxx:119
Style of a layout element.
Definition: frmfmt.hxx:57
void Timeout()
Definition: column.cxx:1067
bool HasSelection() const
Definition: wrtsh.hxx:141
#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:709
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: column.cxx:1166
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:921
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
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
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:190
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:1324
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:884
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:732
#define RES_LR_SPACE
Definition: hintids.hxx:198
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
static BorderWidthImpl getWidthImpl(SvxBorderLineStyle nStyle)
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
std::unique_ptr< SwColMgr > m_xColMgr
Definition: column.hxx:87
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: column.cxx:1267
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:428
static const sal_uInt16 nVisCols
Definition: column.cxx:82
RET_OK
bool isLineNotNone() const
Definition: column.cxx:812
int DenormalizePercent(int nValue)
Definition: prcntfld.cxx:164
#define LISTBOX_SELECTION
Definition: column.cxx:71
void connectPercentField(SwPercentField &rWrap)
Definition: column.cxx:537
const OUString PERCENT("Percent")
#define LISTBOX_PAGE
Definition: column.cxx:74
virtual ~SwColumnPage() override
Definition: column.cxx:511
void Init()
Definition: column.cxx:750
SwColumnPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: column.cxx:385
sal_uInt16 m_nFirstVis
Definition: column.hxx:89
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
std::unique_ptr< weld::CustomWeld > m_xDefaultVS
Definition: column.hxx:131
std::unique_ptr< SwColumnPage > m_xTabPage
Definition: column.hxx:40
void SetFormat()
long GetRight() const
std::unique_ptr< SwPercentField > m_xDistEd2
Definition: column.hxx:130
DeactivateRC
#define RES_BOX
Definition: hintids.hxx:213
bool m_bSelSectionChanged
Definition: column.hxx:52
sal_uInt16 GetNumCols() const
Definition: fmtclds.hxx:114
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Definition: fefly1.cxx:1233
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: column.cxx:601
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