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