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 #include <ndtxt.hxx>
60 
61 using namespace ::com::sun::star::uno;
62 using namespace ::com::sun::star::lang;
63 
64 std::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
88  SfxItemSet aRet(
89  GetPool(),
90  svl::Items<
93  SID_PRINTPREVIEW, SID_PRINTPREVIEW,
94  SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS,
95  SID_HTML_MODE, SID_HTML_MODE,
96  SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE,
97  SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
98  SID_ATTR_LANGUAGE, SID_ATTR_METRIC,
99  SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
100  SID_ATTR_APPLYCHARUNIT, SID_ATTR_APPLYCHARUNIT,
108 
109  aRet.Put( SwDocDisplayItem( aViewOpt ) );
110  aRet.Put( SwElemItem( aViewOpt ) );
111  if( bTextDialog )
112  {
113  aRet.Put( SwShadowCursorItem( aViewOpt ));
115  }
116 
117  if( pAppView )
118  {
119  SwWrtShell& rWrtShell = pAppView->GetWrtShell();
120 
121  SfxPrinter* pPrt = rWrtShell.getIDocumentDeviceAccess().getPrinter( false );
122  if( pPrt )
123  aRet.Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));
124  aRet.Put(SwPtrItem(FN_PARAM_WRTSHELL, &rWrtShell));
125 
126  aRet.Put(rWrtShell.GetDefault(RES_CHRATR_LANGUAGE).CloneSetWhich(SID_ATTR_LANGUAGE));
127  aRet.Put(rWrtShell.GetDefault(RES_CHRATR_CJK_LANGUAGE).CloneSetWhich(SID_ATTR_CHAR_CJK_LANGUAGE));
128  aRet.Put(rWrtShell.GetDefault(RES_CHRATR_CTL_LANGUAGE).CloneSetWhich(SID_ATTR_CHAR_CTL_LANGUAGE));
129  }
130  else
131  {
132  SvtLinguConfig aLinguCfg;
133  css::lang::Locale aLocale;
135 
136  using namespace ::com::sun::star::i18n::ScriptType;
137 
138  Any aLang = aLinguCfg.GetProperty("DefaultLocale");
139  aLang >>= aLocale;
141  aRet.Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE));
142 
143  aLang = aLinguCfg.GetProperty("DefaultLocale_CJK");
144  aLang >>= aLocale;
146  aRet.Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE));
147 
148  aLang = aLinguCfg.GetProperty("DefaultLocale_CTL");
149  aLang >>= aLocale;
151  aRet.Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE));
152  }
153  if(bTextDialog)
155  if( dynamic_cast<SwPagePreview*>( SfxViewShell::Current())!=nullptr )
156  {
157  SfxBoolItem aBool(SfxBoolItem(SID_PRINTPREVIEW, true));
158  aRet.Put(aBool);
159  }
160 
161  FieldUnit eUnit = pPref->GetHScrollMetric();
162  if(pAppView)
163  pAppView->GetHRulerMetric(eUnit);
164  aRet.Put(SfxUInt16Item( FN_HSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit)));
165 
166  eUnit = pPref->GetVScrollMetric();
167  if(pAppView)
168  pAppView->GetVRulerMetric(eUnit);
169  aRet.Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit) ));
170  aRet.Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(pPref->GetMetric()) ));
171  aRet.Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, pPref->IsApplyCharUnit()));
172  if(bTextDialog)
173  {
174  if(pAppView)
175  {
176  const SvxTabStopItem& rDefTabs =
178  aRet.Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, o3tl::narrowing<sal_uInt16>(::GetTabDist(rDefTabs))));
179  }
180  else
181  aRet.Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, o3tl::toTwips(pPref->GetDefTabInMm100(), o3tl::Length::mm100)));
182  }
183 
184  // Options for GridTabPage
185  SvxGridItem aGridItem( SID_ATTR_GRID_OPTIONS);
186 
187  aGridItem.SetUseGridSnap( aViewOpt.IsSnap());
188  aGridItem.SetSynchronize( aViewOpt.IsSynchronize());
189  aGridItem.SetGridVisible( aViewOpt.IsGridVisible());
190 
191  const Size& rSnapSize = aViewOpt.GetSnapSize();
192  aGridItem.SetFieldDrawX( o3tl::narrowing<sal_uInt16>(rSnapSize.Width() ));
193  aGridItem.SetFieldDrawY( o3tl::narrowing<sal_uInt16>(rSnapSize.Height()));
194 
195  aGridItem.SetFieldDivisionX( aViewOpt.GetDivisionX());
196  aGridItem.SetFieldDivisionY( aViewOpt.GetDivisionY());
197 
198  aRet.Put(aGridItem);
199 
200  // Options for PrintTabPage
201  const SwPrintData* pOpt = GetPrtOptions(!bTextDialog);
202  SwAddPrinterItem aAddPrinterItem(*pOpt );
203  aRet.Put(aAddPrinterItem);
204 
205  // Options for Web
206  if(!bTextDialog)
207  {
208  aRet.Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND));
209  aRet.Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON));
210  }
211 
212  return aRet;
213 }
214 
215 void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
216 {
217  bool bTextDialog = nId == SID_SW_EDITOPTIONS;
218  SwView* pAppView = GetView();
219  if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current())
220  pAppView = nullptr;
221  if(pAppView)
222  {
223  // the text dialog mustn't apply data to the web view and vice versa
224  bool bWebView = dynamic_cast<SwWebView*>( pAppView ) != nullptr;
225  if(bWebView == bTextDialog)
226  pAppView = nullptr;
227  }
228 
229  SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
230  SwMasterUsrPref* pPref = bTextDialog ? m_pUsrPref.get() : m_pWebUsrPref.get();
231 
232  const SfxPoolItem* pItem;
233  SfxBindings *pBindings = pAppView ? &pAppView->GetViewFrame()->GetBindings()
234  : nullptr;
235 
236  // Interpret the page Documentview
237  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_DOCDISP, false, &pItem ))
238  {
239  const SwDocDisplayItem* pDocDispItem = static_cast<const SwDocDisplayItem*>(pItem);
240 
241  if(!aViewOpt.IsViewMetaChars())
242  {
243  if( (!aViewOpt.IsTab( true ) && pDocDispItem->m_bTab) ||
244  (!aViewOpt.IsBlank( true ) && pDocDispItem->m_bSpace) ||
245  (!aViewOpt.IsShowBookmarks(true) && pDocDispItem->m_bBookmarks) ||
246  (!aViewOpt.IsParagraph( true ) && pDocDispItem->m_bParagraphEnd) ||
247  (!aViewOpt.IsLineBreak( true ) && pDocDispItem->m_bManualBreak) )
248  {
249  aViewOpt.SetViewMetaChars(true);
250  if(pBindings)
251  pBindings->Invalidate(FN_VIEW_META_CHARS);
252  }
253 
254  }
255  pDocDispItem->FillViewOptions( aViewOpt );
256  if(pBindings)
257  {
258  pBindings->Invalidate(FN_VIEW_GRAPHIC);
259  pBindings->Invalidate(FN_VIEW_HIDDEN_PARA);
260  }
261  }
262 
263  // Elements - interpret Item
264  bool bFlag = true;
265  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ELEM, false, &pItem ) )
266  {
267  const SwElemItem* pElemItem = static_cast<const SwElemItem*>(pItem);
268  pElemItem->FillViewOptions( aViewOpt );
269 
270  SwWrtShell* pWrtShell = GetActiveWrtShell();
272  bool bTreatSubsChanged = aViewOpt.IsTreatSubOutlineLevelsAsContent()
274  if (bFlag && (!aViewOpt.IsShowOutlineContentVisibilityButton() || bTreatSubsChanged))
275  {
276  // outline mode options have change which require to show all content
278 
279  if (bTreatSubsChanged)
280  bFlag = false; // folding method changed, set bFlag false to refold below
281  }
282  }
283 
284  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_METRIC, false, &pItem ) )
285  {
286  SfxGetpApp()->SetOptions(rSet);
287  PutItem(*pItem);
288  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
289  ::SetDfltMetric(static_cast<FieldUnit>(pMetricItem->GetValue()), !bTextDialog);
290  }
291  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT,
292  false, &pItem ) )
293  {
294  SfxGetpApp()->SetOptions(rSet);
295  const SfxBoolItem* pCharItem = static_cast<const SfxBoolItem*>(pItem);
296  ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog);
297  }
298 
299  if( SfxItemState::SET == rSet.GetItemState(FN_HSCROLL_METRIC, false, &pItem ) )
300  {
301  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
302  FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
303  pPref->SetHScrollMetric(eUnit);
304  if(pAppView)
305  pAppView->ChangeTabMetric(eUnit);
306  }
307 
308  if( SfxItemState::SET == rSet.GetItemState(FN_VSCROLL_METRIC, false, &pItem ) )
309  {
310  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
311  FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
312  pPref->SetVScrollMetric(eUnit);
313  if(pAppView)
314  pAppView->ChangeVRulerMetric(eUnit);
315  }
316 
317  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, false, &pItem ) )
318  {
319  sal_uInt16 nTabDist = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
320  pPref->SetDefTabInMm100(convertTwipToMm100(nTabDist));
321  if(pAppView)
322  {
323  SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
324  MakeDefTabs( nTabDist, aDefTabs );
325  pAppView->GetWrtShell().SetDefault( aDefTabs );
326  }
327  }
328 
329  // Background only in WebDialog
330  if(SfxItemState::SET == rSet.GetItemState(RES_BACKGROUND))
331  {
332  const SvxBrushItem& rBrushItem = rSet.Get(RES_BACKGROUND);
333  aViewOpt.SetRetoucheColor( rBrushItem.GetColor() );
334  }
335 
336  // Interpret page Grid Settings
337  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, false, &pItem ))
338  {
339  const SvxGridItem* pGridItem = static_cast<const SvxGridItem*>(pItem);
340 
341  aViewOpt.SetSnap( pGridItem->GetUseGridSnap() );
342  aViewOpt.SetSynchronize(pGridItem->GetSynchronize());
343  if( aViewOpt.IsGridVisible() != pGridItem->GetGridVisible() )
344  aViewOpt.SetGridVisible( pGridItem->GetGridVisible());
345  Size aSize( pGridItem->GetFieldDrawX(), pGridItem->GetFieldDrawY() );
346  if( aViewOpt.GetSnapSize() != aSize )
347  aViewOpt.SetSnapSize( aSize );
348  short nDiv = static_cast<short>(pGridItem->GetFieldDivisionX()) ;
349  if( aViewOpt.GetDivisionX() != nDiv )
350  aViewOpt.SetDivisionX( nDiv );
351  nDiv = static_cast<short>(pGridItem->GetFieldDivisionY());
352  if( aViewOpt.GetDivisionY() != nDiv )
353  aViewOpt.SetDivisionY( nDiv );
354 
355  if(pBindings)
356  {
357  pBindings->Invalidate(SID_GRID_VISIBLE);
358  pBindings->Invalidate(SID_GRID_USE);
359  }
360  }
361 
362  // Interpret Writer Printer Options
363  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, false, &pItem ))
364  {
365  SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog);
366  if (pOpt)
367  {
368  const SwAddPrinterItem* pAddPrinterAttr = static_cast<const SwAddPrinterItem*>(pItem);
369  *pOpt = *pAddPrinterAttr;
370  }
371 
372  }
373 
374  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, false, &pItem ))
375  {
376  static_cast<const SwShadowCursorItem*>(pItem)->FillViewOptions( aViewOpt );
377  if(pBindings)
378  pBindings->Invalidate(FN_SHADOWCURSOR);
379  }
380 
381  if( pAppView )
382  {
383  SwWrtShell &rWrtSh = pAppView->GetWrtShell();
384  const bool bAlignFormulas = rWrtSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
385  pPref->SetAlignMathObjectsToBaseline( bAlignFormulas );
386 
387  // don't align formulas in documents that are currently loading
388  if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading())
390  }
391 
392  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, false, &pItem ))
393  {
394  aViewOpt.SetCursorInProtectedArea(static_cast<const SfxBoolItem*>(pItem)->GetValue());
395  }
396 
397  // set elements for the current view and shell
398  ApplyUsrPref( aViewOpt, pAppView, bTextDialog? SvViewOpt::DestText : SvViewOpt::DestWeb);
399 
400  // must be done after ApplyUsrPref
401  if (SfxItemState::SET != rSet.GetItemState(FN_PARAM_ELEM, false))
402  return;
403 
404  if (!bFlag)
406 }
407 
408 std::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: */
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in document.
Definition: edatmisc.cxx:84
SfxViewFrame * GetViewFrame() const
bool GetValue() const
bool IsSynchronize() const
Definition: viewopt.hxx:380
sal_uInt32 GetFieldDivisionY() const
bool IsViewMetaChars() const
Definition: viewopt.hxx:375
#define FONT_GROUP_CTL
Definition: fontcfg.hxx:48
#define FN_VIEW_GRAPHIC
Definition: cmdid.h:152
const Color & GetRetoucheColor() const
Definition: viewopt.hxx:578
FieldUnit
void GetHRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:641
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()
static constexpr auto Items
std::string GetValue
#define FN_PARAM_ELEM
Definition: cmdid.h:767
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:618
SwStdFontConfig * GetStdFontConfig()
Definition: swmodule.hxx:173
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:155
void SetFieldDrawY(sal_uInt32 nSet)
SwPrintOptions * GetPrtOptions(bool bWeb)
Definition: swmodul1.cxx:344
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
sal_uInt32 GetFieldDrawX() const
void SetHScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:218
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
bool IsApplyCharUnit() const
Definition: usrpref.hxx:232
sal_uInt16 GetValue() const
static LanguageType resolveSystemLanguageByScriptType(LanguageType nLang, sal_Int16 nType)
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:659
#define ASIAN
void SetFieldDivisionY(sal_uInt32 nSet)
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pWebUsrPref
Definition: swmodule.hxx:82
void SetVScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:226
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
Definition: apphdl.cxx:1044
#define FN_HSCROLL_METRIC
Definition: cmdid.h:176
void SetAlignMathObjectsToBaseline(bool bVal, bool noModify=false)
Definition: usrpref.hxx:262
#define FN_PARAM_SHADOWCURSOR
Definition: cmdid.h:805
virtual void ApplyItemSet(sal_uInt16 nId, const SfxItemSet &rSet) override
Definition: appopt.cxx:215
void Invalidate(sal_uInt16 nId)
#define FN_PARAM_ADDPRINTER
Definition: cmdid.h:765
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:177
constexpr auto convertTwipToMm100(N n)
Used by the UI to modify the document model.
Definition: wrtsh.hxx:93
constexpr tools::Long Width() const
#define FN_PARAM_DOCDISP
Definition: cmdid.h:766
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:408
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
#define FN_PARAM_PRINTER
Definition: cmdid.h:793
#define FN_PARAM_CRSR_IN_PROTECTED
Definition: cmdid.h:809
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:2670
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
bool GetUseGridSnap() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SfxBindings & GetBindings()
#define FN_PARAM_WRTSHELL
Definition: cmdid.h:796
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)
sal_uInt32 GetFieldDivisionX() const
#define FN_PARAM_STDFONTS
Definition: cmdid.h:794
virtual std::optional< SfxItemSet > CreateItemSet(sal_uInt16 nId) override
Definition: appopt.cxx:64
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:219
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:77
#define FN_SHADOWCURSOR
Definition: cmdid.h:514
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:2200
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:888
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:647
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:954
#define FONT_GROUP_CJK
Definition: fontcfg.hxx:47
bool GetSynchronize() const
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:423
void SetRetoucheColor(const Color &r)
Definition: viewopt.hxx:579
void AlignAllFormulasToBaseline()
aligns all formulas with anchor 'as char' to baseline
Definition: fefly1.cxx:2111
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:170
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pUsrPref
Definition: swmodule.hxx:81
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:627
sal_uInt32 GetFieldDrawY() const
void GetVRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:636
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
#define FN_VIEW_META_CHARS
Definition: cmdid.h:159
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 m_bParagraphEnd
Definition: cfgitems.hxx:46
bool IsGridVisible() const
Definition: viewopt.hxx:366
#define SAL_WARN(area, stream)
css::uno::Any GetProperty(const OUString &rPropertyName) const
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
void SetGridVisible(bool b)
Definition: viewopt.hxx:368
bool GetGridVisible() const
bool IsSnap() const
Definition: viewopt.hxx:358
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:773
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:147
void ApplyUsrPref(const SwViewOption &, SwView *, SvViewOpt nDest=SvViewOpt::DestView)
Definition: swmodul1.cxx:137