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 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.
137void 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
205void 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 assert(pPref && "pPref is set by here");
221 FieldUnit eOldMetric = pPref->GetMetric();
222 if(eOldMetric != eMetric)
223 pPref->SetMetric(eMetric);
224
225 FieldUnit eHScrollMetric = pPref->IsHScrollMetric() ? pPref->GetHScrollMetric() : eMetric;
226 FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : eMetric;
227
228 SwView* pTmpView = SwModule::GetFirstView();
229 // switch the ruler for all MDI-Windows
230 while(pTmpView)
231 {
232 if(bWeb == (dynamic_cast<SwWebView*>( pTmpView) != nullptr) )
233 {
234 pTmpView->ChangeVRulerMetric(eVScrollMetric);
235 pTmpView->ChangeTabMetric(eHScrollMetric);
236 }
237
238 pTmpView = SwModule::GetNextView(pTmpView);
239 }
240}
241
242void SwModule::ApplyRulerMetric( FieldUnit eMetric, bool bHorizontal, bool bWeb )
243{
244 SwMasterUsrPref* pPref;
245 if(bWeb)
246 {
247 if(!m_pWebUsrPref)
248 GetUsrPref(true);
249 pPref = m_pWebUsrPref.get();
250 }
251 else
252 {
253 if(!m_pUsrPref)
254 GetUsrPref(false);
255 pPref = m_pUsrPref.get();
256 }
257 assert(pPref && "pPref will be set by now");
258 if( bHorizontal )
259 pPref->SetHScrollMetric(eMetric);
260 else
261 pPref->SetVScrollMetric(eMetric);
262
263 SwView* pTmpView = SwModule::GetFirstView();
264 // switch metric at the appropriate rulers
265 while(pTmpView)
266 {
267 if(bWeb == (dynamic_cast<SwWebView *>( pTmpView ) != nullptr))
268 {
269 if( bHorizontal )
270 pTmpView->ChangeTabMetric(eMetric);
271 else
272 pTmpView->ChangeVRulerMetric(eMetric);
273 }
274 pTmpView = SwModule::GetNextView(pTmpView);
275 }
276}
277
278//set the usrpref 's char unit attribute and set rulers unit as char if the "apply char unit" is checked
279void SwModule::ApplyUserCharUnit(bool bApplyChar, bool bWeb)
280{
281 SwMasterUsrPref* pPref;
282 if(bWeb)
283 {
284 if(!m_pWebUsrPref)
285 GetUsrPref(true);
286 pPref = m_pWebUsrPref.get();
287 }
288 else
289 {
290 if(!m_pUsrPref)
291 GetUsrPref(false);
292 pPref = m_pUsrPref.get();
293 }
294 assert(pPref && "pPref is set by here");
295 bool bOldApplyCharUnit = pPref->IsApplyCharUnit();
296 bool bHasChanged = false;
297 if(bOldApplyCharUnit != bApplyChar)
298 {
299 pPref->SetApplyCharUnit(bApplyChar);
300 bHasChanged = true;
301 }
302
303 if( !bHasChanged )
304 return;
305
306 FieldUnit eHScrollMetric = pPref->IsHScrollMetric() ? pPref->GetHScrollMetric() : pPref->GetMetric();
307 FieldUnit eVScrollMetric = pPref->IsVScrollMetric() ? pPref->GetVScrollMetric() : pPref->GetMetric();
308 if(bApplyChar)
309 {
310 eHScrollMetric = FieldUnit::CHAR;
311 eVScrollMetric = FieldUnit::LINE;
312 }
313 else
314 {
315 if ( !SvtCJKOptions::IsAsianTypographyEnabled() && ( eHScrollMetric == FieldUnit::CHAR ))
316 eHScrollMetric = FieldUnit::INCH;
317 else if ( eHScrollMetric == FieldUnit::CHAR )
318 eHScrollMetric = FieldUnit::CM;
319 if ( !SvtCJKOptions::IsAsianTypographyEnabled() && ( eVScrollMetric == FieldUnit::LINE ))
320 eVScrollMetric = FieldUnit::INCH;
321 else if ( eVScrollMetric == FieldUnit::LINE )
322 eVScrollMetric = FieldUnit::CM;
323 }
324 SwView* pTmpView = SwModule::GetFirstView();
325 // switch rulers for all MDI-Windows
326 while(pTmpView)
327 {
328 if(bWeb == (dynamic_cast<SwWebView*>( pTmpView) != nullptr) )
329 {
330 pTmpView->ChangeVRulerMetric(eVScrollMetric);
331 pTmpView->ChangeTabMetric(eHScrollMetric);
332 }
333
334 pTmpView = SwModule::GetNextView(pTmpView);
335 }
336}
337
339{
341 {
343 }
344 return m_pNavigationConfig.get();
345}
346
348{
349 if(bWeb && !m_pWebPrintOptions)
350 {
351 m_pWebPrintOptions.reset(new SwPrintOptions(true));
352 }
353 else if(!bWeb && !m_pPrintOptions)
354 {
355 m_pPrintOptions.reset(new SwPrintOptions(false));
356 }
357
358 return bWeb ? m_pWebPrintOptions.get() : m_pPrintOptions.get();
359}
360
362{
365 return m_pChapterNumRules.get();
366}
367
368void SwModule::ShowDBObj(SwView const & rView, const SwDBData& rData)
369{
370 Reference<XFrame> xFrame = rView.GetViewFrame()->GetFrame().GetFrameInterface();
371
372 uno::Reference<XFrame> xBeamerFrame = xFrame->findFrame("_beamer", FrameSearchFlag::CHILDREN);
373 if (!xBeamerFrame.is())
374 return;
375
376// the beamer has been opened by the SfxViewFrame
377 Reference<XController> xController = xBeamerFrame->getController();
378 Reference<XSelectionSupplier> xControllerSelection(xController, UNO_QUERY);
379 if (xControllerSelection.is())
380 {
381
382 ODataAccessDescriptor aSelection;
383 aSelection.setDataSource(rData.sDataSource);
384 aSelection[DataAccessDescriptorProperty::Command] <<= rData.sCommand;
385 aSelection[DataAccessDescriptorProperty::CommandType] <<= rData.nCommandType;
386 xControllerSelection->select(Any(aSelection.createPropertyValueSequence()));
387 }
388 else {
389 OSL_FAIL("no selection supplier in the beamer!");
390 }
391}
392
394{
396 {
397 const SvtUserOptions& rOpt = GetUserOptions();
398 m_sActAuthor = rOpt.GetFullName();
399 if (m_sActAuthor.isEmpty())
400 {
401 m_sActAuthor = rOpt.GetID();
402 if (m_sActAuthor.isEmpty())
403 m_sActAuthor = SwResId( STR_REDLINE_UNKNOWN_AUTHOR );
404 }
406 }
408}
409
410void SwModule::SetRedlineAuthor(const OUString &rAuthor)
411{
413 m_sActAuthor = rAuthor;
415}
416
417OUString const & SwModule::GetRedlineAuthor(std::size_t nPos)
418{
419 OSL_ENSURE(nPos < m_pAuthorNames.size(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash
420 while(nPos >= m_pAuthorNames.size())
421 {
423 }
424 return m_pAuthorNames[nPos];
425}
426
428{
429 m_pAuthorNames.clear();
430}
431
432static Color lcl_GetAuthorColor(std::size_t nPos)
433{
434 static const Color aColArr[] =
435 {
439 };
440
441 return aColArr[nPos % SAL_N_ELEMENTS(aColArr)];
442}
443
446{
447 auto authorsNode = rJsonWriter.startArray("authors");
448 for (std::size_t nAuthor = 0; nAuthor < m_pAuthorNames.size(); ++nAuthor)
449 {
450 auto authorNode = rJsonWriter.startStruct();
451 rJsonWriter.put("index", static_cast<sal_Int64>(nAuthor));
452 rJsonWriter.put("name", m_pAuthorNames[nAuthor]);
453 rJsonWriter.put("color", sal_uInt32(lcl_GetAuthorColor(nAuthor)));
454 }
455}
456
457std::size_t SwModule::InsertRedlineAuthor(const OUString& rAuthor)
458{
459 std::size_t nPos = 0;
460
461 while(nPos < m_pAuthorNames.size() && m_pAuthorNames[nPos] != rAuthor)
462 ++nPos;
463
464 if (nPos == m_pAuthorNames.size())
465 m_pAuthorNames.push_back(rAuthor);
466
467 return nPos;
468}
469
470static void lcl_FillAuthorAttr( std::size_t nAuthor, SfxItemSet &rSet,
471 const AuthorCharAttr &rAttr )
472{
473 Color aCol( rAttr.m_nColor );
474
475 if( rAttr.m_nColor == COL_TRANSPARENT )
476 aCol = lcl_GetAuthorColor(nAuthor);
477
478 bool bBackGr = rAttr.m_nColor == COL_NONE_COLOR;
479
480 switch (rAttr.m_nItemId)
481 {
482 case SID_ATTR_CHAR_WEIGHT:
483 {
484 SvxWeightItem aW( static_cast<FontWeight>(rAttr.m_nAttr), RES_CHRATR_WEIGHT );
485 rSet.Put( aW );
486 aW.SetWhich( RES_CHRATR_CJK_WEIGHT );
487 rSet.Put( aW );
488 aW.SetWhich( RES_CHRATR_CTL_WEIGHT );
489 rSet.Put( aW );
490 }
491 break;
492
493 case SID_ATTR_CHAR_POSTURE:
494 {
495 SvxPostureItem aP( static_cast<FontItalic>(rAttr.m_nAttr), RES_CHRATR_POSTURE );
496 rSet.Put( aP );
497 aP.SetWhich( RES_CHRATR_CJK_POSTURE );
498 rSet.Put( aP );
499 aP.SetWhich( RES_CHRATR_CTL_POSTURE );
500 rSet.Put( aP );
501 }
502 break;
503
504 case SID_ATTR_CHAR_UNDERLINE:
505 rSet.Put( SvxUnderlineItem( static_cast<FontLineStyle>(rAttr.m_nAttr),
507 break;
508
509 case SID_ATTR_CHAR_STRIKEOUT:
510 rSet.Put(SvxCrossedOutItem( static_cast<FontStrikeout>(rAttr.m_nAttr),
512 break;
513
514 case SID_ATTR_CHAR_CASEMAP:
515 rSet.Put( SvxCaseMapItem( static_cast<SvxCaseMap>(rAttr.m_nAttr),
517 break;
518
519 case SID_ATTR_BRUSH:
521 bBackGr = true;
522 break;
523 }
524
525 if( !bBackGr )
527}
528
529void SwModule::GetInsertAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
530{
531 lcl_FillAuthorAttr(nAuthor, rSet, m_pModuleConfig->GetInsertAuthorAttr());
532}
533
534void SwModule::GetDeletedAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
535{
536 lcl_FillAuthorAttr(nAuthor, rSet, m_pModuleConfig->GetDeletedAuthorAttr());
537}
538
539// For future extension:
540void SwModule::GetFormatAuthorAttr( std::size_t nAuthor, SfxItemSet &rSet )
541{
542 lcl_FillAuthorAttr( nAuthor, rSet, m_pModuleConfig->GetFormatAuthorAttr() );
543}
544
546{
547 return m_pModuleConfig->GetMarkAlignMode();
548}
549
550bool SwModule::IsInsTableFormatNum(bool bHTML) const
551{
552 return m_pModuleConfig->IsInsTableFormatNum(bHTML);
553}
554
556{
557 return m_pModuleConfig->IsInsTableChangeNumFormat(bHTML);
558}
559
560bool SwModule::IsInsTableAlignNum(bool bHTML) const
561{
562 return m_pModuleConfig->IsInsTableAlignNum(bHTML);
563}
564
566{
567 return m_pModuleConfig->IsSplitVerticalByDefault(bHTML);
568}
569
570void SwModule::SetSplitVerticalByDefault(bool bHTML, bool value)
571{
572 m_pModuleConfig->SetSplitVerticalByDefault(bHTML, value);
573}
574
576{
577 return m_pModuleConfig->GetMarkAlignColor();
578}
579
581{
582 return GetUsrPref( bWeb );
583}
584
585OUString const & SwModule::GetDocStatWordDelim() const
586{
587 return m_pModuleConfig->GetWordDelimiter();
588}
589
590// Passing-through of the ModuleConfig's Metric (for HTML-Export)
592{
593 SwMasterUsrPref* pPref;
594 if(bWeb)
595 {
596 if(!m_pWebUsrPref)
597 GetUsrPref(true);
598 pPref = m_pWebUsrPref.get();
599 }
600 else
601 {
602 if(!m_pUsrPref)
603 GetUsrPref(false);
604 pPref = m_pUsrPref.get();
605 }
606 assert(pPref && "pPref is set by here");
607 return pPref->GetMetric();
608}
609
610// Pass-through Update-Status
611sal_uInt16 SwModule::GetLinkUpdMode() const
612{
613 if (!m_pUsrPref)
614 GetUsrPref(false);
615 assert(m_pUsrPref && "m_pUsrPref is set by here");
616 return o3tl::narrowing<sal_uInt16>(m_pUsrPref->GetUpdateLinkMode());
617}
618
620{
621 if (!m_pUsrPref)
622 GetUsrPref(false);
623 assert(m_pUsrPref && "m_pUsrPref is set by here");
624 return m_pUsrPref->GetFieldUpdateFlags();
625}
626
628{
629 if (!m_pUsrPref)
630 GetUsrPref(false);
631 assert(m_pUsrPref && "m_pUsrPref is set by here");
632 m_pUsrPref->SetFieldUpdateFlags(eFieldFlags);
633}
634
635void SwModule::ApplyLinkMode(sal_Int32 nNewLinkMode)
636{
637 if (!m_pUsrPref)
638 GetUsrPref(false);
639 assert(m_pUsrPref && "m_pUsrPref is set by here");
640 m_pUsrPref->SetUpdateLinkMode(nNewLinkMode);
641}
642
643void SwModule::CheckSpellChanges( bool bOnlineSpelling,
644 bool bIsSpellWrongAgain, bool bIsSpellAllAgain, bool bSmartTags )
645{
646 bool bOnlyWrong = bIsSpellWrongAgain && !bIsSpellAllAgain;
647 bool bInvalid = bOnlyWrong || bIsSpellAllAgain;
648 if( !(bOnlineSpelling || bInvalid) )
649 return;
650
651 for( SwDocShell *pDocSh = static_cast<SwDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<SwDocShell>));
652 pDocSh;
653 pDocSh = static_cast<SwDocShell*>(SfxObjectShell::GetNext( *pDocSh, checkSfxObjectShell<SwDocShell> ) ) )
654 {
655 SwDoc* pTmp = pDocSh->GetDoc();
657 {
658 pTmp->SpellItAgainSam( bInvalid, bOnlyWrong, bSmartTags );
660 if ( bSmartTags && pViewShell && pViewShell->GetWin() )
661 pViewShell->GetWin()->Invalidate();
662 }
663 }
664}
665
666void SwModule::ApplyDefaultPageMode(bool bIsSquaredPageMode)
667{
668 if (!m_pUsrPref)
669 GetUsrPref(false);
670 assert(m_pUsrPref && "pPref is set by here");
671 m_pUsrPref->SetDefaultPageMode(bIsSquaredPageMode);
672}
673
675{
676 return m_pModuleConfig->GetCompareMode();
677}
678
680{
681 return m_pModuleConfig->IsUseRsid();
682}
683
685{
686 return m_pModuleConfig->IsIgnorePieces();
687}
688
689sal_uInt16 SwModule::GetPieceLen() const
690{
691 return m_pModuleConfig->GetPieceLen();
692}
693
694/* 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 SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
bool IsReadOnly() const
static SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
SfxFrame & GetFrame() const
void InvalidateBorder()
static SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
SfxViewFrame * GetViewFrame() const
static SfxViewShell * Current()
OUString GetFullName() const
OUString GetID() const
Definition: doc.hxx:194
void SpellItAgainSam(bool bInvalid, bool bOnlyWrong, bool bSmartTags)
Re-trigger spelling in the idle handler.
Definition: doc.cxx:1166
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:411
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:643
std::size_t InsertRedlineAuthor(const OUString &rAuthor)
Definition: swmodul1.cxx:457
static SwView * GetNextView(SwView const *)
Definition: swmodul1.cxx:129
void GetInsertAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet)
Definition: swmodul1.cxx:529
bool IsInsTableChangeNumFormat(bool bHTML) const
Definition: swmodul1.cxx:555
std::unique_ptr< SwPrintOptions > m_pWebPrintOptions
Definition: swmodule.hxx:83
SwCompareMode GetCompareMode() const
Definition: swmodul1.cxx:674
const SwViewOption * GetViewOption(bool bWeb)
Definition: swmodul1.cxx:580
std::size_t GetRedlineAuthor()
Definition: swmodul1.cxx:393
SvtUserOptions & GetUserOptions()
Definition: apphdl.cxx:1073
SwFieldUpdateFlags GetFieldUpdateFlags() const
Definition: swmodul1.cxx:619
std::unique_ptr< SwNavigationConfig > m_pNavigationConfig
Definition: swmodule.hxx:86
void ApplyRulerMetric(FieldUnit eMetric, bool bHorizontal, bool bWeb)
Definition: swmodul1.cxx:242
OUString const & GetDocStatWordDelim() const
Definition: swmodul1.cxx:585
void ApplyFieldUpdateFlags(SwFieldUpdateFlags eFieldFlags)
Definition: swmodul1.cxx:627
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
Definition: apphdl.cxx:1083
static SwView * GetFirstView()
Definition: swmodul1.cxx:122
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:534
bool IsUseRsid() const
Definition: swmodul1.cxx:679
FieldUnit GetMetric(bool bWeb) const
Definition: swmodul1.cxx:591
bool m_bAuthorInitialised
Definition: swmodule.hxx:112
void SetSplitVerticalByDefault(bool bHTML, bool value)
Definition: swmodul1.cxx:570
sal_uInt16 GetLinkUpdMode() const
Definition: swmodul1.cxx:611
OUString m_sActAuthor
Definition: swmodule.hxx:76
bool IsSplitVerticalByDefault(bool bHTML) const
Definition: swmodul1.cxx:565
SwChapterNumRules * GetChapterNumRules()
Definition: swmodul1.cxx:361
void GetRedlineAuthorInfo(tools::JsonWriter &rJsonWriter)
See SwXTextDocument::getTrackedChangeAuthors().
Definition: swmodul1.cxx:445
bool IsInsTableAlignNum(bool bHTML) const
Definition: swmodul1.cxx:560
SwPrintOptions * GetPrtOptions(bool bWeb)
Definition: swmodul1.cxx:347
sal_uInt16 GetPieceLen() const
Definition: swmodul1.cxx:689
std::vector< OUString > m_pAuthorNames
Definition: swmodule.hxx:105
void ApplyDefaultPageMode(bool bIsSquaredPageMode)
Definition: swmodul1.cxx:666
void ApplyUserMetric(FieldUnit eMetric, bool bWeb)
Definition: swmodul1.cxx:205
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:137
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
Definition: swmodul1.cxx:368
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:540
SwNavigationConfig * GetNavigationConfig()
Definition: swmodul1.cxx:338
bool IsIgnorePieces() const
Definition: swmodul1.cxx:684
void ApplyUserCharUnit(bool bApplyChar, bool bWeb)
Definition: swmodul1.cxx:279
std::unique_ptr< SwPrintOptions > m_pPrintOptions
Definition: swmodule.hxx:82
sal_uInt16 GetRedlineMarkPos() const
Definition: swmodul1.cxx:545
void SetRedlineAuthor(const OUString &rAuthor)
Definition: swmodul1.cxx:410
bool IsInsTableFormatNum(bool bHTML) const
Definition: swmodul1.cxx:550
void ClearRedlineAuthors()
Definition: swmodul1.cxx:427
void ApplyLinkMode(sal_Int32 nNewLinkMode)
Definition: swmodul1.cxx:635
const Color & GetRedlineMarkColor() const
Definition: swmodul1.cxx:575
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:1854
void EnableVScrollbar(bool bEnable)
Definition: pview.cxx:1863
void PrepareView(bool bIgnoreCount=false)
Definition: PostItMgr.cxx:1934
bool IsViewHRuler(bool bDirect=false) const
Definition: viewopt.hxx:700
void SetIdle(bool b) const
Definition: viewopt.hxx:283
bool IsReadonly() const
Definition: viewopt.hxx:571
bool IsVRulerRight() const
Definition: viewopt.hxx:735
void SetPagePrevCol(sal_uInt8 n)
Definition: viewopt.hxx:570
sal_uInt8 GetPagePrevCol() const
Definition: viewopt.hxx:569
sal_uInt8 GetPagePrevRow() const
Definition: viewopt.hxx:567
void SetPagePrevRow(sal_uInt8 n)
Definition: viewopt.hxx:568
bool IsViewHScrollBar() const
Definition: viewopt.hxx:635
bool getBrowseMode() const
Definition: viewopt.hxx:580
bool IsViewVRuler(bool bDirect=false) const
Definition: viewopt.hxx:714
bool IsViewVScrollBar() const
Definition: viewopt.hxx:627
void SetUIOptions(const SwViewOption &)
Definition: viewopt.hxx:804
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:433
void StartAction()
Definition: viewsh.hxx:602
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2202
void EndAction(const bool bIdleEnd=false)
Definition: viewsh.hxx:607
vcl::Window * GetWin() const
Definition: viewsh.hxx:346
virtual void SetReadonlyOption(bool bSet)
Definition: viewsh.cxx:2462
void SetUIOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2451
Definition: view.hxx:146
SwWrtShell & GetWrtShell() const
Definition: view.hxx:416
void CreateVRuler()
Definition: viewmdi.cxx:662
void EnableVScrollbar(bool bEnable)
Definition: viewmdi.cxx:755
void CreateTab()
Definition: viewmdi.cxx:620
void EnableHScrollbar(bool bEnable)
Definition: viewmdi.cxx:746
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:642
void ChangeVRulerMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:643
void KillTab()
Definition: viewmdi.cxx:628
SwDocShell * GetDocShell()
Definition: view.cxx:1160
void KillVRuler()
Definition: viewmdi.cxx:671
void ChangeTabMetric(FieldUnit eUnit)
Definition: viewmdi.cxx:634
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
void put(const char *pPropName, const OUString &rPropValue)
ScopedJsonWriterArray startArray(const char *)
ScopedJsonWriterStruct startStruct()
virtual 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:116
static Color lcl_GetAuthorColor(std::size_t nPos)
Definition: swmodul1.cxx:432
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
static void lcl_FillAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet, const AuthorCharAttr &rAttr)
Definition: swmodul1.cxx:470
static void lcl_SetUIPrefs(const SwViewOption &rPref, SwView *pView, SwViewShell *pSh)
Definition: swmodul1.cxx:70
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
SvViewOpt
Definition: swmodule.hxx:62