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