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