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 SwWrtShell* pWrtShell = GetActiveWrtShell();
267 bool bIsOutlineFoldingOn = pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton();
268 bool bTreatSubsChanged = aViewOpt.IsTreatSubOutlineLevelsAsContent()
270 if (bIsOutlineFoldingOn &&
271 (!aViewOpt.IsShowOutlineContentVisibilityButton() || bTreatSubsChanged))
272 {
273 // Outline-folding options have change which require to show all content.
274 // Either outline-folding is being switched off or outline-folding is currently on
275 // and the treat subs option has changed.
277 if (bTreatSubsChanged)
278 bReFoldOutlineFolding = true; // folding method changed, set flag to refold below
279 }
280 else
281 {
282 // Refold needs to be done when outline-folding is being turned on or off
283 bReFoldOutlineFolding =
286 }
287 }
288
289 if( const SfxUInt16Item* pMetricItem = rSet.GetItemIfSet(SID_ATTR_METRIC, false ) )
290 {
292 PutItem(*pMetricItem);
293 ::SetDfltMetric(static_cast<FieldUnit>(pMetricItem->GetValue()), !bTextDialog);
294 }
295 if( const SfxBoolItem* pCharItem = rSet.GetItemIfSet(SID_ATTR_APPLYCHARUNIT,
296 false ) )
297 {
299 ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog);
300 }
301
302 if( const SfxUInt16Item* pMetricItem = rSet.GetItemIfSet(FN_HSCROLL_METRIC, false ) )
303 {
304 FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
305 pPref->SetHScrollMetric(eUnit);
306 if(pAppView)
307 pAppView->ChangeTabMetric(eUnit);
308 }
309
310 if( const SfxUInt16Item* pMetricItem = rSet.GetItemIfSet(FN_VSCROLL_METRIC, false ) )
311 {
312 FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
313 pPref->SetVScrollMetric(eUnit);
314 if(pAppView)
315 pAppView->ChangeVRulerMetric(eUnit);
316 }
317
318 if( const SfxUInt16Item* pItem = rSet.GetItemIfSet(SID_ATTR_DEFTABSTOP, false ) )
319 {
320 sal_uInt16 nTabDist = pItem->GetValue();
321 pPref->SetDefTabInMm100(convertTwipToMm100(nTabDist));
322 if(pAppView)
323 {
324 SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
325 MakeDefTabs( nTabDist, aDefTabs );
326 pAppView->GetWrtShell().SetDefault( aDefTabs );
327 }
328 }
329
330 // Background only in WebDialog
331 if(SfxItemState::SET == rSet.GetItemState(RES_BACKGROUND))
332 {
333 const SvxBrushItem& rBrushItem = rSet.Get(RES_BACKGROUND);
334 aViewOpt.SetRetoucheColor( rBrushItem.GetColor() );
335 }
336
337 // Interpret page Grid Settings
338 if( const SvxGridItem* pGridItem = rSet.GetItemIfSet( SID_ATTR_GRID_OPTIONS, false ))
339 {
340 aViewOpt.SetSnap( pGridItem->GetUseGridSnap() );
341 aViewOpt.SetSynchronize(pGridItem->GetSynchronize());
342 if( aViewOpt.IsGridVisible() != pGridItem->GetGridVisible() )
343 aViewOpt.SetGridVisible( pGridItem->GetGridVisible());
344 Size aSize( pGridItem->GetFieldDrawX(), pGridItem->GetFieldDrawY() );
345 if( aViewOpt.GetSnapSize() != aSize )
346 aViewOpt.SetSnapSize( aSize );
347 short nDiv = static_cast<short>(pGridItem->GetFieldDivisionX()) ;
348 if( aViewOpt.GetDivisionX() != nDiv )
349 aViewOpt.SetDivisionX( nDiv );
350 nDiv = static_cast<short>(pGridItem->GetFieldDivisionY());
351 if( aViewOpt.GetDivisionY() != nDiv )
352 aViewOpt.SetDivisionY( nDiv );
353
354 if(pBindings)
355 {
356 pBindings->Invalidate(SID_GRID_VISIBLE);
357 pBindings->Invalidate(SID_GRID_USE);
358 }
359 }
360
361 // Interpret Writer Printer Options
362 if( const SwAddPrinterItem* pAddPrinterAttr = rSet.GetItemIfSet( FN_PARAM_ADDPRINTER, false ) )
363 {
364 SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog);
365 if (pOpt)
366 {
367 *pOpt = *pAddPrinterAttr;
368 }
369 }
370
371 if( const SwShadowCursorItem* pItem = rSet.GetItemIfSet( FN_PARAM_SHADOWCURSOR, false ))
372 {
373 pItem->FillViewOptions( aViewOpt );
374 if(pBindings)
375 pBindings->Invalidate(FN_SHADOWCURSOR);
376 }
377
378 if( pAppView )
379 {
380 SwWrtShell &rWrtSh = pAppView->GetWrtShell();
381 const bool bAlignFormulas = rWrtSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
382 pPref->SetAlignMathObjectsToBaseline( bAlignFormulas );
383
384 // don't align formulas in documents that are currently loading
385 if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading())
387 }
388
389 if( const SfxBoolItem* pItem = rSet.GetItemIfSet( FN_PARAM_CRSR_IN_PROTECTED, false ))
390 {
391 aViewOpt.SetCursorInProtectedArea(pItem->GetValue());
392 }
393
394 // set elements for the current view and shell
395 ApplyUsrPref( aViewOpt, pAppView, bTextDialog? SvViewOpt::DestText : SvViewOpt::DestWeb);
396
397 // must be done after ApplyUsrPref
398 if (SfxItemState::SET != rSet.GetItemState(FN_PARAM_ELEM, false))
399 return;
400
401 if (bReFoldOutlineFolding)
402 {
405 }
406}
407
408std::unique_ptr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet )
409{
410 std::unique_ptr<SfxTabPage> xRet;
411 SfxAllItemSet aSet(*(rSet.GetPool()));
412 switch( nId )
413 {
414 case RID_SW_TP_CONTENT_OPT:
415 case RID_SW_TP_HTML_CONTENT_OPT:
416 {
418 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
419 xRet = (*fnCreatePage)( pPage, pController, &rSet );
420 break;
421 }
422 case RID_SW_TP_HTML_OPTGRID_PAGE:
423 case RID_SVXPAGE_GRID:
424 xRet = SvxGridTabPage::Create(pPage, pController, rSet);
425 break;
426
427 case RID_SW_TP_STD_FONT:
428 case RID_SW_TP_STD_FONT_CJK:
429 case RID_SW_TP_STD_FONT_CTL:
430 {
432 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
433 xRet = (*fnCreatePage)( pPage, pController, &rSet );
434 if(RID_SW_TP_STD_FONT != nId)
435 {
436 aSet.Put (SfxUInt16Item(SID_FONTMODE_TYPE, RID_SW_TP_STD_FONT_CJK == nId ? FONT_GROUP_CJK : FONT_GROUP_CTL));
437 xRet->PageCreated(aSet);
438 }
439 }
440 break;
441 case RID_SW_TP_HTML_OPTPRINT_PAGE:
442 case RID_SW_TP_OPTPRINT_PAGE:
443 {
445 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
446 xRet = (*fnCreatePage)( pPage, pController, &rSet );
447 aSet.Put (SfxBoolItem(SID_FAX_LIST, true));
448 xRet->PageCreated(aSet);
449 }
450 break;
451 case RID_SW_TP_HTML_OPTTABLE_PAGE:
452 case RID_SW_TP_OPTTABLE_PAGE:
453 {
455 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
456 xRet = (*fnCreatePage)( pPage, pController, &rSet );
457 SwView* pCurrView = GetView();
458 if(pCurrView)
459 {
460 // if text then not WebView and vice versa
461 bool bWebView = dynamic_cast<SwWebView*>( pCurrView ) != nullptr;
462 if( (bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE == nId) ||
463 (!bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE != nId) )
464 {
465 aSet.Put (SwWrtShellItem(pCurrView->GetWrtShellPtr()));
466 xRet->PageCreated(aSet);
467 }
468 }
469 }
470 break;
471 case RID_SW_TP_OPTSHDWCRSR:
472 case RID_SW_TP_HTML_OPTSHDWCRSR:
473 case RID_SW_TP_REDLINE_OPT:
474 case RID_SW_TP_COMPARISON_OPT:
475 case RID_SW_TP_OPTLOAD_PAGE:
476 case RID_SW_TP_OPTCOMPATIBILITY_PAGE:
477 case RID_SW_TP_MAILCONFIG:
478 {
480 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
481 xRet = (*fnCreatePage)( pPage, pController, &rSet );
482 if (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR)
483 {
484 SwView* pCurrView = GetView();
485 if(pCurrView)
486 {
487 aSet.Put( SwWrtShellItem( pCurrView->GetWrtShellPtr() ) );
488 xRet->PageCreated(aSet);
489 }
490 }
491 }
492 break;
493 case RID_SW_TP_OPTTEST_PAGE:
494 {
496 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
497 xRet = (*fnCreatePage)( pPage, pController, &rSet );
498 break;
499 }
500 case RID_SW_TP_BACKGROUND:
501 {
503 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG );
504 xRet = (*fnCreatePage)( pPage, pController, &rSet );
505 xRet->PageCreated( rSet );
506 break;
507 }
508 case RID_SW_TP_OPTCAPTION_PAGE:
509 {
511 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SW_TP_OPTCAPTION_PAGE );
512 xRet = (*fnCreatePage)( pPage, pController, &rSet );
513 }
514 break;
515 }
516
517 if(!xRet)
518 SAL_WARN( "sw", "SwModule::CreateTabPage(): Unknown tabpage id " << nId );
519 return xRet;
520}
521
522/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define COMPLEX
#define ASIAN
constexpr auto convertTwipToMm100(N n)
SfxApplication * SfxGetpApp()
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
void SetOptions(const SfxItemSet &)
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
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 SfxViewFrame * Current()
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
SfxViewFrame * GetViewFrame() const
static 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:962
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:182
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:2107
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:1083
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:408
SwPrintOptions * GetPrtOptions(bool bWeb)
Definition: swmodul1.cxx:347
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:137
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:313
bool IsSynchronize() const
Definition: viewopt.hxx:495
bool IsShowBookmarks(bool const bHard=false) const
Definition: viewopt.hxx:327
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:295
bool IsShowOutlineContentVisibilityButton() const
Definition: viewopt.cxx:100
void SetSynchronize(bool b)
Definition: viewopt.hxx:497
bool IsGridVisible() const
Definition: viewopt.hxx:476
short GetDivisionY() const
Definition: viewopt.hxx:554
void SetCursorInProtectedArea(bool b)
Definition: viewopt.hxx:527
const Color & GetRetoucheColor() const
Definition: viewopt.hxx:686
bool IsTreatSubOutlineLevelsAsContent() const
Definition: viewopt.cxx:105
void SetGridVisible(bool b)
Definition: viewopt.hxx:478
void SetSnapSize(Size const &rSz)
Definition: viewopt.hxx:473
const Size & GetSnapSize() const
Definition: viewopt.hxx:474
bool IsCursorInProtectedArea() const
Definition: viewopt.hxx:524
void SetSnap(bool b)
Definition: viewopt.hxx:470
void SetDivisionX(short n)
Definition: viewopt.hxx:553
bool IsViewMetaChars() const
Definition: viewopt.hxx:490
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:333
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:286
short GetDivisionX() const
Definition: viewopt.hxx:552
void SetDivisionY(short n)
Definition: viewopt.hxx:555
void SetRetoucheColor(const Color &r)
Definition: viewopt.hxx:687
bool IsSnap() const
Definition: viewopt.hxx:468
void SetViewMetaChars(bool b)
Definition: viewopt.hxx:492
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:433
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2805
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
Definition: view.hxx:146
void GetHRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:657
SwWrtShell & GetWrtShell() const
Definition: view.hxx:416
void GetVRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:652
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:643
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:417
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:634
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
const SwView & GetView() const
Definition: wrtsh.hxx:443
#define FN_VSCROLL_METRIC
Definition: cmdid.h:181
#define FN_PARAM_PRINTER
Definition: cmdid.h:809
#define FN_PARAM_ELEM
Definition: cmdid.h:788
#define FN_PARAM_SHADOWCURSOR
Definition: cmdid.h:821
#define FN_VIEW_GRAPHIC
Definition: cmdid.h:156
#define FN_SHADOWCURSOR
Definition: cmdid.h:531
#define FN_PARAM_STDFONTS
Definition: cmdid.h:810
#define FN_PARAM_ADDPRINTER
Definition: cmdid.h:786
#define FN_VIEW_HIDDEN_PARA
Definition: cmdid.h:174
#define FN_PARAM_WRTSHELL
Definition: cmdid.h:812
#define FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON
Definition: cmdid.h:191
#define FN_PARAM_DOCDISP
Definition: cmdid.h:787
#define FN_VIEW_META_CHARS
Definition: cmdid.h:163
#define FN_HSCROLL_METRIC
Definition: cmdid.h:180
#define FN_PARAM_CRSR_IN_PROTECTED
Definition: cmdid.h:825
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< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
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:762
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:649
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:877
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:637
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)