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_xShowOutlineContentVisibilityButton(m_xBuilder->weld_check_button("outlinecontentvisibilitybutton"))
104 , m_xTreatSubOutlineLevelsAsContent(m_xBuilder->weld_check_button("suboutlinelevelsascontent"))
105 , m_xShowChangesInMargin(m_xBuilder->weld_check_button("changesinmargin"))
106 , m_xFieldHiddenCB(m_xBuilder->weld_check_button("hiddentextfield"))
107 , m_xFieldHiddenParaCB(m_xBuilder->weld_check_button("hiddenparafield"))
108{
109 m_xShowOutlineContentVisibilityButton->connect_toggled(LINK(this, SwContentOptPage, ShowOutlineContentVisibilityButtonHdl));
110
111 /* This part is visible only with Writer/Web->View dialogue. */
112 const SfxUInt16Item* pItem = rCoreSet.GetItemIfSet(SID_HTML_MODE, false );
113 if (!pItem || !(pItem->GetValue() & HTMLMODE_ON))
114 {
115 m_xSettingsFrame->hide();
116 m_xSettingsLabel->hide();
117 m_xMetricLabel->hide();
118 m_xMetricLB->hide();
119 }
120
122 m_xVRulerRightCBox->hide();
123 m_xVRulerCBox->connect_toggled(LINK(this, SwContentOptPage, VertRulerHdl ));
124
125 for (size_t i = 0; i < SwFieldUnitTable::Count(); ++i)
126 {
127 const OUString sMetric = SwFieldUnitTable::GetString(i);
129
130 switch ( eFUnit )
131 {
132 case FieldUnit::MM:
133 case FieldUnit::CM:
134 case FieldUnit::POINT:
135 case FieldUnit::PICA:
136 case FieldUnit::INCH:
137 case FieldUnit::CHAR: // add two units , 'character' and 'line' , their ticks are not fixed
138 case FieldUnit::LINE:
139 {
140 // only use these metrics
141 // a horizontal ruler has not the 'line' unit
142 // there isn't 'line' unit in HTML format
143 if (eFUnit != FieldUnit::LINE)
144 {
145 m_xMetricLB->append(OUString::number(static_cast<sal_uInt32>(eFUnit)), sMetric);
146 m_xHMetric->append(OUString::number(static_cast<sal_uInt32>(eFUnit)), sMetric);
147 }
148 // a vertical ruler has not the 'character' unit
149 if (eFUnit != FieldUnit::CHAR)
150 {
151 m_xVMetric->append(OUString::number(static_cast<sal_uInt32>(eFUnit)), sMetric);
152 }
153 break;
154 }
155 default:;//prevent warning
156 }
157 }
158}
159
161{
162}
163
164std::unique_ptr<SfxTabPage> SwContentOptPage::Create( weld::Container* pPage, weld::DialogController* pController,
165 const SfxItemSet* rAttrSet)
166{
167 return std::make_unique<SwContentOptPage>(pPage, pController, *rAttrSet);
168}
169
171{
172 const SfxPoolItem* pItem;
173 if( rSet.GetItemState( nSID, false, &pItem ) >= SfxItemState::DEFAULT )
174 {
175 FieldUnit eFieldUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
176 for (sal_Int32 i = 0, nEntryCount = rMetric.get_count(); i < nEntryCount; ++i)
177 {
178 if (rMetric.get_id(i).toUInt32() == static_cast<sal_uInt32>(eFieldUnit))
179 {
180 rMetric.set_active(i);
181 break;
182 }
183 }
184 }
185 rMetric.save_value();
186}
187
189{
190 const SwElemItem* pElemAttr = rSet->GetItemIfSet( FN_PARAM_ELEM , false );
191 if(pElemAttr)
192 {
193 m_xTableCB->set_active(pElemAttr->m_bTable);
194 m_xGrfCB->set_active(pElemAttr->m_bGraphic);
195 m_xDrwCB->set_active(pElemAttr->m_bDrawing);
196 m_xPostItCB->set_active(pElemAttr->m_bNotes);
197 m_xCrossCB->set_active(pElemAttr->m_bCrosshair);
198 m_xVRulerCBox->set_active(pElemAttr->m_bVertRuler);
199 m_xVRulerRightCBox->set_active(pElemAttr->m_bVertRulerRight);
200 m_xSmoothCBox->set_active(pElemAttr->m_bSmoothScroll);
201 m_xShowInlineTooltips->set_active(pElemAttr->m_bShowInlineTooltips);
205 m_xShowChangesInMargin->set_active(pElemAttr->m_bShowChangesInMargin);
206 m_xFieldHiddenCB->set_active( pElemAttr->m_bFieldHiddenText );
207 m_xFieldHiddenParaCB->set_active( pElemAttr->m_bShowHiddenPara );
208 }
209 m_xMetricLB->set_active(-1);
210 lcl_SelectMetricLB(*m_xMetricLB, SID_ATTR_METRIC, *rSet);
213}
214
216{
217 const SwElemItem* pOldAttr = GetOldItem(GetItemSet(), FN_PARAM_ELEM);
218
219 SwElemItem aElem;
220 aElem.m_bTable = m_xTableCB->get_active();
221 aElem.m_bGraphic = m_xGrfCB->get_active();
222 aElem.m_bDrawing = m_xDrwCB->get_active();
223 aElem.m_bNotes = m_xPostItCB->get_active();
224 aElem.m_bCrosshair = m_xCrossCB->get_active();
225 aElem.m_bVertRuler = m_xVRulerCBox->get_active();
226 aElem.m_bVertRulerRight = m_xVRulerRightCBox->get_active();
227 aElem.m_bSmoothScroll = m_xSmoothCBox->get_active();
228 aElem.m_bShowInlineTooltips = m_xShowInlineTooltips->get_active();
232 aElem.m_bFieldHiddenText = m_xFieldHiddenCB->get_active();
233 aElem.m_bShowHiddenPara = m_xFieldHiddenParaCB->get_active();
234
235 bool bRet = !pOldAttr || aElem != *pOldAttr;
236 if(bRet)
237 bRet = nullptr != rSet->Put(aElem);
238
239 sal_Int32 nMPos = m_xMetricLB->get_active();
240 sal_Int32 nGlobalMetricPos = nMPos;
241 if ( m_xMetricLB->get_value_changed_from_saved() )
242 {
243 const sal_uInt16 nFieldUnit = m_xMetricLB->get_id(nMPos).toUInt32();
244 rSet->Put( SfxUInt16Item( SID_ATTR_METRIC, nFieldUnit ) );
245 bRet = true;
246 }
247
248 nMPos = m_xHMetric->get_active();
249 if ( m_xHMetric->get_value_changed_from_saved() || nMPos != nGlobalMetricPos )
250 {
251 const sal_uInt16 nFieldUnit = m_xHMetric->get_id(nMPos).toUInt32();
252 rSet->Put( SfxUInt16Item( FN_HSCROLL_METRIC, nFieldUnit ) );
253 bRet = true;
254 }
255 nMPos = m_xVMetric->get_active();
256 if ( m_xVMetric->get_value_changed_from_saved() || nMPos != nGlobalMetricPos )
257 {
258 const sal_uInt16 nFieldUnit = m_xVMetric->get_id(nMPos).toUInt32();
259 rSet->Put( SfxUInt16Item( FN_VSCROLL_METRIC, nFieldUnit ) );
260 bRet = true;
261 }
262
263 return bRet;
264}
265
266IMPL_LINK(SwContentOptPage, VertRulerHdl, weld::Toggleable&, rBox, void)
267{
268 m_xVRulerRightCBox->set_sensitive(rBox.get_sensitive() && rBox.get_active());
269}
270
271IMPL_LINK(SwContentOptPage, ShowOutlineContentVisibilityButtonHdl, weld::Toggleable&, rBox, void)
272{
273 m_xTreatSubOutlineLevelsAsContent->set_sensitive(rBox.get_active());
274}
275
276// TabPage Printer additional settings
278 const SfxItemSet& rCoreSet)
279 : SfxTabPage(pPage, pController, "modules/swriter/ui/printoptionspage.ui", "PrintOptionsPage", &rCoreSet)
280 , m_sNone(SwResId(SW_STR_NONE))
281 , m_bAttrModified(false)
282 , m_bPreview(false)
283 , m_xGrfCB(m_xBuilder->weld_check_button("graphics"))
284 , m_xCtrlFieldCB(m_xBuilder->weld_check_button("formcontrols"))
285 , m_xBackgroundCB(m_xBuilder->weld_check_button("background"))
286 , m_xBlackFontCB(m_xBuilder->weld_check_button("inblack"))
287 , m_xPrintHiddenTextCB(m_xBuilder->weld_check_button("hiddentext"))
288 , m_xPrintTextPlaceholderCB(m_xBuilder->weld_check_button("textplaceholder"))
289 , m_xPagesFrame(m_xBuilder->weld_widget("pagesframe"))
290 , m_xLeftPageCB(m_xBuilder->weld_check_button("leftpages"))
291 , m_xRightPageCB(m_xBuilder->weld_check_button("rightpages"))
292 , m_xProspectCB(m_xBuilder->weld_check_button("brochure"))
293 , m_xProspectCB_RTL(m_xBuilder->weld_check_button("rtl"))
294 , m_xCommentsFrame(m_xBuilder->weld_widget("commentsframe"))
295 , m_xNoRB(m_xBuilder->weld_radio_button("none"))
296 , m_xOnlyRB(m_xBuilder->weld_radio_button("only"))
297 , m_xEndRB(m_xBuilder->weld_radio_button("end"))
298 , m_xEndPageRB(m_xBuilder->weld_radio_button("endpage"))
299 , m_xInMarginsRB(m_xBuilder->weld_radio_button("inmargins"))
300 , m_xPrintEmptyPagesCB(m_xBuilder->weld_check_button("blankpages"))
301 , m_xPaperFromSetupCB(m_xBuilder->weld_check_button("papertray"))
302 , m_xFaxLB(m_xBuilder->weld_combo_box("fax"))
303{
304 Link<weld::Toggleable&,void> aLk = LINK( this, SwAddPrinterTabPage, AutoClickHdl);
305 m_xGrfCB->connect_toggled( aLk );
306 m_xRightPageCB->connect_toggled( aLk );
307 m_xLeftPageCB->connect_toggled( aLk );
308 m_xCtrlFieldCB->connect_toggled( aLk );
309 m_xBackgroundCB->connect_toggled( aLk );
310 m_xBlackFontCB->connect_toggled( aLk );
311 m_xPrintHiddenTextCB->connect_toggled( aLk );
312 m_xPrintTextPlaceholderCB->connect_toggled( aLk );
313 m_xProspectCB->connect_toggled( aLk );
314 m_xProspectCB_RTL->connect_toggled( aLk );
315 m_xPaperFromSetupCB->connect_toggled( aLk );
316 m_xPrintEmptyPagesCB->connect_toggled( aLk );
317 m_xEndPageRB->connect_toggled( aLk );
318 m_xInMarginsRB->connect_toggled( aLk );
319 m_xEndRB->connect_toggled( aLk );
320 m_xOnlyRB->connect_toggled( aLk );
321 m_xNoRB->connect_toggled( aLk );
322 m_xFaxLB->connect_changed( LINK( this, SwAddPrinterTabPage, SelectHdl ) );
323
324 const SfxUInt16Item* pItem = rCoreSet.GetItemIfSet(SID_HTML_MODE, false );
325 if(pItem && pItem->GetValue() & HTMLMODE_ON)
326 {
327 m_xLeftPageCB->hide();
328 m_xRightPageCB->hide();
329 m_xPrintHiddenTextCB->hide();
331 m_xPrintEmptyPagesCB->hide();
332 }
333 m_xProspectCB_RTL->set_sensitive(false);
334 SvtCTLOptions aCTLOptions;
336}
337
339{
340}
341
343{
344 m_bPreview = bPrev;
345 m_xCommentsFrame->set_sensitive(!m_bPreview);
346 m_xPagesFrame->set_sensitive(!m_bPreview);
347}
348
349std::unique_ptr<SfxTabPage> SwAddPrinterTabPage::Create( weld::Container* pPage, weld::DialogController* pController,
350 const SfxItemSet* rAttrSet )
351{
352 return std::make_unique<SwAddPrinterTabPage>(pPage, pController, *rAttrSet);
353}
354
356{
357 if ( m_bAttrModified )
358 {
359 SwAddPrinterItem aAddPrinterAttr;
360 aAddPrinterAttr.m_bPrintGraphic = m_xGrfCB->get_active();
361 aAddPrinterAttr.m_bPrintTable = true; // always enabled since CWS printerpullgpages /*m_xTabCB->get_active();*/
362 aAddPrinterAttr.m_bPrintDraw = m_xGrfCB->get_active(); // UI merged with m_xGrfCB in CWS printerpullgpages
363 aAddPrinterAttr.m_bPrintControl = m_xCtrlFieldCB->get_active();
364 aAddPrinterAttr.m_bPrintPageBackground = m_xBackgroundCB->get_active();
365 aAddPrinterAttr.m_bPrintBlackFont = m_xBlackFontCB->get_active();
366 aAddPrinterAttr.m_bPrintHiddenText = m_xPrintHiddenTextCB->get_active();
367 aAddPrinterAttr.m_bPrintTextPlaceholder = m_xPrintTextPlaceholderCB->get_active();
368
369 aAddPrinterAttr.m_bPrintLeftPages = m_xLeftPageCB->get_active();
370 aAddPrinterAttr.m_bPrintRightPages = m_xRightPageCB->get_active();
371 aAddPrinterAttr.m_bPrintReverse = false; // handled by vcl itself since CWS printerpullpages /*m_xReverseCB->get_active()*/;
372 aAddPrinterAttr.m_bPrintProspect = m_xProspectCB->get_active();
373 aAddPrinterAttr.m_bPrintProspectRTL = m_xProspectCB_RTL->get_active();
374 aAddPrinterAttr.m_bPaperFromSetup = m_xPaperFromSetupCB->get_active();
375 aAddPrinterAttr.m_bPrintEmptyPages = m_xPrintEmptyPagesCB->get_active();
376 aAddPrinterAttr.m_bPrintSingleJobs = true; // handled by vcl in new print dialog since CWS printerpullpages /*m_xSingleJobsCB->get_active()*/;
377
378 if (m_xNoRB->get_active()) aAddPrinterAttr.m_nPrintPostIts =
380 if (m_xOnlyRB->get_active()) aAddPrinterAttr.m_nPrintPostIts =
382 if (m_xEndRB->get_active()) aAddPrinterAttr.m_nPrintPostIts =
384 if (m_xEndPageRB->get_active()) aAddPrinterAttr.m_nPrintPostIts =
386 if (m_xInMarginsRB->get_active()) aAddPrinterAttr.m_nPrintPostIts =
388
389 const OUString sFax = m_xFaxLB->get_active_text();
390 aAddPrinterAttr.m_sFaxName = m_sNone == sFax ? OUString() : sFax;
391 rCoreSet->Put(aAddPrinterAttr);
392 }
393 return m_bAttrModified;
394}
395
397{
398 const SfxItemSet& rSet = GetItemSet();
399
400 if( const SwAddPrinterItem* pAddPrinterAttr = rSet.GetItemIfSet( FN_PARAM_ADDPRINTER , false ) )
401 {
402 m_xGrfCB->set_active(pAddPrinterAttr->m_bPrintGraphic || pAddPrinterAttr->m_bPrintDraw);
403 m_xCtrlFieldCB->set_active( pAddPrinterAttr->m_bPrintControl);
404 m_xBackgroundCB->set_active( pAddPrinterAttr->m_bPrintPageBackground);
405 m_xBlackFontCB->set_active( pAddPrinterAttr->m_bPrintBlackFont);
406 m_xPrintHiddenTextCB->set_active( pAddPrinterAttr->m_bPrintHiddenText);
407 m_xPrintTextPlaceholderCB->set_active(pAddPrinterAttr->m_bPrintTextPlaceholder);
408 m_xLeftPageCB->set_active( pAddPrinterAttr->m_bPrintLeftPages);
409 m_xRightPageCB->set_active( pAddPrinterAttr->m_bPrintRightPages);
410 m_xPaperFromSetupCB->set_active(pAddPrinterAttr->m_bPaperFromSetup);
411 m_xPrintEmptyPagesCB->set_active(pAddPrinterAttr->m_bPrintEmptyPages);
412 m_xProspectCB->set_active( pAddPrinterAttr->m_bPrintProspect);
413 m_xProspectCB_RTL->set_active( pAddPrinterAttr->m_bPrintProspectRTL);
414
415 m_xNoRB->set_active(pAddPrinterAttr->m_nPrintPostIts== SwPostItMode::NONE ) ;
416 m_xOnlyRB->set_active(pAddPrinterAttr->m_nPrintPostIts== SwPostItMode::Only ) ;
417 m_xEndRB->set_active(pAddPrinterAttr->m_nPrintPostIts== SwPostItMode::EndDoc ) ;
418 m_xEndPageRB->set_active(pAddPrinterAttr->m_nPrintPostIts== SwPostItMode::EndPage ) ;
419 m_xInMarginsRB->set_active(pAddPrinterAttr->m_nPrintPostIts== SwPostItMode::InMargins ) ;
420 auto nFound = m_xFaxLB->find_text(pAddPrinterAttr->m_sFaxName);
421 if (nFound != -1)
422 m_xFaxLB->set_active(nFound);
423 else if (m_xFaxLB->get_count())
424 m_xFaxLB->set_active(0);
425 }
426 if (m_xProspectCB->get_active())
427 {
428 m_xProspectCB_RTL->set_sensitive(true);
429 m_xNoRB->set_sensitive( false );
430 m_xOnlyRB->set_sensitive( false );
431 m_xEndRB->set_sensitive( false );
432 m_xEndPageRB->set_sensitive( false );
433 }
434 else
435 m_xProspectCB_RTL->set_sensitive( false );
436}
437
439{
440 m_bAttrModified = true;
441 bool bIsProspect = m_xProspectCB->get_active();
442 if (!bIsProspect)
443 m_xProspectCB_RTL->set_active( false );
444 m_xProspectCB_RTL->set_sensitive( bIsProspect );
445 m_xNoRB->set_sensitive( !bIsProspect );
446 m_xOnlyRB->set_sensitive( !bIsProspect );
447 m_xEndRB->set_sensitive( !bIsProspect );
448 m_xEndPageRB->set_sensitive( !bIsProspect );
449 m_xInMarginsRB->set_sensitive( !bIsProspect );
450}
451
452void SwAddPrinterTabPage::SetFax( const std::vector<OUString>& rFaxLst )
453{
454 m_xFaxLB->append_text(m_sNone);
455 for(const auto & i : rFaxLst)
456 {
457 m_xFaxLB->append_text(i);
458 }
459 m_xFaxLB->set_active(0);
460}
461
463{
464 m_bAttrModified=true;
465}
466
468{
469 const SfxBoolItem* pListItem = aSet.GetItem<SfxBoolItem>(SID_FAX_LIST, false);
470 const SfxBoolItem* pPreviewItem = aSet.GetItem<SfxBoolItem>(SID_PREVIEWFLAG_TYPE, false);
471 if (pPreviewItem)
472 {
473 SetPreview(pPreviewItem->GetValue());
474 Reset(&aSet);
475 }
476 if (pListItem && pListItem->GetValue())
477 {
478 std::vector<OUString> aFaxList;
479 const std::vector<OUString>& rPrinters = Printer::GetPrinterQueues();
480 for (const auto & rPrinter : rPrinters)
481 aFaxList.insert(aFaxList.begin(), rPrinter);
482 SetFax( aFaxList );
483 }
484}
485
486// Tabpage Standardfonts
488 : SfxTabPage(pPage, pController, "modules/swriter/ui/optfonttabpage.ui", "OptFontTabPage", &rSet)
489 , m_pPrt(nullptr)
490 , m_pFontConfig(nullptr)
491 , m_pWrtShell(nullptr)
492 , m_eLanguage( GetAppLanguage() )
493 , m_bListDefault(false)
494 , m_bSetListDefault(true)
495 , m_bLabelDefault(false)
496 , m_bSetLabelDefault(true)
497 , m_bIdxDefault(false)
498 , m_bSetIdxDefault(true)
499 , m_bDisposePrinter(false)
500 , m_nFontGroup(FONT_GROUP_DEFAULT)
501 , m_sScriptWestern(SwResId(ST_SCRIPT_WESTERN))
502 , m_sScriptAsian(SwResId(ST_SCRIPT_ASIAN))
503 , m_sScriptComplex(SwResId(ST_SCRIPT_CTL))
504 , m_xLabelFT(m_xBuilder->weld_label("label1"))
505 , m_xStandardBox(m_xBuilder->weld_combo_box("standardbox"))
506 , m_xStandardHeightLB(new FontSizeBox(m_xBuilder->weld_combo_box("standardheight")))
507 , m_xTitleBox(m_xBuilder->weld_combo_box("titlebox"))
508 , m_xTitleHeightLB(new FontSizeBox(m_xBuilder->weld_combo_box("titleheight")))
509 , m_xListBox(m_xBuilder->weld_combo_box("listbox"))
510 , m_xListHeightLB(new FontSizeBox(m_xBuilder->weld_combo_box("listheight")))
511 , m_xLabelBox(m_xBuilder->weld_combo_box("labelbox"))
512 , m_xLabelHeightLB(new FontSizeBox(m_xBuilder->weld_combo_box("labelheight")))
513 , m_xIdxBox(m_xBuilder->weld_combo_box("idxbox"))
514 , m_xIndexHeightLB(new FontSizeBox(m_xBuilder->weld_combo_box("indexheight")))
515 , m_xStandardPB(m_xBuilder->weld_button("standard"))
516{
517 m_xStandardBox->make_sorted();
518 m_xTitleBox->make_sorted();
519 m_xListBox->make_sorted();
520 m_xLabelBox->make_sorted();
521 m_xIdxBox->make_sorted();
522
523 m_xStandardPB->connect_clicked(LINK(this, SwStdFontTabPage, StandardHdl));
524 m_xStandardBox->connect_changed( LINK(this, SwStdFontTabPage, ModifyHdl));
525 m_xListBox->connect_changed( LINK(this, SwStdFontTabPage, ModifyHdl));
526 m_xLabelBox->connect_changed( LINK(this, SwStdFontTabPage, ModifyHdl));
527 m_xIdxBox->connect_changed( LINK(this, SwStdFontTabPage, ModifyHdl));
528 Link<weld::Widget&,void> aFocusLink = LINK( this, SwStdFontTabPage, LoseFocusHdl);
529 m_xStandardBox->connect_focus_out( aFocusLink );
530 m_xTitleBox->connect_focus_out( aFocusLink );
531 m_xListBox->connect_focus_out( aFocusLink );
532 m_xLabelBox->connect_focus_out( aFocusLink );
533 m_xIdxBox->connect_focus_out( aFocusLink );
534}
535
537{
538 m_xIndexHeightLB.reset();
539 m_xLabelHeightLB.reset();
540 m_xListHeightLB.reset();
541 m_xTitleHeightLB.reset();
542 m_xStandardHeightLB.reset();
543 m_pFontList.reset();
546 else
547 m_pPrt.clear();
548}
549
550std::unique_ptr<SfxTabPage> SwStdFontTabPage::Create( weld::Container* pPage, weld::DialogController* pController,
551 const SfxItemSet* rAttrSet )
552{
553 return std::make_unique<SwStdFontTabPage>(pPage, pController, *rAttrSet);
554}
555
556static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
557 SfxPrinter const * pPrt, const OUString& rStyle,
558 sal_uInt16 nFontWhich)
559{
560 vcl::Font aFont( rStyle, Size( 0, 10 ) );
561 if( pPrt )
562 aFont = pPrt->GetFontMetric( aFont );
563 SwTextFormatColl *pColl = pWrtShell->GetTextCollFromPool(nType);
565 OUString(), aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
566}
567
568static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
569 sal_Int32 nHeight, sal_uInt16 nFontHeightWhich)
570{
571 float fSize = static_cast<float>(nHeight) / 10;
572 nHeight = CalcToUnit( fSize, MapUnit::MapTwip );
573 SwTextFormatColl *pColl = pWrtShell->GetTextCollFromPool(nType);
574 pColl->SetFormatAttr(SvxFontHeightItem(nHeight, 100, nFontHeightWhich));
575}
576
578{
579 SW_MOD()->GetModuleConfig()->SetDefaultFontInCurrDocOnly(false);
580
581 const OUString sStandard = m_xStandardBox->get_active_text();
582 const OUString sTitle = m_xTitleBox->get_active_text();
583 const OUString sList = m_xListBox->get_active_text();
584 const OUString sLabel = m_xLabelBox->get_active_text();
585 const OUString sIdx = m_xIdxBox->get_active_text();
586
587 bool bStandardHeightChanged = m_xStandardHeightLB->get_value_changed_from_saved();
588 bool bTitleHeightChanged = m_xTitleHeightLB->get_value_changed_from_saved();
589 bool bListHeightChanged = m_xListHeightLB->get_value_changed_from_saved();
590 bool bLabelHeightChanged = m_xLabelHeightLB->get_value_changed_from_saved();
591 bool bIndexHeightChanged = m_xIndexHeightLB->get_value_changed_from_saved();
592
598 if(bStandardHeightChanged)
599 {
600 float fSize = static_cast<float>(m_xStandardHeightLB->get_value()) / 10;
601 m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_STANDARD, m_nFontGroup );
602 }
603 if(bTitleHeightChanged)
604 {
605 float fSize = static_cast<float>(m_xTitleHeightLB->get_value()) / 10;
606 m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_OUTLINE, m_nFontGroup );
607 }
608 if(bListHeightChanged)
609 {
610 float fSize = static_cast<float>(m_xListHeightLB->get_value()) / 10;
611 m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_LIST, m_nFontGroup );
612 }
613 if(bLabelHeightChanged)
614 {
615 float fSize = static_cast<float>(m_xLabelHeightLB->get_value()) / 10;
616 m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_CAPTION, m_nFontGroup );
617 }
618 if(bIndexHeightChanged)
619 {
620 float fSize = static_cast<float>(m_xIndexHeightLB->get_value()) / 10;
621 m_pFontConfig->SetFontHeight( CalcToUnit( fSize, MapUnit::MapTwip ), FONT_INDEX, m_nFontGroup );
622 }
623
624 if(m_pWrtShell)
625 {
628 bool bMod = false;
629 const sal_uInt16 nFontWhich =
632 const sal_uInt16 nFontHeightWhich =
635 if(sStandard != m_sShellStd)
636 {
637 vcl::Font aFont( sStandard, Size( 0, 10 ) );
638 if( pPrinter )
639 aFont = pPrinter->GetFontMetric( aFont );
641 OUString(), aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
643 pColl->ResetFormatAttr(nFontWhich);
644 bMod = true;
645 }
646 if(bStandardHeightChanged)
647 {
648 float fSize = static_cast<float>(m_xStandardHeightLB->get_value()) / 10;
649 m_pWrtShell->SetDefault(SvxFontHeightItem( CalcToUnit( fSize, MapUnit::MapTwip ), 100, nFontHeightWhich ) );
651 pColl->ResetFormatAttr(nFontHeightWhich);
652 bMod = true;
653 }
654
655 if(sTitle != m_sShellTitle )
656 {
657 lcl_SetColl(m_pWrtShell, RES_POOLCOLL_HEADLINE_BASE, pPrinter, sTitle, nFontWhich);
658 bMod = true;
659 }
660 if(bTitleHeightChanged)
661 {
663 sal::static_int_cast< sal_uInt16, sal_Int64 >(m_xTitleHeightLB->get_value()), nFontHeightWhich);
664 bMod = true;
665 }
666 if(sList != m_sShellList && (!m_bListDefault || !m_bSetListDefault ))
667 {
668 lcl_SetColl(m_pWrtShell, RES_POOLCOLL_NUMBER_BULLET_BASE, pPrinter, sList, nFontWhich);
669 bMod = true;
670 }
671 if(bListHeightChanged)
672 {
674 sal::static_int_cast< sal_uInt16, sal_Int64 >(m_xListHeightLB->get_value()), nFontHeightWhich);
675 bMod = true;
676 }
677 if(sLabel != m_sShellLabel && (!m_bLabelDefault || !m_bSetLabelDefault))
678 {
679 lcl_SetColl(m_pWrtShell, RES_POOLCOLL_LABEL, pPrinter, sLabel, nFontWhich);
680 bMod = true;
681 }
682 if(bLabelHeightChanged)
683 {
685 sal::static_int_cast< sal_uInt16, sal_Int64 >(m_xLabelHeightLB->get_value()), nFontHeightWhich);
686 bMod = true;
687 }
688 if(sIdx != m_sShellIndex && (!m_bIdxDefault || !m_bSetIdxDefault))
689 {
690 lcl_SetColl(m_pWrtShell, RES_POOLCOLL_REGISTER_BASE, pPrinter, sIdx, nFontWhich);
691 bMod = true;
692 }
693 if(bIndexHeightChanged)
694 {
696 sal::static_int_cast< sal_uInt16, sal_Int64 >(m_xIndexHeightLB->get_value()), nFontHeightWhich);
697 bMod = true;
698 }
699 if ( bMod )
702 }
703 return false;
704}
705
707{
708 const TypedWhichId<SvxLanguageItem> nLangSlot = m_nFontGroup == FONT_GROUP_DEFAULT ? SID_ATTR_LANGUAGE :
709 FONT_GROUP_CJK == m_nFontGroup ? SID_ATTR_CHAR_CJK_LANGUAGE : SID_ATTR_CHAR_CTL_LANGUAGE;
710
711 if( const SvxLanguageItem* pLang = rSet->GetItemIfSet(nLangSlot, false) )
712 m_eLanguage = pLang->GetValue();
713
714 OUString sToReplace = m_sScriptWestern;
716 sToReplace = m_sScriptAsian;
717 else if(FONT_GROUP_CTL == m_nFontGroup )
718 sToReplace = m_sScriptComplex;
719 m_xLabelFT->set_label(m_xLabelFT->get_label().replaceFirst("%1", sToReplace));
720
722 {
724 m_bDisposePrinter = false;
725 }
726
727 if(const SwPtrItem* pItem = rSet->GetItemIfSet(FN_PARAM_PRINTER, false))
728 {
729 m_pPrt = static_cast<SfxPrinter*>(pItem->GetValue());
730 }
731 else
732 {
733 auto pPrinterSet = std::make_unique<SfxItemSetFixed
734 <SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
735 SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>>( *rSet->GetPool() );
736 m_pPrt = VclPtr<SfxPrinter>::Create(std::move(pPrinterSet));
737 m_bDisposePrinter = true;
738 }
739 m_pFontList.reset(new FontList( m_pPrt ));
740 // #i94536# prevent duplication of font entries when 'reset' button is pressed
741 if( !m_xStandardBox->get_count() )
742 {
743 // get the set of distinct available family names
744 std::set< OUString > aFontNames;
745 int nFontNames = m_pPrt->GetFontFaceCollectionCount();
746 for( int i = 0; i < nFontNames; i++ )
747 {
748 FontMetric aFontMetric( m_pPrt->GetFontMetricFromCollection( i ) );
749 aFontNames.insert( aFontMetric.GetFamilyName() );
750 }
751
752 // insert to listboxes
753 for( const auto& rFontName : aFontNames )
754 {
755 m_xStandardBox->append_text( rFontName );
756 m_xTitleBox->append_text( rFontName );
757 m_xListBox->append_text( rFontName );
758 m_xLabelBox->append_text( rFontName );
759 m_xIdxBox->append_text( rFontName );
760 }
761 }
762 if(const SwPtrItem* pItem = rSet->GetItemIfSet(FN_PARAM_STDFONTS, false))
763 {
764 m_pFontConfig = static_cast<SwStdFontConfig*>(pItem->GetValue());
765 }
766
767 if(const SwPtrItem* pItem = rSet->GetItemIfSet(FN_PARAM_WRTSHELL, false))
768 {
769 m_pWrtShell = static_cast<SwWrtShell*>(pItem->GetValue());
770 }
771 OUString sStdBackup;
772 OUString sOutBackup;
773 OUString sListBackup;
774 OUString sCapBackup;
775 OUString sIdxBackup;
776 sal_Int32 nStandardHeight = -1;
777 sal_Int32 nTitleHeight = -1;
778 sal_Int32 nListHeight = -1;
779 sal_Int32 nLabelHeight = -1;
780 sal_Int32 nIndexHeight = -1;
781
782 if(!m_pWrtShell)
783 {
794 if( nStandardHeight <= 0)
796 if( nTitleHeight <= 0)
798 if( nListHeight <= 0)
800 if( nLabelHeight <= 0)
802 if( nIndexHeight <= 0)
804 }
805 else
806 {
808 const SvxFontItem& rFont = !m_nFontGroup ? pColl->GetFont() :
809 FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
810 m_sShellStd = sStdBackup = rFont.GetFamilyName();
811
812 const sal_uInt16 nFontHeightWhich =
815 const SvxFontHeightItem& rFontHeightStandard = static_cast<const SvxFontHeightItem& >(pColl->GetFormatAttr(nFontHeightWhich));
816 nStandardHeight = static_cast<sal_Int32>(rFontHeightStandard.GetHeight());
817
819 const SvxFontItem& rFontHL = !m_nFontGroup ? pColl->GetFont() :
820 FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
821 m_sShellTitle = sOutBackup = rFontHL.GetFamilyName();
822
823 const SvxFontHeightItem& rFontHeightTitle = static_cast<const SvxFontHeightItem&>(pColl->GetFormatAttr( nFontHeightWhich ));
824 nTitleHeight = static_cast<sal_Int32>(rFontHeightTitle.GetHeight());
825
826 const sal_uInt16 nFontWhich =
830 const SvxFontItem& rFontLS = !m_nFontGroup ? pColl->GetFont() :
831 FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
832 m_bListDefault = SfxItemState::DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, false);
833 m_sShellList = sListBackup = rFontLS.GetFamilyName();
834
835 const SvxFontHeightItem& rFontHeightList = static_cast<const SvxFontHeightItem&>(pColl->GetFormatAttr(nFontHeightWhich));
836 nListHeight = static_cast<sal_Int32>(rFontHeightList.GetHeight());
837
839 m_bLabelDefault = SfxItemState::DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, false);
840 const SvxFontItem& rFontCP = !m_nFontGroup ? pColl->GetFont() :
841 FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
842 m_sShellLabel = sCapBackup = rFontCP.GetFamilyName();
843 const SvxFontHeightItem& rFontHeightLabel = static_cast<const SvxFontHeightItem&>(pColl->GetFormatAttr(nFontHeightWhich));
844 nLabelHeight = static_cast<sal_Int32>(rFontHeightLabel.GetHeight());
845
847 m_bIdxDefault = SfxItemState::DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, false);
848 const SvxFontItem& rFontIDX = !m_nFontGroup ? pColl->GetFont() :
849 FONT_GROUP_CJK == m_nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
850 m_sShellIndex = sIdxBackup = rFontIDX.GetFamilyName();
851 const SvxFontHeightItem& rFontHeightIndex = static_cast<const SvxFontHeightItem&>(pColl->GetFormatAttr(nFontHeightWhich));
852 nIndexHeight = static_cast<sal_Int32>(rFontHeightIndex.GetHeight());
853 }
854 m_xStandardBox->set_entry_text(sStdBackup );
855 m_xTitleBox->set_entry_text(sOutBackup );
856 m_xListBox->set_entry_text(sListBackup);
857 m_xLabelBox->set_entry_text(sCapBackup );
858 m_xIdxBox->set_entry_text(sIdxBackup );
859
860 m_xStandardHeightLB->Fill( m_pFontList.get() );
861 m_xTitleHeightLB->Fill( m_pFontList.get() );
862 m_xListHeightLB->Fill( m_pFontList.get() );
863 m_xLabelHeightLB->Fill( m_pFontList.get() );
864 m_xIndexHeightLB->Fill( m_pFontList.get() );
865
866 m_xStandardHeightLB->set_value( CalcToPoint( nStandardHeight, MapUnit::MapTwip, 10 ) );
867 m_xTitleHeightLB->set_value( CalcToPoint( nTitleHeight , MapUnit::MapTwip, 10 ) );
868 m_xListHeightLB->set_value( CalcToPoint( nListHeight , MapUnit::MapTwip, 10 ) );
869 m_xLabelHeightLB->set_value( CalcToPoint( nLabelHeight , MapUnit::MapTwip, 10 ));
870 m_xIndexHeightLB->set_value( CalcToPoint( nIndexHeight , MapUnit::MapTwip, 10 ));
871
872 m_xStandardBox->save_value();
873 m_xTitleBox->save_value();
874 m_xListBox->save_value();
875 m_xLabelBox->save_value();
876 m_xIdxBox->save_value();
877
878 m_xStandardHeightLB->save_value();
879 m_xTitleHeightLB->save_value();
880 m_xListHeightLB->save_value();
881 m_xLabelHeightLB->save_value();
882 m_xIndexHeightLB->save_value();
883}
884
886{
887 sal_uInt8 nFontOffset = m_nFontGroup * FONT_PER_GROUP;
888 m_xStandardBox->set_entry_text(SwStdFontConfig::GetDefaultFor(FONT_STANDARD + nFontOffset, m_eLanguage));
889 m_xTitleBox->set_entry_text(SwStdFontConfig::GetDefaultFor(FONT_OUTLINE + nFontOffset, m_eLanguage));
890 m_xListBox->set_entry_text(SwStdFontConfig::GetDefaultFor(FONT_LIST + nFontOffset, m_eLanguage));
891 m_xLabelBox->set_entry_text(SwStdFontConfig::GetDefaultFor(FONT_CAPTION + nFontOffset, m_eLanguage));
892 m_xIdxBox->set_entry_text(SwStdFontConfig::GetDefaultFor(FONT_INDEX + nFontOffset, m_eLanguage));
893
894 m_xStandardBox->save_value();
895 m_xTitleBox->save_value();
896 m_xListBox->save_value();
897 m_xLabelBox->save_value();
898 m_xIdxBox->save_value();
899
900 m_xStandardHeightLB->set_value( CalcToPoint(
901 SwStdFontConfig::GetDefaultHeightFor(FONT_STANDARD + nFontOffset, m_eLanguage),
902 MapUnit::MapTwip, 10 ));
903 m_xTitleHeightLB->set_value(CalcToPoint(
905 nFontOffset, m_eLanguage), MapUnit::MapTwip, 10 ));
906 m_xListHeightLB->set_value(CalcToPoint(
907 SwStdFontConfig::GetDefaultHeightFor(FONT_LIST + nFontOffset, m_eLanguage),
908 MapUnit::MapTwip, 10 ));
909 m_xLabelHeightLB->set_value(CalcToPoint(
910 SwStdFontConfig::GetDefaultHeightFor(FONT_CAPTION + nFontOffset, m_eLanguage),
911 MapUnit::MapTwip, 10 ));
912 m_xIndexHeightLB->set_value(CalcToPoint(
913 SwStdFontConfig::GetDefaultHeightFor(FONT_INDEX + nFontOffset, m_eLanguage),
914 MapUnit::MapTwip, 10 ));
915}
916
917IMPL_LINK( SwStdFontTabPage, ModifyHdl, weld::ComboBox&, rBox, void )
918{
919 if (&rBox == m_xStandardBox.get())
920 {
921 const OUString sEntry = rBox.get_active_text();
922 if(m_bSetListDefault && m_bListDefault)
923 m_xListBox->set_entry_text(sEntry);
924 if(m_bSetLabelDefault && m_bLabelDefault)
925 m_xLabelBox->set_entry_text(sEntry);
926 if(m_bSetIdxDefault && m_bIdxDefault)
927 m_xIdxBox->set_entry_text(sEntry);
928 }
929 else if (&rBox == m_xListBox.get())
930 {
931 m_bSetListDefault = false;
932 }
933 else if (&rBox == m_xLabelBox.get())
934 {
935 m_bSetLabelDefault = false;
936 }
937 else if (&rBox == m_xIdxBox.get())
938 {
939 m_bSetIdxDefault = false;
940 }
941}
942
943IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, weld::Widget&, rControl, void )
944{
945 weld::ComboBox& rBox = dynamic_cast<weld::ComboBox&>(rControl);
946 FontSizeBox* pHeightLB = nullptr;
947
948 if (&rBox == m_xStandardBox.get())
949 {
950 pHeightLB = m_xStandardHeightLB.get();
951 }
952 else if (&rBox == m_xTitleBox.get())
953 {
954 pHeightLB = m_xTitleHeightLB.get();
955 }
956 else if (&rBox == m_xListBox.get())
957 {
958 pHeightLB = m_xListHeightLB.get();
959 }
960 else if (&rBox == m_xLabelBox.get())
961 {
962 pHeightLB = m_xLabelHeightLB.get();
963 }
964 else /*if (&rBox == m_xIndexHeightLB.get())*/
965 {
966 pHeightLB = m_xIndexHeightLB.get();
967 }
968
969 pHeightLB->Fill( m_pFontList.get() );
970}
971
973{
974 const SfxUInt16Item* pFlagItem = aSet.GetItem<SfxUInt16Item>(SID_FONTMODE_TYPE, false);
975 if (pFlagItem)
976 m_nFontGroup = sal::static_int_cast< sal_uInt8, sal_uInt16>( pFlagItem->GetValue() );
977}
978
980 : SfxTabPage(pPage, pController, "modules/swriter/ui/opttablepage.ui", "OptTablePage", &rSet)
981 , m_pWrtShell(nullptr)
982 , m_bHTMLMode(false)
983 , m_xHeaderCB(m_xBuilder->weld_check_button("header"))
984 , m_xRepeatHeaderCB(m_xBuilder->weld_check_button("repeatheader"))
985 , m_xDontSplitCB(m_xBuilder->weld_check_button("dontsplit"))
986 , m_xBorderCB(m_xBuilder->weld_check_button("border"))
987 , m_xNumFormattingCB(m_xBuilder->weld_check_button("numformatting"))
988 , m_xNumFormatFormattingCB(m_xBuilder->weld_check_button("numfmtformatting"))
989 , m_xNumAlignmentCB(m_xBuilder->weld_check_button("numalignment"))
990 , m_xRowMoveMF(m_xBuilder->weld_metric_spin_button("rowmove", FieldUnit::CM))
991 , m_xColMoveMF(m_xBuilder->weld_metric_spin_button("colmove", FieldUnit::CM))
992 , m_xRowInsertMF(m_xBuilder->weld_metric_spin_button("rowinsert", FieldUnit::CM))
993 , m_xColInsertMF(m_xBuilder->weld_metric_spin_button("colinsert", FieldUnit::CM))
994 , m_xFixRB(m_xBuilder->weld_radio_button("fix"))
995 , m_xFixPropRB(m_xBuilder->weld_radio_button("fixprop"))
996 , m_xVarRB(m_xBuilder->weld_radio_button("var"))
997{
999 m_xNumFormattingCB->connect_toggled(aLnk);
1000 m_xNumFormatFormattingCB->connect_toggled(aLnk);
1001 m_xHeaderCB->connect_toggled(aLnk);
1002}
1003
1005{
1006}
1007
1008std::unique_ptr<SfxTabPage> SwTableOptionsTabPage::Create( weld::Container* pPage, weld::DialogController* pController,
1009 const SfxItemSet* rAttrSet )
1010{
1011 return std::make_unique<SwTableOptionsTabPage>(pPage, pController, *rAttrSet);
1012}
1013
1015{
1016 bool bRet = false;
1017 SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
1018
1019 if (m_xRowMoveMF->get_value_changed_from_saved())
1020 pModOpt->SetTableHMove( o3tl::narrowing<sal_uInt16>(m_xRowMoveMF->denormalize( m_xRowMoveMF->get_value(FieldUnit::TWIP))));
1021
1022 if (m_xColMoveMF->get_value_changed_from_saved())
1023 pModOpt->SetTableVMove( o3tl::narrowing<sal_uInt16>(m_xColMoveMF->denormalize( m_xColMoveMF->get_value(FieldUnit::TWIP))));
1024
1025 if (m_xRowInsertMF->get_value_changed_from_saved())
1026 pModOpt->SetTableHInsert(o3tl::narrowing<sal_uInt16>(m_xRowInsertMF->denormalize( m_xRowInsertMF->get_value(FieldUnit::TWIP))));
1027
1028 if (m_xColInsertMF->get_value_changed_from_saved())
1029 pModOpt->SetTableVInsert(o3tl::narrowing<sal_uInt16>(m_xColInsertMF->denormalize( m_xColInsertMF->get_value(FieldUnit::TWIP))));
1030
1032 if (m_xFixRB->get_active())
1034 else if(m_xFixPropRB->get_active())
1036 else
1038 if(eMode != pModOpt->GetTableMode())
1039 {
1040 pModOpt->SetTableMode(eMode);
1041 // the table-keyboard-mode has changed, now the current
1042 // table should know about that too.
1044 {
1046 static sal_uInt16 aInva[] =
1050 0
1051 };
1053 }
1054
1055 bRet = true;
1056 }
1057
1059
1060 if (m_xHeaderCB->get_active())
1062
1063 if (m_xRepeatHeaderCB->get_sensitive())
1064 aInsOpts.mnRowsToRepeat = m_xRepeatHeaderCB->get_active() ? 1 : 0;
1065
1066 if (!m_xDontSplitCB->get_active())
1068
1069 if (m_xBorderCB->get_active())
1071
1072 if (m_xHeaderCB->get_state_changed_from_saved() ||
1073 m_xRepeatHeaderCB->get_state_changed_from_saved() ||
1074 m_xDontSplitCB->get_state_changed_from_saved() ||
1075 m_xBorderCB->get_state_changed_from_saved())
1076 {
1077 pModOpt->SetInsTableFlags(m_bHTMLMode, aInsOpts);
1078 }
1079
1080 if (m_xNumFormattingCB->get_state_changed_from_saved())
1081 {
1082 pModOpt->SetInsTableFormatNum(m_bHTMLMode, m_xNumFormattingCB->get_active());
1083 bRet = true;
1084 }
1085
1086 if (m_xNumFormatFormattingCB->get_state_changed_from_saved())
1087 {
1089 bRet = true;
1090 }
1091
1092 if (m_xNumAlignmentCB->get_state_changed_from_saved())
1093 {
1094 pModOpt->SetInsTableAlignNum(m_bHTMLMode, m_xNumAlignmentCB->get_active());
1095 bRet = true;
1096 }
1097
1098 return bRet;
1099}
1100
1102{
1103 const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
1104 if ( rSet->GetItemState( SID_ATTR_METRIC ) >= SfxItemState::DEFAULT )
1105 {
1106 const SfxUInt16Item& rItem = rSet->Get( SID_ATTR_METRIC );
1107 FieldUnit eFieldUnit = static_cast<FieldUnit>(rItem.GetValue());
1108 ::SetFieldUnit( *m_xRowMoveMF, eFieldUnit );
1109 ::SetFieldUnit( *m_xColMoveMF, eFieldUnit );
1110 ::SetFieldUnit( *m_xRowInsertMF, eFieldUnit );
1111 ::SetFieldUnit( *m_xColInsertMF, eFieldUnit );
1112 }
1113
1114 m_xRowMoveMF->set_value(m_xRowMoveMF->normalize(pModOpt->GetTableHMove()), FieldUnit::TWIP);
1115 m_xColMoveMF->set_value(m_xColMoveMF->normalize(pModOpt->GetTableVMove()), FieldUnit::TWIP);
1116 m_xRowInsertMF->set_value(m_xRowInsertMF->normalize(pModOpt->GetTableHInsert()), FieldUnit::TWIP);
1117 m_xColInsertMF->set_value(m_xColInsertMF->normalize(pModOpt->GetTableVInsert()), FieldUnit::TWIP);
1118
1119 switch(pModOpt->GetTableMode())
1120 {
1121 case TableChgMode::FixedWidthChangeAbs: m_xFixRB->set_active(true); break;
1122 case TableChgMode::FixedWidthChangeProp: m_xFixPropRB->set_active(true); break;
1123 case TableChgMode::VarWidthChangeAbs: m_xVarRB->set_active(true); break;
1124 }
1125 if(const SfxUInt16Item* pItem = rSet->GetItemIfSet(SID_HTML_MODE, false))
1126 {
1127 m_bHTMLMode = 0 != (pItem->GetValue() & HTMLMODE_ON);
1128 }
1129
1130 // hide certain controls for html
1131 if (m_bHTMLMode)
1132 {
1133 m_xRepeatHeaderCB->hide();
1134 m_xDontSplitCB->hide();
1135 }
1136
1138 const SwInsertTableFlags nInsTableFlags = aInsOpts.mnInsMode;
1139
1140 m_xHeaderCB->set_active(bool(nInsTableFlags & SwInsertTableFlags::Headline));
1141 m_xRepeatHeaderCB->set_active((!m_bHTMLMode) && (aInsOpts.mnRowsToRepeat > 0));
1142 m_xDontSplitCB->set_active(!(nInsTableFlags & SwInsertTableFlags::SplitLayout));
1143 m_xBorderCB->set_active(bool(nInsTableFlags & SwInsertTableFlags::DefaultBorder));
1144
1145 m_xNumFormattingCB->set_active(pModOpt->IsInsTableFormatNum(m_bHTMLMode));
1147 m_xNumAlignmentCB->set_active(pModOpt->IsInsTableAlignNum(m_bHTMLMode));
1148
1149 m_xHeaderCB->save_state();
1150 m_xRepeatHeaderCB->save_state();
1151 m_xDontSplitCB->save_state();
1152 m_xBorderCB->save_state();
1153 m_xNumFormattingCB->save_state();
1154 m_xNumFormatFormattingCB->save_state();
1155 m_xNumAlignmentCB->save_state();
1156 m_xRowMoveMF->save_value();
1157 m_xColMoveMF->save_value();
1158 m_xRowInsertMF->save_value();
1159 m_xColInsertMF->save_value();
1160
1161 CheckBoxHdl(*m_xHeaderCB);
1162}
1163
1165{
1166 m_xNumFormatFormattingCB->set_sensitive(m_xNumFormattingCB->get_active());
1167 m_xNumAlignmentCB->set_sensitive(m_xNumFormattingCB->get_active());
1168 m_xRepeatHeaderCB->set_sensitive(m_xHeaderCB->get_active());
1169}
1170
1172{
1173 const SwWrtShellItem* pWrtSh = aSet.GetItem<SwWrtShellItem>(SID_WRT_SHELL, false);
1174 if (pWrtSh)
1175 m_pWrtShell = pWrtSh->GetValue();
1176}
1177
1179 : SfxTabPage(pPage, pController, "modules/swriter/ui/optformataidspage.ui", "OptFormatAidsPage", &rSet)
1180 , m_pWrtShell(nullptr)
1181 , m_xParaCB(m_xBuilder->weld_check_button("paragraph"))
1182 , m_xSHyphCB(m_xBuilder->weld_check_button("hyphens"))
1183 , m_xSpacesCB(m_xBuilder->weld_check_button("spaces"))
1184 , m_xHSpacesCB(m_xBuilder->weld_check_button("nonbreak"))
1185 , m_xTabCB(m_xBuilder->weld_check_button("tabs"))
1186 , m_xTabLabel(m_xBuilder->weld_label("tabs_label"))
1187 , m_xBreakCB(m_xBuilder->weld_check_button("break"))
1188 , m_xCharHiddenCB(m_xBuilder->weld_check_button("hiddentext"))
1189 , m_xBookmarkCB(m_xBuilder->weld_check_button("bookmarks"))
1190 , m_xBookmarkLabel(m_xBuilder->weld_label("bookmarks_label"))
1191 , m_xDirectCursorFrame(m_xBuilder->weld_frame("directcrsrframe"))
1192 , m_xOnOffCB(m_xBuilder->weld_check_button("cursoronoff"))
1193 , m_xDirectCursorFillMode(m_xBuilder->weld_combo_box("cxDirectCursorFillMode"))
1194 , m_xCursorProtFrame(m_xBuilder->weld_frame("crsrprotframe"))
1195 , m_xImageFrame(m_xBuilder->weld_frame("frmImage"))
1196 , m_xCursorInProtCB(m_xBuilder->weld_check_button("cursorinprot"))
1197 , m_xDefaultAnchorType(m_xBuilder->weld_combo_box("cxDefaultAnchor"))
1198 , m_xMathBaselineAlignmentCB(m_xBuilder->weld_check_button("mathbaseline"))
1199{
1201 bool bIsOn = false;
1202
1203 if( const SwShadowCursorItem* pItem = rSet.GetItemIfSet( FN_PARAM_SHADOWCURSOR, false ))
1204 {
1205 eMode = pItem->GetMode();
1206 bIsOn = pItem->IsOn();
1207 }
1208 m_xOnOffCB->set_active( bIsOn );
1209
1210 m_xDirectCursorFillMode->set_active( static_cast<int>(eMode) );
1211 const SfxUInt16Item* pHtmlModeItem = rSet.GetItemIfSet(SID_HTML_MODE, false);
1212 if(!pHtmlModeItem || !(pHtmlModeItem->GetValue() & HTMLMODE_ON))
1213 return;
1214
1215 m_xTabCB->hide();
1216 m_xTabLabel->hide();
1217 m_xCharHiddenCB->hide();
1218 m_xBookmarkCB->hide();
1219 m_xBookmarkLabel->hide();
1220
1221 m_xDirectCursorFrame->hide();
1222 m_xOnOffCB->hide();
1224 m_xCursorProtFrame->hide();
1225 m_xCursorInProtCB->hide();
1226 m_xImageFrame->hide();
1227}
1228
1230{
1231}
1232
1233std::unique_ptr<SfxTabPage> SwShdwCursorOptionsTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet )
1234{
1235 return std::make_unique<SwShdwCursorOptionsTabPage>(pPage, pController, *rSet);
1236}
1237
1239{
1240 const SwWrtShellItem* pWrtSh = aSet.GetItem<SwWrtShellItem>(SID_WRT_SHELL, false);
1241 if (pWrtSh)
1242 m_pWrtShell = pWrtSh->GetValue();
1243}
1244
1246{
1247 SwShadowCursorItem aOpt;
1248 aOpt.SetOn( m_xOnOffCB->get_active() );
1249
1250 SwFillMode eMode = static_cast<SwFillMode>(m_xDirectCursorFillMode->get_active());
1251 aOpt.SetMode( eMode );
1252
1253 bool bRet = false;
1254 const SwShadowCursorItem* pShadowCursorItem = rSet->GetItemIfSet( FN_PARAM_SHADOWCURSOR, false );
1255 if( !pShadowCursorItem || *pShadowCursorItem != aOpt )
1256 {
1257 rSet->Put( aOpt );
1258 bRet = true;
1259 }
1260
1261 if (m_pWrtShell) {
1263 m_xMathBaselineAlignmentCB->get_active() );
1264 bRet |= m_xMathBaselineAlignmentCB->get_state_changed_from_saved();
1265 }
1266
1267 if( m_xCursorInProtCB->get_state_changed_from_saved())
1268 {
1270 bRet = true;
1271 }
1272
1274
1275 SwDocDisplayItem aDisp;
1276
1277 aDisp.m_bParagraphEnd = m_xParaCB->get_active();
1278 aDisp.m_bTab = m_xTabCB->get_active();
1279 aDisp.m_bSpace = m_xSpacesCB->get_active();
1280 aDisp.m_bNonbreakingSpace = m_xHSpacesCB->get_active();
1281 aDisp.m_bSoftHyphen = m_xSHyphCB->get_active();
1282 aDisp.m_bCharHiddenText = m_xCharHiddenCB->get_active();
1283 aDisp.m_bBookmarks = m_xBookmarkCB->get_active();
1284 aDisp.m_bManualBreak = m_xBreakCB->get_active();
1285 aDisp.m_xDefaultAnchor = m_xDefaultAnchorType->get_active();
1286
1287 bRet |= (!pOldAttr || aDisp != *pOldAttr);
1288 if(bRet)
1289 bRet = nullptr != rSet->Put(aDisp);
1290
1291 return bRet;
1292}
1293
1295{
1297 bool bIsOn = false;
1298
1299 if( const SwShadowCursorItem* pItem = rSet->GetItemIfSet( FN_PARAM_SHADOWCURSOR, false ))
1300 {
1301 eMode = pItem->GetMode();
1302 bIsOn = pItem->IsOn();
1303 }
1304 m_xOnOffCB->set_active( bIsOn );
1305
1306 m_xDirectCursorFillMode->set_active( static_cast<int>(eMode) );
1307 if (m_pWrtShell) {
1309 m_xMathBaselineAlignmentCB->save_state();
1310 } else {
1312 }
1313
1314 if( const SfxBoolItem* pItem = rSet->GetItemIfSet( FN_PARAM_CRSR_IN_PROTECTED, false ) )
1315 m_xCursorInProtCB->set_active(pItem->GetValue());
1316 m_xCursorInProtCB->save_state();
1317
1318 const SwDocDisplayItem* pDocDisplayAttr = rSet->GetItemIfSet( FN_PARAM_DOCDISP, false );
1319 if(pDocDisplayAttr)
1320 {
1321 m_xParaCB->set_active( pDocDisplayAttr->m_bParagraphEnd );
1322 m_xTabCB->set_active( pDocDisplayAttr->m_bTab );
1323 m_xSpacesCB->set_active( pDocDisplayAttr->m_bSpace );
1324 m_xHSpacesCB->set_active( pDocDisplayAttr->m_bNonbreakingSpace );
1325 m_xSHyphCB->set_active( pDocDisplayAttr->m_bSoftHyphen );
1326 m_xCharHiddenCB->set_active( pDocDisplayAttr->m_bCharHiddenText );
1327 m_xBookmarkCB->set_active(pDocDisplayAttr->m_bBookmarks);
1328 m_xBreakCB->set_active( pDocDisplayAttr->m_bManualBreak );
1329 m_xDefaultAnchorType->set_active( pDocDisplayAttr->m_xDefaultAnchor );
1330 }
1331}
1332
1333namespace {
1334
1335// TabPage for Redlining
1336struct CharAttr
1337{
1338 sal_uInt16 nItemId;
1339 sal_uInt16 nAttr;
1340};
1341
1342}
1343
1344// Edit corresponds to Paste-attributes
1345CharAttr const aRedlineAttr[] =
1346{
1347 { SID_ATTR_CHAR_CASEMAP, sal_uInt16(SvxCaseMap::NotMapped) },
1348 { SID_ATTR_CHAR_WEIGHT, WEIGHT_BOLD },
1349 { SID_ATTR_CHAR_POSTURE, ITALIC_NORMAL },
1350 { SID_ATTR_CHAR_UNDERLINE, LINESTYLE_SINGLE },
1351 { SID_ATTR_CHAR_UNDERLINE, LINESTYLE_DOUBLE },
1352 { SID_ATTR_CHAR_STRIKEOUT, STRIKEOUT_SINGLE },
1353 { SID_ATTR_CHAR_CASEMAP, sal_uInt16(SvxCaseMap::Uppercase) },
1354 { SID_ATTR_CHAR_CASEMAP, sal_uInt16(SvxCaseMap::Lowercase) },
1355 { SID_ATTR_CHAR_CASEMAP, sal_uInt16(SvxCaseMap::SmallCaps) },
1356 { SID_ATTR_CHAR_CASEMAP, sal_uInt16(SvxCaseMap::Capitalize) },
1357 { SID_ATTR_BRUSH, 0 }
1358};
1359// Items from aRedlineAttr relevant for InsertAttr: strikethrough is
1360// not used
1361static sal_uInt16 aInsertAttrMap[] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 };
1362
1363// Items from aRedlineAttr relevant for DeleteAttr: underline and
1364// double underline is not used
1365static sal_uInt16 aDeletedAttrMap[] = { 0, 1, 2, 5, 6, 7, 8, 9, 10 };
1366
1367// Items from aRedlineAttr relevant for ChangeAttr: strikethrough is
1368// not used
1369static sal_uInt16 aChangedAttrMap[] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 };
1370
1371// Preview of selection
1373 : m_aTransCol(COL_TRANSPARENT)
1374 , m_aMarkCol(COL_LIGHTRED)
1375 , m_nMarkPos(0)
1376
1377{
1378 InitColors();
1379}
1380
1382{
1383}
1384
1386{
1387 // m_aTransCol and m_aMarkCol are _not_ changed because they are set from outside!
1388
1390 m_aBgCol = rSettings.GetWindowColor();
1391
1392 bool bHC = rSettings.GetHighContrastMode();
1394 m_aLineCol = bHC? rFontColor : COL_BLACK;
1395 m_aShadowCol = bHC? m_aBgCol : rSettings.GetShadowColor();
1396 m_aTextCol = bHC? rFontColor : COL_GRAY;
1398}
1399
1400void SwMarkPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle &/*rRect*/)
1401{
1402 const Size aSz(GetOutputSizePixel());
1403
1404 // Page
1405 m_aPage.SetSize(Size(aSz.Width() - 3, aSz.Height() - 3));
1406
1407 const tools::Long nOutWPix = m_aPage.GetWidth();
1408 const tools::Long nOutHPix = m_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 m_aLeftPagePrtArea = tools::Rectangle(Point(nLBorder, nTBorder), Point((nOutWPix - 1) - nRBorder, (nOutHPix - 1) - nBBorder));
1417 const tools::Long nWidth = m_aLeftPagePrtArea.GetWidth();
1418 const tools::Long nCorr = (nWidth & 1) != 0 ? 0 : 1;
1419 m_aLeftPagePrtArea.SetSize(Size(nWidth / 2 - (nLBorder + nRBorder) / 2 + nCorr, m_aLeftPagePrtArea.GetHeight()));
1420
1422 m_aRightPagePrtArea.Move(m_aLeftPagePrtArea.GetWidth() + nLBorder + nRBorder + 1, 0);
1423
1424 // draw shadow
1425 tools::Rectangle aShadow(m_aPage);
1426 aShadow += Point(3, 3);
1427 drawRect(rRenderContext, aShadow, m_aShadowCol, m_aTransCol);
1428
1429 // draw page
1430 drawRect(rRenderContext, m_aPage, m_aBgCol, m_aLineCol);
1431
1432 // draw separator
1433 tools::Rectangle aPageSeparator(m_aPage);
1434 aPageSeparator.SetSize(Size(2, aPageSeparator.GetHeight()));
1435 aPageSeparator.Move(m_aPage.GetWidth() / 2 - 1, 0);
1436 drawRect(rRenderContext, aPageSeparator, m_aLineCol, m_aTransCol);
1437
1438 PaintPage(rRenderContext, m_aLeftPagePrtArea);
1439 PaintPage(rRenderContext, m_aRightPagePrtArea);
1440
1443
1444 switch (m_nMarkPos)
1445 {
1446 case 1: // left
1447 aRightMark.SetPos(Point(m_aRightPagePrtArea.Left() - 2 - aRightMark.GetWidth(), aRightMark.Top()));
1448 break;
1449
1450 case 2: // right
1451 aLeftMark.SetPos(Point(m_aLeftPagePrtArea.Right() + 2, aLeftMark.Top()));
1452 break;
1453
1454 case 3: // outside
1455 break;
1456
1457 case 4: // inside
1458 aLeftMark.SetPos(Point(m_aLeftPagePrtArea.Right() + 2, aLeftMark.Top()));
1459 aRightMark.SetPos(Point(m_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 (m_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 , m_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 ( m_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 m_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 m_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 SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
static SAL_WARN_UNUSED_RESULT 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
static bool IsCTLFontEnabled()
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:104
std::unique_ptr< weld::CheckButton > m_xLeftPageCB
Definition: optpage.hxx:90
SwAddPrinterTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:277
void SetPreview(bool bPrev)
Definition: optpage.cxx:342
void SetFax(const std::vector< OUString > &)
Definition: optpage.cxx:452
std::unique_ptr< weld::Widget > m_xPagesFrame
Definition: optpage.hxx:89
std::unique_ptr< weld::RadioButton > m_xOnlyRB
Definition: optpage.hxx:97
std::unique_ptr< weld::CheckButton > m_xProspectCB
Definition: optpage.hxx:92
std::unique_ptr< weld::CheckButton > m_xPaperFromSetupCB
Definition: optpage.hxx:103
std::unique_ptr< weld::CheckButton > m_xBackgroundCB
Definition: optpage.hxx:84
std::unique_ptr< weld::CheckButton > m_xRightPageCB
Definition: optpage.hxx:91
OUString m_sNone
Definition: optpage.hxx:78
virtual ~SwAddPrinterTabPage() override
Definition: optpage.cxx:338
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:355
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:349
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:396
std::unique_ptr< weld::Widget > m_xCommentsFrame
Definition: optpage.hxx:95
std::unique_ptr< weld::RadioButton > m_xEndPageRB
Definition: optpage.hxx:99
std::unique_ptr< weld::CheckButton > m_xPrintTextPlaceholderCB
Definition: optpage.hxx:87
std::unique_ptr< weld::RadioButton > m_xNoRB
Definition: optpage.hxx:96
std::unique_ptr< weld::RadioButton > m_xInMarginsRB
Definition: optpage.hxx:100
std::unique_ptr< weld::CheckButton > m_xProspectCB_RTL
Definition: optpage.hxx:93
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: optpage.cxx:467
std::unique_ptr< weld::CheckButton > m_xCtrlFieldCB
Definition: optpage.hxx:83
std::unique_ptr< weld::CheckButton > m_xGrfCB
Definition: optpage.hxx:82
std::unique_ptr< weld::CheckButton > m_xPrintEmptyPagesCB
Definition: optpage.hxx:102
std::unique_ptr< weld::RadioButton > m_xEndRB
Definition: optpage.hxx:98
std::unique_ptr< weld::CheckButton > m_xBlackFontCB
Definition: optpage.hxx:85
std::unique_ptr< weld::CheckButton > m_xPrintHiddenTextCB
Definition: optpage.hxx:86
std::unique_ptr< weld::RadioButton > m_xAutoRB
Definition: optpage.hxx:366
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:369
std::unique_ptr< weld::RadioButton > m_xCharRB
Definition: optpage.hxx:368
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:1995
std::unique_ptr< weld::RadioButton > m_xWordRB
Definition: optpage.hxx:367
virtual ~SwCompareOptionsTabPage() override
Definition: optpage.cxx:1986
std::unique_ptr< weld::CheckButton > m_xIgnoreCB
Definition: optpage.hxx:370
SwCompareOptionsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:1968
std::unique_ptr< weld::CheckButton > m_xStoreRsidCB
Definition: optpage.hxx:372
std::unique_ptr< weld::SpinButton > m_xLenNF
Definition: optpage.hxx:371
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:164
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:59
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:57
SwContentOptPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:86
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:188
std::unique_ptr< weld::CheckButton > m_xFieldHiddenCB
Definition: optpage.hxx:60
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:58
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:61
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:160
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:215
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:190
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:285
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:366
void PaintPage(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: optpage.cxx:1470
Color m_aBgCol
Definition: optpage.hxx:262
void InitColors()
Definition: optpage.cxx:1385
tools::Rectangle m_aRightPagePrtArea
Definition: optpage.hxx:272
virtual ~SwMarkPreview() override
Definition: optpage.cxx:1381
Color m_aTransCol
Definition: optpage.hxx:263
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: optpage.cxx:1400
Color m_aTextCol
Definition: optpage.hxx:267
tools::Rectangle m_aLeftPagePrtArea
Definition: optpage.hxx:271
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: optpage.cxx:1500
sal_uInt16 m_nMarkPos
Definition: optpage.hxx:274
Color m_aLineCol
Definition: optpage.hxx:265
Color m_aMarkCol
Definition: optpage.hxx:264
tools::Rectangle m_aPage
Definition: optpage.hxx:270
Color m_aPrintAreaCol
Definition: optpage.hxx:268
Color m_aShadowCol
Definition: optpage.hxx:266
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:292
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:294
std::unique_ptr< weld::CustomWeld > m_xChangedPreview
Definition: optpage.hxx:305
std::unique_ptr< SwMarkPreview > m_xMarkPreviewWN
Definition: optpage.hxx:309
std::unique_ptr< ColorListBox > m_xChangedColorLB
Definition: optpage.hxx:303
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:308
std::unique_ptr< weld::ComboBox > m_xChangedLB
Definition: optpage.hxx:302
std::unique_ptr< weld::CustomWeld > m_xInsertedPreview
Definition: optpage.hxx:295
std::unique_ptr< weld::CustomWeld > m_xMarkPreview
Definition: optpage.hxx:310
std::unique_ptr< SvxFontPrevWindow > m_xDeletedPreviewWN
Definition: optpage.hxx:299
virtual ~SwRedlineOptionsTabPage() override
Definition: optpage.cxx:1588
std::unique_ptr< SvxFontPrevWindow > m_xChangedPreviewWN
Definition: optpage.hxx:304
std::unique_ptr< weld::CustomWeld > m_xDeletedPreview
Definition: optpage.hxx:300
std::unique_ptr< ColorListBox > m_xDeletedColorLB
Definition: optpage.hxx:298
std::unique_ptr< weld::ComboBox > m_xMarkPosLB
Definition: optpage.hxx:307
std::unique_ptr< weld::ComboBox > m_xDeletedLB
Definition: optpage.hxx:297
std::unique_ptr< ColorListBox > m_xInsertColorLB
Definition: optpage.hxx:293
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:224
virtual ~SwShdwCursorOptionsTabPage() override
Definition: optpage.cxx:1229
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:1294
std::unique_ptr< weld::Frame > m_xImageFrame
Definition: optpage.hxx:240
std::unique_ptr< weld::CheckButton > m_xSpacesCB
Definition: optpage.hxx:226
std::unique_ptr< weld::Frame > m_xCursorProtFrame
Definition: optpage.hxx:239
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:1245
std::unique_ptr< weld::Label > m_xBookmarkLabel
Definition: optpage.hxx:233
std::unique_ptr< weld::ComboBox > m_xDirectCursorFillMode
Definition: optpage.hxx:238
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:1233
std::unique_ptr< weld::CheckButton > m_xMathBaselineAlignmentCB
Definition: optpage.hxx:245
std::unique_ptr< weld::CheckButton > m_xCursorInProtCB
Definition: optpage.hxx:241
std::unique_ptr< weld::ComboBox > m_xDefaultAnchorType
Definition: optpage.hxx:243
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: optpage.cxx:1238
std::unique_ptr< weld::Frame > m_xDirectCursorFrame
Definition: optpage.hxx:235
std::unique_ptr< weld::CheckButton > m_xCharHiddenCB
Definition: optpage.hxx:231
std::unique_ptr< weld::CheckButton > m_xHSpacesCB
Definition: optpage.hxx:227
std::unique_ptr< weld::CheckButton > m_xTabCB
Definition: optpage.hxx:228
std::unique_ptr< weld::CheckButton > m_xBreakCB
Definition: optpage.hxx:230
std::unique_ptr< weld::Label > m_xTabLabel
Definition: optpage.hxx:229
std::unique_ptr< weld::CheckButton > m_xOnOffCB
Definition: optpage.hxx:236
SwShdwCursorOptionsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:1178
std::unique_ptr< weld::CheckButton > m_xSHyphCB
Definition: optpage.hxx:225
SwWrtShell * m_pWrtShell
Definition: optpage.hxx:221
std::unique_ptr< weld::CheckButton > m_xBookmarkCB
Definition: optpage.hxx:232
sal_Int32 GetFontHeight(sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang)
Definition: fontcfg.cxx:303
const OUString & GetFontOutline(sal_uInt8 nFontGroup) const
Definition: fontcfg.hxx:83
void SetFontHeight(sal_Int32 nHeight, sal_uInt8 nFont, sal_uInt8 nScriptType)
Definition: fontcfg.hxx:103
const OUString & GetFontCaption(sal_uInt8 nFontGroup) const
Definition: fontcfg.hxx:85
void SetFontOutline(const OUString &rSet, sal_uInt8 nFontGroup)
Definition: fontcfg.hxx:94
const OUString & GetFontList(sal_uInt8 nFontGroup) const
Definition: fontcfg.hxx:84
void SetFontList(const OUString &rSet, sal_uInt8 nFontGroup)
Definition: fontcfg.hxx:96
static OUString GetDefaultFor(sal_uInt16 nFontType, LanguageType eLang)
Definition: fontcfg.cxx:216
void SetFontStandard(const OUString &rSet, sal_uInt8 nFontGroup)
Definition: fontcfg.hxx:91
void SetFontIndex(const OUString &rSet, sal_uInt8 nFontGroup)
Definition: fontcfg.hxx:100
static sal_Int32 GetDefaultHeightFor(sal_uInt16 nFontType, LanguageType eLang)
Definition: fontcfg.cxx:249
const OUString & GetFontStandard(sal_uInt8 nFontGroup) const
Definition: fontcfg.hxx:82
const OUString & GetFontIndex(sal_uInt8 nFontGroup) const
Definition: fontcfg.hxx:86
void SetFontCaption(const OUString &rSet, sal_uInt8 nFontGroup)
Definition: fontcfg.hxx:98
SwStdFontConfig * m_pFontConfig
Definition: optpage.hxx:132
std::unique_ptr< weld::Label > m_xLabelFT
Definition: optpage.hxx:151
bool m_bSetIdxDefault
Definition: optpage.hxx:142
VclPtr< SfxPrinter > m_pPrt
Definition: optpage.hxx:130
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:706
std::unique_ptr< FontSizeBox > m_xTitleHeightLB
Definition: optpage.hxx:155
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:577
std::unique_ptr< weld::ComboBox > m_xTitleBox
Definition: optpage.hxx:154
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:550
OUString m_sScriptComplex
Definition: optpage.hxx:149
virtual ~SwStdFontTabPage() override
Definition: optpage.cxx:536
std::unique_ptr< weld::ComboBox > m_xListBox
Definition: optpage.hxx:156
OUString m_sScriptAsian
Definition: optpage.hxx:148
LanguageType m_eLanguage
Definition: optpage.hxx:134
bool m_bSetListDefault
Definition: optpage.hxx:138
bool m_bDisposePrinter
Definition: optpage.hxx:143
std::unique_ptr< weld::Button > m_xStandardPB
Definition: optpage.hxx:162
std::unique_ptr< weld::ComboBox > m_xStandardBox
Definition: optpage.hxx:152
std::unique_ptr< FontSizeBox > m_xListHeightLB
Definition: optpage.hxx:157
std::unique_ptr< FontList > m_pFontList
Definition: optpage.hxx:131
OUString m_sShellIndex
Definition: optpage.hxx:128
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: optpage.cxx:972
OUString m_sShellLabel
Definition: optpage.hxx:127
std::unique_ptr< FontSizeBox > m_xLabelHeightLB
Definition: optpage.hxx:159
SwWrtShell * m_pWrtShell
Definition: optpage.hxx:133
std::unique_ptr< FontSizeBox > m_xIndexHeightLB
Definition: optpage.hxx:161
bool m_bLabelDefault
Definition: optpage.hxx:139
bool m_bSetLabelDefault
Definition: optpage.hxx:140
OUString m_sShellStd
Definition: optpage.hxx:124
OUString m_sShellList
Definition: optpage.hxx:126
SwStdFontTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:487
std::unique_ptr< weld::ComboBox > m_xLabelBox
Definition: optpage.hxx:158
std::unique_ptr< FontSizeBox > m_xStandardHeightLB
Definition: optpage.hxx:153
std::unique_ptr< weld::ComboBox > m_xIdxBox
Definition: optpage.hxx:160
OUString m_sShellTitle
Definition: optpage.hxx:125
OUString m_sScriptWestern
Definition: optpage.hxx:147
sal_uInt8 m_nFontGroup
Definition: optpage.hxx:145
std::unique_ptr< weld::CheckButton > m_xHeaderCB
Definition: optpage.hxx:184
std::unique_ptr< weld::MetricSpinButton > m_xColInsertMF
Definition: optpage.hxx:197
virtual ~SwTableOptionsTabPage() override
Definition: optpage.cxx:1004
std::unique_ptr< weld::MetricSpinButton > m_xRowMoveMF
Definition: optpage.hxx:193
std::unique_ptr< weld::RadioButton > m_xVarRB
Definition: optpage.hxx:201
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: optpage.cxx:1171
std::unique_ptr< weld::CheckButton > m_xNumFormattingCB
Definition: optpage.hxx:189
SwTableOptionsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:979
std::unique_ptr< weld::MetricSpinButton > m_xRowInsertMF
Definition: optpage.hxx:196
virtual void Reset(const SfxItemSet *rSet) override
Definition: optpage.cxx:1101
std::unique_ptr< weld::CheckButton > m_xRepeatHeaderCB
Definition: optpage.hxx:185
std::unique_ptr< weld::CheckButton > m_xNumFormatFormattingCB
Definition: optpage.hxx:190
std::unique_ptr< weld::RadioButton > m_xFixPropRB
Definition: optpage.hxx:200
SwWrtShell * m_pWrtShell
Definition: optpage.hxx:181
std::unique_ptr< weld::CheckButton > m_xDontSplitCB
Definition: optpage.hxx:186
std::unique_ptr< weld::CheckButton > m_xNumAlignmentCB
Definition: optpage.hxx:191
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:1014
std::unique_ptr< weld::MetricSpinButton > m_xColMoveMF
Definition: optpage.hxx:194
std::unique_ptr< weld::CheckButton > m_xBorderCB
Definition: optpage.hxx:187
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:1008
std::unique_ptr< weld::RadioButton > m_xFixRB
Definition: optpage.hxx:199
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:352
std::unique_ptr< weld::CheckButton > m_xTest8CBox
Definition: optpage.hxx:355
std::unique_ptr< weld::CheckButton > m_xTest9CBox
Definition: optpage.hxx:356
std::unique_ptr< weld::CheckButton > m_xTest2CBox
Definition: optpage.hxx:349
std::unique_ptr< weld::CheckButton > m_xTest6CBox
Definition: optpage.hxx:353
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: optpage.cxx:2131
std::unique_ptr< weld::CheckButton > m_xTest10CBox
Definition: optpage.hxx:357
std::unique_ptr< weld::CheckButton > m_xTest3CBox
Definition: optpage.hxx:350
std::unique_ptr< weld::CheckButton > m_xTest7CBox
Definition: optpage.hxx:354
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: optpage.cxx:2125
SwTestTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: optpage.cxx:2104
bool m_bAttrModified
Definition: optpage.hxx:346
std::unique_ptr< weld::CheckButton > m_xTest4CBox
Definition: optpage.hxx:351
std::unique_ptr< weld::CheckButton > m_xTest1CBox
Definition: optpage.hxx:348
virtual ~SwTestTabPage() override
Definition: optpage.cxx:2121
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: fmtcol.cxx:432
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:395
const Color & GetFontColor() const
Definition: viewopt.cxx:517
static const SwViewOption & GetCurrentViewOptions()
Definition: viewopt.cxx:605
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2819
SwDoc * GetDoc() const
Definition: viewsh.hxx:308
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:1723
const SwView & GetView() const
Definition: wrtsh.hxx:443
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:186
#define FN_PARAM_PRINTER
Definition: cmdid.h:826
#define FN_PARAM_ELEM
Definition: cmdid.h:805
#define FN_TABLE_MODE_FIX_PROP
Definition: cmdid.h:459
#define FN_PARAM_SWTEST
Definition: cmdid.h:806
#define FN_PARAM_SHADOWCURSOR
Definition: cmdid.h:838
#define FN_TABLE_MODE_VARIABLE
Definition: cmdid.h:460
#define FN_PARAM_STDFONTS
Definition: cmdid.h:827
#define FN_PARAM_ADDPRINTER
Definition: cmdid.h:803
#define FN_PARAM_WRTSHELL
Definition: cmdid.h:829
#define FN_PARAM_DOCDISP
Definition: cmdid.h:804
#define FN_HSCROLL_METRIC
Definition: cmdid.h:185
#define FN_TABLE_MODE_FIX
Definition: cmdid.h:458
#define FN_PARAM_CRSR_IN_PROTECTED
Definition: cmdid.h:842
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:741
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)
const char GetValue[]
IMPL_LINK(SwContentOptPage, VertRulerHdl, weld::Toggleable &, rBox, void)
Definition: optpage.cxx:266
CharAttr const aRedlineAttr[]
Definition: optpage.cxx:1345
static void lcl_SetColl(SwWrtShell *pWrtShell, sal_uInt16 nType, SfxPrinter const *pPrt, const OUString &rStyle, sal_uInt16 nFontWhich)
Definition: optpage.cxx:556
static void lcl_SelectMetricLB(weld::ComboBox &rMetric, TypedWhichId< SfxUInt16Item > nSID, const SfxItemSet &rSet)
Definition: optpage.cxx:170
static sal_uInt16 aDeletedAttrMap[]
Definition: optpage.cxx:1365
static sal_uInt16 aInsertAttrMap[]
Definition: optpage.cxx:1361
static sal_uInt16 aChangedAttrMap[]
Definition: optpage.cxx:1369
IMPL_LINK_NOARG(SwAddPrinterTabPage, AutoClickHdl, weld::Toggleable &, void)
Definition: optpage.cxx:438
@ RES_POOLCOLL_STANDARD
Standard.
Definition: poolfmt.hxx:250
@ RES_POOLCOLL_REGISTER_BASE
Base index.
Definition: poolfmt.hxx:366
@ 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:168
#define SW_MOD()
Definition: swmodule.hxx:254
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)