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
24#include <hintids.hxx>
25#include <sfx2/request.hxx>
27#include <com/sun/star/frame/FrameSearchFlag.hpp>
28#include <com/sun/star/frame/XFrame.hpp>
29#include <com/sun/star/view/XSelectionSupplier.hpp>
30#include <svx/colorwindow.hxx>
32#include <editeng/editids.hrc>
33#include <editeng/wghtitem.hxx>
34#include <editeng/postitem.hxx>
35#include <editeng/udlnitem.hxx>
37#include <editeng/cmapitem.hxx>
38#include <editeng/colritem.hxx>
39#include <editeng/brushitem.hxx>
40#include <svl/cjkoptions.hxx>
41#include <osl/diagnose.h>
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
62using namespace ::svx;
63using namespace ::com::sun::star;
64using namespace ::com::sun::star::uno;
65using namespace ::com::sun::star::beans;
66using namespace ::com::sun::star::frame;
67using namespace ::com::sun::star::view;
68using namespace ::com::sun::star::lang;
69
70static 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 if (SwView *pActive = GetActiveView())
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.
136void 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
204void 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 assert(pPref && "pPref is set by here");
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
241void 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 assert(pPref && "pPref will be set by now");
257 if( bHorizontal )
258 pPref->SetHScrollMetric(eMetric);
259 else
260 pPref->SetVScrollMetric(eMetric);
261
262 SwView* pTmpView = SwModule::GetFirstView();
263 // switch metric at the appropriate rulers
264 while(pTmpView)
265 {
266 if(bWeb == (dynamic_cast<SwWebView *>( pTmpView ) != nullptr))
267 {
268 if( bHorizontal )
269 pTmpView->ChangeTabMetric(eMetric);
270 else
271 pTmpView->ChangeVRulerMetric(eMetric);
272 }
273 pTmpView = SwModule::GetNextView(pTmpView);
274 }
275}
276
277//set the usrpref 's char unit attribute and set rulers unit as char if the "apply char unit" is checked
278void SwModule::ApplyUserCharUnit(bool bApplyChar, bool bWeb)
279{
280 SwMasterUsrPref* pPref;
281 if(bWeb)
282 {
283 if(!m_pWebUsrPref)
284 GetUsrPref(true);
285 pPref = m_pWebUsrPref.get();
286 }
287 else
288 {
289 if(!m_pUsrPref)
290 GetUsrPref(false);
291 pPref = m_pUsrPref.get();
292 }
293 assert(pPref && "pPref is set by here");
294 bool bOldApplyCharUnit = pPref->IsApplyCharUnit();
295 bool bHasChanged = false;
296 if(bOldApplyCharUnit != bApplyChar)
297 {
298 pPref->SetApplyCharUnit(bApplyChar);
299 bHasChanged = true;
300 }
301
302 if( !bHasChanged )
303 return;
304
305 FieldUnit eHScrollMetric = pPref->IsHScrollMetric() ? pPref->GetHScrollMetric() : pPref->GetMetric();
306 FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : pPref->GetMetric();
307 if(bApplyChar)
308 {
309 eHScrollMetric = FieldUnit::CHAR;
310 eVScrollMetric = FieldUnit::LINE;
311 }
312 else
313 {
314 if ( !SvtCJKOptions::IsAsianTypographyEnabled() && ( eHScrollMetric == FieldUnit::CHAR ))
315 eHScrollMetric = FieldUnit::INCH;
316 else if ( eHScrollMetric == FieldUnit::CHAR )
317 eHScrollMetric = FieldUnit::CM;
318 if ( !SvtCJKOptions::IsAsianTypographyEnabled() && ( eVScrollMetric == FieldUnit::LINE ))
319 eVScrollMetric = FieldUnit::INCH;
320 else if ( eVScrollMetric == FieldUnit::LINE )
321 eVScrollMetric = FieldUnit::CM;
322 }
323 SwView* pTmpView = SwModule::GetFirstView();
324 // switch rulers for all MDI-Windows
325 while(pTmpView)
326 {
327 if(bWeb == (dynamic_cast<SwWebView*>( pTmpView) != nullptr) )
328 {
329 pTmpView->ChangeVRulerMetric(eVScrollMetric);
330 pTmpView->ChangeTabMetric(eHScrollMetric);
331 }
332
333 pTmpView = SwModule::GetNextView(pTmpView);
334 }
335}
336
338{
340 {
342 }
343 return m_pNavigationConfig.get();
344}
345
347{
348 if(bWeb && !m_pWebPrintOptions)
349 {
350 m_pWebPrintOptions.reset(new SwPrintOptions(true));
351 }
352 else if(!bWeb && !m_pPrintOptions)
353 {
354 m_pPrintOptions.reset(new SwPrintOptions(false));
355 }
356
357 return bWeb ? m_pWebPrintOptions.get() : m_pPrintOptions.get();
358}
359
361{
364 return m_pChapterNumRules.get();
365}
366
367void SwModule::ShowDBObj(SwView const & rView, const SwDBData& rData)
368{
369 Reference<XFrame> xFrame = rView.GetViewFrame().GetFrame().GetFrameInterface();
370
371 uno::Reference<XFrame> xBeamerFrame = xFrame->findFrame("_beamer", FrameSearchFlag::CHILDREN);
372 if (!xBeamerFrame.is())
373 return;
374
375// the beamer has been opened by the SfxViewFrame
376 Reference<XController> xController = xBeamerFrame->getController();
377 Reference<XSelectionSupplier> xControllerSelection(xController, UNO_QUERY);
378 if (xControllerSelection.is())
379 {
380
381 ODataAccessDescriptor aSelection;
382 aSelection.setDataSource(rData.sDataSource);
383 aSelection[DataAccessDescriptorProperty::Command] <<= rData.sCommand;
384 aSelection[DataAccessDescriptorProperty::CommandType] <<= rData.nCommandType;
385 xControllerSelection->select(Any(aSelection.createPropertyValueSequence()));
386 }
387 else {
388 OSL_FAIL("no selection supplier in the beamer!");
389 }
390}
391
393{
395 {
396 const SvtUserOptions& rOpt = GetUserOptions();
397 m_sActAuthor = rOpt.GetFullName();
398 if (m_sActAuthor.isEmpty())
399 {
400 m_sActAuthor = rOpt.GetID();
401 if (m_sActAuthor.isEmpty())
402 m_sActAuthor = SwResId( STR_REDLINE_UNKNOWN_AUTHOR );
403 }
405 }
407}
408
409void SwModule::SetRedlineAuthor(const OUString &rAuthor)
410{
412 m_sActAuthor = rAuthor;
414}
415
416OUString const & SwModule::GetRedlineAuthor(std::size_t nPos)
417{
418 OSL_ENSURE(nPos < m_pAuthorNames.size(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash
419 while(nPos >= m_pAuthorNames.size())
420 {
422 }
423 return m_pAuthorNames[nPos];
424}
425
427{
428 m_pAuthorNames.clear();
429}
430
431static Color lcl_GetAuthorColor(std::size_t nPos)
432{
433 static const Color aColArr[] =
434 {
438 };
439
440 return aColArr[nPos % SAL_N_ELEMENTS(aColArr)];
441}
442
445{
446 auto authorsNode = rJsonWriter.startArray("authors");
447 for (std::size_t nAuthor = 0; nAuthor < m_pAuthorNames.size(); ++nAuthor)
448 {
449 auto authorNode = rJsonWriter.startStruct();
450 rJsonWriter.put("index", static_cast<sal_Int64>(nAuthor));
451 rJsonWriter.put("name", m_pAuthorNames[nAuthor]);
452 rJsonWriter.put("color", sal_uInt32(lcl_GetAuthorColor(nAuthor)));
453 }
454}
455
456std::size_t SwModule::InsertRedlineAuthor(const OUString& rAuthor)
457{
458 std::size_t nPos = 0;
459
460 while(nPos < m_pAuthorNames.size() && m_pAuthorNames[nPos] != rAuthor)
461 ++nPos;
462
463 if (nPos == m_pAuthorNames.size())
464 m_pAuthorNames.push_back(rAuthor);
465
466 return nPos;
467}
468
469static void lcl_FillAuthorAttr( std::size_t nAuthor, SfxItemSet &rSet,
470 const AuthorCharAttr &rAttr )
471{
472 Color aCol( rAttr.m_nColor );
473
474 if( rAttr.m_nColor == COL_TRANSPARENT )
475 aCol = lcl_GetAuthorColor(nAuthor);
476
477 bool bBackGr = rAttr.m_nColor == COL_NONE_COLOR;
478
479 switch (rAttr.m_nItemId)
480 {
481 case SID_ATTR_CHAR_WEIGHT:
482 {
483 SvxWeightItem aW( static_cast<FontWeight>(rAttr.m_nAttr), RES_CHRATR_WEIGHT );
484 rSet.Put( aW );
485 aW.SetWhich( RES_CHRATR_CJK_WEIGHT );
486 rSet.Put( aW );
487 aW.SetWhich( RES_CHRATR_CTL_WEIGHT );
488 rSet.Put( aW );
489 }
490 break;
491
492 case SID_ATTR_CHAR_POSTURE:
493 {
494 SvxPostureItem aP( static_cast<FontItalic>(rAttr.m_nAttr), RES_CHRATR_POSTURE );
495 rSet.Put( aP );
496 aP.SetWhich( RES_CHRATR_CJK_POSTURE );
497 rSet.Put( aP );
498 aP.SetWhich( RES_CHRATR_CTL_POSTURE );
499 rSet.Put( aP );
500 }
501 break;
502
503 case SID_ATTR_CHAR_UNDERLINE:
504 rSet.Put( SvxUnderlineItem( static_cast<FontLineStyle>(rAttr.m_nAttr),
506 break;
507
508 case SID_ATTR_CHAR_STRIKEOUT:
509 rSet.Put(SvxCrossedOutItem( static_cast<FontStrikeout>(rAttr.m_nAttr),
511 break;
512
513 case SID_ATTR_CHAR_CASEMAP:
514 rSet.Put( SvxCaseMapItem( static_cast<SvxCaseMap>(rAttr.m_nAttr),
516 break;
517
518 case SID_ATTR_BRUSH:
520 bBackGr = true;
521 break;
522 }
523
524 if( !bBackGr )
526}
527
528void SwModule::GetInsertAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
529{
530 lcl_FillAuthorAttr(nAuthor, rSet, m_pModuleConfig->GetInsertAuthorAttr());
531}
532
533void SwModule::GetDeletedAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
534{
535 lcl_FillAuthorAttr(nAuthor, rSet, m_pModuleConfig->GetDeletedAuthorAttr());
536}
537
538// For future extension:
539void SwModule::GetFormatAuthorAttr( std::size_t nAuthor, SfxItemSet &rSet )
540{
541 lcl_FillAuthorAttr( nAuthor, rSet, m_pModuleConfig->GetFormatAuthorAttr() );
542}
543
545{
546 return m_pModuleConfig->GetMarkAlignMode();
547}
548
549bool SwModule::IsInsTableFormatNum(bool bHTML) const
550{
551 return m_pModuleConfig->IsInsTableFormatNum(bHTML);
552}
553
555{
556 return m_pModuleConfig->IsInsTableChangeNumFormat(bHTML);
557}
558
559bool SwModule::IsInsTableAlignNum(bool bHTML) const
560{
561 return m_pModuleConfig->IsInsTableAlignNum(bHTML);
562}
563
565{
566 return m_pModuleConfig->IsSplitVerticalByDefault(bHTML);
567}
568
569void SwModule::SetSplitVerticalByDefault(bool bHTML, bool value)
570{
571 m_pModuleConfig->SetSplitVerticalByDefault(bHTML, value);
572}
573
575{
576 return m_pModuleConfig->GetMarkAlignColor();
577}
578
580{
581 return GetUsrPref( bWeb );
582}
583
584OUString const & SwModule::GetDocStatWordDelim() const
585{
586 return m_pModuleConfig->GetWordDelimiter();
587}
588
589// Passing-through of the ModuleConfig's Metric (for HTML-Export)
591{
592 SwMasterUsrPref* pPref;
593 if(bWeb)
594 {
595 if(!m_pWebUsrPref)
596 GetUsrPref(true);
597 pPref = m_pWebUsrPref.get();
598 }
599 else
600 {
601 if(!m_pUsrPref)
602 GetUsrPref(false);
603 pPref = m_pUsrPref.get();
604 }
605 assert(pPref && "pPref is set by here");
606 return pPref->GetMetric();
607}
608
609// Pass-through Update-Status
610sal_uInt16 SwModule::GetLinkUpdMode() const
611{
612 if (!m_pUsrPref)
613 GetUsrPref(false);
614 assert(m_pUsrPref && "m_pUsrPref is set by here");
615 return o3tl::narrowing<sal_uInt16>(m_pUsrPref->GetUpdateLinkMode());
616}
617
619{
620 if (!m_pUsrPref)
621 GetUsrPref(false);
622 assert(m_pUsrPref && "m_pUsrPref is set by here");
623 return m_pUsrPref->GetFieldUpdateFlags();
624}
625
627{
628 if (!m_pUsrPref)
629 GetUsrPref(false);
630 assert(m_pUsrPref && "m_pUsrPref is set by here");
631 m_pUsrPref->SetFieldUpdateFlags(eFieldFlags);
632}
633
634void SwModule::ApplyLinkMode(sal_Int32 nNewLinkMode)
635{
636 if (!m_pUsrPref)
637 GetUsrPref(false);
638 assert(m_pUsrPref && "m_pUsrPref is set by here");
639 m_pUsrPref->SetUpdateLinkMode(nNewLinkMode);
640}
641
642void 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 return;
649
650 for( SwDocShell *pDocSh = static_cast<SwDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<SwDocShell>));
651 pDocSh;
652 pDocSh = static_cast<SwDocShell*>(SfxObjectShell::GetNext( *pDocSh, checkSfxObjectShell<SwDocShell> ) ) )
653 {
654 SwDoc* pTmp = pDocSh->GetDoc();
656 {
657 pTmp->SpellItAgainSam( bInvalid, bOnlyWrong, bSmartTags );
659 if ( bSmartTags && pViewShell && pViewShell->GetWin() )
660 pViewShell->GetWin()->Invalidate();
661 }
662 }
663}
664
665void SwModule::ApplyDefaultPageMode(bool bIsSquaredPageMode)
666{
667 if (!m_pUsrPref)
668 GetUsrPref(false);
669 assert(m_pUsrPref && "pPref is set by here");
670 m_pUsrPref->SetDefaultPageMode(bIsSquaredPageMode);
671}
672
674{
675 return m_pModuleConfig->GetCompareMode();
676}
677
679{
680 return m_pModuleConfig->IsUseRsid();
681}
682
684{
685 return m_pModuleConfig->IsIgnorePieces();
686}
687
688sal_uInt16 SwModule::GetPieceLen() const
689{
690 return m_pModuleConfig->GetPieceLen();
691}
692
693/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 m_nAttr
Definition: authratr.hxx:30
Color m_nColor
Definition: authratr.hxx:31
sal_uInt16 m_nItemId
Definition: authratr.hxx:29
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
bool IsReadOnly() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
SfxFrame & GetFrame() const
void InvalidateBorder()
SfxViewFrame & GetViewFrame() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
OUString GetFullName() const
OUString GetID() const
Definition: doc.hxx:197
void SpellItAgainSam(bool bInvalid, bool bOnlyWrong, bool bSmartTags)
Re-trigger spelling in the idle handler.
Definition: doc.cxx:1197
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
bool IsVScrollMetric() const
Definition: usrpref.hxx:224
FieldUnit GetHScrollMetric() const
Definition: usrpref.hxx:217
void SetUsrPref(const SwViewOption &rCopy)
Definition: usrpref.cxx:37
FieldUnit GetMetric() const
Definition: usrpref.hxx:208
void SetVScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:226
void SetMetric(FieldUnit eSet, bool bNoModify=false)
Definition: usrpref.hxx:209
void SetApplyCharUnit(bool bSet, bool noModify=false)
Definition: usrpref.hxx:236
bool IsHScrollMetric() const
Definition: usrpref.hxx:216
FieldUnit GetVScrollMetric() const
Definition: usrpref.hxx:225
void SetModified()
Definition: usrpref.hxx:157
bool IsApplyCharUnit() const
Definition: usrpref.hxx:232
void SetHScrollMetric(FieldUnit eSet)
Definition: usrpref.hxx:218
static void CheckSpellChanges(bool bOnlineSpelling, bool bIsSpellWrongAgain, bool bIsSpellAllAgain, bool bSmartTags)
Definition: swmodul1.cxx:642
std::size_t InsertRedlineAuthor(const OUString &rAuthor)
Definition: swmodul1.cxx:456
static SwView * GetNextView(SwView const *)
Definition: swmodul1.cxx:128
void GetInsertAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
Definition: swmodul1.cxx:528
bool IsInsTableChangeNumFormat(bool bHTML) const
Definition: swmodul1.cxx:554
std::unique_ptr< SwPrintOptions > m_pWebPrintOptions
Definition: swmodule.hxx:83
SwCompareMode GetCompareMode() const
Definition: swmodul1.cxx:673
const SwViewOption * GetViewOption(bool bWeb)
Definition: swmodul1.cxx:579
std::size_t GetRedlineAuthor()
Definition: swmodul1.cxx:392
SvtUserOptions & GetUserOptions()
Definition: apphdl.cxx:1066
SwFieldUpdateFlags GetFieldUpdateFlags() const
Definition: swmodul1.cxx:618
std::unique_ptr< SwNavigationConfig > m_pNavigationConfig
Definition: swmodule.hxx:86
void ApplyRulerMetric(FieldUnit eMetric, bool bHorizontal, bool bWeb)
Definition: swmodul1.cxx:241
OUString const & GetDocStatWordDelim() const
Definition: swmodul1.cxx:584
void ApplyFieldUpdateFlags(SwFieldUpdateFlags eFieldFlags)
Definition: swmodul1.cxx:626
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
Definition: apphdl.cxx:1076
static SwView * GetFirstView()
Definition: swmodul1.cxx:121
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pWebUsrPref
Definition: swmodule.hxx:81
void GetDeletedAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
Definition: swmodul1.cxx:533
bool IsUseRsid() const
Definition: swmodul1.cxx:678
FieldUnit GetMetric(bool bWeb) const
Definition: swmodul1.cxx:590
bool m_bAuthorInitialised
Definition: swmodule.hxx:112
void SetSplitVerticalByDefault(bool bHTML, bool value)
Definition: swmodul1.cxx:569
sal_uInt16 GetLinkUpdMode() const
Definition: swmodul1.cxx:610
OUString m_sActAuthor
Definition: swmodule.hxx:76
bool IsSplitVerticalByDefault(bool bHTML) const
Definition: swmodul1.cxx:564
SwChapterNumRules * GetChapterNumRules()
Definition: swmodul1.cxx:360
void GetRedlineAuthorInfo(tools::JsonWriter &rJsonWriter)
See SwXTextDocument::getTrackedChangeAuthors().
Definition: swmodul1.cxx:444
bool IsInsTableAlignNum(bool bHTML) const
Definition: swmodul1.cxx:559
SwPrintOptions * GetPrtOptions(bool bWeb)
Definition: swmodul1.cxx:346
sal_uInt16 GetPieceLen() const
Definition: swmodul1.cxx:688
std::vector< OUString > m_pAuthorNames
Definition: swmodule.hxx:105
void ApplyDefaultPageMode(bool bIsSquaredPageMode)
Definition: swmodul1.cxx:665
void ApplyUserMetric(FieldUnit eMetric, bool bWeb)
Definition: swmodul1.cxx:204
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pUsrPref
Definition: swmodule.hxx:80
void ApplyUsrPref(const SwViewOption &, SwView *, SvViewOpt nDest=SvViewOpt::DestView)
Definition: swmodul1.cxx:136
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
Definition: swmodul1.cxx:367
std::unique_ptr< SwModuleOptions, o3tl::default_delete< SwModuleOptions > > m_pModuleConfig
Definition: swmodule.hxx:79
void GetFormatAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
Definition: swmodul1.cxx:539
SwNavigationConfig * GetNavigationConfig()
Definition: swmodul1.cxx:337
bool IsIgnorePieces() const
Definition: swmodul1.cxx:683
void ApplyUserCharUnit(bool bApplyChar, bool bWeb)
Definition: swmodul1.cxx:278
std::unique_ptr< SwPrintOptions > m_pPrintOptions
Definition: swmodule.hxx:82
sal_uInt16 GetRedlineMarkPos() const
Definition: swmodul1.cxx:544
void SetRedlineAuthor(const OUString &rAuthor)
Definition: swmodul1.cxx:409
bool IsInsTableFormatNum(bool bHTML) const
Definition: swmodul1.cxx:549
void ClearRedlineAuthors()
Definition: swmodul1.cxx:426
void ApplyLinkMode(sal_Int32 nNewLinkMode)
Definition: swmodul1.cxx:634
const Color & GetRedlineMarkColor() const
Definition: swmodul1.cxx:574
std::unique_ptr< SwChapterNumRules > m_pChapterNumRules
Definition: swmodule.hxx:84
View of a document.
Definition: pview.hxx:162
void EnableHScrollbar(bool bEnable)
Definition: pview.cxx:1860
void EnableVScrollbar(bool bEnable)
Definition: pview.cxx:1869
void PrepareView(bool bIgnoreCount=false)
Definition: PostItMgr.cxx:1928
bool IsViewHRuler(bool bDirect=false) const
Definition: viewopt.hxx:756
void SetIdle(bool b) const
Definition: viewopt.hxx:339
bool IsReadonly() const
Definition: viewopt.hxx:627
bool IsVRulerRight() const
Definition: viewopt.hxx:791
void SetPagePrevCol(sal_uInt8 n)
Definition: viewopt.hxx:626
sal_uInt8 GetPagePrevCol() const
Definition: viewopt.hxx:625
sal_uInt8 GetPagePrevRow() const
Definition: viewopt.hxx:623
void SetPagePrevRow(sal_uInt8 n)
Definition: viewopt.hxx:624
bool IsViewHScrollBar() const
Definition: viewopt.hxx:691
bool getBrowseMode() const
Definition: viewopt.hxx:636
bool IsViewVRuler(bool bDirect=false) const
Definition: viewopt.hxx:770
bool IsViewVScrollBar() const
Definition: viewopt.hxx:683
void SetUIOptions(const SwViewOption &)
Definition: viewopt.hxx:860
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:452
void StartAction()
Definition: viewsh.hxx:619
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2205
void EndAction(const bool bIdleEnd=false)
Definition: viewsh.hxx:625
vcl::Window * GetWin() const
Definition: viewsh.hxx:364
virtual void SetReadonlyOption(bool bSet)
Definition: viewsh.cxx:2476
void SetUIOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2465
Definition: view.hxx:146
SwWrtShell & GetWrtShell() const
Definition: view.hxx:423
void CreateVRuler()
Definition: viewmdi.cxx:689
void EnableVScrollbar(bool bEnable)
Definition: viewmdi.cxx:782
void CreateTab()
Definition: viewmdi.cxx:647
void EnableHScrollbar(bool bEnable)
Definition: viewmdi.cxx:773
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:650
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:670
void KillTab()
Definition: viewmdi.cxx:655
SwDocShell * GetDocShell()
Definition: view.cxx:1193
void KillVRuler()
Definition: viewmdi.cxx:698
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:661
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
void put(std::u16string_view pPropName, const OUString &rPropValue)
ScopedJsonWriterStruct startStruct()
ScopedJsonWriterArray startArray(std::string_view)
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
constexpr ::Color COL_AUTHOR9_DARK(0xD1, 0x76, 0x00)
constexpr ::Color COL_AUTHOR8_DARK(0x35, 0x55, 0x6B)
constexpr ::Color COL_AUTHOR2_DARK(0x06, 0x46, 0xA2)
constexpr ::Color COL_AUTHOR3_DARK(0x57, 0x9D, 0x1C)
constexpr ::Color COL_AUTHOR6_DARK(0x00, 0x80, 0x80)
constexpr ::Color COL_AUTHOR7_DARK(0x8C, 0x84, 0x00)
constexpr ::Color COL_AUTHOR5_DARK(0xC5, 0x00, 0x0B)
constexpr ::Color COL_AUTHOR4_DARK(0x69, 0x2B, 0x9D)
constexpr ::Color COL_AUTHOR1_DARK(0xC6, 0x92, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define COL_NONE_COLOR
Any value
FieldUnit
SwFieldUpdateFlags
Definition: fldupde.hxx:23
FontLineStyle
FontStrikeout
FontItalic
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
sal_uInt16 nPos
#define SAL_N_ELEMENTS(arr)
SwCompareMode
Definition: modcfg.hxx:88
bool IsAsianTypographyEnabled()
FontWeight
static SfxItemSet & rSet
sal_Int32 nCommandType
Definition: swdbdata.hxx:32
OUString sDataSource
Definition: swdbdata.hxx:30
OUString sCommand
Definition: swdbdata.hxx:31
Reference< XController > xController
Reference< XFrame > xFrame
SvxCaseMap
SwView * GetActiveView()
Definition: swmodul1.cxx:115
static Color lcl_GetAuthorColor(std::size_t nPos)
Definition: swmodul1.cxx:431
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
static void lcl_FillAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet, const AuthorCharAttr &rAttr)
Definition: swmodul1.cxx:469
static void lcl_SetUIPrefs(const SwViewOption &rPref, SwView *pView, SwViewShell *pSh)
Definition: swmodul1.cxx:70
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
SvViewOpt
Definition: swmodule.hxx:62