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