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/request.hxx>
29 #include <sfx2/app.hxx>
30 #include <sfx2/printer.hxx>
31 #include <sfx2/htmlmode.hxx>
32 #include <sfx2/bindings.hxx>
33 #include <editeng/brushitem.hxx>
34 #include <editeng/tstpitem.hxx>
35 #include <svx/optgrid.hxx>
36 #include <svx/svxdlg.hxx>
37 #include <svx/dialogs.hrc>
38 #include <svx/svxids.hrc>
39 #include <i18nlangtag/mslangid.hxx>
41 #include <fontcfg.hxx>
42 #include <optload.hxx>
43 #include <optcomp.hxx>
44 #include <edtwin.hxx>
45 #include <swmodule.hxx>
46 #include <view.hxx>
47 #include <doc.hxx>
48 #include <wrtsh.hxx>
51 #include <uitool.hxx>
52 #include <initui.hxx>
53 #include <fldbas.hxx>
54 #include <wview.hxx>
55 #include <cfgitems.hxx>
56 #include <prtopt.hxx>
57 #include <pview.hxx>
58 #include <usrpref.hxx>
59 #include <modcfg.hxx>
60 #include <glosdoc.hxx>
61 #include <uiitems.hxx>
62 #include <editeng/langitem.hxx>
63 #include <unotools/lingucfg.hxx>
64 #include <editeng/unolingu.hxx>
65 #include <globals.hrc>
66 #include <globals.h>
67 #include <svl/slstitm.hxx>
68 #include <swabstdlg.hxx>
69 #include <swwrtshitem.hxx>
70 
71 #include <unomid.h>
72 
73 using namespace ::com::sun::star::uno;
74 using namespace ::com::sun::star::lang;
75 
76 std::unique_ptr<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId )
77 {
78  bool bTextDialog = (nId == SID_SW_EDITOPTIONS);
79 
80  // the options for the Web- and Textdialog are put together here
81  SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
82  SwMasterUsrPref* pPref = bTextDialog ? m_pUsrPref.get() : m_pWebUsrPref.get();
83  // no MakeUsrPref, because only options from textdoks can be used here
84  SwView* pAppView = GetView();
85  if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current())
86  pAppView = nullptr;
87  if(pAppView)
88  {
89  bool bWebView = dynamic_cast<SwWebView*>( pAppView ) != nullptr;
90  // if Text then no WebView and vice versa
91  if (bWebView != bTextDialog)
92  {
93  aViewOpt = *pAppView->GetWrtShell().GetViewOptions();
94  }
95  else
96  pAppView = nullptr; // with View, there's nothing to win here
97  }
98 
99  // Options/Edit
100  auto pRet = std::make_unique<SfxItemSet>(
101  GetPool(),
102  svl::Items<
104  SID_PRINTPREVIEW, SID_PRINTPREVIEW,
105  SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS,
106  SID_HTML_MODE, SID_HTML_MODE,
107  SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE,
108  SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
109  SID_ATTR_LANGUAGE, SID_ATTR_METRIC,
110  SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
111  SID_ATTR_APPLYCHARUNIT, SID_ATTR_APPLYCHARUNIT,
118  FN_PARAM_CRSR_IN_PROTECTED, FN_PARAM_CRSR_IN_PROTECTED>{});
119 
120  pRet->Put( SwDocDisplayItem( aViewOpt ) );
121  pRet->Put( SwElemItem( aViewOpt ) );
122  if( bTextDialog )
123  {
124  pRet->Put( SwShadowCursorItem( aViewOpt ));
125  pRet->Put( SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aViewOpt.IsCursorInProtectedArea()));
126  }
127 
128  if( pAppView )
129  {
130  SwWrtShell& rWrtShell = pAppView->GetWrtShell();
131 
132  SfxPrinter* pPrt = rWrtShell.getIDocumentDeviceAccess().getPrinter( false );
133  if( pPrt )
134  pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));
135  pRet->Put(SwPtrItem(FN_PARAM_WRTSHELL, &rWrtShell));
136 
137  pRet->Put(rWrtShell.GetDefault(RES_CHRATR_LANGUAGE).CloneSetWhich(SID_ATTR_LANGUAGE));
138  pRet->Put(rWrtShell.GetDefault(RES_CHRATR_CJK_LANGUAGE).CloneSetWhich(SID_ATTR_CHAR_CJK_LANGUAGE));
139  pRet->Put(rWrtShell.GetDefault(RES_CHRATR_CTL_LANGUAGE).CloneSetWhich(SID_ATTR_CHAR_CTL_LANGUAGE));
140  }
141  else
142  {
143  SvtLinguConfig aLinguCfg;
144  css::lang::Locale aLocale;
146 
147  using namespace ::com::sun::star::i18n::ScriptType;
148 
149  Any aLang = aLinguCfg.GetProperty("DefaultLocale");
150  aLang >>= aLocale;
152  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE));
153 
154  aLang = aLinguCfg.GetProperty("DefaultLocale_CJK");
155  aLang >>= aLocale;
157  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE));
158 
159  aLang = aLinguCfg.GetProperty("DefaultLocale_CTL");
160  aLang >>= aLocale;
162  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE));
163  }
164  if(bTextDialog)
165  pRet->Put(SwPtrItem(FN_PARAM_STDFONTS, GetStdFontConfig()));
166  if( dynamic_cast<SwPagePreview*>( SfxViewShell::Current())!=nullptr )
167  {
168  SfxBoolItem aBool(SfxBoolItem(SID_PRINTPREVIEW, true));
169  pRet->Put(aBool);
170  }
171 
172  FieldUnit eUnit = pPref->GetHScrollMetric();
173  if(pAppView)
174  pAppView->GetHRulerMetric(eUnit);
175  pRet->Put(SfxUInt16Item( FN_HSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit)));
176 
177  eUnit = pPref->GetVScrollMetric();
178  if(pAppView)
179  pAppView->GetVRulerMetric(eUnit);
180  pRet->Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit) ));
181  pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(pPref->GetMetric()) ));
182  pRet->Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, pPref->IsApplyCharUnit()));
183  if(bTextDialog)
184  {
185  if(pAppView)
186  {
187  const SvxTabStopItem& rDefTabs =
189  pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(::GetTabDist(rDefTabs))));
190  }
191  else
192  pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(convertMm100ToTwip(pPref->GetDefTabInMm100()))));
193  }
194 
195  // Options for GridTabPage
196  SvxGridItem aGridItem( SID_ATTR_GRID_OPTIONS);
197 
198  aGridItem.SetUseGridSnap( aViewOpt.IsSnap());
199  aGridItem.SetSynchronize( aViewOpt.IsSynchronize());
200  aGridItem.SetGridVisible( aViewOpt.IsGridVisible());
201 
202  const Size& rSnapSize = aViewOpt.GetSnapSize();
203  aGridItem.SetFieldDrawX( static_cast<sal_uInt16>(rSnapSize.Width() ));
204  aGridItem.SetFieldDrawY( static_cast<sal_uInt16>(rSnapSize.Height()));
205 
206  aGridItem.SetFieldDivisionX( aViewOpt.GetDivisionX());
207  aGridItem.SetFieldDivisionY( aViewOpt.GetDivisionY());
208 
209  pRet->Put(aGridItem);
210 
211  // Options for PrintTabPage
212  const SwPrintData* pOpt = pAppView ?
214  nullptr;
215 
216  if(!pOpt)
217  pOpt = GetPrtOptions(!bTextDialog);
218 
219  SwAddPrinterItem aAddPrinterItem(*pOpt );
220  pRet->Put(aAddPrinterItem);
221 
222  // Options for Web
223  if(!bTextDialog)
224  {
225  pRet->Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND));
226  pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON));
227  }
228 
229  return pRet;
230 }
231 
232 void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
233 {
234  bool bTextDialog = nId == SID_SW_EDITOPTIONS;
235  SwView* pAppView = GetView();
236  if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current())
237  pAppView = nullptr;
238  if(pAppView)
239  {
240  // the text dialog mustn't apply data to the web view and vice versa
241  bool bWebView = dynamic_cast<SwWebView*>( pAppView ) != nullptr;
242  if(bWebView == bTextDialog)
243  pAppView = nullptr;
244  }
245 
246  SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
247  SwMasterUsrPref* pPref = bTextDialog ? m_pUsrPref.get() : m_pWebUsrPref.get();
248 
249  const SfxPoolItem* pItem;
250  SfxBindings *pBindings = pAppView ? &pAppView->GetViewFrame()->GetBindings()
251  : nullptr;
252 
253  // Interpret the page Documentview
254  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_DOCDISP, false, &pItem ))
255  {
256  const SwDocDisplayItem* pDocDispItem = static_cast<const SwDocDisplayItem*>(pItem);
257 
258  if(!aViewOpt.IsViewMetaChars())
259  {
260  if( (!aViewOpt.IsTab( true ) && pDocDispItem->bTab) ||
261  (!aViewOpt.IsBlank( true ) && pDocDispItem->bSpace) ||
262  (!aViewOpt.IsParagraph( true ) && pDocDispItem->bParagraphEnd) ||
263  (!aViewOpt.IsLineBreak( true ) && pDocDispItem->bManualBreak) )
264  {
265  aViewOpt.SetViewMetaChars(true);
266  if(pBindings)
267  pBindings->Invalidate(FN_VIEW_META_CHARS);
268  }
269 
270  }
271  pDocDispItem->FillViewOptions( aViewOpt );
272  if(pBindings)
273  {
274  pBindings->Invalidate(FN_VIEW_GRAPHIC);
275  pBindings->Invalidate(FN_VIEW_HIDDEN_PARA);
276  }
277  }
278 
279  // Elements - interpret Item
280  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ELEM, false, &pItem ) )
281  {
282  const SwElemItem* pElemItem = static_cast<const SwElemItem*>(pItem);
283  pElemItem->FillViewOptions( aViewOpt );
284 
285  }
286 
287  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_METRIC, false, &pItem ) )
288  {
289  SfxGetpApp()->SetOptions(rSet);
290  PutItem(*pItem);
291  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
292  ::SetDfltMetric(static_cast<FieldUnit>(pMetricItem->GetValue()), !bTextDialog);
293  }
294  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT,
295  false, &pItem ) )
296  {
297  SfxGetpApp()->SetOptions(rSet);
298  const SfxBoolItem* pCharItem = static_cast<const SfxBoolItem*>(pItem);
299  ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog);
300  }
301 
302  if( SfxItemState::SET == rSet.GetItemState(FN_HSCROLL_METRIC, false, &pItem ) )
303  {
304  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
305  FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
306  pPref->SetHScrollMetric(eUnit);
307  if(pAppView)
308  pAppView->ChangeTabMetric(eUnit);
309  }
310 
311  if( SfxItemState::SET == rSet.GetItemState(FN_VSCROLL_METRIC, false, &pItem ) )
312  {
313  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
314  FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
315  pPref->SetVScrollMetric(eUnit);
316  if(pAppView)
317  pAppView->ChangeVRulerMetric(eUnit);
318  }
319 
320  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, false, &pItem ) )
321  {
322  sal_uInt16 nTabDist = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
323  pPref->SetDefTabInMm100(convertTwipToMm100(nTabDist));
324  if(pAppView)
325  {
326  SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
327  MakeDefTabs( nTabDist, aDefTabs );
328  pAppView->GetWrtShell().SetDefault( aDefTabs );
329  }
330  }
331 
332  // Background only in WebDialog
333  if(SfxItemState::SET == rSet.GetItemState(RES_BACKGROUND))
334  {
335  const SvxBrushItem& rBrushItem = rSet.Get(RES_BACKGROUND);
336  aViewOpt.SetRetoucheColor( rBrushItem.GetColor() );
337  }
338 
339  // Interpret page Grid Settings
340  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, false, &pItem ))
341  {
342  const SvxGridItem* pGridItem = static_cast<const SvxGridItem*>(pItem);
343 
344  aViewOpt.SetSnap( pGridItem->GetUseGridSnap() );
345  aViewOpt.SetSynchronize(pGridItem->GetSynchronize());
346  if( aViewOpt.IsGridVisible() != pGridItem->GetGridVisible() )
347  aViewOpt.SetGridVisible( pGridItem->GetGridVisible());
348  Size aSize( pGridItem->GetFieldDrawX(), pGridItem->GetFieldDrawY() );
349  if( aViewOpt.GetSnapSize() != aSize )
350  aViewOpt.SetSnapSize( aSize );
351  short nDiv = static_cast<short>(pGridItem->GetFieldDivisionX()) ;
352  if( aViewOpt.GetDivisionX() != nDiv )
353  aViewOpt.SetDivisionX( nDiv );
354  nDiv = static_cast<short>(pGridItem->GetFieldDivisionY());
355  if( aViewOpt.GetDivisionY() != nDiv )
356  aViewOpt.SetDivisionY( nDiv );
357 
358  if(pBindings)
359  {
360  pBindings->Invalidate(SID_GRID_VISIBLE);
361  pBindings->Invalidate(SID_GRID_USE);
362  }
363  }
364 
365  // Interpret Writer Printer Options
366  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, false, &pItem ))
367  {
368  SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog);
369  if (pOpt)
370  {
371  const SwAddPrinterItem* pAddPrinterAttr = static_cast<const SwAddPrinterItem*>(pItem);
372  *pOpt = *pAddPrinterAttr;
373 
374  if(pAppView)
375  pAppView->GetWrtShell().getIDocumentDeviceAccess().setPrintData( *pOpt );
376  }
377 
378  }
379 
380  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, false, &pItem ))
381  {
382  static_cast<const SwShadowCursorItem*>(pItem)->FillViewOptions( aViewOpt );
383  if(pBindings)
384  pBindings->Invalidate(FN_SHADOWCURSOR);
385  }
386 
387  if( pAppView )
388  {
389  SwWrtShell &rWrtSh = pAppView->GetWrtShell();
390  const bool bAlignFormulas = rWrtSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
391  pPref->SetAlignMathObjectsToBaseline( bAlignFormulas );
392 
393  // don't align formulas in documents that are currently loading
394  if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading())
396  }
397 
398  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, false, &pItem ))
399  {
400  aViewOpt.SetCursorInProtectedArea(static_cast<const SfxBoolItem*>(pItem)->GetValue());
401  }
402 
403  // set elements for the current view and shell
404  ApplyUsrPref( aViewOpt, pAppView, bTextDialog? SvViewOpt::DestText : SvViewOpt::DestWeb);
405 }
406 
408 {
409  VclPtr<SfxTabPage> pRet;
410  SfxAllItemSet aSet(*(rSet.GetPool()));
411  switch( nId )
412  {
413  case RID_SW_TP_CONTENT_OPT:
414  case RID_SW_TP_HTML_CONTENT_OPT:
415  {
417  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
418  pRet = (*fnCreatePage)( pParent, &rSet );
419  break;
420  }
421  case RID_SW_TP_HTML_OPTGRID_PAGE:
422  case RID_SVXPAGE_GRID:
423  pRet = SvxGridTabPage::Create(pParent, rSet);
424  break;
425 
426  case RID_SW_TP_STD_FONT:
427  case RID_SW_TP_STD_FONT_CJK:
428  case RID_SW_TP_STD_FONT_CTL:
429  {
431  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
432  pRet = (*fnCreatePage)( pParent, &rSet );
433  if(RID_SW_TP_STD_FONT != nId)
434  {
435  aSet.Put (SfxUInt16Item(SID_FONTMODE_TYPE, RID_SW_TP_STD_FONT_CJK == nId ? FONT_GROUP_CJK : FONT_GROUP_CTL));
436  pRet->PageCreated(aSet);
437  }
438  }
439  break;
440  case RID_SW_TP_HTML_OPTPRINT_PAGE:
441  case RID_SW_TP_OPTPRINT_PAGE:
442  {
444  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
445  pRet = (*fnCreatePage)( pParent, &rSet );
446  aSet.Put (SfxBoolItem(SID_FAX_LIST, true));
447  pRet->PageCreated(aSet);
448  }
449  break;
450  case RID_SW_TP_HTML_OPTTABLE_PAGE:
451  case RID_SW_TP_OPTTABLE_PAGE:
452  {
454  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
455  pRet = (*fnCreatePage)( pParent, &rSet );
456  SwView* pCurrView = GetView();
457  if(pCurrView)
458  {
459  // if text then not WebView and vice versa
460  bool bWebView = dynamic_cast<SwWebView*>( pCurrView ) != nullptr;
461  if( (bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE == nId) ||
462  (!bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE != nId) )
463  {
464  aSet.Put (SwWrtShellItem(pCurrView->GetWrtShellPtr()));
465  pRet->PageCreated(aSet);
466  }
467  }
468  }
469  break;
470  case RID_SW_TP_OPTSHDWCRSR:
471  case RID_SW_TP_HTML_OPTSHDWCRSR:
472  case RID_SW_TP_REDLINE_OPT:
473  case RID_SW_TP_COMPARISON_OPT:
474  case RID_SW_TP_OPTLOAD_PAGE:
475  case RID_SW_TP_OPTCOMPATIBILITY_PAGE:
476  case RID_SW_TP_MAILCONFIG:
477  {
479  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
480  pRet = (*fnCreatePage)( pParent, &rSet );
481  if (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR)
482  {
483  SwView* pCurrView = GetView();
484  if(pCurrView)
485  {
486  aSet.Put( SwWrtShellItem( pCurrView->GetWrtShellPtr() ) );
487  pRet->PageCreated(aSet);
488  }
489  }
490  }
491  break;
492  case RID_SW_TP_OPTTEST_PAGE:
493  {
495  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
496  pRet = (*fnCreatePage)( pParent, &rSet );
497  break;
498  }
499  case RID_SW_TP_BACKGROUND:
500  {
502  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND );
503  pRet = (*fnCreatePage)( pParent, &rSet );
504  break;
505  }
506  case RID_SW_TP_OPTCAPTION_PAGE:
507  {
509  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SW_TP_OPTCAPTION_PAGE );
510  pRet = (*fnCreatePage)( pParent, &rSet );
511  }
512  break;
513  }
514 
515  if(!pRet)
516  SAL_WARN( "sw", "SwModule::CreateTabPage(): Unknown tabpage id " << nId );
517  return pRet;
518 }
519 
520 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in document.
Definition: edatmisc.cxx:85
SfxViewFrame * GetViewFrame() const
bool GetValue() const
long Width() const
bool IsSynchronize() const
Definition: viewopt.hxx:334
sal_uInt32 GetFieldDivisionY() const
bool IsViewMetaChars() const
Definition: viewopt.hxx:329
#define FONT_GROUP_CTL
Definition: fontcfg.hxx:48
#define FN_VIEW_GRAPHIC
Definition: cmdid.h:152
const Color & GetRetoucheColor() const
Definition: viewopt.hxx:532
FieldUnit
void GetHRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:602
void SetFieldDrawX(sal_uInt32 nSet)
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
#define RES_CHRATR_CJK_LANGUAGE
Definition: hintids.hxx:92
void SetDivisionX(short n)
Definition: viewopt.hxx:399
static SfxAbstractDialogFactory * Create()
virtual void PageCreated(const SfxAllItemSet &aSet)
#define RES_CHRATR_LANGUAGE
Definition: hintids.hxx:78
std::string GetValue
#define FN_PARAM_ELEM
Definition: cmdid.h:740
long Height() const
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:579
SwStdFontConfig * GetStdFontConfig()
Definition: swmodule.hxx:172
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:148
void SetFieldDrawY(sal_uInt32 nSet)
SwPrintOptions * GetPrtOptions(bool bWeb)
Definition: swmodul1.cxx:352
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
std::unique_ptr< SwMasterUsrPref > m_pWebUsrPref
Definition: swmodule.hxx:81
static LanguageType resolveSystemLanguageByScriptType(LanguageType nLang, sal_Int16 nType)
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:586
#define ASIAN
void SetFieldDivisionY(sal_uInt32 nSet)
void SetVScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:226
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
Definition: apphdl.cxx:1040
#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:778
virtual void ApplyItemSet(sal_uInt16 nId, const SfxItemSet &rSet) override
Definition: appopt.cxx:232
void Invalidate(sal_uInt16 nId)
#define FN_PARAM_ADDPRINTER
Definition: cmdid.h:738
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:58
SfxApplication * SfxGetpApp()
sal_Int32 GetDefTabInMm100() const
Definition: usrpref.hxx:244
#define FN_VSCROLL_METRIC
Definition: cmdid.h:177
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
#define FN_PARAM_DOCDISP
Definition: cmdid.h:739
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
short GetDivisionX() const
Definition: viewopt.hxx:398
void SetCursorInProtectedArea(bool b)
Definition: viewopt.hxx:366
short GetDivisionY() const
Definition: viewopt.hxx:400
void SetSynchronize(bool b)
Definition: viewopt.hxx:336
#define RES_PARATR_TABSTOP
Definition: hintids.hxx:166
static SfxViewShell * Current()
std::unique_ptr< SwMasterUsrPref > m_pUsrPref
Definition: swmodule.hxx:80
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
#define FN_PARAM_PRINTER
Definition: cmdid.h:766
#define FN_PARAM_CRSR_IN_PROTECTED
Definition: cmdid.h:782
bool IsBlank(bool bHard=false) const
Definition: viewopt.hxx:217
SfxItemPool & GetPool() const
#define RES_BACKGROUND
Definition: hintids.hxx:210
const Color & GetColor() const
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2590
void SetGridVisible(bool bSet)
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Query default attribute of document.
Definition: edatmisc.cxx:94
bool IsCursorInProtectedArea() const
Definition: viewopt.hxx:363
bool GetUseGridSnap() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
virtual const SwPrintData & getPrintData() const =0
Returns the PrintData.
virtual VclPtr< SfxTabPage > CreateTabPage(sal_uInt16 nId, TabPageParent pParent, const SfxItemSet &rSet) override
Definition: appopt.cxx:407
SfxBindings & GetBindings()
#define FN_PARAM_WRTSHELL
Definition: cmdid.h:769
void SetOptions(const SfxItemSet &)
HTMLMODE_ON
bool IsParagraph(bool bHard=false) const
Definition: viewopt.hxx:228
sal_uInt32 GetFieldDivisionX() const
#define FN_PARAM_STDFONTS
Definition: cmdid.h:767
bool IsTab(bool bHard=false) const
Definition: viewopt.hxx:211
void FillViewOptions(SwViewOption &rVOpt) const
Definition: cfgitems.cxx:78
#define FN_SHADOWCURSOR
Definition: cmdid.h:495
void SetFieldDivisionX(sal_uInt32 nSet)
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:234
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:815
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:574
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:331
void SetSnapSize(Size const &rSz)
Definition: viewopt.hxx:317
bool IsInReading() const
Definition: doc.hxx:948
#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:401
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:97
void SetSynchronize(bool bSet)
virtual std::unique_ptr< SfxItemSet > CreateItemSet(sal_uInt16 nId) override
Definition: appopt.cxx:76
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:426
void SetRetoucheColor(const Color &r)
Definition: viewopt.hxx:533
void AlignAllFormulasToBaseline()
aligns all formulas with anchor 'as char' to baseline
Definition: fefly1.cxx:2074
void SetUseGridSnap(bool bSet)
const Size & GetSnapSize() const
Definition: viewopt.hxx:318
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:208
#define FN_VIEW_HIDDEN_PARA
Definition: cmdid.h:170
virtual void setPrintData(const SwPrintData &rPrtData)=0
Sets the PrintData.
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:588
sal_uInt32 GetFieldDrawY() const
void GetVRulerMetric(FieldUnit &rToFill) const
Definition: viewmdi.cxx:597
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
void SetSnap(bool b)
Definition: viewopt.hxx:314
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
bool IsGridVisible() const
Definition: viewopt.hxx:320
#define SAL_WARN(area, stream)
css::uno::Any GetProperty(const OUString &rPropertyName) const
void SetGridVisible(bool b)
Definition: viewopt.hxx:322
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
bool GetGridVisible() const
bool IsSnap() const
Definition: viewopt.hxx:312
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:698
void SetDefTabInMm100(sal_Int32 nSet, bool bNoModify=false)
Definition: usrpref.hxx:245
#define COMPLEX
Definition: view.hxx:146
SwView * GetView()
Definition: swmodule.hxx:146
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet &rAttrSet)
void ApplyUsrPref(const SwViewOption &, SwView *, SvViewOpt nDest=SvViewOpt::DestView)
Definition: swmodul1.cxx:144