LibreOffice Module sw (master) 1
appopt.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 <memory>
21#include <cmdid.h>
22
23#include <com/sun/star/i18n/ScriptType.hpp>
24
25#include <sal/log.hxx>
26#include <hintids.hxx>
27#include <svl/eitem.hxx>
28#include <sfx2/app.hxx>
29#include <sfx2/printer.hxx>
30#include <sfx2/htmlmode.hxx>
31#include <sfx2/bindings.hxx>
32#include <editeng/brushitem.hxx>
33#include <editeng/tstpitem.hxx>
34#include <svx/optgrid.hxx>
35#include <svx/dialogs.hrc>
39#include <fontcfg.hxx>
40#include <swmodule.hxx>
41#include <view.hxx>
42#include <doc.hxx>
43#include <wrtsh.hxx>
46#include <uitool.hxx>
47#include <wview.hxx>
48#include <cfgitems.hxx>
49#include <prtopt.hxx>
50#include <pview.hxx>
51#include <usrpref.hxx>
52#include <uiitems.hxx>
53#include <editeng/langitem.hxx>
54#include <unotools/lingucfg.hxx>
55#include <globals.hrc>
56#include <swabstdlg.hxx>
57#include <swwrtshitem.hxx>
58
59#include <sfx2/dispatch.hxx>
60
61using namespace ::com::sun::star::uno;
62using namespace ::com::sun::star::lang;
63
64std::optional<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId )
65{
66 bool bTextDialog = (nId == SID_SW_EDITOPTIONS);
67
68 // the options for the Web- and Textdialog are put together here
69 SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
70 SwMasterUsrPref* pPref = bTextDialog ? m_pUsrPref.get() : m_pWebUsrPref.get();
71 // no MakeUsrPref, because only options from textdoks can be used here
72 SwView* pAppView = GetView();
73 if(pAppView && &pAppView->GetViewFrame() != SfxViewFrame::Current())
74 pAppView = nullptr;
75 if(pAppView)
76 {
77 bool bWebView = dynamic_cast<SwWebView*>( pAppView ) != nullptr;
78 // if Text then no WebView and vice versa
79 if (bWebView != bTextDialog)
80 {
81 aViewOpt = *pAppView->GetWrtShell().GetViewOptions();
82 }
83 else
84 pAppView = nullptr; // with View, there's nothing to win here
85 }
86
87 // Options/Edit
91 SID_PRINTPREVIEW, SID_PRINTPREVIEW,
92 SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS,
93 SID_HTML_MODE, SID_HTML_MODE,
94 SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE,
95 SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
96 SID_ATTR_LANGUAGE, SID_ATTR_METRIC,
97 SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
98 SID_ATTR_APPLYCHARUNIT, SID_ATTR_APPLYCHARUNIT,
106 aRet(GetPool());
107
108 aRet.Put( SwDocDisplayItem( aViewOpt ) );
109 aRet.Put( SwElemItem( aViewOpt ) );
110 if( bTextDialog )
111 {
112 aRet.Put( SwShadowCursorItem( aViewOpt ));
114 }
115
116 if( pAppView )
117 {
118 SwWrtShell& rWrtShell = pAppView->GetWrtShell();
119
120 SfxPrinter* pPrt = rWrtShell.getIDocumentDeviceAccess().getPrinter( false );
121 if( pPrt )
122 aRet.Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));
123 aRet.Put(SwPtrItem(FN_PARAM_WRTSHELL, &rWrtShell));
124
125 aRet.Put(rWrtShell.GetDefault(RES_CHRATR_LANGUAGE).CloneSetWhich(SID_ATTR_LANGUAGE));
126 aRet.Put(rWrtShell.GetDefault(RES_CHRATR_CJK_LANGUAGE).CloneSetWhich(SID_ATTR_CHAR_CJK_LANGUAGE));
127 aRet.Put(rWrtShell.GetDefault(RES_CHRATR_CTL_LANGUAGE).CloneSetWhich(SID_ATTR_CHAR_CTL_LANGUAGE));
128 }
129 else
130 {
131 SvtLinguConfig aLinguCfg;
132 css::lang::Locale aLocale;
134
135 using namespace ::com::sun::star::i18n::ScriptType;
136
137 Any aLang = aLinguCfg.GetProperty(u"DefaultLocale");
138 aLang >>= aLocale;
140 aRet.Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE));
141
142 aLang = aLinguCfg.GetProperty(u"DefaultLocale_CJK");
143 aLang >>= aLocale;
145 aRet.Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE));
146
147 aLang = aLinguCfg.GetProperty(u"DefaultLocale_CTL");
148 aLang >>= aLocale;
150 aRet.Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE));
151 }
152 if(bTextDialog)
154 if( dynamic_cast<SwPagePreview*>( SfxViewShell::Current())!=nullptr )
155 {
156 SfxBoolItem aBool(SfxBoolItem(SID_PRINTPREVIEW, true));
157 aRet.Put(aBool);
158 }
159
160 FieldUnit eUnit = pPref->GetHScrollMetric();
161 if(pAppView)
162 pAppView->GetHRulerMetric(eUnit);
163 aRet.Put(SfxUInt16Item( FN_HSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit)));
164
165 eUnit = pPref->GetVScrollMetric();
166 if(pAppView)
167 pAppView->GetVRulerMetric(eUnit);
168 aRet.Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit) ));
169 aRet.Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(pPref->GetMetric()) ));
170 aRet.Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, pPref->IsApplyCharUnit()));
171 if(bTextDialog)
172 {
173 if(pAppView)
174 {
175 const SvxTabStopItem& rDefTabs =
177 aRet.Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, o3tl::narrowing<sal_uInt16>(::GetTabDist(rDefTabs))));
178 }
179 else
180 aRet.Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, o3tl::toTwips(pPref->GetDefTabInMm100(), o3tl::Length::mm100)));
181 }
182
183 // Options for GridTabPage
184 SvxGridItem aGridItem( SID_ATTR_GRID_OPTIONS);
185
186 aGridItem.SetUseGridSnap( aViewOpt.IsSnap());
187 aGridItem.SetSynchronize( aViewOpt.IsSynchronize());
188 aGridItem.SetGridVisible( aViewOpt.IsGridVisible());
189
190 const Size& rSnapSize = aViewOpt.GetSnapSize();
191 aGridItem.SetFieldDrawX( o3tl::narrowing<sal_uInt16>(rSnapSize.Width() ));
192 aGridItem.SetFieldDrawY( o3tl::narrowing<sal_uInt16>(rSnapSize.Height()));
193
194 aGridItem.SetFieldDivisionX( aViewOpt.GetDivisionX());
195 aGridItem.SetFieldDivisionY( aViewOpt.GetDivisionY());
196
197 aRet.Put(aGridItem);
198
199 // Options for PrintTabPage
200 const SwPrintData* pOpt = GetPrtOptions(!bTextDialog);
201 SwAddPrinterItem aAddPrinterItem(*pOpt );
202 aRet.Put(aAddPrinterItem);
203
204 // Options for Web
205 if(!bTextDialog)
206 {
207 aRet.Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND));
208 aRet.Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON));
209 }
210
211 return aRet;
212}
213
214void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
215{
216 bool bTextDialog = nId == SID_SW_EDITOPTIONS;
217 SwView* pAppView = GetView();
218 if(pAppView && &pAppView->GetViewFrame() != SfxViewFrame::Current())
219 pAppView = nullptr;
220 if(pAppView)
221 {
222 // the text dialog mustn't apply data to the web view and vice versa
223 bool bWebView = dynamic_cast<SwWebView*>( pAppView ) != nullptr;
224 if(bWebView == bTextDialog)
225 pAppView = nullptr;
226 }
227
228 SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
229 SwMasterUsrPref* pPref = bTextDialog ? m_pUsrPref.get() : m_pWebUsrPref.get();
230
231 SfxBindings *pBindings = pAppView ? &pAppView->GetViewFrame().GetBindings()
232 : nullptr;
233
234 // Interpret the page Documentview
235 if( const SwDocDisplayItem* pDocDispItem = rSet.GetItemIfSet( FN_PARAM_DOCDISP, false ))
236 {
237 if(!aViewOpt.IsViewMetaChars())
238 {
239 if( (!aViewOpt.IsTab( true ) && pDocDispItem->m_bTab) ||
240 (!aViewOpt.IsBlank( true ) && pDocDispItem->m_bSpace) ||
241 (!aViewOpt.IsShowBookmarks(true) && pDocDispItem->m_bBookmarks) ||
242 (!aViewOpt.IsParagraph( true ) && pDocDispItem->m_bParagraphEnd) ||
243 (!aViewOpt.IsLineBreak( true ) && pDocDispItem->m_bManualBreak) )
244 {
245 aViewOpt.SetViewMetaChars(true);
246 if(pBindings)
247 pBindings->Invalidate(FN_VIEW_META_CHARS);
248 }
249
250 }
251 pDocDispItem->FillViewOptions( aViewOpt );
252 if(pBindings)
253 {
254 pBindings->Invalidate(FN_VIEW_GRAPHIC);
256 }
257 }
258
259 // Elements - interpret Item
260 bool bReFoldOutlineFolding = false;
261 if( const SwElemItem* pElemItem = rSet.GetItemIfSet( FN_PARAM_ELEM, false ) )
262 {
263 pElemItem->FillViewOptions( aViewOpt );
264
265 // Outline-folding options
266 if (SwWrtShell* pWrtShell = GetActiveWrtShell())
267 {
268 bool bIsOutlineFoldingOn = pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton();
269 bool bTreatSubsChanged = aViewOpt.IsTreatSubOutlineLevelsAsContent()
270 != pWrtShell->GetViewOptions()->IsTreatSubOutlineLevelsAsContent();
271 if (bIsOutlineFoldingOn &&
272 (!aViewOpt.IsShowOutlineContentVisibilityButton() || bTreatSubsChanged))
273 {
274 // Outline-folding options have change which require to show all content.
275 // Either outline-folding is being switched off or outline-folding is currently on
276 // and the treat subs option has changed.
277 pWrtShell->GetView().GetViewFrame().GetDispatcher()->Execute(FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON);
278 if (bTreatSubsChanged)
279 bReFoldOutlineFolding = true; // folding method changed, set flag to refold below
280 }
281 else
282 {
283 // Refold needs to be done when outline-folding is being turned on or off
284 bReFoldOutlineFolding =
285 pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton() !=
287 }
288 }
289 }
290
291 if( const SfxUInt16Item* pMetricItem = rSet.GetItemIfSet(SID_ATTR_METRIC, false ) )
292 {
294 PutItem(*pMetricItem);
295 ::SetDfltMetric(static_cast<FieldUnit>(pMetricItem->GetValue()), !bTextDialog);
296 }
297 if( const SfxBoolItem* pCharItem = rSet.GetItemIfSet(SID_ATTR_APPLYCHARUNIT,
298 false ) )
299 {
301 ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog);
302 }
303
304 if( const SfxUInt16Item* pMetricItem = rSet.GetItemIfSet(FN_HSCROLL_METRIC, false ) )
305 {
306 FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
307 pPref->SetHScrollMetric(eUnit);
308 if(pAppView)
309 pAppView->ChangeTabMetric(eUnit);
310 }
311
312 if( const SfxUInt16Item* pMetricItem = rSet.GetItemIfSet(FN_VSCROLL_METRIC, false ) )
313 {
314 FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
315 pPref->SetVScrollMetric(eUnit);
316 if(pAppView)
317 pAppView->ChangeVRulerMetric(eUnit);
318 }
319
320 if( const SfxUInt16Item* pItem = rSet.GetItemIfSet(SID_ATTR_DEFTABSTOP, false ) )
321 {
322 sal_uInt16 nTabDist = pItem->GetValue();
323 pPref->SetDefTabInMm100(convertTwipToMm100(nTabDist));
324 if(pAppView)
325 {
326 SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
327 MakeDefTabs( nTabDist, aDefTabs );
328 pAppView->GetWrtShell().SetDefault( aDefTabs );
329 }
330 }
331
332 // Background only in WebDialog
333 if(SfxItemState::SET == rSet.GetItemState(RES_BACKGROUND))
334 {
335 const SvxBrushItem& rBrushItem = rSet.Get(RES_BACKGROUND);
336 aViewOpt.SetRetoucheColor( rBrushItem.GetColor() );
337 }
338
339 // Interpret page Grid Settings
340 if( const SvxGridItem* pGridItem = rSet.GetItemIfSet( SID_ATTR_GRID_OPTIONS, false ))
341 {
342 aViewOpt.SetSnap( pGridItem->GetUseGridSnap() );
343 aViewOpt.SetSynchronize(pGridItem->GetSynchronize());
344 if( aViewOpt.IsGridVisible() != pGridItem->GetGridVisible() )
345 aViewOpt.SetGridVisible( pGridItem->GetGridVisible());
346 Size aSize( pGridItem->GetFieldDrawX(), pGridItem->GetFieldDrawY() );
347 if( aViewOpt.GetSnapSize() != aSize )
348 aViewOpt.SetSnapSize( aSize );
349 short nDiv = static_cast<short>(pGridItem->GetFieldDivisionX()) ;
350 if( aViewOpt.GetDivisionX() != nDiv )
351 aViewOpt.SetDivisionX( nDiv );
352 nDiv = static_cast<short>(pGridItem->GetFieldDivisionY());
353 if( aViewOpt.GetDivisionY() != nDiv )
354 aViewOpt.SetDivisionY( nDiv );
355
356 if(pBindings)
357 {
358 pBindings->Invalidate(SID_GRID_VISIBLE);
359 pBindings->Invalidate(SID_GRID_USE);
360 }
361 }
362
363 // Interpret Writer Printer Options
364 if( const SwAddPrinterItem* pAddPrinterAttr = rSet.GetItemIfSet( FN_PARAM_ADDPRINTER, false ) )
365 {
366 SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog);
367 if (pOpt)
368 {
369 *pOpt = *pAddPrinterAttr;
370 }
371 }
372
373 if( const SwShadowCursorItem* pItem = rSet.GetItemIfSet( FN_PARAM_SHADOWCURSOR, false ))
374 {
375 pItem->FillViewOptions( aViewOpt );
376 if(pBindings)
377 pBindings->Invalidate(FN_SHADOWCURSOR);
378 }
379
380 if( pAppView )
381 {
382 SwWrtShell &rWrtSh = pAppView->GetWrtShell();
383 const bool bAlignFormulas = rWrtSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
384 pPref->SetAlignMathObjectsToBaseline( bAlignFormulas );
385
386 // don't align formulas in documents that are currently loading
387 if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading())
389 }
390
391 if( const SfxBoolItem* pItem = rSet.GetItemIfSet( FN_PARAM_CRSR_IN_PROTECTED, false ))
392 {
393 aViewOpt.SetCursorInProtectedArea(pItem->GetValue());
394 }
395
396 // set elements for the current view and shell
397 ApplyUsrPref( aViewOpt, pAppView, bTextDialog? SvViewOpt::DestText : SvViewOpt::DestWeb);
398
399 // must be done after ApplyUsrPref
400 if (SfxItemState::SET != rSet.GetItemState(FN_PARAM_ELEM, false))
401 return;
402
403 if (bReFoldOutlineFolding)
404 {
405 if (SwWrtShell* pWrtShell = GetActiveWrtShell())
406 {
407 pWrtShell->GetView().GetViewFrame().GetDispatcher()->Execute(FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON);
408 pWrtShell->GetView().GetViewFrame().GetDispatcher()->Execute(FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON);
409 }
410 }
411}
412
413std::unique_ptr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet )
414{
415 std::unique_ptr<SfxTabPage> xRet;
416 SfxAllItemSet aSet(*(rSet.GetPool()));
417 switch( nId )
418 {
419 case RID_SW_TP_CONTENT_OPT:
420 case RID_SW_TP_HTML_CONTENT_OPT:
421 {
423 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
424 xRet = (*fnCreatePage)( pPage, pController, &rSet );
425 break;
426 }
427 case RID_SW_TP_HTML_OPTGRID_PAGE:
428 case RID_SVXPAGE_GRID:
429 xRet = SvxGridTabPage::Create(pPage, pController, rSet);
430 break;
431
432 case RID_SW_TP_STD_FONT:
433 case RID_SW_TP_STD_FONT_CJK:
434 case RID_SW_TP_STD_FONT_CTL:
435 {
437 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
438 xRet = (*fnCreatePage)( pPage, pController, &rSet );
439 if(RID_SW_TP_STD_FONT != nId)
440 {
441 aSet.Put (SfxUInt16Item(SID_FONTMODE_TYPE, RID_SW_TP_STD_FONT_CJK == nId ? FONT_GROUP_CJK : FONT_GROUP_CTL));
442 xRet->PageCreated(aSet);
443 }
444 }
445 break;
446 case RID_SW_TP_HTML_OPTPRINT_PAGE:
447 case RID_SW_TP_OPTPRINT_PAGE:
448 {
450 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
451 xRet = (*fnCreatePage)( pPage, pController, &rSet );
452 aSet.Put (SfxBoolItem(SID_FAX_LIST, true));
453 xRet->PageCreated(aSet);
454 }
455 break;
456 case RID_SW_TP_HTML_OPTTABLE_PAGE:
457 case RID_SW_TP_OPTTABLE_PAGE:
458 {
460 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
461 xRet = (*fnCreatePage)( pPage, pController, &rSet );
462 SwView* pCurrView = GetView();
463 if(pCurrView)
464 {
465 // if text then not WebView and vice versa
466 bool bWebView = dynamic_cast<SwWebView*>( pCurrView ) != nullptr;
467 if( (bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE == nId) ||
468 (!bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE != nId) )
469 {
470 aSet.Put (SwWrtShellItem(pCurrView->GetWrtShellPtr()));
471 xRet->PageCreated(aSet);
472 }
473 }
474 }
475 break;
476 case RID_SW_TP_OPTSHDWCRSR:
477 case RID_SW_TP_HTML_OPTSHDWCRSR:
478 case RID_SW_TP_REDLINE_OPT:
479 case RID_SW_TP_COMPARISON_OPT:
480 case RID_SW_TP_OPTLOAD_PAGE:
481 case RID_SW_TP_OPTCOMPATIBILITY_PAGE:
482 case RID_SW_TP_MAILCONFIG:
483 {
485 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
486 xRet = (*fnCreatePage)( pPage, pController, &rSet );
487 if (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR)
488 {
489 SwView* pCurrView = GetView();
490 if(pCurrView)
491 {
492 aSet.Put( SwWrtShellItem( pCurrView->GetWrtShellPtr() ) );
493 xRet->PageCreated(aSet);
494 }
495 }
496 }
497 break;
498 case RID_SW_TP_OPTTEST_PAGE:
499 {
501 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
502 xRet = (*fnCreatePage)( pPage, pController, &rSet );
503 break;
504 }
505 case RID_SW_TP_BACKGROUND:
506 {
508 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG );
509 xRet = (*fnCreatePage)( pPage, pController, &rSet );
510 xRet->PageCreated( rSet );
511 break;
512 }
513 case RID_SW_TP_OPTCAPTION_PAGE:
514 {
516 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SW_TP_OPTCAPTION_PAGE );
517 xRet = (*fnCreatePage)( pPage, pController, &rSet );
518 }
519 break;
520 }
521
522 if(!xRet)
523 SAL_WARN( "sw", "SwModule::CreateTabPage(): Unknown tabpage id " << nId );
524 return xRet;
525}
526
527/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define COMPLEX
#define ASIAN
constexpr auto convertTwipToMm100(N n)
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.
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
static LanguageType resolveSystemLanguageByScriptType(LanguageType nLang, sal_Int16 nType)
static SfxAbstractDialogFactory * Create()
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
static void SetOptions(const SfxItemSet &)
void Invalidate(sal_uInt16 nId)
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 * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
void PutItem(const SfxPoolItem &rItem)
SfxItemPool & GetPool() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
SfxViewFrame & GetViewFrame() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
css::uno::Any GetProperty(std::u16string_view rPropertyName) const
const Color & GetColor() const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
void SetFieldDrawX(sal_uInt32 nSet)
void SetUseGridSnap(bool bSet)
void SetFieldDrawY(sal_uInt32 nSet)
void SetSynchronize(bool bSet)
void SetGridVisible(bool bSet)
void SetFieldDivisionY(sal_uInt32 nSet)
void SetFieldDivisionX(sal_uInt32 nSet)
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
Item for settings dialog - document view.
Definition: cfgitems.hxx:42
bool IsInReading() const
Definition: doc.hxx:969
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:190
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Query default attribute of document.
Definition: edatmisc.cxx:93
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in document.
Definition: edatmisc.cxx:84
void AlignAllFormulasToBaseline()
aligns all formulas with anchor 'as char' to baseline
Definition: fefly1.cxx:2156
FieldUnit GetHScrollMetric() const
Definition: usrpref.hxx:217
void SetDefTabInMm100(sal_Int32 nSet, bool bNoModify=false)
Definition: usrpref.hxx:245
void SetAlignMathObjectsToBaseline(bool bVal, bool noModify=false)
Definition: usrpref.hxx:262
FieldUnit GetMetric() const
Definition: usrpref.hxx:208
void SetVScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:226
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
sal_Int32 GetDefTabInMm100() const
Definition: usrpref.hxx:244
bool IsApplyCharUnit() const
Definition: usrpref.hxx:232
void SetHScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:218
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
Definition: apphdl.cxx:1076
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pWebUsrPref
Definition: swmodule.hxx:81
SwView * GetView()
Definition: swmodule.hxx:146
SwStdFontConfig * GetStdFontConfig()
Definition: swmodule.hxx:172
virtual std::unique_ptr< SfxTabPage > CreateTabPage(sal_uInt16 nId, weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet) override
Definition: appopt.cxx:413
SwPrintOptions * GetPrtOptions(bool bWeb)
Definition: swmodul1.cxx:346
virtual void ApplyItemSet(sal_uInt16 nId, const SfxItemSet &rSet) override
Definition: appopt.cxx:214
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pUsrPref
Definition: swmodule.hxx:80
void ApplyUsrPref(const SwViewOption &, SwView *, SvViewOpt nDest=SvViewOpt::DestView)
Definition: swmodul1.cxx:136
virtual std::optional< SfxItemSet > CreateItemSet(sal_uInt16 nId) override
Definition: appopt.cxx:64
View of a document.
Definition: pview.hxx:162
Item for settings dialog, ShadowCursorPage.
Definition: cfgitems.hxx:117
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:369
bool IsSynchronize() const
Definition: viewopt.hxx:551
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:383
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:351
bool IsShowOutlineContentVisibilityButton() const
Definition: viewopt.cxx:177
void SetSynchronize(bool b)
Definition: viewopt.hxx:553
bool IsGridVisible() const
Definition: viewopt.hxx:532
short GetDivisionY() const
Definition: viewopt.hxx:610
void SetCursorInProtectedArea(bool b)
Definition: viewopt.hxx:583
const Color & GetRetoucheColor() const
Definition: viewopt.hxx:742
bool IsTreatSubOutlineLevelsAsContent() const
Definition: viewopt.cxx:182
void SetGridVisible(bool b)
Definition: viewopt.hxx:534
void SetSnapSize(Size const &rSz)
Definition: viewopt.hxx:529
const Size & GetSnapSize() const
Definition: viewopt.hxx:530
bool IsCursorInProtectedArea() const
Definition: viewopt.hxx:580
void SetSnap(bool b)
Definition: viewopt.hxx:526
void SetDivisionX(short n)
Definition: viewopt.hxx:609
bool IsViewMetaChars() const
Definition: viewopt.hxx:546
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:389
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:342
short GetDivisionX() const
Definition: viewopt.hxx:608
void SetDivisionY(short n)
Definition: viewopt.hxx:611
void SetRetoucheColor(const Color &r)
Definition: viewopt.hxx:743
bool IsSnap() const
Definition: viewopt.hxx:524
void SetViewMetaChars(bool b)
Definition: viewopt.hxx:548
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:452
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2819
SwDoc * GetDoc() const
Definition: viewsh.hxx:308
Definition: view.hxx:146
void GetHRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:684
SwWrtShell & GetWrtShell() const
Definition: view.hxx:423
void GetVRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:679
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:670
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:424
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:661
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
#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_PARAM_SHADOWCURSOR
Definition: cmdid.h:838
#define FN_VIEW_GRAPHIC
Definition: cmdid.h:158
#define FN_SHADOWCURSOR
Definition: cmdid.h:547
#define FN_PARAM_STDFONTS
Definition: cmdid.h:827
#define FN_PARAM_ADDPRINTER
Definition: cmdid.h:803
#define FN_VIEW_HIDDEN_PARA
Definition: cmdid.h:179
#define FN_PARAM_WRTSHELL
Definition: cmdid.h:829
#define FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON
Definition: cmdid.h:196
#define FN_PARAM_DOCDISP
Definition: cmdid.h:804
#define FN_VIEW_META_CHARS
Definition: cmdid.h:166
#define FN_HSCROLL_METRIC
Definition: cmdid.h:185
#define FN_PARAM_CRSR_IN_PROTECTED
Definition: cmdid.h:842
float u
FieldUnit
#define FONT_GROUP_CTL
Definition: fontcfg.hxx:48
#define FONT_GROUP_CJK
Definition: fontcfg.hxx:47
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
HTMLMODE_ON
#define SAL_WARN(area, stream)
constexpr auto toTwips(N number, Length from)
sal_Int16 nId
static SfxItemSet & rSet
static LanguageType nLang
Definition: srtdlg.cxx:51
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:763
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:650
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:878
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:638
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)