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 <i18nlangtag/mslangid.hxx>
38 #include <fontcfg.hxx>
39 #include <swmodule.hxx>
40 #include <view.hxx>
41 #include <doc.hxx>
42 #include <wrtsh.hxx>
45 #include <uitool.hxx>
46 #include <wview.hxx>
47 #include <cfgitems.hxx>
48 #include <prtopt.hxx>
49 #include <pview.hxx>
50 #include <usrpref.hxx>
51 #include <uiitems.hxx>
52 #include <editeng/langitem.hxx>
53 #include <unotools/lingucfg.hxx>
54 #include <globals.hrc>
55 #include <swabstdlg.hxx>
56 #include <swwrtshitem.hxx>
57 
58 using namespace ::com::sun::star::uno;
59 using namespace ::com::sun::star::lang;
60 
61 std::unique_ptr<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId )
62 {
63  bool bTextDialog = (nId == SID_SW_EDITOPTIONS);
64 
65  // the options for the Web- and Textdialog are put together here
66  SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
67  SwMasterUsrPref* pPref = bTextDialog ? m_pUsrPref.get() : m_pWebUsrPref.get();
68  // no MakeUsrPref, because only options from textdoks can be used here
69  SwView* pAppView = GetView();
70  if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current())
71  pAppView = nullptr;
72  if(pAppView)
73  {
74  bool bWebView = dynamic_cast<SwWebView*>( pAppView ) != nullptr;
75  // if Text then no WebView and vice versa
76  if (bWebView != bTextDialog)
77  {
78  aViewOpt = *pAppView->GetWrtShell().GetViewOptions();
79  }
80  else
81  pAppView = nullptr; // with View, there's nothing to win here
82  }
83 
84  // Options/Edit
85  auto pRet = std::make_unique<SfxItemSet>(
86  GetPool(),
87  svl::Items<
90  SID_PRINTPREVIEW, SID_PRINTPREVIEW,
91  SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS,
92  SID_HTML_MODE, SID_HTML_MODE,
93  SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE,
94  SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
95  SID_ATTR_LANGUAGE, SID_ATTR_METRIC,
96  SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
97  SID_ATTR_APPLYCHARUNIT, SID_ATTR_APPLYCHARUNIT,
104  FN_PARAM_CRSR_IN_PROTECTED, FN_PARAM_CRSR_IN_PROTECTED>{});
105 
106  pRet->Put( SwDocDisplayItem( aViewOpt ) );
107  pRet->Put( SwElemItem( aViewOpt ) );
108  if( bTextDialog )
109  {
110  pRet->Put( SwShadowCursorItem( aViewOpt ));
111  pRet->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  pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));
121  pRet->Put(SwPtrItem(FN_PARAM_WRTSHELL, &rWrtShell));
122 
123  pRet->Put(rWrtShell.GetDefault(RES_CHRATR_LANGUAGE).CloneSetWhich(SID_ATTR_LANGUAGE));
124  pRet->Put(rWrtShell.GetDefault(RES_CHRATR_CJK_LANGUAGE).CloneSetWhich(SID_ATTR_CHAR_CJK_LANGUAGE));
125  pRet->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("DefaultLocale");
136  aLang >>= aLocale;
138  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE));
139 
140  aLang = aLinguCfg.GetProperty("DefaultLocale_CJK");
141  aLang >>= aLocale;
143  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE));
144 
145  aLang = aLinguCfg.GetProperty("DefaultLocale_CTL");
146  aLang >>= aLocale;
148  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE));
149  }
150  if(bTextDialog)
151  pRet->Put(SwPtrItem(FN_PARAM_STDFONTS, GetStdFontConfig()));
152  if( dynamic_cast<SwPagePreview*>( SfxViewShell::Current())!=nullptr )
153  {
154  SfxBoolItem aBool(SfxBoolItem(SID_PRINTPREVIEW, true));
155  pRet->Put(aBool);
156  }
157 
158  FieldUnit eUnit = pPref->GetHScrollMetric();
159  if(pAppView)
160  pAppView->GetHRulerMetric(eUnit);
161  pRet->Put(SfxUInt16Item( FN_HSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit)));
162 
163  eUnit = pPref->GetVScrollMetric();
164  if(pAppView)
165  pAppView->GetVRulerMetric(eUnit);
166  pRet->Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit) ));
167  pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(pPref->GetMetric()) ));
168  pRet->Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, pPref->IsApplyCharUnit()));
169  if(bTextDialog)
170  {
171  if(pAppView)
172  {
173  const SvxTabStopItem& rDefTabs =
175  pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(::GetTabDist(rDefTabs))));
176  }
177  else
178  pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(convertMm100ToTwip(pPref->GetDefTabInMm100()))));
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( static_cast<sal_uInt16>(rSnapSize.Width() ));
190  aGridItem.SetFieldDrawY( static_cast<sal_uInt16>(rSnapSize.Height()));
191 
192  aGridItem.SetFieldDivisionX( aViewOpt.GetDivisionX());
193  aGridItem.SetFieldDivisionY( aViewOpt.GetDivisionY());
194 
195  pRet->Put(aGridItem);
196 
197  // Options for PrintTabPage
198  const SwPrintData* pOpt = GetPrtOptions(!bTextDialog);
199  SwAddPrinterItem aAddPrinterItem(*pOpt );
200  pRet->Put(aAddPrinterItem);
201 
202  // Options for Web
203  if(!bTextDialog)
204  {
205  pRet->Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND));
206  pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON));
207  }
208 
209  return pRet;
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  const SfxPoolItem* pItem;
230  SfxBindings *pBindings = pAppView ? &pAppView->GetViewFrame()->GetBindings()
231  : nullptr;
232 
233  // Interpret the page Documentview
234  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_DOCDISP, false, &pItem ))
235  {
236  const SwDocDisplayItem* pDocDispItem = static_cast<const SwDocDisplayItem*>(pItem);
237 
238  if(!aViewOpt.IsViewMetaChars())
239  {
240  if( (!aViewOpt.IsTab( true ) && pDocDispItem->bTab) ||
241  (!aViewOpt.IsBlank( true ) && pDocDispItem->bSpace) ||
242  (!aViewOpt.IsParagraph( true ) && pDocDispItem->bParagraphEnd) ||
243  (!aViewOpt.IsLineBreak( true ) && pDocDispItem->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);
255  pBindings->Invalidate(FN_VIEW_HIDDEN_PARA);
256  }
257  }
258 
259  // Elements - interpret Item
260  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ELEM, false, &pItem ) )
261  {
262  const SwElemItem* pElemItem = static_cast<const SwElemItem*>(pItem);
263  pElemItem->FillViewOptions( aViewOpt );
264 
265  }
266 
267  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_METRIC, false, &pItem ) )
268  {
269  SfxGetpApp()->SetOptions(rSet);
270  PutItem(*pItem);
271  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
272  ::SetDfltMetric(static_cast<FieldUnit>(pMetricItem->GetValue()), !bTextDialog);
273  }
274  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT,
275  false, &pItem ) )
276  {
277  SfxGetpApp()->SetOptions(rSet);
278  const SfxBoolItem* pCharItem = static_cast<const SfxBoolItem*>(pItem);
279  ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog);
280  }
281 
282  if( SfxItemState::SET == rSet.GetItemState(FN_HSCROLL_METRIC, false, &pItem ) )
283  {
284  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
285  FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
286  pPref->SetHScrollMetric(eUnit);
287  if(pAppView)
288  pAppView->ChangeTabMetric(eUnit);
289  }
290 
291  if( SfxItemState::SET == rSet.GetItemState(FN_VSCROLL_METRIC, false, &pItem ) )
292  {
293  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
294  FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
295  pPref->SetVScrollMetric(eUnit);
296  if(pAppView)
297  pAppView->ChangeVRulerMetric(eUnit);
298  }
299 
300  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, false, &pItem ) )
301  {
302  sal_uInt16 nTabDist = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
303  pPref->SetDefTabInMm100(convertTwipToMm100(nTabDist));
304  if(pAppView)
305  {
306  SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
307  MakeDefTabs( nTabDist, aDefTabs );
308  pAppView->GetWrtShell().SetDefault( aDefTabs );
309  }
310  }
311 
312  // Background only in WebDialog
313  if(SfxItemState::SET == rSet.GetItemState(RES_BACKGROUND))
314  {
315  const SvxBrushItem& rBrushItem = rSet.Get(RES_BACKGROUND);
316  aViewOpt.SetRetoucheColor( rBrushItem.GetColor() );
317  }
318 
319  // Interpret page Grid Settings
320  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, false, &pItem ))
321  {
322  const SvxGridItem* pGridItem = static_cast<const SvxGridItem*>(pItem);
323 
324  aViewOpt.SetSnap( pGridItem->GetUseGridSnap() );
325  aViewOpt.SetSynchronize(pGridItem->GetSynchronize());
326  if( aViewOpt.IsGridVisible() != pGridItem->GetGridVisible() )
327  aViewOpt.SetGridVisible( pGridItem->GetGridVisible());
328  Size aSize( pGridItem->GetFieldDrawX(), pGridItem->GetFieldDrawY() );
329  if( aViewOpt.GetSnapSize() != aSize )
330  aViewOpt.SetSnapSize( aSize );
331  short nDiv = static_cast<short>(pGridItem->GetFieldDivisionX()) ;
332  if( aViewOpt.GetDivisionX() != nDiv )
333  aViewOpt.SetDivisionX( nDiv );
334  nDiv = static_cast<short>(pGridItem->GetFieldDivisionY());
335  if( aViewOpt.GetDivisionY() != nDiv )
336  aViewOpt.SetDivisionY( nDiv );
337 
338  if(pBindings)
339  {
340  pBindings->Invalidate(SID_GRID_VISIBLE);
341  pBindings->Invalidate(SID_GRID_USE);
342  }
343  }
344 
345  // Interpret Writer Printer Options
346  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, false, &pItem ))
347  {
348  SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog);
349  if (pOpt)
350  {
351  const SwAddPrinterItem* pAddPrinterAttr = static_cast<const SwAddPrinterItem*>(pItem);
352  *pOpt = *pAddPrinterAttr;
353  }
354 
355  }
356 
357  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, false, &pItem ))
358  {
359  static_cast<const SwShadowCursorItem*>(pItem)->FillViewOptions( aViewOpt );
360  if(pBindings)
361  pBindings->Invalidate(FN_SHADOWCURSOR);
362  }
363 
364  if( pAppView )
365  {
366  SwWrtShell &rWrtSh = pAppView->GetWrtShell();
367  const bool bAlignFormulas = rWrtSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
368  pPref->SetAlignMathObjectsToBaseline( bAlignFormulas );
369 
370  // don't align formulas in documents that are currently loading
371  if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading())
373  }
374 
375  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, false, &pItem ))
376  {
377  aViewOpt.SetCursorInProtectedArea(static_cast<const SfxBoolItem*>(pItem)->GetValue());
378  }
379 
380  // set elements for the current view and shell
381  ApplyUsrPref( aViewOpt, pAppView, bTextDialog? SvViewOpt::DestText : SvViewOpt::DestWeb);
382 }
383 
384 std::unique_ptr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet )
385 {
386  std::unique_ptr<SfxTabPage> xRet;
387  SfxAllItemSet aSet(*(rSet.GetPool()));
388  switch( nId )
389  {
390  case RID_SW_TP_CONTENT_OPT:
391  case RID_SW_TP_HTML_CONTENT_OPT:
392  {
394  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
395  xRet = (*fnCreatePage)( pPage, pController, &rSet );
396  break;
397  }
398  case RID_SW_TP_HTML_OPTGRID_PAGE:
399  case RID_SVXPAGE_GRID:
400  xRet = SvxGridTabPage::Create(pPage, pController, rSet);
401  break;
402 
403  case RID_SW_TP_STD_FONT:
404  case RID_SW_TP_STD_FONT_CJK:
405  case RID_SW_TP_STD_FONT_CTL:
406  {
408  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
409  xRet = (*fnCreatePage)( pPage, pController, &rSet );
410  if(RID_SW_TP_STD_FONT != nId)
411  {
412  aSet.Put (SfxUInt16Item(SID_FONTMODE_TYPE, RID_SW_TP_STD_FONT_CJK == nId ? FONT_GROUP_CJK : FONT_GROUP_CTL));
413  xRet->PageCreated(aSet);
414  }
415  }
416  break;
417  case RID_SW_TP_HTML_OPTPRINT_PAGE:
418  case RID_SW_TP_OPTPRINT_PAGE:
419  {
421  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
422  xRet = (*fnCreatePage)( pPage, pController, &rSet );
423  aSet.Put (SfxBoolItem(SID_FAX_LIST, true));
424  xRet->PageCreated(aSet);
425  }
426  break;
427  case RID_SW_TP_HTML_OPTTABLE_PAGE:
428  case RID_SW_TP_OPTTABLE_PAGE:
429  {
431  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
432  xRet = (*fnCreatePage)( pPage, pController, &rSet );
433  SwView* pCurrView = GetView();
434  if(pCurrView)
435  {
436  // if text then not WebView and vice versa
437  bool bWebView = dynamic_cast<SwWebView*>( pCurrView ) != nullptr;
438  if( (bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE == nId) ||
439  (!bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE != nId) )
440  {
441  aSet.Put (SwWrtShellItem(pCurrView->GetWrtShellPtr()));
442  xRet->PageCreated(aSet);
443  }
444  }
445  }
446  break;
447  case RID_SW_TP_OPTSHDWCRSR:
448  case RID_SW_TP_HTML_OPTSHDWCRSR:
449  case RID_SW_TP_REDLINE_OPT:
450  case RID_SW_TP_COMPARISON_OPT:
451  case RID_SW_TP_OPTLOAD_PAGE:
452  case RID_SW_TP_OPTCOMPATIBILITY_PAGE:
453  case RID_SW_TP_MAILCONFIG:
454  {
456  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
457  xRet = (*fnCreatePage)( pPage, pController, &rSet );
458  if (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR)
459  {
460  SwView* pCurrView = GetView();
461  if(pCurrView)
462  {
463  aSet.Put( SwWrtShellItem( pCurrView->GetWrtShellPtr() ) );
464  xRet->PageCreated(aSet);
465  }
466  }
467  }
468  break;
469  case RID_SW_TP_OPTTEST_PAGE:
470  {
472  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
473  xRet = (*fnCreatePage)( pPage, pController, &rSet );
474  break;
475  }
476  case RID_SW_TP_BACKGROUND:
477  {
479  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG );
480  xRet = (*fnCreatePage)( pPage, pController, &rSet );
481  xRet->PageCreated( rSet );
482  break;
483  }
484  case RID_SW_TP_OPTCAPTION_PAGE:
485  {
487  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SW_TP_OPTCAPTION_PAGE );
488  xRet = (*fnCreatePage)( pPage, pController, &rSet );
489  }
490  break;
491  }
492 
493  if(!xRet)
494  SAL_WARN( "sw", "SwModule::CreateTabPage(): Unknown tabpage id " << nId );
495  return xRet;
496 }
497 
498 /* 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
long Width() const
bool IsSynchronize() const
Definition: viewopt.hxx:341
sal_uInt32 GetFieldDivisionY() const
bool IsViewMetaChars() const
Definition: viewopt.hxx:336
#define FONT_GROUP_CTL
Definition: fontcfg.hxx:48
#define FN_VIEW_GRAPHIC
Definition: cmdid.h:154
const Color & GetRetoucheColor() const
Definition: viewopt.hxx:539
FieldUnit
void GetHRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:603
void SetFieldDrawX(sal_uInt32 nSet)
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
#define RES_CHRATR_CJK_LANGUAGE
Definition: hintids.hxx:93
void SetDivisionX(short n)
Definition: viewopt.hxx:406
static SfxAbstractDialogFactory * Create()
#define RES_CHRATR_LANGUAGE
Definition: hintids.hxx:79
std::string GetValue
#define FN_PARAM_ELEM
Definition: cmdid.h:752
long Height() const
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:580
SwStdFontConfig * GetStdFontConfig()
Definition: swmodule.hxx:173
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:138
void SetFieldDrawY(sal_uInt32 nSet)
SwPrintOptions * GetPrtOptions(bool bWeb)
Definition: swmodul1.cxx:344
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
sal_uInt32 GetFieldDrawX() const
void SetHScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:218
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:604
#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:1047
#define FN_HSCROLL_METRIC
Definition: cmdid.h:178
void SetAlignMathObjectsToBaseline(bool bVal, bool noModify=false)
Definition: usrpref.hxx:262
#define FN_PARAM_SHADOWCURSOR
Definition: cmdid.h:790
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:750
void PutItem(const SfxPoolItem &rItem)
FieldUnit GetHScrollMetric() const
Definition: usrpref.hxx:217
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
static LanguageType nLang
Definition: srtdlg.cxx:60
SfxApplication * SfxGetpApp()
sal_Int32 GetDefTabInMm100() const
Definition: usrpref.hxx:244
#define FN_VSCROLL_METRIC
Definition: cmdid.h:179
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
#define FN_PARAM_DOCDISP
Definition: cmdid.h:751
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
#define XATTR_FILL_LAST
short GetDivisionX() const
Definition: viewopt.hxx:405
void SetCursorInProtectedArea(bool b)
Definition: viewopt.hxx:373
#define XATTR_FILL_FIRST
short GetDivisionY() const
Definition: viewopt.hxx:407
void SetSynchronize(bool b)
Definition: viewopt.hxx:343
#define RES_PARATR_TABSTOP
Definition: hintids.hxx:167
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:384
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
#define FN_PARAM_PRINTER
Definition: cmdid.h:778
#define FN_PARAM_CRSR_IN_PROTECTED
Definition: cmdid.h:794
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:218
SfxItemPool & GetPool() const
#define RES_BACKGROUND
Definition: hintids.hxx:212
const Color & GetColor() const
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2580
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:370
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:781
void SetOptions(const SfxItemSet &)
HTMLMODE_ON
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:229
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
sal_uInt32 GetFieldDivisionX() const
#define FN_PARAM_STDFONTS
Definition: cmdid.h:779
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:212
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:71
#define FN_SHADOWCURSOR
Definition: cmdid.h:505
void SetFieldDivisionX(sal_uInt32 nSet)
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:235
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:833
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:592
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:338
void SetSnapSize(Size const &rSz)
Definition: viewopt.hxx:324
bool IsInReading() const
Definition: doc.hxx:951
#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:408
FieldUnit GetMetric() const
Definition: usrpref.hxx:208
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:401
static SfxViewFrame * Current()
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
#define RES_CHRATR_CTL_LANGUAGE
Definition: hintids.hxx:98
void SetSynchronize(bool bSet)
virtual std::unique_ptr< SfxItemSet > CreateItemSet(sal_uInt16 nId) override
Definition: appopt.cxx:61
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:426
void SetRetoucheColor(const Color &r)
Definition: viewopt.hxx:540
void AlignAllFormulasToBaseline()
aligns all formulas with anchor 'as char' to baseline
Definition: fefly1.cxx:2064
void SetUseGridSnap(bool bSet)
const Size & GetSnapSize() const
Definition: viewopt.hxx:325
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:175
#define FN_VIEW_HIDDEN_PARA
Definition: cmdid.h:172
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pUsrPref
Definition: swmodule.hxx:81
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:589
sal_uInt32 GetFieldDrawY() const
void GetVRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:598
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
#define FN_VIEW_META_CHARS
Definition: cmdid.h:161
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
void SetSnap(bool b)
Definition: viewopt.hxx:321
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
bool IsGridVisible() const
Definition: viewopt.hxx:327
#define SAL_WARN(area, stream)
css::uno::Any GetProperty(const OUString &rPropertyName) const
void SetGridVisible(bool b)
Definition: viewopt.hxx:329
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
bool GetGridVisible() const
bool IsSnap() const
Definition: viewopt.hxx:319
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:716
void SetDefTabInMm100(sal_Int32 nSet, bool bNoModify=false)
Definition: usrpref.hxx:245
#define COMPLEX
Definition: view.hxx:146
SwView * GetView()
Definition: swmodule.hxx:147
void ApplyUsrPref(const SwViewOption &, SwView *, SvViewOpt nDest=SvViewOpt::DestView)
Definition: swmodul1.cxx:136