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