LibreOffice Module sw (master)  1
optpage.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 <sal/config.h>
21 
22 #include <utility>
23 
24 #include <optpage.hxx>
25 #include <doc.hxx>
26 #include <hintids.hxx>
27 #include <cmdid.h>
28 #include <fmtcol.hxx>
29 #include <charatr.hxx>
30 #include <swtypes.hxx>
31 #include <view.hxx>
32 #include <docsh.hxx>
35 
36 #include <swmodule.hxx>
37 #include <wrtsh.hxx>
38 #include <cfgitems.hxx>
39 #include <poolfmt.hxx>
40 #include <uiitems.hxx>
41 #include <printdata.hxx>
42 #include <modcfg.hxx>
43 #include <crstate.hxx>
44 #include <viewopt.hxx>
45 #include <globals.hrc>
46 #include <strings.hrc>
47 #include <swwrtshitem.hxx>
48 
49 #include <editeng/fhgtitem.hxx>
50 #include <editeng/fontitem.hxx>
51 #include <editeng/langitem.hxx>
52 #include <editeng/svxenum.hxx>
53 #include <sal/macros.h>
54 #include <sfx2/dialoghelper.hxx>
55 #include <sfx2/printer.hxx>
56 #include <sfx2/bindings.hxx>
57 #include <sfx2/viewfrm.hxx>
58 #include <svl/ctloptions.hxx>
59 #include <svl/eitem.hxx>
60 #include <svl/cjkoptions.hxx>
61 #include <svtools/ctrltool.hxx>
62 #include <svtools/unitconv.hxx>
63 #include <sfx2/htmlmode.hxx>
64 
65 #include <vcl/settings.hxx>
66 #include <vcl/svapp.hxx>
67 
68 #include <optload.hxx>
69 
70 using namespace ::com::sun::star;
71 
72 namespace {
73 
74 void drawRect(vcl::RenderContext& rRenderContext, const tools::Rectangle &rRect, const Color &rFillColor, const Color &rLineColor)
75 {
76  rRenderContext.SetFillColor(rFillColor);
77  rRenderContext.SetLineColor(rLineColor);
78  rRenderContext.DrawRect(rRect);
79 }
80 
81 }
82 
83 // Tools->Options->Writer->View
84 // Tools->Options->Writer/Web->View
86  : SfxTabPage(pPage, pController, "modules/swriter/ui/viewoptionspage.ui", "ViewOptionsPage", &rCoreSet)
87  , m_xCrossCB(m_xBuilder->weld_check_button("helplines"))
88  , m_xHMetric(m_xBuilder->weld_combo_box("hrulercombobox"))
89  , m_xVRulerCBox(m_xBuilder->weld_check_button("vruler"))
90  , m_xVRulerRightCBox(m_xBuilder->weld_check_button("vrulerright"))
91  , m_xVMetric(m_xBuilder->weld_combo_box("vrulercombobox"))
92  , m_xSmoothCBox(m_xBuilder->weld_check_button("smoothscroll"))
93  , m_xGrfCB(m_xBuilder->weld_check_button("graphics"))
94  , m_xTableCB(m_xBuilder->weld_check_button("tables"))
95  , m_xDrwCB(m_xBuilder->weld_check_button("drawings"))
96  , m_xPostItCB(m_xBuilder->weld_check_button("comments"))
97  , m_xSettingsFrame(m_xBuilder->weld_frame("settingsframe"))
98  , m_xSettingsLabel(m_xBuilder->weld_label("settingslabel"))
99  , m_xMetricLabel(m_xBuilder->weld_label("measureunitlabel"))
100  , m_xMetricLB(m_xBuilder->weld_combo_box("measureunit"))
101  , m_xShowInlineTooltips(m_xBuilder->weld_check_button("changestooltip"))
102  , m_xFieldHiddenCB(m_xBuilder->weld_check_button("hiddentextfield"))
103  , m_xFieldHiddenParaCB(m_xBuilder->weld_check_button("hiddenparafield"))
104 {
105  /* This part is visible only with Writer/Web->View dialogue. */
106  const SfxPoolItem* pItem;
107  if (! (SfxItemState::SET == rCoreSet.GetItemState(SID_HTML_MODE, false, &pItem )
108  && static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON))
109  {
110  m_xSettingsFrame->hide();
111  m_xSettingsLabel->hide();
112  m_xMetricLabel->hide();
113  m_xMetricLB->hide();
114  }
115 
116  SvtCJKOptions aCJKOptions;
117  if(!aCJKOptions.IsVerticalTextEnabled() )
118  m_xVRulerRightCBox->hide();
119  m_xVRulerCBox->connect_toggled(LINK(this, SwContentOptPage, VertRulerHdl ));
120 
121  for (size_t i = 0; i < SwFieldUnitTable::Count(); ++i)
122  {
123  const OUString sMetric = SwFieldUnitTable::GetString(i);
125 
126  switch ( eFUnit )
127  {
128  case FieldUnit::MM:
129  case FieldUnit::CM:
130  case FieldUnit::POINT:
131  case FieldUnit::PICA:
132  case FieldUnit::INCH:
133  case FieldUnit::CHAR: // add two units , 'character' and 'line' , their ticks are not fixed
134  case FieldUnit::LINE:
135  {
136  // only use these metrics
137  // a horizontal ruler has not the 'line' unit
138  // there isn't 'line' unit in HTML format
139  if (eFUnit != FieldUnit::LINE)
140  {
141  m_xMetricLB->append(OUString::number(static_cast<sal_uInt32>(eFUnit)), sMetric);
142  m_xHMetric->append(OUString::number(static_cast<sal_uInt32>(eFUnit)), sMetric);
143  }
144  // a vertical ruler has not the 'character' unit
145  if (eFUnit != FieldUnit::CHAR)
146  {
147  m_xVMetric->append(OUString::number(static_cast<sal_uInt32>(eFUnit)), sMetric);
148  }
149  break;
150  }
151  default:;//prevent warning
152  }
153  }
154 }
155 
157 {
158 }
159 
160 std::unique_ptr<SfxTabPage> SwContentOptPage::Create( weld::Container* pPage, weld::DialogController* pController,
161  const SfxItemSet* rAttrSet)
162 {
163  return std::make_unique<SwContentOptPage>(pPage, pController, *rAttrSet);
164 }
165 
166 static void lcl_SelectMetricLB(weld::ComboBox& rMetric, sal_uInt16 nSID, const SfxItemSet& rSet)
167 {
168  const SfxPoolItem* pItem;
169  if( rSet.GetItemState( nSID, false, &pItem ) >= SfxItemState::DEFAULT )
170  {
171  FieldUnit eFieldUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
172  for (sal_Int32 i = 0, nEntryCount = rMetric.get_count(); i < nEntryCount; ++i)
173  {
174  if (rMetric.get_id(i).toUInt32() == static_cast<sal_uInt32>(eFieldUnit))
175  {
176  rMetric.set_active(i);
177  break;
178  }
179  }
180  }
181  rMetric.save_value();
182 }
183 
185 {
186  const SwElemItem* pElemAttr = nullptr;
187 
188  rSet->GetItemState( FN_PARAM_ELEM , false,
189  reinterpret_cast<const SfxPoolItem**>(&pElemAttr) );
190  if(pElemAttr)
191  {
192  m_xTableCB->set_active(pElemAttr->m_bTable);
193  m_xGrfCB->set_active(pElemAttr->m_bGraphic);
194  m_xDrwCB->set_active(pElemAttr->m_bDrawing);
195  m_xPostItCB->set_active(pElemAttr->m_bNotes);
196  m_xCrossCB->set_active(pElemAttr->m_bCrosshair);
197  m_xVRulerCBox->set_active(pElemAttr->m_bVertRuler);
198  m_xVRulerRightCBox->set_active(pElemAttr->m_bVertRulerRight);
199  m_xSmoothCBox->set_active(pElemAttr->m_bSmoothScroll);
200  m_xShowInlineTooltips->set_active(pElemAttr->m_bShowInlineTooltips);
201  m_xFieldHiddenCB->set_active( pElemAttr->m_bFieldHiddenText );
202  m_xFieldHiddenParaCB->set_active( pElemAttr->m_bShowHiddenPara );
203  }
204  m_xMetricLB->set_active(-1);
205  lcl_SelectMetricLB(*m_xMetricLB, SID_ATTR_METRIC, *rSet);
208 }
209 
211 {
212  const SwElemItem* pOldAttr = static_cast<const SwElemItem*>(
214 
215  SwElemItem aElem;
216  aElem.m_bTable = m_xTableCB->get_active();
217  aElem.m_bGraphic = m_xGrfCB->get_active();
218  aElem.m_bDrawing = m_xDrwCB->get_active();
219  aElem.m_bNotes = m_xPostItCB->get_active();
220  aElem.m_bCrosshair = m_xCrossCB->get_active();
221  aElem.m_bVertRuler = m_xVRulerCBox->get_active();
222  aElem.m_bVertRulerRight = m_xVRulerRightCBox->get_active();
223  aElem.m_bSmoothScroll = m_xSmoothCBox->get_active();
224  aElem.m_bShowInlineTooltips = m_xShowInlineTooltips->get_active();
225  aElem.m_bFieldHiddenText = m_xFieldHiddenCB->get_active();
226  aElem.m_bShowHiddenPara = m_xFieldHiddenParaCB->get_active();
227 
228  bool bRet = !pOldAttr || aElem != *pOldAttr;
229  if(bRet)
230  bRet = nullptr != rSet->Put(aElem);
231 
232  sal_Int32 nMPos = m_xMetricLB->get_active();
233  sal_Int32 nGlobalMetricPos = nMPos;
234  if ( m_xMetricLB->get_value_changed_from_saved() )
235  {
236  const sal_uInt16 nFieldUnit = m_xMetricLB->get_id(nMPos).toUInt32();
237  rSet->Put( SfxUInt16Item( SID_ATTR_METRIC, nFieldUnit ) );
238  bRet = true;
239  }
240 
241  nMPos = m_xHMetric->get_active();
242  if ( m_xHMetric->get_value_changed_from_saved() || nMPos != nGlobalMetricPos )
243  {
244  const sal_uInt16 nFieldUnit = m_xHMetric->get_id(nMPos).toUInt32();
245  rSet->Put( SfxUInt16Item( FN_HSCROLL_METRIC, nFieldUnit ) );
246  bRet = true;
247  }
248  nMPos = m_xVMetric->get_active();
249  if ( m_xVMetric->get_value_changed_from_saved() || nMPos != nGlobalMetricPos )
250  {
251  const sal_uInt16 nFieldUnit = m_xVMetric->get_id(nMPos).toUInt32();
252  rSet->Put( SfxUInt16Item( FN_VSCROLL_METRIC, nFieldUnit ) );
253  bRet = true;
254  }
255 
256  return bRet;
257 }
258 
259 IMPL_LINK(SwContentOptPage, VertRulerHdl, weld::ToggleButton&, rBox, void)
260 {
261  m_xVRulerRightCBox->set_sensitive(rBox.get_sensitive() && rBox.get_active());
262 }
263 
264 // TabPage Printer additional settings
266  const SfxItemSet& rCoreSet)
267  : SfxTabPage(pPage, pController, "modules/swriter/ui/printoptionspage.ui", "PrintOptionsPage", &rCoreSet)
268  , sNone(SwResId(SW_STR_NONE))
269  , bAttrModified(false)
270  , bPreview(false)
271  , m_xGrfCB(m_xBuilder->weld_check_button("graphics"))
272  , m_xCtrlFieldCB(m_xBuilder->weld_check_button("formcontrols"))
273  , m_xBackgroundCB(m_xBuilder->weld_check_button("background"))
274  , m_xBlackFontCB(m_xBuilder->weld_check_button("inblack"))
275  , m_xPrintHiddenTextCB(m_xBuilder->weld_check_button("hiddentext"))
276  , m_xPrintTextPlaceholderCB(m_xBuilder->weld_check_button("textplaceholder"))
277  , m_xPagesFrame(m_xBuilder->weld_widget("pagesframe"))
278  , m_xLeftPageCB(m_xBuilder->weld_check_button("leftpages"))
279  , m_xRightPageCB(m_xBuilder->weld_check_button("rightpages"))
280  , m_xProspectCB(m_xBuilder->weld_check_button("brochure"))
281  , m_xProspectCB_RTL(m_xBuilder->weld_check_button("rtl"))
282  , m_xCommentsFrame(m_xBuilder->weld_widget("commentsframe"))
283  , m_xNoRB(m_xBuilder->weld_radio_button("none"))
284  , m_xOnlyRB(m_xBuilder->weld_radio_button("only"))
285  , m_xEndRB(m_xBuilder->weld_radio_button("end"))
286  , m_xEndPageRB(m_xBuilder->weld_radio_button("endpage"))
287  , m_xInMarginsRB(m_xBuilder->weld_radio_button("inmargins"))
288  , m_xPrintEmptyPagesCB(m_xBuilder->weld_check_button("blankpages"))
289  , m_xPaperFromSetupCB(m_xBuilder->weld_check_button("papertray"))
290  , m_xFaxLB(m_xBuilder->weld_combo_box("fax"))
291 {
292  Link<weld::ToggleButton&,void> aLk = LINK( this, SwAddPrinterTabPage, AutoClickHdl);
293  m_xGrfCB->connect_toggled( aLk );
294  m_xRightPageCB->connect_toggled( aLk );
295  m_xLeftPageCB->connect_toggled( aLk );
296  m_xCtrlFieldCB->connect_toggled( aLk );
297  m_xBackgroundCB->connect_toggled( aLk );
298  m_xBlackFontCB->connect_toggled( aLk );
299  m_xPrintHiddenTextCB->connect_toggled( aLk );
300  m_xPrintTextPlaceholderCB->connect_toggled( aLk );
301  m_xProspectCB->connect_toggled( aLk );
302  m_xProspectCB_RTL->connect_toggled( aLk );
303  m_xPaperFromSetupCB->connect_toggled( aLk );
304  m_xPrintEmptyPagesCB->connect_toggled( aLk );
305  m_xEndPageRB->connect_toggled( aLk );
306  m_xInMarginsRB->connect_toggled( aLk );
307  m_xEndRB->connect_toggled( aLk );
308  m_xOnlyRB->connect_toggled( aLk );
309  m_xNoRB->connect_toggled( aLk );
310  m_xFaxLB->connect_changed( LINK( this, SwAddPrinterTabPage, SelectHdl ) );
311 
312  const SfxPoolItem* pItem;
313  if(SfxItemState::SET == rCoreSet.GetItemState(SID_HTML_MODE, false, &pItem )
314  && static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON)
315  {
316  m_xLeftPageCB->hide();
317  m_xRightPageCB->hide();
318  m_xPrintHiddenTextCB->hide();
320  m_xPrintEmptyPagesCB->hide();
321  }
322  m_xProspectCB_RTL->set_sensitive(false);
323  SvtCTLOptions aCTLOptions;
324  m_xProspectCB_RTL->set_visible(aCTLOptions.IsCTLFontEnabled());
325 }
326 
328 {
329 }
330 
332 {
333  bPreview = bPrev;
334  m_xCommentsFrame->set_sensitive(!bPreview);
335  m_xPagesFrame->set_sensitive(!bPreview);
336 }
337 
338 std::unique_ptr<SfxTabPage> SwAddPrinterTabPage::Create( weld::Container* pPage, weld::DialogController* pController,
339  const SfxItemSet* rAttrSet )
340 {
341  return std::make_unique<SwAddPrinterTabPage>(pPage, pController, *rAttrSet);
342 }
343 
345 {
346  if ( bAttrModified )
347  {
348  SwAddPrinterItem aAddPrinterAttr;
349  aAddPrinterAttr.m_bPrintGraphic = m_xGrfCB->get_active();
350  aAddPrinterAttr.m_bPrintTable = true; // always enabled since CWS printerpullgpages /*m_xTabCB->get_active();*/
351  aAddPrinterAttr.m_bPrintDraw = m_xGrfCB->get_active(); // UI merged with m_xGrfCB in CWS printerpullgpages
352  aAddPrinterAttr.m_bPrintControl = m_xCtrlFieldCB->get_active();
353  aAddPrinterAttr.m_bPrintPageBackground = m_xBackgroundCB->get_active();
354  aAddPrinterAttr.m_bPrintBlackFont = m_xBlackFontCB->get_active();
355  aAddPrinterAttr.m_bPrintHiddenText = m_xPrintHiddenTextCB->get_active();
356  aAddPrinterAttr.m_bPrintTextPlaceholder = m_xPrintTextPlaceholderCB->get_active();
357 
358  aAddPrinterAttr.m_bPrintLeftPages = m_xLeftPageCB->get_active();
359  aAddPrinterAttr.m_bPrintRightPages = m_xRightPageCB->get_active();
360  aAddPrinterAttr.m_bPrintReverse = false; // handled by vcl itself since CWS printerpullpages /*m_xReverseCB->get_active()*/;
361  aAddPrinterAttr.m_bPrintProspect = m_xProspectCB->get_active();
362  aAddPrinterAttr.m_bPrintProspectRTL = m_xProspectCB_RTL->get_active();
363  aAddPrinterAttr.m_bPaperFromSetup = m_xPaperFromSetupCB->get_active();
364  aAddPrinterAttr.m_bPrintEmptyPages = m_xPrintEmptyPagesCB->get_active();
365  aAddPrinterAttr.m_bPrintSingleJobs = true; // handled by vcl in new print dialog since CWS printerpullpages /*m_xSingleJobsCB->get_active()*/;
366 
367  if (m_xNoRB->get_active()) aAddPrinterAttr.m_nPrintPostIts =
369  if (m_xOnlyRB->get_active()) aAddPrinterAttr.m_nPrintPostIts =
371  if (m_xEndRB->get_active()) aAddPrinterAttr.m_nPrintPostIts =
373  if (m_xEndPageRB->get_active()) aAddPrinterAttr.m_nPrintPostIts =
375  if (m_xInMarginsRB->get_active()) aAddPrinterAttr.m_nPrintPostIts =
377 
378  const OUString sFax = m_xFaxLB->get_active_text();
379  aAddPrinterAttr.m_sFaxName = sNone == sFax ? OUString() : sFax;
380  rCoreSet->Put(aAddPrinterAttr);
381  }
382  return bAttrModified;
383 }
384 
386 {
387  const SfxItemSet& rSet = GetItemSet();
388  const SwAddPrinterItem* pAddPrinterAttr = nullptr;
389 
390  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ADDPRINTER , false,
391  reinterpret_cast<const SfxPoolItem**>(&pAddPrinterAttr) ))
392  {
393  m_xGrfCB->set_active(pAddPrinterAttr->m_bPrintGraphic || pAddPrinterAttr->m_bPrintDraw);
394  m_xCtrlFieldCB->set_active( pAddPrinterAttr->m_bPrintControl);
395  m_xBackgroundCB->set_active( pAddPrinterAttr->m_bPrintPageBackground);
396  m_xBlackFontCB->set_active( pAddPrinterAttr->m_bPrintBlackFont);
397  m_xPrintHiddenTextCB->set_active( pAddPrinterAttr->m_bPrintHiddenText);
398  m_xPrintTextPlaceholderCB->set_active(pAddPrinterAttr->m_bPrintTextPlaceholder);
399  m_xLeftPageCB->set_active( pAddPrinterAttr->m_bPrintLeftPages);
400  m_xRightPageCB->set_active( pAddPrinterAttr->m_bPrintRightPages);
401  m_xPaperFromSetupCB->set_active(pAddPrinterAttr->m_bPaperFromSetup);
402  m_xPrintEmptyPagesCB->set_active(pAddPrinterAttr->m_bPrintEmptyPages);
403  m_xProspectCB->set_active( pAddPrinterAttr->m_bPrintProspect);
404  m_xProspectCB_RTL->set_active( pAddPrinterAttr->m_bPrintProspectRTL);
405 
406  m_xNoRB->set_active(pAddPrinterAttr->m_nPrintPostIts== SwPostItMode::NONE ) ;
407  m_xOnlyRB->set_active(pAddPrinterAttr->m_nPrintPostIts== SwPostItMode::Only ) ;
408  m_xEndRB->set_active(pAddPrinterAttr->m_nPrintPostIts== SwPostItMode::EndDoc ) ;
409  m_xEndPageRB->set_active(pAddPrinterAttr->m_nPrintPostIts== SwPostItMode::EndPage ) ;
410  m_xInMarginsRB->set_active(pAddPrinterAttr->m_nPrintPostIts== SwPostItMode::InMargins ) ;
411  auto nFound = m_xFaxLB->find_text(pAddPrinterAttr->m_sFaxName);
412  if (nFound != -1)
413  m_xFaxLB->set_active(nFound);
414  else
415  m_xFaxLB->set_active(0);
416  }
417  if (m_xProspectCB->get_active())
418  {
419  m_xProspectCB_RTL->set_sensitive(true);
420  m_xNoRB->set_sensitive( false );
421  m_xOnlyRB->set_sensitive( false );
422  m_xEndRB->set_sensitive( false );
423  m_xEndPageRB->set_sensitive( false );
424  }
425  else
426  m_xProspectCB_RTL->set_sensitive( false );
427 }
428 
430 {
431  bAttrModified = true;
432  bool bIsProspect = m_xProspectCB->get_active();
433  if (!bIsProspect)
434  m_xProspectCB_RTL->set_active( false );
435  m_xProspectCB_RTL->set_sensitive( bIsProspect );
436  m_xNoRB->set_sensitive( !bIsProspect );
437  m_xOnlyRB->set_sensitive( !bIsProspect );
438  m_xEndRB->set_sensitive( !bIsProspect );
439  m_xEndPageRB->set_sensitive( !bIsProspect );
440  m_xInMarginsRB->set_sensitive( !bIsProspect );
441 }
442 
443 void SwAddPrinterTabPage::SetFax( const std::vector<OUString>& rFaxLst )
444 {
445  m_xFaxLB->append_text(sNone);
446  for(const auto & i : rFaxLst)
447  {
448  m_xFaxLB->append_text(i);
449  }
450  m_xFaxLB->set_active(0);
451 }
452 
454 {
455  bAttrModified=true;
456 }
457 
459 {
460  const SfxBoolItem* pListItem = aSet.GetItem<SfxBoolItem>(SID_FAX_LIST, false);
461  const SfxBoolItem* pPreviewItem = aSet.GetItem<SfxBoolItem>(SID_PREVIEWFLAG_TYPE, false);
462  if (pPreviewItem)
463  {
464  SetPreview(pPreviewItem->GetValue());
465  Reset(&aSet);
466  }
467  if (pListItem && pListItem->GetValue())
468  {
469  std::vector<OUString> aFaxList;
470  const std::vector<OUString>& rPrinters = Printer::GetPrinterQueues();
471  for (const auto & rPrinter : rPrinters)
472  aFaxList.insert(aFaxList.begin(), rPrinter);
473  SetFax( aFaxList );
474  }
475 }
476 
477 // Tabpage Standardfonts
479  : SfxTabPage(pPage, pController, "modules/swriter/ui/optfonttabpage.ui", "OptFontTabPage", &rSet)
480  , m_pPrt(nullptr)
481  , m_pFontConfig(nullptr)
482  , m_pWrtShell(nullptr)
483  , m_eLanguage( GetAppLanguage() )
484  , m_bListDefault(false)
485  , m_bSetListDefault(true)
486  , m_bLabelDefault(false)
487  , m_bSetLabelDefault(true)
488  , m_bIdxDefault(false)
489  , m_bSetIdxDefault(true)
490  , m_bDisposePrinter(false)
491  , m_bListHeightDefault(false)
492  , m_bLabelHeightDefault(false)
493  , m_bIndexHeightDefault(false)
494  , m_nFontGroup(FONT_GROUP_DEFAULT)
495  , m_sScriptWestern(SwResId(ST_SCRIPT_WESTERN))
496  , m_sScriptAsian(SwResId(ST_SCRIPT_ASIAN))
497  , m_sScriptComplex(SwResId(ST_SCRIPT_CTL))
498  , m_xLabelFT(m_xBuilder->weld_label("label1"))
499  , m_xStandardBox(m_xBuilder->weld_combo_box("standardbox"))
500  , m_xStandardHeightLB(new FontSizeBox(m_xBuilder->weld_combo_box("standardheight")))
501  , m_xTitleBox(m_xBuilder->weld_combo_box("titlebox"))
502  , m_xTitleHeightLB(new FontSizeBox(m_xBuilder->weld_combo_box("titleheight")))
503  , m_xListBox(m_xBuilder->weld_combo_box("listbox"))
504  , m_xListHeightLB(new FontSizeBox(m_xBuilder->weld_combo_box("listheight")))
505  , m_xLabelBox(m_xBuilder->weld_combo_box("labelbox"))
506  , m_xLabelHeightLB(new FontSizeBox(m_xBuilder->weld_combo_box("labelheight")))
507  , m_xIdxBox(m_xBuilder->weld_combo_box("idxbox"))
508  , m_xIndexHeightLB(new FontSizeBox(m_xBuilder->weld_combo_box("indexheight")))
509  , m_xStandardPB(m_xBuilder->weld_button("standard"))
510 {
511  m_xStandardBox->make_sorted();
512  m_xTitleBox->make_sorted();
513  m_xListBox->make_sorted();
514  m_xLabelBox->make_sorted();
515  m_xIdxBox->make_sorted();
516 
517  m_xStandardPB->connect_clicked(LINK(this, SwStdFontTabPage, StandardHdl));
518  m_xStandardBox->connect_changed( LINK(this, SwStdFontTabPage, ModifyHdl));
519  m_xListBox->connect_changed( LINK(this, SwStdFontTabPage, ModifyHdl));
520  m_xLabelBox->connect_changed( LINK(this, SwStdFontTabPage, ModifyHdl));
521  m_xIdxBox->connect_changed( LINK(this, SwStdFontTabPage, ModifyHdl));
522  Link<weld::Widget&,void> aFocusLink = LINK( this, SwStdFontTabPage, LoseFocusHdl);
523  m_xStandardBox->connect_focus_out( aFocusLink );
524  m_xTitleBox->connect_focus_out( aFocusLink );
525  m_xListBox->connect_focus_out( aFocusLink );
526  m_xLabelBox->connect_focus_out( aFocusLink );
527  m_xIdxBox->connect_focus_out( aFocusLink );
528 }
529 
531 {
532  m_xIndexHeightLB.reset();
533  m_xLabelHeightLB.reset();
534  m_xListHeightLB.reset();
535  m_xTitleHeightLB.reset();
536  m_xStandardHeightLB.reset();
537  m_pFontList.reset();
538  if (m_bDisposePrinter)
540  else
541  m_pPrt.clear();
542 }
543 
544 std::unique_ptr<SfxTabPage> SwStdFontTabPage::Create( weld::Container* pPage, weld::DialogController* pController,
545  const SfxItemSet* rAttrSet )
546 {
547  return std::make_unique<SwStdFontTabPage>(pPage, pController, *rAttrSet);
548 }
549 
550 static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
551  SfxPrinter const * pPrt, const OUString& rStyle,
552  sal_uInt16 nFontWhich)
553 {
554  vcl::Font aFont( rStyle, Size( 0, 10 ) );
555  if( pPrt )
556  aFont = pPrt->GetFontMetric( aFont );
557  SwTextFormatColl *pColl = pWrtShell->GetTextCollFromPool(nType);
558  pColl->SetFormatAttr(SvxFontItem(aFont.GetFamilyType(), aFont.GetFamilyName(),
559  OUString(), aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
560 }
561 
562 static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
563  sal_Int32 nHeight, sal_uInt16 nFontHeightWhich)
564 {
565  float fSize = static_cast<float>(nHeight) / 10;
566  nHeight = CalcToUnit( fSize, MapUnit::MapTwip );
567  SwTextFormatColl *pColl = pWrtShell->GetTextCollFromPool(nType);
568  pColl->SetFormatAttr(SvxFontHeightItem(nHeight, 100, nFontHeightWhich));
569 }
570 
572 {
573  SW_MOD()->GetModuleConfig()->SetDefaultFontInCurrDocOnly(false);
574 
575  const OUString sStandard = m_xStandardBox->get_active_text();
576  const OUString sTitle = m_xTitleBox->get_active_text();
577  const OUString sList = m_xListBox->get_active_text();
578  const OUString sLabel = m_xLabelBox->get_active_text();
579  const OUString sIdx = m_xIdxBox->get_active_text();
580 
581  bool bStandardHeightChanged = m_xStandardHeightLB->get_value_changed_from_saved();
582  bool bTitleHeightChanged = m_xTitleHeightLB->get_value_changed_from_saved();
583  bool bListHeightChanged = m_xListHeightLB->get_value_changed_from_saved() && !m_bListHeightDefault;
584  bool bLabelHeightChanged = m_xLabelHeightLB->get_value_changed_from_saved() && !m_bLabelHeightDefault;
585  bool bIndexHeightChanged = m_xIndexHeightLB->get_value_changed_from_saved() && !m_bIndexHeightDefault;
586 
592  if(bStandardHeightChanged)
593  {
594  float fSize = static_cast<float>(m_xStandardHeightLB->get_value()) / 10;
595  m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_STANDARD, m_nFontGroup );
596  }
597  if(bTitleHeightChanged)
598  {
599  float fSize = static_cast<float>(m_xTitleHeightLB->get_value()) / 10;
600  m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_OUTLINE, m_nFontGroup );
601  }
602  if(bListHeightChanged)
603  {
604  float fSize = static_cast<float>(m_xListHeightLB->get_value()) / 10;
605  m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_LIST, m_nFontGroup );
606  }
607  if(bLabelHeightChanged)
608  {
609  float fSize = static_cast<float>(m_xLabelHeightLB->get_value()) / 10;
610  m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_CAPTION, m_nFontGroup );
611  }
612  if(bIndexHeightChanged)
613  {
614  float fSize = static_cast<float>(m_xIndexHeightLB->get_value()) / 10;
615  m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_INDEX, m_nFontGroup );
616  }
617 
618  if(m_pWrtShell)
619  {
622  bool bMod = false;
623  const sal_uInt16 nFontWhich =
626  const sal_uInt16 nFontHeightWhich =
629  if(sStandard != m_sShellStd)
630  {
631  vcl::Font aFont( sStandard, Size( 0, 10 ) );
632  if( pPrinter )
633  aFont = pPrinter->GetFontMetric( aFont );
635  OUString(), aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
637  pColl->ResetFormatAttr(nFontWhich);
638  bMod = true;
639  }
640  if(bStandardHeightChanged)
641  {
642  float fSize = static_cast<float>(m_xStandardHeightLB->get_value()) / 10;
643  m_pWrtShell->SetDefault(SvxFontHeightItem( CalcToUnit( fSize, MapUnit::MapTwip ), 100, nFontHeightWhich ) );
645  pColl->ResetFormatAttr(nFontHeightWhich);
646  bMod = true;
647  }
648 
649  if(sTitle != m_sShellTitle )
650  {
651  lcl_SetColl(m_pWrtShell, RES_POOLCOLL_HEADLINE_BASE, pPrinter, sTitle, nFontWhich);
652  bMod = true;
653  }
654  if(bTitleHeightChanged)
655  {
657  sal::static_int_cast< sal_uInt16, sal_Int64 >(m_xTitleHeightLB->get_value()), nFontHeightWhich);
658  bMod = true;
659  }
660  if(sList != m_sShellList && (!m_bListDefault || !m_bSetListDefault ))
661  {
662  lcl_SetColl(m_pWrtShell, RES_POOLCOLL_NUMBER_BULLET_BASE, pPrinter, sList, nFontWhich);
663  bMod = true;
664  }
665  if(bListHeightChanged)
666  {
668  sal::static_int_cast< sal_uInt16, sal_Int64 >(m_xListHeightLB->get_value()), nFontHeightWhich);
669  bMod = true;
670  }
671  if(sLabel != m_sShellLabel && (!m_bLabelDefault || !m_bSetLabelDefault))
672  {
673  lcl_SetColl(m_pWrtShell, RES_POOLCOLL_LABEL, pPrinter, sLabel, nFontWhich);
674  bMod = true;
675  }
676  if(bLabelHeightChanged)
677  {
679  sal::static_int_cast< sal_uInt16, sal_Int64 >(m_xLabelHeightLB->get_value()), nFontHeightWhich);
680  bMod = true;
681  }
682  if(sIdx != m_sShellIndex && (!m_bIdxDefault || !m_bSetIdxDefault))
683  {
684  lcl_SetColl(m_pWrtShell, RES_POOLCOLL_REGISTER_BASE, pPrinter, sIdx, nFontWhich);
685  bMod = true;
686  }
687  if(bIndexHeightChanged)
688  {
690  sal::static_int_cast< sal_uInt16, sal_Int64 >(m_xIndexHeightLB->get_value()), nFontHeightWhich);
691  bMod = true;
692  }
693  if ( bMod )
696  }
697  return false;
698 }
699 
701 {
702  const SfxPoolItem* pLang;
703  const sal_uInt16 nLangSlot = m_nFontGroup == FONT_GROUP_DEFAULT ? SID_ATTR_LANGUAGE :
704  FONT_GROUP_CJK == m_nFontGroup ? SID_ATTR_CHAR_CJK_LANGUAGE : SID_ATTR_CHAR_CTL_LANGUAGE;
705 
706  if( SfxItemState::SET == rSet->GetItemState(nLangSlot, false, &pLang))
707  m_eLanguage = static_cast<const SvxLanguageItem*>(pLang)->GetValue();
708 
709  OUString sToReplace = m_sScriptWestern;
711  sToReplace = m_sScriptAsian;
712  else if(FONT_GROUP_CTL == m_nFontGroup )
713  sToReplace = m_sScriptComplex;
714  m_xLabelFT->set_label(m_xLabelFT->get_label().replaceFirst("%1", sToReplace));
715 
716  const SfxPoolItem* pItem;
717 
718  if (m_bDisposePrinter)
719  {
721  m_bDisposePrinter = false;
722  }
723 
724  if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_PRINTER, false, &pItem))
725  {
726  m_pPrt = static_cast<SfxPrinter*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
727  }
728  else
729  {
730  auto pPrinterSet = std::make_unique<SfxItemSet>( *rSet->GetPool(),
731  svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
732  SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>{} );
733  m_pPrt = VclPtr<SfxPrinter>::Create(std::move(pPrinterSet));
734  m_bDisposePrinter = true;
735  }
736  m_pFontList.reset(new FontList( m_pPrt ));
737  // #i94536# prevent duplication of font entries when 'reset' button is pressed
738  if( !m_xStandardBox->get_count() )
739  {
740  // get the set of distinct available family names
741  std::set< OUString > aFontNames;
742  int nFontNames = m_pPrt->GetDevFontCount();
743  for( int i = 0; i < nFontNames; i++ )
744  {
745  FontMetric aFontMetric( m_pPrt->GetDevFont( i ) );
746  aFontNames.insert( aFontMetric.GetFamilyName() );
747  }
748 
749  // insert to listboxes
750  for( const auto& rFontName : aFontNames )
751  {
752  m_xStandardBox->append_text( rFontName );
753  m_xTitleBox->append_text( rFontName );
754  m_xListBox->append_text( rFontName );
755  m_xLabelBox->append_text( rFontName );
756  m_xIdxBox->append_text( rFontName );
757  }
758  }
759  if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_STDFONTS, false, &pItem))
760  {
761  m_pFontConfig = static_cast<SwStdFontConfig*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
762  }
763 
764  if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_WRTSHELL, false, &pItem))
765  {
766  m_pWrtShell = static_cast<SwWrtShell*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
767  }
768  OUString sStdBackup;
769  OUString sOutBackup;
770  OUString sListBackup;
771  OUString sCapBackup;
772  OUString sIdxBackup;
773  sal_Int32 nStandardHeight = -1;
774  sal_Int32 nTitleHeight = -1;
775  sal_Int32 nListHeight = -1;
776  sal_Int32 nLabelHeight = -1;
777  sal_Int32 nIndexHeight = -1;
778 
779  if(!m_pWrtShell)
780  {
783  sListBackup= m_pFontConfig->GetFontList(m_nFontGroup);
785  sIdxBackup = m_pFontConfig->GetFontIndex(m_nFontGroup);
791  if( nStandardHeight <= 0)
793  if( nTitleHeight <= 0)
794  nTitleHeight = SwStdFontConfig::GetDefaultHeightFor( FONT_OUTLINE + m_nFontGroup * FONT_PER_GROUP, m_eLanguage);
795  if( nListHeight <= 0)
796  nListHeight = SwStdFontConfig::GetDefaultHeightFor( FONT_LIST + m_nFontGroup * FONT_PER_GROUP, m_eLanguage);
797  if( nLabelHeight <= 0)
798  nLabelHeight = SwStdFontConfig::GetDefaultHeightFor( FONT_CAPTION + m_nFontGroup * FONT_PER_GROUP, m_eLanguage);
799  if( nIndexHeight <= 0)
800  nIndexHeight = SwStdFontConfig::GetDefaultHeightFor( FONT_INDEX + m_nFontGroup * FONT_PER_GROUP, m_eLanguage);
801  }
802  else
803  {
805  const SvxFontItem& rFont = !m_nFontGroup ? pColl->GetFont() :
806  FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
807  m_sShellStd = sStdBackup = rFont.GetFamilyName();
808 
809  const sal_uInt16 nFontHeightWhich =
812  const SvxFontHeightItem& rFontHeightStandard = static_cast<const SvxFontHeightItem& >(pColl->GetFormatAttr(nFontHeightWhich));
813  nStandardHeight = static_cast<sal_Int32>(rFontHeightStandard.GetHeight());
814 
816  const SvxFontItem& rFontHL = !m_nFontGroup ? pColl->GetFont() :
817  FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
818  m_sShellTitle = sOutBackup = rFontHL.GetFamilyName();
819 
820  const SvxFontHeightItem& rFontHeightTitle = static_cast<const SvxFontHeightItem&>(pColl->GetFormatAttr( nFontHeightWhich ));
821  nTitleHeight = static_cast<sal_Int32>(rFontHeightTitle.GetHeight());
822 
823  const sal_uInt16 nFontWhich =
827  const SvxFontItem& rFontLS = !m_nFontGroup ? pColl->GetFont() :
828  FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
829  m_bListDefault = SfxItemState::DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, false);
830  m_sShellList = sListBackup = rFontLS.GetFamilyName();
831 
832  const SvxFontHeightItem& rFontHeightList = static_cast<const SvxFontHeightItem&>(pColl->GetFormatAttr(nFontHeightWhich));
833  nListHeight = static_cast<sal_Int32>(rFontHeightList.GetHeight());
834  m_bListHeightDefault = SfxItemState::DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, false);
835 
837  m_bLabelDefault = SfxItemState::DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, false);
838  const SvxFontItem& rFontCP = !m_nFontGroup ? pColl->GetFont() :
839  FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
840  m_sShellLabel = sCapBackup = rFontCP.GetFamilyName();
841  const SvxFontHeightItem& rFontHeightLabel = static_cast<const SvxFontHeightItem&>(pColl->GetFormatAttr(nFontHeightWhich));
842  nLabelHeight = static_cast<sal_Int32>(rFontHeightLabel.GetHeight());
843  m_bLabelHeightDefault = SfxItemState::DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, false);
844 
846  m_bIdxDefault = SfxItemState::DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, false);
847  const SvxFontItem& rFontIDX = !m_nFontGroup ? pColl->GetFont() :
848  FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
849  m_sShellIndex = sIdxBackup = rFontIDX.GetFamilyName();
850  const SvxFontHeightItem& rFontHeightIndex = static_cast<const SvxFontHeightItem&>(pColl->GetFormatAttr(nFontHeightWhich));
851  nIndexHeight = static_cast<sal_Int32>(rFontHeightIndex.GetHeight());
852  m_bIndexHeightDefault = SfxItemState::DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, false);
853  }
854  m_xStandardBox->set_entry_text(sStdBackup );
855  m_xTitleBox->set_entry_text(sOutBackup );
856  m_xListBox->set_entry_text(sListBackup);
857  m_xLabelBox->set_entry_text(sCapBackup );
858  m_xIdxBox->set_entry_text(sIdxBackup );
859 
860  FontMetric aFontMetric( m_pFontList->Get(sStdBackup, sStdBackup) );
861  m_xStandardHeightLB->Fill( &aFontMetric, m_pFontList.get() );
862  aFontMetric = m_pFontList->Get(sOutBackup, sOutBackup );
863  m_xTitleHeightLB->Fill( &aFontMetric, m_pFontList.get() );
864  aFontMetric = m_pFontList->Get(sListBackup,sListBackup);
865  m_xListHeightLB->Fill( &aFontMetric, m_pFontList.get() );
866  aFontMetric = m_pFontList->Get(sCapBackup, sCapBackup );
867  m_xLabelHeightLB->Fill( &aFontMetric, m_pFontList.get() );
868  aFontMetric = m_pFontList->Get(sIdxBackup, sIdxBackup );
869  m_xIndexHeightLB->Fill( &aFontMetric, m_pFontList.get() );
870 
871  m_xStandardHeightLB->set_value( CalcToPoint( nStandardHeight, MapUnit::MapTwip, 10 ) );
872  m_xTitleHeightLB->set_value( CalcToPoint( nTitleHeight , MapUnit::MapTwip, 10 ) );
873  m_xListHeightLB->set_value( CalcToPoint( nListHeight , MapUnit::MapTwip, 10 ) );
874  m_xLabelHeightLB->set_value( CalcToPoint( nLabelHeight , MapUnit::MapTwip, 10 ));
875  m_xIndexHeightLB->set_value( CalcToPoint( nIndexHeight , MapUnit::MapTwip, 10 ));
876 
877  m_xStandardBox->save_value();
878  m_xTitleBox->save_value();
879  m_xListBox->save_value();
880  m_xLabelBox->save_value();
881  m_xIdxBox->save_value();
882 
883  m_xStandardHeightLB->save_value();
884  m_xTitleHeightLB->save_value();
885  m_xListHeightLB->save_value();
886  m_xLabelHeightLB->save_value();
887  m_xIndexHeightLB->save_value();
888 }
889 
891 {
892  sal_uInt8 nFontOffset = m_nFontGroup * FONT_PER_GROUP;
893  m_xStandardBox->set_entry_text(SwStdFontConfig::GetDefaultFor(FONT_STANDARD + nFontOffset, m_eLanguage));
894  m_xTitleBox->set_entry_text(SwStdFontConfig::GetDefaultFor(FONT_OUTLINE + nFontOffset, m_eLanguage));
895  m_xListBox->set_entry_text(SwStdFontConfig::GetDefaultFor(FONT_LIST + nFontOffset, m_eLanguage));
896  m_xLabelBox->set_entry_text(SwStdFontConfig::GetDefaultFor(FONT_CAPTION + nFontOffset, m_eLanguage));
897  m_xIdxBox->set_entry_text(SwStdFontConfig::GetDefaultFor(FONT_INDEX + nFontOffset, m_eLanguage));
898 
899  m_xStandardBox->save_value();
900  m_xTitleBox->save_value();
901  m_xListBox->save_value();
902  m_xLabelBox->save_value();
903  m_xIdxBox->save_value();
904 
905  m_xStandardHeightLB->set_value( CalcToPoint(
906  SwStdFontConfig::GetDefaultHeightFor(FONT_STANDARD + nFontOffset, m_eLanguage),
907  MapUnit::MapTwip, 10 ));
908  m_xTitleHeightLB->set_value(CalcToPoint(
910  nFontOffset, m_eLanguage), MapUnit::MapTwip, 10 ));
911  m_xListHeightLB->set_value(CalcToPoint(
912  SwStdFontConfig::GetDefaultHeightFor(FONT_LIST + nFontOffset, m_eLanguage),
913  MapUnit::MapTwip, 10 ));
914  m_xLabelHeightLB->set_value(CalcToPoint(
915  SwStdFontConfig::GetDefaultHeightFor(FONT_CAPTION + nFontOffset, m_eLanguage),
916  MapUnit::MapTwip, 10 ));
917  m_xIndexHeightLB->set_value(CalcToPoint(
918  SwStdFontConfig::GetDefaultHeightFor(FONT_INDEX + nFontOffset, m_eLanguage),
919  MapUnit::MapTwip, 10 ));
920 }
921 
922 IMPL_LINK( SwStdFontTabPage, ModifyHdl, weld::ComboBox&, rBox, void )
923 {
924  if (&rBox == m_xStandardBox.get())
925  {
926  const OUString sEntry = rBox.get_active_text();
927  if(m_bSetListDefault && m_bListDefault)
928  m_xListBox->set_entry_text(sEntry);
929  if(m_bSetLabelDefault && m_bLabelDefault)
930  m_xLabelBox->set_entry_text(sEntry);
931  if(m_bSetIdxDefault && m_bIdxDefault)
932  m_xIdxBox->set_entry_text(sEntry);
933  }
934  else if (&rBox == m_xListBox.get())
935  {
936  m_bSetListDefault = false;
937  }
938  else if (&rBox == m_xLabelBox.get())
939  {
940  m_bSetLabelDefault = false;
941  }
942  else if (&rBox == m_xIdxBox.get())
943  {
944  m_bSetIdxDefault = false;
945  }
946 }
947 
948 IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, weld::Widget&, rControl, void )
949 {
950  weld::ComboBox& rBox = dynamic_cast<weld::ComboBox&>(rControl);
951  FontSizeBox* pHeightLB = nullptr;
952  const OUString sEntry = rBox.get_active_text();
953  if (&rBox == m_xStandardBox.get())
954  {
955  pHeightLB = m_xStandardHeightLB.get();
956  }
957  else if (&rBox == m_xTitleBox.get())
958  {
959  pHeightLB = m_xTitleHeightLB.get();
960  }
961  else if (&rBox == m_xListBox.get())
962  {
963  pHeightLB = m_xListHeightLB.get();
964  }
965  else if (&rBox == m_xLabelBox.get())
966  {
967  pHeightLB = m_xLabelHeightLB.get();
968  }
969  else /*if (&rBox == m_xIndexHeightLB.get())*/
970  {
971  pHeightLB = m_xIndexHeightLB.get();
972  }
973  FontMetric aFontMetric( m_pFontList->Get(sEntry, sEntry) );
974  pHeightLB->Fill( &aFontMetric, m_pFontList.get() );
975 }
976 
978 {
979  const SfxUInt16Item* pFlagItem = aSet.GetItem<SfxUInt16Item>(SID_FONTMODE_TYPE, false);
980  if (pFlagItem)
981  m_nFontGroup = sal::static_int_cast< sal_uInt8, sal_uInt16>( pFlagItem->GetValue() );
982 }
983 
985  : SfxTabPage(pPage, pController, "modules/swriter/ui/opttablepage.ui", "OptTablePage", &rSet)
986  , m_pWrtShell(nullptr)
987  , m_bHTMLMode(false)
988  , m_xHeaderCB(m_xBuilder->weld_check_button("header"))
989  , m_xRepeatHeaderCB(m_xBuilder->weld_check_button("repeatheader"))
990  , m_xDontSplitCB(m_xBuilder->weld_check_button("dontsplit"))
991  , m_xBorderCB(m_xBuilder->weld_check_button("border"))
992  , m_xNumFormattingCB(m_xBuilder->weld_check_button("numformatting"))
993  , m_xNumFormatFormattingCB(m_xBuilder->weld_check_button("numfmtformatting"))
994  , m_xNumAlignmentCB(m_xBuilder->weld_check_button("numalignment"))
995  , m_xRowMoveMF(m_xBuilder->weld_metric_spin_button("rowmove", FieldUnit::CM))
996  , m_xColMoveMF(m_xBuilder->weld_metric_spin_button("colmove", FieldUnit::CM))
997  , m_xRowInsertMF(m_xBuilder->weld_metric_spin_button("rowinsert", FieldUnit::CM))
998  , m_xColInsertMF(m_xBuilder->weld_metric_spin_button("colinsert", FieldUnit::CM))
999  , m_xFixRB(m_xBuilder->weld_radio_button("fix"))
1000  , m_xFixPropRB(m_xBuilder->weld_radio_button("fixprop"))
1001  , m_xVarRB(m_xBuilder->weld_radio_button("var"))
1002 {
1003  Link<weld::Button&,void> aLnk(LINK(this, SwTableOptionsTabPage, CheckBoxHdl));
1004  m_xNumFormattingCB->connect_clicked(aLnk);
1005  m_xNumFormatFormattingCB->connect_clicked(aLnk);
1006  m_xHeaderCB->connect_clicked(aLnk);
1007 }
1008 
1010 {
1011 }
1012 
1013 std::unique_ptr<SfxTabPage> SwTableOptionsTabPage::Create( weld::Container* pPage, weld::DialogController* pController,
1014  const SfxItemSet* rAttrSet )
1015 {
1016  return std::make_unique<SwTableOptionsTabPage>(pPage, pController, *rAttrSet);
1017 }
1018 
1020 {
1021  bool bRet = false;
1022  SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
1023 
1024  if (m_xRowMoveMF->get_value_changed_from_saved())
1025  pModOpt->SetTableHMove( static_cast<sal_uInt16>(m_xRowMoveMF->denormalize( m_xRowMoveMF->get_value(FieldUnit::TWIP))));
1026 
1027  if (m_xColMoveMF->get_value_changed_from_saved())
1028  pModOpt->SetTableVMove( static_cast<sal_uInt16>(m_xColMoveMF->denormalize( m_xColMoveMF->get_value(FieldUnit::TWIP))));
1029 
1030  if (m_xRowInsertMF->get_value_changed_from_saved())
1031  pModOpt->SetTableHInsert(static_cast<sal_uInt16>(m_xRowInsertMF->denormalize( m_xRowInsertMF->get_value(FieldUnit::TWIP))));
1032 
1033  if (m_xColInsertMF->get_value_changed_from_saved())
1034  pModOpt->SetTableVInsert(static_cast<sal_uInt16>(m_xColInsertMF->denormalize( m_xColInsertMF->get_value(FieldUnit::TWIP))));
1035 
1037  if (m_xFixRB->get_active())
1039  else if(m_xFixPropRB->get_active())
1041  else
1043  if(eMode != pModOpt->GetTableMode())
1044  {
1045  pModOpt->SetTableMode(eMode);
1046  // the table-keyboard-mode has changed, now the current
1047  // table should know about that too.
1049  {
1050  m_pWrtShell->SetTableChgMode(eMode);
1051  static sal_uInt16 aInva[] =
1055  0
1056  };
1058  }
1059 
1060  bRet = true;
1061  }
1062 
1064 
1065  if (m_xHeaderCB->get_active())
1067 
1068  if (m_xRepeatHeaderCB->get_sensitive())
1069  aInsOpts.mnRowsToRepeat = m_xRepeatHeaderCB->get_active() ? 1 : 0;
1070 
1071  if (!m_xDontSplitCB->get_active())
1073 
1074  if (m_xBorderCB->get_active())
1076 
1077  if (m_xHeaderCB->get_state_changed_from_saved() ||
1078  m_xRepeatHeaderCB->get_state_changed_from_saved() ||
1079  m_xDontSplitCB->get_state_changed_from_saved() ||
1080  m_xBorderCB->get_state_changed_from_saved())
1081  {
1082  pModOpt->SetInsTableFlags(m_bHTMLMode, aInsOpts);
1083  }
1084 
1085  if (m_xNumFormattingCB->get_state_changed_from_saved())
1086  {
1087  pModOpt->SetInsTableFormatNum(m_bHTMLMode, m_xNumFormattingCB->get_active());
1088  bRet = true;
1089  }
1090 
1091  if (m_xNumFormatFormattingCB->get_state_changed_from_saved())
1092  {
1094  bRet = true;
1095  }
1096 
1097  if (m_xNumAlignmentCB->get_state_changed_from_saved())
1098  {
1099  pModOpt->SetInsTableAlignNum(m_bHTMLMode, m_xNumAlignmentCB->get_active());
1100  bRet = true;
1101  }
1102 
1103  return bRet;
1104 }
1105 
1107 {
1108  const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
1109  if ( rSet->GetItemState( SID_ATTR_METRIC ) >= SfxItemState::DEFAULT )
1110  {
1111  const SfxUInt16Item& rItem = rSet->Get( SID_ATTR_METRIC );
1112  FieldUnit eFieldUnit = static_cast<FieldUnit>(rItem.GetValue());
1113  ::SetFieldUnit( *m_xRowMoveMF, eFieldUnit );
1114  ::SetFieldUnit( *m_xColMoveMF, eFieldUnit );
1115  ::SetFieldUnit( *m_xRowInsertMF, eFieldUnit );
1116  ::SetFieldUnit( *m_xColInsertMF, eFieldUnit );
1117  }
1118 
1119  m_xRowMoveMF->set_value(m_xRowMoveMF->normalize(pModOpt->GetTableHMove()), FieldUnit::TWIP);
1120  m_xColMoveMF->set_value(m_xColMoveMF->normalize(pModOpt->GetTableVMove()), FieldUnit::TWIP);
1121  m_xRowInsertMF->set_value(m_xRowInsertMF->normalize(pModOpt->GetTableHInsert()), FieldUnit::TWIP);
1122  m_xColInsertMF->set_value(m_xColInsertMF->normalize(pModOpt->GetTableVInsert()), FieldUnit::TWIP);
1123 
1124  switch(pModOpt->GetTableMode())
1125  {
1126  case TableChgMode::FixedWidthChangeAbs: m_xFixRB->set_active(true); break;
1127  case TableChgMode::FixedWidthChangeProp: m_xFixPropRB->set_active(true); break;
1128  case TableChgMode::VarWidthChangeAbs: m_xVarRB->set_active(true); break;
1129  }
1130  const SfxPoolItem* pItem;
1131  if(SfxItemState::SET == rSet->GetItemState(SID_HTML_MODE, false, &pItem))
1132  {
1133  m_bHTMLMode = 0 != (static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON);
1134  }
1135 
1136  // hide certain controls for html
1137  if (m_bHTMLMode)
1138  {
1139  m_xRepeatHeaderCB->hide();
1140  m_xDontSplitCB->hide();
1141  }
1142 
1143  SwInsertTableOptions aInsOpts = pModOpt->GetInsTableFlags(m_bHTMLMode);
1144  const SwInsertTableFlags nInsTableFlags = aInsOpts.mnInsMode;
1145 
1146  m_xHeaderCB->set_active(bool(nInsTableFlags & SwInsertTableFlags::Headline));
1147  m_xRepeatHeaderCB->set_active((!m_bHTMLMode) && (aInsOpts.mnRowsToRepeat > 0));
1148  m_xDontSplitCB->set_active(!(nInsTableFlags & SwInsertTableFlags::SplitLayout));
1149  m_xBorderCB->set_active(bool(nInsTableFlags & SwInsertTableFlags::DefaultBorder));
1150 
1151  m_xNumFormattingCB->set_active(pModOpt->IsInsTableFormatNum(m_bHTMLMode));
1153  m_xNumAlignmentCB->set_active(pModOpt->IsInsTableAlignNum(m_bHTMLMode));
1154 
1155  m_xHeaderCB->save_state();
1156  m_xRepeatHeaderCB->save_state();
1157  m_xDontSplitCB->save_state();
1158  m_xBorderCB->save_state();
1159  m_xNumFormattingCB->save_state();
1160  m_xNumFormatFormattingCB->save_state();
1161  m_xNumAlignmentCB->save_state();
1162  m_xRowMoveMF->save_value();
1163  m_xColMoveMF->save_value();
1164  m_xRowInsertMF->save_value();
1165  m_xColInsertMF->save_value();
1166 
1167  CheckBoxHdl(*m_xHeaderCB);
1168 }
1169 
1171 {
1172  m_xNumFormatFormattingCB->set_sensitive(m_xNumFormattingCB->get_active());
1173  m_xNumAlignmentCB->set_sensitive(m_xNumFormattingCB->get_active());
1174  m_xRepeatHeaderCB->set_sensitive(m_xHeaderCB->get_active());
1175 }
1176 
1178 {
1179  const SwWrtShellItem* pWrtSh = aSet.GetItem<SwWrtShellItem>(SID_WRT_SHELL, false);
1180  if (pWrtSh)
1181  m_pWrtShell = pWrtSh->GetValue();
1182 }
1183 
1185  : SfxTabPage(pPage, pController, "modules/swriter/ui/optformataidspage.ui", "OptFormatAidsPage", &rSet)
1186  , m_pWrtShell(nullptr)
1187  , m_xParaCB(m_xBuilder->weld_check_button("paragraph"))
1188  , m_xSHyphCB(m_xBuilder->weld_check_button("hyphens"))
1189  , m_xSpacesCB(m_xBuilder->weld_check_button("spaces"))
1190  , m_xHSpacesCB(m_xBuilder->weld_check_button("nonbreak"))
1191  , m_xTabCB(m_xBuilder->weld_check_button("tabs"))
1192  , m_xTabLabel(m_xBuilder->weld_label("tabs_label"))
1193  , m_xBreakCB(m_xBuilder->weld_check_button("break"))
1194  , m_xCharHiddenCB(m_xBuilder->weld_check_button("hiddentext"))
1195  , m_xBookmarkCB(m_xBuilder->weld_check_button("bookmarks"))
1196  , m_xBookmarkLabel(m_xBuilder->weld_label("bookmarks_label"))
1197  , m_xDirectCursorFrame(m_xBuilder->weld_frame("directcrsrframe"))
1198  , m_xOnOffCB(m_xBuilder->weld_check_button("cursoronoff"))
1199  , m_xDirectCursorFillMode(m_xBuilder->weld_combo_box("cxDirectCursorFillMode"))
1200  , m_xCursorProtFrame(m_xBuilder->weld_frame("crsrprotframe"))
1201  , m_xCursorInProtCB(m_xBuilder->weld_check_button("cursorinprot"))
1202  , m_xMathBaselineAlignmentCB(m_xBuilder->weld_check_button("mathbaseline"))
1203 {
1204  const SfxPoolItem* pItem = nullptr;
1206  bool bIsOn = false;
1207 
1208  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, false, &pItem ))
1209  {
1210  auto& aOpt = *static_cast<const SwShadowCursorItem*>(pItem);
1211  eMode = aOpt.GetMode();
1212  bIsOn = aOpt.IsOn();
1213  }
1214  m_xOnOffCB->set_active( bIsOn );
1215 
1216  m_xDirectCursorFillMode->set_active( static_cast<int>(eMode) );
1217  if(SfxItemState::SET != rSet.GetItemState(SID_HTML_MODE, false, &pItem )
1218  || !(static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON))
1219  return;
1220 
1221  m_xTabCB->hide();
1222  m_xTabLabel->hide();
1223  m_xCharHiddenCB->hide();
1224  m_xBookmarkCB->hide();
1225  m_xBookmarkLabel->hide();
1226 
1227  m_xDirectCursorFrame->hide();
1228  m_xOnOffCB->hide();
1229  m_xDirectCursorFillMode->hide();
1230  m_xCursorProtFrame->hide();
1231  m_xCursorInProtCB->hide();
1232 }
1233 
1235 {
1236 }
1237 
1238 std::unique_ptr<SfxTabPage> SwShdwCursorOptionsTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet )
1239 {
1240  return std::make_unique<SwShdwCursorOptionsTabPage>(pPage, pController, *rSet);
1241 }
1242 
1244 {
1245  const SwWrtShellItem* pWrtSh = aSet.GetItem<SwWrtShellItem>(SID_WRT_SHELL, false);
1246  if (pWrtSh)
1247  m_pWrtShell = pWrtSh->GetValue();
1248 }
1249 
1251 {
1252  SwShadowCursorItem aOpt;
1253  aOpt.SetOn( m_xOnOffCB->get_active() );
1254 
1255  SwFillMode eMode = static_cast<SwFillMode>(m_xDirectCursorFillMode->get_active());
1256  aOpt.SetMode( eMode );
1257 
1258  bool bRet = false;
1259  const SfxPoolItem* pItem = nullptr;
1260  if( SfxItemState::SET != rSet->GetItemState( FN_PARAM_SHADOWCURSOR, false, &pItem )
1261  || static_cast<const SwShadowCursorItem&>(*pItem) != aOpt )
1262  {
1263  rSet->Put( aOpt );
1264  bRet = true;
1265  }
1266 
1267  if (m_pWrtShell) {
1269  m_xMathBaselineAlignmentCB->get_active() );
1270  bRet |= m_xMathBaselineAlignmentCB->get_state_changed_from_saved();
1271  }
1272 
1273  if( m_xCursorInProtCB->get_state_changed_from_saved())
1274  {
1276  bRet = true;
1277  }
1278 
1279  const SwDocDisplayItem* pOldAttr = static_cast<const SwDocDisplayItem*>(
1281 
1282  SwDocDisplayItem aDisp;
1283 
1284  aDisp.bParagraphEnd = m_xParaCB->get_active();
1285  aDisp.bTab = m_xTabCB->get_active();
1286  aDisp.bSpace = m_xSpacesCB->get_active();
1287  aDisp.bNonbreakingSpace = m_xHSpacesCB->get_active();
1288  aDisp.bSoftHyphen = m_xSHyphCB->get_active();
1289  aDisp.bCharHiddenText = m_xCharHiddenCB->get_active();
1290  aDisp.bBookmarks = m_xBookmarkCB->get_active();
1291  aDisp.bManualBreak = m_xBreakCB->get_active();
1292 
1293  bRet |= (!pOldAttr || aDisp != *pOldAttr);
1294  if(bRet)
1295  bRet = nullptr != rSet->Put(aDisp);
1296 
1297  return bRet;
1298 }
1299 
1301 {
1302  const SfxPoolItem* pItem = nullptr;
1304  bool bIsOn = false;
1305 
1306  if( SfxItemState::SET == rSet->GetItemState( FN_PARAM_SHADOWCURSOR, false, &pItem ))
1307  {
1308  auto& aOpt = *static_cast<const SwShadowCursorItem*>(pItem);
1309  eMode = aOpt.GetMode();
1310  bIsOn = aOpt.IsOn();
1311  }
1312  m_xOnOffCB->set_active( bIsOn );
1313 
1314  m_xDirectCursorFillMode->set_active( static_cast<int>(eMode) );
1315  if (m_pWrtShell) {
1317  m_xMathBaselineAlignmentCB->save_state();
1318  } else {
1320  }
1321 
1322  if( SfxItemState::SET == rSet->GetItemState( FN_PARAM_CRSR_IN_PROTECTED, false, &pItem ))
1323  m_xCursorInProtCB->set_active(static_cast<const SfxBoolItem*>(pItem)->GetValue());
1324  m_xCursorInProtCB->save_state();
1325 
1326  const SwDocDisplayItem* pDocDisplayAttr = nullptr;
1327 
1328  rSet->GetItemState( FN_PARAM_DOCDISP, false,
1329  reinterpret_cast<const SfxPoolItem**>(&pDocDisplayAttr) );
1330  if(pDocDisplayAttr)
1331  {
1332  m_xParaCB->set_active( pDocDisplayAttr->bParagraphEnd );
1333  m_xTabCB->set_active( pDocDisplayAttr->bTab );
1334  m_xSpacesCB->set_active( pDocDisplayAttr->bSpace );
1335  m_xHSpacesCB->set_active( pDocDisplayAttr->bNonbreakingSpace );
1336  m_xSHyphCB->set_active( pDocDisplayAttr->bSoftHyphen );
1337  m_xCharHiddenCB->set_active( pDocDisplayAttr->bCharHiddenText );
1338  m_xBookmarkCB->set_active(pDocDisplayAttr->bBookmarks);
1339  m_xBreakCB->set_active( pDocDisplayAttr->bManualBreak );
1340  }
1341 }
1342 
1343 namespace {
1344 
1345 // TabPage for Redlining
1346 struct CharAttr
1347 {
1348  sal_uInt16 nItemId;
1349  sal_uInt16 nAttr;
1350 };
1351 
1352 }
1353 
1354 // Edit corresponds to Paste-attributes
1355 static CharAttr const aRedlineAttr[] =
1356 {
1357  { SID_ATTR_CHAR_CASEMAP, sal_uInt16(SvxCaseMap::NotMapped) },
1358  { SID_ATTR_CHAR_WEIGHT, WEIGHT_BOLD },
1359  { SID_ATTR_CHAR_POSTURE, ITALIC_NORMAL },
1360  { SID_ATTR_CHAR_UNDERLINE, LINESTYLE_SINGLE },
1361  { SID_ATTR_CHAR_UNDERLINE, LINESTYLE_DOUBLE },
1362  { SID_ATTR_CHAR_STRIKEOUT, STRIKEOUT_SINGLE },
1363  { SID_ATTR_CHAR_CASEMAP, sal_uInt16(SvxCaseMap::Uppercase) },
1364  { SID_ATTR_CHAR_CASEMAP, sal_uInt16(SvxCaseMap::Lowercase) },
1365  { SID_ATTR_CHAR_CASEMAP, sal_uInt16(SvxCaseMap::SmallCaps) },
1366  { SID_ATTR_CHAR_CASEMAP, sal_uInt16(SvxCaseMap::Capitalize) },
1367  { SID_ATTR_BRUSH, 0 }
1368 };
1369 // Items from aRedlineAttr relevant for InsertAttr: strikethrough is
1370 // not used
1371 static sal_uInt16 aInsertAttrMap[] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 };
1372 
1373 // Items from aRedlineAttr relevant for DeleteAttr: underline and
1374 // double underline is not used
1375 static sal_uInt16 aDeletedAttrMap[] = { 0, 1, 2, 5, 6, 7, 8, 9, 10 };
1376 
1377 // Items from aRedlineAttr relevant for ChangeAttr: strikethrough is
1378 // not used
1379 static sal_uInt16 aChangedAttrMap[] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 };
1380 
1381 // Preview of selection
1383  : m_aTransCol(COL_TRANSPARENT)
1384  , m_aMarkCol(COL_LIGHTRED)
1385  , nMarkPos(0)
1386 
1387 {
1388  InitColors();
1389 }
1390 
1392 {
1393 }
1394 
1396 {
1397  // m_aTransCol and m_aMarkCol are _not_ changed because they are set from outside!
1398 
1400  m_aBgCol = rSettings.GetWindowColor();
1401 
1402  bool bHC = rSettings.GetHighContrastMode();
1404  m_aShadowCol = bHC? m_aBgCol : rSettings.GetShadowColor();
1407 }
1408 
1409 void SwMarkPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle &/*rRect*/)
1410 {
1411  const Size aSz(GetOutputSizePixel());
1412 
1413  // Page
1414  aPage.SetSize(Size(aSz.Width() - 3, aSz.Height() - 3));
1415 
1416  const long nOutWPix = aPage.GetWidth();
1417  const long nOutHPix = aPage.GetHeight();
1418 
1419  // PrintArea
1420  const long nLBorder = 8;
1421  const long nRBorder = 8;
1422  const long nTBorder = 4;
1423  const long nBBorder = 4;
1424 
1425  aLeftPagePrtArea = tools::Rectangle(Point(nLBorder, nTBorder), Point((nOutWPix - 1) - nRBorder, (nOutHPix - 1) - nBBorder));
1426  const long nWidth = aLeftPagePrtArea.GetWidth();
1427  const long nCorr = (nWidth & 1) != 0 ? 0 : 1;
1428  aLeftPagePrtArea.SetSize(Size(nWidth / 2 - (nLBorder + nRBorder) / 2 + nCorr, aLeftPagePrtArea.GetHeight()));
1429 
1431  aRightPagePrtArea.Move(aLeftPagePrtArea.GetWidth() + nLBorder + nRBorder + 1, 0);
1432 
1433  // draw shadow
1434  tools::Rectangle aShadow(aPage);
1435  aShadow += Point(3, 3);
1436  drawRect(rRenderContext, aShadow, m_aShadowCol, m_aTransCol);
1437 
1438  // draw page
1439  drawRect(rRenderContext, aPage, m_aBgCol, m_aLineCol);
1440 
1441  // draw separator
1442  tools::Rectangle aPageSeparator(aPage);
1443  aPageSeparator.SetSize(Size(2, aPageSeparator.GetHeight()));
1444  aPageSeparator.Move(aPage.GetWidth() / 2 - 1, 0);
1445  drawRect(rRenderContext, aPageSeparator, m_aLineCol, m_aTransCol);
1446 
1447  PaintPage(rRenderContext, aLeftPagePrtArea);
1448  PaintPage(rRenderContext, aRightPagePrtArea);
1449 
1450  tools::Rectangle aLeftMark(Point(aPage.Left() + 2, aLeftPagePrtArea.Top() + 4), Size(aLeftPagePrtArea.Left() - 4, 2));
1452 
1453  switch (nMarkPos)
1454  {
1455  case 1: // left
1456  aRightMark.SetPos(Point(aRightPagePrtArea.Left() - 2 - aRightMark.GetWidth(), aRightMark.Top()));
1457  break;
1458 
1459  case 2: // right
1460  aLeftMark.SetPos(Point(aLeftPagePrtArea.Right() + 2, aLeftMark.Top()));
1461  break;
1462 
1463  case 3: // outside
1464  break;
1465 
1466  case 4: // inside
1467  aLeftMark.SetPos(Point(aLeftPagePrtArea.Right() + 2, aLeftMark.Top()));
1468  aRightMark.SetPos(Point(aRightPagePrtArea.Left() - 2 - aRightMark.GetWidth(), aRightMark.Top()));
1469  break;
1470 
1471  case 0: // none
1472  default:
1473  return;
1474  }
1475  drawRect(rRenderContext, aLeftMark, m_aMarkCol, m_aTransCol);
1476  drawRect(rRenderContext, aRightMark, m_aMarkCol, m_aTransCol);
1477 }
1478 
1480 {
1481  // draw PrintArea
1482  drawRect(rRenderContext, rRect, m_aTransCol, m_aPrintAreaCol);
1483 
1484  // draw Testparagraph
1485 
1486  tools::Rectangle aTextLine = rRect;
1487  aTextLine.SetSize(Size(aTextLine.GetWidth(), 2));
1488  aTextLine.AdjustLeft(4 );
1489  aTextLine.AdjustRight( -4 );
1490  aTextLine.Move(0, 4);
1491 
1492  const long nStep = aTextLine.GetHeight() + 2;
1493  const long nLines = rRect.GetHeight() / (aTextLine.GetHeight() + 2) - 1;
1494 
1495  // simulate text
1496  for (long i = 0; i < nLines; ++i)
1497  {
1498  if (i == (nLines - 1))
1499  aTextLine.SetSize(Size(aTextLine.GetWidth() / 2, aTextLine.GetHeight()));
1500 
1501  if (aPage.IsInside(aTextLine))
1502  drawRect(rRenderContext, aTextLine, m_aTextCol, m_aTransCol);
1503 
1504  aTextLine.Move(0, nStep);
1505  }
1506  aTextLine.Move(0, -nStep);
1507 }
1508 
1510 {
1511  Size aInitialSize = getPreviewOptionsSize(pDrawingArea->get_ref_device());
1512  pDrawingArea->set_size_request(aInitialSize.Width(), aInitialSize.Height());
1514  SetOutputSizePixel(aInitialSize);
1515 }
1516 
1517 namespace
1518 {
1519  void lcl_FillRedlineAttrListBox(
1520  weld::ComboBox& rLB, const AuthorCharAttr& rAttrToSelect,
1521  const sal_uInt16* pAttrMap, const size_t nAttrMapSize)
1522  {
1523  for (size_t i = 0; i != nAttrMapSize; ++i)
1524  {
1525  CharAttr const & rAttr(aRedlineAttr[pAttrMap[i]]);
1526  rLB.set_id(i, OUString::number(reinterpret_cast<sal_Int64>(&rAttr)));
1527  if (rAttr.nItemId == rAttrToSelect.m_nItemId &&
1528  rAttr.nAttr == rAttrToSelect.m_nAttr)
1529  rLB.set_active(i);
1530  }
1531  }
1532 }
1533 
1535  const SfxItemSet& rSet)
1536  : SfxTabPage(pPage, pController, "modules/swriter/ui/optredlinepage.ui", "OptRedLinePage", &rSet)
1537  , m_xInsertLB(m_xBuilder->weld_combo_box("insert"))
1538  , m_xInsertColorLB(new ColorListBox(m_xBuilder->weld_menu_button("insertcolor"), pController->getDialog()))
1539  , m_xInsertedPreviewWN(new SvxFontPrevWindow)
1540  , m_xInsertedPreview(new weld::CustomWeld(*m_xBuilder, "insertedpreview", *m_xInsertedPreviewWN))
1541  , m_xDeletedLB(m_xBuilder->weld_combo_box("deleted"))
1542  , m_xDeletedColorLB(new ColorListBox(m_xBuilder->weld_menu_button("deletedcolor"), pController->getDialog()))
1543  , m_xDeletedPreviewWN(new SvxFontPrevWindow)
1544  , m_xDeletedPreview(new weld::CustomWeld(*m_xBuilder, "deletedpreview", *m_xDeletedPreviewWN))
1545  , m_xChangedLB(m_xBuilder->weld_combo_box("changed"))
1546  , m_xChangedColorLB(new ColorListBox(m_xBuilder->weld_menu_button("changedcolor"), pController->getDialog()))
1547  , m_xChangedPreviewWN(new SvxFontPrevWindow)
1548  , m_xChangedPreview(new weld::CustomWeld(*m_xBuilder, "changedpreview", *m_xChangedPreviewWN))
1549  , m_xMarkPosLB(m_xBuilder->weld_combo_box("markpos"))
1550  , m_xMarkColorLB(new ColorListBox(m_xBuilder->weld_menu_button("markcolor"), pController->getDialog()))
1551  , m_xMarkPreviewWN(new SwMarkPreview)
1552  , m_xMarkPreview(new weld::CustomWeld(*m_xBuilder, "markpreview", *m_xMarkPreviewWN))
1553 {
1554  Size aPreviewSize(getPreviewOptionsSize(m_xMarkPreviewWN->GetDrawingArea()->get_ref_device()));
1555 
1556  m_xInsertColorLB->SetSlotId(SID_AUTHOR_COLOR, true);
1557  m_xDeletedColorLB->SetSlotId(SID_AUTHOR_COLOR, true);
1558  m_xChangedColorLB->SetSlotId(SID_AUTHOR_COLOR, true);
1559 
1560  m_xInsertedPreviewWN->set_size_request(aPreviewSize.Width(), aPreviewSize.Height());
1561  m_xDeletedPreviewWN->set_size_request(aPreviewSize.Width(), aPreviewSize.Height());
1562  m_xChangedPreviewWN->set_size_request(aPreviewSize.Width(), aPreviewSize.Height());
1563  m_xMarkPreviewWN->set_size_request(aPreviewSize.Width(), aPreviewSize.Height());
1564 
1565  for (sal_Int32 i = 0, nEntryCount = m_xInsertLB->get_count(); i < nEntryCount; ++i)
1566  {
1567  const OUString sEntry(m_xInsertLB->get_text(i));
1568  m_xDeletedLB->append_text(sEntry);
1569  m_xChangedLB->append_text(sEntry);
1570  };
1571 
1572  // remove strikethrough from insert and change and underline + double
1573  // underline from delete
1574  m_xInsertLB->remove(5);
1575  m_xChangedLB->remove(5);
1576  m_xDeletedLB->remove(4);
1577  m_xDeletedLB->remove(3);
1578 
1580  m_xInsertLB->connect_changed( aLk );
1581  m_xDeletedLB->connect_changed( aLk );
1582  m_xChangedLB->connect_changed( aLk );
1583 
1584  Link<ColorListBox&,void> aLk2 = LINK(this, SwRedlineOptionsTabPage, ColorHdl);
1585  m_xInsertColorLB->SetSelectHdl( aLk2 );
1586  m_xDeletedColorLB->SetSelectHdl( aLk2 );
1587  m_xChangedColorLB->SetSelectHdl( aLk2 );
1588 
1589  m_xMarkPosLB->connect_changed(LINK(this, SwRedlineOptionsTabPage, ChangedMaskPrevHdl));
1590  m_xMarkColorLB->SetSelectHdl(LINK(this, SwRedlineOptionsTabPage, ChangedMaskColorPrevHdl));
1591 }
1592 
1594 {
1595  m_xInsertColorLB.reset();
1596  m_xInsertedPreview.reset();
1597  m_xInsertedPreviewWN.reset();
1598  m_xDeletedColorLB.reset();
1599  m_xDeletedPreview.reset();
1600  m_xDeletedPreviewWN.reset();
1601  m_xChangedColorLB.reset();
1602  m_xChangedPreview.reset();
1603  m_xChangedPreviewWN.reset();
1604  m_xMarkColorLB.reset();
1605  m_xMarkPreview.reset();
1606  m_xMarkPreviewWN.reset();
1607 }
1608 
1609 std::unique_ptr<SfxTabPage> SwRedlineOptionsTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet)
1610 {
1611  return std::make_unique<SwRedlineOptionsTabPage>(pPage, pController, *rSet);
1612 }
1613 
1615 {
1616  CharAttr *pAttr;
1617  SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig();
1618 
1619  AuthorCharAttr aInsertedAttr;
1620  AuthorCharAttr aDeletedAttr;
1621  AuthorCharAttr aChangedAttr;
1622 
1623  AuthorCharAttr aOldInsertAttr(pOpt->GetInsertAuthorAttr());
1624  AuthorCharAttr aOldDeletedAttr(pOpt->GetDeletedAuthorAttr());
1625  AuthorCharAttr aOldChangedAttr(pOpt->GetFormatAuthorAttr());
1626 
1627  Color nOldMarkColor = pOpt->GetMarkAlignColor();
1628  sal_uInt16 nOldMarkMode = pOpt->GetMarkAlignMode();
1629 
1630  sal_Int32 nPos = m_xInsertLB->get_active();
1631  if (nPos != -1)
1632  {
1633  pAttr = reinterpret_cast<CharAttr*>(m_xInsertLB->get_id(nPos).toInt64());
1634  aInsertedAttr.m_nItemId = pAttr->nItemId;
1635  aInsertedAttr.m_nAttr = pAttr->nAttr;
1636  aInsertedAttr.m_nColor = m_xInsertColorLB->GetSelectEntryColor();
1637  pOpt->SetInsertAuthorAttr(aInsertedAttr);
1638  }
1639 
1640  nPos = m_xDeletedLB->get_active();
1641  if (nPos != -1)
1642  {
1643  pAttr = reinterpret_cast<CharAttr*>(m_xDeletedLB->get_id(nPos).toInt64());
1644  aDeletedAttr.m_nItemId = pAttr->nItemId;
1645  aDeletedAttr.m_nAttr = pAttr->nAttr;
1646  aDeletedAttr.m_nColor = m_xDeletedColorLB->GetSelectEntryColor();
1647  pOpt->SetDeletedAuthorAttr(aDeletedAttr);
1648  }
1649 
1650  nPos = m_xChangedLB->get_active();
1651  if (nPos != -1)
1652  {
1653  pAttr = reinterpret_cast<CharAttr*>(m_xChangedLB->get_id(nPos).toInt64());
1654  aChangedAttr.m_nItemId = pAttr->nItemId;
1655  aChangedAttr.m_nAttr = pAttr->nAttr;
1656  aChangedAttr.m_nColor = m_xChangedColorLB->GetSelectEntryColor();
1657  pOpt->SetFormatAuthorAttr(aChangedAttr);
1658  }
1659 
1660  nPos = 0;
1661  switch (m_xMarkPosLB->get_active())
1662  {
1663  case 0: nPos = text::HoriOrientation::NONE; break;
1664  case 1: nPos = text::HoriOrientation::LEFT; break;
1665  case 2: nPos = text::HoriOrientation::RIGHT; break;
1666  case 3: nPos = text::HoriOrientation::OUTSIDE; break;
1667  case 4: nPos = text::HoriOrientation::INSIDE; break;
1668  }
1669  pOpt->SetMarkAlignMode(nPos);
1670  pOpt->SetMarkAlignColor(m_xMarkColorLB->GetSelectEntryColor());
1671 
1672  if (!(aInsertedAttr == aOldInsertAttr) ||
1673  !(aDeletedAttr == aOldDeletedAttr) ||
1674  !(aChangedAttr == aOldChangedAttr) ||
1675  nOldMarkColor != pOpt->GetMarkAlignColor() ||
1676  nOldMarkMode != pOpt->GetMarkAlignMode() )
1677  {
1678  // update all documents
1679  SwDocShell* pDocShell = static_cast<SwDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<SwDocShell>));
1680 
1681  while( pDocShell )
1682  {
1683  pDocShell->GetWrtShell()->UpdateRedlineAttr();
1684  pDocShell = static_cast<SwDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<SwDocShell>));
1685  }
1686  }
1687 
1688  return false;
1689 }
1690 
1692 {
1693  const SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig();
1694 
1695  const AuthorCharAttr &rInsertAttr = pOpt->GetInsertAuthorAttr();
1696  const AuthorCharAttr &rDeletedAttr = pOpt->GetDeletedAuthorAttr();
1697  const AuthorCharAttr &rChangedAttr = pOpt->GetFormatAuthorAttr();
1698 
1699  // initialise preview
1700  InitFontStyle(*m_xInsertedPreviewWN, SwResId(STR_OPT_PREVIEW_INSERTED));
1701  InitFontStyle(*m_xDeletedPreviewWN, SwResId(STR_OPT_PREVIEW_DELETED));
1702  InitFontStyle(*m_xChangedPreviewWN, SwResId(STR_OPT_PREVIEW_CHANGED));
1703 
1704  Color nColor = rInsertAttr.m_nColor;
1705  m_xInsertColorLB->SelectEntry(nColor);
1706 
1707  nColor = rDeletedAttr.m_nColor;
1708  m_xDeletedColorLB->SelectEntry(nColor);
1709 
1710  nColor = rChangedAttr.m_nColor;
1711  m_xChangedColorLB->SelectEntry(nColor);
1712 
1713  m_xMarkColorLB->SelectEntry(pOpt->GetMarkAlignColor());
1714 
1715  m_xInsertLB->set_active(0);
1716  m_xDeletedLB->set_active(0);
1717  m_xChangedLB->set_active(0);
1718 
1719  lcl_FillRedlineAttrListBox(*m_xInsertLB, rInsertAttr, aInsertAttrMap, SAL_N_ELEMENTS(aInsertAttrMap));
1720  lcl_FillRedlineAttrListBox(*m_xDeletedLB, rDeletedAttr, aDeletedAttrMap, SAL_N_ELEMENTS(aDeletedAttrMap));
1721  lcl_FillRedlineAttrListBox(*m_xChangedLB, rChangedAttr, aChangedAttrMap, SAL_N_ELEMENTS(aChangedAttrMap));
1722 
1723  sal_Int32 nPos = 0;
1724  switch (pOpt->GetMarkAlignMode())
1725  {
1726  case text::HoriOrientation::NONE: nPos = 0; break;
1727  case text::HoriOrientation::LEFT: nPos = 1; break;
1728  case text::HoriOrientation::RIGHT: nPos = 2; break;
1729  case text::HoriOrientation::OUTSIDE: nPos = 3; break;
1730  case text::HoriOrientation::INSIDE: nPos = 4; break;
1731  }
1732  m_xMarkPosLB->set_active(nPos);
1733 
1734  // show settings in preview
1735  AttribHdl(*m_xInsertLB);
1736  ColorHdl(*m_xInsertColorLB);
1737  AttribHdl(*m_xDeletedLB);
1738  ColorHdl(*m_xInsertColorLB);
1739  AttribHdl(*m_xChangedLB);
1740  ColorHdl(*m_xChangedColorLB);
1741 
1742  ChangedMaskPrev();
1743 }
1744 
1746 {
1747  SvxFontPrevWindow *pPrev = nullptr;
1748  ColorListBox *pColorLB;
1749 
1750  if (&rLB == m_xInsertLB.get())
1751  {
1752  pColorLB = m_xInsertColorLB.get();
1753  pPrev = m_xInsertedPreviewWN.get();
1754  }
1755  else if (&rLB == m_xDeletedLB.get())
1756  {
1757  pColorLB = m_xDeletedColorLB.get();
1758  pPrev = m_xDeletedPreviewWN.get();
1759  }
1760  else
1761  {
1762  pColorLB = m_xChangedColorLB.get();
1763  pPrev = m_xChangedPreviewWN.get();
1764  }
1765 
1766  SvxFont& rFont = pPrev->GetFont();
1767  SvxFont& rCJKFont = pPrev->GetCJKFont();
1768 
1769  rFont.SetWeight(WEIGHT_NORMAL);
1770  rCJKFont.SetWeight(WEIGHT_NORMAL);
1771  rFont.SetItalic(ITALIC_NONE);
1772  rCJKFont.SetItalic(ITALIC_NONE);
1773  rFont.SetUnderline(LINESTYLE_NONE);
1774  rCJKFont.SetUnderline(LINESTYLE_NONE);
1775  rFont.SetStrikeout(STRIKEOUT_NONE);
1776  rCJKFont.SetStrikeout(STRIKEOUT_NONE);
1777  rFont.SetCaseMap(SvxCaseMap::NotMapped);
1778  rCJKFont.SetCaseMap(SvxCaseMap::NotMapped);
1779 
1780  Color aColor = pColorLB->GetSelectEntryColor();
1781 
1782  if (aColor == COL_NONE_COLOR)
1783  {
1784  rFont.SetColor( COL_BLACK );
1785  rCJKFont.SetColor( COL_BLACK );
1786  }
1787  else if (aColor == COL_TRANSPARENT)
1788  {
1789  rFont.SetColor( COL_RED );
1790  rCJKFont.SetColor( COL_RED );
1791  }
1792  else
1793  {
1794  rFont.SetColor(aColor);
1795  rCJKFont.SetColor(aColor);
1796  }
1797 
1798  sal_Int32 nPos = rLB.get_active();
1799  if( nPos == -1)
1800  nPos = 0;
1801 
1802  CharAttr* pAttr = reinterpret_cast<CharAttr*>(rLB.get_id(nPos).toInt64());
1803  //switch off preview background color
1804  pPrev->ResetColor();
1805  switch (pAttr->nItemId)
1806  {
1807  case SID_ATTR_CHAR_WEIGHT:
1808  rFont.SetWeight( static_cast<FontWeight>(pAttr->nAttr) );
1809  rCJKFont.SetWeight( static_cast<FontWeight>(pAttr->nAttr) );
1810  break;
1811 
1812  case SID_ATTR_CHAR_POSTURE:
1813  rFont.SetItalic( static_cast<FontItalic>(pAttr->nAttr) );
1814  rCJKFont.SetItalic( static_cast<FontItalic>(pAttr->nAttr) );
1815  break;
1816 
1817  case SID_ATTR_CHAR_UNDERLINE:
1818  rFont.SetUnderline( static_cast<FontLineStyle>(pAttr->nAttr) );
1819  rCJKFont.SetUnderline( static_cast<FontLineStyle>(pAttr->nAttr) );
1820  break;
1821 
1822  case SID_ATTR_CHAR_STRIKEOUT:
1823  rFont.SetStrikeout( static_cast<FontStrikeout>(pAttr->nAttr) );
1824  rCJKFont.SetStrikeout( static_cast<FontStrikeout>(pAttr->nAttr) );
1825  break;
1826 
1827  case SID_ATTR_CHAR_CASEMAP:
1828  rFont.SetCaseMap( static_cast<SvxCaseMap>(pAttr->nAttr) );
1829  rCJKFont.SetCaseMap( static_cast<SvxCaseMap>(pAttr->nAttr) );
1830  break;
1831 
1832  case SID_ATTR_BRUSH:
1833  {
1834  Color aBgColor = pColorLB->GetSelectEntryColor();
1835  if (aBgColor != COL_NONE_COLOR)
1836  pPrev->SetColor(aBgColor);
1837  else
1838  pPrev->SetColor(COL_LIGHTGRAY);
1839  rFont.SetColor( COL_BLACK );
1840  rCJKFont.SetColor( COL_BLACK );
1841  }
1842  break;
1843  }
1844 
1845  pPrev->Invalidate();
1846 }
1847 
1848 IMPL_LINK(SwRedlineOptionsTabPage, ColorHdl, ColorListBox&, rListBox, void)
1849 {
1850  ColorListBox* pColorLB = &rListBox;
1851  SvxFontPrevWindow *pPrev = nullptr;
1852  weld::ComboBox* pLB;
1853 
1854  if (pColorLB == m_xInsertColorLB.get())
1855  {
1856  pLB = m_xInsertLB.get();
1857  pPrev = m_xInsertedPreviewWN.get();
1858  }
1859  else if (pColorLB == m_xDeletedColorLB.get())
1860  {
1861  pLB = m_xDeletedLB.get();
1862  pPrev = m_xDeletedPreviewWN.get();
1863  }
1864  else
1865  {
1866  pLB = m_xChangedLB.get();
1867  pPrev = m_xChangedPreviewWN.get();
1868  }
1869 
1870  SvxFont& rFont = pPrev->GetFont();
1871  SvxFont& rCJKFont = pPrev->GetCJKFont();
1872  sal_Int32 nPos = pLB->get_active();
1873  if( nPos == -1)
1874  nPos = 0;
1875 
1876  CharAttr* pAttr = reinterpret_cast<CharAttr*>(pLB->get_id(nPos).toInt64());
1877 
1878  if( pAttr->nItemId == SID_ATTR_BRUSH )
1879  {
1880  rFont.SetColor( COL_BLACK );
1881  rCJKFont.SetColor( COL_BLACK );
1882 
1883  Color aBgColor = pColorLB->GetSelectEntryColor();
1884  if (aBgColor != COL_NONE_COLOR)
1885  pPrev->SetColor(aBgColor);
1886  else
1887  pPrev->SetColor(COL_LIGHTGRAY);
1888  }
1889  else
1890  {
1891  Color aColor = pColorLB->GetSelectEntryColor();
1892 
1893  if (aColor == COL_NONE_COLOR)
1894  {
1895  rFont.SetColor( COL_BLACK );
1896  rCJKFont.SetColor( COL_BLACK );
1897  }
1898  else if (aColor == COL_TRANSPARENT)
1899  {
1900  rFont.SetColor( COL_RED );
1901  rCJKFont.SetColor( COL_RED );
1902  }
1903  else
1904  {
1905  rFont.SetColor(aColor);
1906  rCJKFont.SetColor(aColor);
1907  }
1908  }
1909 
1910  pPrev->Invalidate();
1911 }
1912 
1914 {
1915  m_xMarkPreviewWN->SetMarkPos(m_xMarkPosLB->get_active());
1916  m_xMarkPreviewWN->SetColor(m_xMarkColorLB->GetSelectEntryColor());
1917 
1918  m_xMarkPreviewWN->Invalidate();
1919 }
1920 
1922 {
1923  ChangedMaskPrev();
1924 }
1925 
1926 IMPL_LINK_NOARG(SwRedlineOptionsTabPage, ChangedMaskColorPrevHdl, ColorListBox&, void)
1927 {
1928  ChangedMaskPrev();
1929 }
1930 
1931 void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin, const OUString& rText)
1932 {
1933  const AllSettings& rAllSettings = Application::GetSettings();
1934  LanguageType eLangType = rAllSettings.GetUILanguageTag().getLanguageType();
1935  Color aBackCol( rAllSettings.GetStyleSettings().GetWindowColor() );
1936  SvxFont& rFont = rExampleWin.GetFont();
1937  SvxFont& rCJKFont = rExampleWin.GetCJKFont();
1938  SvxFont& rCTLFont = rExampleWin.GetCTLFont();
1939 
1940  OutputDevice& rDevice = rExampleWin.GetDrawingArea()->get_ref_device();
1941 
1942  vcl::Font aFont( OutputDevice::GetDefaultFont( DefaultFontType::SERIF, eLangType,
1943  GetDefaultFontFlags::OnlyOne, &rDevice ) );
1944  vcl::Font aCJKFont( OutputDevice::GetDefaultFont( DefaultFontType::CJK_TEXT, eLangType,
1945  GetDefaultFontFlags::OnlyOne, &rDevice ) );
1946  vcl::Font aCTLFont( OutputDevice::GetDefaultFont( DefaultFontType::CTL_TEXT, eLangType,
1947  GetDefaultFontFlags::OnlyOne, &rDevice ) );
1948  const Size aDefSize( 0, 12 );
1949  aFont.SetFontSize( aDefSize );
1950  aCJKFont.SetFontSize( aDefSize );
1951  aCTLFont.SetFontSize( aDefSize );
1952 
1953  aFont.SetFillColor( aBackCol );
1954  aCJKFont.SetFillColor( aBackCol );
1955  aCTLFont.SetFillColor( aBackCol );
1956 
1957  aFont.SetWeight( WEIGHT_NORMAL );
1958  aCJKFont.SetWeight( WEIGHT_NORMAL );
1959  aCTLFont.SetWeight( WEIGHT_NORMAL );
1960 
1961  rFont = aFont;
1962  rCJKFont = aCJKFont;
1963  rCTLFont = aCTLFont;
1964 
1965  const Size aNewSize( 0, rExampleWin.GetOutputSizePixel().Height() * 2 / 3 );
1966  rFont.SetFontSize( aNewSize );
1967  rCJKFont.SetFontSize( aNewSize );
1968 
1969  rExampleWin.SetFont( rFont, rCJKFont,rCTLFont );
1970  rExampleWin.SetPreviewText(rText);
1971 
1972  rExampleWin.SetBackColor(aBackCol);
1973 }
1974 
1976  : SfxTabPage(pPage, pController, "modules/swriter/ui/optcomparison.ui", "OptComparison", &rSet)
1977  , m_xAutoRB(m_xBuilder->weld_radio_button("auto"))
1978  , m_xWordRB(m_xBuilder->weld_radio_button("byword"))
1979  , m_xCharRB(m_xBuilder->weld_radio_button("bycharacter"))
1980  , m_xRsidCB(m_xBuilder->weld_check_button("useRSID"))
1981  , m_xIgnoreCB(m_xBuilder->weld_check_button("ignore"))
1982  , m_xLenNF(m_xBuilder->weld_spin_button("ignorelen"))
1983  , m_xStoreRsidCB(m_xBuilder->weld_check_button("storeRSID"))
1984 {
1985  Link<weld::Button&,void> aLnk( LINK( this, SwCompareOptionsTabPage, ComparisonHdl ) );
1986  m_xAutoRB->connect_clicked( aLnk );
1987  m_xWordRB->connect_clicked( aLnk );
1988  m_xCharRB->connect_clicked( aLnk );
1989 
1990  m_xIgnoreCB->connect_clicked( LINK( this, SwCompareOptionsTabPage, IgnoreHdl) );
1991 }
1992 
1994 {
1995 }
1996 
1997 std::unique_ptr<SfxTabPage> SwCompareOptionsTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet )
1998 {
1999  return std::make_unique<SwCompareOptionsTabPage>(pPage, pController, *rAttrSet);
2000 }
2001 
2003 {
2004  bool bRet = false;
2005  SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig();
2006 
2007  if( m_xAutoRB->get_state_changed_from_saved() ||
2008  m_xWordRB->get_state_changed_from_saved() ||
2009  m_xCharRB->get_state_changed_from_saved() )
2010  {
2012 
2013  if ( m_xAutoRB->get_active() ) eCmpMode = SwCompareMode::Auto;
2014  if ( m_xWordRB->get_active() ) eCmpMode = SwCompareMode::ByWord;
2015  if ( m_xCharRB->get_active() ) eCmpMode = SwCompareMode::ByChar;
2016 
2017  pOpt->SetCompareMode( eCmpMode );
2018  bRet = true;
2019  }
2020 
2021  if( m_xRsidCB->get_state_changed_from_saved() )
2022  {
2023  pOpt->SetUseRsid( m_xRsidCB->get_active() );
2024  bRet = true;
2025  }
2026 
2027  if( m_xIgnoreCB->get_state_changed_from_saved() )
2028  {
2029  pOpt->SetIgnorePieces( m_xIgnoreCB->get_active() );
2030  bRet = true;
2031  }
2032 
2033  if( m_xLenNF->get_value_changed_from_saved() )
2034  {
2035  pOpt->SetPieceLen( m_xLenNF->get_value() );
2036  bRet = true;
2037  }
2038 
2039  if (m_xStoreRsidCB->get_state_changed_from_saved())
2040  {
2041  pOpt->SetStoreRsid(m_xStoreRsidCB->get_active());
2042  bRet = true;
2043  }
2044 
2045  return bRet;
2046 }
2047 
2049 {
2050  SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig();
2051 
2052  SwCompareMode eCmpMode = pOpt->GetCompareMode();
2053  if( eCmpMode == SwCompareMode::Auto )
2054  {
2055  m_xAutoRB->set_active(true);
2056  m_xRsidCB->set_sensitive(false);
2057  m_xIgnoreCB->set_sensitive(false);
2058  m_xLenNF->set_sensitive(false);
2059  }
2060  else if( eCmpMode == SwCompareMode::ByWord )
2061  {
2062  m_xWordRB->set_active(true);
2063  m_xRsidCB->set_sensitive(true);
2064  m_xIgnoreCB->set_sensitive(true);
2065  m_xLenNF->set_sensitive(true);
2066  }
2067  else if( eCmpMode == SwCompareMode::ByChar)
2068  {
2069  m_xCharRB->set_active(true);
2070  m_xRsidCB->set_sensitive(true);
2071  m_xIgnoreCB->set_sensitive(true);
2072  m_xLenNF->set_sensitive(true);
2073  }
2074  m_xAutoRB->save_state();
2075  m_xWordRB->save_state();
2076  m_xCharRB->save_state();
2077 
2078  m_xRsidCB->set_active( pOpt->IsUseRsid() );
2079  m_xRsidCB->save_state();
2080 
2081  m_xIgnoreCB->set_active( pOpt->IsIgnorePieces() );
2082  m_xIgnoreCB->save_state();
2083 
2084  m_xLenNF->set_sensitive( m_xIgnoreCB->get_active() && eCmpMode != SwCompareMode::Auto );
2085 
2086  m_xLenNF->set_value( pOpt->GetPieceLen() );
2087  m_xLenNF->save_value();
2088 
2089  m_xStoreRsidCB->set_active(pOpt->IsStoreRsid());
2090  m_xStoreRsidCB->save_state();
2091 }
2092 
2094 {
2095  bool bChecked = !m_xAutoRB->get_active();
2096  m_xRsidCB->set_sensitive( bChecked );
2097  m_xIgnoreCB->set_sensitive( bChecked );
2098  m_xLenNF->set_sensitive( bChecked && m_xIgnoreCB->get_active() );
2099 }
2100 
2102 {
2103  m_xLenNF->set_sensitive(m_xIgnoreCB->get_active());
2104 }
2105 
2106 #ifdef DBG_UTIL
2107 
2109  : SfxTabPage(pPage, pController, "modules/swriter/ui/opttestpage.ui", "OptTestPage", &rCoreSet)
2110  , bAttrModified( false )
2111  , m_xTest1CBox(m_xBuilder->weld_check_button("unused"))
2112  , m_xTest2CBox(m_xBuilder->weld_check_button("dynamic"))
2113  , m_xTest3CBox(m_xBuilder->weld_check_button("nocalm"))
2114  , m_xTest4CBox(m_xBuilder->weld_check_button("wysiwygdbg"))
2115  , m_xTest5CBox(m_xBuilder->weld_check_button("noidle"))
2116  , m_xTest6CBox(m_xBuilder->weld_check_button("noscreenadj"))
2117  , m_xTest7CBox(m_xBuilder->weld_check_button("winformat"))
2118  , m_xTest8CBox(m_xBuilder->weld_check_button("noscroll"))
2119  , m_xTest9CBox(m_xBuilder->weld_check_button("DrawingLayerNotLoading"))
2120  , m_xTest10CBox(m_xBuilder->weld_check_button("AutoFormatByInput"))
2121 {
2122  Init();
2123 }
2124 
2126 {
2127 }
2128 
2129 std::unique_ptr<SfxTabPage> SwTestTabPage::Create( weld::Container* pPage, weld::DialogController* pController,
2130  const SfxItemSet* rAttrSet )
2131 {
2132  return std::make_unique<SwTestTabPage>(pPage, pController, *rAttrSet);
2133 }
2134 
2136 {
2137 
2138  if ( bAttrModified )
2139  {
2140  SwTestItem aTestItem;
2141  aTestItem.m_bTest1=m_xTest1CBox->get_active();
2142  aTestItem.m_bTest2=m_xTest2CBox->get_active();
2143  aTestItem.m_bTest3=m_xTest3CBox->get_active();
2144  aTestItem.m_bTest4=m_xTest4CBox->get_active();
2145  aTestItem.m_bTest5=m_xTest5CBox->get_active();
2146  aTestItem.m_bTest6=m_xTest6CBox->get_active();
2147  aTestItem.m_bTest7=m_xTest7CBox->get_active();
2148  aTestItem.m_bTest8=m_xTest8CBox->get_active();
2149  aTestItem.m_bTest9=m_xTest9CBox->get_active();
2150  aTestItem.m_bTest10=m_xTest10CBox->get_active();
2151  rCoreSet->Put(aTestItem);
2152  }
2153  return bAttrModified;
2154 }
2155 
2157 {
2158  const SfxItemSet& rSet = GetItemSet();
2159  const SwTestItem* pTestAttr = nullptr;
2160 
2161  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_SWTEST , false,
2162  reinterpret_cast<const SfxPoolItem**>(&pTestAttr) ))
2163  {
2164  m_xTest1CBox->set_active(pTestAttr->m_bTest1);
2165  m_xTest2CBox->set_active(pTestAttr->m_bTest2);
2166  m_xTest3CBox->set_active(pTestAttr->m_bTest3);
2167  m_xTest4CBox->set_active(pTestAttr->m_bTest4);
2168  m_xTest5CBox->set_active(pTestAttr->m_bTest5);
2169  m_xTest6CBox->set_active(pTestAttr->m_bTest6);
2170  m_xTest7CBox->set_active(pTestAttr->m_bTest7);
2171  m_xTest8CBox->set_active(pTestAttr->m_bTest8);
2172  m_xTest9CBox->set_active(pTestAttr->m_bTest9);
2173  m_xTest10CBox->set_active(pTestAttr->m_bTest10);
2174  }
2175 }
2176 
2178 {
2179  // handler
2180  Link<weld::Button&,void> aLk = LINK( this, SwTestTabPage, AutoClickHdl );
2181  m_xTest1CBox->connect_clicked( aLk );
2182  m_xTest2CBox->connect_clicked( aLk );
2183  m_xTest3CBox->connect_clicked( aLk );
2184  m_xTest4CBox->connect_clicked( aLk );
2185  m_xTest5CBox->connect_clicked( aLk );
2186  m_xTest6CBox->connect_clicked( aLk );
2187  m_xTest7CBox->connect_clicked( aLk );
2188  m_xTest8CBox->connect_clicked( aLk );
2189  m_xTest9CBox->connect_clicked( aLk );
2190  m_xTest10CBox->connect_clicked( aLk );
2191 }
2192 
2194 {
2195  bAttrModified = true;
2196 }
2197 
2198 #endif
2199 
2200 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in document.
Definition: edatmisc.cxx:84
std::unique_ptr< weld::ComboBox > m_xTitleBox
Definition: optpage.hxx:153
SfxViewFrame * GetViewFrame() const
bool GetValue() const
long Width() const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:544
void SetPos(const Point &rPoint)
const Color & GetShadowColor() const
std::unique_ptr< weld::CheckButton > m_xTableCB
Definition: optpage.hxx:46
Subgroup labels.
Definition: poolfmt.hxx:345
#define FONT_GROUP_CTL
Definition: fontcfg.hxx:48
void SetFillColor(const Color &)
long GetWidth() const
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
bool IsUseRsid() const
Definition: modcfg.hxx:371
FieldUnit
void SetBackColor(const Color &rColor)
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:1019
std::unique_ptr< weld::CustomWeld > m_xInsertedPreview
Definition: optpage.hxx:291
SvxFont & GetCTLFont()
void UpdateRedlineAttr()
Redline attributes have been changed. Updated views.
Definition: edredln.cxx:126
sal_uInt16 GetTableVMove() const
Definition: modcfg.hxx:231
void SetFontSize(const Size &)
void SetFontStandard(const OUString &rSet, sal_uInt8 nFontGroup)
Definition: fontcfg.hxx:90
std::unique_ptr< weld::ComboBox > m_xIdxBox
Definition: optpage.hxx:159
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
long GetHeight() const
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
Definition: edfmt.cxx:123
bool m_bTest4
Definition: cfgitems.hxx:144
#define FONT_STANDARD
Definition: fontcfg.hxx:27
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
const OUString & GetFamilyName() const
std::unique_ptr< ColorListBox > m_xInsertColorLB
Definition: optpage.hxx:289
#define FONT_OUTLINE
Definition: fontcfg.hxx:28
Color m_aMarkCol
Definition: optpage.hxx:260
bool m_bDrawing
Definition: cfgitems.hxx:78
bool m_bTest7
Definition: cfgitems.hxx:147
std::unique_ptr< weld::CheckButton > m_xNumAlignmentCB
Definition: optpage.hxx:190
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:1300
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:1106
OUString m_sFaxName
Definition: printdata.hxx:69
std::unique_ptr< weld::CheckButton > m_xRepeatHeaderCB
Definition: optpage.hxx:184
SwRedlineOptionsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:1534
void InitColors()
Definition: optpage.cxx:1395
std::unique_ptr< weld::CheckButton > m_xPostItCB
Definition: optpage.hxx:48
const LanguageTag & GetUILanguageTag() const
std::string GetValue
std::unique_ptr< weld::ComboBox > m_xListBox
Definition: optpage.hxx:155
#define FN_PARAM_ELEM
Definition: cmdid.h:757
void SetFontCaption(const OUString &rSet, sal_uInt8 nFontGroup)
Definition: fontcfg.hxx:97
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:2002
std::unique_ptr< weld::CheckButton > m_xTest3CBox
Definition: optpage.hxx:346
long Height() const
std::unique_ptr< weld::CheckButton > m_xProspectCB
Definition: optpage.hxx:87
LanguageType getLanguageType(bool bResolveSystem=true) const
std::unique_ptr< weld::CheckButton > m_xCtrlFieldCB
Definition: optpage.hxx:78
constexpr::Color COL_RED(0x80, 0x00, 0x00)
SwTestTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:2108
std::unique_ptr< weld::CheckButton > m_xTest4CBox
Definition: optpage.hxx:347
long AdjustLeft(long nHorzMoveDelta)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:1609
SwWrtShell * m_pWrtShell
Definition: optpage.hxx:220
static CharAttr const aRedlineAttr[]
Definition: optpage.cxx:1355
void disposeAndClear()
void SetFontList(const OUString &rSet, sal_uInt8 nFontGroup)
Definition: fontcfg.hxx:95
bool IsIgnorePieces() const
Definition: modcfg.hxx:375
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
SwStdFontConfig * m_pFontConfig
Definition: optpage.hxx:127
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
bool m_bListHeightDefault
Definition: optpage.hxx:140
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:1997
SvxFont & GetCJKFont()
SwInsertTableFlags mnInsMode
Definition: itabenum.hxx:40
OUString m_sShellLabel
Definition: optpage.hxx:122
const SvxFontItem & GetFont(bool=true) const
Definition: charatr.hxx:125
std::unique_ptr< weld::CheckButton > m_xTest1CBox
Definition: optpage.hxx:344
sal_uInt16 GetValue() const
bool m_bNotes
Definition: cfgitems.hxx:79
bool m_bPrintSingleJobs
Definition: printdata.hxx:58
void SetWeight(FontWeight)
std::unique_ptr< weld::CheckButton > m_xLeftPageCB
Definition: optpage.hxx:85
#define FONT_LIST
Definition: fontcfg.hxx:29
std::unique_ptr< weld::Frame > m_xSettingsFrame
Definition: optpage.hxx:50
constexpr::Color COL_GRAY(0x80, 0x80, 0x80)
bool m_bPrintRightPages
Definition: printdata.hxx:58
constexpr::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
std::unique_ptr< weld::CheckButton > m_xDrwCB
Definition: optpage.hxx:47
std::unique_ptr< weld::CheckButton > m_xStoreRsidCB
Definition: optpage.hxx:368
sal_uInt16 GetTableHMove() const
Definition: modcfg.hxx:227
void SetOn(bool bFlag)
Definition: cfgitems.hxx:130
#define FN_HSCROLL_METRIC
Definition: cmdid.h:178
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
bool m_bDisposePrinter
Definition: optpage.hxx:138
#define FN_PARAM_SHADOWCURSOR
Definition: cmdid.h:795
void SetModified()
Definition: edws.cxx:70
const OUString & GetFontList(sal_uInt8 nFontGroup) const
Definition: fontcfg.hxx:83
bool m_bPrintReverse
Definition: printdata.hxx:58
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: optpage.cxx:1409
void Invalidate(sal_uInt16 nId)
std::unique_ptr< weld::ComboBox > m_xStandardBox
Definition: optpage.hxx:151
bool IsCTLFontEnabled() const
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:329
Color m_aTextCol
Definition: optpage.hxx:263
#define FN_PARAM_ADDPRINTER
Definition: cmdid.h:755
bool m_bIndexHeightDefault
Definition: optpage.hxx:142
virtual int get_active() const =0
sal_Int32 GetFontHeight(sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang)
Definition: fontcfg.cxx:298
std::unique_ptr< SvxFontPrevWindow > m_xChangedPreviewWN
Definition: optpage.hxx:300
const AuthorCharAttr & GetInsertAuthorAttr() const
Definition: modcfg.hxx:243
void SetInsTableFormatNum(bool bHTML, bool b)
Definition: modcfg.hxx:282
std::unique_ptr< weld::CheckButton > m_xDontSplitCB
Definition: optpage.hxx:185
std::unique_ptr< weld::Label > m_xBookmarkLabel
Definition: optpage.hxx:232
void EndAllAction()
Definition: edws.cxx:97
virtual ~SwRedlineOptionsTabPage() override
Definition: optpage.cxx:1593
bool m_bLabelHeightDefault
Definition: optpage.hxx:141
const OUString & GetFontCaption(sal_uInt8 nFontGroup) const
Definition: fontcfg.hxx:84
void SetTableHInsert(sal_uInt16 nSet)
Definition: modcfg.hxx:236
sal_uInt16 m_nAttr
Definition: authratr.hxx:30
sal_uInt16 mnRowsToRepeat
Definition: itabenum.hxx:41
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
const SvxFontItem & GetCJKFont(bool=true) const
Definition: charatr.hxx:127
bool m_bSetListDefault
Definition: optpage.hxx:133
virtual ~SwTableOptionsTabPage() override
Definition: optpage.cxx:1009
#define FONT_CAPTION
Definition: fontcfg.hxx:30
virtual int get_count() const =0
bool bAttrModified
Definition: optpage.hxx:342
Size const & GetOutputSizePixel() const
FontFamily GetFamilyType()
bool IsInsTableAlignNum(bool bHTML) const
Definition: modcfg.hxx:294
bool m_bSetIdxDefault
Definition: optpage.hxx:137
SwInsertTableFlags
Definition: itabenum.hxx:25
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:2135
std::unique_ptr< weld::CheckButton > m_xGrfCB
Definition: optpage.hxx:77
VclPtr< SfxPrinter > m_pPrt
Definition: optpage.hxx:125
std::unique_ptr< weld::CheckButton > m_xVRulerRightCBox
Definition: optpage.hxx:41
std::unique_ptr< weld::CheckButton > m_xParaCB
Definition: optpage.hxx:223
std::unique_ptr< weld::CheckButton > m_xMathBaselineAlignmentCB
Definition: optpage.hxx:241
std::unique_ptr< weld::ComboBox > m_xDeletedLB
Definition: optpage.hxx:293
void Move(long nHorzMoveDelta, long nVertMoveDelta)
const Color & GetMarkAlignColor() const
Definition: modcfg.hxx:259
#define FN_VSCROLL_METRIC
Definition: cmdid.h:179
#define FONT_GROUP_DEFAULT
Definition: fontcfg.hxx:46
WEIGHT_BOLD
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
std::unique_ptr< weld::CheckButton > m_xFieldHiddenParaCB
Definition: optpage.hxx:57
std::unique_ptr< SwMarkPreview > m_xMarkPreviewWN
Definition: optpage.hxx:305
#define FN_PARAM_DOCDISP
Definition: cmdid.h:756
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
std::unique_ptr< weld::ComboBox > m_xLabelBox
Definition: optpage.hxx:157
bool m_bPrintProspectRTL
Definition: printdata.hxx:58
long Right() const
tools::Rectangle aRightPagePrtArea
Definition: optpage.hxx:268
const SwView & GetView() const
Definition: wrtsh.hxx:428
bool m_bPrintGraphic
Definition: printdata.hxx:58
LINESTYLE_NONE
bool IsInsTableChangeNumFormat(bool bHTML) const
Definition: modcfg.hxx:287
static sal_uInt16 aDeletedAttrMap[]
Definition: optpage.cxx:1375
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: optpage.cxx:977
std::unique_ptr< weld::Button > m_xStandardPB
Definition: optpage.hxx:161
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:210
std::unique_ptr< SvxFontPrevWindow > m_xDeletedPreviewWN
Definition: optpage.hxx:295
Color m_aShadowCol
Definition: optpage.hxx:262
std::unique_ptr< weld::CheckButton > m_xBookmarkCB
Definition: optpage.hxx:231
void SetFont(const SvxFont &rNormalFont, const SvxFont &rCJKFont, const SvxFont &rCTLFont)
void SetDeletedAuthorAttr(AuthorCharAttr const &rAttr)
Definition: modcfg.hxx:248
bool m_bPrintProspect
Definition: printdata.hxx:58
void SetPieceLen(sal_uInt16 nLen)
Definition: modcfg.hxx:380
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:700
bool GetHighContrastMode() const
virtual void set_id(int row, const OUString &rId)=0
sal_uInt16 nMarkPos
Definition: optpage.hxx:270
#define FONT_PER_GROUP
Definition: fontcfg.hxx:44
bool m_bShowHiddenPara
Definition: cfgitems.hxx:82
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:344
std::unique_ptr< weld::CustomWeld > m_xChangedPreview
Definition: optpage.hxx:301
Mode eMode
SwFillMode
Definition: crstate.hxx:28
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
long Top() const
Size getPreviewOptionsSize(const OutputDevice &rReference)
static OUString GetDefaultFor(sal_uInt16 nFontType, LanguageType eLang)
Definition: fontcfg.cxx:215
SvxFont & GetFont()
void SetInsTableAlignNum(bool bHTML, bool b)
Definition: modcfg.hxx:296
virtual OutputDevice & get_ref_device()=0
void SetFormatAuthorAttr(AuthorCharAttr const &rAttr)
Definition: modcfg.hxx:252
std::unique_ptr< FontSizeBox > m_xListHeightLB
Definition: optpage.hxx:156
#define FN_PARAM_PRINTER
Definition: cmdid.h:783
std::unique_ptr< weld::CheckButton > m_xCursorInProtCB
Definition: optpage.hxx:239
STRIKEOUT_SINGLE
if(nullptr==pCandidateA||nullptr==pCandidateB)
const AuthorCharAttr & GetFormatAuthorAttr() const
Definition: modcfg.hxx:251
bool m_bPrintPageBackground
Definition: printdata.hxx:58
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:1691
#define FN_PARAM_CRSR_IN_PROTECTED
Definition: cmdid.h:799
void SetCompareMode(SwCompareMode eMode)
Definition: modcfg.hxx:368
void DrawRect(const tools::Rectangle &rRect)
bool m_bPrintTextPlaceholder
Definition: printdata.hxx:58
const SfxItemSet & GetItemSet() const
std::unique_ptr< weld::CheckButton > m_xVRulerCBox
Definition: optpage.hxx:40
SwCompareMode
Definition: modcfg.hxx:87
#define SAL_N_ELEMENTS(arr)
static FieldUnit GetValue(sal_uInt32 i)
Definition: optload.cxx:71
SwCompareOptionsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:1975
void SetFax(const std::vector< OUString > &)
Definition: optpage.cxx:443
bool m_bTest8
Definition: cfgitems.hxx:148
void SetTableChgMode(TableChgMode eMode)
Definition: edtab.cxx:287
std::unique_ptr< weld::RadioButton > m_xVarRB
Definition: optpage.hxx:200
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
void SetFontIndex(const OUString &rSet, sal_uInt8 nFontGroup)
Definition: fontcfg.hxx:99
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2587
std::unique_ptr< weld::CheckButton > m_xTest7CBox
Definition: optpage.hxx:350
void SetLineColor()
bool m_bTable
Definition: cfgitems.hxx:76
std::unique_ptr< weld::ComboBox > m_xMarkPosLB
Definition: optpage.hxx:303
void clear()
SwFillMode GetMode() const
Definition: cfgitems.hxx:126
std::unique_ptr< weld::MetricSpinButton > m_xRowInsertMF
Definition: optpage.hxx:195
tools::Rectangle aLeftPagePrtArea
Definition: optpage.hxx:267
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: optpage.cxx:458
#define SW_MOD()
Definition: swmodule.hxx:256
bool m_bVertRuler
Definition: cfgitems.hxx:70
#define COL_NONE_COLOR
std::unique_ptr< weld::CheckButton > m_xShowInlineTooltips
Definition: optpage.hxx:55
FontPitch GetPitch()
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetIgnorePieces(bool b)
Definition: modcfg.hxx:376
std::unique_ptr< weld::CheckButton > m_xTabCB
Definition: optpage.hxx:227
bool IsInsTableFormatNum(bool bHTML) const
Definition: modcfg.hxx:280
bool m_bPrintLeftPages
Definition: printdata.hxx:58
int i
const OUString & GetFontIndex(sal_uInt8 nFontGroup) const
Definition: fontcfg.hxx:85
std::unique_ptr< weld::CheckButton > m_xSmoothCBox
Definition: optpage.hxx:43
Subgroup headings.
Definition: poolfmt.hxx:261
bool m_bTest6
Definition: cfgitems.hxx:146
bool IsStoreRsid() const
Definition: modcfg.hxx:383
std::unique_ptr< weld::RadioButton > m_xEndRB
Definition: optpage.hxx:93
OUString m_sScriptAsian
Definition: optpage.hxx:147
SwAddPrinterTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:265
std::unique_ptr< weld::RadioButton > m_xFixRB
Definition: optpage.hxx:198
std::unique_ptr< weld::CheckButton > m_xSHyphCB
Definition: optpage.hxx:224
OUString m_sShellList
Definition: optpage.hxx:121
void SetSize(const Size &rSize)
SfxBindings & GetBindings()
#define FN_PARAM_WRTSHELL
Definition: cmdid.h:786
std::unique_ptr< weld::CheckButton > m_xPrintEmptyPagesCB
Definition: optpage.hxx:97
void SetInsTableFlags(bool bHTML, const SwInsertTableOptions &rOpts)
Definition: modcfg.hxx:303
HTMLMODE_ON
std::unique_ptr< weld::RadioButton > m_xInMarginsRB
Definition: optpage.hxx:95
std::unique_ptr< weld::ComboBox > m_xDirectCursorFillMode
Definition: optpage.hxx:237
bool m_bPrintDraw
Definition: printdata.hxx:58
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:1250
void SetFillColor()
WEIGHT_NORMAL
std::unique_ptr< weld::RadioButton > m_xEndPageRB
Definition: optpage.hxx:94
virtual ~SwAddPrinterTabPage() override
Definition: optpage.cxx:327
bool m_bPrintTable
Definition: printdata.hxx:58
LINESTYLE_SINGLE
std::unique_ptr< weld::RadioButton > m_xAutoRB
Definition: optpage.hxx:362
long Bottom() const
#define FN_PARAM_STDFONTS
Definition: cmdid.h:784
Color m_aLineCol
Definition: optpage.hxx:261
bool m_bSetLabelDefault
Definition: optpage.hxx:135
bool m_bTest9
Definition: cfgitems.hxx:149
static void lcl_SetColl(SwWrtShell *pWrtShell, sal_uInt16 nType, SfxPrinter const *pPrt, const OUString &rStyle, sal_uInt16 nFontWhich)
Definition: optpage.cxx:550
std::unique_ptr< ColorListBox > m_xChangedColorLB
Definition: optpage.hxx:299
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:224
sal_uInt16 GetTableVInsert() const
Definition: modcfg.hxx:239
std::unique_ptr< weld::CustomWeld > m_xDeletedPreview
Definition: optpage.hxx:296
void SetStoreRsid(bool bStoreRsid)
Definition: modcfg.hxx:387
#define FONT_INDEX
Definition: fontcfg.hxx:31
bool IsInside(const Point &rPOINT) const
bool m_bPrintControl
Definition: printdata.hxx:58
std::unique_ptr< weld::Label > m_xTabLabel
Definition: optpage.hxx:228
sal_uInt16 m_nItemId
Definition: authratr.hxx:29
std::unique_ptr< FontSizeBox > m_xLabelHeightLB
Definition: optpage.hxx:158
LanguageType m_eLanguage
Definition: optpage.hxx:129
virtual void set_active(int pos)=0
void SetMarkAlignColor(const Color &rColor)
Definition: modcfg.hxx:260
OUString SwResId(const char *pId)
Definition: swmodule.cxx:178
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:571
ITALIC_NONE
virtual ~SwStdFontTabPage() override
Definition: optpage.cxx:530
tools::Rectangle aPage
Definition: optpage.hxx:266
virtual ~SwCompareOptionsTabPage() override
Definition: optpage.cxx:1993
bool m_bShowInlineTooltips
Definition: cfgitems.hxx:80
const OUString & GetFontOutline(sal_uInt8 nFontGroup) const
Definition: fontcfg.hxx:82
std::unique_ptr< weld::CheckButton > m_xTest2CBox
Definition: optpage.hxx:345
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
SfxItemPool * GetPool() const
std::unique_ptr< weld::CheckButton > m_xPaperFromSetupCB
Definition: optpage.hxx:98
void SetOutputSizePixel(const Size &rSize)
#define FONT_GROUP_CJK
Definition: fontcfg.hxx:47
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:184
virtual ~SwShdwCursorOptionsTabPage() override
Definition: optpage.cxx:1234
OUString m_sShellIndex
Definition: optpage.hxx:123
std::unique_ptr< weld::CheckButton > m_xIgnoreCB
Definition: optpage.hxx:366
bool m_bPrintBlackFont
Definition: printdata.hxx:58
Color m_nColor
Definition: authratr.hxx:31
static const std::vector< OUString > & GetPrinterQueues()
std::unique_ptr< weld::RadioButton > m_xWordRB
Definition: optpage.hxx:363
void SetMarkAlignMode(sal_uInt16 nMode)
Definition: modcfg.hxx:256
#define FN_TABLE_MODE_FIX_PROP
Definition: cmdid.h:423
TableChgMode GetTableMode() const
Definition: modcfg.hxx:223
std::unique_ptr< weld::ComboBox > m_xVMetric
Definition: optpage.hxx:42
std::unique_ptr< weld::CheckButton > m_xTest10CBox
Definition: optpage.hxx:353
SwWrtShell * GetValue() const
Definition: swwrtshitem.hxx:36
std::unique_ptr< weld::Widget > m_xCommentsFrame
Definition: optpage.hxx:90
bool m_bGraphic
Definition: cfgitems.hxx:77
SwContentOptPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:85
bool m_bTest5
Definition: cfgitems.hxx:145
std::unique_ptr< weld::CustomWeld > m_xMarkPreview
Definition: optpage.hxx:306
void PaintPage(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: optpage.cxx:1479
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:1013
const OUString & GetFamilyName() const
void SetTableVInsert(sal_uInt16 nSet)
Definition: modcfg.hxx:240
std::unique_ptr< FontList > m_pFontList
Definition: optpage.hxx:126
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetCaseMap(const SvxCaseMap eNew)
SwStdFontTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:478
OUString m_sScriptWestern
Definition: optpage.hxx:146
sal_uInt32 GetHeight() const
Color const & GetSelectEntryColor() const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:338
default, fill with tabs
std::unique_ptr< weld::CheckButton > m_xTest8CBox
Definition: optpage.hxx:351
std::unique_ptr< weld::CheckButton > m_xCharHiddenCB
Definition: optpage.hxx:230
long CalcToUnit(float nIn, MapUnit eUnit)
bool m_bSmoothScroll
Definition: cfgitems.hxx:72
long AdjustRight(long nHorzMoveDelta)
const OUString & GetFontStandard(sal_uInt8 nFontGroup) const
Definition: fontcfg.hxx:81
bool m_bPaperFromSetup
Definition: printdata.hxx:58
virtual ~SwTestTabPage() override
Definition: optpage.cxx:2125
std::unique_ptr< weld::Label > m_xSettingsLabel
Definition: optpage.hxx:51
bool m_bFieldHiddenText
Definition: cfgitems.hxx:81
std::unique_ptr< weld::ComboBox > m_xHMetric
Definition: optpage.hxx:39
std::unique_ptr< weld::CheckButton > m_xOnOffCB
Definition: optpage.hxx:235
OUString m_sShellTitle
Definition: optpage.hxx:120
bool bCharHiddenText
Definition: cfgitems.hxx:52
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
std::unique_ptr< weld::Label > m_xLabelFT
Definition: optpage.hxx:150
SwTableOptionsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:984
std::unique_ptr< SvxFontPrevWindow > m_xInsertedPreviewWN
Definition: optpage.hxx:290
ITALIC_NORMAL
void SetTableMode(TableChgMode eSet)
Definition: modcfg.hxx:224
static SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
unsigned char sal_uInt8
std::unique_ptr< weld::ComboBox > m_xFaxLB
Definition: optpage.hxx:99
void SetTableVMove(sal_uInt16 nSet)
Definition: modcfg.hxx:232
bool m_bPrintHiddenText
Definition: printdata.hxx:58
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: optpage.cxx:1509
std::unique_ptr< weld::RadioButton > m_xCharRB
Definition: optpage.hxx:364
std::unique_ptr< weld::Frame > m_xCursorProtFrame
Definition: optpage.hxx:238
Color m_aTransCol
Definition: optpage.hxx:259
bool m_bTest3
Definition: cfgitems.hxx:143
std::unique_ptr< weld::CheckButton > m_xTest6CBox
Definition: optpage.hxx:349
void SetInsertAuthorAttr(AuthorCharAttr const &rAttr)
Definition: modcfg.hxx:244
void SetFontHeight(sal_Int32 nHeight, sal_uInt8 nFont, sal_uInt8 nScriptType)
Definition: fontcfg.hxx:102
static Color & GetFontColor()
Definition: viewopt.cxx:425
std::unique_ptr< weld::MetricSpinButton > m_xColInsertMF
Definition: optpage.hxx:196
bool m_bTest10
Definition: cfgitems.hxx:150
LanguageType GetAppLanguage()
Definition: init.cxx:729
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:175
std::unique_ptr< FontSizeBox > m_xIndexHeightLB
Definition: optpage.hxx:160
static OUString GetString(sal_uInt32 i)
Definition: optload.cxx:64
SwCompareMode GetCompareMode() const
Definition: modcfg.hxx:367
void SetColor(const Color &rColor)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
sal_uInt16 GetPieceLen() const
Definition: modcfg.hxx:379
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:1238
static VclPtr< reference_type > Create(Arg &&...arg)
std::unique_ptr< weld::Widget > m_xPagesFrame
Definition: optpage.hxx:84
void SetUseRsid(bool b)
Definition: modcfg.hxx:372
void SetTableHMove(sal_uInt16 nSet)
Definition: modcfg.hxx:228
void SetPreview(bool bPrev)
Definition: optpage.cxx:331
std::unique_ptr< weld::CheckButton > m_xHeaderCB
Definition: optpage.hxx:183
sal_uInt16 GetTableHInsert() const
Definition: modcfg.hxx:235
std::unique_ptr< weld::RadioButton > m_xFixPropRB
Definition: optpage.hxx:199
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea)
bool m_bPrintEmptyPages
Print empty pages.
Definition: printdata.hxx:58
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:377
const SvxFontItem & GetCTLFont(bool=true) const
Definition: charatr.hxx:129
const Color & GetWindowColor() const
std::unique_ptr< weld::CheckButton > m_xCrossCB
Definition: optpage.hxx:37
std::unique_ptr< weld::CheckButton > m_xRsidCB
Definition: optpage.hxx:365
std::unique_ptr< FontSizeBox > m_xTitleHeightLB
Definition: optpage.hxx:154
long CalcToPoint(long nIn, MapUnit eUnit, sal_uInt16 nFactor)
static void InitFontStyle(SvxFontPrevWindow &rExampleWin, const OUString &rText)
Definition: optpage.cxx:1931
virtual OUString get_id(int pos) const =0
std::unique_ptr< weld::CheckButton > m_xSpacesCB
Definition: optpage.hxx:225
long Left() const
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
std::unique_ptr< weld::RadioButton > m_xNoRB
Definition: optpage.hxx:91
bool bNonbreakingSpace
Definition: cfgitems.hxx:50
OUString m_sShellStd
Definition: optpage.hxx:119
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: fmtcol.cxx:366
std::unique_ptr< weld::CheckButton > m_xTest5CBox
Definition: optpage.hxx:348
bool m_bTest2
Definition: cfgitems.hxx:142
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: optpage.cxx:1177
std::unique_ptr< weld::CheckButton > m_xBreakCB
Definition: optpage.hxx:229
std::unique_ptr< ColorListBox > m_xMarkColorLB
Definition: optpage.hxx:304
void SetMode(SwFillMode eM)
Definition: cfgitems.hxx:129
std::unique_ptr< weld::CheckButton > m_xRightPageCB
Definition: optpage.hxx:86
SwShdwCursorOptionsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:1184
IMPL_LINK_NOARG(SwAddPrinterTabPage, AutoClickHdl, weld::ToggleButton &, void)
Definition: optpage.cxx:429
std::unique_ptr< weld::RadioButton > m_xOnlyRB
Definition: optpage.hxx:92
#define FN_PARAM_SWTEST
Definition: cmdid.h:758
std::unique_ptr< weld::CheckButton > m_xProspectCB_RTL
Definition: optpage.hxx:88
static sal_uInt32 Count()
Definition: optload.cxx:59
void SetFontOutline(const OUString &rSet, sal_uInt8 nFontGroup)
Definition: fontcfg.hxx:93
std::unique_ptr< FontSizeBox > m_xStandardHeightLB
Definition: optpage.hxx:152
std::unique_ptr< weld::SpinButton > m_xLenNF
Definition: optpage.hxx:367
std::unique_ptr< weld::CheckButton > m_xNumFormattingCB
Definition: optpage.hxx:188
std::unique_ptr< weld::CheckButton > m_xHSpacesCB
Definition: optpage.hxx:226
static sal_uInt16 aChangedAttrMap[]
Definition: optpage.cxx:1379
static SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
std::unique_ptr< weld::CheckButton > m_xPrintHiddenTextCB
Definition: optpage.hxx:81
#define FN_TABLE_MODE_VARIABLE
Definition: cmdid.h:424
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:160
TableChgMode
Definition: tblenum.hxx:46
std::unique_ptr< weld::Frame > m_xDirectCursorFrame
Definition: optpage.hxx:234
std::unique_ptr< weld::Label > m_xMetricLabel
Definition: optpage.hxx:52
#define FN_TABLE_MODE_FIX
Definition: cmdid.h:422
LINESTYLE_DOUBLE
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
STRIKEOUT_NONE
SwWrtShell * m_pWrtShell
Definition: optpage.hxx:128
std::unique_ptr< weld::CheckButton > m_xFieldHiddenCB
Definition: optpage.hxx:56
std::unique_ptr< weld::CheckButton > m_xBorderCB
Definition: optpage.hxx:186
sal_uInt8 m_nFontGroup
Definition: optpage.hxx:144
const SwInsertTableOptions & GetInsTableFlags(bool bHTML) const
Definition: modcfg.hxx:301
std::unique_ptr< weld::ComboBox > m_xMetricLB
Definition: optpage.hxx:53
std::unique_ptr< weld::CheckButton > m_xGrfCB
Definition: optpage.hxx:45
bool m_bCrosshair
Definition: cfgitems.hxx:74
static void lcl_SelectMetricLB(weld::ComboBox &rMetric, sal_uInt16 nSID, const SfxItemSet &rSet)
Definition: optpage.cxx:166
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1388
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:2129
virtual void set_size_request(int nWidth, int nHeight)=0
static sal_uInt16 aInsertAttrMap[]
Definition: optpage.cxx:1371
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
static sal_Int32 GetDefaultHeightFor(sal_uInt16 nFontType, LanguageType eLang)
Definition: fontcfg.cxx:248
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:1614
sal_uInt16 GetMarkAlignMode() const
Definition: modcfg.hxx:255
std::unique_ptr< weld::CheckButton > m_xPrintTextPlaceholderCB
Definition: optpage.hxx:82
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: optpage.cxx:1243
std::unique_ptr< weld::ComboBox > m_xInsertLB
Definition: optpage.hxx:288
const AuthorCharAttr & GetDeletedAuthorAttr() const
Definition: modcfg.hxx:247
void Fill(const FontMetric *pFontMetric, const FontList *pList)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
SwWrtShell * m_pWrtShell
Definition: optpage.hxx:180
virtual ~SwMarkPreview() override
Definition: optpage.cxx:1391
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:2156
bool m_bVertRulerRight
Definition: cfgitems.hxx:71
std::unique_ptr< weld::MetricSpinButton > m_xRowMoveMF
Definition: optpage.hxx:192
std::unique_ptr< weld::CheckButton > m_xBlackFontCB
Definition: optpage.hxx:80
void SetPreviewText(const OUString &rString)
Color m_aBgCol
Definition: optpage.hxx:258
std::unique_ptr< ColorListBox > m_xDeletedColorLB
Definition: optpage.hxx:294
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:2048
Color m_aPrintAreaCol
Definition: optpage.hxx:264
SwPostItMode m_nPrintPostIts
Definition: printdata.hxx:68
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:385
virtual ~SwContentOptPage() override
Definition: optpage.cxx:156
IMPL_LINK(SwContentOptPage, VertRulerHdl, weld::ToggleButton &, rBox, void)
Definition: optpage.cxx:259
bool m_bLabelDefault
Definition: optpage.hxx:134
rtl_TextEncoding GetCharSet() const
sal_uInt16 nPos
std::unique_ptr< weld::ComboBox > m_xChangedLB
Definition: optpage.hxx:298
std::unique_ptr< weld::MetricSpinButton > m_xColMoveMF
Definition: optpage.hxx:193
bool m_bTest1
Definition: cfgitems.hxx:141
virtual OUString get_active_text() const =0
void SetInsTableChangeNumFormat(bool bHTML, bool b)
Definition: modcfg.hxx:289
std::unique_ptr< weld::CheckButton > m_xBackgroundCB
Definition: optpage.hxx:79
std::unique_ptr< weld::CheckButton > m_xTest9CBox
Definition: optpage.hxx:352
OUString m_sScriptComplex
Definition: optpage.hxx:148
bool IsVerticalTextEnabled() const
std::unique_ptr< weld::CheckButton > m_xNumFormatFormattingCB
Definition: optpage.hxx:189