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