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::unique_ptr<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  auto pRet = std::make_unique<SfxItemSet>(
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,
107  FN_PARAM_CRSR_IN_PROTECTED, FN_PARAM_CRSR_IN_PROTECTED>{});
108 
109  pRet->Put( SwDocDisplayItem( aViewOpt ) );
110  pRet->Put( SwElemItem( aViewOpt ) );
111  if( bTextDialog )
112  {
113  pRet->Put( SwShadowCursorItem( aViewOpt ));
114  pRet->Put( SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aViewOpt.IsCursorInProtectedArea()));
115  }
116 
117  if( pAppView )
118  {
119  SwWrtShell& rWrtShell = pAppView->GetWrtShell();
120 
121  SfxPrinter* pPrt = rWrtShell.getIDocumentDeviceAccess().getPrinter( false );
122  if( pPrt )
123  pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));
124  pRet->Put(SwPtrItem(FN_PARAM_WRTSHELL, &rWrtShell));
125 
126  pRet->Put(rWrtShell.GetDefault(RES_CHRATR_LANGUAGE).CloneSetWhich(SID_ATTR_LANGUAGE));
127  pRet->Put(rWrtShell.GetDefault(RES_CHRATR_CJK_LANGUAGE).CloneSetWhich(SID_ATTR_CHAR_CJK_LANGUAGE));
128  pRet->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  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE));
142 
143  aLang = aLinguCfg.GetProperty("DefaultLocale_CJK");
144  aLang >>= aLocale;
146  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE));
147 
148  aLang = aLinguCfg.GetProperty("DefaultLocale_CTL");
149  aLang >>= aLocale;
151  pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE));
152  }
153  if(bTextDialog)
154  pRet->Put(SwPtrItem(FN_PARAM_STDFONTS, GetStdFontConfig()));
155  if( dynamic_cast<SwPagePreview*>( SfxViewShell::Current())!=nullptr )
156  {
157  SfxBoolItem aBool(SfxBoolItem(SID_PRINTPREVIEW, true));
158  pRet->Put(aBool);
159  }
160 
161  FieldUnit eUnit = pPref->GetHScrollMetric();
162  if(pAppView)
163  pAppView->GetHRulerMetric(eUnit);
164  pRet->Put(SfxUInt16Item( FN_HSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit)));
165 
166  eUnit = pPref->GetVScrollMetric();
167  if(pAppView)
168  pAppView->GetVRulerMetric(eUnit);
169  pRet->Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit) ));
170  pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(pPref->GetMetric()) ));
171  pRet->Put(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, pPref->IsApplyCharUnit()));
172  if(bTextDialog)
173  {
174  if(pAppView)
175  {
176  const SvxTabStopItem& rDefTabs =
178  pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(::GetTabDist(rDefTabs))));
179  }
180  else
181  pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(convertMm100ToTwip(pPref->GetDefTabInMm100()))));
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( static_cast<sal_uInt16>(rSnapSize.Width() ));
193  aGridItem.SetFieldDrawY( static_cast<sal_uInt16>(rSnapSize.Height()));
194 
195  aGridItem.SetFieldDivisionX( aViewOpt.GetDivisionX());
196  aGridItem.SetFieldDivisionY( aViewOpt.GetDivisionY());
197 
198  pRet->Put(aGridItem);
199 
200  // Options for PrintTabPage
201  const SwPrintData* pOpt = GetPrtOptions(!bTextDialog);
202  SwAddPrinterItem aAddPrinterItem(*pOpt );
203  pRet->Put(aAddPrinterItem);
204 
205  // Options for Web
206  if(!bTextDialog)
207  {
208  pRet->Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND));
209  pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON));
210  }
211 
212  return pRet;
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  std::vector<SwNode*> aFoldedOutlineNdsArray;
265  bool bShow = false;
266  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ELEM, false, &pItem ) )
267  {
268  const SwElemItem* pElemItem = static_cast<const SwElemItem*>(pItem);
269  pElemItem->FillViewOptions( aViewOpt );
270 
271  SwWrtShell* pWrtShell = GetActiveWrtShell();
273  bool bTreatSubsChanged = aViewOpt.IsTreatSubOutlineLevelsAsContent()
275 
276  // move cursor to top if something with the outline mode changed
277  if ((bShow != aViewOpt.IsShowOutlineContentVisibilityButton()) ||
280  {
281  // move cursor to top of document
282  if (pWrtShell->IsSelFrameMode())
283  {
284  pWrtShell->UnSelectFrame();
285  pWrtShell->LeaveSelFrameMode();
286  }
287  pWrtShell->EnterStdMode();
288  pWrtShell->SttEndDoc(true);
289  }
290 
291  if (bShow && (!aViewOpt.IsShowOutlineContentVisibilityButton() || bTreatSubsChanged))
292  {
293  // outline mode options have change which require to show all content
294  const SwOutlineNodes& rOutlineNds = pWrtShell->GetNodes().GetOutLineNds();
295  for (SwOutlineNodes::size_type nPos = 0; nPos < rOutlineNds.size(); ++nPos)
296  {
297  SwNode* pNd = rOutlineNds[nPos];
298  if (pNd->IsTextNode()) // should always be true
299  {
300  bool bOutlineContentVisibleAttr = true;
301  pNd->GetTextNode()->GetAttrOutlineContentVisible(bOutlineContentVisibleAttr);
302  if (!bOutlineContentVisibleAttr)
303  {
304  aFoldedOutlineNdsArray.push_back(pNd);
306  }
307  }
308  }
309  }
310  }
311 
312  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_METRIC, false, &pItem ) )
313  {
314  SfxGetpApp()->SetOptions(rSet);
315  PutItem(*pItem);
316  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
317  ::SetDfltMetric(static_cast<FieldUnit>(pMetricItem->GetValue()), !bTextDialog);
318  }
319  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_APPLYCHARUNIT,
320  false, &pItem ) )
321  {
322  SfxGetpApp()->SetOptions(rSet);
323  const SfxBoolItem* pCharItem = static_cast<const SfxBoolItem*>(pItem);
324  ::SetApplyCharUnit(pCharItem->GetValue(), !bTextDialog);
325  }
326 
327  if( SfxItemState::SET == rSet.GetItemState(FN_HSCROLL_METRIC, false, &pItem ) )
328  {
329  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
330  FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
331  pPref->SetHScrollMetric(eUnit);
332  if(pAppView)
333  pAppView->ChangeTabMetric(eUnit);
334  }
335 
336  if( SfxItemState::SET == rSet.GetItemState(FN_VSCROLL_METRIC, false, &pItem ) )
337  {
338  const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pItem);
339  FieldUnit eUnit = static_cast<FieldUnit>(pMetricItem->GetValue());
340  pPref->SetVScrollMetric(eUnit);
341  if(pAppView)
342  pAppView->ChangeVRulerMetric(eUnit);
343  }
344 
345  if( SfxItemState::SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, false, &pItem ) )
346  {
347  sal_uInt16 nTabDist = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
348  pPref->SetDefTabInMm100(convertTwipToMm100(nTabDist));
349  if(pAppView)
350  {
351  SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
352  MakeDefTabs( nTabDist, aDefTabs );
353  pAppView->GetWrtShell().SetDefault( aDefTabs );
354  }
355  }
356 
357  // Background only in WebDialog
358  if(SfxItemState::SET == rSet.GetItemState(RES_BACKGROUND))
359  {
360  const SvxBrushItem& rBrushItem = rSet.Get(RES_BACKGROUND);
361  aViewOpt.SetRetoucheColor( rBrushItem.GetColor() );
362  }
363 
364  // Interpret page Grid Settings
365  if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, false, &pItem ))
366  {
367  const SvxGridItem* pGridItem = static_cast<const SvxGridItem*>(pItem);
368 
369  aViewOpt.SetSnap( pGridItem->GetUseGridSnap() );
370  aViewOpt.SetSynchronize(pGridItem->GetSynchronize());
371  if( aViewOpt.IsGridVisible() != pGridItem->GetGridVisible() )
372  aViewOpt.SetGridVisible( pGridItem->GetGridVisible());
373  Size aSize( pGridItem->GetFieldDrawX(), pGridItem->GetFieldDrawY() );
374  if( aViewOpt.GetSnapSize() != aSize )
375  aViewOpt.SetSnapSize( aSize );
376  short nDiv = static_cast<short>(pGridItem->GetFieldDivisionX()) ;
377  if( aViewOpt.GetDivisionX() != nDiv )
378  aViewOpt.SetDivisionX( nDiv );
379  nDiv = static_cast<short>(pGridItem->GetFieldDivisionY());
380  if( aViewOpt.GetDivisionY() != nDiv )
381  aViewOpt.SetDivisionY( nDiv );
382 
383  if(pBindings)
384  {
385  pBindings->Invalidate(SID_GRID_VISIBLE);
386  pBindings->Invalidate(SID_GRID_USE);
387  }
388  }
389 
390  // Interpret Writer Printer Options
391  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, false, &pItem ))
392  {
393  SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog);
394  if (pOpt)
395  {
396  const SwAddPrinterItem* pAddPrinterAttr = static_cast<const SwAddPrinterItem*>(pItem);
397  *pOpt = *pAddPrinterAttr;
398  }
399 
400  }
401 
402  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, false, &pItem ))
403  {
404  static_cast<const SwShadowCursorItem*>(pItem)->FillViewOptions( aViewOpt );
405  if(pBindings)
406  pBindings->Invalidate(FN_SHADOWCURSOR);
407  }
408 
409  if( pAppView )
410  {
411  SwWrtShell &rWrtSh = pAppView->GetWrtShell();
412  const bool bAlignFormulas = rWrtSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
413  pPref->SetAlignMathObjectsToBaseline( bAlignFormulas );
414 
415  // don't align formulas in documents that are currently loading
416  if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading())
418  }
419 
420  if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, false, &pItem ))
421  {
422  aViewOpt.SetCursorInProtectedArea(static_cast<const SfxBoolItem*>(pItem)->GetValue());
423  }
424 
425  // set elements for the current view and shell
426  ApplyUsrPref( aViewOpt, pAppView, bTextDialog? SvViewOpt::DestText : SvViewOpt::DestWeb);
427 
428  // must be done after ApplyUsrPref
429  if (SfxItemState::SET != rSet.GetItemState(FN_PARAM_ELEM, false))
430  return;
431 
433  {
434  // outline mode is no longer active
435  // set outline content visible attribute to false for nodes in the array
436  for (SwNode* pNd : aFoldedOutlineNdsArray)
437  pNd->GetTextNode()->SetAttrOutlineContentVisible(false);
438  }
439  else if (bShow)
440  {
441  // outline mode remained active
442  // sub level treatment might have changed
443  // ToggleOutlineContentVisibility only knows sub level treatment after ApplyUserPref
444  for (SwNode* pNd : aFoldedOutlineNdsArray)
446  }
447 }
448 
449 std::unique_ptr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet )
450 {
451  std::unique_ptr<SfxTabPage> xRet;
452  SfxAllItemSet aSet(*(rSet.GetPool()));
453  switch( nId )
454  {
455  case RID_SW_TP_CONTENT_OPT:
456  case RID_SW_TP_HTML_CONTENT_OPT:
457  {
459  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
460  xRet = (*fnCreatePage)( pPage, pController, &rSet );
461  break;
462  }
463  case RID_SW_TP_HTML_OPTGRID_PAGE:
464  case RID_SVXPAGE_GRID:
465  xRet = SvxGridTabPage::Create(pPage, pController, rSet);
466  break;
467 
468  case RID_SW_TP_STD_FONT:
469  case RID_SW_TP_STD_FONT_CJK:
470  case RID_SW_TP_STD_FONT_CTL:
471  {
473  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
474  xRet = (*fnCreatePage)( pPage, pController, &rSet );
475  if(RID_SW_TP_STD_FONT != nId)
476  {
477  aSet.Put (SfxUInt16Item(SID_FONTMODE_TYPE, RID_SW_TP_STD_FONT_CJK == nId ? FONT_GROUP_CJK : FONT_GROUP_CTL));
478  xRet->PageCreated(aSet);
479  }
480  }
481  break;
482  case RID_SW_TP_HTML_OPTPRINT_PAGE:
483  case RID_SW_TP_OPTPRINT_PAGE:
484  {
486  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
487  xRet = (*fnCreatePage)( pPage, pController, &rSet );
488  aSet.Put (SfxBoolItem(SID_FAX_LIST, true));
489  xRet->PageCreated(aSet);
490  }
491  break;
492  case RID_SW_TP_HTML_OPTTABLE_PAGE:
493  case RID_SW_TP_OPTTABLE_PAGE:
494  {
496  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
497  xRet = (*fnCreatePage)( pPage, pController, &rSet );
498  SwView* pCurrView = GetView();
499  if(pCurrView)
500  {
501  // if text then not WebView and vice versa
502  bool bWebView = dynamic_cast<SwWebView*>( pCurrView ) != nullptr;
503  if( (bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE == nId) ||
504  (!bWebView && RID_SW_TP_HTML_OPTTABLE_PAGE != nId) )
505  {
506  aSet.Put (SwWrtShellItem(pCurrView->GetWrtShellPtr()));
507  xRet->PageCreated(aSet);
508  }
509  }
510  }
511  break;
512  case RID_SW_TP_OPTSHDWCRSR:
513  case RID_SW_TP_HTML_OPTSHDWCRSR:
514  case RID_SW_TP_REDLINE_OPT:
515  case RID_SW_TP_COMPARISON_OPT:
516  case RID_SW_TP_OPTLOAD_PAGE:
517  case RID_SW_TP_OPTCOMPATIBILITY_PAGE:
518  case RID_SW_TP_MAILCONFIG:
519  {
521  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
522  xRet = (*fnCreatePage)( pPage, pController, &rSet );
523  if (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR)
524  {
525  SwView* pCurrView = GetView();
526  if(pCurrView)
527  {
528  aSet.Put( SwWrtShellItem( pCurrView->GetWrtShellPtr() ) );
529  xRet->PageCreated(aSet);
530  }
531  }
532  }
533  break;
534  case RID_SW_TP_OPTTEST_PAGE:
535  {
537  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
538  xRet = (*fnCreatePage)( pPage, pController, &rSet );
539  break;
540  }
541  case RID_SW_TP_BACKGROUND:
542  {
544  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG );
545  xRet = (*fnCreatePage)( pPage, pController, &rSet );
546  xRet->PageCreated( rSet );
547  break;
548  }
549  case RID_SW_TP_OPTCAPTION_PAGE:
550  {
552  ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SW_TP_OPTCAPTION_PAGE );
553  xRet = (*fnCreatePage)( pPage, pController, &rSet );
554  }
555  break;
556  }
557 
558  if(!xRet)
559  SAL_WARN( "sw", "SwModule::CreateTabPage(): Unknown tabpage id " << nId );
560  return xRet;
561 }
562 
563 /* 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)
const SwNodes & GetNodes() const
Definition: viewsh.cxx:2085
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
void SetDivisionX(short n)
Definition: viewopt.hxx:445
static SfxAbstractDialogFactory * Create()
bool SttEndDoc(bool bStt)
Definition: crsrsh.cxx:573
std::string GetValue
#define FN_PARAM_ELEM
Definition: cmdid.h:766
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:345
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:619
#define ASIAN
void EnterStdMode()
Definition: select.cxx:551
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:804
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:764
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:91
constexpr tools::Long Width() const
#define FN_PARAM_DOCDISP
Definition: cmdid.h:765
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:449
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
#define FN_PARAM_PRINTER
Definition: cmdid.h:792
size_type size() const
#define FN_PARAM_CRSR_IN_PROTECTED
Definition: cmdid.h:808
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:2663
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:795
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:793
constexpr auto convertMm100ToTwip(N n)
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:513
void SetFieldDivisionX(sal_uInt32 nSet)
bool GetAttrOutlineContentVisible(bool &bOutlineContentVisibleAttr)
GetAttrOutlineContentVisible.
Definition: ndtxt.cxx:4037
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
bool IsLineBreak(bool bHard=false) const
Definition: viewopt.hxx:252
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
Definition: ndarr.hxx:231
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:848
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:607
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:955
#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)
virtual std::unique_ptr< SfxItemSet > CreateItemSet(sal_uInt16 nId) override
Definition: appopt.cxx:64
Item for settings dialog - document view.
Definition: cfgitems.hxx:41
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:423
void ToggleOutlineContentVisibility(SwNode *pNd, const bool bForceNotVisible=false)
Definition: wrtsh1.cxx:2011
void SetRetoucheColor(const Color &r)
Definition: viewopt.hxx:579
void AlignAllFormulasToBaseline()
aligns all formulas with anchor 'as char' to baseline
Definition: fefly1.cxx:2087
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 UnSelectFrame()
Definition: select.cxx:323
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
void LeaveSelFrameMode()
Definition: select.cxx:720
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
std::vector< SwNode * >::size_type size_type
bool IsSnap() const
Definition: viewopt.hxx:358
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:733
bool IsTextNode() const
Definition: node.hxx:640
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
sal_uInt16 nPos
bool IsSelFrameMode() const
Definition: wrtsh.hxx:171
SwView * GetView()
Definition: swmodule.hxx:147
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:845
void ApplyUsrPref(const SwViewOption &, SwView *, SvViewOpt nDest=SvViewOpt::DestView)
Definition: swmodul1.cxx:137
Base class of the Writer document model elements.
Definition: node.hxx:80