LibreOffice Module sw (master)  1
pggrid.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 <cmdid.h>
21 #include <hintids.hxx>
22 #include <swtypes.hxx>
23 #include <svx/colorbox.hxx>
24 #include <editeng/sizeitem.hxx>
25 #include <editeng/lrspitem.hxx>
26 #include <editeng/ulspitem.hxx>
27 #include <editeng/boxitem.hxx>
28 #include <editeng/frmdiritem.hxx>
29 #include <svx/ruler.hxx>
30 #include <pggrid.hxx>
31 #include <tgrditem.hxx>
32 
33 #include <wrtsh.hxx>
34 #include <doc.hxx>
35 #include <swmodule.hxx>
36 #include <view.hxx>
37 
39  : SfxTabPage(pPage, pController, "modules/swriter/ui/textgridpage.ui", "TextGridPage", &rSet)
40  , m_nRubyUserValue(0)
41  , m_bRubyUserValue(false)
42  , m_aPageSize(MM50, MM50)
43  , m_bVertical(false)
44  , m_bSquaredMode(false)
45  , m_bHRulerChanged(false)
46  , m_bVRulerChanged(false)
47  , m_xNoGridRB(m_xBuilder->weld_radio_button("radioRB_NOGRID"))
48  , m_xLinesGridRB(m_xBuilder->weld_radio_button("radioRB_LINESGRID"))
49  , m_xCharsGridRB(m_xBuilder->weld_radio_button("radioRB_CHARSGRID"))
50  , m_xSnapToCharsCB(m_xBuilder->weld_check_button("checkCB_SNAPTOCHARS"))
51  , m_xExampleWN(new weld::CustomWeld(*m_xBuilder, "drawingareaWN_EXAMPLE", m_aExampleWN))
52  , m_xLayoutFL(m_xBuilder->weld_widget("frameFL_LAYOUT"))
53  , m_xLinesPerPageNF(m_xBuilder->weld_spin_button("spinNF_LINESPERPAGE"))
54  , m_xLinesRangeFT(m_xBuilder->weld_label("labelFT_LINERANGE"))
55  , m_xTextSizeMF(m_xBuilder->weld_metric_spin_button("spinMF_TEXTSIZE", FieldUnit::POINT))
56  , m_xCharsPerLineFT(m_xBuilder->weld_label("labelFT_CHARSPERLINE"))
57  , m_xCharsPerLineNF(m_xBuilder->weld_spin_button("spinNF_CHARSPERLINE"))
58  , m_xCharsRangeFT(m_xBuilder->weld_label("labelFT_CHARRANGE"))
59  , m_xCharWidthFT(m_xBuilder->weld_label("labelFT_CHARWIDTH"))
60  , m_xCharWidthMF(m_xBuilder->weld_metric_spin_button("spinMF_CHARWIDTH", FieldUnit::POINT))
61  , m_xRubySizeFT(m_xBuilder->weld_label("labelFT_RUBYSIZE"))
62  , m_xRubySizeMF(m_xBuilder->weld_metric_spin_button("spinMF_RUBYSIZE", FieldUnit::POINT))
63  , m_xRubyBelowCB(m_xBuilder->weld_check_button("checkCB_RUBYBELOW"))
64  , m_xDisplayFL(m_xBuilder->weld_widget("frameFL_DISPLAY"))
65  , m_xDisplayCB(m_xBuilder->weld_check_button("checkCB_DISPLAY"))
66  , m_xPrintCB(m_xBuilder->weld_check_button("checkCB_PRINT"))
67  , m_xColorLB(new ColorListBox(m_xBuilder->weld_menu_button("listLB_COLOR"),
68  [this]{ return GetDialogController()->getDialog(); }))
69 {
70  Link<weld::SpinButton&,void> aLink = LINK(this, SwTextGridPage, CharorLineChangedHdl);
71  m_xCharsPerLineNF->connect_value_changed(aLink);
72  m_xLinesPerPageNF->connect_value_changed(aLink);
73 
74  Link<weld::MetricSpinButton&,void> aSizeLink = LINK(this, SwTextGridPage, TextSizeChangedHdl);
75  m_xTextSizeMF->connect_value_changed(aSizeLink);
76  m_xRubySizeMF->connect_value_changed(aSizeLink);
77  m_xCharWidthMF->connect_value_changed(aSizeLink);
78 
79  Link<weld::ToggleButton&,void> aGridTypeHdl = LINK(this, SwTextGridPage, GridTypeHdl);
80  m_xNoGridRB->connect_toggled(aGridTypeHdl);
81  m_xLinesGridRB->connect_toggled(aGridTypeHdl);
82  m_xCharsGridRB->connect_toggled(aGridTypeHdl);
83 
84  m_xColorLB->SetSelectHdl(LINK(this, SwTextGridPage, ColorModifyHdl));
85  m_xPrintCB->connect_toggled(LINK(this, SwTextGridPage, GridModifyClickHdl));
86  m_xRubyBelowCB->connect_toggled(LINK(this, SwTextGridPage, GridModifyClickHdl));
87 
88  m_xDisplayCB->connect_toggled(LINK(this, SwTextGridPage, DisplayGridHdl));
89 
90  //Get the default paper mode
91  SwView *pView = ::GetActiveView();
92  if( pView )
93  {
94  SwWrtShell* pSh = pView->GetWrtShellPtr();
95  if( pSh )
96  {
98  }
99  }
100  if( m_bSquaredMode )
101  {
102 
103  m_xRubySizeFT->show();
104  m_xRubySizeMF->show();
105  m_xRubyBelowCB->show();
106  m_xSnapToCharsCB->hide();
107  m_xCharWidthFT->hide();
108  m_xCharWidthMF->hide();
109  }
110  else
111  {
112  m_xRubySizeFT->hide();
113  m_xRubySizeMF->hide();
114  m_xRubyBelowCB->hide();
115  m_xSnapToCharsCB->show();
116  m_xCharWidthFT->show();
117  m_xCharWidthMF->show();
118  }
119 }
120 
122 {
123  m_xColorLB.reset();
124 }
125 
126 std::unique_ptr<SfxTabPage> SwTextGridPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet)
127 {
128  return std::make_unique<SwTextGridPage>(pPage, pController, *rSet);
129 }
130 
132 {
133  bool bRet = false;
134  if (m_xNoGridRB->get_state_changed_from_saved() ||
135  m_xLinesGridRB->get_state_changed_from_saved() ||
136  m_xLinesPerPageNF->get_value_changed_from_saved() ||
137  m_xTextSizeMF->get_value_changed_from_saved() ||
138  m_xCharsPerLineNF->get_value_changed_from_saved() ||
139  m_xSnapToCharsCB->get_state_changed_from_saved() ||
140  m_xRubySizeMF->get_value_changed_from_saved() ||
141  m_xCharWidthMF->get_value_changed_from_saved() ||
142  m_xRubyBelowCB->get_state_changed_from_saved() ||
143  m_xDisplayCB->get_state_changed_from_saved() ||
144  m_xPrintCB->get_state_changed_from_saved() ||
145  m_xColorLB->IsValueChangedFromSaved())
146  {
147  PutGridItem(*rSet);
148  bRet = true;
149  }
150 
151  // draw ticks of ruler
152  SwView * pView = ::GetActiveView();
153  if ( m_bHRulerChanged )
154  pView->GetHRuler().DrawTicks();
155  if ( m_bVRulerChanged )
156  pView->GetVRuler().DrawTicks();
157  return bRet;
158 }
159 
161 {
162  sal_Int32 nLinesPerPage = 0;
163 
164  if(SfxItemState::DEFAULT <= rSet->GetItemState(RES_TEXTGRID))
165  {
166  const SwTextGridItem& rGridItem = rSet->Get(RES_TEXTGRID);
167  weld::RadioButton* pButton = nullptr;
168  switch(rGridItem.GetGridType())
169  {
170  case GRID_NONE : pButton = m_xNoGridRB.get(); break;
171  case GRID_LINES_ONLY : pButton = m_xLinesGridRB.get(); break;
172  default: pButton = m_xCharsGridRB.get();
173  }
174  pButton->set_active(true);
175  m_xDisplayCB->set_active(rGridItem.IsDisplayGrid());
176  GridTypeHdl(*pButton);
177  m_xSnapToCharsCB->set_active(rGridItem.IsSnapToChars());
178  nLinesPerPage = rGridItem.GetLines();
179 
181  m_nRubyUserValue = rGridItem.GetBaseHeight();
182  m_bRubyUserValue = true;
183  m_xTextSizeMF->set_value(m_xTextSizeMF->normalize(m_nRubyUserValue), FieldUnit::TWIP);
184  m_xRubySizeMF->set_value(m_xRubySizeMF->normalize(rGridItem.GetRubyHeight()), FieldUnit::TWIP);
185  m_xCharWidthMF->set_value(m_xCharWidthMF->normalize(rGridItem.GetBaseWidth()), FieldUnit::TWIP);
186  m_xRubyBelowCB->set_active(rGridItem.IsRubyTextBelow());
187  m_xPrintCB->set_active(rGridItem.IsPrintGrid());
188  m_xColorLB->SelectEntry(rGridItem.GetColor());
189  }
190  UpdatePageSize(*rSet);
191 
192  if (nLinesPerPage > 0)
193  m_xLinesPerPageNF->set_value(nLinesPerPage);
194 
195  m_xNoGridRB->save_state();
196  m_xLinesGridRB->save_state();
197  m_xSnapToCharsCB->save_state();
198  m_xLinesPerPageNF->save_value();
199  m_xTextSizeMF->save_value();
200  m_xCharsPerLineNF->save_value();
201  m_xRubySizeMF->save_value();
202  m_xCharWidthMF->save_value();
203  m_xRubyBelowCB->save_state();
204  m_xDisplayCB->save_state();
205  m_xPrintCB->save_state();
206  m_xColorLB->SaveValue();
207 }
208 
210 {
211  m_aExampleWN.Hide();
213  UpdatePageSize(rSet);
214  m_aExampleWN.Show();
215  m_aExampleWN.Invalidate();
216 }
217 
219 {
220  return DeactivateRC::LeavePage;
221 }
222 
224 {
225  SwTextGridItem aGridItem;
226  aGridItem.SetGridType(m_xNoGridRB->get_active() ? GRID_NONE :
227  m_xLinesGridRB->get_active() ? GRID_LINES_ONLY : GRID_LINES_CHARS );
228  aGridItem.SetSnapToChars(m_xSnapToCharsCB->get_active());
229  aGridItem.SetLines( static_cast< sal_uInt16 >(m_xLinesPerPageNF->get_value()) );
230  aGridItem.SetBaseHeight( static_cast< sal_uInt16 >(
232  m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP))) );
233  aGridItem.SetRubyHeight( static_cast< sal_uInt16 >(m_xRubySizeMF->denormalize(m_xRubySizeMF->get_value(FieldUnit::TWIP))) );
234  aGridItem.SetBaseWidth( static_cast< sal_uInt16 >(m_xCharWidthMF->denormalize(m_xCharWidthMF->get_value(FieldUnit::TWIP))) );
235  aGridItem.SetRubyTextBelow(m_xRubyBelowCB->get_active());
236  aGridItem.SetSquaredMode(m_bSquaredMode);
237  aGridItem.SetDisplayGrid(m_xDisplayCB->get_active());
238  aGridItem.SetPrintGrid(m_xPrintCB->get_active());
239  aGridItem.SetColor(m_xColorLB->GetSelectEntryColor());
240  rSet.Put(aGridItem);
241 
242  SwView * pView = ::GetActiveView();
243  if ( aGridItem.GetGridType() != GRID_NONE )
244  {
245  if ( aGridItem.GetGridType() == GRID_LINES_CHARS )
246  {
247  m_bHRulerChanged = true;
248  }
249  m_bVRulerChanged = true;
250  pView->GetHRuler().SetCharWidth(static_cast<tools::Long>(m_xCharWidthMF->get_value(FieldUnit::TWIP)/56.7));
251  pView->GetVRuler().SetLineHeight(static_cast<tools::Long>(m_xTextSizeMF->get_value(FieldUnit::TWIP)/56.7));
252  }
253 }
254 
256 {
257  if( SfxItemState::UNKNOWN != rSet.GetItemState( RES_FRAMEDIR ))
258  {
259  const SvxFrameDirectionItem& rDirItem =
260  rSet.Get(RES_FRAMEDIR);
261  m_bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB||
262  rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB;
263  }
264 
265  if( SfxItemState::SET != rSet.GetItemState( SID_ATTR_PAGE_SIZE ))
266  return;
267 
268  const SvxSizeItem& rSize = rSet.Get(SID_ATTR_PAGE_SIZE);
269  const SvxLRSpaceItem& rLRSpace = rSet.Get( RES_LR_SPACE );
270  const SvxULSpaceItem& rULSpace = rSet.Get( RES_UL_SPACE );
271  const SvxBoxItem& rBox = rSet.Get(RES_BOX);
272  sal_Int32 nDistanceLR = rLRSpace.GetLeft() + rLRSpace.GetRight();
273  sal_Int32 nDistanceUL = rULSpace.GetUpper() + rULSpace.GetLower();
274 
275  sal_Int32 nValue1 = rSize.GetSize().Height() - nDistanceUL -
276  rBox.GetDistance(SvxBoxItemLine::TOP) -
277  rBox.GetDistance(SvxBoxItemLine::BOTTOM);
278  sal_Int32 nValue2 = rSize.GetSize().Width() - nDistanceLR -
279  rBox.GetDistance(SvxBoxItemLine::LEFT) -
280  rBox.GetDistance(SvxBoxItemLine::RIGHT);
281  if(m_bVertical)
282  {
283  m_aPageSize.setWidth( nValue1 );
284  m_aPageSize.setHeight( nValue2 );
285  }
286  else
287  {
288  m_aPageSize.setWidth( nValue2 );
289  m_aPageSize.setHeight( nValue1 );
290  }
291 
292  sal_Int32 nTextSize = static_cast< sal_Int32 >(m_bRubyUserValue ?
294  m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)));
295 
296  if ( m_bSquaredMode )
297  {
298  sal_Int32 nCharsPerLine = m_aPageSize.Width() / nTextSize;
299  m_xCharsPerLineNF->set_max(nCharsPerLine);
300  m_xCharsPerLineNF->set_value(nCharsPerLine);
302  ( m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)) +
303  m_xRubySizeMF->denormalize(m_xRubySizeMF->get_value(FieldUnit::TWIP))));
306  }
307  else
308  {
309  sal_Int32 nTextWidth = static_cast< sal_Int32 >(m_xCharWidthMF->denormalize(m_xCharWidthMF->get_value(FieldUnit::TWIP)));
310  m_xLinesPerPageNF->set_value(m_aPageSize.Height() / nTextSize);
311  if (nTextWidth)
312  m_xCharsPerLineNF->set_value(m_aPageSize.Width() / nTextWidth);
313  else
314  m_xCharsPerLineNF->set_value(45);
317  }
318 }
319 
320 void SwTextGridPage::SetLinesOrCharsRanges(weld::Label& rField, const sal_Int32 nValue )
321 {
322  OUString aFieldStr = "( 1 -" + OUString::number(nValue) + " )";
323  rField.set_label(aFieldStr);
324 }
325 
326 const sal_uInt16* SwTextGridPage::GetRanges()
327 {
328  static const sal_uInt16 aPageRg[] = {
330  0};
331  return aPageRg;
332 }
333 
334 IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, weld::SpinButton&, rField, void)
335 {
336  //if in squared mode
337  if ( m_bSquaredMode )
338  {
339  if (m_xCharsPerLineNF.get() == &rField)
340  {
341  auto nValue = m_xCharsPerLineNF->get_value();
342  assert(nValue && "div-by-zero");
343  auto nWidth = m_aPageSize.Width() / nValue;
344  m_xTextSizeMF->set_value(m_xTextSizeMF->normalize(nWidth), FieldUnit::TWIP);
345  //prevent rounding errors in the MetricField by saving the used value
346  m_nRubyUserValue = nWidth;
347  m_bRubyUserValue = true;
348 
349  }
350  //set maximum line per page
351  {
352  sal_Int32 nMaxLines = static_cast< sal_Int32 >(m_aPageSize.Height() /
353  ( m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)) +
354  m_xRubySizeMF->denormalize(m_xRubySizeMF->get_value(FieldUnit::TWIP))));
355  m_xLinesPerPageNF->set_max(nMaxLines);
356  }
357  SetLinesOrCharsRanges( *m_xLinesRangeFT , m_xLinesPerPageNF->get_max() );
358  SetLinesOrCharsRanges( *m_xCharsRangeFT , m_xCharsPerLineNF->get_max() );
359  }
360  else//in normal mode
361  {
362  if (m_xLinesPerPageNF.get() == &rField)
363  {
364  auto nValue = m_xLinesPerPageNF->get_value();
365  assert(nValue && "div-by-zero");
366  auto nHeight = m_aPageSize.Height() / nValue;
367  m_xTextSizeMF->set_value(m_xTextSizeMF->normalize(nHeight), FieldUnit::TWIP);
368  m_xRubySizeMF->set_value(0, FieldUnit::TWIP);
369  SetLinesOrCharsRanges( *m_xLinesRangeFT , m_xLinesPerPageNF->get_max() );
370 
371  m_nRubyUserValue = nHeight;
372  m_bRubyUserValue = true;
373  }
374  else if (m_xCharsPerLineNF.get() == &rField)
375  {
376  auto nValue = m_xCharsPerLineNF->get_value();
377  assert(nValue && "div-by-zero");
378  auto nWidth = m_aPageSize.Width() / nValue;
379  m_xCharWidthMF->set_value(m_xCharWidthMF->normalize(nWidth), FieldUnit::TWIP);
380  SetLinesOrCharsRanges( *m_xCharsRangeFT , m_xCharsPerLineNF->get_max() );
381  }
382  }
383  GridModifyHdl();
384 }
385 
386 IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, weld::MetricSpinButton&, rField, void)
387 {
388  //if in squared mode
389  if( m_bSquaredMode )
390  {
391  if (m_xTextSizeMF.get() == &rField)
392  {
393  m_bRubyUserValue = false;
394 
395  // fdo#50941: set maximum characters per line
396  sal_Int32 nTextSize = static_cast< sal_Int32 >(m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)));
397  if (nTextSize > 0)
398  {
399  sal_Int32 nMaxChars = m_aPageSize.Width() / nTextSize;
400  m_xCharsPerLineNF->set_value(nMaxChars);
401  m_xCharsPerLineNF->set_max(nMaxChars);
402  SetLinesOrCharsRanges( *m_xCharsRangeFT , m_xCharsPerLineNF->get_max() );
403  }
404  }
405  //set maximum line per page
406  {
407  sal_Int32 nMaxLines = static_cast< sal_Int32 >(m_aPageSize.Height() /
408  ( m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)) +
409  m_xRubySizeMF->denormalize(m_xRubySizeMF->get_value(FieldUnit::TWIP))));
410  m_xLinesPerPageNF->set_max(nMaxLines);
411  SetLinesOrCharsRanges( *m_xLinesRangeFT , m_xLinesPerPageNF->get_max() );
412  }
413  }
414  else
415  {
416  if (m_xTextSizeMF.get() == &rField)
417  {
418  sal_Int32 nTextSize = static_cast< sal_Int32 >(m_xTextSizeMF->denormalize(m_xTextSizeMF->get_value(FieldUnit::TWIP)));
419  m_xLinesPerPageNF->set_value(m_aPageSize.Height() / nTextSize);
420  m_bRubyUserValue = false;
421  SetLinesOrCharsRanges( *m_xLinesRangeFT , m_xLinesPerPageNF->get_max() );
422  }
423  else if (m_xCharWidthMF.get() == &rField)
424  {
425  sal_Int32 nTextWidth = static_cast< sal_Int32 >(m_xCharWidthMF->denormalize(m_xCharWidthMF->get_value(FieldUnit::TWIP)));
426  sal_Int32 nMaxChar = 45 ;
427  if (nTextWidth)
428  nMaxChar = m_aPageSize.Width() / nTextWidth;
429  m_xCharsPerLineNF->set_value( nMaxChar );
430  SetLinesOrCharsRanges( *m_xCharsRangeFT , m_xCharsPerLineNF->get_max() );
431  }
432  //rubySize is disabled
433  }
434  GridModifyHdl();
435 }
436 
437 IMPL_LINK(SwTextGridPage, GridTypeHdl, weld::ToggleButton&, rButton, void)
438 {
439  bool bEnable = m_xNoGridRB.get() != &rButton;
440  m_xLayoutFL->set_sensitive(bEnable);
441  m_xDisplayFL->set_sensitive(bEnable);
442 
443  //one special case
444  if (bEnable)
445  DisplayGridHdl(*m_xDisplayCB);
446 
447  bEnable = m_xCharsGridRB.get() == &rButton;
448  m_xSnapToCharsCB->set_sensitive(bEnable);
449 
450  bEnable = m_xLinesGridRB.get() == &rButton;
451  if (bEnable && !m_bSquaredMode)
452  {
453  m_xCharsPerLineFT->set_sensitive(false);
454  m_xCharsPerLineNF->set_sensitive(false);
455  m_xCharsRangeFT->set_sensitive(false);
456  m_xCharWidthFT->set_sensitive(false);
457  m_xCharWidthMF->set_sensitive(false);
458  }
459 
460  GridModifyHdl();
461 }
462 
464 {
465  bool bChecked = m_xDisplayCB->get_active();
466  m_xPrintCB->set_sensitive(bChecked);
467  m_xPrintCB->set_active(bChecked);
468 }
469 
471 {
472  GridModifyHdl();
473 }
474 
476 {
477  GridModifyHdl();
478 }
479 
481 {
482  const SfxItemSet& rOldSet = GetItemSet();
483  SfxItemSet aSet(rOldSet);
484  const SfxItemSet* pExSet = GetDialogExampleSet();
485  if(pExSet)
486  aSet.Put(*pExSet);
487  PutGridItem(aSet);
489 }
490 
491 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
FieldUnit
void PutGridItem(SfxItemSet &rSet)
Definition: pggrid.cxx:223
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: pggrid.cxx:126
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: pggrid.cxx:131
std::unique_ptr< ColorListBox > m_xColorLB
Definition: pggrid.hxx:60
sal_uInt16 GetLower() const
void setWidth(tools::Long nWidth)
SwView * GetActiveView()
Definition: swmodul1.cxx:116
sal_uInt16 GetBaseWidth() const
Definition: tgrditem.hxx:97
virtual ~SwTextGridPage() override
Definition: pggrid.cxx:121
tools::Long GetRight() const
void SetRubyHeight(sal_uInt16 nNew)
Definition: tgrditem.hxx:79
sal_uInt16 GetDistance(SvxBoxItemLine nLine) const
std::unique_ptr< weld::RadioButton > m_xLinesGridRB
Definition: pggrid.hxx:41
void SetDisplayGrid(bool bNew)
Definition: tgrditem.hxx:94
std::unique_ptr< weld::MetricSpinButton > m_xTextSizeMF
Definition: pggrid.hxx:48
SvxRuler & GetVRuler()
Definition: view.hxx:495
std::unique_ptr< weld::Label > m_xLinesRangeFT
Definition: pggrid.hxx:47
std::unique_ptr< weld::CheckButton > m_xRubyBelowCB
Definition: pggrid.hxx:56
Used by the UI to modify the document model.
Definition: wrtsh.hxx:91
constexpr tools::Long Width() const
void SetSquaredMode(bool bNew)
Definition: tgrditem.hxx:106
void SetRubyTextBelow(bool bNew)
Definition: tgrditem.hxx:86
std::unique_ptr< weld::Label > m_xCharWidthFT
Definition: pggrid.hxx:52
void UpdatePageSize(const SfxItemSet &rSet)
Definition: pggrid.cxx:255
void SetBaseWidth(sal_uInt16 nNew)
Definition: tgrditem.hxx:98
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
SwTextGridPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: pggrid.cxx:38
IMPL_LINK(SwTextGridPage, CharorLineChangedHdl, weld::SpinButton &, rField, void)
Definition: pggrid.cxx:334
bool m_bHRulerChanged
Definition: pggrid.hxx:36
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
void SetColor(const Color &rCol)
Definition: tgrditem.hxx:70
bool m_bVRulerChanged
Definition: pggrid.hxx:37
virtual void set_active(bool active)=0
const SfxItemSet & GetItemSet() const
std::unique_ptr< weld::RadioButton > m_xNoGridRB
Definition: pggrid.hxx:40
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
bool IsPrintGrid() const
Definition: tgrditem.hxx:88
bool IsRubyTextBelow() const
Definition: tgrditem.hxx:84
tools::Long GetLeft() const
sal_Int32 m_nRubyUserValue
Definition: pggrid.hxx:31
void UpdateExample(const SfxItemSet &rSet)
Definition: colex.cxx:598
std::unique_ptr< weld::RadioButton > m_xCharsGridRB
Definition: pggrid.hxx:42
void SetBaseHeight(sal_uInt16 nNew)
Definition: tgrditem.hxx:76
IMPL_LINK_NOARG(SwTextGridPage, DisplayGridHdl, weld::ToggleButton &, void)
Definition: pggrid.cxx:463
bool m_bSquaredMode
Definition: pggrid.hxx:35
const SfxItemSet * GetDialogExampleSet() const
sal_uInt16 GetLines() const
Definition: tgrditem.hxx:72
virtual void set_label(const OUString &rText)=0
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: pggrid.cxx:209
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwPageGridExample m_aExampleWN
Definition: pggrid.hxx:39
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:414
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(115)
std::unique_ptr< weld::CheckButton > m_xPrintCB
Definition: pggrid.hxx:59
bool IsSquaredPageMode() const
Definition: docdesc.cxx:951
#define MM50
Definition: swtypes.hxx:59
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: pggrid.cxx:218
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
std::unique_ptr< weld::Label > m_xCharsRangeFT
Definition: pggrid.hxx:51
void SetSnapToChars(bool bNew)
Definition: tgrditem.hxx:102
std::unique_ptr< weld::CheckButton > m_xSnapToCharsCB
Definition: pggrid.hxx:43
const Color & GetColor() const
Definition: tgrditem.hxx:69
void GridModifyHdl()
Definition: pggrid.cxx:480
static const sal_uInt16 * GetRanges()
Definition: pggrid.cxx:326
SfxOkDialogController * GetDialogController() const
bool m_bVertical
Definition: pggrid.hxx:34
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
SvxRuler & GetHRuler()
Definition: view.hxx:494
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
bool IsSnapToChars() const
Definition: tgrditem.hxx:100
std::unique_ptr< weld::Label > m_xRubySizeFT
Definition: pggrid.hxx:54
DeactivateRC
void setHeight(tools::Long nHeight)
bool m_bRubyUserValue
Definition: pggrid.hxx:32
std::unique_ptr< weld::CheckButton > m_xDisplayCB
Definition: pggrid.hxx:58
static void SetLinesOrCharsRanges(weld::Label &rField, const sal_Int32 nValue)
Definition: pggrid.cxx:320
bool IsDisplayGrid() const
Definition: tgrditem.hxx:92
Size m_aPageSize
Definition: pggrid.hxx:33
SwTextGrid GetGridType() const
Definition: tgrditem.hxx:81
std::unique_ptr< weld::SpinButton > m_xCharsPerLineNF
Definition: pggrid.hxx:50
void SetPrintGrid(bool bNew)
Definition: tgrditem.hxx:90
sal_uInt16 GetBaseHeight() const
Definition: tgrditem.hxx:75
std::unique_ptr< weld::MetricSpinButton > m_xRubySizeMF
Definition: pggrid.hxx:55
std::unique_ptr< weld::MetricSpinButton > m_xCharWidthMF
Definition: pggrid.hxx:53
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
sal_uInt16 GetRubyHeight() const
Definition: tgrditem.hxx:78
void SetGridType(SwTextGrid eNew)
Definition: tgrditem.hxx:82
Definition: view.hxx:144
std::unique_ptr< weld::SpinButton > m_xLinesPerPageNF
Definition: pggrid.hxx:46
const Size & GetSize() const
void SetLines(sal_uInt16 nNew)
Definition: tgrditem.hxx:73
sal_Int16 nValue
sal_uInt16 GetUpper() const
virtual void Reset(const SfxItemSet *rSet) override
Definition: pggrid.cxx:160