LibreOffice Module sw (master)  1
swmodul1.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 <sal/config.h>
21 
22 #include <memory>
23 #include <boost/property_tree/json_parser.hpp>
24 
25 #include <hintids.hxx>
26 #include <sfx2/request.hxx>
27 #include <unotools/useroptions.hxx>
28 #include <com/sun/star/frame/FrameSearchFlag.hpp>
29 #include <com/sun/star/frame/XFrame.hpp>
30 #include <com/sun/star/view/XSelectionSupplier.hpp>
31 #include <svx/colorwindow.hxx>
33 #include <editeng/editids.hrc>
34 #include <editeng/wghtitem.hxx>
35 #include <editeng/postitem.hxx>
36 #include <editeng/udlnitem.hxx>
38 #include <editeng/cmapitem.hxx>
39 #include <editeng/colritem.hxx>
40 #include <editeng/brushitem.hxx>
41 #include <svl/cjkoptions.hxx>
42 #include <swmodule.hxx>
43 #include <swtypes.hxx>
44 #include <usrpref.hxx>
45 #include <modcfg.hxx>
46 #include <view.hxx>
47 #include <pview.hxx>
48 #include <wview.hxx>
49 #include <wrtsh.hxx>
50 #include <docsh.hxx>
51 #include <uinums.hxx>
52 #include <prtopt.hxx>
53 #include <navicfg.hxx>
54 #include <doc.hxx>
55 #include <strings.hrc>
57 
58 #include <tools/color.hxx>
59 #include <tools/json_writer.hxx>
60 #include <PostItMgr.hxx>
61 
62 using namespace ::svx;
63 using namespace ::com::sun::star;
64 using namespace ::com::sun::star::uno;
65 using namespace ::com::sun::star::beans;
66 using namespace ::com::sun::star::frame;
67 using namespace ::com::sun::star::view;
68 using namespace ::com::sun::star::lang;
69 
70 static void lcl_SetUIPrefs(const SwViewOption &rPref, SwView* pView, SwViewShell* pSh )
71 {
72  // in FrameSets the actual visibility can differ from the ViewOption's setting
73  bool bVScrollChanged = rPref.IsViewVScrollBar() != pSh->GetViewOptions()->IsViewVScrollBar();
74  bool bHScrollChanged = rPref.IsViewHScrollBar() != pSh->GetViewOptions()->IsViewHScrollBar();
75  bool bVAlignChanged = rPref.IsVRulerRight() != pSh->GetViewOptions()->IsVRulerRight();
76 
77  pSh->SetUIOptions(rPref);
78  const SwViewOption* pNewPref = pSh->GetViewOptions();
79 
80  // Scrollbars on / off
81  if(bVScrollChanged)
82  {
83  pView->EnableVScrollbar(pNewPref->IsViewVScrollBar());
84  }
85  if(bHScrollChanged)
86  {
87  pView->EnableHScrollbar( pNewPref->IsViewHScrollBar() || pNewPref->getBrowseMode() );
88  }
89  //if only the position of the vertical ruler has been changed initiate an update
90  if(bVAlignChanged && !bHScrollChanged && !bVScrollChanged)
91  pView->InvalidateBorder();
92 
93  // Rulers on / off
94  if(pNewPref->IsViewVRuler())
95  pView->CreateVRuler();
96  else
97  pView->KillVRuler();
98 
99  // TabWindow on / off
100  if(pNewPref->IsViewHRuler())
101  pView->CreateTab();
102  else
103  pView->KillTab();
104 
105  pView->GetPostItMgr()->PrepareView(true);
106 }
107 
109 {
110  SwView *pActive = ::GetActiveView();
111  if( pActive )
112  return &pActive->GetWrtShell();
113  return nullptr;
114 }
115 
117 {
119  return dynamic_cast<SwView*>( pView );
120 }
121 
123 {
124  // returns only visible SwView
125  SwView* pView = static_cast<SwView*>(SfxViewShell::GetFirst(true, checkSfxViewShell<SwView>));
126  return pView;
127 }
128 
130 {
131  OSL_ENSURE( pView,"return no SwView" );
132  SwView* pNView = static_cast<SwView*>(SfxViewShell::GetNext(*pView, true, checkSfxViewShell<SwView>));
133  return pNView;
134 }
135 
136 // New Master for the settings is set; this affects the current view and all following.
137 void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
138  SvViewOpt nDest )
139 {
140  SwView* pCurrView = pActView;
141  SwViewShell* pSh = pCurrView ? &pCurrView->GetWrtShell() : nullptr;
142 
143  SwMasterUsrPref* pPref = const_cast<SwMasterUsrPref*>(GetUsrPref(
144  nDest == SvViewOpt::DestWeb
145  || (nDest != SvViewOpt::DestText
146  && dynamic_cast< const SwWebView *>( pCurrView )) ));
147 
148  // with Uno, only sdbcx::View, but not the Module should be changed
149  bool bViewOnly = SvViewOpt::DestViewOnly == nDest;
150  // fob Preview off
151  SwPagePreview* pPPView;
152  if( !pCurrView && nullptr != (pPPView = dynamic_cast<SwPagePreview*>( SfxViewShell::Current())) )
153  {
154  if(!bViewOnly)
155  pPref->SetUIOptions( rUsrPref );
156  pPPView->EnableVScrollbar(pPref->IsViewVScrollBar());
157  pPPView->EnableHScrollbar(pPref->IsViewHScrollBar());
158  if(!bViewOnly)
159  {
160  pPref->SetPagePrevRow(rUsrPref.GetPagePrevRow());
161  pPref->SetPagePrevCol(rUsrPref.GetPagePrevCol());
162  }
163  return;
164  }
165 
166  if(!bViewOnly)
167  {
168  pPref->SetUsrPref( rUsrPref );
169  pPref->SetModified();
170  }
171 
172  if( !pCurrView )
173  return;
174 
175  // Passing on to CORE
176  bool bReadonly;
177  const SwDocShell* pDocSh = pCurrView->GetDocShell();
178  if (pDocSh)
179  bReadonly = pDocSh->IsReadOnly();
180  else //Use existing option if DocShell missing
181  bReadonly = pSh->GetViewOptions()->IsReadonly();
182  std::unique_ptr<SwViewOption> xViewOpt;
183  if (!bViewOnly)
184  xViewOpt.reset(new SwViewOption(*pPref));
185  else
186  xViewOpt.reset(new SwViewOption(rUsrPref));
187  xViewOpt->SetReadonly( bReadonly );
188  if( !(*pSh->GetViewOptions() == *xViewOpt) )
189  {
190  //is maybe only a SwViewShell
191  pSh->StartAction();
192  pSh->ApplyViewOptions( *xViewOpt );
193  static_cast<SwWrtShell*>(pSh)->SetReadOnlyAvailable(xViewOpt->IsCursorInProtectedArea());
194  pSh->EndAction();
195  }
196  if ( pSh->GetViewOptions()->IsReadonly() != bReadonly )
197  pSh->SetReadonlyOption(bReadonly);
198 
199  lcl_SetUIPrefs(*xViewOpt, pCurrView, pSh);
200 
201  // in the end the Idle-Flag is set again
202  pPref->SetIdle(true);
203 }
204 
205 void SwModule::ApplyUserMetric( FieldUnit eMetric, bool bWeb )
206 {
207  SwMasterUsrPref* pPref;
208  if(bWeb)
209  {
210  if(!m_pWebUsrPref)
211  GetUsrPref(true);
212  pPref = m_pWebUsrPref.get();
213  }
214  else
215  {
216  if(!m_pUsrPref)
217  GetUsrPref(false);
218  pPref = m_pUsrPref.get();
219  }
220  FieldUnit eOldMetric = pPref->GetMetric();
221  if(eOldMetric != eMetric)
222  pPref->SetMetric(eMetric);
223 
224  FieldUnit eHScrollMetric = pPref->IsHScrollMetric() ? pPref->GetHScrollMetric() : eMetric;
225  FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : eMetric;
226 
227  SwView* pTmpView = SwModule::GetFirstView();
228  // switch the ruler for all MDI-Windows
229  while(pTmpView)
230  {
231  if(bWeb == (dynamic_cast<SwWebView*>( pTmpView) != nullptr) )
232  {
233  pTmpView->ChangeVRulerMetric(eVScrollMetric);
234  pTmpView->ChangeTabMetric(eHScrollMetric);
235  }
236 
237  pTmpView = SwModule::GetNextView(pTmpView);
238  }
239 }
240 
241 void SwModule::ApplyRulerMetric( FieldUnit eMetric, bool bHorizontal, bool bWeb )
242 {
243  SwMasterUsrPref* pPref;
244  if(bWeb)
245  {
246  if(!m_pWebUsrPref)
247  GetUsrPref(true);
248  pPref = m_pWebUsrPref.get();
249  }
250  else
251  {
252  if(!m_pUsrPref)
253  GetUsrPref(false);
254  pPref = m_pUsrPref.get();
255  }
256  if( bHorizontal )
257  pPref->SetHScrollMetric(eMetric);
258  else
259  pPref->SetVScrollMetric(eMetric);
260 
261  SwView* pTmpView = SwModule::GetFirstView();
262  // switch metric at the appropriate rulers
263  while(pTmpView)
264  {
265  if(bWeb == (dynamic_cast<SwWebView *>( pTmpView ) != nullptr))
266  {
267  if( bHorizontal )
268  pTmpView->ChangeTabMetric(eMetric);
269  else
270  pTmpView->ChangeVRulerMetric(eMetric);
271  }
272  pTmpView = SwModule::GetNextView(pTmpView);
273  }
274 }
275 
276 //set the usrpref 's char unit attribute and set rulers unit as char if the "apply char unit" is checked
277 void SwModule::ApplyUserCharUnit(bool bApplyChar, bool bWeb)
278 {
279  SwMasterUsrPref* pPref;
280  if(bWeb)
281  {
282  if(!m_pWebUsrPref)
283  GetUsrPref(true);
284  pPref = m_pWebUsrPref.get();
285  }
286  else
287  {
288  if(!m_pUsrPref)
289  GetUsrPref(false);
290  pPref = m_pUsrPref.get();
291  }
292  bool bOldApplyCharUnit = pPref->IsApplyCharUnit();
293  bool bHasChanged = false;
294  if(bOldApplyCharUnit != bApplyChar)
295  {
296  pPref->SetApplyCharUnit(bApplyChar);
297  bHasChanged = true;
298  }
299 
300  if( !bHasChanged )
301  return;
302 
303  FieldUnit eHScrollMetric = pPref->IsHScrollMetric() ? pPref->GetHScrollMetric() : pPref->GetMetric();
304  FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : pPref->GetMetric();
305  if(bApplyChar)
306  {
307  eHScrollMetric = FieldUnit::CHAR;
308  eVScrollMetric = FieldUnit::LINE;
309  }
310  else
311  {
312  SvtCJKOptions aCJKOptions;
313  if ( !aCJKOptions.IsAsianTypographyEnabled() && ( eHScrollMetric == FieldUnit::CHAR ))
314  eHScrollMetric = FieldUnit::INCH;
315  else if ( eHScrollMetric == FieldUnit::CHAR )
316  eHScrollMetric = FieldUnit::CM;
317  if ( !aCJKOptions.IsAsianTypographyEnabled() && ( eVScrollMetric == FieldUnit::LINE ))
318  eVScrollMetric = FieldUnit::INCH;
319  else if ( eVScrollMetric == FieldUnit::LINE )
320  eVScrollMetric = FieldUnit::CM;
321  }
322  SwView* pTmpView = SwModule::GetFirstView();
323  // switch rulers for all MDI-Windows
324  while(pTmpView)
325  {
326  if(bWeb == (dynamic_cast<SwWebView*>( pTmpView) != nullptr) )
327  {
328  pTmpView->ChangeVRulerMetric(eVScrollMetric);
329  pTmpView->ChangeTabMetric(eHScrollMetric);
330  }
331 
332  pTmpView = SwModule::GetNextView(pTmpView);
333  }
334 }
335 
337 {
339  {
341  }
342  return m_pNavigationConfig.get();
343 }
344 
346 {
347  if(bWeb && !m_pWebPrintOptions)
348  {
349  m_pWebPrintOptions.reset(new SwPrintOptions(true));
350  }
351  else if(!bWeb && !m_pPrintOptions)
352  {
353  m_pPrintOptions.reset(new SwPrintOptions(false));
354  }
355 
356  return bWeb ? m_pWebPrintOptions.get() : m_pPrintOptions.get();
357 }
358 
360 {
361  if(!m_pChapterNumRules)
363  return m_pChapterNumRules.get();
364 }
365 
366 void SwModule::ShowDBObj(SwView const & rView, const SwDBData& rData)
367 {
368  Reference<XFrame> xFrame = rView.GetViewFrame()->GetFrame().GetFrameInterface();
369 
370  uno::Reference<XFrame> xBeamerFrame = xFrame->findFrame("_beamer", FrameSearchFlag::CHILDREN);
371  if (!xBeamerFrame.is())
372  return;
373 
374 // the beamer has been opened by the SfxViewFrame
375  Reference<XController> xController = xBeamerFrame->getController();
376  Reference<XSelectionSupplier> xControllerSelection(xController, UNO_QUERY);
377  if (xControllerSelection.is())
378  {
379 
380  ODataAccessDescriptor aSelection;
381  aSelection.setDataSource(rData.sDataSource);
382  aSelection[DataAccessDescriptorProperty::Command] <<= rData.sCommand;
383  aSelection[DataAccessDescriptorProperty::CommandType] <<= rData.nCommandType;
384  xControllerSelection->select(makeAny(aSelection.createPropertyValueSequence()));
385  }
386  else {
387  OSL_FAIL("no selection supplier in the beamer!");
388  }
389 }
390 
392 {
394  {
395  const SvtUserOptions& rOpt = GetUserOptions();
396  m_sActAuthor = rOpt.GetFullName();
397  if (m_sActAuthor.isEmpty())
398  {
399  m_sActAuthor = rOpt.GetID();
400  if (m_sActAuthor.isEmpty())
401  m_sActAuthor = SwResId( STR_REDLINE_UNKNOWN_AUTHOR );
402  }
403  m_bAuthorInitialised = true;
404  }
406 }
407 
408 void SwModule::SetRedlineAuthor(const OUString &rAuthor)
409 {
410  m_bAuthorInitialised = true;
411  m_sActAuthor = rAuthor;
413 }
414 
415 OUString const & SwModule::GetRedlineAuthor(std::size_t nPos)
416 {
417  OSL_ENSURE(nPos < m_pAuthorNames.size(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash
418  while(nPos >= m_pAuthorNames.size())
419  {
420  InsertRedlineAuthor("nn");
421  }
422  return m_pAuthorNames[nPos];
423 }
424 
425 static Color lcl_GetAuthorColor(std::size_t nPos)
426 {
427  static const Color aColArr[] =
428  {
432  };
433 
434  return aColArr[nPos % SAL_N_ELEMENTS(aColArr)];
435 }
436 
439 {
440  auto authorsNode = rJsonWriter.startNode("authors");
441  for (std::size_t nAuthor = 0; nAuthor < m_pAuthorNames.size(); ++nAuthor)
442  {
443  auto authorNode = rJsonWriter.startNode("");
444  rJsonWriter.put("index", static_cast<sal_Int64>(nAuthor));
445  rJsonWriter.put("name", m_pAuthorNames[nAuthor]);
446  rJsonWriter.put("color", sal_uInt32(lcl_GetAuthorColor(nAuthor)));
447  }
448 }
449 
450 std::size_t SwModule::InsertRedlineAuthor(const OUString& rAuthor)
451 {
452  std::size_t nPos = 0;
453 
454  while(nPos < m_pAuthorNames.size() && m_pAuthorNames[nPos] != rAuthor)
455  ++nPos;
456 
457  if (nPos == m_pAuthorNames.size())
458  m_pAuthorNames.push_back(rAuthor);
459 
460  return nPos;
461 }
462 
463 static void lcl_FillAuthorAttr( std::size_t nAuthor, SfxItemSet &rSet,
464  const AuthorCharAttr &rAttr )
465 {
466  Color aCol( rAttr.m_nColor );
467 
468  if( rAttr.m_nColor == COL_TRANSPARENT )
469  aCol = lcl_GetAuthorColor(nAuthor);
470 
471  bool bBackGr = rAttr.m_nColor == COL_NONE_COLOR;
472 
473  switch (rAttr.m_nItemId)
474  {
475  case SID_ATTR_CHAR_WEIGHT:
476  {
477  SvxWeightItem aW( static_cast<FontWeight>(rAttr.m_nAttr), RES_CHRATR_WEIGHT );
478  rSet.Put( aW );
479  aW.SetWhich( RES_CHRATR_CJK_WEIGHT );
480  rSet.Put( aW );
481  aW.SetWhich( RES_CHRATR_CTL_WEIGHT );
482  rSet.Put( aW );
483  }
484  break;
485 
486  case SID_ATTR_CHAR_POSTURE:
487  {
488  SvxPostureItem aP( static_cast<FontItalic>(rAttr.m_nAttr), RES_CHRATR_POSTURE );
489  rSet.Put( aP );
490  aP.SetWhich( RES_CHRATR_CJK_POSTURE );
491  rSet.Put( aP );
492  aP.SetWhich( RES_CHRATR_CTL_POSTURE );
493  rSet.Put( aP );
494  }
495  break;
496 
497  case SID_ATTR_CHAR_UNDERLINE:
498  rSet.Put( SvxUnderlineItem( static_cast<FontLineStyle>(rAttr.m_nAttr),
500  break;
501 
502  case SID_ATTR_CHAR_STRIKEOUT:
503  rSet.Put(SvxCrossedOutItem( static_cast<FontStrikeout>(rAttr.m_nAttr),
505  break;
506 
507  case SID_ATTR_CHAR_CASEMAP:
508  rSet.Put( SvxCaseMapItem( static_cast<SvxCaseMap>(rAttr.m_nAttr),
510  break;
511 
512  case SID_ATTR_BRUSH:
513  rSet.Put( SvxBrushItem( aCol, RES_CHRATR_BACKGROUND ));
514  bBackGr = true;
515  break;
516  }
517 
518  if( !bBackGr )
519  rSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) );
520 }
521 
522 void SwModule::GetInsertAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
523 {
524  lcl_FillAuthorAttr(nAuthor, rSet, m_pModuleConfig->GetInsertAuthorAttr());
525 }
526 
527 void SwModule::GetDeletedAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
528 {
529  lcl_FillAuthorAttr(nAuthor, rSet, m_pModuleConfig->GetDeletedAuthorAttr());
530 }
531 
532 // For future extension:
533 void SwModule::GetFormatAuthorAttr( std::size_t nAuthor, SfxItemSet &rSet )
534 {
535  lcl_FillAuthorAttr( nAuthor, rSet, m_pModuleConfig->GetFormatAuthorAttr() );
536 }
537 
538 sal_uInt16 SwModule::GetRedlineMarkPos() const
539 {
540  return m_pModuleConfig->GetMarkAlignMode();
541 }
542 
543 bool SwModule::IsInsTableFormatNum(bool bHTML) const
544 {
545  return m_pModuleConfig->IsInsTableFormatNum(bHTML);
546 }
547 
549 {
550  return m_pModuleConfig->IsInsTableChangeNumFormat(bHTML);
551 }
552 
553 bool SwModule::IsInsTableAlignNum(bool bHTML) const
554 {
555  return m_pModuleConfig->IsInsTableAlignNum(bHTML);
556 }
557 
559 {
560  return m_pModuleConfig->IsSplitVerticalByDefault(bHTML);
561 }
562 
563 void SwModule::SetSplitVerticalByDefault(bool bHTML, bool value)
564 {
565  m_pModuleConfig->SetSplitVerticalByDefault(bHTML, value);
566 }
567 
569 {
570  return m_pModuleConfig->GetMarkAlignColor();
571 }
572 
574 {
575  return GetUsrPref( bWeb );
576 }
577 
578 OUString const & SwModule::GetDocStatWordDelim() const
579 {
580  return m_pModuleConfig->GetWordDelimiter();
581 }
582 
583 // Passing-through of the ModuleConfig's Metric (for HTML-Export)
584 FieldUnit SwModule::GetMetric( bool bWeb ) const
585 {
586  SwMasterUsrPref* pPref;
587  if(bWeb)
588  {
589  if(!m_pWebUsrPref)
590  GetUsrPref(true);
591  pPref = m_pWebUsrPref.get();
592  }
593  else
594  {
595  if(!m_pUsrPref)
596  GetUsrPref(false);
597  pPref = m_pUsrPref.get();
598  }
599  return pPref->GetMetric();
600 }
601 
602 // Pass-through Update-Status
603 sal_uInt16 SwModule::GetLinkUpdMode() const
604 {
605  if(!m_pUsrPref)
606  GetUsrPref(false);
607  return static_cast<sal_uInt16>(m_pUsrPref->GetUpdateLinkMode());
608 }
609 
611 {
612  if(!m_pUsrPref)
613  GetUsrPref(false);
614  return m_pUsrPref->GetFieldUpdateFlags();
615 }
616 
618 {
619  if(!m_pUsrPref)
620  GetUsrPref(false);
621  m_pUsrPref->SetFieldUpdateFlags(eFieldFlags);
622 }
623 
624 void SwModule::ApplyLinkMode(sal_Int32 nNewLinkMode)
625 {
626  if(!m_pUsrPref)
627  GetUsrPref(false);
628  m_pUsrPref->SetUpdateLinkMode(nNewLinkMode);
629 }
630 
631 void SwModule::CheckSpellChanges( bool bOnlineSpelling,
632  bool bIsSpellWrongAgain, bool bIsSpellAllAgain, bool bSmartTags )
633 {
634  bool bOnlyWrong = bIsSpellWrongAgain && !bIsSpellAllAgain;
635  bool bInvalid = bOnlyWrong || bIsSpellAllAgain;
636  if( !(bOnlineSpelling || bInvalid) )
637  return;
638 
639  for( SwDocShell *pDocSh = static_cast<SwDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<SwDocShell>));
640  pDocSh;
641  pDocSh = static_cast<SwDocShell*>(SfxObjectShell::GetNext( *pDocSh, checkSfxObjectShell<SwDocShell> ) ) )
642  {
643  SwDoc* pTmp = pDocSh->GetDoc();
645  {
646  pTmp->SpellItAgainSam( bInvalid, bOnlyWrong, bSmartTags );
648  if ( bSmartTags && pViewShell && pViewShell->GetWin() )
649  pViewShell->GetWin()->Invalidate();
650  }
651  }
652 }
653 
654 void SwModule::ApplyDefaultPageMode(bool bIsSquaredPageMode)
655 {
656  if(!m_pUsrPref)
657  GetUsrPref(false);
658  m_pUsrPref->SetDefaultPageMode(bIsSquaredPageMode);
659 }
660 
662 {
663  return m_pModuleConfig->GetCompareMode();
664 }
665 
667 {
668  return m_pModuleConfig->IsUseRsid();
669 }
670 
672 {
673  return m_pModuleConfig->IsIgnorePieces();
674 }
675 
676 sal_uInt16 SwModule::GetPieceLen() const
677 {
678  return m_pModuleConfig->GetPieceLen();
679 }
680 
681 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxViewFrame * GetViewFrame() const
void ApplyUserCharUnit(bool bApplyChar, bool bWeb)
Definition: swmodul1.cxx:277
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
Definition: swmodul1.cxx:366
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
FieldUnit
sal_Int32 nCommandType
Definition: swdbdata.hxx:32
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2111
void SetUsrPref(const SwViewOption &rCopy)
Definition: usrpref.cxx:37
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
SwFieldUpdateFlags
Definition: fldupde.hxx:22
SwView * GetActiveView()
Definition: swmodul1.cxx:116
SwNavigationConfig * GetNavigationConfig()
Definition: swmodul1.cxx:336
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:570
View of a document.
Definition: pview.hxx:161
SwPrintOptions * GetPrtOptions(bool bWeb)
Definition: swmodul1.cxx:345
OUString sDataSource
Definition: swdbdata.hxx:30
Reference< XFrame > xFrame
SwChapterNumRules * GetChapterNumRules()
Definition: swmodul1.cxx:359
void GetRedlineAuthorInfo(tools::JsonWriter &rJsonWriter)
See SwXTextDocument::getTrackedChangeAuthors().
Definition: swmodul1.cxx:438
void SetHScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:218
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
Definition: doc.hxx:184
bool IsApplyCharUnit() const
Definition: usrpref.hxx:232
ScopedJsonWriterNode startNode(const char *)
constexpr::Color COL_AUTHOR4_DARK(105, 43, 157)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
void SetSplitVerticalByDefault(bool bHTML, bool value)
Definition: swmodul1.cxx:563
bool IsSplitVerticalByDefault(bool bHTML) const
Definition: swmodul1.cxx:558
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pWebUsrPref
Definition: swmodule.hxx:81
bool IsIgnorePieces() const
Definition: swmodul1.cxx:671
void SetVScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:226
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
Definition: apphdl.cxx:1044
std::unique_ptr< SwChapterNumRules > m_pChapterNumRules
Definition: swmodule.hxx:84
std::size_t GetRedlineAuthor()
Definition: swmodul1.cxx:391
void ApplyRulerMetric(FieldUnit eMetric, bool bHorizontal, bool bWeb)
Definition: swmodul1.cxx:241
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
void GetInsertAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
Definition: swmodul1.cxx:522
sal_uInt16 m_nAttr
Definition: authratr.hxx:30
virtual void SetReadonlyOption(bool bSet)
Definition: viewsh.cxx:2301
void ApplyDefaultPageMode(bool bIsSquaredPageMode)
Definition: swmodul1.cxx:654
FieldUnit GetHScrollMetric() const
Definition: usrpref.hxx:217
SwWrtShell & GetWrtShell() const
Definition: view.hxx:398
void SetPagePrevRow(sal_uInt8 n)
Definition: viewopt.hxx:442
static void lcl_SetUIPrefs(const SwViewOption &rPref, SwView *pView, SwViewShell *pSh)
Definition: swmodul1.cxx:70
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
static void CheckSpellChanges(bool bOnlineSpelling, bool bIsSpellWrongAgain, bool bIsSpellAllAgain, bool bSmartTags)
Definition: swmodul1.cxx:631
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
bool IsReadonly() const
Definition: viewopt.hxx:445
Reference< XController > xController
void InvalidateBorder()
const SwViewOption * GetViewOption(bool bWeb)
Definition: swmodul1.cxx:573
void ApplyLinkMode(sal_Int32 nNewLinkMode)
Definition: swmodul1.cxx:624
bool getBrowseMode() const
Definition: viewopt.hxx:454
void GetFormatAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
Definition: swmodul1.cxx:533
std::unique_ptr< SwPrintOptions > m_pWebPrintOptions
Definition: swmodule.hxx:83
SfxFrame & GetFrame() const
static SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SfxViewShell * Current()
constexpr::Color COL_AUTHOR6_DARK(0, 128, 128)
void SetUIOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2290
constexpr::Color COL_AUTHOR8_DARK(53, 85, 107)
bool IsViewVScrollBar() const
Definition: viewopt.hxx:501
constexpr::Color COL_AUTHOR2_DARK(6, 70, 162)
void EnableHScrollbar(bool bEnable)
Definition: pview.cxx:1843
std::vector< OUString > m_pAuthorNames
Definition: swmodule.hxx:105
bool IsViewHRuler(bool bDirect=false) const
Definition: viewopt.hxx:574
void CreateVRuler()
Definition: viewmdi.cxx:598
bool m_bAuthorInitialised
Definition: swmodule.hxx:112
void PrepareView(bool bIgnoreCount=false)
Definition: PostItMgr.cxx:1862
void KillVRuler()
Definition: viewmdi.cxx:607
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
bool IsInsTableAlignNum(bool bHTML) const
Definition: swmodul1.cxx:553
SwCompareMode
Definition: modcfg.hxx:87
#define SAL_N_ELEMENTS(arr)
const Color & GetRedlineMarkColor() const
Definition: swmodul1.cxx:568
#define COL_NONE_COLOR
void SetPagePrevCol(sal_uInt8 n)
Definition: viewopt.hxx:444
std::size_t InsertRedlineAuthor(const OUString &rAuthor)
Definition: swmodul1.cxx:450
sal_uInt16 GetLinkUpdMode() const
Definition: swmodul1.cxx:603
constexpr::Color COL_AUTHOR9_DARK(209, 118, 0)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void GetDeletedAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
Definition: swmodul1.cxx:527
void StartAction()
Definition: viewsh.hxx:590
bool IsViewVRuler(bool bDirect=false) const
Definition: viewopt.hxx:588
SwFieldUpdateFlags GetFieldUpdateFlags() const
Definition: swmodul1.cxx:610
SvViewOpt
Definition: swmodule.hxx:62
static SwView * GetFirstView()
Definition: swmodul1.cxx:122
bool IsInsTableFormatNum(bool bHTML) const
Definition: swmodul1.cxx:543
SvtUserOptions & GetUserOptions()
Definition: apphdl.cxx:1034
sal_uInt16 m_nItemId
Definition: authratr.hxx:29
OUString SwResId(const char *pId)
Definition: swmodule.cxx:165
OUString GetID() const
OUString m_sActAuthor
Definition: swmodule.hxx:76
void EnableHScrollbar(bool bEnable)
Definition: viewmdi.cxx:682
static SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
void CreateTab()
Definition: viewmdi.cxx:556
void SetApplyCharUnit(bool bSet, bool noModify=false)
Definition: usrpref.hxx:236
void SpellItAgainSam(bool bInvalid, bool bOnlyWrong, bool bSmartTags)
Re-trigger spelling in the idle handler.
Definition: doc.cxx:1165
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
SwDocShell * GetDocShell()
Definition: view.cxx:1107
void put(const char *pPropName, const OUString &rPropValue)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
bool IsReadOnly() const
Color m_nColor
Definition: authratr.hxx:31
sal_uInt8 GetPagePrevRow() const
Definition: viewopt.hxx:441
void EndAction(const bool bIdleEnd=false)
Definition: viewsh.hxx:595
constexpr::Color COL_AUTHOR1_DARK(198, 146, 0)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
std::unique_ptr< SwModuleOptions, o3tl::default_delete< SwModuleOptions > > m_pModuleConfig
Definition: swmodule.hxx:79
bool IsUseRsid() const
Definition: swmodul1.cxx:666
void EnableVScrollbar(bool bEnable)
Definition: viewmdi.cxx:691
bool IsVRulerRight() const
Definition: viewopt.hxx:609
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
bool IsAsianTypographyEnabled() const
FieldUnit GetMetric() const
Definition: usrpref.hxx:208
void ApplyUserMetric(FieldUnit eMetric, bool bWeb)
Definition: swmodul1.cxx:205
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
void SetRedlineAuthor(const OUString &rAuthor)
Definition: swmodul1.cxx:408
bool IsVScrollMetric() const
Definition: usrpref.hxx:224
static SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:424
vcl::Window * GetWin() const
Definition: viewsh.hxx:338
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr::Color COL_AUTHOR5_DARK(197, 0, 11)
bool IsInsTableChangeNumFormat(bool bHTML) const
Definition: swmodul1.cxx:548
void SetIdle(bool b) const
Definition: viewopt.hxx:214
bool IsHScrollMetric() const
Definition: usrpref.hxx:216
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pUsrPref
Definition: swmodule.hxx:80
sal_uInt16 GetPieceLen() const
Definition: swmodul1.cxx:676
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:579
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:621
constexpr::Color COL_AUTHOR7_DARK(140, 132, 0)
std::unique_ptr< SwPrintOptions > m_pPrintOptions
Definition: swmodule.hxx:82
SwCompareMode GetCompareMode() const
Definition: swmodul1.cxx:661
std::unique_ptr< SwNavigationConfig > m_pNavigationConfig
Definition: swmodule.hxx:86
static SwView * GetNextView(SwView const *)
Definition: swmodul1.cxx:129
OUString GetFullName() const
static SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
FieldUnit GetMetric(bool bWeb) const
Definition: swmodul1.cxx:584
void ApplyFieldUpdateFlags(SwFieldUpdateFlags eFieldFlags)
Definition: swmodul1.cxx:617
void SetModified()
Definition: usrpref.hxx:157
void KillTab()
Definition: viewmdi.cxx:564
sal_uInt16 GetRedlineMarkPos() const
Definition: swmodul1.cxx:538
constexpr::Color COL_AUTHOR3_DARK(87, 157, 28)
static Color lcl_GetAuthorColor(std::size_t nPos)
Definition: swmodul1.cxx:425
bool IsViewHScrollBar() const
Definition: viewopt.hxx:509
OUString const & GetDocStatWordDelim() const
Definition: swmodul1.cxx:578
void SetUIOptions(const SwViewOption &)
Definition: viewopt.hxx:669
OUString sCommand
Definition: swdbdata.hxx:31
sal_uInt8 GetPagePrevCol() const
Definition: viewopt.hxx:443
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
static void lcl_FillAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet, const AuthorCharAttr &rAttr)
Definition: swmodul1.cxx:463
Definition: view.hxx:144
sal_uInt16 nPos
void SetMetric(FieldUnit eSet, bool bNoModify=false)
Definition: usrpref.hxx:209
void EnableVScrollbar(bool bEnable)
Definition: pview.cxx:1852
void ApplyUsrPref(const SwViewOption &, SwView *, SvViewOpt nDest=SvViewOpt::DestView)
Definition: swmodul1.cxx:137
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)