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